This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Error in building EJB codes using Ant  RSS feed

 
Pankaj Poshirkar
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,

I am new to EJB technology and I am following the O'Reilly book 'Enterprise JavaBeans 3.0'. This book illustrates sample programs and builts them using Ant Scripts on JBoss Application Server. I have set the folder structures, etc everything similar to as shown in this book. But then too I am getting compilation error when I run the command : ant run.client

The compilation error which I get is 'The package Persistence could not be found'.

The script just cannot recognise any of the Persistence related objects. I have even included ejb3-persistence.jar file in the CLASS_PATH variable, but getting the same error.

Does anyone know this problem? Please help me if anybody is aware of this issue? Or please know if I am committing some stupid mistake


Thanks,
Pankaj Poshirkar
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

The package Persistence could not be found

Is this the exact message? There is no package called "Persistence" that I am aware of in JEE. Is this your own package name?
 
Pankaj Poshirkar
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,


I meant to say javax.persistence package (or any package related to persistence). Currently I am not in front of my personal laptop where JBoss is installed so am not able to provide you the correct compilation errors.

Thanks,
Pankaj
 
Mark E Hansen
Ranch Hand
Posts: 650
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, that's the jar that contains the javax.persistence classes. Are you sure you're placing it on the classpath propertly? For example, you mentioned you placed it on CLASS_PATH. If you were referring to an environment variable, the one used by Java is CLASSPATH (note no underscore).

Also, your Ant scripts are going to do two things: build the classes and then run them. Each phase needs to have access to the appropriate jars. Is it possible you fixed one and not the other?

I don't have that book, so I'm afraid I don't have a lot of insight otherwise in what might be going wrong.
 
Pankaj Poshirkar
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Mark,

Yes I have placed all the jar files on the CLASSPATH property (CLASS_PATH was a typo error)
 
Mark E Hansen
Ranch Hand
Posts: 650
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay, then, inspect the contents of those Jar file and make sure they contain the class files. If they do, then your setting of classpath must not be correct. Doesn't Ant have a way to print out debugging information? Can you add some debugging statements to the build script to have it spit out the classpath it is using when compiling/running?

Good luck.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!