java

Best way to really grok Java for a C# guy

I've recently started developing applications for the Blackberry. Consequently, I've had to jump to Java and learn that and its associated tools. The syntax is easy, but I keep having issues with various gotchas and the environment. For instance, something that surprised me and wasted a lot of time is absence of real properties on a...

How do I create a thread dump of a Java Web Start application

Is it possible to get a thread dump of a Java Web Start application? And if so, how? It would be nice if there were a simple solution, which would enable a non-developer (customer) to create a thread dump. Alternatively, is it possible to create a thread dump programmatically? In the Java Web Start Console I can get a list of threads b...

How to check PDF-A 1b compliance with open source tools?

How can i check (and additionally create) PDF-A 1b compliant PDF documents using open source tools? Does anybody know an open source tool? Thanks in advance... ...

Is it just me or are interfaces overused?

Ok, I may resort to a tad ranting here, so let me apologize in advance, but I'm really curious if others find this pattern annoying too (and I wonder if it is a justifiable pattern)… So, after just looking at a particular question, I noticed that almost all of the responses suggested creating an interface for injecting a mock in some te...

Compound keys in JPA

I want to make an entity that has an autogenerated primary key, but also a unique compound key made up of two other fields. How do I do this in JPA? I want to do this because the primary key should be used as foreign key in another table and making it compound would not be good. In the following snippet, I need the command and model to ...

Unit testing a java servlet

I would like to know what would be the best way to do unit testing of a servlet. Testing internal methods is not a problem as long as they don't refer to the servlet context, but what about testing the doGet/doPost methods as well as the internal method that refer to the context or make use of session parameters? Is there a way to do ...

J2EE App Server Hello World

I am fairly comfortable with standalone Java app development, but will soon be working on a project using a J2EE application server. Does anyone know of a straightforward how-to tutorial to getting a hello-world type application working in an application server? I'm (perhaps naievly) assuming that the overall approach is similar between...

Automated tests for Java Swing GUIs

What options are there for building automated tests for GUIs written in Java Swing? I'd like to test some GUIs which have been written using the NetBeans Swing GUI Builder, so something that works without requiring special tampering of the code under test would be ideal. ...

Serialize Java objects into Java code

Does somebody know a Java library which serializes a Java object hierarchy into Java code which generates this object hierarchy? Like Object/XML serialization, only that the output format is not binary/XML but Java code. ...

Best resources to prepare for the "Spring Framework Certification"

Hi there I want to do the Spring Framework Certification (2.5), but there aren't many good resources to prepare for the exam. For the Sun certifications there are a lot of books and trainers (Enthuware / Whizlabs) but not for the Spring certification. Has somebody done the 2.5 exam already? What was your first impression? How did you p...

Best solution for using EJBs from Excel

We would like to give access to some of our EJBs from Excel. The goal is to give an API usable from VBA. Our EJBs are mostly Stateless Session Beans that do simple CRUD operations with POJOs. Some possible solutions: Exposing the EJBs as WebServices and create a VB/C# dll wrapping them, Using Corba to access the EJBs from C#, Creati...

Attaching additional javadoc in Intellij IDEA

When I use quick documentaion lookup (Ctrl+Q) on j2ee classes or annotations in IDEA I only get an empty javadoc. It only contains the basics like class name. How do I add the javadoc to the libs IDEA provides itself? ...

What is the best Ajax framework for JSF

I have an existing JSF application (Tomcat 6, MyFaces, JSF 1.2, Tomahawk, JSP) and we are looking at adding AJAX to existing pages. 1 What is the best framework you have used. 2 What issues have you had. I have stated looking at Richfaces, and just started looking at Icefaces Thanks. ...

How do you get an embedded Jetty webserver to dump its interim Java code for JSPs

I keep running into this problem when debugging JSP pages in OpenNMS. The Jetty wiki talks about keepGenerated (http://docs.codehaus.org/display/JETTY/KeepGenerated) in webdefault.xml but it seems unclear how this works in embedded setups. ...

How can I specify the local address on a java.net.URLConnection?

My Tomcat instance is listening to multiple IP adress, but I want to control what source IP address is used when opening a URLConnection. How can I specify this? ...

JSTL/JSP EL (Expression Language) in a non JSP (standalone) context

Can anyone recommend a framework for templating/formatting messages in a standalone application along the lines of the JSP EL (Expression Language)? I would expect to be able to instantiate a an object of some sort, give it a template along the lines of Dear ${customer.firstName}. You order will be dispatched on ${order.estimatedDispat...

JIRA - Updating summary from post function

How do you update a summary field's value from post function in JIRA? ...

Reading quicken data files

Looking for an open source library, for C++, Java, C# or Python, for reading the data from Quicken .qdf files. @Swati: Quicken .qif format is for transfer only and is not kept up to date by the application like the .qdf file is. ...

How to mock object construction?

Is there a way to mock object construction using JMock in Java? For example, if I have a method as such: public Object createObject(String objectType) { if(objectType.equals("Integer") { return new Integer(); } else if (objectType.equals("String") { return new String(); } } ...is there a way to mock out...

Sending a 4 byte message header from C# client to a Java Server

I am trying to write a C# client to a server that is written in Java. The server expects a 4 byte (DataInputStread readInt() in Java) message header followed by the actual message. I am absolutely new to C#, how can I send this message header over to the Java Server? I tried it several ways (mostly trial and error without getting too de...