Community
Participate
Working Groups
Hi , I have an application that is behaving differently in Eclipse and outside of Eclipse usign the same JDK. I attached the JAR file with the source code. When I run outside i get: C:\temp>java -fullversion java full version "J2RE 1.3.1 IBM Windows 32 build cn131-20030711a" C:\temp>java -cp testFail.jar Main DATA EXCEPTION Exc->com.mbh.test.exceptions.DataException:[SEARCH_TIMEOUT] a search timeout occurred in ProviderData.doZipSearchOnly When I import the JAR in Eclipse 3.0 (M3 I think) and I run it I get: DATA EXCEPTION Exc->com.mbh.test.exceptions.DataException:[SEARCH_TIMEOUT] a search timeout occurred in ProviderData.doZipSearchOnly if I change the JDK of the application to use the first one: java full version "J2RE 1.3.1 IBM Windows 32 build cn131-20030711a" I get: UNEXPECTED Exc->com.mbh.test.exceptions.DataException:[UNEXPECTED_EXCEPTION] an unexpected exception occurred in method ProviderData.doZipSearchOnly. Error reported [ZIP_SEARCH_TIMEOUT] A search timeout in throwDatabaseException occurred with a zipcode of 10017 and a radius of 25 If I remove static { addExceptionResource (DatabaseException.class, "databaseException"); } from DatabaseException I then get DATA EXCEPTION Exc->com.mbh.test.exceptions.DataException:SEARCH_TIMEOUT ----------------- I am puzzled :( because I thought it would be a bytecode issue in Eclipse, but then it works fine when I use JDK 1.4.1 inside Eclipse ? Who can shed some light on what is happening ?
Created attachment 6537 [details] testcase
How did you compile your code? I guess it is related to the fact that .class no longer initialize the class. Before it did. Did you compile your code with two different versions of Eclipse or with javac?
Hello Olivier Hum, good question Obviously I believe Eclipse 3.0 recompiled no ? I compiled with Eclipse 2.1 and exported Are you suggesting I compile and export with Eclipse 3.0 and an external JDK ?
This has been changed between Eclipse 2.1 and Eclipse 3.0. It has nothing to do with the JDK that you are using. The problem is that you assumed that the class literal (DatabaseException.class) will initialize your class. This is not done anymore. See bug 37565.
AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHh ! :)
Ok to close?
fine for me
Close as INVALID.