This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

calling an ejb from jsp

 
magesh sripathy
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic