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
Amit

Hi 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

Similar Messages

  • Can anybody tell how to access web service from Message Driven bean

    Can anybody tell how to access web service from Message Driven bean

    Can anybody tell how to access web service from Message Driven bean

  • Access web service from Message Driven bean

    Can anybody give code to to access webservice from Message Driven Bean

    Can anybody give code to to access webservice from Message Driven Bean

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

  • Call session bean in message driven bean

    Is it a best practice calling a session bean every time arrive a message in a message driven bean?
    Regards
    Message was edited by:
    gionnyDeep

    Why not?
    You can call Session Bean from a Message Driven Bean as long as your J2EE Server is able to handle the messages.

  • Best way to call web service from Message Driven Bean

    I'm q'ing msgs up and would like to use a message driven bean to forward them to
    an external web service. Weblogic workshop does not seem to support web service
    controls in an EJB project. Any suggestions?
    Thanks,
    Paul

    Paul,
    A non-trivial alternative, since you have the WSDL, would be to forget about trying
    to use generated client code and just use JAX-RPC dynamic invocation instead.
    That's how I call external web services from within an EJB in situations in which
    generated client code cannot be incorporated prior to deployment. Minimally all
    that is required is the WSDL and the service name, port name, and operation name,
    although if non-builtin parameter types are used then you will have to manipulate
    the service's type mapping registry.
    Mark
    "Paul" <[email protected]> wrote:
    >
    I've taken our wsdl and generated a web service in Workshop 8.1 using
    XMLBeans.
    This produces a web page that contains a link"Java Proxy" for downloading
    generated
    client code. I assume this is the same as clientgen. It's interesting
    that
    it does not
    use XMLBeans like the web service that generated it. It uses a different
    serialization
    method.
    I've used this generated code to call the web service. Although the
    client seems
    to run
    successfully to completion, I get the following error in the weblogic
    server console:
    <Sep 29, 2003 7:46:24 AM EDT> <Error> <WLW> <000000> <Failure=com.bea.wlw.runtim
    e.core.request.ResponseValidationException: java.lang.RuntimeException:
    Protocol
    'http-soap' not available on this operation. [ServiceException]>
    <Sep 29, 2003 7:46:24 AM EDT> <Warning> <WLW> <000000> <Returning HTTP
    500 due
    t
    o SOAP fault occurring on DispFile=pjm.srcm.webservices.face.Receptor>
    Frustrating...
    Bruce Stephens <[email protected]> wrote:
    Hi Paul,
    Could you not first use clientgen on the external webservice, then take
    the stubs it created, then add these to your code along with the
    onMessage(Message msg) and roll it into the MBean?
    We don't have exactly that example, but you might take a look at this
    one to get some ideas:
    http://webservice.bea.com/message.zip
    Hope this helps,
    Bruce
    Paul wrote:
    Bruce,
    Don't think this will work for us. We are receiving data internallythrough
    a JMS queue. We need to pull it off the queue (MDB), massage it alittle and
    send it to an external web service. The link you sent me was howto implement
    a web service with JMS.
    I started out by trying to use the Web Service and JMS controls butit doesn't
    seem like I can use a JMS control because that requires a conversationID,
    which we don't have because nothing is comming in through a web services.
    Paul
    Bruce Stephens <[email protected]> wrote:
    Hi Paul,
    There is a chapter in the docs on this. See if this helps,
    http://edocs.bea.com/wls/docs81/webserv/jms.html#1067060
    Thanks,
    Bruce
    Paul wrote:
    I'm q'ing msgs up and would like to use a message driven bean to
    forward
    them to
    an external web service. Weblogic workshop does not seem to supportweb service
    controls in an EJB project. Any suggestions?
    Thanks,
    Paul

  • Problem accessing session variable from jsp

    Hi!
    I get an error retrieving a session variable from inside a JSP declaration scriptlet....
    Something like this code in a JSP page:
    <%!
    public void funtion1() {
    String parameter1 = session.getAttribute("parameter1");
    %>I have seen that I have available getContextServer() method and from there I could call getAttribute("parameter1") . But the thing is that the attribute I want to retrieve was stored in session by another Jsp page.
    Any solutions are welcome
    Cheers
    Victor

    Appropriately the above is one the reasons also You cannot use JSP implicit objects from the declaration tag. However we can think of a small workaround by passing the reference like the one discussed below
    <%!public void funtion1(HttpSession session) {
    String parameter1 = session.getAttribute("parameter1").toString();
    }%>
    <% funtion1(session);%>Hope that helps :)
    REGARDS,
    RaHuL

  • Problems accessing session variables from a pop-up

    I am working on a webapp and I when I click on a certain button I need to have a pop-up appear that will either prompt a user to enter log-in info if they haven't already, otherwise the pop-up just needs to display a report. Users can navigate around on the main page and select various reports so multiple pop-ups could possibly be opened. When a user logs in I save the login info in session variables, but for some reason whenever I click to have another pop-up open it always says that my session variables are null. Is there a way to have more global session variables so that multiple windows (the pop-ups) can touch session variables? Would there be a way to pass the login info in session variables back to the main page and then pass those session variables back out to each pop-up that opens? Thanks so much.

    Have you got session cookies enabled?
    The most common way to keep track of the session id is via a session cookie.
    This cookie gets shared by all windows of the same browser session.
    You are opening these pop-up windows with window.open?
    Print out the session id <%= session.getId() %> on each page to see if it is the same.
    Cheers,
    evnafets

  • Problem creating Physical Destination for Message Driven Bean example

    I am trying to create a MDB application. in which i want to distribute the workload using messages.
    I am using SUN j2ee application server8.2 and netbeans 6.5 on windows xp professional.
    I referred the j2ee 1.4 tutorial to create the mdb's.
    I am able to create queue's and connection factories.
    the tutorial says
    To create the physical destination, perform the following steps:
    •.In the tree component, expand the Resources node, then expand the JMS Resources node.
    •.Select the Physical Destinations node.
    •.On the Physical Destinations page, click New. The Create Physical Destination page appears.
    •.In the Physical Destination Name field, type PhysicalQueue.
    •.Choose queue from the Type combo box.
    •.Click OK.
    but i am not able to find out this Physical Destination node in admin console. So when i execute my MDB project the messages are created but the onMessage() method is not invoked.
    Please help!!!

    Hi,
    but this example was in guide to this version.
    Ok, in case it is not possible to use MDB, how should i handle long time consumpting functions in EP enviroment?
    (customer has only EP6SP2 and he need to send a lot of mails after user request and i dont want to leave user waiting till that function ends. - should i start new thread in portal?)
    JJ

  • SAP WAS SS13 Message driven bean start up problem

    Hello,
    After we have upgraded our environment from SS9 to SS13 our app doesn't start anymore with the following exception (worked fine before):
    com.sap.engine.services.deploy.exceptions.ServerDeploymentException: Exception in operation startApp with application
    <skipped>
    Caused by: java.lang.NoSuchMethodException: com.sap.engine.services.ejb.message.SrvSessionPool.<init>(com.sap.engine.services.ejb.util.pool.PoolUser, com.sap.engine.services.ejb.Environment, java.util.Properties)
    ejb-jar.xml contains the reference to the class which couldn't be loaded:
    <property>
    <property-name>PoolClass</property-name>
    <property-value>
       com.sap.engine.services.ejb.message.SrvSessionPool
    </property-value>
    </property>
    Is there something we're missing? Please help! Thanks!
    P.S. Full stack trace below:
    Date : 09/06/2005
    Time : 18:10:13:655
    Category : /System/Audit
    Message ID : 00C09F09C00700200000000300000B8000040021B1330F51
    Severity : Error
    Location : com.sap.engine.services.deploy
    Source Name : com.sap.engine.services.deploy
    Thread : SAPEngine_System_Thread[impl:5]_62
    Message : Exception com.sap.engine.services.deploy.exceptions.ServerDeploymentException: Exception in operation startApp with application ourapp.com/App36.
         at com.sap.engine.services.deploy.server.application.ApplicationTransaction.rollbackPart(ApplicationTransaction.java:387)
         at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhasesOnOneServer(ApplicationTransaction.java:301)
         at com.sap.engine.services.deploy.server.application.ParallelAdapter.makeAllPhasesImpl(ParallelAdapter.java:301)
         at com.sap.engine.services.deploy.server.application.ParallelAdapter.run(ParallelAdapter.java:73)
         at com.sap.engine.frame.core.thread.Task.run(Task.java:60)
         at com.sap.engine.core.thread.impl5.SingleThread.execute(SingleThread.java:74)
         at com.sap.engine.core.thread.impl5.SingleThread.run(SingleThread.java:140)
    Caused by: com.sap.engine.services.ejb.exceptions.deployment.EJBDeploymentException: Exception during the initialization of container boot class com.nrx.beans.job_handler.JobHandlerBean10ContainerFP.
         at com.sap.engine.services.ejb.EJBAdmin.prepareLoad(EJBAdmin.java:994)
         at com.sap.engine.services.ejb.EJBAdmin.prepareStart(EJBAdmin.java:2402)
         at com.sap.engine.services.deploy.server.application.StartTransaction.prepareCommon(StartTransaction.java:370)
         at com.sap.engine.services.deploy.server.application.StartTransaction.prepare(StartTransaction.java:318)
         at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhasesOnOneServer(ApplicationTransaction.java:299)
         ... 5 more
    Caused by: com.sap.engine.services.ejb.ContainerInitializationException: Cannot initialize message system bridge com.sap.engine.services.ejb.message.JMSBridgeFP.
         at com.sap.engine.services.ejb.message.MessageContainer.load(MessageContainer.java:457)
         at com.sap.engine.services.ejb.message.MessageContainer.init(MessageContainer.java:146)
         at com.sap.engine.services.ejb.message.MessageContainerFP.init(MessageContainerFP.java:53)
         at com.sap.engine.services.ejb.EJBAdmin.prepareLoad(EJBAdmin.java:988)
         ... 9 more
    Caused by: com.sap.engine.services.ejb.message.JMSBridgeException: Cannot initialize the message-driven bean container.
         at com.sap.engine.services.ejb.message.JMSBridge.registerListener(JMSBridge.java:113)
         at com.sap.engine.services.ejb.message.MessageContainer.load(MessageContainer.java:455)
         ... 12 more
    Caused by: com.sap.engine.services.ejb.ContainerInitializationException: Cannot create a session pool for message-driven bean JobHandlerBean.
         at com.sap.engine.services.ejb.message.JMSBridge.initPool(JMSBridge.java:219)
         at com.sap.engine.services.ejb.message.JMSBridge.registerListener(JMSBridge.java:96)
         ... 13 more
    Caused by: java.lang.NoSuchMethodException: com.sap.engine.services.ejb.message.SrvSessionPool.<init>(com.sap.engine.services.ejb.util.pool.PoolUser, com.sap.engine.services.ejb.Environment, java.util.Properties)
         at java.lang.Class.getConstructor0(Class.java:1937)
         at java.lang.Class.getConstructor(Class.java:1027)
         at com.sap.engine.services.ejb.message.JMSBridge.initPool(JMSBridge.java:205)
         ... 14 more

    Hello,
    After we have upgraded our environment from SS9 to SS13 our app doesn't start anymore with the following exception (worked fine before):
    com.sap.engine.services.deploy.exceptions.ServerDeploymentException: Exception in operation startApp with application
    <skipped>
    Caused by: java.lang.NoSuchMethodException: com.sap.engine.services.ejb.message.SrvSessionPool.<init>(com.sap.engine.services.ejb.util.pool.PoolUser, com.sap.engine.services.ejb.Environment, java.util.Properties)
    ejb-jar.xml contains the reference to the class which couldn't be loaded:
    <property>
    <property-name>PoolClass</property-name>
    <property-value>
       com.sap.engine.services.ejb.message.SrvSessionPool
    </property-value>
    </property>
    Is there something we're missing? Please help! Thanks!
    P.S. Full stack trace below:
    Date : 09/06/2005
    Time : 18:10:13:655
    Category : /System/Audit
    Message ID : 00C09F09C00700200000000300000B8000040021B1330F51
    Severity : Error
    Location : com.sap.engine.services.deploy
    Source Name : com.sap.engine.services.deploy
    Thread : SAPEngine_System_Thread[impl:5]_62
    Message : Exception com.sap.engine.services.deploy.exceptions.ServerDeploymentException: Exception in operation startApp with application ourapp.com/App36.
         at com.sap.engine.services.deploy.server.application.ApplicationTransaction.rollbackPart(ApplicationTransaction.java:387)
         at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhasesOnOneServer(ApplicationTransaction.java:301)
         at com.sap.engine.services.deploy.server.application.ParallelAdapter.makeAllPhasesImpl(ParallelAdapter.java:301)
         at com.sap.engine.services.deploy.server.application.ParallelAdapter.run(ParallelAdapter.java:73)
         at com.sap.engine.frame.core.thread.Task.run(Task.java:60)
         at com.sap.engine.core.thread.impl5.SingleThread.execute(SingleThread.java:74)
         at com.sap.engine.core.thread.impl5.SingleThread.run(SingleThread.java:140)
    Caused by: com.sap.engine.services.ejb.exceptions.deployment.EJBDeploymentException: Exception during the initialization of container boot class com.nrx.beans.job_handler.JobHandlerBean10ContainerFP.
         at com.sap.engine.services.ejb.EJBAdmin.prepareLoad(EJBAdmin.java:994)
         at com.sap.engine.services.ejb.EJBAdmin.prepareStart(EJBAdmin.java:2402)
         at com.sap.engine.services.deploy.server.application.StartTransaction.prepareCommon(StartTransaction.java:370)
         at com.sap.engine.services.deploy.server.application.StartTransaction.prepare(StartTransaction.java:318)
         at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhasesOnOneServer(ApplicationTransaction.java:299)
         ... 5 more
    Caused by: com.sap.engine.services.ejb.ContainerInitializationException: Cannot initialize message system bridge com.sap.engine.services.ejb.message.JMSBridgeFP.
         at com.sap.engine.services.ejb.message.MessageContainer.load(MessageContainer.java:457)
         at com.sap.engine.services.ejb.message.MessageContainer.init(MessageContainer.java:146)
         at com.sap.engine.services.ejb.message.MessageContainerFP.init(MessageContainerFP.java:53)
         at com.sap.engine.services.ejb.EJBAdmin.prepareLoad(EJBAdmin.java:988)
         ... 9 more
    Caused by: com.sap.engine.services.ejb.message.JMSBridgeException: Cannot initialize the message-driven bean container.
         at com.sap.engine.services.ejb.message.JMSBridge.registerListener(JMSBridge.java:113)
         at com.sap.engine.services.ejb.message.MessageContainer.load(MessageContainer.java:455)
         ... 12 more
    Caused by: com.sap.engine.services.ejb.ContainerInitializationException: Cannot create a session pool for message-driven bean JobHandlerBean.
         at com.sap.engine.services.ejb.message.JMSBridge.initPool(JMSBridge.java:219)
         at com.sap.engine.services.ejb.message.JMSBridge.registerListener(JMSBridge.java:96)
         ... 13 more
    Caused by: java.lang.NoSuchMethodException: com.sap.engine.services.ejb.message.SrvSessionPool.<init>(com.sap.engine.services.ejb.util.pool.PoolUser, com.sap.engine.services.ejb.Environment, java.util.Properties)
         at java.lang.Class.getConstructor0(Class.java:1937)
         at java.lang.Class.getConstructor(Class.java:1027)
         at com.sap.engine.services.ejb.message.JMSBridge.initPool(JMSBridge.java:205)
         ... 14 more

  • Can you set isolation levels of message-driven bean transactions?

    The problem: I have 3 different message-driven beans which each get a different type of message, except for a field that is common to all. That field is used as the primary key of an entity object. The message-driven beans configured to use a container managed transaction. Each message-driven bean, in processing the message, first does a lookup by primary key to see if the object associated with the key exists, and if it does not, it requests the entity's home object to create it. After that, they do further processing. The problem is that sometimes all the beans simultaneously get a message, resulting in each bean checking for the entity object at about the same time, and if they fail to find it (because none of them has created it yet), each creates an object, all with the same primary key. This is not caught until the beans start to complete their onMessage method, which I believe results in the container committing the transaction. One of the transactions will be committed successfully, while the other two will fail, get rolled back, and then be retried with the same message. The second time through, the other beans will find the entity object (since it has been created and committed) and they will complete correctly. In the end, they right thing occurs, except that there is a troubling exception or 2 in the log telling about the constraint violation (with the primary key) and the rollback. If it was just me, that would be fine, but our customer does not like to see exceptions in the log; that indicates to him that something is wrong.
    So, I am looking for someway to make sure that the actions of the message-driven beans are serialized. One suggestion from a colleague was to set the isolation level of the transactions being used by the container in processing the message-driven beans' onMessage method. However, the documentation does not mention any way to do this for a message-driven bean. Suggestions?
    Is the use of a UserTransaction a better way to do this? If I acquire a UserTransaction within the onMessage method of a message-driven bean, can I set its isolation level? How would this work? When I get a UserTransaction, does each client get a different transaction, or do they all get the same one?

    (1) The WebLogic JMS "unit-of-order" feature is a heavily adopted feature that was specifically designed to handle similar use cases - see the JMS developer guide for extensive documentation. In your use case, if "key" is used to define UOO, then there's no limit on the number of keys that can be processed concurrently, but messages for any particular key will be processed single-threaded in the order in which they were first submitted.
    Note that if you're using distributed destinations, the UOO feature is still fully supported - but the developer and/or administrator needs to decide whether to configure the destination to use "hash" or "path service" based routing (the JMS UOO edoc outlines the trade-offs).
    (2) Another alternative is to use a single MDB with max-beans-free-pool that processes all three types (as the other poster suggested). I think this assumes all MDBs run on the same JVM.
    (3) Another alternative is to use multiple queues, with a single MDB on each Q. Where some sort of hash algorithm is used to determine which Q is for the key. This approach is a "hand-coded" variant of the approach in (1) with "hash" based routing enabled...
    (4) If all MDBs actually do run in the same JVM, a third alternative is to use code the application to use a common lock to protect each key, eg, something like:
    // assume MyLock is simply a class with a "reference counter"
    // assume some global "staticHM" hash map that is all MDBs can access
    onMessage() {
    MyLock lock = null;
    key= msg.getKey();
    synchronized(staticHM) {
    lock = staticHM.get();
    if (lock = null) {
    lock = new lock();
    staticHM.put(key, new lock());
    lock.incRefCount();
    try {
    synchronized(lock) {
    // only one onMessage will be able to lock a particular key at a time
    do your work;
    } finally {
    synchronized(staticHT) {
    if (lock.defRefCount() == 0) staticHM.remove(lock);
    if (lock = null) staticHM.put(key);
    If multiple threads get a message with the same key, then only one thread at a time will work on the key.
    Hope this helps,
    Tom

  • Jndi-name in  Message Driven Bean

    Hi
    I have successfully created the ejb jar file for deployment using sun one studio . I created the message driven bean and I right clicked on the ejb and used the customize option to set the bean properties . But my problem is that the jndi-name in the <ejb> tags takes the value jms/(ejbname) instead of jms/(queuename) . I am attaching the xml file with this . Can any one tell how to set the jndi-name to queue value using studio
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE sun-ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Sun ONE Application Server 7.0 EJB 2.0//EN" "http://www.sun.com/software/sunone/appserver/dtds/sun-ejb-jar_2_0-0.dtd">
    <sun-ejb-jar>
    <enterprise-beans>
    <name>ejb</name>
    <ejb>
    <ejb-name>Suneesh</ejb-name>
    <jndi-name>jms/Suneesh</jndi-name> <resource-ref>
    <res-ref-name>QueueConnectionFactory</res-ref-name>
    <jndi-name>jms/QueueConnectionFactory</jndi-name>
    </resource-ref>
    <resource-env-ref>
    <resource-env-ref-name>TestQueue</resource-env-ref-name>
    <jndi-name>jms/TestQueue</jndi-name>
    </resource-env-ref>
    <pass-by-reference>false</pass-by-reference>
    </ejb>
    <ejb>
    <ejb-name>Suneesh1</ejb-name>
    <jndi-name>jms/Suneesh1</jndi-name>
    <resource-ref>
    <res-ref-name>QueueConnectionFactory</res-ref-name>
    <jndi-name>jms/QueueConnectionFactory</jndi-name>
    </resource-ref>
    <resource-env-ref>
    <resource-env-ref-name>TestQueue1</resource-env-ref-name>
    <jndi-name>jms/TestQueue1</jndi-name>
    </resource-env-ref>
    <pass-by-reference>false</pass-by-reference>
    </ejb>
    </enterprise-beans>
    </sun-ejb-jar>

    Hi 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

  • Message Driven Bean reading multiple times from a jms queue

    Hi,
    I am facing a strange problem with my message driven bean. Its configured to read message from a jms queue. But sometimes it read the same message multiple times from the jms queue.
    We are using weblogic server 8.1 sp5.
    Please find below our descriptor files
    ejb-jar.xml  
    <ejb-jar>  
      <display-name>ClarifyCRM_Process_Manager_13.1</display-name>  
      <enterprise-beans>  
        <session>  
          <display-name>ProcessManager</display-name>  
          <ejb-name>ProcessManager</ejb-name>  
          <home>com.clarify.procmgr.ejb.ProcessManagerHome</home>  
          <remote>com.clarify.procmgr.ejb.ProcessManagerRemote</remote>  
          <ejb-class>com.clarify.procmgr.ejb.ProcessManagerEJB</ejb-class>  
          <session-type>Stateless</session-type>  
          <transaction-type>Container</transaction-type>  
        </session>  
        <message-driven>  
          <display-name>ProcessManagerListener</display-name>  
          <ejb-name>ProcessManagerListener</ejb-name>  
          <ejb-class>com.clarify.procmgr.ejb.ProcessManagerMDB</ejb-class>  
          <transaction-type>Bean</transaction-type>  
          <acknowledge-mode>Auto-acknowledge</acknowledge-mode>  
          <message-driven-destination>  
            <destination-type>javax.jms.Queue</destination-type>  
          </message-driven-destination>  
        </message-driven>  
      </enterprise-beans>  
      <assembly-descriptor>  
        <container-transaction>  
          <method>  
            <ejb-name>ProcessManager</ejb-name>  
            <method-name>*</method-name>  
          </method>  
          <trans-attribute>Required</trans-attribute>  
        </container-transaction>  
      </assembly-descriptor>  
    </ejb-jar>  
    weblogic-ejb-jar.xml  
    <weblogic-ejb-jar>  
      <weblogic-enterprise-bean>  
        <ejb-name>ProcessManager</ejb-name>  
        <stateless-session-descriptor>  
          <pool>  
            <max-beans-in-free-pool>100</max-beans-in-free-pool>  
            <initial-beans-in-free-pool>10</initial-beans-in-free-pool>  
          </pool>  
        </stateless-session-descriptor>  
        <enable-call-by-reference>False</enable-call-by-reference>  
        <jndi-name>ProcessManagerHome</jndi-name>  
        <dispatch-policy>PMExecuteQueue</dispatch-policy>  
        <remote-client-timeout>0</remote-client-timeout>  
      </weblogic-enterprise-bean>  
      <weblogic-enterprise-bean>  
        <ejb-name>ProcessManagerListener</ejb-name>  
        <message-driven-descriptor>  
          <pool>  
            <max-beans-in-free-pool>100</max-beans-in-free-pool>  
            <initial-beans-in-free-pool>10</initial-beans-in-free-pool>  
          </pool>  
          <destination-jndi-name>clarify.procmgr.jms.queue.Execution</destination-jndi-name>  
          <connection-factory-jndi-name>clarify.procmgr.jms.factories.ExecConnection</connection-factory-jndi-name>  
        </message-driven-descriptor>  
        <enable-call-by-reference>True</enable-call-by-reference>  
        <dispatch-policy>PMListenerExecuteQueue</dispatch-policy>  
        <remote-client-timeout>0</remote-client-timeout>  
      </weblogic-enterprise-bean>  
    </weblogic-ejb-jar>   The MDB is sometimes reading multiple times from clarify.procmgr.jms.queue.Execution
    Also i would like to add here that the connection factory we are using clarify.procmgr.jms.factories.ExecConnection is having the following properties
    ServerAffinity Enabled=true
    XA connection factory enabled=false.
    Please help me out here!!

    Maybe, your MDB "sometimes" throws an Exception in onMessage.
    Check if this happens when you set <max-beans-in-free-pool>1</max-beans-in-free-pool>.

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

  • Send message from JSP page to Java message driven bean

    Hi all
    I'm using Jdev903.
    I need to send a message from JSP page (Web Application) to Java Message Driven Bean.
    * I created Message Driven Bean that named: MyMessageDrivenEJBBean
    * I have configed jms.xml:
    <topic-connection-factory name="ChatTopicConnectionFactory" location="jms/theTopicConnectionFactory"/>
    <topic name="ChatTopic" location="jms/theTopic"/>
    * In JSP page, my code is:
    final Context ctx = new InitialContext();
    // 1: Lookup ConnectionFactory via JNDI
    TopicConnectionFactory factory =(TopicConnectionFactory)ctx.lookup("jms/theTopicConnectionFactory");
    But trouble occurs is:
    javax.naming.NameNotFoundException: jms/theTopicConnectionFactory not found
    please help me!
    thank a lot.

    Welcome to the Sun forums.
    1. Please post your code using code tags, this formats it so that it is easier for people to read and understand it. Click on 'CODE' above the text area when posting.
    2. As far as possible, please post an SSCCE
    What have learnt about JSPs and servlets till now? Because reading the values submitted in a form is pretty much the base of all operations. I suggest you Google for [servlet tutorials|http://www.google.com/search?q=servlet+tutorial] and [JSP tutorials|http://www.google.com/search?q=jsp+tutorial] and go through them thoroughly. After you understand what is to be done and what options are available to you, if you still face problems, please feel free to post your queries here. But this isn't exactly a site for tutorials, especially since there are so many good ones already out there, that explain all this stuff in detail. There's no point in re-inventing the wheel.
    Hints: [ServletRequest#getParameter()|http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletRequest.html#getParameter(java.lang.String)] and [RequestDispatcher#forward|http://java.sun.com/javaee/5/docs/api/javax/servlet/RequestDispatcher.html]

Maybe you are looking for

  • Why does every version of Firefox seem less stable of the version before?

    Firefox used to be the best and most stable browser around, but the last few years I've been noticing major memory leaks that get worse with every update. Simply submitting a crash report from one browser won't make any difference here because I'm no

  • Disable/Grey out a row in ABAP Objects

    HI, I have a reqmt where in which in the report - when check box display BOM is checked only BOM components needs to be displayed in the output but should not allow user to select the row and make changes by pressing anybutton. The display rows shoul

  • How do I install the plug-in for Solaris??

    Where are the steps documented to use the 1.4 plug-in with Netscape 4.x on Solaris? I was expecting a big README when I unpacked the product. I thought maybe all I had to do was set NPX_PLUGIN_PATH=/disk2/j2re1.4/plugin/sparc/ns4 but it still uses th

  • LDAP configuration for HR Portal in dual stack EHP4 - Best Practice

    Hi Experts,            Hello Experts, We are trying to use the JAVA Stack of ECC server for HR Portal i.e Dual Stack and have applied EHP4 package for ESS/MSS Appraisal. When we are trying to configure the LDAP ADS datasource through portal , we are

  • Moving photos between libraries

    I take lots of photos, and, with previous incarnations of iPhoto, this was a bit of a problem. To get around it, I created multiple users on my computer, each with a themed library (family, travel, hobbies, etc.) With iPhoto 6 I can have much larger