Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem Invoking MDB from MBean in JBOSS4.0.5GA

 
Faisal Ahmed Siddiqui
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Faisal Ahmed Siddiqui
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ATTMessageProcessor is a simple MDB implementing the MessageDrivenBean and MessageListener
 
Faisal Ahmed Siddiqui
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic