• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

EJB 3.0 with Jboss 7,1,0.CR1b

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I am new to the world of J2EE.
I am trying to create a simple EJB example.
Following is the source code for my EJB and the web app I am using to access the EJB.

Local Interface


Implementation



Servlet to access the EJB


I keep getting java.lang.ClassNotFoundException.
I have tried all the JNDI names for the lookup, but I still am not able to access the EJB.
What am I doing wrong?

 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A ClassNotFoundException means that the the class is probably not package in your app properly. Look at your TestEjb.jar file and make sure that it contains both test/Test1Local.class and test/Test1.class.

If this doesn't help, post the complete contents of your JAR and WAR file (use "jar -tf" to list the contents).
 
Abhishek Khanna
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is what I see.

C:\server\jboss-as-7.1.0.CR1b\standalone\deployments>jar -tf TestEjb.jar
META-INF/MANIFEST.MF
META-INF/
META-INF/ejb-jar.xml
test/
test/Test1.class
test/Test1Local.class


Just to add I get this error message when I try to deploy the web app.
Any help would be greatly appreciated.
 
Abhishek Khanna
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And here is the WAR file.

C:\server\jboss-as-7.1.0.CR1b\standalone\deployments>jar -tf EmployeeWebApp.war
META-INF/MANIFEST.MF
META-INF/
WEB-INF/
WEB-INF/classes/
WEB-INF/classes/com/
WEB-INF/classes/com/web/
WEB-INF/classes/com/web/emp/
WEB-INF/classes/com/web/emp/controller/
WEB-INF/classes/com/web/emp/controller/EmpServlet.class
WEB-INF/lib/
WEB-INF/web.xml
 
Abhishek Khanna
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is the complete server log.

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic