java

Senior J2EE interview questions

What are the best questions to ask when running a technical interview for a senior level j2ee developer? ...

How to replace a character programatically in Oracle 8.x series

Due to repetitive errors with one of our Java applications: Engine engine_0: Error in application action. org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x13) was found in the element content of the document. I need to "fix" some Unicode character in an Oracle database, ideally in a programmatic fashion. Once identi...

JVM Thread dumps containing monitors without locking threads

What could be the cause of JVM thread dumps that show threads waiting to lock on a monitor, but the monitors do not have corresponding locking threads? Java 1.5_14 on Windows 2003 ...

Is GCJ (GNU Compiler for Java) a viable tool for publishing a webapp?

Is it really viable to use GCJ to publish server-side applications? Webapps? My boss is convinced that compiling our (my) webapp into a binary executable is a brilliant idea. (Then again, he likes nice, small simple things with blinky lights that he can understand.) He instinctively sees no issues with this, while I only see an end...

In Java, does return trump finally?

If I have a try/catch block with returns inside it, will the finally block be called? For example: try { something(); return success; } catch (Exception e) { return failure; } finally { System.out.println "i don't know if this will get printed out." } I know I can just type this in an se...

How to rewrite or convert C# code in Java code ?

I start to write a client - server application using .net (C#) for both client and server side. Unfortunately, my company refuse to pay for Windows licence on server box meaning that I need to rewrite my code in Java, or go to the Mono way. Is there any good way to translate C# code in Java ? The server application used no .net specifi...

track down file handle

I have a huge ear that uses log4j and there is a single config file that is used to set it up. In this config file there is no mention of certain log files but, additional files apart from those specified in the config file get generated in the logs folder. I've searched for other combinations of (logger|log4j|log).(properties|xml) and h...

Java Open Source Workflow Engines

What is the best open source java workflow framework (e.g. OSWorkflow, jBPM, XFlow etc.)? ...

How do you crash a JVM?

Newbie here... Also not sure whether the question belongs to a site that prefers questions that can be answered and not discussed. Still... I was reading a book on programming skills wherein the author asks the interviewee, "How do you crash a JVM?" I thought that you could do so by writing an infinite for-loop that would eventually use...

apache axis ConfigurationException

I am using apache axis to connect my java app to a web server. I used wsdl2java to create the stubs for me, but when I try to use the stubs, I get the following exception: org.apache.axis.ConfigurationException: No service named is available any idea? ...

Valid characters in a Java class name

What characters are valid in a Java class name? What other rules govern Java class names (for instance, Java class names cannot begin with a number)? ...

Why to use StringBuffer in Java instead of the string concatenation operator

Someone told me it's more efficient to use StringBuffer to concatenate strings in Java than to use the + operator for Strings. What happens under the hood when you do that? What does StringBuffer do differently? ...

What's the best library for reading Outlook .msg files in Java ?

I would like to read the text and binary attachments in a saved Outlook message (.msg file) from a Java application, without resorting to native code (JNI, Java Native Interface). Apache POI-HSMF seems to be in the right direction, but it's in very early stages of development... ...

Order of DOM NodeList returned by getChildNodes()

The DOM method getChildNodes() returns a NodeList of the children of the current Node. Whilst a NodeList is ordered, is the list guaranteed to be in document order? For example, given <a><b/><c/><d/></a> is a.getChildNodes() guaranteed to return a NodeList with b, c and d in that order? The javadoc isn't clear on this. ...

What is the best way to implement constants in Java ?

I've seen examples like this: public class MaxSeconds { public static final int MAX_SECONDS = 25; } and supposed that I could have a Constants class to wrap constants in, declaring them static final. I know practically no Java at all and am wondering if this is the best way to create constants. ...

Why does Tomcat 5.5 (with Java 1.4, running on Windows XP 32-bit) suddenly hang?

I've been running Tomcat 5.5 with Java 1.4 for a while now with a huge webapp. Most of the time it runs fine, but sometimes it will just hang, with no exception generated, and no apparant way of getting it to run again other than re-starting Tomcat. The tomcat instance is allowed a gigabyte of memory on the heap, but rarely exceeds 300...

REST in Java

I'm looking for a light version of REST for a Java web application I'm developing. I've looked at RESTlet (www.restlet.org) and the REST plugin for Struts 2, but I haven't made up my mind. I'm leaning towards RESTlet, as it seems to be lighter. Has anyone implemented a RESTful layer without any of the the frameworks or with the framew...

faster Math.exp() via JNI?

Hi, I need to calculate Math.exp() from java very frequently, is it possible to get a native version to run faster than java's Math.exp()?? I tried just jni + C, but it's slower than just plain java. ...

Can a servlet determine if the data posted to it is enctype="multipart/form-data"?

I have a servlet that is used for many different actions, used in the Front Controller pattern. Does anyone know if it is possible to tell if the data posted back to it is enctype="multipart/form-data"? I can't read the request parameters until I decide this, so I can't dispatch the request to the proper controller. Any ideas? ...

What is the best OpenGL java binding?

I am trying to achieve better performance for my Java SWT application, and I just found out it is possible to use OpenGL in SWT. It seems there are more than one Java binding for OpenGL. Which one do you prefer? Note that I have never used OpenGL before, and that the application needs to work on Windows, Linux and Mac OS X. ...