Message Driven Beans: how to receive and send in a single session?

Hello
How to receive and send JMS messages in a message driven bean using a single session?
Thanks.

Are you referring to writing code within the onMessage method itself to receive JMS messages?
If so, that is not a pattern that is recommended, especially not in the case of a blocking JMS
receieve. If you must write an explicit JMS receive within an EJB component it's best to use
a "check the queue" approach where you give a very small timeout for the receive. That way
if the message is there it will be returned but if not the call will not block.
You'll also need to take the transactional settings of the onMessage method into account.
If your are sending a message and then waiting for a response, those two actions can
not be done within the same global transaction. For that, you'll need to either use
BMT and perform each in its own transaction or just not use global transactions at all,
in which case each send and receive operation will be atomic.
--ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • How to receive and send V/A signal in one host?

    The sample code VideoTransmit.java,sames only can send the V/A signal over network,but the sending host cannot receive the signal.
    I hope receive and send signal in one host,what should I do?
    s.

    Now,the problem is ,how to send and save the live stream in one host?I hope save the stream to a media file,like *.dat,etc.
    Of course,the host user can receive the stream sending by himself.
    s.

  • Message-driven bean "loses" MDB icon and status

    Using JDev v11.1.1.5.0, when I create a MDB in my project using the wizard, it initially is displayed with the MDB icon next to it (a little envelope with a paperclip). However, about a second later, the icon changes to a normal 'Java' icon (coffee cup). I've also noticed that the MDB class does NOT appear in the Project Properties | EJB Module | Annotated EJB 3.0 Classes list box. The net result is that when the application is deployed, the MDB doesn't get registered to listen, so it never receives JMS messages.
    I tried creating a new application from scratch, and created the exact same MDB. In this application, the icon 'sticks', and the class DOES show up in the "Annotated EJB 3.0 Classes" list box in the Project Properties dialog. (And, it will correctly register to receive JMS message on deployment.)
    So, obviously something is different/wrong with my actual application that is preventing it from recognizing that the MDB class is an MDB. But, I don't know what. I've looked at all the settings in the Project Properties, looked at the actual project's .jpr file, etc., and can't see anything that would cause one application to not recognize MDBs.
    Does anyone have any suggestions on how to figure out why my MDB classes aren't recognized as such in the one Application?
    Here's the class I'm trying to use:
    package com.acme;
    import javax.ejb.MessageDriven;
    import javax.jms.Message;
    import javax.jms.MessageListener;
    @MessageDriven(mappedName = "acme.DefaultQueue")
    public class MessageEJB implements MessageListener {
        public void onMessage(Message message) {
             // ... code here ...
    Thanks,
    Karl

    For those that might have this problem down the road, here's what I found... It seems that there was a corrupt "cache" file or something in the project. Specifically, I had to delete the files in the <app_name>\<project_name>\classes\.data\00000000 folder. Once I deleted those files (mostly .jdb files), and restarted JDeveloper, the correct icon displayed next to my MDB classes, AND they also showed up correctly in the Project Properties | EJB Console pane.
    I'm not sure what these files are, but I assume they are cache files and get re-created automatically by JDeveloper when needed. I hope this helps someone else that has the same problem!

  • Message Driven Beans with "Required" CMT and duplicate delivery of messages

    Hi,
    Let's pretend that an MDB is configured with CMT and the "Required" transaction attribute. Let's suppose that it has received a message and is busy processing it in a transaction that might take some time to complete.
    Is a JEE container required to ensure that while a message is being handled by an MDB in a transaction that's neither completed nor rolled back, no dupes of the same message should be delivered to another instance of the same MDB?

    user572625 wrote:
    Hi,
    Let's pretend that an MDB is configured with CMT and the "Required" transaction attribute. Let's suppose that it has received a message and is busy processing it in a transaction that might take some time to complete.
    Is a JEE container required to ensure that while a message is being handled by an MDB in a transaction that's neither completed nor rolled back, no dupes of the same message should be delivered to another instance of the same MDB?First, define "dupe".
    Note that the main reason to use JEE technology over simpler frameworks is robustness, so if I understand your slightly vague question correctly, you can make the safe assumption that the answer is yes.

  • 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,
    Tim

    Hi 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)?
              

  • Problem deploying message driven bean using Log4j

    Hello all.
    Using JDeveloper 11.1.1.0.2, I'm having a problem with a message driven bean I've created and associated with a JMS queue.
    I've created an EJB Module project in my application (in which some other projects exist), and created the bean. A simple test of the bean, sending a message through the jms queue and printing it on system.out in the mdb onMessage() worked just fine.
    However, when I add apache commons logging to my mdb, things start to go wrong. Running the project on the integrated weblogic 10.3 server just fails during deployment, due to a NoClassDefFoundError on org/apache/log4j/Logger.
    In project properties -> libraries and classpath, I've added a log4j library (Log4j-1.2.14.jar) next to Commons Logging 1.0.4 but it doesn't seem to matter anything.
    The code of my message bean:
    @MessageDriven(mappedName = "weblogic.wsee.DefaultQueue")
    public class MyMessageBean implements MessageListener {
        // logger
        private static Log sLog = LogFactory.getLog(MyMessageBean.class);
        public void ejbCreate() {
        public void ejbRemove() {
        public void onMessage(Message message) {
            MapMessage mapmsg = null;
            try {
                if (message instanceof MapMessage) {
                    mapmsg = (MapMessage)message;
                    boolean msgRedelivered = mapmsg.getJMSRedelivered();
                    String msgId = mapmsg.getJMSMessageID();
                    if (!msgRedelivered) {
                        sLog.debug("****** Successfully received message " + msgId);
                    } else {
                        sLog.debug("****** Successfully received redelivered message " + msgId);
                    // Haal de inhoud op:
                    int testInt = mapmsg.getInt("TestInt");
                    sLog.debug("TestInt:" + testInt);
                } else {
                    sLog.debug("Message of wrong type: " +
                                       message.getClass().getName());
            } catch (Exception e) {
                sLog.error("Fout in verwerken",e);           
    }Does anybody have any clue as to what I might be doing wrong or missing out here?
    The complete stacktrace:
    5-aug-2009 12:54:44 oracle.adf.share.config.ADFConfigFactory cleanUpApplicationState
    INFO: Cleaning up application state
    java.lang.ExceptionInInitializerError
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:247)
         at weblogic.ejb.container.dd.xml.EjbAnnotationProcessor.processWLSAnnotations(EjbAnnotationProcessor.java:1705)
         at weblogic.ejb.container.dd.xml.EjbDescriptorReaderImpl.processWLSAnnotations(EjbDescriptorReaderImpl.java:346)
         at weblogic.ejb.container.dd.xml.EjbDescriptorReaderImpl.createReadOnlyDescriptorFromJarFile(EjbDescriptorReaderImpl.java:192)
         at weblogic.ejb.spi.EjbDescriptorFactory.createReadOnlyDescriptorFromJarFile(EjbDescriptorFactory.java:93)
         at weblogic.ejb.container.deployer.EJBModule.loadEJBDescriptor(EJBModule.java:1198)
         at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:380)
         at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93)
         at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:387)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:58)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:42)
         at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:615)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
         at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:191)
         at weblogic.application.internal.EarDeployment.prepare(EarDeployment.java:16)
         at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:155)
         at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
         at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:197)
         at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:89)
         at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217)
         at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:723)
         at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1190)
         at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:248)
         at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:159)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:157)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:12)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:45)
         at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@51b296 for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Logger) (Caused by org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@51b296 for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Logger))
         at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:543)
         at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
         at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209)
         at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
         at nl.justid.dolores.mdb.MyMessageBean.<clinit>(MyMessageBean.java:19)
         ... 32 more
    Caused by: org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@51b296 for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Logger)
         at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:413)
         at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529)
         ... 36 more
    Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Logger
         at java.lang.Class.getDeclaredConstructors0(Native Method)
         at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
         at java.lang.Class.getConstructor0(Class.java:2699)
         at java.lang.Class.getConstructor(Class.java:1657)
         at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:410)
         ... 37 more
    Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Logger
         at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
         ... 42 more
    <5-aug-2009 12:54:44 uur CEST> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID '1249469684085' for task '14'. Error is: 'weblogic.application.ModuleException: Exception preparing module: EJBModule(Dolores-MessageBeans-ejb)
    [EJB:011023]An error occurred while reading the deployment descriptor. The error was:
    null.'
    weblogic.application.ModuleException: Exception preparing module: EJBModule(Dolores-MessageBeans-ejb)
    [EJB:011023]An error occurred while reading the deployment descriptor. The error was:
    null.
         at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:452)
         at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93)
         at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:387)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:58)
         Truncated. see log file for complete stacktrace
    java.lang.ClassNotFoundException: org.apache.log4j.Logger
         at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
         Truncated. see log file for complete stacktrace
    >
    5-aug-2009 12:54:44 oracle.adf.share.config.ADFConfigFactory cleanUpApplicationState
    INFO: Cleaning up application state
    <5-aug-2009 12:54:44 uur CEST> <Warning> <Deployer> <BEA-149004> <Failures were detected while initiating deploy task for application 'Dolores'.>
    <5-aug-2009 12:54:44 uur CEST> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004
    weblogic.application.ModuleException: Exception preparing module: EJBModule(Dolores-MessageBeans-ejb)
    [EJB:011023]An error occurred while reading the deployment descriptor. The error was:
    null.
         at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:452)
         at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93)
         at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:387)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:58)
         Truncated. see log file for complete stacktrace
    java.lang.ClassNotFoundException: org.apache.log4j.Logger
         at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
         Truncated. see log file for complete stacktrace
    >
    [Deployer:149034]An exception occurred for task [Deployer:149026]deploy application Dolores on DefaultServer.: Exception preparing module: EJBModule(Dolores-MessageBeans-ejb)
    [EJB:011023]An error occurred while reading the deployment descriptor. The error was:
    null..
    weblogic.application.ModuleException: Exception preparing module: EJBModule(Dolores-MessageBeans-ejb)
    [EJB:011023]An error occurred while reading the deployment descriptor. The error was:
    null.
    ####  Deployment incomplete.  ####    Aug 5, 2009 12:54:44 PM
    oracle.jdeveloper.deploy.DeployException
         at oracle.jdevimpl.deploy.common.Jsr88RemoteDeployer.doDeploymentAction(Jsr88RemoteDeployer.java:247)
         at oracle.jdevimpl.deploy.common.Jsr88RemoteDeployer.deployImpl(Jsr88RemoteDeployer.java:157)
         at oracle.jdeveloper.deploy.common.AbstractDeployer.deploy(AbstractDeployer.java:94)
         at oracle.jdevimpl.deploy.fwk.WrappedDeployer.deployImpl(WrappedDeployer.java:39)
         at oracle.jdeveloper.deploy.common.AbstractDeployer.deploy(AbstractDeployer.java:94)
         at oracle.jdeveloper.deploy.common.BatchDeployer.deployImpl(BatchDeployer.java:82)
         at oracle.jdeveloper.deploy.common.AbstractDeployer.deploy(AbstractDeployer.java:94)
         at oracle.jdevimpl.deploy.fwk.WrappedDeployer.deployImpl(WrappedDeployer.java:39)
         at oracle.jdeveloper.deploy.common.AbstractDeployer.deploy(AbstractDeployer.java:94)
         at oracle.jdevimpl.deploy.fwk.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:436)
         at oracle.jdeveloper.deploy.DeploymentManager.deploy(DeploymentManager.java:209)
         at oracle.jdevimpl.runner.adrs.AdrsStarter$5$1.run(AdrsStarter.java:1365)
    Caused by: oracle.jdeveloper.deploy.DeployException
         at oracle.jdevimpl.deploy.common.Jsr88DeploymentHelper.deployApplication(Jsr88DeploymentHelper.java:413)
         at oracle.jdevimpl.deploy.common.Jsr88RemoteDeployer.doDeploymentAction(Jsr88RemoteDeployer.java:238)
         ... 11 more
    Caused by: oracle.jdeveloper.deploy.DeployException: Deployment Failed
         at oracle.jdevimpl.deploy.common.Jsr88DeploymentHelper.deployApplication(Jsr88DeploymentHelper.java:395)
         ... 12 more
    #### Cannot run application Dolores due to error deploying to DefaultServer.
    [Application Dolores stopped and undeployed from Server Instance DefaultServer]Thanks in advance!
    Greetings,
    Eelse
    Edited by: Eelse on Aug 5, 2009 1:57 PM
    Edited by: Eelse on Aug 5, 2009 5:39 PM

    Creating a new deployment profile (EAR) and including the original deployment (JAR) and the needed libraries (in a lib-directory) solved the problem.

  • Only one Message Driven Bean

    hi
    i have some heavy calculating beans and i want that only one EJB is calculating at one time. can i do this by using Message Driven Beans? is it possible that the server creates only one Message Driven Bean at one time and gets the next one out of the queue when the old one finished calculating?
    thanks, jo

    It is possible to set up that there should be only one mdb in the pool, but it's not quite what mdbs are intended for. Remember that this is an asynchronous message service, and you will not receive a reply after you put a message on the queue.

  • I bought a used i pod 4 for my daughter and it does not have the message icon on it: how can i put the icon on the i pod and get it receive and send messages

    I bought a used i pod 4 for my daughter and it does not have the message icon on it ( not even in settings) how can I get the message icon on it so it can receive and send messages

    Try:
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Reset all settings
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:       
    iOS: How to back up
    - Restore to factory settings/new iOS device.
    -  Make an appointment at the Genius Bar of an Apple store.
    Apple Retail Store - Genius Bar

  • How to send message from Message Driven Bean  to JMS client?

    In my project I have JMS client, two QueueConnectionFactory and Message Driven Bean. Client send message to MDB through the first QueueConnectionFactory , in one's turn MDB send message to client through the second Queue Connection Factory . I already config my Sun AppServer for sending message in one way, and sending message from MDB to the second QueueConnectionFactory. But on my Client there is an error : �JNDI lookup failed: javax.naming.NameNotFoundException: No object bound to name java:comp/env/jms/MyQueue2� (jms/MyQueue2 � this is the name of my Queue). So it couldn't get this message.
    P.S.
    Thank you for help!!!

    What is the name of the second queue?is the connection factory on the local?Yes the connection factory is on the local. The name of my first queue is jms/MYQueue and the name of another one is jms/MyQueue2.

  • How to use canon pixma MX377. I can't receive and send fax messages

    Can please anyone send me complete instruction manual in english for my pixma canon MX377 machine because I can't receive and send fax messages. I'm connected to a PBX extension line or a xDSL splitter. Every time i called a person on the machine, I can hear him but he can't hear me. Thank you very much.

    Hi rgc,
    The PIXMA MX377 user's manual is available in an online format and can be downloaded from the Canon Asia website.  The following link will take you to the Manuals page for the PIXMA MX377:
    http://support-asia.canon-asia.com/P/search?model=PIXMA+MX377&filter=0&menu=manual
    Once on the page, please scroll through the list and select the manual that corresponds to your operating system (Windows or Mac), then click the DOWNLOAD NOW button on the following page that appears to download and view the manual.
    This didn't answer your question or issue? Find more help at Contact Us.
    Did this answer your question? Please click the Accept as Solution button so that others may find the answer as well.

  • 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,
    Guru

    Dear 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

  • 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.
              >
              >
              

  • 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
    Thanks

    Could 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();
    }

  • B2B using JMS and Processing Messages with Message Driven Beans

    We want to be able to use B2B to send messages to a JMS queue and then process messages from B2B using a Message Driven Bean. Is this supported.
    We are using B2B 10.2.0.2 with Patchset 4.

    Hello,
    In 10.1.2.0.2 B2B , as part of the internal Delivery channel B2B can only send and receive messages from JMS queues.
    Rgds,Ramesh

