• 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
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Referencing EJBs in a JAR file from a WAR

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not sure how to access a session EJB which has been deployed in a separate JAR file from a WAR.
My files look like this:

(Where the jndi-name MyJNDI is that of the bean in the JAR.)
This results in

during the deployment of the WAR. No difference even if I wrap the JAR and the WAR in an EAR file.

Removing the <ejb-ref> tag in web.xml allows the deployment to go ahead, but then the context lookup to java:comp/env/ejb/MyEJB fails. ejb not bound, it says.

I've tried to do a context lookup on the JNDI name of the bean directly. This works, but only on startup of JBoss. Any subsequent redeploy results in a ClassCastException on lookup, such as:
Couldn't cast class $Proxy62 into interface foo.bar.MyEJBHome
Despite the fact that subsequent tests reveal that what is returned is indeed a foo.bar.MyEJBHome.

So this leads me to suspect that I'm not supposed to be doing a direct lookup anyway.

Using JBoss 3.0.4. Any help appreciated.
N
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic