Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

package javax.ejb does not exist

 
L. Wei
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am trying to run the examples of "Action In EJB3". I am using osx snow leopard on my macbook. I installed JBoss AS6.0 and Ant, and tried to compile actionbazaar of chapter1. I got "package javax.ejb does not exist" error. I am using Java 1.6.0_20 from osx 10.6.

I know that I need j2ee.jar but where is it? I didn't even find it in JBoss installation folder. Should I install J2ee sdk? Why couldn't I find this jar in jboss folder? Any one can help?
 
Ninad Kulkarni
Ranch Hand
Posts: 802
Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are geeting such error at compile time then you have to set path location in xml file according to your environment.
 
L. Wei
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Ninad. I tried to modify the build.xml file, but I still couldn't get it compiled. I keep getting the compilation error


Here is the build.xml file of the chapter1 in EJB3 in Action.


and Here is my env setup.


What should I change to get this HelloWorld example run? Which jar file should I include to have javax.ejb package? Please advice. I appreciate it.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check my question there, and stop duplicating threads.
 
L. Wei
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Christophe. Here is the common.xml. Please advice.



Christophe Verré wrote:Check my question there, and stop duplicating threads.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have the following file : /Users/lwei/Tools/jboss-5.1.0.GA/server/default/lib/jboss-j2ee.jar ?
 
L. Wei
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, no files in the server/default/lib folder. Did I miss anything? I downloaded the jboss-5.1.0.GA-jdk6.zip file only from its download page. should I download the src file?

I did "find . -name jboss-j2ee.jar -print" at the jboss-5.1.0.GA folder, but not find it either.

Christophe Verré wrote:Do you have the following file : /Users/lwei/Tools/jboss-5.1.0.GA/server/default/lib/jboss-j2ee.jar ?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
L. Wei wrote:No, no files in the server/default/lib folder. Did I miss anything? I downloaded the jboss-5.1.0.GA-jdk6.zip file only from its download page. should I download the src file?

I did "find . -name jboss-j2ee.jar -print" at the jboss-5.1.0.GA folder, but not find it either.


From the author of the book (here): "We currently do not support JBoss 5. Our example code is targeted for JBoss 4.2."

I'm moving this thread to the JBoss forum.
 
Vikram Saxena
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have to include the jboss-javaee.jar file. Its present in the same location i.e. <,YourServer>>\lib.

Also, Please ensure that you are using the correct JAR files as the naming conventions have changed.

Hope this helps !
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic