• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

EJB 3.0 with Jboss 7,1,0.CR1b

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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
  • Quote
  • Report post to moderator
This is the complete server log.

 
and POOF! You're gone! But look, this tiny ad is still here:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic