wood burning stoves*
The moose likes JBoss/WildFly and the fly likes Problem Invoking MDB from MBean in JBOSS4.0.5GA Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Problem Invoking MDB from MBean in JBOSS4.0.5GA" Watch "Problem Invoking MDB from MBean in JBOSS4.0.5GA" New topic
Author

Problem Invoking MDB from MBean in JBOSS4.0.5GA

Faisal Ahmed Siddiqui
Greenhorn

Joined: Jan 03, 2002
Posts: 29
can anybody tell me the reason why i am getting this error in JBOSS4.0.5GA where as same application is running in JBOSS-3.2.6

javax.management.InstanceNotFoundException: jboss.j2ee:service=EJB,plugin=invoker,binding=message-dr
iven-bean,jndiName=local/ATTMessageProcessor is not registered.

i am calling my MDB from MBean
String mdbname="jboss.j2ee:service=EJB,plugin=invoker,binding=message-dr
iven-bean,jndiName=local/ATTMessageProcessor";
String operation="startDelivery";
List list=MBeanServerFactory.findMBeanServer(null);
Iterator itr=list.iterator();
MBeanServer server = (MBeanServer)itr.next();
ObjectName mbeanObjectName = new ObjectName(mdbname);
server.invoke(mbeanObjectName, operation, null, null);

its also working from the JMX interface when i look into the jboss.j2ee code.
but the only difference in the entry it shows is @14272226 after my JNDIName
binding=message-driven-bean,jndiName=local/ATTMessageProcessor@14272226,plugin=invoker,service=EJB
i refer to the wiki page
http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossMDB
and found a note

NOTE: that the default MDB local-jndi-name is derived from the ejb-name with a random integer appended, so to have a usable MBean name requires an explicit local-jndi-name setting in the jboss.xml descriptor.

i added the local-jndi-name element in my jboss.xml as mentioned below.

<message-driven>
<ejb-name>ATTMessageProcessor</ejb-name>
<local-jndi-name>ATTMessageProcessor</local-jndi-name>
<destination-jndi-name>queue/2_MessageProcessor</destination-jndi-name>
</message-driven>


but still getting the error InstanceNotFoundException..
note that i have added the entry of all queues being used in server/all/deploy-hasingelton/jms/jboss-destination-service.xml
i feel it might be problem of JMS Specs. as i think 3.2.6 is compliance the JMS1.0 where as JBOSS4.0.5 have the support of JMS1.1
[ May 17, 2007: Message edited by: Bear Bibeault ]

Architect<br />SCJP<br />SCWCD<br />IBM-486
Faisal Ahmed Siddiqui
Greenhorn

Joined: Jan 03, 2002
Posts: 29
ATTMessageProcessor is a simple MDB implementing the MessageDrivenBean and MessageListener
Faisal Ahmed Siddiqui
Greenhorn

Joined: Jan 03, 2002
Posts: 29
at last i got the solution...

<message-driven>
<ejb-name>ATTMessageProcessor</ejb-name>
<local-jndi-name>local/ATTMessageProcessor</local-jndi-name>
<destination-jndi-name>queue/2_MessageProcessor</destination-jndi-name>
</message-driven>
if you notice.. i just prefix local-jndi-name with local...
and problem resolved...
but unfortunately i still not found this entry in jboss4.0 dtd.
therefore i manually added.. this entry into the xdoclet .xdt template file.

i hope it will help out all ..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem Invoking MDB from MBean in JBOSS4.0.5GA