URLConnection from MDB

I am working on an application where the MDB (configurable value) will pick up message from IBM MQ, process these messages and post them out to a URI and handle the response back and put them to MQ. I am trying to use HttpClient instead of URLConnection. My question is,
1) What is the best practice to open this (rather say these) external connection (s) and post message to them?
2) How to do the house keeping (managing resources)
3) Is it good to use SessionBean (Stateful, Stateless?)
Any ideas appreciated

1) What is the best practice to open this (rather say these) external connection (s) and post message to them?
The biggest problem you'll have is figuring out how (and if) to handle errors. Since HTTP POSTS aren't transactional you can get the situation where the POST succeeds, but your server dies before the JMS session is commited. Since the JMS session didn't commit, the message will still be on the queue and be picked up next time your MDB starts, leading to a duplicate post. One way to resovle this is if the message contains a unique id, the recipient can discard duplicates.
An alternative scenario where there is something wrong with the message. In this situation you need to agree with the recipient whether they will handle the error or whether the MDB should.
There's no best practice for this sort of thing, as it depends on how valuable the message is, whether duplicates matter, whether bad messages can be fixed, or need to be corrected at source etc.
2) How to do the house keeping (managing resources)
Do you mean TCP/IP connections? I haven't done much work with HttpClient but it looks as though you can share connections using the HttpConnectionManager.
3) Is it good to use SessionBean (Stateful, Stateless?)
I would delegate the http work to another class, but don't see any benefit in making it a session bean.

Similar Messages

  • Not able to Call JDBC control from MDB

    I need to call a method in the JDBC control from the Message Driven Bean(MDB). When I try to do so, Weblogic throws an error. I tried to call a Custom Control from MDB and the Custom Control called a method in the JDBC control but that does not work too. Can someone help me solve this?
    Can't we call the JDBC control from MDB? There should be some way around this.
    This is the error I get :
    org.apache.beehive.controls.api.ControlException: Control initialization failure[org.apache.beehive.controls.api.ControlException: Contextual service org.apache.beehive.controls.api.context.ResourceContext is not available]
         at org.apache.beehive.controls.runtime.bean.ControlBean.ensureControl(ControlBean.java:326)
         at com.boehringer.supplier.control.db.ForecastJDBCControlBean.updateSpendWithCMId(ForecastJDBCControlBean.java:2879)
         at com.boehringer.supplier.control.java.SupplierControlImpl.processCustomer(SupplierControlImpl.java:1290)
         at com.boehringer.supplier.control.java.SupplierControlImpl.processSonicInboundMessage(SupplierControlImpl.java:1096)
         at com.boehringer.supplier.control.java.SupplierControlBean.processSonicInboundMessage(SupplierControlBean.java:663)
         at com.boehringer.sonic.SonicVendorInboundMDB.onMessage(SonicVendorInboundMDB.java:45)
         at weblogic.ejb.container.internal.MDListener.execute(MDListener.java:466)
         at weblogic.ejb.container.internal.MDListener.transactionalOnMessage(MDListener.java:371)
         at weblogic.ejb.container.internal.ContinuousJMSMessagePoller.processOneMessage(ContinuousJMSMessagePoller.java:138)
         at weblogic.ejb.container.internal.JMSMessagePoller.pollContinuously(JMSMessagePoller.java:404)
         at weblogic.ejb.container.internal.ContinuousJMSMessagePoller.pollForParent(ContinuousJMSMessagePoller.java:213)
         at weblogic.ejb.container.internal.JMSMessagePoller.run(JMSMessagePoller.java:543)
         at java.lang.Thread.run(Thread.java:595)
    Caused by: org.apache.beehive.controls.api.ControlException: Contextual service org.apache.beehive.controls.api.context.ResourceContext is not available
         at org.apache.beehive.controls.system.jdbc.JdbcControlImplInitializer.initServices(JdbcControlImplInitializer.java:50)
         at org.apache.beehive.controls.runtime.bean.ImplInitializer.initialize(ImplInitializer.java:34)
         at org.apache.beehive.controls.runtime.bean.ControlBean.ensureControl(ControlBean.java:321)
         ... 12 more

    Hi,
    I am getting the same error. Did you got any solution for this?
    Please help.
    Any kind of help is appreciated.
    Thanks,
    Dpak

  • How to invoke a servlet from MDB

    Hi,
    Can someone please tell me how to invoke a servlet from MDB. Actually I want to have a MDB that will invoke a servlet that takes arround ~3 minutes to process and send the response back to MDB. Any small code snippet on invoking a servlet.
    Thanks

    nope. this is probably a bad design.
    but here's a hint: whenever you have a question like this, start browsing the javadocs. chances are there's a class that might help you.
    i'd recommend that you look at this:
    http://java.sun.com/javase/6/docs/api/java/net/HttpURLConnection.html
    %

  • Trying to call stateless session bean from MDB

    Folks,
    Am working on RAD and WAS 8.
    I have an MDB. And a stateless session bean (AOBean under EJB project).
    While the listener listens to the messages from queue, it also tries to persist to db. I want to achieve this via a method of AOBean (through instantiating session bean or by injection).
    I have been sucessful by invoking a method from AOBean class -  that method just returns a string (without any objects being passed)
    Problem:
    I am getting IllegalStateException when I try to invoke a method of AOBean class, that has an object as a parameter
    For eg:
    MDB
    @EJB(name="ejb/TransactionMgrAOBean", mappedName="ejb/TransactionMgrAOBean")
    ITransactionMgrAO tranAO;
        public void onMessage(Message message) {
         TextMessage textMessage = (TextMessage) message;
         boolean status = false;
      try {
       TransactionVO tranVO =  getTransactionVO();//Here building the object to be passed to session bean
       String status1  = tranAO.getVersion(tranVO);
      }catch(Exception e){
    AOBean
    @Stateless
    @Remote({ ITransactionMgrAO.class })
    @WebService
    public class TransactionMgrAOBean {
    public String getVersion(TransactionVO tranVO) throws Exception{
      try{
    //business logic 
      } catch(Exception e){
      throw e;
      return true;
    TransactionVO implements Serializable has also inner static classes that are not Serializable.
    EXCEPTION: At runtime we are getting exception saying that the inner classes are not serialized.
    REASON why we are invoking session bean from MDB? We found that if we invoke any service from AOBean the transaction management was successful. We are using sessionContext.setRollBackonly when an exception occurs. Tranasactions are not rolled back when any db exception occurs if we invoke business logic methods from Model layer of another NON-EJB package.
    Hope I have provided enough information!

    My concret problem is that I want to call an ejb session contained in an ejb project from a session bean in a different web project. When I include the code in my web session bean I get the error adjunted:
    - Code:
    @EJB
    private UserRemote userSessionBean;
    - Error:
    Exception Details: javax.naming.NameNotFoundException
    pac.UserRemote#pac.UserRemote not found
    Possible Source of Error:
    Class Name: com.sun.enterprise.naming.TransientContext
    File Name: TransientContext.java
    Method Name: doLookup
    Line Number: 216
    Any suggestion?

  • Connecting to a Remote JMS provider from MDB in jboss-4.0

    Hi,
    I am using Tibco as a remote JMS Provider. When the Tibco server is running on the same machine as JBoss-4.0, the Message Driven Bean deployed in Jboss is able to get the messages from the queue on Tibco server.
    I have added the following configuration to jms-ds.xml file
    <!-- The JMS provider loader -->
    <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
    name="jboss.mq:service=JMSProviderLoader,name=JMSProvider">
    <attribute name="ProviderName">TIBCOJMSProvider</attribute>
    <attribute name="ProviderAdapterClass">
    org.jboss.jms.jndi.JNDIProviderAdapter
    </attribute>
    <!-- The combined connection factory -->
    <!--attribute name="FactoryRef">XAConnectionFactory</attribute-->
    <!-- The queue connection factory -->
    <attribute name="QueueFactoryRef">XAQueueConnectionFactory</attribute>
    <!-- The topic factory -->
    <attribute name="TopicFactoryRef">XATopicConnectionFactory</attribute>
    <attribute name="Properties">
    java.naming.factory.initial=com.tibco.tibjms.naming.TibjmsInitialContextFactory
    java.naming.factory.url.pkgs=com.tibco.tibjms.naming
    java.naming.provider.url=tibjmsnaming://TibcoHost:7222
    </attribute>
    </mbean>
    Also following invoker proxy binding is added to standardjboss.xml & it is used in MDB's jboss.xml
    <invoker-proxy-binding>
    <name>my-mdb-invoker</name>
    <invoker-mbean>does-not-matter</invoker-mbean>
    <proxy-factory>org.jboss.ejb.plugins.jms.JMSContainerInvoker</proxy-factory>
    <proxy-factory-config>
    <JMSProviderAdapterJNDI>TIBCOJMSProvider</JMSProviderAdapterJNDI>
    <ServerSessionPoolFactoryJNDI>StdJMSPool</ServerSessionPoolFactoryJNDI>
    <MinimumSize>1</MinimumSize>
    <KeepAliveMillis>30000</KeepAliveMillis>
    <MaximumSize>15</MaximumSize>
    <MaxMessages>1</MaxMessages>
    <MDBConfig>
    <ReconnectIntervalSec>10</ReconnectIntervalSec>
    <DLQConfig>
    <DestinationQueue>queue/DLQ</DestinationQueue>
    <MaxTimesRedelivered>10</MaxTimesRedelivered>
    <TimeToLive>0</TimeToLive>
    </DLQConfig>
    </MDBConfig>
    </proxy-factory-config>
    </invoker-proxy-binding>
    But When I try to use Tibco server on some other machine it throws following exception. It actually tryies to connect to Tibco server on same machine.
    javax.jms.JMSException: Failed to connect to the server at tcp://localhost:7222
    at com.tibco.tibjms.TibjmsxLinkTcp._createSocket(TibjmsxLinkTcp.java:748)
    at com.tibco.tibjms.TibjmsxLinkTcp.connect(TibjmsxLinkTcp.java:857)
    at com.tibco.tibjms.TibjmsConnection._create(TibjmsConnection.java:611)
    at com.tibco.tibjms.TibjmsConnection.<init>(TibjmsConnection.java:1769)
    at com.tibco.tibjms.TibjmsQueueConnection.<init>(TibjmsQueueConnection.java:35)
    at com.tibco.tibjms.TibjmsxCFImpl._createImpl(TibjmsxCFImpl.java:90)
    at com.tibco.tibjms.TibjmsxCFImpl._createConnection(TibjmsxCFImpl.java:151)
    at com.tibco.tibjms.TibjmsXAQueueConnectionFactory.createQueueConnection(TibjmsXAQueueConnectionFactory.java:140
    at org.jboss.ejb.plugins.jms.DLQHandler.createService(DLQHandler.java:152)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupport.java:237)
    at org.jboss.system.ServiceMBeanSupport.create(ServiceMBeanSupport.java:164)
    at org.jboss.ejb.plugins.jms.JMSContainerInvoker.innerCreate(JMSContainerInvoker.java:545)
    at org.jboss.ejb.plugins.jms.JMSContainerInvoker.startService(JMSContainerInvoker.java:767)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221)
    at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
    at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:891)
    at $Proxy45.start(Unknown Source)
    at org.jboss.system.ServiceController.start(ServiceController.java:416)
    at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
    at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:170)
    at org.jboss.ejb.MessageDrivenContainer.startService(MessageDrivenContainer.java:262)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221)
    at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
    at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:891)
    at $Proxy0.start(Unknown Source)
    at org.jboss.system.ServiceController.start(ServiceController.java:416)
    at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
    at $Proxy43.start(Unknown Source)
    at org.jboss.ejb.EjbModule.startService(EjbModule.java:394)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221)
    at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
    at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:891)
    at $Proxy0.start(Unknown Source)
    at org.jboss.system.ServiceController.start(ServiceController.java:416)
    at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
    at $Proxy19.start(Unknown Source)
    at org.jboss.ejb.EJBDeployer.start(EJBDeployer.java:605)
    at org.jboss.deployment.MainDeployer.start(MainDeployer.java:935)
    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:746)
    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:709)
    at sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
    at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:119)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
    at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:131)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
    at $Proxy8.deploy(Unknown Source)

    Hi,
    I am using Tibco as a remote JMS Provider. When the Tibco server is running on the same machine as JBoss-4.0, the Message Driven Bean deployed in Jboss is able to get the messages from the queue on Tibco server.
    I have added the following configuration to jms-ds.xml file
    <!-- The JMS provider loader -->
    <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
    name="jboss.mq:service=JMSProviderLoader,name=JMSProvider">
    <attribute name="ProviderName">TIBCOJMSProvider</attribute>
    <attribute name="ProviderAdapterClass">
    org.jboss.jms.jndi.JNDIProviderAdapter
    </attribute>
    <!-- The combined connection factory -->
    <!--attribute name="FactoryRef">XAConnectionFactory</attribute-->
    <!-- The queue connection factory -->
    <attribute name="QueueFactoryRef">XAQueueConnectionFactory</attribute>
    <!-- The topic factory -->
    <attribute name="TopicFactoryRef">XATopicConnectionFactory</attribute>
    <attribute name="Properties">
    java.naming.factory.initial=com.tibco.tibjms.naming.TibjmsInitialContextFactory
    java.naming.factory.url.pkgs=com.tibco.tibjms.naming
    java.naming.provider.url=tibjmsnaming://TibcoHost:7222
    </attribute>
    </mbean>
    Also following invoker proxy binding is added to standardjboss.xml & it is used in MDB's jboss.xml
    <invoker-proxy-binding>
    <name>my-mdb-invoker</name>
    <invoker-mbean>does-not-matter</invoker-mbean>
    <proxy-factory>org.jboss.ejb.plugins.jms.JMSContainerInvoker</proxy-factory>
    <proxy-factory-config>
    <JMSProviderAdapterJNDI>TIBCOJMSProvider</JMSProviderAdapterJNDI>
    <ServerSessionPoolFactoryJNDI>StdJMSPool</ServerSessionPoolFactoryJNDI>
    <MinimumSize>1</MinimumSize>
    <KeepAliveMillis>30000</KeepAliveMillis>
    <MaximumSize>15</MaximumSize>
    <MaxMessages>1</MaxMessages>
    <MDBConfig>
    <ReconnectIntervalSec>10</ReconnectIntervalSec>
    <DLQConfig>
    <DestinationQueue>queue/DLQ</DestinationQueue>
    <MaxTimesRedelivered>10</MaxTimesRedelivered>
    <TimeToLive>0</TimeToLive>
    </DLQConfig>
    </MDBConfig>
    </proxy-factory-config>
    </invoker-proxy-binding>
    But When I try to use Tibco server on some other machine it throws following exception. It actually tryies to connect to Tibco server on same machine.
    javax.jms.JMSException: Failed to connect to the server at tcp://localhost:7222
    at com.tibco.tibjms.TibjmsxLinkTcp._createSocket(TibjmsxLinkTcp.java:748)
    at com.tibco.tibjms.TibjmsxLinkTcp.connect(TibjmsxLinkTcp.java:857)
    at com.tibco.tibjms.TibjmsConnection._create(TibjmsConnection.java:611)
    at com.tibco.tibjms.TibjmsConnection.<init>(TibjmsConnection.java:1769)
    at com.tibco.tibjms.TibjmsQueueConnection.<init>(TibjmsQueueConnection.java:35)
    at com.tibco.tibjms.TibjmsxCFImpl._createImpl(TibjmsxCFImpl.java:90)
    at com.tibco.tibjms.TibjmsxCFImpl._createConnection(TibjmsxCFImpl.java:151)
    at com.tibco.tibjms.TibjmsXAQueueConnectionFactory.createQueueConnection(TibjmsXAQueueConnectionFactory.java:140
    at org.jboss.ejb.plugins.jms.DLQHandler.createService(DLQHandler.java:152)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupport.java:237)
    at org.jboss.system.ServiceMBeanSupport.create(ServiceMBeanSupport.java:164)
    at org.jboss.ejb.plugins.jms.JMSContainerInvoker.innerCreate(JMSContainerInvoker.java:545)
    at org.jboss.ejb.plugins.jms.JMSContainerInvoker.startService(JMSContainerInvoker.java:767)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221)
    at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
    at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:891)
    at $Proxy45.start(Unknown Source)
    at org.jboss.system.ServiceController.start(ServiceController.java:416)
    at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
    at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:170)
    at org.jboss.ejb.MessageDrivenContainer.startService(MessageDrivenContainer.java:262)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221)
    at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
    at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:891)
    at $Proxy0.start(Unknown Source)
    at org.jboss.system.ServiceController.start(ServiceController.java:416)
    at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
    at $Proxy43.start(Unknown Source)
    at org.jboss.ejb.EjbModule.startService(EjbModule.java:394)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221)
    at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
    at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:891)
    at $Proxy0.start(Unknown Source)
    at org.jboss.system.ServiceController.start(ServiceController.java:416)
    at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
    at $Proxy19.start(Unknown Source)
    at org.jboss.ejb.EJBDeployer.start(EJBDeployer.java:605)
    at org.jboss.deployment.MainDeployer.start(MainDeployer.java:935)
    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:746)
    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:709)
    at sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
    at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:119)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
    at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:131)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
    at $Proxy8.deploy(Unknown Source)

  • Using Session EJB from MDB in Weblogic 11G

    I am having trouble with what should be a very simple operation. I have created an MDB and deployed it successfully on the Weblogic managed server. Then in a separate application, I created a Stateless session bean that I would also like to call from the MDB. My SSB deploys and works fine. I added an @EJB annotation to the MDB so I could instantiate and access the SSB from the MDB. In order to resolve the interface class in jDeveloper, I went to my MDB project properties under libraries and classpath and added the jar file for my ejb.
    When I try to redeploy the MDB, I get a java.lang.ClassNotFoundException on the SSB interface class.
    Is there an example somewhere of how to properly create and configure all of the deployment packages and refereneces I need on the weblogic server? The SSB is a common service that going to be called by a lot of other MDBs in my system. Optimally, what I would like to do is to deploy the ejb-client.jar as a shared library so all of my MDBs can use it.
    Thanks for any pointers!

    I am using jDeveloper 11g, so both my MDB and SLSB were built and deployed using the wizzards in the IDE.
    The MDB is inside of an ejb-jar and deployed to a managed server. I am doing my development on a box that is resource challenged so I setup my WLS on a different box. There is an admin server (AdminServer) and a separate soa server (soa_server1) on which I have installed all of the SOA Suite packages.
    The SLSB represents a primary service for the system I am building. Service1SessionBean is deployed targeted to soa_server1. The MDB is also deployed to soa_server1. At least it was until I tried to add the EJB reference. Now it won't deploy at all.
    I would like to avoid packaging the Service1SessionBean client jar in with the MDB because there are several other EJBs that will also need to call the service. I would like to deploy the client jar as a shared library on soa_server1 so that any EJB artifacts that need to call it may do so, I have tried to deploy the client jar as a shared library using jDeveloper but when it deploys, it seems to be under the name "j2ee-app" rather than Service1SessionBean.

  • Accessing AQ from MDB in JBoss

    Hi All,
    I am trying to read the messages from AQ. I am able to read the messages through a JMS client but not able to get any breakthrough with MDB...kindly help.
    I wrote a simple MDB....
    package com.ameripath.billinginterface.mdb;
    import java.util.Enumeration;
    import java.util.Hashtable;
    import javax.jms.Message;
    import javax.jms.MessageListener;
    import javax.jms.TextMessage;
    import javax.ejb.ActivationConfigProperty;
    import javax.ejb.MessageDriven;
    @MessageDriven(activationConfig =
              @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Topic"),
              @ActivationConfigProperty(propertyName="destination", propertyValue="topic/OAQRequestTopic")
    public class AQMDB implements MessageListener {
         public void onMessage(Message message) {
              String reqMsg = null;
    System.out.println("!!!!!!!!!!!!!1Inside onMessage~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
    updated Jboss-service.xml with...
    <mbean code="jmx.service.oracle.aq.OAQDestination"
    name="jmx.service.oracle.aq:service=OAQRequestTopic">
    <attribute name="JndiName">topic/OAQRequestTopic</attribute>
    <attribute name="JMSStyle">topic</attribute>
    <attribute name="IsXA">false</attribute>
    <attribute name="URL">jdbc:oracle:thin:@192.168.200.73:1521:INTORCL</attribute>
    <attribute name="Username">oas_intgrtn</attribute>
    <attribute name="Password">oas_intgrtn</attribute>
    <attribute name="PayloadFactory"></attribute>
    <attribute name="Schema">oas_intgrtn</attribute>
    <attribute name="Destination">MULTI_QUEUE</attribute>
    <depends>jboss:service=Naming</depends>
    </mbean>
    updated jms-ds.xml with....
    <!-- The OAQ JMS provider loader -->
    <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
    name="jboss.mq:service=JMSProviderLoader,name=OAQJMSProvider">
    <attribute name="ProviderName">OAQJMSProvider</attribute>
    <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute>
    <!-- <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JBossMQProvider</attribute> -->
    <attribute name="QueueFactoryRef">OAQQueueConnectionFactory</attribute>
    <attribute name="TopicFactoryRef">OAQTopicConnectionFactory</attribute>
    </mbean>
    also updated standardjboss.xml with ...
    <invoker-proxy-binding>
    <name>oaq-message-driven-bean</name>
    <invoker-mbean>default</invoker-mbean>
    <proxy-factory>org.jboss.ejb.plugins.jms.JMSContainerInvoker</proxy-factory>
    <proxy-factory-config>
    <JMSProviderAdapterJNDI>OAQJMSProvider</JMSProviderAdapterJNDI>
    <ServerSessionPoolFactoryJNDI>StdJMSPool</ServerSessionPoolFactoryJNDI>
    <MaximumSize>5</MaximumSize>
    <MaxMessages>5</MaxMessages>
    <MDBConfig>
    <ReconnectIntervalSec>10</ReconnectIntervalSec>
    <DLQConfig>
    <DestinationQueue>queue/DLQ</DestinationQueue>
    <MaxTimesRedelivered>10</MaxTimesRedelivered>
    <TimeToLive>0</TimeToLive>
    </DLQConfig>
    </MDBConfig>
    </proxy-factory-config>
    </invoker-proxy-binding>
    <!-- for AQ -->
    <container-configuration>
    <container-name>OAQ Message Driven Bean</container-name>
    <call-logging>false</call-logging>
    <invoker-proxy-binding-name>oaq-message-driven-bean</invoker-proxy-binding-name>
    <container-interceptors>
    <interceptor>org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor</interceptor>
    <interceptor>org.jboss.ejb.plugins.LogInterceptor</interceptor>
    <interceptor>org.jboss.ejb.plugins.RunAsSecurityInterceptor</interceptor>
    <!-- CMT -->
    <interceptor transaction="Container">org.jboss.ejb.plugins.TxInterceptorCMT</interceptor>
    <interceptor transaction="Container" metricsEnabled="true">org.jboss.ejb.plugins.MetricsInterceptor</interceptor>
    <interceptor transaction="Container">org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor</interceptor>
    <!-- BMT -->
    <interceptor transaction="Bean">org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor</interceptor>
    <interceptor transaction="Bean">org.jboss.ejb.plugins.MessageDrivenTxInterceptorBMT</interceptor>
    <interceptor transaction="Bean" metricsEnabled="true">org.jboss.ejb.plugins.MetricsInterceptor</interceptor>
    <interceptor>org.jboss.resource.connectionmanager.CachedConnectionInterceptor</interceptor>
    </container-interceptors>
    <instance-pool>org.jboss.ejb.plugins.MessageDrivenInstancePool</instance-pool>
    <instance-cache></instance-cache>
    <persistence-manager></persistence-manager>
    <container-pool-conf>
    <MaximumSize>100</MaximumSize>
    </container-pool-conf>
    </container-configuration>
    <!-- for AQ -->
    I am getting this error on deployment of this MDB....
    18:35:07,236 INFO [Ejb3AnnotationHandler] found EJB3: ejbName=AQMDB, class=com.
    ameripath.billinginterface.mdb.AQMDB, type=MESSAGE_DRIVEN
    18:35:07,548 INFO [Ejb3Deployment] EJB3 deployment time took: 500
    18:35:07,627 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:service=E
    JB3,jar=bi_pocapp.ejb3,name=AQMDB with dependencies:
    18:35:08,189 WARN [ServiceController] Problem starting service jboss.j2ee:servi
    ce=EJB3,jar=bi_pocapp.ejb3,name=AQMDB
    java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
    java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    Kindly suggest a fix
    thanks in anticipation

    Hi,
    I´m facing exactly the same problem and weren´t able to solve it. Anyone was able to acomplish this?
    Regards,
    Vinicius

  • UTF-8 enabling JMS message read from MDB

    Hi,
    I need to read a Chinese name from the JMS topic through the onMessage event of a EJB3.0 MDB. I'm using the ESB 10.1.3 JMS adapter to push data into my DemoTopic.
    But, when I read the JMS message from the MDB, I get '????' as part of Chinese name value.
    How and where do I have to set the character set to UTF-8?
    Vikas

    Check where your MDB sends the [response] messages to.

  • How to stop reading foreign queue message from MDB using weblogic 6.1? thanks,

    Hi, I am using weblogic 6.1 to communicate with IBM MQseries foreign
    queue. I use the asychronous way "onMessage()"(properly the only
    known way) to listen the messages from the queue. I like to stop
    receiving messages if my south bound stream has problems and not able
    to process the message, I would like to stop fetching the message with
    my MDB(message driven bean) untill the down stream problem is cleared.
    As weblogic uses container to create the multiple session and
    connections internally, how can I efficiently stop the message
    delivery, do I have to locate all the connections and issue
    connection.stop()for each one, or there is better way to do this.
    Thanks in advance.

    If you never use FaceTime on your Mac, open the FaceTime app on it and sign out. Also, the following instructions are from Connect your iPhone, iPad, iPod touch, and Mac using Continuity - Apple Support
    Turn off iPhone cellular calls
    To turn off iPhone cellular calls on your iPad or iPod touch, go to Settings > FaceTime and turn off iPhone Cellular Calls.
    On your Mac, open the FaceTime app and go to FaceTime > Preferences. Click Settings and deselect the iPhone Cellular Calls option.

  • Invoking servlet from mDB

    Hi all;
    this is the process.
    1. Servlet received / creates msg.
    2. Servlet Enqueues Msg on JMS queue.
    3. MDB dequeues.
    -- processes against DB
    -- composes respoonse.
    4. mdb invokes servlet with response.
    servlet need not maintain state.
    State information can be passed in Msg (Query and Response)
    I was just wanting to find out if this possible in oc4j.
    apparently, there is a process in weblogic 6.1 to support this.
    Any help is appreciated.
    thanks.
    jayant

    I would assume that you would need to do a "createSipApplicationSession" on your sip factory and then get the ID from there.
    Then create a request from your session and send it.
    Wouldn't you want each outgoing call to be associated with a different sip app session?

  • Anyone used setJMSReplyTo functionality to get response from MDB?

    Ok, so now that I know how to send a message to a MDB via JMS/AQ, how can I get a reply to that message from the MDB?
    I understand there is a setJMSReplyTo method that can reply to a "temporary queue" but I haven't seen any reference to this in OC4J.
    Can anyone tell me if setJMSReplyTo can be used with OC4J?
    Thanks

    Hi Doug,
    I haven't got an answer for you -- just some pointers to other resources
    that may be of help (if you aren't already aware of them):
    http://tahiti.oracle.com
    http://www.orionserver.com
    http://www.orionsupport.com
    http://www.atlassian.com
    http://www.elephantwalker.com
    Good Luck,
    Avi.

  • Sending notification from MDB to MBean

    Hi
    Is there a way I can send a notification to an MBean from an MDB? I have a MessageDrivenBean that is listening to a queue. Any message on the queue need to be fwded to the MBean.
    MBean and the MDB, both are in a jboss sar. The version used is 4.2.0 with java 6.
    Any direction would be great. Thanks in advance

    Is your goal to be able to see how many messages are processed? If this is the case, I think you have two options:
    1. The MDB would have to be an MBean itself. In this case, your MDB would play two roles, an MDB, and an MBean. And then you just increment a count variable and expose it as an attribute.
    2. Alternatively, you could have a separate MBean that is registered as a listener on your MDB (like Observer/Observable, where MDB is the Observable, and the MBean is the Observer), and the MDB will call update on your MBean every time it handles a message. Then the MBean would increment its internal counter, which is exposed as an attribute. Depending on what else you do in the update method, you would want to be careful about handling this on the same thread, as it could slow down your MDB processing.
    - Alper

  • Import data from mdb

    Can I import a mdb file in Oracle, using PL/SQL? Or convert to another format (perhaps a script file) that Oracle can read?
    I need do this from an ASP page. So, I can't use the Access.

    &gt; muhammad,
    &gt;
    &gt; every week, from a Web page written in ASP, I need to
    &gt; inform the location of a mdb file and import its data
    &gt; to a Oracle schema (already created) with the same
    &gt; structure (the same tables and attributes).
    &gt;
    &gt; About your suggestions, I don't have sql server. This
    &gt; db link from access using DSN can be created using
    &gt; ASP ?
    &gt;
    Maybe I am already to late with my suggestion.
    You don't give any information which amounts of MDB-data you want to transfer to an Oracle schema. With ASP I would prefer a direct copy record by record by opening connections to the MDB and the Oracle db too. If you must avoid a decrease of the webserver maybe you can establish a planned task schedule on the webserver at a time where it is less frequented.
    Regards J. Schadler

  • Oracle.oc4j.rmi.OracleRemoteException while calling EJB from MDB

    Hi All,
    From Client am sending a request to a In_queue, MDB picks from that queue and sends to EJB. EJB processes it and sends back to the MDB and MDB to Client. This works fine for 20 requests. When i increase to 30 am getting EXCEPTION : oracle.oc4j.rmi.OracleRemoteException: An exception occurred during transaction completion: ; nested exception is: javax.transaction.RollbackException: Timed out
    I have increased the transaction-timeout to "999999" in orion-ejb-jar.xml. Still i get the same error. Can anybody please help me on this.
    Thank you in advance

    Hi all,
    Got the way to solve this. I increased the time of transaction-timeout to "100" in transaction-manager.xml. by default it is "30"

  • SEND JMS MESSAGE FROM MDB TO ANOTHER OC4J_INSTANCE

    Hi,
    How Can I Access JMS queues on other OC4J_INSTANCE from a EJB MDB??
    Suppose you have same applications on two OC4J instances (AS Cluster Active-Active) there is a MDB that should route message to JMS queue in one or other OC4J instance.
    How do do this??
    I created a new context with other OC4J parameters but can not use the java:comp/env/jms.
    Coukd someone explain what is java:comp/env/ ?? is this the jdni name of the queue??
    Please
    advise
    Thanks
    JO

    You may want to look at using the "Dedicated JMS Server" topology (found in the OC4J Services Guide, JMS chapter). You set the host/port of your connection factories in all OC4J instances to point to the same JMS server, then all OC4J instances can communicate via JMS. You can then using standard JMS techniques (different destinations, message properties and message selectors) to route messages.
    -Jeff

Maybe you are looking for

  • Creating a dropdown for Roles

    Hello All, Can anybody please help me to create a dropdown for various roles in the portal,so that if the user clicks on the first role in the Top Level Navigation ,he should see a dropdown list with other roles being displayed and listed to be selec

  • How do I get my songs in ITunes to stop skipping when crossfading?

    I like my music at parties to crossfade in and out and keep the mood going. Unfortunately on both my Gateway Desktop and Toshiba Laptop the beginning of the next song always skips terribly for a bout 2-3 seconds. What do I need to do to fix this prob

  • How do you get an old version of iTunes that has CoverFlow?

    I unfortunately installed the new iTunes and hate it. How can I get the old version back with cover flow?

  • XML wont load

    hello, im using this great tutorial from gotoandlean.com but have run into some problems im trying to load jpg's into a flash with xml, using the following code var x:XML = new XML (); x.ignoreWhite = true; var urls:Array = new Array(); var captions:

  • New drive has password issues

    Hi world, I had to change my intel iMac hard drive. Luckily I had a back up, however on trying to open after copying the back up it appears the passwords don't work. It also won't accept a new password even with the master password entered (which it