• 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

LocalHome Interfaces ClassNotFoundException

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
we got the following problem:
We have RemoteInterfaces that work properly. The LocalHomeInterfaces always lead to an Exception. All I found concerning that prob was the ejb-local-ref entry in the ejb-jar.xml, but even that didn't solve the prob. It seems like the JNDI name cannot be resolved cause a missing or wrong configuration. I would appreciate an example or better a howto with code and deployment descriptor. If somebody could fix the posted code it would be even better We are using JBoss 3.23 and the following files:
Inside the Session Bean we are using:
InitialContext ctx = new InitialContext();
WorkorderLocalHome home = (WorkorderLocalHome) ctx.lookup("com/teec/ios/ejb/cmp/workorder/WorkorderLocal");
The ejb-jar.xml Descriptor:
<entity>
<description/>
<ejb-name>Workorder</ejb-name>
<home>com.teec.ios.ejb.cmp.workorder.WorkorderHome</home>
<remote>com.teec.ios.ejb.cmp.workorder.Workorder</remote>
<local-home>com.teec.ios.ejb.cmp.workorder.WorkorderLocalHome</local-home>
<local>com.teec.ios.ejb.cmp.workorder.WorkorderLocal</local>
<ejb-class>com.teec.ios.ejb.cmp.workorder.WorkorderBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Integer</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>Workorder</abstract-schema-name>

<ejb-local-ref>
<ejb-ref-name>com/teec/ios/ejb/cmp/workorder/Workorder</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>com.teec.ios.ejb.cmp.workorder.WorkorderLocalHome</local-home>
<local>com.teec.ios.ejb.cmp.workorder.WorkorderLocal</local>
</ejb-local-ref>
...
</entity>

JBoss Descriptor jboss.xml:
<entity>
<ejb-name>Workorder</ejb-name>
<jndi-name>com/teec/ios/ejb/cmp/workorder/Workorder</jndi-name>

<ejb-local-ref>
<ejb-ref-name>com/teec/ios/ejb/cmp/workorder/Workorder</ejb-ref-name>
<local-jndi-name>com/teec/ios/ejb/cmp/WorkorderLocal</local-jndi-name>
</ejb-local-ref>

</entity>
 
Ranch Hand
Posts: 1646
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Martin Eichhorn:
WorkorderLocalHome home = (WorkorderLocalHome) ctx.lookup("com/teec/ios/ejb/cmp/workorder/WorkorderLocal");
...
<local-home>com.teec.ios.ejb.cmp.workorder.WorkorderLocalHome</local-home>


Is that a typoe, or did you mean
ctx.lookup("com/teec/ios/ejb/cmp/workorder/WorkorderLocalHome");
 
Martin Eichhorn
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's just the JNDI name. Of course these match!
 
girl power ... turns out to be about a hundred watts. But they seriuosly don't like being connected to the grid. Tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic