OIM11g: The Message-Driven EJB: oimKernelQueueMDB is throwing exception
Hi All,
I am getting the following error always and providing trobule to run schedule job "Issue Aduit Message Task"
####<Feb 25, 2013 11:40:21 PM EST> <Warning> <EJB> <oimhp02> <prod-oim_oim_server02> <[ACTIVE] ExecuteThread: '17' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <347b29a9270cc81f:-72dc63f2:13d10f9b16f:-8000-000000000001790a> <1361853621251> <BEA-010216> <The Message-Driven EJB: oimKernelQueueMDB is throwing exception when processing the messages. Delivery failed after *2,033 attempts*. The EJB container will suspend the message delivery for 60 seconds before retry.>
see now the attempt is 2033, its incresing ....
Env Detais:
OIM11g 11.3.3.6
Weblogic 10.3.3
DB Oracle 11.2
platform: linx redhat 5
Can you please help me to solve this issue? Thank you.
Check MOS Article: 1369008.1
-Bikash
Similar Messages
-
How to transaction in the message driven bean?
hello
i write a message driven bean,that monitor the weblogic message queue,when a "Order"
object is witten to the queue,the mdb get it and write it to a entity bean "Orderinfo".all
of above logic is within the "onMessage" method of the mdb.
i want to encapsulate the flow in a transaction,see my code snippet of the onMessage
method:
ObjectMessage objMsg = (ObjectMessage) msg;
OrderVO orderVO = (OrderVO) objMsg.getObject();
System.out.println(orderVO.booklist);
OrderinfoHome orderinfoHome = (OrderinfoHome) ctx.lookup(
"java:/comp/env/orderinfo");
Orderinfo orderinfo = orderinfoHome.create(orderVO.orderID);
orderinfo.setAddress(orderVO.address);
orderinfo.setCustname(orderVO.custName);
orderinfo.setEmail(orderVO.email);
orderinfo.setBooklist(orderVO.booklist);
orderinfo.setPrice(new BigDecimal(orderVO.price));
and deploy descriptor snippet(ejb-jar.xml):
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>orderMDB</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
i think during this transaction,there are two action:geting the object from the
queue and saving it to entity bean.in order to test the transaction,i modify the
jndi name of entity bean in the code to a WRONG one.redeploy my program,and send
a message to the queue,the mdb is activated,then the exception is thrown because
of the wrong jndi name.after that,i check the message queue,find that it is empty.why?i
think if the second action of the transaction is fail,the transaction should roll
back,the message should be send BACK to the queue.
i also ty to use the "javax.transaction.UserTransaction" in the onMessage method,but
the follwing exception is thrown:
javax.transaction.NotSupportedException: Another transaction is associated with
this thread.................................
who can help me,if any wrong with me,and how to use the transaction with the message
driven bean?
thank you.
The transaction should rollback if the MDB throws an
exception. Try changing your MDB code to
call "setRollbackOnly()" on the EJB
context (instead of throwing an exception) to see
if that works. If calling "setRollbackOnly()" fixes
the problem - then please contact customer support
and report a bug.
zbcong wrote:
> hello
>
> i write a message driven bean,that monitor the weblogic message queue,when a "Order"
> object is witten to the queue,the mdb get it and write it to a entity bean "Orderinfo".all
> of above logic is within the "onMessage" method of the mdb.
> i want to encapsulate the flow in a transaction,see my code snippet of the onMessage
> method:
>
>
> ObjectMessage objMsg = (ObjectMessage) msg;
> OrderVO orderVO = (OrderVO) objMsg.getObject();
> System.out.println(orderVO.booklist);
> OrderinfoHome orderinfoHome = (OrderinfoHome) ctx.lookup(
> "java:/comp/env/orderinfo");
> Orderinfo orderinfo = orderinfoHome.create(orderVO.orderID);
> orderinfo.setAddress(orderVO.address);
> orderinfo.setCustname(orderVO.custName);
> orderinfo.setEmail(orderVO.email);
> orderinfo.setBooklist(orderVO.booklist);
> orderinfo.setPrice(new BigDecimal(orderVO.price));
>
>
> and deploy descriptor snippet(ejb-jar.xml):
>
>
> <assembly-descriptor>
> ............
> ...........
>
> <container-transaction>
> <method>
> <ejb-name>orderMDB</ejb-name>
> <method-name>*</method-name>
> </method>
> <trans-attribute>Required</trans-attribute>
> </container-transaction>
> </assembly-descriptor>
>
>
> i think during this transaction,there are two action:geting the object from the
> queue and saving it to entity bean.in order to test the transaction,i modify the
> jndi name of entity bean in the code to a WRONG one.redeploy my program,and send
> a message to the queue,the mdb is activated,then the exception is thrown because
> of the wrong jndi name.after that,i check the message queue,find that it is empty.why?i
> think if the second action of the transaction is fail,the transaction should roll
> back,the message should be send BACK to the queue.
>
> i also ty to use the "javax.transaction.UserTransaction" in the onMessage method,but
> the follwing exception is thrown:
>
> javax.transaction.NotSupportedException: Another transaction is associated with
> this thread.................................
>
> who can help me,if any wrong with me,and how to use the transaction with the message
> driven bean?
>
> thank you.
>
>
-
[#|2008-09-17T07:32:06.973-0500|SEVERE|sun-appserver-ee8.2|javax.enterprise.system.container.ejb.mdb|_ThreadID=58;|MDB00050: Message-driven bean [OAHMSTcpIpServer1:eaTCPIP_cmTcpIpServer_Service1]: Exception in creating message-driven ejb : [java.lang.NullPointerException]|#]
[#|2008-09-17T07:32:06.974-0500|SEVERE|sun-appserver-ee8.2|javax.enterprise.system.container.ejb.mdb|_ThreadID=58;|java.lang.NullPointerException
java.lang.NullPointerException
at com.sun.enterprise.util.InvocationManagerImpl.preInvoke(InvocationManagerImpl.java:117)
at com.sun.ejb.containers.MessageBeanContainer.createMessageDrivenEJB(MessageBeanContainer.java:670)
at com.sun.ejb.containers.MessageBeanContainer.access$100(MessageBeanContainer.java:71)
at com.sun.ejb.containers.MessageBeanContainer$MessageBeanContextFactory.create(MessageBeanContainer.java:467)
at com.sun.ejb.containers.util.pool.NonBlockingPool.preload(NonBlockingPool.java:249)
at com.sun.ejb.containers.util.pool.NonBlockingPool.doResize(NonBlockingPool.java:473)
at com.sun.ejb.containers.util.pool.NonBlockingPool$IdleBeanWork.run(NonBlockingPool.java:568)
at com.sun.ejb.containers.util.pool.NonBlockingPool$IdleBeanWork.service(NonBlockingPool.java:560)
at com.sun.ejb.containers.util.WorkAdapter.doWork(WorkAdapter.java:44)
at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:409)
|#]Hello,
If I make use of the @EJB annotation again a NullPointerException is risen
package videoclub;
import java.awt.Component;
import java.awt.Container;
import java.awt.FocusTraversalPolicy;
import java.util.Vector;
import javax.annotation.Resource;
import javax.ejb.EJB;
import javax.swing.JOptionPane;
import vc.bl.ClerkSessionRemote;
import vc.domain.Customer;
* @author IOANNIS_PAPAIOANNOU
@EJB(name="ejb/ClerkSessionBean", beanInterface=ClerkSessionRemote.class, beanName="ClerkSessionBean")
public class Clerk extends javax.swing.JFrame
@Resource
javax.ejb.SessionContext sessionContext;
ClerkSessionRemote clerkSessionBean = (ClerkSessionRemote) sessionContext.lookup("ejb/ClerkSessionBean");
} The line:
ClerkSessionRemote clerkSessionBean = (ClerkSessionRemote) sessionContext.lookup("ejb/ClerkSessionBean");rises the exception
the output of the client:
init:
init:
deps-jar:
compile:
library-inclusion-in-archive:
Building jar: C:\Documents and Settings\IOANNIS_PAPAIOANNOU\My Documents\NetBeansProjects\VideoClub\VideoClub-ejb\dist\VideoClub-ejb.jar
dist:
deps-jar:
compile-single:
run-single:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at videoclub.Clerk.<init>(Clerk.java:33)
at videoclub.Clerk$2.run(Clerk.java:232)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
BUILD SUCCESSFUL (total time: 2 seconds)
Yiannis P. -
EJB is not throwing exception to calling Action class in Unix environment
Hi
We are using Weblogic Server 9.2.3.0.
One of our EJB is not throwing exception to calling Action class in Unix environment. Its working fine in Windows.
Somehow the EJB is swallowing the exception.
any idea? I suspect it may be environmental issue?
thank youHi
We are using Weblogic Server 9.2.3.0.
One of our EJB is not throwing exception to calling Action class in Unix environment. Its working fine in Windows.
Somehow the EJB is swallowing the exception.
any idea? I suspect it may be environmental issue?
thank you -
My problem in Weblogic and Message Driven Bean for Topic
Hello to all
I used this page (http://www.ecomputercoach.com/index.php/component/content/article/90-weblogic-jms-queue-setup.html?showall=1)
for setup JMS Server, Queue, Connection Factory on Weblogic Server
and I created a Message Driven Bean ,I used those Queue , and all things was OK
But I wanted to setup a Topic and use it in this manner
I created a Topic like previous steps for setup Queue
(http://www.ecomputercoach.com/index.php/component/content/article/90-weblogic-jms-queue-setup.html?showall=1)
Except in Step 3 ,I selected Topic instead of Queue
then I created a Message Driven Bean in JDeveloper , my Message Driven Bean is like this:
@MessageDriven(mappedName = "jndi.testTopic")
<p>
public class aliJMS1_MessageDrivenEJBBean implements MessageListener {
public void onMessage(Message message) {
if(message instanceof TextMessage ){
TextMessage txtM=(TextMessage) message;
try{
System.out.println(txtM.getText());
}catch(Exception ex){
ex.printStackTrace();
</p>
When I deploy the Application , Weblogic shows me this error:
+<Aug 30, 2011 11:32:28 AM PDT> <Warning> <EJB> <BEA-010061> <The Message-Driven EJB: aliJMS1_MessageDrivenEJBBean is unable to connect to th+
e JMS destination: jndi.testTopic. The Error was:
+[EJB:011011]The Message-Driven EJB attempted to connect to the JMS destination with the JNDI name: jndi.testTopic. However, the object with+
the JNDI name: jndi.testTopic is not a JMS destination, or the destination found was of the wrong type (Topic or Queue).>
And when I send message to the topic The Message Dirven Bean dosen't work
But when I create an ordinary Java application like this (it uses that Tpoic) :
import java.io.*;
import java.util.*;
import javax.transaction.*;
import javax.naming.*;
import javax.jms.*;
public class TopicReceive implements MessageListener
public final static String JNDI_FACTORY =
"weblogic.jndi.WLInitialContextFactory";
public final static String JMS_FACTORY =
"jndi.testConnectionFactory";
public final static String TOPIC = "jndi.testTopic";
private TopicConnectionFactory tconFactory;
private TopicConnection tcon;
private TopicSession tsession;
private TopicSubscriber tsubscriber;
private Topic topic;
private boolean quit = false;
public void onMessage(Message msg) {
try {
String msgText;
if (msg instanceof TextMessage) {
msgText = ((TextMessage)msg).getText();
} else {
msgText = msg.toString();
System.out.println("JMS Message Received: " + msgText);
if (msgText.equalsIgnoreCase("quit")) {
synchronized (this) {
quit = true;
this.notifyAll();
} catch (JMSException jmse) {
jmse.printStackTrace();
public void init(Context ctx, String topicName) throws NamingException,
JMSException {
tconFactory = (TopicConnectionFactory)ctx.lookup(JMS_FACTORY);
tcon = tconFactory.createTopicConnection();
tsession = tcon.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
topic = (Topic)ctx.lookup(topicName);
tsubscriber = tsession.createSubscriber(topic);
tsubscriber.setMessageListener(this);
tcon.start();
public void close() throws JMSException {
tsubscriber.close();
tsession.close();
tcon.close();
public static void main(String[] args) throws Exception {
InitialContext ic = getInitialContext("t3://127.0.0.1:7001");
TopicReceive tr = new TopicReceive();
tr.init(ic, TOPIC);
System.out.println("JMS Ready To Receive Messages (To quit, send a \"quit\" message).");
synchronized (tr) {
while (!tr.quit) {
try {
tr.wait();
} catch (InterruptedException ie) {
tr.close();
private static InitialContext getInitialContext(String url) throws NamingException {
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, JNDI_FACTORY);
env.put(Context.PROVIDER_URL, url);
env.put("weblogic.jndi.createIntermediateContexts", "true");
return new InitialContext(env);
It's OK and shows messages When I send message to the Topic
Now I want know why the Message Driven Bean doesn't work for those Topic
I want create a Message Driven Bean for Topic in the same way I created for Queue
I don't know what is problem , please advice me
ThanksCould you try adding a activationconfig to the message-driven bean, for example,
@MessageDriven(mappedName = "jndi.testTopic", activationConfig = {
@ActivationConfigProperty(propertyName = "destinationName", propertyValue = "jndi.testTopic"),
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic")
public class aliJMS1_MessageDrivenEJBBean implements MessageListener {
public void onMessage(Message message) {
if(message instanceof TextMessage ){
TextMessage txtM=(TextMessage) message;
try{
System.out.println(txtM.getText());
}catch(Exception ex){
ex.printStackTrace();
} -
Error during deployment of Message Driven Bean
Environment: WLS 6.1SP3 on Win2K SP2, non-clustered.
I am getting some error (or perhaps warning) during deployment of Message
Driven Bean. Any one seen this before?
This error only comes on a machine with Dual Network card.
Thanks.
####<Dec 11, 2002 1:23:04 AM GMT> <Info> <EJB> <QAAPP01> <Makalu> <main>
<system> <> <010008> <EJB Deploying file: AppRuntime.jar>
####<Dec 11, 2002 1:23:04 AM GMT> <Warning> <J2EE> <QAAPP01> <Makalu> <main>
<system> <> <160007> <You are running WebLogic Server with J2EE 1.3 features
enabled. The implementation of specific J2EE 1.3 features (EJB 2.0, JSP 1.2,
Servlet 2.3, and J2EE Connector Architecture 1.0) in BEA WebLogic Server 6.1
is of a non-final version of the appropriate specification. It is subject to
change in future releases once the specification becomes finalized. This may
cause application code developed for BEA WebLogic Server 6.1 that uses the
new features of J2EE 1.3 to be incompatible with the J2EE 1.3 platform
supported in future releases of BEA WebLogic Server.>
####<Dec 11, 2002 1:23:07 AM GMT> <Warning> <EJB> <QAAPP01> <Makalu> <main>
<system> <> <010061> <The Message-Driven EJB: ASYNCMessageDrivenBean is
unable to connect to the JMS destination: CQM_MessageQueue. The EJB
container will automatically attempt to re-establish the connection with the
JMS server. This warning may occur during WebLogic Cluster start-up if the
JMS destination is located on another server. When the JMS server connection
is re-established, the Message-Driven EJB will again receive JMS messages.
The Error was:
Unable to create a JNDI InitialContext to lookup the JMS destination. The
error was:
javax.naming.CommunicationException. Root exception is
java.net.ConnectException: t3://127.0.0.1:7001: Destination unreachable;
nested exception is:
java.net.ConnectException: Connection refused: connect; No available router
to destination
at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:155)
at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:207)
at
weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialCon
textFactoryDelegate.java:307)
at
weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialCon
textFactoryDelegate.java:211)
at
weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFact
ory.java:149)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:660)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:241)
at javax.naming.InitialContext.init(InitialContext.java:217)
at javax.naming.InitialContext.<init>(InitialContext.java:193)
at
weblogic.ejb20.deployer.MessageDrivenBeanInfoImpl.getInitialContext(MessageD
rivenBeanInfoImpl.java:641)
at
weblogic.ejb20.internal.JMSConnectionPoller.createJMSConnection(JMSConnectio
nPoller.java:474)
at
weblogic.ejb20.internal.JMSConnectionPoller.connectToJMS(JMSConnectionPoller
.java:418)
at
weblogic.ejb20.internal.JMSConnectionPoller.startJMSConnectionPolling(JMSCon
nectionPoller.java:286)
at
weblogic.ejb20.deployer.MessageDrivenBeanInfoImpl.deploy(MessageDrivenBeanIn
foImpl.java:511)
at weblogic.ejb20.deployer.Deployer.deployDescriptor(Deployer.java:1294)
at weblogic.ejb20.deployer.Deployer.deploy(Deployer.java:996)
at weblogic.j2ee.EJBComponent.deploy(EJBComponent.java:31)
at weblogic.j2ee.Application.addComponent(Application.java:170)
at weblogic.j2ee.J2EEService.addDeployment(J2EEService.java:117)
at
weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentT
arget.java:360)
at
weblogic.management.mbeans.custom.DeploymentTarget.addDeployments(Deployment
Target.java:285)
at
weblogic.management.mbeans.custom.DeploymentTarget.updateServerDeployments(D
eploymentTarget.java:239)
at
weblogic.management.mbeans.custom.DeploymentTarget.updateDeployments(Deploym
entTarget.java:199)
at java.lang.reflect.Method.invoke(Native Method)
at
weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl
.java:636)
at
weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:6
21)
at
weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBea
nImpl.java:360)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1557)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1525)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:468)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:209)
at $Proxy34.updateDeployments(Unknown Source)
at
weblogic.management.configuration.ServerMBean_CachingStub.updateDeployments(
ServerMBean_CachingStub.java:2977)
at
weblogic.management.mbeans.custom.ApplicationManager.startConfigManager(Appl
icationManager.java:372)
at
weblogic.management.mbeans.custom.ApplicationManager.start(ApplicationManage
r.java:160)
at java.lang.reflect.Method.invoke(Native Method)
at
weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl
.java:636)
at
weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:6
21)
at
weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBea
nImpl.java:360)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1557)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1525)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:468)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:209)
at $Proxy49.start(Unknown Source)
at
weblogic.management.configuration.ApplicationManagerMBean_CachingStub.start(
ApplicationManagerMBean_CachingStub.java:480)
at weblogic.management.Admin.startApplicationManager(Admin.java:1234)
at weblogic.management.Admin.finish(Admin.java:644)
at weblogic.t3.srvr.T3Srvr.start(T3Srvr.java:524)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:207)
at weblogic.Server.main(Server.java:35)
>
####<Dec 11, 2002 1:23:07 AM GMT> <Info> <EJB> <QAAPP01> <Makalu> <main>
<system> <> <010009> <EJB Deployed EJB with JNDI name
ASYNCMessageDrivenBean.>
Hi Tom
Yes we do have an URL provided in the descriptor. It's
t3://jms.server.net:7001.
and the jms.server.net is resolved via a hosts file in Win2K
eg,
192.168.100.200 jms.server.net
You are right in saying that the loopback in a dual-net card is a problem.
But our solution
above solves the issue as long as your host file does not use 127.0.0.1 as
the IP.
We need the URL b/c depending on our client's deployment , the JMS Server
may be remote or may be local.
"Tom Barnes" <[email protected]> wrote in message
news:[email protected]...
> Hi x,
>
> Something to do with the loopback and dual-network cards is
> messin' with WLS' mind. I do not know what the problem is,
> but I can guess:
>
> You have specified an URL in the MDB descriptor when there
> is no need for one. If t3://127.0.0.1:7001 is in the same
> cluster the MDB is running in (I suspect this URL is
> actually the same WL server), then don't specify the URL.
> This URL is only useful for connecting an MDB to a JMS
> server that is outside local server and outside the cluster.
> The URL may be working on single-network card systems
> as perhaps then WL has enough info to guess that you
> actually mean the local WL server, and simply converts
> the context to a local context.
>
> Note that the URL option in the MDB descriptor is actually
> a WebLogic extension of J2EE.
>
> Tom
>
>
>
> x wrote:
> > Environment: WLS 6.1SP3 on Win2K SP2, non-clustered.
> >
> > I am getting some error (or perhaps warning) during deployment of
Message
> > Driven Bean. Any one seen this before?
> > This error only comes on a machine with Dual Network card.
> >
> > Thanks.
> >
> >
> >
> > ####<Dec 11, 2002 1:23:04 AM GMT> <Info> <EJB> <QAAPP01> <Makalu> <main>
> > <system> <> <010008> <EJB Deploying file: AppRuntime.jar>
> > ####<Dec 11, 2002 1:23:04 AM GMT> <Warning> <J2EE> <QAAPP01> <Makalu>
<main>
> > <system> <> <160007> <You are running WebLogic Server with J2EE 1.3
features
> > enabled. The implementation of specific J2EE 1.3 features (EJB 2.0, JSP
1.2,
> > Servlet 2.3, and J2EE Connector Architecture 1.0) in BEA WebLogic Server
6.1
> > is of a non-final version of the appropriate specification. It is
subject to
> > change in future releases once the specification becomes finalized. This
may
> > cause application code developed for BEA WebLogic Server 6.1 that uses
the
> > new features of J2EE 1.3 to be incompatible with the J2EE 1.3 platform
> > supported in future releases of BEA WebLogic Server.>
> > ####<Dec 11, 2002 1:23:07 AM GMT> <Warning> <EJB> <QAAPP01> <Makalu>
<main>
> > <system> <> <010061> <The Message-Driven EJB: ASYNCMessageDrivenBean is
> > unable to connect to the JMS destination: CQM_MessageQueue. The EJB
> > container will automatically attempt to re-establish the connection with
the
> > JMS server. This warning may occur during WebLogic Cluster start-up if
the
> > JMS destination is located on another server. When the JMS server
connection
> > is re-established, the Message-Driven EJB will again receive JMS
messages.
> > The Error was:
> > Unable to create a JNDI InitialContext to lookup the JMS destination.
The
> > error was:
> > javax.naming.CommunicationException. Root exception is
> > java.net.ConnectException: t3://127.0.0.1:7001: Destination unreachable;
> > nested exception is:
> > java.net.ConnectException: Connection refused: connect; No available
router
> > to destination
> > at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:155)
> > at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:207)
> > at
> >
weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialCon
> > textFactoryDelegate.java:307)
> > at
> >
weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialCon
> > textFactoryDelegate.java:211)
> > at
> >
weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFact
> > ory.java:149)
> > at
javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:660)
> > at
javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:241)
> > at javax.naming.InitialContext.init(InitialContext.java:217)
> > at javax.naming.InitialContext.<init>(InitialContext.java:193)
> > at
> >
weblogic.ejb20.deployer.MessageDrivenBeanInfoImpl.getInitialContext(MessageD
> > rivenBeanInfoImpl.java:641)
> > at
> >
weblogic.ejb20.internal.JMSConnectionPoller.createJMSConnection(JMSConnectio
> > nPoller.java:474)
> > at
> >
weblogic.ejb20.internal.JMSConnectionPoller.connectToJMS(JMSConnectionPoller
> > .java:418)
> > at
> >
weblogic.ejb20.internal.JMSConnectionPoller.startJMSConnectionPolling(JMSCon
> > nectionPoller.java:286)
> > at
> >
weblogic.ejb20.deployer.MessageDrivenBeanInfoImpl.deploy(MessageDrivenBeanIn
> > foImpl.java:511)
> > at
weblogic.ejb20.deployer.Deployer.deployDescriptor(Deployer.java:1294)
> > at weblogic.ejb20.deployer.Deployer.deploy(Deployer.java:996)
> > at weblogic.j2ee.EJBComponent.deploy(EJBComponent.java:31)
> > at weblogic.j2ee.Application.addComponent(Application.java:170)
> > at weblogic.j2ee.J2EEService.addDeployment(J2EEService.java:117)
> > at
> >
weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentT
> > arget.java:360)
> > at
> >
weblogic.management.mbeans.custom.DeploymentTarget.addDeployments(Deployment
> > Target.java:285)
> > at
> >
weblogic.management.mbeans.custom.DeploymentTarget.updateServerDeployments(D
> > eploymentTarget.java:239)
> > at
> >
weblogic.management.mbeans.custom.DeploymentTarget.updateDeployments(Deploym
> > entTarget.java:199)
> > at java.lang.reflect.Method.invoke(Native Method)
> > at
> >
weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl
> > .java:636)
> > at
> >
weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:6
> > 21)
> > at
> >
weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBea
> > nImpl.java:360)
> > at
com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1557)
> > at
com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1525)
> > at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:468)
> > at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:209)
> > at $Proxy34.updateDeployments(Unknown Source)
> > at
> >
weblogic.management.configuration.ServerMBean_CachingStub.updateDeployments(
> > ServerMBean_CachingStub.java:2977)
> > at
> >
weblogic.management.mbeans.custom.ApplicationManager.startConfigManager(Appl
> > icationManager.java:372)
> > at
> >
weblogic.management.mbeans.custom.ApplicationManager.start(ApplicationManage
> > r.java:160)
> > at java.lang.reflect.Method.invoke(Native Method)
> > at
> >
weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl
> > .java:636)
> > at
> >
weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:6
> > 21)
> > at
> >
weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBea
> > nImpl.java:360)
> > at
com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1557)
> > at
com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1525)
> > at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:468)
> > at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:209)
> > at $Proxy49.start(Unknown Source)
> > at
> >
weblogic.management.configuration.ApplicationManagerMBean_CachingStub.start(
> > ApplicationManagerMBean_CachingStub.java:480)
> > at weblogic.management.Admin.startApplicationManager(Admin.java:1234)
> > at weblogic.management.Admin.finish(Admin.java:644)
> > at weblogic.t3.srvr.T3Srvr.start(T3Srvr.java:524)
> > at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:207)
> > at weblogic.Server.main(Server.java:35)
> >
> > ####<Dec 11, 2002 1:23:07 AM GMT> <Info> <EJB> <QAAPP01> <Makalu> <main>
> > <system> <> <010009> <EJB Deployed EJB with JNDI name
> > ASYNCMessageDrivenBean.>
> >
> >
>
-
Assining Identity to Message Driven Bean
Dear All,
I have a problem on connecting MDB to JMS administered object in iPlanet server.
In the administered object I create an ACI to allows only a certain member of
group can access this ao. Disallowing anonymous user to connect to the ldap server
give me this error.
<Apr 15, 2003 1:41:09 PM SGT> <Warning> <EJB> <010096> <The Message-Driven EJB:
MessageEJB is unable to connect to the J
MS destination: cn=ocsQueue. Connection failed after 365 attempts. The MDB will
attempt to reconnect every 10 seconds, t
his log message will repeat every 600 seconds until the condition clears.>
<Apr 15, 2003 1:41:09 PM SGT> <Warning> <EJB> <010061> <The Message-Driven EJB:
MessageEJB is unable to connect to the J
MS destination: cn=ocsQueue. The EJB container will automatically attempt to re-establish
the connection with the JMS se
rver. This warning may occur during WebLogic Cluster start-up if the JMS destination
is located on another server. When
the JMS server connection is re-established, the Message-Driven EJB will again
receive JMS messages.
The Error was:
The Message-Driven EJB attempted to connect to the JMS destination with the JNDI
name: cn=ocsQueue. However, the object
with the JNDI name: cn=ocsQueue is not a JMS destination, or the destination found
was of the wrong type (Topic or Queue
).>
How can I configure the security descriptor so that my MDB can gen a connection
to ldap to read the administered object.
I am working on WebLogic 7.0 sp1 and iPlanet
Thanks,
WayanHi Yang,
The J2EE tutorial will give some more information.
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/
See Ch. 28 A Message-Driven Bean example. It has some tips on using deploytool.
Hope this helps,
J -
Message Driven bean not able to listen to IBM MQ
Hello,
I am trying to implement a Mesage Driven Bean on Weblogic 7.0.This MDB
would listen on a particular queue of IBM MQ.
I have written a Weblogic startUp class which registers the factory
into Weblogic JNDI.Am I supposed to register the queue as well? I am
confused about the queue part. In the deployement descriptor of the
MDB (weblogic-ejb-jar.xml), we have the the <destination-jndi-name>
tag which should be the Queue name (in my case the IBM MQ queue ). Am
I supposed to register that in the Weblogic JNDI as well? I mean do I
add the Queue part in my Weblogic start-up class as well? Else how
will The Queue be obtained?
I am sort of confused on this . I get the error :
<Apr 16, 2003 3:17:14 PM EDT> <Warning> <EJB> <010061> <The
Message-Driven EJB: SimpleMDB is unable
to connect to the JMS destination: ivtQ. The EJB container will
automatically attempt to re-establis
h the connection with the JMS server. This warning may occur during
WebLogic Cluster start-up if the
JMS destination is located on another server. When the JMS server
connection is re-established, the
Message-Driven EJB will again receive JMS messages.
The Error was:
The JMS destination with the JNDI name: ivtQ could not be found.
Please ensure that the JNDI name in
the weblogic-ejb-jar.xml is correct, and the JMS destination has been
deployed.>
Please guide .I am trying to find out this information(which isn`t
very difficult i think ) since quite a few days now but I have got no
reply whatsoever.Please let me know if I am posting in the wrong group
or should I place my query in some other group where I can get a
better response.
Thanks and regards,
Milan Doshi
I'm not familiar with this stuff, but Greg is out, so
hey, I'll give it a shot. Some random thoughts:
It seems odd that the MDB can find the factory in JNDI but
not the queue.
Make sure that the startup class is actually running the code
you think it is. Put println's before and after the queue binding
code. And as the white-paper suggests, use the "failure is
fatal" option for the startup class so that you know
if the class worked or not...
Put some trace code in the ignored "NumberFormatException" catch below.
Carefully check you log to see if there are other warnings or errors.
Note that you may wish to use MQ JNDI instead of createQueue
in the startup class to look up the queue. The "createQueue()"
will not necessarily return an object that is JNDI "capable", (vendor
specific)... If this is the case, then you will need to
write a "wrapper" class that implements Serializable but
finds its wrapped factory via some sort of static lookup.
Tom, BEA
P.S. Note that WebLogic 8.1 provides the ability
to "wrap" and deploy foreign JMS resources administratively
via the console. No startup class needed...
Milan Doshi wrote:
> Thanks for the response.
>
> I have written the startUp class but I am getting the following error:
>
> The Error was:
> The JMS destination with the JNDI name: MySenderQueue could not be
> found. Please ensure that the
> JNDI name in the weblogic-ejb-jar.xml is correct, and the JMS
> destination has been deployed.>
>
> =====
>
> My startup class is as follows:
>
> String qmPort = (String)args.get(QM_PORT_PROPERTY);
> String qmHost = (String)args.get(QM_HOST_PROPERTY);
> String qmName = (String)args.get(QM_NAME_PROPERTY);
>
> MQQueueConnectionFactory factory = new MQQueueConnectionFactory();
>
> factory.setQueueManager(qmName);
> factory.setHostName(qmHost);
> if (qmPort != null)
> {
> try
> {
> int portNum = Integer.parseInt(qmPort);
> factory.setPort(portNum);
> }
> catch (NumberFormatException ignore)
> {
>
> }
> }
> if (qmHost == null)
> {
> factory.setTransportType(JMSC.MQJMS_TP_BINDINGS_MQ);
>
>
> }
> else
> {
> factory.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);
> }
>
> InitialContext context = new InitialContext();
> context.bind(jndiName, factory);
>
> QueueConnection connection = factory.createQueueConnection();
> boolean transacted = false;
> QueueSession session = connection.createQueueSession( transacted,
> Session.AUTO_ACKNOWLEDGE);
> Queue ioQueue = session.createQueue("MySenderQueue");
>
> context.bind("MySenderQueue",ioQueue);
> context.close();
>
>
> ===================================================
>
> My Weblogic-ejb-jar.xml is like this:
>
> <weblogic-ejb-jar>
> <weblogic-enterprise-bean>
> <ejb-name>SimpleMDB</ejb-name>
> <message-driven-descriptor>
> <pool>
> <max-beans-in-free-pool>8</max-beans-in-free-pool>
> <initial-beans-in-free-pool>1</initial-beans-in-free-pool>
> </pool>
> <destination-jndi-name>MySenderQueue</destination-jndi-name>
> <connection-factory-jndi-name>
> MyQCF
> </connection-factory-jndi-name>
> </message-driven-descriptor>
> </weblogic-enterprise-bean>
> </weblogic-ejb-jar>
>
> ======================================================
>
> Can you please guide me what is wrong in registering the Queue?
>
> Thanks once again for the response,
>
> Milan Doshi
>
>
> "Greg Brail" <[email protected]> wrote in message news:<[email protected]>...
>
>>You don't have to use a startup class to do this unless you want to. If you
>>use IBM's "JMSAdmin" tool to register the MQ connection factory and
>>destination objects into a JNDI provider, then you need only specify the
>>right JNDI stuff in weblogic-ejb-jar.xml. You might want to look at the
>>white paper for more information on exactly how to do this:
>>
>>http://dev2dev.bea.com/resourcelibrary/whitepapers/jmsproviders.jsp
>>
>>However, there might be reasons to use the startup class anyway. With the
>>startup class, you don't have to mess with a JNDI provider for MQ. The white
>>paper also contains a sample startup class.
>>
>>If you do this with a startup class, you do indeed need to bind BOTH the
>>MQSeries ConnectionFactory and Queue objects into WebLogic JNDI. You then
>>need to make the MDB use those particular objects (the ones you created in
>>the startup class) for both the connection factory and the queue. The
>>resulting weblogic-ejb-jar.xml file would look like this:
>>
>><weblogic-ejb-jar>
>> <weblogic-enterprise-bean>
>> <ejb-name>YourMDBName</ejb-name>
>> <message-driven-descriptor>
>> <pool>
>> <max-beans-in-free-pool>8</max-beans-in-free-pool>
>> <initial-beans-in-free-pool>1</initial-beans-in-free-pool>
>> </pool>
>> <destination-jndi-name>
>> YourQueueNameFromTheStartupClass
>> </destination-jndi-name>
>> <connection-factory-jndi-name>
>> ConnectionFactoryNameFromTheStartupClass
>> </connection-factory-jndi-name>
>> </message-driven-descriptor>
>> </weblogic-enterprise-bean>
>></weblogic-ejb-jar>
>>
>>Hope this helps.
>>
>> greg
>>
>>"Milan Doshi" <[email protected]> wrote in message
>>news:[email protected]...
>>
>>>Hello,
>>>
>>>I am trying to implement a Mesage Driven Bean on Weblogic 7.0.This MDB
>>>would listen on a particular queue of IBM MQ.
>>>
>>>I have written a Weblogic startUp class which registers the factory
>>>into Weblogic JNDI.Am I supposed to register the queue as well? I am
>>>confused about the queue part. In the deployement descriptor of the
>>>MDB (weblogic-ejb-jar.xml), we have the the <destination-jndi-name>
>>>tag which should be the Queue name (in my case the IBM MQ queue ). Am
>>>I supposed to register that in the Weblogic JNDI as well? I mean do I
>>>add the Queue part in my Weblogic start-up class as well? Else how
>>>will The Queue be obtained?
>>>
>>>I am sort of confused on this . I get the error :
>>>
>>><Apr 16, 2003 3:17:14 PM EDT> <Warning> <EJB> <010061> <The
>>>Message-Driven EJB: SimpleMDB is unable
>>>to connect to the JMS destination: ivtQ. The EJB container will
>>>automatically attempt to re-establis
>>>h the connection with the JMS server. This warning may occur during
>>>WebLogic Cluster start-up if the
>>> JMS destination is located on another server. When the JMS server
>>>connection is re-established, the
>>> Message-Driven EJB will again receive JMS messages.
>>>The Error was:
>>>The JMS destination with the JNDI name: ivtQ could not be found.
>>>Please ensure that the JNDI name in
>>> the weblogic-ejb-jar.xml is correct, and the JMS destination has been
>>>deployed.>
>>>
>>>Please guide .I am trying to find out this information(which isn`t
>>>very difficult i think ) since quite a few days now but I have got no
>>>reply whatsoever.Please let me know if I am posting in the wrong group
>>>or should I place my query in some other group where I can get a
>>>better response.
>>>
>>>Thanks and regards,
>>>
>>>Milan Doshi
>>
-
WebLogic 10 and EJB 3.0 for Message Driven Bean
Hi,
I am trying to deploy Message Driven Bean using EJB3.0 on weblogic 10. I am using annotations and don't want to use deployment descriptors.
The Bean class:
CalculatorBean.java
import javax.ejb.*;
import javax.jms.*;
import java.sql.Timestamp;
import java.util.StringTokenizer;
@MessageDriven(activationConfig =
@ActivationConfigProperty(propertyName="destinationType",
propertyValue="javax.jms.Queue"),
@ActivationConfigProperty(propertyName="destination",
propertyValue="queue/mdb")
public class CalculatorBean implements MessageListener {
public void onMessage (Message msg) {
TextMessage tmsg=null;
try {
if (msg instanceof TextMessage) {
tmsg = (TextMessage) msg;
System.out.println
("MESSAGE BEAN1: Message received: "
+ tmsg.getText());
} else {
System.out.println
("Message of wrong type1: "
+ msg.getClass().getName());
catch (JMSException e) {
e.printStackTrace();
catch (Throwable te) {
te.printStackTrace();
My client:
import javax.naming.*;
import javax.naming.InitialContext;
import java.text.*;
import javax.jms.*;
public class MsgClient {
public static void main(String args[])
QueueConnection cnn=null;
QueueSender sender=null;
QueueSession sess=null;
Queue queue=null;
try {
java.util.Properties p = new java.util.Properties();
p.put("java.naming.factory.initial","weblogic.jndi.WLInitialContextFactory");
p.put("java.naming.provider.url","t3://10.6.74.79:7001");
Context ctx=new InitialContext(p);
//InitialContext ctx=new InitialContext(p);
queue = (Queue)ctx.lookup("queue/mdb");
QueueConnectionFactory factory = (QueueConnectionFactory)ctx.lookup("ConnectionFactory");
cnn = factory.createQueueConnection();
sess= cnn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
sender = sess.createSender(queue);
TextMessage message = sess.createTextMessage();
message.setText("This is message by Gurumurthy" );
System.out.println("Sending message: " +message.getText());
sender.send(message);
sess.close();
catch (Exception e)
e.printStackTrace();
I am compiling and creating jar file for this class. Then I am creating a .ear file for this.
The meta-inf/application.xml contains the following:
<?xml version="1.0" encoding="UTF-8"?>
<application xmlns="http://java.sun.com/xml/ns/j2ee" version="1.4"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com /xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application_1_4.xsd">
<display-name>MDBWorking1</display-name>
<description>Application description</description>
<module>
<ejb>MDBWorking1.jar</ejb>
</module>
</application>
I don't want to use deployment descriptor (ejb-jar.xml or weblogic-ejb-jar-xml), because I want to utilize the annotation feature of EJB3.0
So, after creating the .ear file for this, and try to deploy on weblogic 10, I get the following error:
An error occurred during activation of changes, please see the log for details.
Exception preparing module: EJBModule(MDBWorking1.jar) Unable to deploy EJB: CalculatorBean from MDBWorking1.jar: [EJB:011113]Error: The Message Driven Bean 'CalculatorBean(Application: MDBWorking1, EJBComponent: MDBWorking1.jar)', does not have a message destination configured. The message destination must be set using a message-destination-link, destination-resource-link, destination-jndi-name or a resource-adapter-jndi-name.
Substituted for missing class [EJB - 11113]Error: The Message Driven Bean 'CalculatorBean(Application: MDBWorking1, EJBComponent: MDBWorking1.jar)', does not have a message destination configured. The message destination must be set using a message-destination-link, destination-resource-link, destination-jndi-name or a resource-adapter-jndi-name.
How to solve this?
Note:
I don't want to use Deployment Descriptor and all I want to use is EJB3.0's annotation feature.
Thanks,
GuruDear gurubbc,
I don't know if it still matters to you but you can use the javax.ejb.MessageDriven annotation to point your bean on your queue. I had the same issue like you but i could not solve it properly by switchihg to weblogic.ejb.MessageDriven.
Use the following annotation and it should work out:
@MessageDriven
(mappedName = "queue/mdb",
name = "CalculatorBean",
activationConfig = {
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue")
Here you can see that the mappedName is the JNDI name of the queue you are trying to connect to. The name is the name for your Bean, and the only property passed is the destination type.
Hope this helps.
Cheers,
Istvan -
Error while deploying a message driven bean
I am deployeing a MDB which is done successfully but the message is not retrieved(No message in teh queue). The following description is given in the log file.
#1.5#0016E6197593004B0000000B000013040004288DE20D6CD8#1170489754872#com.sap.security.core.policy.PolicyInfoManagerImpl##com.sap.security.core.policy.PolicyInfoManagerImpl.copyApplicationConfiguration#Administrator#523####e5dbec01b35c11db90e70016e6197593#SAPEngine_Application_Thread[impl:3]_39##0#0#Error#1#/System/Security/WS/SecurityProtocol#Java###An error occured while copying configurations for application . Reason: #3#sap.com/MessageEAR#com.sap.engine.frame.core.configuration.NameNotFoundException#A configuration with the path "webservices/services/sap.com/MessageEAR" does not exist.#
Can you please tell where to look for it and what to do?the session bean is ::
public class SenderBean implements SessionBean {
public static final boolean DEBUG = false;
private SessionContext ctx;
private TopicConnectionFactory factory;
private TopicConnection connection;
private Topic topic;
public SenderBean() {
log("constructor");
public void ejbCreateSender() throws CreateException {
log("ejbCreate");
try {
InitialContext naming = new InitialContext();
factory = (TopicConnectionFactory)naming.lookup("jmsfactory/default/ExceptionTopicFactory");
topic = (Topic)naming.lookup("jmstopics/default/ExceptionTopic");
log("factory: " + factory);
allocateResources();
} catch (Exception exc) {
log("exception occured during ejbCreate().");
throw new CreateException("Unexpected exception in ejbCreate().");
public void ejbCreate() throws CreateException {
public void ejbActivate() {
log("ejbActivate");
try {
allocateResources();
} catch (Exception exc) {
exc.printStackTrace();
public void ejbPassivate() {
log("ejbPassivate");
try {
releaseResources();
} catch (Exception exc) {
exc.printStackTrace();
public void ejbRemove() {
log("ejbRemove");
public void setSessionContext(SessionContext _ctx) {
log("setSessionContext");
ctx = _ctx;
public void sendMessage(String text) throws MessageNotSentException {
log("sendMessage");
log("text = " + text);
TopicSession session = null;
try {
session = connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
log("topic = " + topic);
TopicPublisher publisher = session.createPublisher(topic);
TextMessage textMessage = session.createTextMessage();
textMessage.setText(text);
publisher.publish(textMessage);
System.out.println("Message Sent");
log("message sent");
} catch (JMSException jmse) {
jmse.printStackTrace();
throw new MessageNotSentException(jmse.toString());
} finally {
try {
if (session != null) {
session.close();
} catch (Exception exc) {
private void releaseResources() throws JMSException {
connection.close();
connection = null;
private void allocateResources() throws JMSException {
connection = factory.createTopicConnection();
log("connection = " + connection);
connection.start();
log("connection started");
private void log(String message) {
if (DEBUG) {
System.out.println("SenderBean: " + message);
the mdb is::
public class MessageDisplayBean implements MessageDrivenBean, MessageListener {
public static final boolean DEBUG = false;
private MessageDrivenContext ctx;
private QueueConnectionFactory factory;
private QueueConnection connection;
private Queue queue;
public MessageDisplayBean() {
System.out.println("In constructor");
log("constructor");
public void onMessage(Message message) {
TextMessage textMessage = (TextMessage)message;
try {
String text = textMessage.getText();
log("message received. Text follows:\n\n " + text + "\n\n");
connection = factory.createQueueConnection();
connection.start();
QueueSession session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
TextMessage confirmation = session.createTextMessage();
confirmation.setText("Message \""+ textMessage.getText() + "\" received.");
//queue = session.createQueue("ConfirmationQueue");
QueueSender sender = session.createSender(queue);
sender.send(confirmation);
session.close();
connection.close();
System.out.println("Message received");
} catch (javax.jms.JMSException jmse) {
public void ejbRemove() {
log("ejbRemove()");
public void setMessageDrivenContext(MessageDrivenContext _ctx) {
log("setMessageDrivenContext()");
ctx = _ctx;
System.out.println("In context");
public void ejbCreate() {
try {
System.out.println("In ejbcreate");
InitialContext naming = new InitialContext();
factory = (QueueConnectionFactory)naming.lookup("jmsfactory/default/ExceptionQueueFactory");
queue = (Queue)naming.lookup("jmsqueues/default/ExceptionQueue");
log("factory: " + factory);
} catch (Exception exc) {
log("exception occured during ejbCreate().");
log("ejbCreate()");
private void log(String str) {
if (DEBUG) {
System.out.println("MessageDisplayBean: " + str);
th ejb-j2ee-engine.xml is::
<ejb-j2ee-engine>
<enterprise-beans>
<enterprise-bean>
<ejb-name>MessageDisplayBean</ejb-name>
<jndi-name>MessageDisplayBean</jndi-name>
<message-props>
<destination-name>ExceptionTopic</destination-name>
<connection-factory-name>ExceptionTopicFactory</connection-factory-name>
</message-props>
</enterprise-bean>
<enterprise-bean>
<ejb-name>MessageSender</ejb-name>
<jndi-name>MessageSender</jndi-name>
<session-props/>
</enterprise-bean>
</enterprise-beans>
</ejb-j2ee-engine>
the ejb-jar.xml is::
<ejb-jar>
<display-name> Message Driver Bean Example </display-name>
<enterprise-beans>
<session>
<display-name> MessageSender </display-name>
<ejb-name>MessageSender</ejb-name>
<home>com.sap.message.sender.SenderHome</home>
<remote>com.sap.message.sender.Sender</remote>
<local-home>com.sap.message.sender.SenderLocalHome</local-home>
<local>com.sap.message.sender.SenderLocal</local>
<ejb-class>com.sap.message.sender.SenderBean</ejb-class>
<session-type>Stateful</session-type>
<transaction-type>Container</transaction-type>
<ejb-local-ref>
<ejb-ref-name>ejb/SenderBean</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>com.sap.message.sender.SenderLocalHome</local-home>
<local>com.sap.message.sender.SenderLocal</local>
<ejb-link>MyEJB.jar#MessageSender</ejb-link>
</ejb-local-ref>
<resource-ref>
<res-ref-name>ExceptionTopicFactory</res-ref-name>
<res-type>javax.jms.TopicConnectionFactory</res-type>
<res-auth> Container</res-auth>
</resource-ref>
<resource-env-ref>
<resource-env-ref-name>ExceptionTopic </resource-env-ref-name>
<resource-env-ref-type> javax.jms.Topic </resource-env-ref-type>
</resource-env-ref>
</session>
<message-driven>
<ejb-name>MessageDisplayBean</ejb-name>
<ejb-class>com.sap.message.mdb.MessageDisplayBean</ejb-class>
<transaction-type>Container</transaction-type>
<message-driven-destination>
<destination-type>javax.jms.Topic</destination-type>
</message-driven-destination>
<resource-ref>
<res-ref-name> ExceptionQueueFactory </res-ref-name>
<res-type> javax.jms.QueueConnectionFactory </res-type>
<res-auth> Container </res-auth>
</resource-ref>
<resource-env-ref>
<resource-env-ref-name> ExceptionQueue </resource-env-ref-name>
<resource-env-ref-type> javax.jms.Queue </resource-env-ref-type>
</resource-env-ref>
</message-driven>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>MessageDisplayBean</ejb-name>
<method-name>onMessage</method-name>
</method>
<trans-attribute> NotSupported </trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar> -
Usage of Apache Beehive JMS control inside Message Driven Bean
Hi,
I am developing a j2ee application using weblogic workshop 10.3. This application contains the following three projects.
- J2EE Utility Project
- Message Driven Bean Project
- Ear Project
In the Utility project I have created one apache beehive jms control. I am using this control inside the message driven bean application. I haven't got any issues during the development and deployment phase with the beehive control. But during runtime the apache beehive jms control is not getting instantiated and the mdb application is throwing the null pointer exception when the EJB container try to execute the methods on the control instance. I have used the declarative programming model to create the control instance inside the mdb application.
I am using the weblogic 10.3 server for testing and I have created the 10.3 weblogic+workshop domain. By default it has the beehive libraries deployed.
Can somebody help me out to resolve this issue?
Regards,
BpYou can get the message directly with getText() method. Following is the snippet of code.
if (aMsg instanceof TextMessage) {
TextMessage msg = (TextMessage) aMsg;
String testMessage = msg.getText());
Kishore. -
Message driven bean and message style web service
Hi,
I'm trying to deploy a message style web service with a message driven EJB as
the receiver and am getting the following exception:
<Jan 22, 2002 10:51:06 AM PST> <Warning> <EJB> <MessageDrivenBean threw an Exception
in onMessage(). The exception was:
java.lang.ClassCastException: weblogic.jms.common.ObjectMessageImpl
java.lang.ClassCastException: weblogic.jms.common.ObjectMessageImpl
at credit.message.PostDefaultPayment.onMessage(PostDefaultPayment.java:24)
at weblogic.ejb20.internal.MDListener.execute(MDListener.java:254)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
public void onMessage(Message message) {
System.out.println("onMessage");
TextMessage textmessage = (TextMessage)message. // It is throwing
the exception on this line --looks pretty normal
Has anyone seen this before? Am I missing something?
Thanks,
TimHi Tim,
I think the problem is that you are assuming that the data type, of the message
argument to the onMessage(Message message) method in your MDB, is of type TextMessage.
I agree that this seems logical, especially since you passed "a string" to the
Message-style Web Service. However, this is not the case, because the WSDL uses
the "xsd:anyType" as the data type for any argument you pass to the send() method
;-) This maps to a java.lang.Object in the WebLogic Web Services implementation,
which is why you get the casting error. Try this instead:
public void onMessage(Message msg)
try
String msgText;
ObjectMessage objMessage = (ObjectMessage)msg;
msgText = (String)objMessage.getObject();
System.out.println("[PostDefaultPayment.onMessage(Message)] msgText=" + msgText);
System.out.println("[PostDefaultPayment.onMessage(Message)] msg.getJMSType()="
+ msg.getJMSType());
System.out.println("[PostDefaultPayment.onMessage(Message)] msg.getJMSCorrelationID()="
+ msg.getJMSCorrelationID());
System.out.println("[PostDefaultPayment.onMessage(Message)] msg.getJMSMessageID()="
+ msg.getJMSMessageID());
catch(Exception e)
e.printStackTrace();
Regards,
Mike Wooten
"Tim Uy" <[email protected]> wrote:
>
Hi,
I'm trying to deploy a message style web service with a message driven
EJB as
the receiver and am getting the following exception:
<Jan 22, 2002 10:51:06 AM PST> <Warning> <EJB> <MessageDrivenBean threw
an Exception
in onMessage(). The exception was:
java.lang.ClassCastException: weblogic.jms.common.ObjectMessageImpl
java.lang.ClassCastException: weblogic.jms.common.ObjectMessageImpl
at credit.message.PostDefaultPayment.onMessage(PostDefaultPayment.java:24)
at weblogic.ejb20.internal.MDListener.execute(MDListener.java:254)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
public void onMessage(Message message) {
System.out.println("onMessage");
TextMessage textmessage = (TextMessage)message. // It
is throwing
the exception on this line --looks pretty normal
Has anyone seen this before? Am I missing something?
Thanks,
Tim -
WLS Cluster with Message Driven Beans and MQSeries on more than one Host
With the Examples of http://developer.bea.com/jmsproviders.jsp and http://developer.bea.com/jmsmdb.jsp
a MDB can be
configured to work with MQSeries with one WLS Server. This works only, if a Queuemanager
is started at the same Host that runs the WLS Server too.
And the QueueConnectionFactory (QCF) is configured to TRANSPORT(BIND).
In my configuration should be two WLS Servers and one JMS Queue (MQS) with the
Queuemanager.
A Message Driven Bean is deployed on both WLS Servers wich should get the Messages
of this Queue.
If one of the two WLS Servers fails the other WLS Server with the corresponding
MDB should get the Messages of the
MQSeries Queue.
If the QCF is configured to TRANSPORT(Client) the Message Driven Bean can't start
and the following Exception is thrown:
<Jul 18, 2001 3:52:49 PM CEST> <Error> <J2EE> <Error deploying EJB Component :
mdb_deployed
weblogic.ejb20.EJBDeploymentException: Error deploying Message-Driven EJB:; nested
exception is:
javax.jms.JMSException: MQJMS2005: failed to create MQQueueManager for
'btsun1a:TEST'
javax.jms.JMSException: MQJMS2005: failed to create MQQueueManager for 'btsun1a:TEST'
at com.ibm.mq.jms.services.ConfigEnvironment.newException(ConfigEnvironment.java:434)
I'm wondering, because their is a MQQueueManager on btsun1a; all Servers throws
the same Exception when the MDB is deployed.
The configuration of JMSadmin on both Hosts is the following:
dis qcf(myQCF2)
HOSTNAME(btsun1a)
CCSID(819)
TRANSPORT(CLIENT)
PORT(1414)
TEMPMODEL(SYSTEM.DEFAULT.MODEL.QUEUE)
QMANAGER(TEST)
CHANNEL(JAVA.CHANNEL)
VERSION(1)
dis q(myQueue)
CCSID(819)
PERSISTENCE(APP)
TARGCLIENT(JMS)
QUEUE(MYQUEUE)
EXPIRY(APP)
QMANAGER(TEST)
ENCODING(NATIVE)
VERSION(1)
PRIORITY(APP)
I think only TRANSPORT(CLIENT) can be used when i don't wan't to install a Queue
and a QueueManager on each WLS Server.
Does anybody know a problem of WLS 6.0 SP2 to cope with TRANSPORT(CLIENT)?
With the Examples of http://developer.bea.com/jmsproviders.jsp and http://developer.bea.com/jmsmdb.jsp
a MDB can be
configured to work with MQSeries with one WLS Server. This works only, if a Queuemanager
is started at the same Host that runs the WLS Server too.
And the QueueConnectionFactory (QCF) is configured to TRANSPORT(BIND).
In my configuration should be two WLS Servers and one JMS Queue (MQS) with the
Queuemanager.
A Message Driven Bean is deployed on both WLS Servers wich should get the Messages
of this Queue.
If one of the two WLS Servers fails the other WLS Server with the corresponding
MDB should get the Messages of the
MQSeries Queue.
If the QCF is configured to TRANSPORT(Client) the Message Driven Bean can't start
and the following Exception is thrown:
<Jul 18, 2001 3:52:49 PM CEST> <Error> <J2EE> <Error deploying EJB Component :
mdb_deployed
weblogic.ejb20.EJBDeploymentException: Error deploying Message-Driven EJB:; nested
exception is:
javax.jms.JMSException: MQJMS2005: failed to create MQQueueManager for
'btsun1a:TEST'
javax.jms.JMSException: MQJMS2005: failed to create MQQueueManager for 'btsun1a:TEST'
at com.ibm.mq.jms.services.ConfigEnvironment.newException(ConfigEnvironment.java:434)
I'm wondering, because their is a MQQueueManager on btsun1a; all Servers throws
the same Exception when the MDB is deployed.
The configuration of JMSadmin on both Hosts is the following:
dis qcf(myQCF2)
HOSTNAME(btsun1a)
CCSID(819)
TRANSPORT(CLIENT)
PORT(1414)
TEMPMODEL(SYSTEM.DEFAULT.MODEL.QUEUE)
QMANAGER(TEST)
CHANNEL(JAVA.CHANNEL)
VERSION(1)
dis q(myQueue)
CCSID(819)
PERSISTENCE(APP)
TARGCLIENT(JMS)
QUEUE(MYQUEUE)
EXPIRY(APP)
QMANAGER(TEST)
ENCODING(NATIVE)
VERSION(1)
PRIORITY(APP)
I think only TRANSPORT(CLIENT) can be used when i don't wan't to install a Queue
and a QueueManager on each WLS Server.
Does anybody know a problem of WLS 6.0 SP2 to cope with TRANSPORT(CLIENT)?
-
MDB Not able to consume the messages
Hi
The code below put the messages in the queue which I can see through the admin console
public class TestMDBClient {
public static void main(String [] args) throws JMSException,
NamingException {
final Context ic = getInitialContext();
final QueueConnectionFactory qcf = (QueueConnectionFactory)ic.lookup("jms/TestConnectionFactory");
// Lookup should specify the queue name that is mentioned as "mappedName" in MessageDriven Bean.
System.out.println("TEST ="+qcf);
final Queue destQueue = (Queue)ic.lookup("jms/TestQueue");
ic.close();
final QueueConnection connection = qcf.createQueueConnection();
try {
final QueueSession session = connection.createQueueSession(false, 0);
final QueueSender sender = session.createSender(destQueue);
final TextMessage msg = session.createTextMessage("Hello World from Message Driven Bean");
sender.send(msg);
System.out.println("Message Sent");
} catch (Exception ex) {
ex.printStackTrace();
} finally {
connection.close();
private static Context getInitialContext() throws NamingException {
Hashtable env = new Hashtable();
// Add InitialContext property assignments here.
env.put( Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory" );
// Note that by default WebLogic server is not created with security, so credentials are not needed.
// TODO: Verify the server address and port number
env.put(Context.PROVIDER_URL, "t3://localhost:7101");
return new InitialContext( env );
But My Mdb onMessage() is not getting executing
import javax.ejb.EJBException;
import javax.ejb.MessageDrivenBean;
import javax.ejb.MessageDrivenContext;
import javax.jms.Message;
import javax.jms.MessageListener;
public class TestMDBBean implements MessageDrivenBean, MessageListener {
private MessageDrivenContext _context;
public void ejbCreate() {
public void setMessageDrivenContext(MessageDrivenContext context) throws EJBException {
_context = context;
public void ejbRemove() throws EJBException {
public void onMessage(Message message) {
System.out.println("I am here ...");
System.out.println(message);
My config xml files are
<?xml version = '1.0' encoding = 'windows-1252'?>
<ejb-jar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd" version="2.1"
xmlns="http://java.sun.com/xml/ns/j2ee">
<enterprise-beans>
<message-driven>
<description>Message-Driven Bean</description>
<display-name>TestMDB</display-name>
<ejb-name>TestMDB</ejb-name>
<ejb-class>oracle.apps.rms.model.TestMDBBean</ejb-class>
<messaging-type>javax.jms.MessageListener</messaging-type>
<transaction-type>Container</transaction-type>
</message-driven>
</enterprise-beans>
</ejb-jar>
<?xml version = '1.0' encoding = 'windows-1252'?>
<weblogic-ejb-jar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-ejb-jar http://www.bea.com/ns/weblogic/weblogic-ejb-jar/1.0/weblogic-ejb-jar.xsd"
xmlns="http://www.bea.com/ns/weblogic/weblogic-ejb-jar">
<weblogic-enterprise-bean>
<ejb-name>TestMDB</ejb-name>
<message-driven-descriptor>
<destination-jndi-name>jms/TestQueue</destination-jndi-name>
</message-driven-descriptor>
<enable-call-by-reference>true</enable-call-by-reference>
</weblogic-enterprise-bean>
<message-destination-descriptor>
<message-destination-name>TestQueue</message-destination-name>
<destination-jndi-name>jms/TestQueue</destination-jndi-name>
</message-destination-descriptor>
</weblogic-ejb-jar>
I even tried with a standalone java program ; no luck there also .Any body can help ?
package oracle.apps.rms.model;
import java.util.Hashtable;
import javax.jms.*;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
public class Test implements MessageListener {
public final static String JNDI_FACTORY =
"weblogic.jndi.WLInitialContextFactory";
// ******Defines the JMS CONNECTION FACTORY JNDI name.******
public final static String JMS_FACTORY = "jms/TestConnectionFactory";
// ******Defines the QUEUE JNDI name.******
public final static String QUEUE = "jms/TestQueue";
private QueueConnectionFactory qconFactory;
private QueueConnection qcon;
private QueueSession qsession;
private QueueReceiver qreceiver;
private Queue queue;
private boolean quit = false;
public void onMessage(Message msg) {
try {
String msgText;
if (msg instanceof TextMessage) {
msgText = ((TextMessage)msg).getText();
} else {
msgText = msg.toString();
System.out.println("Message Received: " + msgText);
if (msgText.equalsIgnoreCase("quit")) {
synchronized (this) {
quit = true;
this.notifyAll();
} catch (JMSException jmse) {
System.err.println("An exception occurred: " + jmse.getMessage());
public void init(Context ctx, String queueName) throws NamingException,
JMSException {
qconFactory = (QueueConnectionFactory)ctx.lookup(JMS_FACTORY);
qcon = qconFactory.createQueueConnection();
qsession = qcon.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
queue = (Queue)ctx.lookup(queueName);
System.out.println(queue);
qreceiver = qsession.createReceiver(queue);
qreceiver.setMessageListener(this);
qcon.start();
public void close() throws JMSException {
qreceiver.close();
qsession.close();
qcon.close();
public static void main(String[] args) throws Exception {
String str = "t3://localhost:7101";
InitialContext ic = getInitialContext(str);
Test qr = new Test();
qr.init(ic, QUEUE);
System.out.println("JMS Ready To Receive Messages (To quit, send a \"quit\" message).");
synchronized (qr) {
while (!qr.quit) {
try {
qr.wait();
} catch (InterruptedException ie) {
ie.printStackTrace();
qr.close();
private static InitialContext getInitialContext(String url) throws NamingException {
Hashtable<String, String> env = new Hashtable<String, String>();
env.put(Context.INITIAL_CONTEXT_FACTORY, JNDI_FACTORY);
env.put(Context.PROVIDER_URL, url);
return new InitialContext(env);
Thanks
SuneeshHi,
Please try the below one: http://weblogic-wonders.com/weblogic/2009/08/17/mdb3-0-sample-for-weblogic-application-server/ (if you want to try with MDB3.0)
If you want to continue with the MDB2.0 then please change the DDs as below:
*"weblogic-ejb-jar.xml"*
<?xml version="1.0" encoding="UTF-8"?>
<weblogic-ejb-jar
xmlns="http://www.bea.com/ns/weblogic/90" xmlns:j2ee="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/90 http://www.bea.com/ns/weblogic/90/weblogic-ejb-jar.xsd">
<weblogic-enterprise-bean>
<ejb-name>TestMDB</ejb-name>
<message-driven-descriptor>
<destination-jndi-name>TestQ</destination-jndi-name>
</message-driven-descriptor>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>
*"ejb-jar.xml"*
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd"
version="2.1">
<enterprise-beans>
<message-driven>
<ejb-name>TestMDB</ejb-name>
<ejb-class>test.example.mdb.TestMDB</ejb-class>
<transaction-type>Container</transaction-type>
<activation-config>
<activation-config-property>
<activation-config-property-name>destinationType</activation-config-property-name>
<activation-config-property-value>javax.jms.Queue</activation-config-property-value>
</activation-config-property>
</activation-config>
</message-driven>
</enterprise-beans>
</ejb-jar>
I have uploaded My TestMDB Application in : http://www.4shared.com/file/ni4WBc6G/TestMDB.html you can get the "QueueSend.java" program from Step-6) of below link : http://weblogic-wonders.com/weblogic/2010/06/26/basic-jms-demo-using-weblogic-queue/
Thanks
Jay SenSharma
http://weblogic-wonders.com (Wonders Are Here)
Thanks
Jay SenSharma -
JNDI Naming Problem accessing Session Bean from Message Driven Bean
Hi,
I am facing a very strange problem in JNDI look up accessing a Session Bean from a Message Driven Bean. I have a session fa�ade bean(Remote Bean) which is being called from Struts Action class getting the home reference from the ServiceLocator (I have implemented ServiceLocator pattern to obtain JNDI reference for all EJBs). When I am calling the session fa�ade EJB from the Struts Action class everything is working fine.
But when I am trying to call the same EJB from my Message Driven Bean, I am getting a JNDI exception (NameNotFoundException - No Object bound to name �java:comp/env/ejb/EJBJNDIName�). I am trying to get the remote reference from the same ServiceLocator which is successfully providing me a reference while calling from the struts action class. But the same ServiceLocator is not able to provide me a reference while calling from the Message Driven Bean. If I use the JNDI name directly like �EJBJNDIName� in the lookup it is working fine. The lookup for the name is working fine and I am able to call the Session Fa�ade bean with that reference.
I am really not sure what exactly the problem is. If I have any problem in the ServiceLocator, it should have given me the same error while calling from Struts Action class. But it is working fine with the full name �java:comp/env/ejb/EJBJNDIName� calling from the struts action class. I am not sure whether Message Driven Bean has something to do with it. Why I am not able to get a reference of the EJB with the full name? Please Help.
Thanks
AmitHi Bhagya,
Thanks for your response. I think from EJB container we can call Local EJBs with the full JNDI name. The session facade bean which is being called is a remote bean. From the session facade bean I am calling a local stateless session bean for database access. I am getting the reference of the local EJB from my session facade bean with full JNDI name "java:comp/env/ejb/EJBJNDIName". It is working fine with out any problem. My servicelocator is able to provide me the reference of the local EJB from the session facade remote bean with Full JNDI name. I am only having this problem calling from the MDB. I am really not sure whether what is causing it?
Thanks
Amit
Maybe you are looking for
-
How do I delete my Photos on my Iphone of my EX-Girlfriend? My Phone is FULL of pictures of my EX-Girlfriend who went behind my back and lied to me and broke my heart. Anyway,I'm sick of them,And I want to delete EVERY photo on my phone.Some photos h
-
To compile more indesign files
hi i need some information. how to compile more individual indesign files as a single file? i added the documents in a new book file but cannot compile them as a single indesign file.
-
SharePoint returned the following error: Invalid URI: The URI is empty.
When I try to add Site Feed (News Feed) in the SharePoint 2013, I get "SharePoint returned the following error: Invalid URI: The URI is empty. Contact your system administrator for help in resolving this problem" error message. Could you please provi
-
Rescue and recovery 4.21 cumulated fix for xp doesn't install
Hi all, I've just used system update to install the above fix, but when I restart my system & run update again it still shows in the list as needing to be downloaded? I assume therefore it hasn't correctly installed? Does anyone have any ideas on how
-
I had the orifginal free Adobe stroy. I downloaded the app for my desktop. When trying to udate I get the apllication error. What do I do? Is that work lost forever?!