File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes calling an ejb from jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "calling an ejb from jsp" Watch "calling an ejb from jsp" New topic
Author

calling an ejb from jsp

magesh sripathy
Greenhorn

Joined: Apr 06, 2006
Posts: 27
i have created a simple ejb and deployed it in Weblogic, using the generated .jar file.
I then created a webmodule containg a jsp and i have deployed in weblogic .
when i try to call the ejb from the jsp in the webmodule i am getting a
noclassdeffounderror.

my ejb-jar.xml

<ejb-jar>
<enterprise-beans>
<session>
<ejb-name>sampleAccess</ejb-name>
<home>com.sampleejb.SampleejbHome</home>
<remote>com.sampleejb.Sampleejb</remote>
<ejb-class>com.sampleejb.SampleejbBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
</enterprise-beans>
</ejb-jar>

my weblogic-ejb-jar.xml looks like#
weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>sampleAccess</ejb-name>
<jndi-name>nickname</jndi-name>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>


my web-xml looks like

<web-app>
<ejb-ref>
<ejb-ref-name>ejb1</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<home>com.sampleejb.SampleejbHome</home>
<remote>com.sampleejb.Sampleejb</remote>
</ejb-ref>
</web-app>


my weblogic.xml looks like

<weblogic-web-app>
<reference-descriptor>
<resource-description>
<res-ref-name/>
<jndi-name/>
</resource-description>
<ejb-reference-description>
<ejb-ref-name>ejb1</ejb-ref-name>
<jndi-name>nickname</jndi-name>
</ejb-reference-description>
</reference-descriptor>
</weblogic-web-app>

if i include the ejb home and remote interface class in the webmodule it works fine.can you help in solving the above issue without adding the ejb interface in the webmodule....


Regards,
Magesh.s
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: calling an ejb from jsp
 
Similar Threads
How to deploy 2 EJB's in separate jars
Can�t find Home Interface.
Local EJB call - Naming Exception
Error----web app could not find ejb module.
Accessing EJB from servlet in WAR file