This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes Compiling Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Compiling " Watch "Compiling " New topic
Author

Compiling

smitha verghese
Ranch Hand

Joined: Jun 21, 2003
Posts: 42
Hi,
I am new to EJB and i have installed weblogic and as well installed ant tool.
I have developed all the necessary bean codes, when i compile
ant all to create a jar file it gives the following error.
It seems as if ejb is not installed any extra packages to b installed?
Let me know
Thanks in advance
Smitha
hw-compile:
[echo] =========================================
[echo] Compiling Lookup files
[echo] =========================================
[javac] Compiling 4 source files to C:\Lookup\build\classes
[javac] C:\Lookup\src\com\examples\helloworld\ejb\HelloWorld.java:18: package javax.ejb does not exist
[javac] import javax.ejb.EJBObject;
[javac] ^
[javac] C:\Lookup\src\com\examples\helloworld\ejb\HelloWorld.java:23: package javax.ejb does not exist
[javac] public interface HelloWorld extends javax.ejb.EJBObject
[javac] ^
[javac] C:\Lookup\src\com\examples\helloworld\ejb\HelloWorldBean.java:18: package javax.ejb does not ex
[javac] import javax.ejb.SessionBean;
[javac] ^
[javac] C:\Lookup\src\com\examples\helloworld\ejb\HelloWorldBean.java:19: package javax.ejb does not ex
[javac] import javax.ejb.SessionContext;
[javac] ^
[javac] C:\Lookup\src\com\examples\helloworld\ejb\HelloWorldBean.java:20: package javax.ejb does not ex
[javac] import javax.ejb.CreateException;
[javac] ^
[javac] C:\Lookup\src\com\examples\helloworld\ejb\HelloWorldBean.java:21: package javax.ejb does not ex
[javac] import javax.ejb.EJBException;
[javac] ^
[javac] C:\Lookup\src\com\examples\helloworld\ejb\HelloWorldBean.java:25: cannot resolve symbol
[javac] symbol : class SessionBean
[javac] location: class com.examples.helloworld.ejb.HelloWorldBean
[javac] public class HelloWorldBean implements SessionBean
[javac] ^
Fire Dawg
Greenhorn

Joined: Jan 27, 2004
Posts: 1
You need to have ejb.jar file in your classpath whilecompiling ejbs.Better you get the j2ee.jar file and include it in your classpath. You can download it from sun site
smitha verghese
Ranch Hand

Joined: Jun 21, 2003
Posts: 42
Hi i did download the file j2ee.jar.
May i have a clear idea on how to set the classpath? for both ant tool and j2ee.jar
Thanks
smitha
Graham Thorpe
Ranch Hand

Joined: Mar 25, 2002
Posts: 265
why dont u try to deploye through weblogic !
smitha verghese
Ranch Hand

Joined: Jun 21, 2003
Posts: 42
Hi yaaar i need to know how do i deploy do let me know
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Did you take a look at the Ant Manual under "Ant Tasks --> Core Tasks --> javac"?


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Compiling
 
Similar Threads
class compile err,pls help
Anybody ever faced this problem running client of chapter 2 of pro ejb 3 java persistence api
EJB compilation - import javax.ejb.*; not found.
NeedJ2EE 1.3 RI server Installation Help
getting compiler error