It's not a secret anymore!*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes javax.ejb error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "javax.ejb error" Watch "javax.ejb error" New topic
Author

javax.ejb error

pramod talekar
Ranch Hand

Joined: Apr 26, 2010
Posts: 323

Hello,

I've installed j2ee 1.5 sdk , glassfish v3 and set up classpath as C:\Sun\SDK\lib\j2ee.jar and j2ee_home as C:\Sun\SDK
But the error is still showing up for import javax.ejb.*; statement in Eclipse.
Is there anything I need to do in the Eclipse properties ?

Please advise.

--

Thanks,
Pramod
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
First of all, I very much doubt that you need the J2EE 1.5 SDK and the classpath setup.
Install GlassFish 3 and create a server for it in Eclipse.
When you create a web project or an EJB project, you select the server to be GlassFish v3.
If you need the GlassFish libraries in some other kind of project, then you can select Server Runtime when adding a JAR.
Best wishes!


My free books and tutorials: http://www.slideshare.net/krizsan
pramod talekar
Ranch Hand

Joined: Apr 26, 2010
Posts: 323

Hi Ivan,

Thanks for the reply.

I installed GF3 and created a server for it in Eclipse but didn't change my j2ee setting and classpath.
I tried to run a sample program, it got compiled but shows '" Publishing to Glassfish v3 Java EE 6 at localhost (java.lang.NullPointerException)"

It is a code error, so it looks like my setup is right.

Thanks a lot for your advice.
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Post the code and the stacktrace if you want help with the code!
Please also include information about what kind of project you use and any non-default configuration.
Best wishes!
pramod talekar
Ranch Hand

Joined: Apr 26, 2010
Posts: 323

Hi Ivan,

I just noticed that while creating a Dynamic web project in Eclipse (platform 3.5), the option 'Dynamic web module version I can set up is 2.5 and I need 3.0

Does this affect the project in any way ?

Thanks.


Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
The dynamic web module version depends on the target runtime you configure for Eclipse projects.
I can configure version 3.0 with GlassFish v3.0.1. If you want a web container only, try Tomcat 7.

Oh, yes - it may also be related to the version of Eclipse you use. Try Helios (Eclipse 3.6).
Best wishes!
pramod talekar
Ranch Hand

Joined: Apr 26, 2010
Posts: 323

Hi Ivan,

I had an old version of Eclipse.
Upgrading it now...
will let you know.

Thanks a lot..
 
jQuery in Action, 2nd edition
 
subject: javax.ejb error