Bugs item #1045056, was opened at 2004-10-12 10:20
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=1045056&group_id=22866

Category: JBossServer
Group: v4.0
Status: Open
Resolution: None
Priority: 5
Submitted By: Chatterjee k (ckm1978)
Assigned to: Nobody/Anonymous (nobody)
Summary: EJB Deploy Fails jboss:service=WebService is not registered

Initial Comment:
Problem Description:

EJB Deployment fails with the following stacktrace:

14:25:26,392 ERROR [EjbModule] Initialization failed 
jboss.j2ee:module=jdalSubscription-
ejb.jar,service=EjbModule
org.jboss.util.NestedRuntimeException: Error creating 
MBeanProxy: jboss:service=WebService; - nested 
throwable: 
(javax.management.InstanceNotFoundException: 
jboss:service=WebService is not registered.)
        at org.jboss.mx.util.MBeanProxyExt.<init>
(MBeanProxyExt.java:77)
        at org.jboss.mx.util.MBeanProxyExt.create
(MBeanProxyExt.java:292)
        at org.jboss.mx.util.MBeanProxyExt.create
(MBeanProxyExt.java:247)
        at org.jboss.ejb.EjbModule.destroyService
(EjbModule.java:400)
        at org.jboss.ejb.EjbModule.createService
(EjbModule.java:346)


Operating System: Win2k, Win2k3, Linux

JDK Version: JDK1.4.2_03

How to Reproduce the bug:

The EJB deployment fails with the above stated 
StackTrace (More in attached Server log) when the 
application is creating and registering its own 
MBeanServer that co-exist with the JBoss MBean Server.

What Actually Happens:

1. The class MBeanProxyExt.java is responsible for 
getting the MBeanServer references, using which it tries 
to getMBeanInfo(ObjectName) of the WebServer MBean. 

2. Now, MBeanProxyExt.java uses 
MBeanServerLocator.java to findMBeanServer(). This 
method (of class MBeanServerFactory.java) returns an 
ArrayList of MBeanServer(s). 

3. When the application gets deployed, it creates and 
registers its own MBean Server that co-exists with the 
JBoss's MBeanServer. So, when you do a 
MBeanServerFactory.findMBeanServer(), it returns you a 
list of MBeanServer(s) and the order of appearance in 
the ArrayList is random. If there are 2 MBeanServers, 
sometimes you get one as the first element in the 
ArrayList, and sometimes the other. 

4. In MBeanServerLocator.java, there are 2 methods 
that calls findMBeanServer() - locate(), and locateJBoss
() 

5. Up untill JBoss 3.2.3, MBeanProxyExt.create(Class 
intf, ObjectName name) was calling 
MBeanServerLocator.locateJBoss(). This method 
categorically returns a JBoss MBeanServer. From JBoss 
3.2.5 (probably 3.2.4 as well - havent checked), the 
above call got replaced with MBeanServerLocator.locate
(). This method simply returns the first element of the 
ArrayList returned by the 
MBeanServerLocator.findMBeanServer()

So, sometimes you get the JBoss MBean Server, and the 
look up for WebService MBean is successful, and the 
EJBs get deployed properly. Sometimes, you get the OSP 
MBean Server, and the lookup fails. As the lookup for 
MBean Server and the WebService MBean happens for 
every EJB, the InstanceNotFoundException occurs for an 
EJB whenever the findMBeanServer() for that EJB returns 
you a non-JBoss MBeanServer. 


How to Fix this:

Simply replace the call to 
MBeanServerLocator.locateJBoss() in 
MBeanProxyExt.java with the call to 
MBeanServerLocator.locate()




----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=1045056&group_id=22866


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to