Maybe you are looking for

  • PO to Sales Order creation

    Hi Gurus, I've been having a lot of confusion lately about PO (EDI 850) to SO creation in SAP. Our scenario is the customer sends their PO thru ADX (an EDI outsourcing provider), needless to say the flow is: Customer EDI 850 -> ADX -> PO Flat File ->

  • Import video clip from DVD

    Can anyone help me learn what I need to import video clips from my family video DVD's? I created the DVD's from tapes through Pinnacle Studio 8 (before becoming a Mac fan). Thanks for any help you can give me, Ann

  • Why is the map not displaying correctly on "find my phone"  I am getting large grid squares on the map

    why is the map not displaying correctly on "find my phone"  on my computer.  I am getting large grid squares on the map.  I have tried deleting my history, tried zooming in & out, but the grid squares won't go away..

  • Alternative to FM 'CRM_BUPA_SELECT_BP_SALES_AREAS'

    Within the ON_SAVE method of BP_HEAD/Overview I am retrieving the Sales areas for the current Account using FM CRM_BUPA_SELECT_BP_SALES_AREAS. However, when I enter Sales area data for the first time this FM is not returning any data. This is probabl

  • Software Update no longer works (file not found on server)

    I just tried the first "Software Update ..." since installing 10.6. There are the 10.6.1 update, a new iTunes, some HP Printer Driver update, and a Remote Desktop Update. The download fails with The update "HP Printer Drivers Update" can't be install