• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java WS stops at startup

 
Andrea Perale
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm having some problems with my Java WS application.
It occasionally crashes, not everytime and not in every desktop clients. When it stops, the application exits and also the Java console is immediately closed.
There aren't compilation errors, I have some Exceptions and some NoSuchMethodError, but I don't think this is real the problem, because I think it should stops in every situations...

This problem is born after I changed a Java Web Application to a Java Web Start Application .

It would be nice, if you have some ideas of what could be the cause.
Thanks.
 
Tim Moores
Bartender
Posts: 3127
50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have some Exceptions and some NoSuchMethodError, but I don't think this is real the problem

That doesn't seem a good assumption, especially NoSuchMethodError is something you should track down. It points to a library or JRE version mismatch somewhere. Maybe the app is allowed to run on lower JVM versions than it is compiled for? Meaning it might make use of classes or methods that are simply not present in the client JVM.

because I think it should stops in every situations.

Code may well behave differently on different OSes, OS versions, JVMs or JVM versions. In some cases it bombs, and in some places it doesn't. WORA (write once, run anywhere) was always a dream, not a reality.
 
Andrea Perale
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Moores wrote:
, I have some Exceptions and some NoSuchMethodError, but I don't think this is real the problem, because I think it should stops in every situations.


Do you think this might be the real problem?
But when I run the web application in browsers it never fail...
And why the crash doesn't happen in every application execution ?
 
Andrea Perale
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Moores wrote:
I have some Exceptions and some NoSuchMethodError, but I don't think this is real the problem

That doesn't seem a good assumption, especially NoSuchMethodError is something you should track down. It points to a library or JRE version mismatch somewhere. Maybe the app is allowed to run on lower JVM versions than it is compiled for? Meaning it might make use of classes or methods that are simply not present in the client JVM.

Thanks for the answer.
I used a tool, the JavaMissionControl and shows where the NoSuchMethodErrors methods are raised.
At compile time methods are correct... And also at runtime, I tried to use a decompiler and it seems that these methods are correct.

The application is using Reflection, I think this might be the problem. Errors are all related to ObjectInputStream \ readObject ...

because I think it should stops in every situations.

Code may well behave differently on different OSes, OS versions, JVMs or JVM versions. In some cases it bombs, and in some places it doesn't. WORA (write once, run anywhere) was always a dream, not a reality.


OK, understood. ;)
 
Andrea Perale
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the answer.
I used a tool, the JavaMissionControl and shows where the NoSuchMethodErrors methods are raised.
At compile time methods are correct... And also at runtime, I tried to use a decompiler and it seems that these methods are correct.

The application is using Reflection, I think this might be the problem. Errors are all related to ObjectInputStream \ readObject .
 
Andrea Perale
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found that all NoSuchMethodErrors come from a reaObject (ObjectInputStream) method.
When I read a particular Object (such as ArrayLists, Lists or objects from a user-defined class) there is a NoSuchMethodError.
Instead when I read normal Objects like String, Object, Integer, etc, there aren't Errors! Maybe i'm doing something wrong with serialization.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic