java

Getting to Guice created objects from dumb data objects

I've taken the plunge and used Guice for my latest project. Overall impressions are good, but I've hit an issue that I can't quite get my head around. Background: It's a Java6 application that accepts commands over a network, parses those commands, and then uses them to modify some internal data structures. It's a simulator for some har...

javax.net.ssl.SSLException when sending mail using JavaMail

javax.mail.MessagingException: Exception reading response; nested exception is: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection? at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:1764) at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1523) ...

Add and subtract two integers without using the + or - operators in java

how can add two number without using + or - operators in java.. I have found one link for the same in c. http://prokutfaq.byethost15.com/AddTwoNumbersWithoutArithmetic But, i am not able to implement in java. Please help me. ...

Attach the Java Source Code

I cannot for the life of me attach the java source code to eclipse so I can see the inner workings of the language. Not even something as simple as the String Class. when I run java -version this is what I have: java version "1.6.0_14" Java(TM) SE Runtime Environment (build 1.6.0_14-b08) Java HotSpot(TM) Client VM (build 14.0-b16, mixe...

Java/Ruby based IMAP proxy library

I'm looking to create an IMAP proxy to a custom back-end mail and document storage engine and was wondering if there are already any production-ready, stable libraries I can pull on for interacting with the client via IMAP so I just have to write the backend code for mailboxes, listing, retrieving messages, etc. ...

Debugging a JLink application in Pro-Engineer

I'm trying to use J-Link, the Java language toolkit for Pro-Engineer. I haven't yet found a way to debug or trace through J-Link applications, something that I need to do to understand the sample applications. The manual recommends attaching a debugger to the the process that was started by Pro-Engineer, which doesn't seem to be workin...

How to map enum in JNA

Hi, I have the following enum how do i map in jna ?? This enum is further referenced in structure. typedef enum { eFtUsbDeviceNotShared, eFtUsbDeviceSharedActive, eFtUsbDeviceSharedNotActive, eFtUsbDeviceSharedNotPlugged, eFtUsbDeviceSharedProblem } eFtUsbDeviceStatus; Abdul Khaliq ...

SimpleJdbcTemplate and null parameters

I'm using SimpleJdbcTemplate and MapSqlParameterSource in the folowing way: MapSqlParameterSource parameterSource = new MapSqlParameterSource(); parameterSource.addValue("typeId", typeId, Types.BIGINT); List<Long> ids = _jdbcTemplate.query(_selectIdByParameters, new EntityIdRowMapper(), parameterSource); When typeId ( which is a Long...

How to intall Tomcat as a daemon on OS X?

How do I install Tomcat as a daemon on OS X? It should run even when a user is not logged on. I could probably survive installing Tomcat for a single users and having it run at log in, for now. But long term I need it installed and running as a service on boot. ...

jsf: iterate in jsp

Hi! I am using jsf framework and want to iterate a list of Integers in jsp. The result should look something like the following: 1 2 3 4. The tags datascroller and datalist does not work in my case and it seems like jsf isnt very compatible with jstl tags. It stumbled upon x:iterator and x:forEach tag but didnt get it to work (actual...

Adventures of a Web Programmer in Applicationland (or, Practical Java Help Needed)

Alright, so I am a compsci college student who, being in college, has not branched out towards a certain specialization yet. I have been programming since I was a young teenager, certainly know my stuff - well versed in about eight different languages as well as compsci theory, etc. In addition, I have about four years of web programming...

JDBC Connection closed by peer (weird)

Hi all, I'm facing sort of a strange issue with two applications of mine. Here's the setting: Two tomcat / java apps, running in the same network, connecting to the same MS-SQL-Server. The one app, which happens to be in an DMZ in order to be accessible from the internet uses to produce "jdbc Connection closed by peer" exceptions in un...

How to generate metrics file (xml) for font?

Hi! How can I generate metrics file for font using iText? I need to append new font to pdf I generate using iText, I found that I need a metrics file for font to do that... ...

using a table in a different class

I have created a JTable in one class now i need to use the same table, to set some value in it, in a different class. how shall i use the same JTable in that different class. please tell. ...

Class Dictionary in java (data structure)

How to use Class Dictionary in java ? ...

JBoss: How to generate a Web Service FROM a WSDL?

I need to prototype a very simple system which sends a request to a remote web service, which will then callback on my own web service once it's finished processing. Unfortunately, I have to implement their WSDL for the callback. Is there a nice simple way of generating a JBoss application which will correctly implement the WSDL, and ru...

Splitting table cells in wordML programatically

how to Splitting table cells in wordML programatically ...

Focus should come to an applet in the IE when IE becomes as active window.

In an applet when opened in Internet Explorer,the focus should come back automatically to applet instead of going to IE when any window comes over IE and goes back (Internet Explorer again becomes the active window). To get the focus RequestFocus() and RequestFocusInWindow() are not working for an applet in my case. Can any one explain...

Getting Callback from OS X When Application Foucs Changes?

Hi, I am trying to find a way how to write a "software sensor" in Java, running on Mac OS X (10.5), which records each application focus change. My first idea was to write a "pull sensor" that uses an Applescript, which just returns the name of the app. that is in focus. Obviously this approach is not very good. Therefore, I was wonde...

Using XML parser implementation as OSGi service

Hello, I am developing an application using OSGi (Equinox platform), and one of the bundles needs to parse XML files. So far I implemented this with SAX (javax.xml.parsers.SAXParserFactory) and I would like to retrieve the SAXParserFactory from the platform. I saw the OSGi standard provides for a XMLParserActivator to allow JAXP implem...