This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes Problem running code from EJB in action book (chapter1) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Problem running code from EJB in action book (chapter1)" Watch "Problem running code from EJB in action book (chapter1)" New topic
Author

Problem running code from EJB in action book (chapter1)

fabianoSouza Souza
Greenhorn

Joined: Oct 07, 2006
Posts: 9
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
internet detective
Marshal

Joined: May 26, 2003
Posts: 29274
    
140

It sounds like you are missing a jar from the classpath. Do you see a jar that looks like j2ee.jar or jpa.jar?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
fabianoSouza Souza
Greenhorn

Joined: Oct 07, 2006
Posts: 9
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem running code from EJB in action book (chapter1)
 
Similar Threads
EJB simple client is not running
Trouble in getting started with EJB3
Problem facing while creating EJB3 application in Netbeans
How to run Hello World example in Eclipse with Glassfish v3 as appserver
@EJB annotation from servlet and JBoss