JBoss - does app have to be compiled under same jdk as JBOSS is running under?

Posted by dcp on Stack Overflow See other posts from Stack Overflow or by dcp
Published on 2010-03-12T19:33:14Z Indexed on 2010/03/12 21:57 UTC
Read the original article Hit count: 198

Filed under:
|
|

I'm a little confused about JBOSS and running it under different JDKs. For example, let's say I'm running JBOSS 5.1, and before starting it I set my JAVA_HOME to point to JDK5. Let's also assume that my JEE application is compiled under JDK6. If I deploy the JEE app (compiled under JDK6) to JBOSS, when I try to look up my EJBs I get errors like:

javax.naming.NameNotFoundException: tc_test_project not bound

But if I recompile my code under JDK5 and redeploy it, it works fine and is able to lookup the EJBs ok.

Likewise, I can set JAVA_HOME to JDK6 and start JBOSS, and my code (compiled under JDK6) will run ok under that scenario (it's able to find the EBJs, etc.).

So it seems that your JEE app needs to be compiled under the same JAVA_HOME that the JBOSS server is going to be running under, or am I misunderstanding something? Just wanted to get confirmation, thanks.

© Stack Overflow or respective owner

Related posts about java

Related posts about jee