java

Reasons of getting a java.lang.VerifyError

I'm investigating the following java.lang.VerifyError java.lang.VerifyError: (class: be/post/ehr/wfm/application/serviceorganization/report/DisplayReportServlet, method: getMonthData signature: (IILjava/util/Collection;Ljava/util/Collection;Ljava/util/HashMap;Ljava/util/Collection;Ljava/util/Locale;Lorg/apache/struts/util/MessageRe˜̴M...

Application wide keyboard shortcut - Java Swing

Hello, I would like to create an application wide keyboard shortcut for a Java Swing application. Looping over all components and adding the shortcut on each has focus related side effects and looks like a brute force solution. Anyone has a cleaner solution ? Regards, Louis ...

How to retrieve params from GET HTTP method using javax.ws.rs.* and Glassfish?

I just installed Glassfish V2 on my local machine just to play around with it. I was wondering if there is a way to retrieve a param passed in by the GET HTTP method. For instance, http://localhost:8080/HelloWorld/resources/helloWorld?name=ABC How do I retrieve the "name" param in my Java code? ...

Java Frameworks War: Spring and Hibernate

My developers are waging a civil war. In one camp, they've embraced Hibernate and Spring. In the other camp, they've denounced frameworks - they're considering Hibernate though. The question is: Are there any nasty surprises, weaknesses or pit-falls that newbie Hibernate-Spring converts are likely to stumble on? PS: We've a DAO libra...

Java: Prevent NPE in MetalFileChooserUI$IndentIcon.getIconWidth ???

Hello, on Windows systems. I get the follwing NPE with the FileChooser. It is a known bug that is not fixed by sun yet. http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6342301 Does somebody know a workaround to prevent this exception? Thanks. André Exception in thread "AWT-EventQueue-2" java.lang.NullPointerException at javax....

Which free and open source frameworks would you recommend for replacing which aspect of ATG

ATG (http://www.atg.com) is a frameowrk, a platform and a solution for content presentation and management, personalisation, e-commerce and customer relationship management. Which free and open source frameworks or products would you recommend to replace the basic functionality it provides? In the spirit of Stack Overflow, can you ans...

How much resources does consume sleeping thread?

I'm wondering, how expensive it is to have many threads in waiting state in java 1.6 x64. To be more specific, I'm writing application which runs across many computers and sends/receives data from one to another. I feel more comfortable to have separate thread for each connected machine and task, like 1) sending data, 2) receiving data,...

How can I access the classes loaded by Java Web Start when dynamically compiling code?

I am dynamically compiling code in my client application. When I start the application with Java Web Start I get an exception. The exception only occurs when it is run through Java Web Start. //The exception evolver.core.model.change.execution.ExecutionException: Compilation failed! DynamicComparator.java:2: package evolver.core.model....

Which Java API would you recommend for dealing with Bluetooth?

Can you recommend a Java API to use with a desktop application (i.e. J2SE not J2ME) that will, perhaps, work with the underlying operating system's Bluetooth stack to give access to Bluetooth functionality and devices? ...

JSF how do I retrieve the selected rows of a woodstock table

I have a JSF woodstock table with checkboxes. When a row is selected I want to do some processing with those items. I managed to get a selection of RowKey objects but can't find out how to get the original objects I put in back. The table is populated by an ObjectListDataProvider. ...

Can you record audio with a Java Midlet on a Nokia phone (N80/N95) without the JVM leaking memory?

I would like to repeatedly capture snippets of audio on a Nokia mobile phone with a Java Midlet. My current experience is that using the code in Sun's documentation (see: http://java.sun.com/javame/reference/apis/jsr135/javax/microedition/media/control/RecordControl.html) and wrapping this in a "while(true)" loop works, but the applicati...

How to choose the max thread count for an HTTP servlet container?

I'm developing a restful Web service that runs as a servlet (using blocking IO) in Jetty. Figuring out the optimal setting for max threads seems hard. Is there a researched formula for deciding the max number of threads from some easily measurable characteristics of the rest of the setup? ...

Java: Why aren't NullPointerExceptions called NullReferenceExceptions ?

Was this an oversight? Or is it to do with the JVM? ...

csv api for java

Hi everyone, Can anyone recommend a simple API that will allow me to use read a csv input file, do some simple transformations, and then write it. A quick google has found http://flatpack.sourceforge.net/ which looks promising. I just wanted to check what others are using before I couple myself to this api. thanks, David. ...

Is there any way to define a constant value to Java at compile time

When I used to write libraries in C/C++ I got into the habit of having a method to return the compile date/time. This was always a compiled into the library so would differentiate builds of the library. I got this by returning a #define in the code: C++: #ifdef _BuildDateTime_ char* SomeClass::getBuildDateTime() { return _Buil...

Compare time part of datetime field in Hibernate

I've got an application that uses a hibernate(annotations)/mysql combination for ORM. In that application, I got an entity with a Date field. I'm looking for a way to select on that date within a time range (so hh:mm:ss without the date part). In MySQL there's a function TIME(expression) that can extract the time part and use that in t...

When do you use a JSP and when a Servlet?

I have an application that sends the customer to another site to handle the payments. The other site, outside of the customer, calls a page on our server to let us know what the status is of the payment. The called page checks the parameters that are given by the payment application and checks to see whether the transaction is known to u...

In eclipse, how to display inherited members in Outline view?

Typing Ctrl+O twice in editor when a java type is selected pops-up an outline context dialog that displays the members && inherited members. How can I have this in the main outline view? ...

Why do I get "java.net.BindException: Only one usage of each socket address" if netstat says something else?

I start up my application which uses a Jetty server, using port 9000. I then shut down my application with Ctrl-C I check with "netstat -a" and see that the port 9000 is no longer being used. I restart my application and get: [ERROR,9/19 15:31:08] java.net.BindException: Only one usage of each socket address (protocol/network address...

How can I start an Java applet with more memory?

The default 64 MB max heap memory can be small for a large Java application. Are there any applet parameter to increment this for a signed applet? For a Java program this is a simple command line parameter but how this work for an applet in the browser. ...