Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem running code from EJB in action book (chapter1)

 
fabianoSouza Souza
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I'm new to EJB and I'm in trouble running that code from EJB in action book (chapter1).

I used ant to deploy the application but when I run the single client application i get this error:

here is the code:



here is the error:

HelloUserClient.java:3: package javax.ejb does not exist
import javax.ejb.EJB;
^
HelloUserClient.java:7: cannot find symbol
symbol : class HelloUser
location: class ejb3inaction.example.HelloUserClient
private static HelloUser helloUser;
^
HelloUserClient.java:6: cannot find symbol
symbol : class EJB
location: class ejb3inaction.example.HelloUserClient
@EJB
^
3 errors

>>I'm running this code from command line, without any IDE, can someone help?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34084
337
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sounds like you are missing a jar from the classpath. Do you see a jar that looks like j2ee.jar or jpa.jar?
 
fabianoSouza Souza
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I did everything as in the book, I'm using GlassFich,, etc..

I tried to run the code with the .jar from command line but it failed with same error..

the .jar i tried was clientxx.jar and if the problem is with .jar file then i don't know what's the right .jar
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic