wood burning stoves*
The moose likes JBoss/WildFly and the fly likes EJB not bound Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "EJB not bound" Watch "EJB not bound" New topic
Author

EJB not bound

uttam kumar
Ranch Hand

Joined: Jan 27, 2009
Posts: 128

Hi,

I have an ear which contains several ejb jar and one war file. In the war file we have defined references to some ejb inside the web.xml. The problem is when I am deploying the ear into Oracle App Server its working fine but as soon as I deploy it into JBoss 5.0.1 GA it throws error. The ejb that is showing error is defined in web.xml as


The error I am getting on console is



Any help on this problem would be highly appreciated.

Thanks,
Uttam Kumar
uttam kumar
Ranch Hand

Joined: Jan 27, 2009
Posts: 128

I asked myself the reason for this exception: The problem of "Could not dereference object" seems to appear when the JNDI name actually exists but the resource references has a broken link, ie the name points on to another name that doesn't exist. When the name doesn't exist at all in the first place we'll get the "name not bound exception".

In server.log I could see that the EJBs were actually deployed and bound to the JNDI


I tried making link using jboss.xml but still didnt get succeeded


Is here anyone who can at-least give me a hint what could be the problem?

Thanks,
Uttam Kumar
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9962
    
163



This is incorrect. You should be pointing to the jndi name of the EJB, if you want the ejb-ref. Remove the java: part from it:



[My Blog] [JavaRanch Journal]
uttam kumar
Ranch Hand

Joined: Jan 27, 2009
Posts: 128

I even tried that one but still problem didn't solved. Please suggest.

Thanks,
Uttam Kumar
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9962
    
163

1) Upgrade to 5.1.0 since 5.0.1 had many issues with deployment
2) Post the entire exception stacktrace with the changes that you did to your configs.
uttam kumar
Ranch Hand

Joined: Jan 27, 2009
Posts: 128

Here is the log:
uttam kumar
Ranch Hand

Joined: Jan 27, 2009
Posts: 128

While I am downloading JBoss 5.1.0 GA I would like you to have a look at the log and see if it gives you any hint.

Thanks for you support.

Regards,
Uttam Kumar
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9962
    
163

at com._360commerce.webmodules.employee.ui.LoginAttemptFilter.init(LoginAttemptFilter.java:67)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:234)


Looks like a deployment ordering issue. Your web application .war is being deployed before the EJBs are bound to JNDI. You'll have to add a dependency on the EJB container's MBean in your jboss-web.xml.
uttam kumar
Ranch Hand

Joined: Jan 27, 2009
Posts: 128

Thats it !!! it worked.

I added following entry into jboss-web.xml



Thanks for your help Jai.

Regards,
Uttam Kumar
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9962
    
163

You're welcome.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: EJB not bound
 
Similar Threads
Need help in calling a EJB from a WAR file
unresolved ejb-link
Referencing EJBs in a JAR file from a WAR
Accessing EJB from servlet in WAR file
Runtime Exception could not find <ejb-ref>'s local interface