Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJB deployed on JBoss, and JVM collapses when I lookup the EJB from a main method

 
Kevin Tse
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know why, I did this successfully before, but it fails now.
I write a main method in eclipse, and lookup the EJB with the code showed below. When I execute these code, the OS(Windows) rather than eclipse prompts me with an error message : "javaw.exe has encountered a problem and needs to close. We are sorry for the inconvenience....".



Well, though the above attempt failed, I could lookup the EJB and invoke on it in a Web Application that was deployed on JBoss as well.

Please help!
Your help will be greatly appreciated!
[ April 01, 2008: Message edited by: Kevin Tse ]
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does your eclipse build path have all the container-generated classes and the client JAR?
 
Kevin Tse
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, all required classes and jars are in the build path. There's no ClassNotFoundException, so I think this is not a problem about that.

might it be a problem about *compilation* of the code? say, code of the EJB are compiled by a JVM of a certain version, and invoked by code compiled by another?

But I checked that the compiler used by eclipse is version 6.0, and all the environment variables are pointing to JDK1.6, so the JBoss is certainly running on JDK1.6.

Anybody out there encountered the same problem?
this' been eating me for days...

please help...
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rerun in eclipse debug mode, keep stepping over until you find out which line of code is failing.
 
Kevin Tse
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it is this line that caused the problem.


if i don't lookup EJB, everything works fine.
 
Kevin Tse
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can't even run the code in debug mode. when I try to debug the code, eclipse gives me this error message: cannot connect to VM socket closed. I have googled for hours and found some solutions, but all those are not solutions to my problem, the error keeps occuring...
 
Kevin Tse
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I find that when I add the JBoss Java EE libraries, the error occurs.
With the JBoss Java EE libraries in the build path, I can't even debug a method without any code.
This is annoying...
What's the problem here?
 
Madhura Oak
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kevin,

Please check out whether jbossall-client.jar is included in the build path. I was getting a similar problem before. It was solved after including it.

Regards,
Madhura
 
Kevin Tse
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried the same code in Linux, it works fine.
I remember that it was after I updated my Windows XP that the error came forth.
 
Edvins Reisons
Ranch Hand
Posts: 364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which version of JBoss are you using?
 
Kevin Tse
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using JBoss 4.2.2GA.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic