Re: Strange MDB invocation behavior
After a lot of investigation I've found a problem here on forum. I was using TomEE v1.0 with ActiveMQ client jar v5.5.1 which has some bug or whatever. Everything works smoothly with latest Tomee v1.1 build. There are no exceptions, however I am periodically checking logs for any kind of related problems. I'll let you know if any. Thanks for the support. -- View this message in context: http://openejb.979440.n4.nabble.com/Strange-MDB-invocation-behavior-tp4656801p4657321.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Strange MDB invocation behavior
8) > at > > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) > at > > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) > at java.lang.Thread.run(Thread.java:662) > > > > > -- > View this message in context: > http://openejb.979440.n4.nabble.com/Strange-MDB-invocation-behavior-tp4656801p4657302.html > Sent from the OpenEJB User mailing list archive at Nabble.com. >
Re: Strange MDB invocation behavior
I have added more logging and found that container occasionally issues following Exception when it sends JMS message. What the problem might be? I am creating connection in @PostConstruct method and then reusing it when posting messages (Session/Producers are created per send operations and not shared). Posting might occur from different threads. Should I create connection per message send operation or sharing Connection instance is fine? javax.jms.JMSException: The resource is allready being used in transaction context. at org.apache.activemq.ra.ManagedTransactionContext.setUseSharedTxContext(ManagedTransactionContext.java:47) at org.apache.activemq.ra.ManagedSessionProxy.setUseSharedTxContext(ManagedSessionProxy.java:67) at org.apache.activemq.ra.ManagedConnectionProxy.createSessionProxy(ManagedConnectionProxy.java:122) at org.apache.activemq.ra.ManagedConnectionProxy.createQueueSession(ManagedConnectionProxy.java:150) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.openejb.resource.AutoConnectionTracker$ConnectionInvocationHandler.invoke(AutoConnectionTracker.java:125) at $Proxy75.createQueueSession(Unknown Source) at com.bmm.dao.jms.AQueueMessageSender.createSession(AQueueMessageSender.java:23) at com.bmm.dao.jms.AMessageSender.post(AMessageSender.java:112) at com.bmm.dao.jms.SynchronizerClient.post(SynchronizerClient.java:52) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181) at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163) at org.apache.openejb.monitoring.StatsInterceptor.record(StatsInterceptor.java:176) at org.apache.openejb.monitoring.StatsInterceptor.invoke(StatsInterceptor.java:95) at sun.reflect.GeneratedMethodAccessor118.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181) at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163) at org.apache.openejb.cdi.CdiInterceptor.invoke(CdiInterceptor.java:129) at org.apache.openejb.cdi.CdiInterceptor.access$000(CdiInterceptor.java:45) at org.apache.openejb.cdi.CdiInterceptor$1.call(CdiInterceptor.java:66) at org.apache.openejb.cdi.CdiInterceptor.aroundInvoke(CdiInterceptor.java:72) at sun.reflect.GeneratedMethodAccessor117.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181) at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163) at org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:138) at org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:226) at org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:178) at org.apache.openejb.core.ivm.EjbObjectProxyHandler$AsynchronousCall.call(EjbObjectProxyHandler.java:296) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) -- View this message in context: http://openejb.979440.n4.nabble.com/Strange-MDB-invocation-behavior-tp4656801p4657302.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Strange MDB invocation behavior
i have not it in mind but i think AMQ has a kind of check interval parameter - Romain 2012/8/11 almos > We thought of network issue as well but it also reproduces in the case when > TomEE and ActiveMQ are on the same host. > For us it also seems like a kind of hibernation, when 1-st message awakes > some hibernated component and then it becomes alive again but first message > gets lost. > > > > > -- > View this message in context: > http://openejb.979440.n4.nabble.com/Strange-MDB-invocation-behavior-tp4656801p4656805.html > Sent from the OpenEJB User mailing list archive at Nabble.com. >
Re: Strange MDB invocation behavior
We thought of network issue as well but it also reproduces in the case when TomEE and ActiveMQ are on the same host. For us it also seems like a kind of hibernation, when 1-st message awakes some hibernated component and then it becomes alive again but first message gets lost. -- View this message in context: http://openejb.979440.n4.nabble.com/Strange-MDB-invocation-behavior-tp4656801p4656805.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Strange MDB invocation behavior
yep, check AMQ looks like a kind of hibernation can be a network issue too, no? then it fails and recover but you lost one message - Romain 2012/8/11 almos > Not exactly. > > System is running all the time. When users are doing some particular > actions > we use to send JMS messages and everything works fine in 99.9% of cases. > > After off hours (absolutely no activity at all for about 4-6 hours from the > users) where the are no requests and hence JMS invocations, first JMS > message delivery to the topic doesn't occur. > > In other words after about of 4-6 hours of inactivity, first user comes to > the system, does some action that triggers JMS message send operation and > that message doesn't get delivered to the MDB listeners. > All subsequent messages send via the system successfully delivered without > any other efforts done to the application (no shutdown/re-deploy). > In logs there are no exceptions and any other suspicious things. So the > only > one message is lost after off hours (inactivity) and then system works as > expected till next off hours period after which we face the same 1-st > message loss problem. > > I'll check ability to send via broker managemet console as well, thanks for > the suggestion. > > Regards, > Alex > > > > -- > View this message in context: > http://openejb.979440.n4.nabble.com/Strange-MDB-invocation-behavior-tp4656801p4656803.html > Sent from the OpenEJB User mailing list archive at Nabble.com. >
Re: Strange MDB invocation behavior
Not exactly. System is running all the time. When users are doing some particular actions we use to send JMS messages and everything works fine in 99.9% of cases. After off hours (absolutely no activity at all for about 4-6 hours from the users) where the are no requests and hence JMS invocations, first JMS message delivery to the topic doesn't occur. In other words after about of 4-6 hours of inactivity, first user comes to the system, does some action that triggers JMS message send operation and that message doesn't get delivered to the MDB listeners. All subsequent messages send via the system successfully delivered without any other efforts done to the application (no shutdown/re-deploy). In logs there are no exceptions and any other suspicious things. So the only one message is lost after off hours (inactivity) and then system works as expected till next off hours period after which we face the same 1-st message loss problem. I'll check ability to send via broker managemet console as well, thanks for the suggestion. Regards, Alex -- View this message in context: http://openejb.979440.n4.nabble.com/Strange-MDB-invocation-behavior-tp4656801p4656803.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Strange MDB invocation behavior
Hi, it means it works first then stop working? can you check you can still send message to AMQ broker (using AMQ directly), if not please check your AMQ config. - Romain 2012/8/11 almos > Hello, > > I am facing a strange behavior with MDB's that are listening on topics. > After long application inactive time (in other words - system is not used > overnight (3-4 hours)) first JMS message send to the topic NEVER reaches > destination (I have couple of MDBs listening on the topic and neither of > them gets invoked). I.e MDB isn't invoked (according to the verbose logs). > All next subsequent send operations works fine and all messages reach > destinations. > According to our observations this doesn't happen with JMS Queues which > uses > the same infrastructure code referenced below. > > What might be a problem? What we are doing incorrectly? > > Here is a code I use to send messages to the topic (without spaces, looks > like forum engine strips some URLs) > http:// pastebin.com /kZ5W0kXS > > So having this code to send messages to topic/queue I use following > approach: > > 1. inject sender into ejb bean: > @EJB private IISMClient ismClient; > 2. invoke send function > ismClient.post(notification); > > Here is my tomee.xml (without spaces) > http:// pastebin.com /kcdBcgEw > > Here is how we use @MessageDriven annotation. And as I mentioned after long > user inactivity first message sent to the topic ismTopic never gets > delivered to the listeners: > > @MessageDriven(activationConfig = { > @ActivationConfigProperty( > propertyName = "destinationType", > propertyValue = "javax.jms.Topic"), > @ActivationConfigProperty( > propertyName = "destination", > propertyValue = "ismTopic") > }) > public class TestListener extends AGenericListener implements > MessageListener { > @Override > public void onMessage(Message msg) > { > TextMessage tm = (TextMessage) msg; > try { > String message = tm.getText(); > logger.info("TestListener [message]: " + message); > setRawPacket(message); > process(); > } catch (JMSException e) { > e.printStackTrace(); > } > } > } > > Sender and listeners resides currently under the same TomEE 1.0 instance on > the same machine. > > Could you please check what I might be doing wrong? > > Thanks, > Alex > > > > -- > View this message in context: > http://openejb.979440.n4.nabble.com/Strange-MDB-invocation-behavior-tp4656801.html > Sent from the OpenEJB User mailing list archive at Nabble.com. >
Strange MDB invocation behavior
Hello, I am facing a strange behavior with MDB's that are listening on topics. After long application inactive time (in other words - system is not used overnight (3-4 hours)) first JMS message send to the topic NEVER reaches destination (I have couple of MDBs listening on the topic and neither of them gets invoked). I.e MDB isn't invoked (according to the verbose logs). All next subsequent send operations works fine and all messages reach destinations. According to our observations this doesn't happen with JMS Queues which uses the same infrastructure code referenced below. What might be a problem? What we are doing incorrectly? Here is a code I use to send messages to the topic (without spaces, looks like forum engine strips some URLs) http:// pastebin.com /kZ5W0kXS So having this code to send messages to topic/queue I use following approach: 1. inject sender into ejb bean: @EJB private IISMClient ismClient; 2. invoke send function ismClient.post(notification); Here is my tomee.xml (without spaces) http:// pastebin.com /kcdBcgEw Here is how we use @MessageDriven annotation. And as I mentioned after long user inactivity first message sent to the topic ismTopic never gets delivered to the listeners: @MessageDriven(activationConfig = { @ActivationConfigProperty( propertyName = "destinationType", propertyValue = "javax.jms.Topic"), @ActivationConfigProperty( propertyName = "destination", propertyValue = "ismTopic") }) public class TestListener extends AGenericListener implements MessageListener { @Override public void onMessage(Message msg) { TextMessage tm = (TextMessage) msg; try { String message = tm.getText(); logger.info("TestListener [message]: " + message); setRawPacket(message); process(); } catch (JMSException e) { e.printStackTrace(); } } } Sender and listeners resides currently under the same TomEE 1.0 instance on the same machine. Could you please check what I might be doing wrong? Thanks, Alex -- View this message in context: http://openejb.979440.n4.nabble.com/Strange-MDB-invocation-behavior-tp4656801.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: How do I *send* JMS messages from an MDB?
Thanks for the feedback! - Romain Le 17 avr. 2012 18:31, "Bjorn Danielsson" a écrit : > Problem solved! > > Thanks AndyG, this did the trick. I compiled a fresh ActiveMQ > snapshot (r1327126) and replaced the files from your list, and > now everything works. Tried with OpenJPA and EclipseLink, both > worked without a glitch. So the bug was in ActiveMQ-5.5.1. > > -- > Björn Danielsson > Cuspy Code AB > > > AndyG wrote: > > These are the required activemq jars: > > > > openejb\lib\activeio-core-3.2-20090713.104929-1.jar > > openejb\lib\activemq-core-5.6-SNAPSHOT.jar > > openejb\lib\activemq-protobuf-1.1.jar > > openejb\lib\activemq-ra-5.6-SNAPSHOT.jar > > openejb\lib\kahadb-5.6-SNAPSHOT.jar > > > > > > -- > > View this message in context: > http://openejb.979440.n4.nabble.com/How-do-I-send-JMS-messages-from-an-MDB-tp4561773p4564896.html > > Sent from the OpenEJB User mailing list archive at Nabble.com. >
Re: How do I *send* JMS messages from an MDB?
Problem solved! Thanks AndyG, this did the trick. I compiled a fresh ActiveMQ snapshot (r1327126) and replaced the files from your list, and now everything works. Tried with OpenJPA and EclipseLink, both worked without a glitch. So the bug was in ActiveMQ-5.5.1. -- Björn Danielsson Cuspy Code AB AndyG wrote: > These are the required activemq jars: > > openejb\lib\activeio-core-3.2-20090713.104929-1.jar > openejb\lib\activemq-core-5.6-SNAPSHOT.jar > openejb\lib\activemq-protobuf-1.1.jar > openejb\lib\activemq-ra-5.6-SNAPSHOT.jar > openejb\lib\kahadb-5.6-SNAPSHOT.jar > > > -- > View this message in context: > http://openejb.979440.n4.nabble.com/How-do-I-send-JMS-messages-from-an-MDB-tp4561773p4564896.html > Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: How do I *send* JMS messages from an MDB?
was more about the integration with openejb. I remember we had some API changes mounths ago. - Romain 2012/4/17 AndyG > > Romain Manni-Bucau wrote > > > > i think pulling activemq-ra should be enough with maven to override the > > version. > > > > @Andy: did you try? > > > > I pull, build and deploy activemq daily snapshot to my local repo, but: > > 5.6-SNAPSHOT > > ...will do the trick. > > > -- > View this message in context: > http://openejb.979440.n4.nabble.com/How-do-I-send-JMS-messages-from-an-MDB-tp4561773p4565102.html > Sent from the OpenEJB User mailing list archive at Nabble.com. >
Re: How do I *send* JMS messages from an MDB?
Romain Manni-Bucau wrote > > i think pulling activemq-ra should be enough with maven to override the > version. > > @Andy: did you try? > I pull, build and deploy activemq daily snapshot to my local repo, but: 5.6-SNAPSHOT ...will do the trick. -- View this message in context: http://openejb.979440.n4.nabble.com/How-do-I-send-JMS-messages-from-an-MDB-tp4561773p4565102.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: How do I *send* JMS messages from an MDB?
Bjorn Danielsson wrote > The EJB then sends out a notification to a JMS topic > How is this EJB sending the message? javax.jms.JMSException: The resource is already being used in transaction context. - Means exactly that, and it is usually a good sign that there is some misuse or a concurrency issue at the root. Access to a shared JMS resource is crossing a transaction/thread boundary and this will only happen if two or more threads are concurrently accessing the resource. Never share a JMS Connection/topic or queue across different threads, putting them in a Singleton is always a good idea as this allows you to keep the connection open for the application lifetime. Here is a really dumbed down example: @Singleton SomeClass private Connection conJms = null; @Resource(mappedName = "JMSConnectionFactory") private ConnectionFactory connectionFactory; @Override public void sendMessage(final String messge) { if(null == this.conJms){ this.conJms = getConnectionFactory().createConnection(); //Do some JMS magic, open a queue and or topic etc etc } //Send the message here } @PreDestroy public void preDestroy() { //Cleanup and close this.conJms and any queues and topics etc... } Any EJB that wants to send a message must then inject the 'SomeClass' instance: @EJB private SomeClass sc; this.sc.sendMessage("Hello Tom, Dick and Harry"); -- View this message in context: http://openejb.979440.n4.nabble.com/How-do-I-send-JMS-messages-from-an-MDB-tp4561773p4565058.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: How do I *send* JMS messages from an MDB?
i think pulling activemq-ra should be enough with maven to override the version. @Andy: did you try? - Romain 2012/4/17 AndyG > These are the required activemq jars: > > openejb\lib\activeio-core-3.2-20090713.104929-1.jar > openejb\lib\activemq-core-5.6-SNAPSHOT.jar > openejb\lib\activemq-protobuf-1.1.jar > openejb\lib\activemq-ra-5.6-SNAPSHOT.jar > openejb\lib\kahadb-5.6-SNAPSHOT.jar > > > -- > View this message in context: > http://openejb.979440.n4.nabble.com/How-do-I-send-JMS-messages-from-an-MDB-tp4561773p4564896.html > Sent from the OpenEJB User mailing list archive at Nabble.com. >
Re: How do I *send* JMS messages from an MDB?
These are the required activemq jars: openejb\lib\activeio-core-3.2-20090713.104929-1.jar openejb\lib\activemq-core-5.6-SNAPSHOT.jar openejb\lib\activemq-protobuf-1.1.jar openejb\lib\activemq-ra-5.6-SNAPSHOT.jar openejb\lib\kahadb-5.6-SNAPSHOT.jar -- View this message in context: http://openejb.979440.n4.nabble.com/How-do-I-send-JMS-messages-from-an-MDB-tp4561773p4564896.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: How do I *send* JMS messages from an MDB?
Hi, i think activemq-ra should be updated too. I don't know if there is API changes between both version but i guess you'll see it soon ;). - Romain 2012/4/17 Bjorn Danielsson > Update > > I can now reproduce the error in a small test program. > All I did was increase the messaging from 2 to 4 messages > and fiddle a bit with the JPA code. The fiddling required > seems to be different depending on whether I use OpenJPA > or EclipseLink. > > I am beginning to suspect that I might be bitten by this > bug, fixed in ActiveMQ 5.6.0: > > https://issues.apache.org/jira/browse/AMQ-3465 > > Now I am itching to try a newer ActiveMQ than the bundled one. > Is this possible? I naively tried replacing the activemq-core > jar but that just gave me "peer did not send his wire format". > > -- > Björn Danielsson > Cuspy Code AB >
Re: How do I *send* JMS messages from an MDB?
Update I can now reproduce the error in a small test program. All I did was increase the messaging from 2 to 4 messages and fiddle a bit with the JPA code. The fiddling required seems to be different depending on whether I use OpenJPA or EclipseLink. I am beginning to suspect that I might be bitten by this bug, fixed in ActiveMQ 5.6.0: https://issues.apache.org/jira/browse/AMQ-3465 Now I am itching to try a newer ActiveMQ than the bundled one. Is this possible? I naively tried replacing the activemq-core jar but that just gave me "peer did not send his wire format". -- Björn Danielsson Cuspy Code AB
Re: How do I *send* JMS messages from an MDB?
Hi, Thanks for your reassuring reply! I have now written a simple test for this, and of course now the test works. So mea culpa, and now I only have to figure out in what way my application code differs from my 100-line test. I'll post back here again when I find the reason, in case anyone else gets this error "resource is allready being used in transaction" and googles it. -- Björn Danielsson Cuspy Code AB Romain Manni-Bucau wrote: > Hi, > > It should work, can you reproduce it in a uniy test? > Le 16 avr. 2012 16:48, "Bjorn Danielsson" > a écrit : > >> I have problems sending JMS messages from my MDB. This MDB >> listens on a queue and then calls an EJB that updates persistent >> storage. The EJB then sends out a notification to a JMS topic. >> >> All this used to work in GlassFish, but on TomEE-plus I always >> get this error that stops the notification from being sent: >> >> javax.jms.JMSException: The resource is allready being used in transaction >> context. >> >> The error message doesn't specify which resource is the culprit, >> but I guess it means the JMS Session? My EJB uses an injected >> ConnectionFactory, just like in the OpenEJB examples. Shouldn't >> that work also when the EJB is called from an MDB, using one >> big nice container-managed transaction that starts when the >> incoming queue message is received? >> >> Version: apache-tomee-plus-1.0.0-beta-2 >> >> -- >> Björn Danielsson >> Cuspy Code AB >>
Re: How do I *send* JMS messages from an MDB?
Hi, It should work, can you reproduce it in a uniy test? Le 16 avr. 2012 16:48, "Bjorn Danielsson" a écrit : > I have problems sending JMS messages from my MDB. This MDB > listens on a queue and then calls an EJB that updates persistent > storage. The EJB then sends out a notification to a JMS topic. > > All this used to work in GlassFish, but on TomEE-plus I always > get this error that stops the notification from being sent: > > javax.jms.JMSException: The resource is allready being used in transaction > context. > > The error message doesn't specify which resource is the culprit, > but I guess it means the JMS Session? My EJB uses an injected > ConnectionFactory, just like in the OpenEJB examples. Shouldn't > that work also when the EJB is called from an MDB, using one > big nice container-managed transaction that starts when the > incoming queue message is received? > > Version: apache-tomee-plus-1.0.0-beta-2 > > -- > Björn Danielsson > Cuspy Code AB >
How do I *send* JMS messages from an MDB?
I have problems sending JMS messages from my MDB. This MDB listens on a queue and then calls an EJB that updates persistent storage. The EJB then sends out a notification to a JMS topic. All this used to work in GlassFish, but on TomEE-plus I always get this error that stops the notification from being sent: javax.jms.JMSException: The resource is allready being used in transaction context. The error message doesn't specify which resource is the culprit, but I guess it means the JMS Session? My EJB uses an injected ConnectionFactory, just like in the OpenEJB examples. Shouldn't that work also when the EJB is called from an MDB, using one big nice container-managed transaction that starts when the incoming queue message is received? Version: apache-tomee-plus-1.0.0-beta-2 -- Björn Danielsson Cuspy Code AB
RE: MDB not invoked
Hi David, I'm not sure how to see the resources and binding in jmx-console, in fact, I don't know how to start jmx-console in openejb. -- View this message in context: http://openejb.979440.n4.nabble.com/MDB-not-invoked-tp4548110p4553890.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: MDB not invoked
On Apr 12, 2012, at 6:19 PM, Johnny Guo wrote: > > I did try to config it in openejb.xml like below as well, but it just didn't > work for me. > > > type="javax.jms.ConnectionFactory"> Hi Johnny! I did take a close look at your logs earlier and can verify this won't do anything (these things were being created already automatically). I think what we need is a log line that says what the server understands is the Topic/Queue name of the MDB. I had thought I added that as I've had this problem before as well. I could be misremembering, though. Anyway, once we get actual confirmation that the bean is truly tied to the queue/topic expected, then it's a simple act of using a JMX Console to see what the JMS broker is doing with the messages. Via JMX you can see how many consumers (if any) there are for each Topic and Queue. There should be at least one for the MDB itself. Regardless of the logging, definitely do grab jconsole and attach to the broker's JVM and see what Topics and Queues there are and how many producers and consumers for each. Let us know what you find and we can see what the next step might be. -David
RE: MDB not invoked
Hi Romain, I did try to config it in openejb.xml like below as well, but it just didn't work for me. -- View this message in context: http://openejb.979440.n4.nabble.com/MDB-not-invoked-tp4548110p4553537.html Sent from the OpenEJB User mailing list archive at Nabble.com.
RE: MDB not invoked
Hi, I have tried to setup it following the examples, but just not working for me. Here are some codes: 1) No annotation in mdb , just a onMessage method. The ejb-jar.xml: StandardReportsBean se.it.newjena.reports.bean.receivers.StandardReportsBean javax.jms.MessageListener destination ReportStandardJMSQueue destinationType javax.jms.Queue jms/tdm-newjena/ReportStandardJMSConnFactory javax.jms.ConnectionFactory ReportStandardJMSQueue javax.jms.Queue 2) The resources in the server.xml for tomcat in Eclipse: 3) The code to send message: QueueConnection queueConnection = null; QueueSession queueSession = null; Queue queue = null; QueueSender queueSender = null; ObjectMessage message = null; try { // check if jndiContext and queueConnectionFactory are set if not // throw an exception if (jndiContext == null || queueConnectionFactory == null) throw new Exception("InitialContext or QueueConnectionFactory is not set"); /* * Look up queue. */ queue = (Queue) jndiContext.lookup("ReportStandardJMSQueue"); queueConnection = queueConnectionFactory.createQueueConnection(); queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE); queueSender = queueSession.createSender(queue); /* * Send message */ message = queueSession.createObjectMessage(); message.setObject(wrapper); queueSender.send(message); logger.info("Jena reports - a message has been sent"); } I also tried the below in ejb-jar.xml, but it will say the queue has binded to context, and if I removed the resource for this queue in server.xml, then it can't find the queue for sending messages. ReportStandardJMSQueue javax.jms.Queue Best Regards, Johnny Guo VIT Tianjin Mobile: +86 13682195826 E-mail:qiang@consultant.volvo.com From: Romain Manni-Bucau [via OpenEJB] [mailto:ml-node+s979440n4548744...@n4.nabble.com] Sent: Wednesday, April 11, 2012 8:23 PM To: Guo Qiang (Consultant) Subject: Re: MDB not invoked Hi, how did you configure: 1) the mdb 2) the jmx resources (queue, connection factory, ...) 3) the client ? it sounds like a config error. If you can share some code we could help you more efficiently. Note: some JMS sample are here: http://openejb.apache.org/examples-trunk/index.html - Romain 2012/4/11 Johnny Guo <[hidden email]> > Hi, > > I'm new to openejb. Now i'm working with openejb integrated with Tomcat in > Eclipse. Openejb can start successfully. One MDB was setup to listen to a > jms queue and the start log like this: > [INFO] Found ejb module EjbModule in war /newjena > [INFO] Found ejb module EjbModule in war /newjena > [INFO] Configuring enterprise application: > > C:\TDM\workspace\was_migr\newjena2\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\newjena > [INFO] Auto-linking resource-ref > 'jms/tdm-newjena/ReportStandardJMSConnFactory' in bean StandardReportsBean > to Resource(id=jms/tdm-newjena/ReportStandardJMSConnFactory) > [INFO] Auto-linking resource-ref 'jms/tdm-newjena/ReportStandardJMSQueue' > in > bean StandardReportsBean to > Resource(id=jms/tdm-newjena/ReportStandardJMSQueue) > [INFO] Configuring Service(id=jms/tdm-newjena/ReportStandardJMSQueue, > type=Resource, provider-id=Default Queue) > [INFO] Auto-creating a Resource with id > 'jms/tdm-newjena/ReportStandardJMSQueue' of type 'javax.jms.Queue for > 'StandardReportsBean'. > [INFO] Creating Resource(id=jms/tdm-newjena/ReportStandardJMSQueue) > [INFO] Enterprise application > > "C:\TDM\workspace\was_migr\newjena2\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\newjena" > loaded. > [INFO] Assembling app: > > C:\TDM\workspace\was_migr\newjena2\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\newjena > [INFO] Jndi(name=StandardReportsBean) --> > Ejb(deployment-id=StandardReportsBean) > [INFO] Created Ejb(deployment-id=StandardReportsBean, > ejb-name=StandardReportsBean, container=My MDB Container) > > But when the message is sent to the queue, the MDB can not be invoked. > What > is the problem and how can i get more detail information if something like > this happens? > Thanks > > -- > View this message in context: > http://openejb.979440.n4.nabble.com/MDB-not-invoked-tp4548110p4548110.html > Sent
RE: MDB not invoked
Hi, I have tried to setup it following the examples, but just not working for me. Here are some codes: 1) No annotation in mdb , just a onMessage method. The ejb-jar.xml: StandardReportsBean se.it.newjena.reports.bean.receivers.StandardReportsBean javax.jms.MessageListener destination ReportStandardJMSQueue destinationType javax.jms.Queue jms/tdm-newjena/ReportStandardJMSConnFactory javax.jms.ConnectionFactory ReportStandardJMSQueue javax.jms.Queue 2) The resources in the server.xml for tomcat in Eclipse: 3) The code to send message: QueueConnection queueConnection = null; QueueSession queueSession = null; Queue queue = null; QueueSender queueSender = null; ObjectMessage message = null; try { // check if jndiContext and queueConnectionFactory are set if not // throw an exception if (jndiContext == null || queueConnectionFactory == null) throw new Exception("InitialContext or QueueConnectionFactory is not set"); /* * Look up queue. */ queue = (Queue) jndiContext.lookup("ReportStandardJMSQueue"); queueConnection = queueConnectionFactory.createQueueConnection(); queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE); queueSender = queueSession.createSender(queue); /* * Send message */ message = queueSession.createObjectMessage(); message.setObject(wrapper); queueSender.send(message); logger.info("Jena reports - a message has been sent"); } I also tried the below in ejb-jar.xml, but it will say the queue has binded to context, and if I removed the resource for this queue in server.xml, then it can't find the queue for sending messages. ReportStandardJMSQueue javax.jms.Queue -- View this message in context: http://openejb.979440.n4.nabble.com/MDB-not-invoked-tp4548110p4550743.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: MDB not invoked
Hi, how did you configure: 1) the mdb 2) the jmx resources (queue, connection factory, ...) 3) the client ? it sounds like a config error. If you can share some code we could help you more efficiently. Note: some JMS sample are here: http://openejb.apache.org/examples-trunk/index.html - Romain 2012/4/11 Johnny Guo > Hi, > > I'm new to openejb. Now i'm working with openejb integrated with Tomcat in > Eclipse. Openejb can start successfully. One MDB was setup to listen to a > jms queue and the start log like this: > [INFO] Found ejb module EjbModule in war /newjena > [INFO] Found ejb module EjbModule in war /newjena > [INFO] Configuring enterprise application: > > C:\TDM\workspace\was_migr\newjena2\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\newjena > [INFO] Auto-linking resource-ref > 'jms/tdm-newjena/ReportStandardJMSConnFactory' in bean StandardReportsBean > to Resource(id=jms/tdm-newjena/ReportStandardJMSConnFactory) > [INFO] Auto-linking resource-ref 'jms/tdm-newjena/ReportStandardJMSQueue' > in > bean StandardReportsBean to > Resource(id=jms/tdm-newjena/ReportStandardJMSQueue) > [INFO] Configuring Service(id=jms/tdm-newjena/ReportStandardJMSQueue, > type=Resource, provider-id=Default Queue) > [INFO] Auto-creating a Resource with id > 'jms/tdm-newjena/ReportStandardJMSQueue' of type 'javax.jms.Queue for > 'StandardReportsBean'. > [INFO] Creating Resource(id=jms/tdm-newjena/ReportStandardJMSQueue) > [INFO] Enterprise application > > "C:\TDM\workspace\was_migr\newjena2\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\newjena" > loaded. > [INFO] Assembling app: > > C:\TDM\workspace\was_migr\newjena2\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\newjena > [INFO] Jndi(name=StandardReportsBean) --> > Ejb(deployment-id=StandardReportsBean) > [INFO] Created Ejb(deployment-id=StandardReportsBean, > ejb-name=StandardReportsBean, container=My MDB Container) > > But when the message is sent to the queue, the MDB can not be invoked. > What > is the problem and how can i get more detail information if something like > this happens? > Thanks > > -- > View this message in context: > http://openejb.979440.n4.nabble.com/MDB-not-invoked-tp4548110p4548110.html > Sent from the OpenEJB User mailing list archive at Nabble.com. >
MDB not invoked
Hi, I'm new to openejb. Now i'm working with openejb integrated with Tomcat in Eclipse. Openejb can start successfully. One MDB was setup to listen to a jms queue and the start log like this: [INFO] Found ejb module EjbModule in war /newjena [INFO] Found ejb module EjbModule in war /newjena [INFO] Configuring enterprise application: C:\TDM\workspace\was_migr\newjena2\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\newjena [INFO] Auto-linking resource-ref 'jms/tdm-newjena/ReportStandardJMSConnFactory' in bean StandardReportsBean to Resource(id=jms/tdm-newjena/ReportStandardJMSConnFactory) [INFO] Auto-linking resource-ref 'jms/tdm-newjena/ReportStandardJMSQueue' in bean StandardReportsBean to Resource(id=jms/tdm-newjena/ReportStandardJMSQueue) [INFO] Configuring Service(id=jms/tdm-newjena/ReportStandardJMSQueue, type=Resource, provider-id=Default Queue) [INFO] Auto-creating a Resource with id 'jms/tdm-newjena/ReportStandardJMSQueue' of type 'javax.jms.Queue for 'StandardReportsBean'. [INFO] Creating Resource(id=jms/tdm-newjena/ReportStandardJMSQueue) [INFO] Enterprise application "C:\TDM\workspace\was_migr\newjena2\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\newjena" loaded. [INFO] Assembling app: C:\TDM\workspace\was_migr\newjena2\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\newjena [INFO] Jndi(name=StandardReportsBean) --> Ejb(deployment-id=StandardReportsBean) [INFO] Created Ejb(deployment-id=StandardReportsBean, ejb-name=StandardReportsBean, container=My MDB Container) But when the message is sent to the queue, the MDB can not be invoked. What is the problem and how can i get more detail information if something like this happens? Thanks -- View this message in context: http://openejb.979440.n4.nabble.com/MDB-not-invoked-tp4548110p4548110.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: OpenEJB Tomcat- MDB - EJB 2.0 - MQ
Hi, you need a JCA connector for MQseries. It means ra.xml is not enough. The ActiveMQ one used in OpenEJB is only for ActiveMQ. I'm not sure if you are familiar with JCA connectors so maybe this explanation is useless: it is basically used to integrate ina JEE container an external system (it allows to participate to transactions for instance). It means it is specific too. If you don't find on the internet a MQseries RA (RA = resource adaptor = almost JCA connector) you'll have to write one. Don't panic it is not complicated, only about 3 interfaces to define/implement. You'll find a lot of example on google ;). - Romain 2012/1/10 Faraz > Thanks, > > Yes,I meant with with WebSphere MQ. > Do i need to create ra.xml for WebSphere MQ ? If yes ,Please suggest what > all things need to include in ra.xml ? > > If I use ActiveMQ,ra.xml is already bundled with OpenEJB or I need to > configure this too ? > > > > > > -- > View this message in context: > http://openejb.979440.n4.nabble.com/OpenEJB-Tomcat-MDB-EJB-2-0-MQ-tp4278150p4281296.html > Sent from the OpenEJB User mailing list archive at Nabble.com. >
Re: OpenEJB Tomcat- MDB - EJB 2.0 - MQ
Thanks, Yes,I meant with with WebSphere MQ. Do i need to create ra.xml for WebSphere MQ ? If yes ,Please suggest what all things need to include in ra.xml ? If I use ActiveMQ,ra.xml is already bundled with OpenEJB or I need to configure this too ? -- View this message in context: http://openejb.979440.n4.nabble.com/OpenEJB-Tomcat-MDB-EJB-2-0-MQ-tp4278150p4281296.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: OpenEJB Tomcat- MDB - EJB 2.0 - MQ
Hi and welcome, may be Andy or David will give a better answer. AFAIR, OpenEJB actually only support ActiveMQ (through the ActiveMQ resource adapter). I guess you mean Websphere MQ or MQ Series. Do you have any spec compliant ResourceAdapter with may be a ra.xml? Jean-Louis 2012/1/9 Faraz > Hi, > I am novice, having OpenEJB 3.1.4-Tomcat integrated server.Working on > Message Driven Bean (EJB 2.0) to recieve messages from MQ. What all > configuration I need to do ? > Such as : > 1. What Resource Adapter can I use (alternative of ActiveMQ) > 2. Configuration to recieve messages from MQ ? > > Looking forward for your help. > > Regards > Faraz > > > -- > View this message in context: > http://openejb.979440.n4.nabble.com/OpenEJB-Tomcat-MDB-EJB-2-0-MQ-tp4278150p4278150.html > Sent from the OpenEJB User mailing list archive at Nabble.com.
OpenEJB Tomcat- MDB - EJB 2.0 - MQ
Hi, I am novice, having OpenEJB 3.1.4-Tomcat integrated server.Working on Message Driven Bean (EJB 2.0) to recieve messages from MQ. What all configuration I need to do ? Such as : 1. What Resource Adapter can I use (alternative of ActiveMQ) 2. Configuration to recieve messages from MQ ? Looking forward for your help. Regards Faraz -- View this message in context: http://openejb.979440.n4.nabble.com/OpenEJB-Tomcat-MDB-EJB-2-0-MQ-tp4278150p4278150.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Test cases failing with Cannot bind Container with id Default MDB Container : ParsedName{path=openejb/Container/Default MDB Container, component=Default MDB Container}
Hello everyone, We develop our application for Glassfish v3 and have been running our testcases with OpenEJB for a while now. We decided to switch from OpenMQ to ActiveMQ for Glassfish because if offers some features in redelivery that we need. However after setting up the MDB's to use ActiveMQ (by using the sun-ejb-jar.xml to setup the resource adapter, and the necessary ActivationConfig) now one of our testcases fails to run. I don't really know how to resolve it. I hope someone can help with this. Below is the stacktrace: Apache OpenEJB 3.1.4build: 20101112-03:32 http://openejb.apache.org/ INFO - openejb.home = C:\CatDev\ht\ht-connector\target INFO - openejb.base = C:\CatDev\ht\ht-connector\target INFO - Configuring Service(id=securityService, type=SecurityService, provider-id=Default Security Service) INFO - Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager) INFO - Configuring Service(id=jdbc/ht, type=Resource, provider-id=Default JDBC Database) INFO - Configuring Service(id=statelessContainer, type=Container, provider-id=Default Stateless Container) INFO - Configuring Service(id=stateful, type=Container, provider-id=Default Stateful Container) INFO - Found EjbModule in classpath: C:\CatDev\ht\ht-connector\target\classes INFO - Found EjbModule in classpath: C:\CatDev\ht\ht-connector\target\test-classes INFO - Found EjbModule in classpath: C:\CatDev\m2\com\greencat-it\ht\ht-testing\1.8.0-SNAPSHOT\ht-testing-1.8.0-SNAPSHOT.jar INFO - Found EjbModule in classpath: C:\CatDev\m2\com\greencat-it\ht\ht-outbound\1.8.0-SNAPSHOT\ht-outbound-1.8.0-SNAPSHOT.jar INFO - Found EjbModule in classpath: C:\CatDev\m2\com\greencat-it\ht\ht-system\1.8.0-SNAPSHOT\ht-system-1.8.0-SNAPSHOT.jar INFO - Found EjbModule in classpath: C:\CatDev\m2\com\greencat-it\ht\ht-printing\1.8.0-SNAPSHOT\ht-printing-1.8.0-SNAPSHOT.jar INFO - Found PersistenceModule in classpath: C:\CatDev\m2\com\greencat-it\ht\ht-model\1.8.0-SNAPSHOT\ht-model-1.8.0-SNAPSHOT.jar INFO - Found EjbModule in classpath: C:\CatDev\m2\com\greencat-it\ht\ht-message\1.8.0-SNAPSHOT\ht-message-1.8.0-SNAPSHOT.jar INFO - Beginning load: C:\CatDev\ht\ht-connector\target\classes INFO - Beginning load: C:\CatDev\ht\ht-connector\target\test-classes INFO - Beginning load: C:\CatDev\m2\com\greencat-it\ht\ht-testing\1.8.0-SNAPSHOT\ht-testing-1.8.0-SNAPSHOT.jar INFO - Beginning load: C:\CatDev\m2\com\greencat-it\ht\ht-outbound\1.8.0-SNAPSHOT\ht-outbound-1.8.0-SNAPSHOT.jar INFO - Beginning load: C:\CatDev\m2\com\greencat-it\ht\ht-system\1.8.0-SNAPSHOT\ht-system-1.8.0-SNAPSHOT.jar INFO - Beginning load: C:\CatDev\m2\com\greencat-it\ht\ht-printing\1.8.0-SNAPSHOT\ht-printing-1.8.0-SNAPSHOT.jar INFO - Beginning load: C:\CatDev\m2\com\greencat-it\ht\ht-model\1.8.0-SNAPSHOT\ht-model-1.8.0-SNAPSHOT.jar INFO - Beginning load: C:\CatDev\m2\com\greencat-it\ht\ht-message\1.8.0-SNAPSHOT\ht-message-1.8.0-SNAPSHOT.jar INFO - Configuring enterprise application: classpath.ear FOO moduleName = C:\CatDev\m2\com\greencat-it\ht\ht-model\1.8.0-SNAPSHOT\ht-model-1.8.0-SNAPSHOT.jar INFO - Configuring Service(id=Default Singleton Container, type=Container, provider-id=Default Singleton Container) INFO - Auto-creating a container for bean MessageReceiverBean: Container(type=SINGLETON, id=Default Singleton Container) INFO - Configuring Service(id=Default JMS Connection Factory, type=Resource, provider-id=Default JMS Connection Factory) INFO - Auto-creating a Resource with id 'Default JMS Connection Factory' of type 'javax.jms.ConnectionFactory for 'ObdConnector'. INFO - Configuring Service(id=Default JMS Resource Adapter, type=Resource, provider-id=Default JMS Resource Adapter) INFO - Auto-linking resource-ref 'com.greencat.ht.outbound.obd.ObdConnector/connectionFactory' in bean ObdConnector to Resource(id=Default JMS Connection Factory) INFO - Configuring Service(id=jms/HtObdOutgoing, type=Resource, provider-id=Default Topic) INFO - Auto-creating a Resource with id 'jms/HtObdOutgoing' of type 'javax.jms.Topic for 'ObdConnector'. INFO - Auto-linking resource-env-ref 'com.greencat.ht.outbound.obd.ObdConnector/obdOutgoingTopic' in bean ObdConnector to Resource(id=jms/HtObdOutgoing) INFO - Configuring Service(id=Default MDB Container, type=Container, provider-id=Default MDB Container) INFO - Auto-creating a container for bean OutboundChangeTopicHandler: Container(type=MESSAGE, id=Default MDB Container) INFO - Configuring Service(id=HtChangeNotification, type=Resource, provider-id=Default Topic) INFO - Auto-creating a Resource with id 'HtChangeNotification' of type 'javax.jms.Topic for 'OutboundChangeTopicHandler'. INFO - Auto-linking resource-ref 'com.greencat.ht.logic.message.MessageLogicBean/connectionFactory' in bean MessageLogicBean to Resource(id=Default JMS Connection Factory) INFO - Configuring Service(id=j
Re: MDB with quartz and jms
I have discovered that the error appeared because there was one MDB which contained the jboss specific dLQMaxResent property. The only was I was able to solve this is by commenting out the property in question, although I would have prefered to specify my own activationspec class in the ra.xml instead of the default JobSpec class. Nevertheless, now I have another problem: following the secutiry example from the test, I created in my test case a stateless bean named ManagerBean which is anotated with RunAs("Manager"). I have also added an empty ejb-jar.xml in src/test/resources/META-INF so that the META-INF file contains now 2 files: the ejb-jar.xml and the ra.xml. The problem is that the ManagerBean is not discovered by openejb and when I look it up in the context I get a NameNotFoundException: Name "ManagerBeanLocal" not found. Any idea why this might happen? -- View this message in context: http://openejb.979440.n4.nabble.com/MDB-with-quartz-and-jms-tp3319390p3321159.html Sent from the OpenEJB User mailing list archive at Nabble.com.
MDB with quartz and jms
Hi guys, I want to use OpenEJb to test an MDB which implements the quartz Job interface and also uses a jms Queue and Connection Factory. I have looked into the mdb and quartz-ra examples from the openEJB project and placed the ra.xml file that is used into the quartz-ra example into the folder src/test/resources/META-INF. When I ran my test case I got the following output into the log: INFO: OpenWebBeans Container is starting... Feb 22, 2011 4:56:59 PM org.apache.webbeans.plugins.PluginLoader startApplication INFO: Adding OpenWebBeansPlugin : [CdiPlugin] Feb 22, 2011 4:56:59 PM org.apache.openejb.cdi.BeansDeployer startApplication INFO: All injection points were validated successfully. Feb 22, 2011 4:56:59 PM org.apache.openejb.cdi.OpenEJBLifecycle initialize INFO: OpenWebBeans Container has started, it took [181] ms. ERROR - Application could not be deployed: classpath.ear org.apache.openejb.OpenEJBException: Creating application failed: classpath.ear: Error deploying 'MailSender'. Exception: class org.apache.openejb.OpenEJBException: Unable to create activation spec: No setter found for the activation spec properties: [dLQMaxResent]: Unable to create activation spec: No setter found for the activation spec properties: [dLQMaxResent] ... Caused by: org.apache.openejb.OpenEJBException: Error deploying 'MailSender'. Exception: class org.apache.openejb.OpenEJBException: Unable to create activation spec: No setter found for the activation spec properties: [dLQMaxResent]: Unable to create activation spec: No setter found for the activation spec properties: [dLQMaxResent] at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:665) ... 45 more Also, if instead of a jms Queue I use a Destination in my MDB I get the following error: WARN - Jar not loaded. classpath.ear. No provider available for resource-ref 'null' of type 'javax.jms.Destination' for 'MonthlyReportTrigger'. org.apache.openejb.OpenEJBException: No provider available for resource-ref 'null' of type 'javax.jms.Destination' for 'MonthlyReportTrigger'. Can you tell me what am I missing in order to make this work? -- View this message in context: http://openejb.979440.n4.nabble.com/MDB-with-quartz-and-jms-tp3319390p3319390.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: MDB to listen to Tibco JMS
On Jul 15, 2009, at 11:36 PM, DimasOwl wrote: hi, David They couldn't provide such file Actually the only available way is to use standard approach: create InitialContext and get connectionfactory, and topic by their jndi names For us it is slightly more complicated as we have to use LDAP server as mediator between Tibco and client application. I've found next page https://genericjmsra.dev.java.net/docs/tibco-genericjmsra-integration-sample-doc/Integrating_Sun_Java_System_Application_Server_with_Tibco_JMS_using_the_Generic_Resource_Adapter_for_JMS.html Looks like that is client's responsibility to create resource adapter. I believe I have all necessary settings to do that. Could you tell me is there more simple way to generate adapter. I don't want to install Sun's server According to that doc it seems Sun has a Resource Adapter that works with any JMS implementation, such as Tibco. If you can get that Resource Adapter and it does work with other app servers like a Resource Adapter should, then it should be possible to package the Resource Adapter (the .rar file) in your ear and deploy it into OpenEJB. Seems like the doc also mentions some fairly important config> settings which you could just as easily include in your ejb- jar.xml or via the @ActivationConfig annotation. I am not sure of any needs that the Resource Adapter or Tibco may have, but any compliant and *portable* Resource Adapter will work in OpenEJB. I can't guarantee that the Resource Adapter/Tibco setup mentioned in that doc is both of those things, but we can hope :) -David
Re: MDB to listen to Tibco JMS
hi, David They couldn't provide such file Actually the only available way is to use standard approach: create InitialContext and get connectionfactory, and topic by their jndi names For us it is slightly more complicated as we have to use LDAP server as mediator between Tibco and client application. I've found next page https://genericjmsra.dev.java.net/docs/tibco-genericjmsra-integration-sample-doc/Integrating_Sun_Java_System_Application_Server_with_Tibco_JMS_using_the_Generic_Resource_Adapter_for_JMS.html Looks like that is client's responsibility to create resource adapter. I believe I have all necessary settings to do that. Could you tell me is there more simple way to generate adapter. I don't want to install Sun's server -- View this message in context: http://www.nabble.com/MDB-to-listen-to-Tibco-JMS-tp24369433p24510876.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: MDB to listen to Tibco JMS
hi, David that is the problem as I don't have any files I will try to talk with guys from Tibco support if they could provide such file. -- View this message in context: http://www.nabble.com/MDB-to-listen-to-Tibco-JMS-tp24369433p24485446.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: MDB to listen to Tibco JMS
On Jul 9, 2009, at 1:31 AM, DimasOwl wrote: 2009-07-09 09:09:31,912 - ERROR - Endpoint connection to JMS broker failed: Wire format negociation timeout: peer did not send his wire format. openejb.xml Use of the ActiveMQResourceAdapter won't work with other JMS implementations than ActiveMQ. Do you have a resource adapter for your Tibco JMS broker (something with a .rar extension). If so can you post the ra.xml file from it? With that information we can probably work up a config for you and use it to improve the documentation as well. -David
Re: MDB to listen to Tibco JMS
Hi, Thank a lot for you answer, Jean I've tried to follow you suggestion now I've got 2009-07-09 09:09:31,912 - ERROR - Endpoint connection to JMS broker failed: Wire format negociation timeout: peer did not send his wire format. 2009-07-09 09:09:31,913 - ERROR - Endpoint will try to reconnect to the JMS broker in 30 seconds openejb.xml # Broker configuration URI as defined by ActiveMQ # see http://activemq.apache.org/broker-configuration-uri.html BrokerXmlConfig # Broker address ServerUrl tcp://lonmmsjmsu1.uk.db.com:10140 # DataSource for persistence messages DataSource My Unmanaged DataSource and here is annotation from MDB @MessageDriven (activationConfig = { @ActivationConfigProperty(propertyName = "destination", propertyValue = "EventsTopic"), @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"), @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"), @ActivationConfigProperty(propertyName = "subscriptionDurability", propertyValue = "NonDurable") } ) *** More questions: How to describe user and password to connect to topic? And what is suspicious is why it doesn't throw authentication Exception Jean-Louis MONTEIRO wrote: > > Hi, > > AFAIK, Active MQ is used both: > - server (optional): used when you want to start an embedded broker > - client: Active MQ is used to connect to a broker (ActiveMQ, MQSeries, > TibcoRV, ...) > > So a configuration like the following should work. > > > # Broker configuration URI as defined by ActiveMQ > # see http://activemq.apache.org/broker-configuration-uri.html > # We can leave it empty because we don't want to start an embedded > ActiveMQ broker > BrokerXmlConfig > > # Broker address > # It must point to your Tibco broker > ServerUrl tcp://: > > # Specifies the size of the thread pool available to ActiveMQ. > ThreadPoolSize 30 > > > Jean-Louis > > -- View this message in context: http://www.nabble.com/MDB-to-listen-to-Tibco-JMS-tp24369433p24406229.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: MDB to listen to Tibco JMS
Hi, AFAIK, Active MQ is used both: - server (optional): used when you want to start an embedded broker - client: Active MQ is used to connect to a broker (ActiveMQ, MQSeries, TibcoRV, ...) So a configuration like the following should work. # Broker configuration URI as defined by ActiveMQ # see http://activemq.apache.org/broker-configuration-uri.html # We can leave it empty because we don't want to start an embedded ActiveMQ broker BrokerXmlConfig # Broker address # It must point to your Tibco broker ServerUrl tcp://: # Specifies the size of the thread pool available to ActiveMQ. ThreadPoolSize 30 Jean-Louis DimasOwl wrote: > > Documentation is quite poor > http://openejb.apache.org/3.0/mdb-container.html > It describes only default settings for ActiveMQ. > Is it possible to listen to topic on external JMS server (Tibco) > > Any sample would be extremely helpful! > -- View this message in context: http://www.nabble.com/MDB-to-listen-to-Tibco-JMS-tp24369433p24399019.html Sent from the OpenEJB User mailing list archive at Nabble.com.
MDB to listen to Tibco JMS
Documentation is quite poor http://openejb.apache.org/3.0/mdb-container.html It describes only default settings for ActiveMQ. Is it possible to listen to topic on external JMS server (Tibco) Any sample would be extremely helpful! -- View this message in context: http://www.nabble.com/MDB-to-listen-to-Tibco-JMS-tp24369433p24369433.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Starting the MDB EJB Module progammatically
On May 27, 2009, at 8:30 PM, Nitin Gupta wrote: I have one Message Driven Bean(MDB) that is dependent on a server for receiving messages. At deploy time when server is up then this MDB will start automatically. but when the server is not running then this MDB will not start. So when when server will up then i will have to manually start this MDB module through Geronimo web console. Can i automate this process ? Or is there any way to start this MDB module using programming. Hi Nitin, The app should start automatically when the server starts. I'm not sure what might be causing it to require a manual start. I'd recommend asking on the Geronimo users list. -David
Starting the MDB EJB Module progammatically
I have one Message Driven Bean(MDB) that is dependent on a server for receiving messages. At deploy time when server is up then this MDB will start automatically. but when the server is not running then this MDB will not start. So when when server will up then i will have to manually start this MDB module through Geronimo web console. Can i automate this process ? Or is there any way to start this MDB module using programming. -- Regards:- Nitin Gupta.
Re: building MDB with Eclipse using openEJB embeded in Tomcat
Thank you. That worked. I appreciate your help. Best regards Mho Mho wrote: > > Hello, > I am new to openEJB and Eclipse. I am not new to Tomcat. > I am porting an application that used to run under JBOSS and it appears > that openEJB/Tomcat should be just a great environment. > > I am using Eclipse with WTP and have successfully loaded up Tomcat with > OpenEJB and now I am trying to bring on line the MDB. > > What I can't figure out is where I would put the XML that describes the > queue for the MDB For example in JBOSS I would have a file that would look > like > >name="jboss.mq.destination:service=Queue,name=myqueueName"> > optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager > > > Any help would be appreciated > Thanks > Mho > -- View this message in context: http://www.nabble.com/building-MDB-with-Eclipse-using-openEJB-embeded-in-Tomcat-tp23715480p23716581.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: building MDB with Eclipse using openEJB embeded in Tomcat
On May 25, 2009, at 8:37 PM, Mho wrote: Thank you that explanation makes sense. I added those and then found out that ejb.jar (or at least the copy that I could find) does not include javax.ejb.MessageDriven or javax.ejb.ActivationConfigProperty. I found ejb-3_0-api.jar at http://java.sun.com/products/ejb/docs.html under 3.0 Final release (download class files) --> ejb-3_0-fr-api.zip and that zip file expands into ejb-3_0-api.jar that includes those class files and makes the compiler happy. However by all rights this qualifies as beeing burried deep and I am wondering if I am really lost. Is there a place where the appropriate libraries for ejb 3.0 are kept? The javaee-api-5.0-1.jar in our distribution contains that and all the other Java EE 5 libraries. Can also pull it down from here: http://repo2.maven.org/maven2/org/apache/openejb/javaee-api/5.0-1/javaee-api-5.0-1.jar -David David Blevins wrote: On May 25, 2009, at 6:15 PM, Mho wrote: Hello, I am new to openEJB and Eclipse. I am not new to Tomcat. I am porting an application that used to run under JBOSS and it appears that openEJB/Tomcat should be just a great environment. I am using Eclipse with WTP and have successfully loaded up Tomcat with OpenEJB and now I am trying to bring on line the MDB. What I can't figure out is where I would put the XML that describes the queue for the MDB For example in JBOSS I would have a file that would look like jboss.mq:service=DestinationManager There are a couple options for specifying the queue name for an MDB. The first is to name the MDB after the queue and we will automatically hook the bean up to the queue with that name. So if the queue name is "DestinationManager", it'd be like so: @MessageDriven public class DestinationManager implements MessageListener { //... } or ... @MessageDriven(name = "DestinationManager") public class MyMdbBean implements MessageListener { //... } The other option is to use an ActivationConfig like so: @MessageDriven(activationConfig = { @ActivationConfigProperty(propertyName="destinationType", propertyValue = "javax.jms.Queue"), @ActivationConfigProperty(propertyName="destination", propertyValue = "DestinationManager")}) public class MyMdbBean implements MessageListener { //... } Hope this helps! -David -- View this message in context: http://www.nabble.com/building-MDB-with-Eclipse-using-openEJB-embeded-in-Tomcat-tp23715480p23716386.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: building MDB with Eclipse using openEJB embeded in Tomcat
Thank you that explanation makes sense. I added those and then found out that ejb.jar (or at least the copy that I could find) does not include javax.ejb.MessageDriven or javax.ejb.ActivationConfigProperty. I found ejb-3_0-api.jar at http://java.sun.com/products/ejb/docs.html under 3.0 Final release (download class files) --> ejb-3_0-fr-api.zip and that zip file expands into ejb-3_0-api.jar that includes those class files and makes the compiler happy. However by all rights this qualifies as beeing burried deep and I am wondering if I am really lost. Is there a place where the appropriate libraries for ejb 3.0 are kept? Thanks again for your help. Mho David Blevins wrote: > > > On May 25, 2009, at 6:15 PM, Mho wrote: > >> >> Hello, >> I am new to openEJB and Eclipse. I am not new to Tomcat. >> I am porting an application that used to run under JBOSS and it >> appears that >> openEJB/Tomcat should be just a great environment. >> >> I am using Eclipse with WTP and have successfully loaded up Tomcat >> with >> OpenEJB and now I am trying to bring on line the MDB. >> >> What I can't figure out is where I would put the XML that describes >> the >> queue for the MDB For example in JBOSS I would have a file that >> would look >> like >> >> >>jboss.mq:service=DestinationManager > > There are a couple options for specifying the queue name for an MDB. > > The first is to name the MDB after the queue and we will automatically > hook the bean up to the queue with that name. So if the queue name is > "DestinationManager", it'd be like so: > > @MessageDriven > public class DestinationManager implements MessageListener { >//... > } > > or ... > > @MessageDriven(name = "DestinationManager") > public class MyMdbBean implements MessageListener { >//... > } > > The other option is to use an ActivationConfig like so: > > @MessageDriven(activationConfig = { > @ActivationConfigProperty(propertyName="destinationType", > propertyValue = "javax.jms.Queue"), > @ActivationConfigProperty(propertyName="destination", > propertyValue = "DestinationManager")}) > public class MyMdbBean implements MessageListener { >//... > } > > Hope this helps! > > > -David > > > -- View this message in context: http://www.nabble.com/building-MDB-with-Eclipse-using-openEJB-embeded-in-Tomcat-tp23715480p23716386.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: building MDB with Eclipse using openEJB embeded in Tomcat
On May 25, 2009, at 6:15 PM, Mho wrote: Hello, I am new to openEJB and Eclipse. I am not new to Tomcat. I am porting an application that used to run under JBOSS and it appears that openEJB/Tomcat should be just a great environment. I am using Eclipse with WTP and have successfully loaded up Tomcat with OpenEJB and now I am trying to bring on line the MDB. What I can't figure out is where I would put the XML that describes the queue for the MDB For example in JBOSS I would have a file that would look like jboss.mq:service=DestinationManager There are a couple options for specifying the queue name for an MDB. The first is to name the MDB after the queue and we will automatically hook the bean up to the queue with that name. So if the queue name is "DestinationManager", it'd be like so: @MessageDriven public class DestinationManager implements MessageListener { //... } or ... @MessageDriven(name = "DestinationManager") public class MyMdbBean implements MessageListener { //... } The other option is to use an ActivationConfig like so: @MessageDriven(activationConfig = { @ActivationConfigProperty(propertyName="destinationType", propertyValue = "javax.jms.Queue"), @ActivationConfigProperty(propertyName="destination", propertyValue = "DestinationManager")}) public class MyMdbBean implements MessageListener { //... } Hope this helps! -David
Re: building MDB with Eclipse using openEJB embeded in Tomcat
Sorry it looks like the mailer ate my XML script. what I meant to say was the JBOSS deployment descriptor looked like >server> < mbean code="org.jboss.mq.server.jmx.Queue" name="jboss.mq.destination:service=Queue,name=fclient"> <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends> </mbean> </server> Mho Mho wrote: > > Hello, > I am new to openEJB and Eclipse. I am not new to Tomcat. > I am porting an application that used to run under JBOSS and it appears > that openEJB/Tomcat should be just a great environment. > > I am using Eclipse with WTP and have successfully loaded up Tomcat with > OpenEJB and now I am trying to bring on line the MDB. > > What I can't figure out is where I would put the XML that describes the > queue for the MDB For example in JBOSS I would have a file that would look > like > >name="jboss.mq.destination:service=Queue,name=myqueueName"> > optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager > > > Any help would be appreciated > Thanks > Mho > -- View this message in context: http://www.nabble.com/building-MDB-with-Eclipse-using-openEJB-embeded-in-Tomcat-tp23715480p23715582.html Sent from the OpenEJB User mailing list archive at Nabble.com.
building MDB with Eclipse using openEJB embeded in Tomcat
Hello, I am new to openEJB and Eclipse. I am not new to Tomcat. I am porting an application that used to run under JBOSS and it appears that openEJB/Tomcat should be just a great environment. I am using Eclipse with WTP and have successfully loaded up Tomcat with OpenEJB and now I am trying to bring on line the MDB. What I can't figure out is where I would put the XML that describes the queue for the MDB For example in JBOSS I would have a file that would look like jboss.mq:service=DestinationManager Any help would be appreciated Thanks Mho -- View this message in context: http://www.nabble.com/building-MDB-with-Eclipse-using-openEJB-embeded-in-Tomcat-tp23715480p23715480.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: MDB Listening on external ActiveMQ broker
Hi, I was able to get the MDB listening on the remote topic. There were two issues. The first was that I had the same MDB in the classpath for the Tomcat web app. The second is that ActiveMQ did not recognize async=true for remote servers. Here is the fix: properties.put("Default JMS Resource Adapter.ServerUrl", "tcp://localhost:61616"); I still would like to have an answer to the JUnit support question. Also, I would like to not create an embedded broker on the command-line client at all. I tried keeping the BrokerXmlConfig null or empty. null tried to create a remoted broker and empty resulted in an error message. Many thanks in advance, Reza Expert Group Member, EJB 3.1 and Java EE 6 Author, EJB 3 in Action Independent Consultant Reza Rahman wrote: Hi, I am trying to connect an OpenEJB MDB embedded in a Java SE command-line application to a JMS topic inside an ActiveMQ embedded broker running inside Tomcat/OpenEJB. The MDB works fine when it is inside Tomcat, but that's not that useful in this scenario since I want to perform remote notification to the Java SE program running outside Tomcat. Here is my SE bootstrap code: Properties properties = new Properties(); properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory"); properties.put("Default JMS Resource Adapter", "new://Resource?type=ActiveMQResourceAdapter"); properties.put("Default JMS Resource Adapter.BrokerXmlConfig", "broker:vm://localhost"); // Ideally, I don't want an embedded broker here at all. properties.put("Default JMS Resource Adapter.ServerUrl", "tcp://localhost:61616?async=true"); // Trying to connect to the Tomcat broker. new InitialContext(properties); Here is the MDB container configuration on the Tomcat/OpenEJB side: # Broker configuration URI as defined by ActiveMQ # see http://activemq.apache.org/broker-configuration-uri.html BrokerXmlConfig broker:(tcp://localhost:61616)?useJmx=false // Should be listening to remote clients # Broker address ServerUrl vm://localhost?async=true // Should start an embedded broker. # DataSource for persistence messages DataSource My Unmanaged DataSource Here is my MDB configuration: @MessageDriven(activationConfig = { @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"), @ActivationConfigProperty(propertyName = "destination", propertyValue = "alertTopic") }) // Can I connect directly to the remote topic instead? Can anyone help? Many thanks in advance, Reza Expert Group Member, EJB 3.1 and Java EE 6 Author, EJB 3 in Action Independent Consultant
MDB Listening on external ActiveMQ broker
Hi, I am trying to connect an OpenEJB MDB embedded in a Java SE command-line application to a JMS topic inside an ActiveMQ embedded broker running inside Tomcat/OpenEJB. The MDB works fine when it is inside Tomcat, but that's not that useful in this scenario since I want to perform remote notification to the Java SE program running outside Tomcat. Here is my SE bootstrap code: Properties properties = new Properties(); properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory"); properties.put("Default JMS Resource Adapter", "new://Resource?type=ActiveMQResourceAdapter"); properties.put("Default JMS Resource Adapter.BrokerXmlConfig", "broker:vm://localhost"); // Ideally, I don't want an embedded broker here at all. properties.put("Default JMS Resource Adapter.ServerUrl", "tcp://localhost:61616?async=true"); // Trying to connect to the Tomcat broker. new InitialContext(properties); Here is the MDB container configuration on the Tomcat/OpenEJB side: # Broker configuration URI as defined by ActiveMQ # see http://activemq.apache.org/broker-configuration-uri.html BrokerXmlConfig broker:(tcp://localhost:61616)?useJmx=false // Should be listening to remote clients # Broker address ServerUrl vm://localhost?async=true // Should start an embedded broker. # DataSource for persistence messages DataSource My Unmanaged DataSource Here is my MDB configuration: @MessageDriven(activationConfig = { @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"), @ActivationConfigProperty(propertyName = "destination", propertyValue = "alertTopic") }) // Can I connect directly to the remote topic instead? Can anyone help? Many thanks in advance, Reza Expert Group Member, EJB 3.1 and Java EE 6 Author, EJB 3 in Action Independent Consultant
Re: Exception while testing MDB
On Jan 14, 2009, at 2:52 AM, marekd wrote: Could it be the same problem as this one: https://issues.apache.org/activemq/browse/AMQ-1824 (see next to last comment) ? Seems very likely. I'd recommend upgrading the ActiveMQ version to try it out, but unfortunately they repackaged their code between 4.x and 5.x so it isn't possible without some code change on our end. If you're willing to dig into code, the change would go in org.apache.openejb.resource.activemq.ActiveMQResourceAdapter. Figuring out how to support ActiveMQ 4.x and 5.x would be tricky, but simply updating that class for a one time test of ActiveMQ 5.x should be fairly straightforward. -David
Exception while testing MDB
Hi, I'm currently writing simple test cases to test (and learn ;-)) power of MDBs. But I run into some problems. This is an modified "simple-mdb" example from openejb3 sources. I have simple test running by 4 threads in parallel sending requests to simple Stateless bean that add these request to some queue (to MDB). This is a stack trace of exception I getting: = http://www.nabble.com/file/p21453674/simple-mdb.zip simple-mdb.zip http://www.nabble.com/file/p21453674/simple-mdb.zip simple-mdb.zip WARN - Unable to enlist XAResource org.apache.geronimo.transaction.manager.wrappernamedxaresou...@17951f3, errorCode: -7 javax.transaction.xa.XAException: The connection is already closed at org.apache.activemq.TransactionContext.toXAException(TransactionContext.java:619) at org.apache.activemq.TransactionContext.setXid(TransactionContext.java:556) at org.apache.activemq.TransactionContext.start(TransactionContext.java:299) at org.apache.activemq.ra.LocalAndXATransaction.start(LocalAndXATransaction.java:136) at org.apache.geronimo.transaction.manager.WrapperNamedXAResource.start(WrapperNamedXAResource.java:86) at org.apache.geronimo.transaction.manager.TransactionImpl.enlistResource(TransactionImpl.java:208) at org.apache.geronimo.connector.outbound.TransactionEnlistingInterceptor.getConnection(TransactionEnlistingInterceptor.java:54) at org.apache.geronimo.connector.outbound.TransactionCachingInterceptor.getConnection(TransactionCachingInterceptor.java:86) at org.apache.geronimo.connector.outbound.ConnectionHandleInterceptor.getConnection(ConnectionHandleInterceptor.java:43) at org.apache.geronimo.connector.outbound.TCCLInterceptor.getConnection(TCCLInterceptor.java:39) at org.apache.geronimo.connector.outbound.ConnectionTrackingInterceptor.getConnection(ConnectionTrackingInterceptor.java:66) at org.apache.geronimo.connector.outbound.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:87) at org.apache.activemq.ra.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:92) at org.apache.activemq.ra.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:66) at example.ComputeServiceImpl.compute(ComputeServiceImpl.java:29) at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:158) at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:141) at org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:67) at org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:211) at org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:169) at org.apache.openejb.core.ivm.EjbObjectProxyHandler.businessMethod(EjbObjectProxyHandler.java:217) at org.apache.openejb.core.ivm.EjbObjectProxyHandler._invoke(EjbObjectProxyHandler.java:77) at org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:286) at $Proxy11.compute(Unknown Source) at MessageDrivenBeanTest.testMessageDrivenBean(MessageDrivenBeanTest.java:76) at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:580) at org.testng.internal.Invoker.invokeMethod(Invoker.java:478) at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:617) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:885) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:110) at org.testng.internal.thread.ThreadUtil$CountDownLatchedRunnable.run(ThreadUtil.java:132) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) Caused by: org.apache.activemq.ConnectionClosedException: The connection is already closed at org.apache.activemq.ActiveMQConnection.checkClosed(ActiveMQConnection.java:1245) at org.apache.activemq.ActiveMQConnection.checkClosedOrFailed(ActiveMQConnection.java:1232) at org.apache.activemq.TransactionContext.setXid(TransactionContext.java:553)
Re: Limit Message Redelivery in MDB
Hi, I believe u need to use the activation-config property maximumRedeliveries of AMQ. You may also configure this at the resource adapter level. http://activemq.apache.org/activation-spec-properties.html Regards Manu On Thu, Aug 28, 2008 at 2:25 AM, rde8026 <[EMAIL PROTECTED]> wrote: > > Does anyone know how to limit the redelivery attempts to and MDB? I've done > some checking but can't seem to find it. > -- > View this message in context: > http://www.nabble.com/Limit-Message-Redelivery-in-MDB-tp19189535p19189535.html > Sent from the OpenEJB User mailing list archive at Nabble.com. > >
Re: MDB
On Aug 13, 2008, at 12:52 PM, lupu.slobodu wrote: I had the activemq jars in my web application also(WebContent/WEB- INF/lib). As soon as I took them out, it works fine. Sorry to have you spend time on this... No problem. This is a good note for the lists. I bet we could scan the webapp classloader and look for issues like this. Not sure we can get it in for the next release, but I bet that might be a useful timesaver. -David David Blevins wrote: On Aug 11, 2008, at 10:29 AM, lupu.slobodu wrote: Trying to run the MDB sample form http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/simple-mdb-with-descriptor/?pathrev=678070 It looks up the ConnectionFactory but it crashes when calling connectionFactory.createConnection(); javax.jms.JMSException: Could not create Transport. Reason: java.io.IOException: Transport scheme NOT recognized: [vm] . . . Caused by: java.lang.ClassCastException: org.apache.activemq.transport.vm.VMTransportFactory cannot be cast to org.apache.activemq.transport.TransportFactory I'm unable to get this error, but I suspect that there might have been an issue with the maven 2 snapshot repository. I cleaned it out and rebuilt it and think things might be better now. I ran the example successfully with a completely clean repo like so: $ cd examples/simple-mdb-with-descriptor $ mkdir temp-repo $ mvn clean install -Dmaven.repo.local=temp-repo Everything downloaded fine and the example ran without issues. -David -- View this message in context: http://www.nabble.com/MDB-tp18930176p18970017.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: MDB
I had the activemq jars in my web application also(WebContent/WEB-INF/lib). As soon as I took them out, it works fine. Sorry to have you spend time on this... David Blevins wrote: > > > On Aug 11, 2008, at 10:29 AM, lupu.slobodu wrote: > >> >> Trying to run the MDB sample form >> http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/simple-mdb-with-descriptor/?pathrev=678070 >> >> It looks up the ConnectionFactory but it crashes when calling >> connectionFactory.createConnection(); >> >> javax.jms.JMSException: Could not create Transport. Reason: >> java.io.IOException: Transport scheme NOT recognized: [vm] >> . >> . >> . >> Caused by: java.lang.ClassCastException: >> org.apache.activemq.transport.vm.VMTransportFactory cannot be cast to >> org.apache.activemq.transport.TransportFactory > > I'm unable to get this error, but I suspect that there might have been > an issue with the maven 2 snapshot repository. I cleaned it out and > rebuilt it and think things might be better now. > > I ran the example successfully with a completely clean repo like so: > > $ cd examples/simple-mdb-with-descriptor > $ mkdir temp-repo > $ mvn clean install -Dmaven.repo.local=temp-repo > > Everything downloaded fine and the example ran without issues. > > -David > > > -- View this message in context: http://www.nabble.com/MDB-tp18930176p18970017.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: MDB
Is the MDB sample confirmed to run on the "OpenEJB for Tomcat" instance? David Blevins wrote: > > > On Aug 11, 2008, at 10:29 AM, lupu.slobodu wrote: > >> >> Trying to run the MDB sample form >> http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/simple-mdb-with-descriptor/?pathrev=678070 >> >> It looks up the ConnectionFactory but it crashes when calling >> connectionFactory.createConnection(); >> >> javax.jms.JMSException: Could not create Transport. Reason: >> java.io.IOException: Transport scheme NOT recognized: [vm] >> . >> . >> . >> Caused by: java.lang.ClassCastException: >> org.apache.activemq.transport.vm.VMTransportFactory cannot be cast to >> org.apache.activemq.transport.TransportFactory > > I'm unable to get this error, but I suspect that there might have been > an issue with the maven 2 snapshot repository. I cleaned it out and > rebuilt it and think things might be better now. > > I ran the example successfully with a completely clean repo like so: > > $ cd examples/simple-mdb-with-descriptor > $ mkdir temp-repo > $ mvn clean install -Dmaven.repo.local=temp-repo > > Everything downloaded fine and the example ran without issues. > > -David > > > -- View this message in context: http://www.nabble.com/MDB-tp18930176p18966718.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: MDB
On Aug 11, 2008, at 10:29 AM, lupu.slobodu wrote: Trying to run the MDB sample form http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/simple-mdb-with-descriptor/?pathrev=678070 It looks up the ConnectionFactory but it crashes when calling connectionFactory.createConnection(); javax.jms.JMSException: Could not create Transport. Reason: java.io.IOException: Transport scheme NOT recognized: [vm] . . . Caused by: java.lang.ClassCastException: org.apache.activemq.transport.vm.VMTransportFactory cannot be cast to org.apache.activemq.transport.TransportFactory I'm unable to get this error, but I suspect that there might have been an issue with the maven 2 snapshot repository. I cleaned it out and rebuilt it and think things might be better now. I ran the example successfully with a completely clean repo like so: $ cd examples/simple-mdb-with-descriptor $ mkdir temp-repo $ mvn clean install -Dmaven.repo.local=temp-repo Everything downloaded fine and the example ran without issues. -David
MDB
Trying to run the MDB sample form http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/simple-mdb-with-descriptor/?pathrev=678070 It looks up the ConnectionFactory but it crashes when calling connectionFactory.createConnection(); javax.jms.JMSException: Could not create Transport. Reason: java.io.IOException: Transport scheme NOT recognized: [vm] . . . Caused by: java.lang.ClassCastException: org.apache.activemq.transport.vm.VMTransportFactory cannot be cast to org.apache.activemq.transport.TransportFactory -- View this message in context: http://www.nabble.com/MDB-tp18930176p18930176.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Specifying source queue for message driven bean (MDB)
On Wed, 2007-10-17 at 21:51 +0200, Jacek Laskowski wrote: > On 10/17/07, Martin Vysny <[EMAIL PROTECTED]> wrote: > > > to the stateless bean definition, and > > > > > > destination > > queue/FE_QUEUE > > > > > > to the message driven bean definition. > > I believe you can do this using @MessageDriven annotation, e.g. > > @MessageDriven( > activationConfig = { > @ActivationConfigProperty(propertyName="destinationType", > propertyValue="javax.jms.Queue"), > @ActivationConfigProperty(propertyName="destination", > propertyValue="queue/FE_QUEUE") > } > ) > > Jacek > Yeah, that may be so. However we have to use EJB2.1. -- Mgr. Martin Vysny | [EMAIL PROTECTED] Software Engineer Whitestein Technologies s.r.o | www.whitestein.com Panenska 28 | 811 03 Bratislava | Slovak Republic Main +421 2 5443-5502 | Direct +421 2 5930-0717 signature.asc Description: This is a digitally signed message part
Re: Specifying source queue for message driven bean (MDB)
On 10/17/07, Martin Vysny <[EMAIL PROTECTED]> wrote: > to the stateless bean definition, and > > > destination > queue/FE_QUEUE > > > to the message driven bean definition. I believe you can do this using @MessageDriven annotation, e.g. @MessageDriven( activationConfig = { @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"), @ActivationConfigProperty(propertyName="destination", propertyValue="queue/FE_QUEUE") } ) Jacek -- Jacek Laskowski http://www.JacekLaskowski.pl
Re: Specifying source queue for message driven bean (MDB)
On Tue, 2007-10-16 at 17:28 -0700, Dain Sundstrom wrote: > Sounds like you are happy with the MDB configuration but want the > queue/FE_QUEUE resource-env-ref in FEInternalServicesEJB to point to > queue/FE_QUEUE instead of "Default Queue". > > This error seem very strange because the code that processes resource- > env-ref should never create an queue with ID "Default Queue" unless > your JNDI reference was named "Default Queue". I'm gonna guess that > you have a resource-ref instead of a resouce-env-ref. > > Can you double check you ejb-jar.xml to see if you have the wrong ref > type? > Thanks very much, it works now :) To sum up, we had to put queue/FE_QUEUE javax.jms.Queue to the stateless bean definition, and destination queue/FE_QUEUE to the message driven bean definition. > In the mean time, I've committed a patch the changes these log > messages to include the exact reference type. I'll also look at > logging an error or throwing an exception if you use a resource-ref > to auto create a queue or topic. > > -dain > > BTW, If my assumptions are correct, I'm surprised you didn't get a > null pointer exception when the container attempted to construct an > ActimeMQ Queue without a destination name. Patched that already :-) https://issues.apache.org/jira/browse/OPENEJB-706 > > On Oct 16, 2007, at 7:55 AM, Martin Vysny wrote: > > > Hi guys, > > can you help me again? ;) We have a MDB named CallAgentMDB, which > > is a > > message consumer (MessageListener), and FEInternalServicesBean, > > which is > > a stateless bean. The problem is, that the MDB is not receiving > > messages > > which are sent by the internal services bean. When openejb starts, it > > prints the following: > > > > 2007-10-16 16:37:32,401 - INFO - Configuring Service(id=Default > > Stateless Container, type=Container, provider-id=Default Stateless > > Container) > > 2007-10-16 16:37:32,406 - INFO - Auto-creating a container for bean > > FEClientEJB: Container(type=STATELESS, id=Default Stateless Container) > > 2007-10-16 16:37:32,407 - INFO - Auto-linking resource reference > > 'jdbc/DB2DS' in bean FEInternalServicesEJB to Resource(id=Default JDBC > > Database) > > 2007-10-16 16:37:32,407 - INFO - Configuring Service(id=Default JMS > > Connection Factory, type=Resource, provider-id=Default JMS Connection > > Factory) > > 2007-10-16 16:37:32,407 - INFO - Auto-creating a resource with id > > 'Default JMS Connection Factory' of type > > 'javax.jms.QueueConnectionFactory for 'FEInternalServicesEJB'. > > 2007-10-16 16:37:32,407 - INFO - Configuring Service(id=Default JMS > > Resource Adapter, type=Resource, provider-id=Default JMS Resource > > Adapter) > > 2007-10-16 16:37:32,408 - INFO - Auto-linking resource reference > > 'jms/FE_QCF' in bean FEInternalServicesEJB to Resource(id=Default JMS > > Connection Factory) > > 2007-10-16 16:37:32,408 - INFO - Configuring Service(id=Default > > Queue, > > type=Resource, provider-id=Default Queue) > > 2007-10-16 16:37:32,408 - INFO - Auto-creating a resource with id > > 'Default Queue' of type 'javax.jms.Queue for 'FEInternalServicesEJB'. > > 2007-10-16 16:37:32,408 - INFO - Auto-linking resource reference > > 'queue/FE_QUEUE' in bean FEInternalServicesEJB to Resource(id=Default > > Queue) > > 2007-10-16 16:37:32,408 - INFO - Configuring Service(id=Default MDB > > Container, type=Container, provider-id=Default MDB Container) > > 2007-10-16 16:37:32,409 - INFO - Auto-creating a container for bean > > CallAgentMDB: Container(type=MESSAGE, id=Default MDB Container) > > 2007-10-16 16:37:32,409 - INFO - Configuring Service(id=queue/ > > FE_QUEUE, > > type=Resource, provider-id=Default Queue) > > 2007-10-16 16:37:32,409 - INFO - Auto-creating a resource with id > > 'queue/FE_QUEUE' of type 'javax.jms.Queue for 'CallAgentMDB'. > > 2007-10-16 16:37:32,409 - INFO - Auto-linking resource reference > > 'queue/FE_QUEUE' in bean CallAgentMDB to Resource(id=queue/FE_QUEUE) > > 2007-10-16 16:37:32,409 - INFO - Configuring Service(id=CallAgentMDB, > > type=Resource, provider-id=Default Queue) > > 2007-10-16 16:37:32,410 - INFO - Auto-creating a resource with id > > 'CallAgentMDB' of type 'javax.jms.Queue for 'CallAgentMDB'. > > 2007-10-16 16:37:32,708 - INFO - Loaded > > Module: /home/vyzivus/work/chrysler/fe-trunk/fe-ejb/eclipse-target/ > >
Re: Specifying source queue for message driven bean (MDB)
Sounds like you are happy with the MDB configuration but want the queue/FE_QUEUE resource-env-ref in FEInternalServicesEJB to point to queue/FE_QUEUE instead of "Default Queue". This error seem very strange because the code that processes resource- env-ref should never create an queue with ID "Default Queue" unless your JNDI reference was named "Default Queue". I'm gonna guess that you have a resource-ref instead of a resouce-env-ref. Can you double check you ejb-jar.xml to see if you have the wrong ref type? In the mean time, I've committed a patch the changes these log messages to include the exact reference type. I'll also look at logging an error or throwing an exception if you use a resource-ref to auto create a queue or topic. -dain BTW, If my assumptions are correct, I'm surprised you didn't get a null pointer exception when the container attempted to construct an ActimeMQ Queue without a destination name. On Oct 16, 2007, at 7:55 AM, Martin Vysny wrote: Hi guys, can you help me again? ;) We have a MDB named CallAgentMDB, which is a message consumer (MessageListener), and FEInternalServicesBean, which is a stateless bean. The problem is, that the MDB is not receiving messages which are sent by the internal services bean. When openejb starts, it prints the following: 2007-10-16 16:37:32,401 - INFO - Configuring Service(id=Default Stateless Container, type=Container, provider-id=Default Stateless Container) 2007-10-16 16:37:32,406 - INFO - Auto-creating a container for bean FEClientEJB: Container(type=STATELESS, id=Default Stateless Container) 2007-10-16 16:37:32,407 - INFO - Auto-linking resource reference 'jdbc/DB2DS' in bean FEInternalServicesEJB to Resource(id=Default JDBC Database) 2007-10-16 16:37:32,407 - INFO - Configuring Service(id=Default JMS Connection Factory, type=Resource, provider-id=Default JMS Connection Factory) 2007-10-16 16:37:32,407 - INFO - Auto-creating a resource with id 'Default JMS Connection Factory' of type 'javax.jms.QueueConnectionFactory for 'FEInternalServicesEJB'. 2007-10-16 16:37:32,407 - INFO - Configuring Service(id=Default JMS Resource Adapter, type=Resource, provider-id=Default JMS Resource Adapter) 2007-10-16 16:37:32,408 - INFO - Auto-linking resource reference 'jms/FE_QCF' in bean FEInternalServicesEJB to Resource(id=Default JMS Connection Factory) 2007-10-16 16:37:32,408 - INFO - Configuring Service(id=Default Queue, type=Resource, provider-id=Default Queue) 2007-10-16 16:37:32,408 - INFO - Auto-creating a resource with id 'Default Queue' of type 'javax.jms.Queue for 'FEInternalServicesEJB'. 2007-10-16 16:37:32,408 - INFO - Auto-linking resource reference 'queue/FE_QUEUE' in bean FEInternalServicesEJB to Resource(id=Default Queue) 2007-10-16 16:37:32,408 - INFO - Configuring Service(id=Default MDB Container, type=Container, provider-id=Default MDB Container) 2007-10-16 16:37:32,409 - INFO - Auto-creating a container for bean CallAgentMDB: Container(type=MESSAGE, id=Default MDB Container) 2007-10-16 16:37:32,409 - INFO - Configuring Service(id=queue/ FE_QUEUE, type=Resource, provider-id=Default Queue) 2007-10-16 16:37:32,409 - INFO - Auto-creating a resource with id 'queue/FE_QUEUE' of type 'javax.jms.Queue for 'CallAgentMDB'. 2007-10-16 16:37:32,409 - INFO - Auto-linking resource reference 'queue/FE_QUEUE' in bean CallAgentMDB to Resource(id=queue/FE_QUEUE) 2007-10-16 16:37:32,409 - INFO - Configuring Service(id=CallAgentMDB, type=Resource, provider-id=Default Queue) 2007-10-16 16:37:32,410 - INFO - Auto-creating a resource with id 'CallAgentMDB' of type 'javax.jms.Queue for 'CallAgentMDB'. 2007-10-16 16:37:32,708 - INFO - Loaded Module: /home/vyzivus/work/chrysler/fe-trunk/fe-ejb/eclipse-target/ classes So, we can see that FEInternalServicesEJB posts messages to "Default Queue", while CallAgentMDB expects messages in "queue/FE_QUEUE" queue. How can I set the CallAgentMDB to listen on "Default Queue"? Can you please provide me with some MDB examples on OpenEJB? Thanks! Martin -- Mgr. Martin Vysny | [EMAIL PROTECTED] Software Engineer Whitestein Technologies s.r.o | www.whitestein.com Panenska 28 | 811 03 Bratislava | Slovak Republic Main +421 2 5443-5502 | Direct +421 2 5930-0717
Specifying source queue for message driven bean (MDB)
Hi guys, can you help me again? ;) We have a MDB named CallAgentMDB, which is a message consumer (MessageListener), and FEInternalServicesBean, which is a stateless bean. The problem is, that the MDB is not receiving messages which are sent by the internal services bean. When openejb starts, it prints the following: 2007-10-16 16:37:32,401 - INFO - Configuring Service(id=Default Stateless Container, type=Container, provider-id=Default Stateless Container) 2007-10-16 16:37:32,406 - INFO - Auto-creating a container for bean FEClientEJB: Container(type=STATELESS, id=Default Stateless Container) 2007-10-16 16:37:32,407 - INFO - Auto-linking resource reference 'jdbc/DB2DS' in bean FEInternalServicesEJB to Resource(id=Default JDBC Database) 2007-10-16 16:37:32,407 - INFO - Configuring Service(id=Default JMS Connection Factory, type=Resource, provider-id=Default JMS Connection Factory) 2007-10-16 16:37:32,407 - INFO - Auto-creating a resource with id 'Default JMS Connection Factory' of type 'javax.jms.QueueConnectionFactory for 'FEInternalServicesEJB'. 2007-10-16 16:37:32,407 - INFO - Configuring Service(id=Default JMS Resource Adapter, type=Resource, provider-id=Default JMS Resource Adapter) 2007-10-16 16:37:32,408 - INFO - Auto-linking resource reference 'jms/FE_QCF' in bean FEInternalServicesEJB to Resource(id=Default JMS Connection Factory) 2007-10-16 16:37:32,408 - INFO - Configuring Service(id=Default Queue, type=Resource, provider-id=Default Queue) 2007-10-16 16:37:32,408 - INFO - Auto-creating a resource with id 'Default Queue' of type 'javax.jms.Queue for 'FEInternalServicesEJB'. 2007-10-16 16:37:32,408 - INFO - Auto-linking resource reference 'queue/FE_QUEUE' in bean FEInternalServicesEJB to Resource(id=Default Queue) 2007-10-16 16:37:32,408 - INFO - Configuring Service(id=Default MDB Container, type=Container, provider-id=Default MDB Container) 2007-10-16 16:37:32,409 - INFO - Auto-creating a container for bean CallAgentMDB: Container(type=MESSAGE, id=Default MDB Container) 2007-10-16 16:37:32,409 - INFO - Configuring Service(id=queue/FE_QUEUE, type=Resource, provider-id=Default Queue) 2007-10-16 16:37:32,409 - INFO - Auto-creating a resource with id 'queue/FE_QUEUE' of type 'javax.jms.Queue for 'CallAgentMDB'. 2007-10-16 16:37:32,409 - INFO - Auto-linking resource reference 'queue/FE_QUEUE' in bean CallAgentMDB to Resource(id=queue/FE_QUEUE) 2007-10-16 16:37:32,409 - INFO - Configuring Service(id=CallAgentMDB, type=Resource, provider-id=Default Queue) 2007-10-16 16:37:32,410 - INFO - Auto-creating a resource with id 'CallAgentMDB' of type 'javax.jms.Queue for 'CallAgentMDB'. 2007-10-16 16:37:32,708 - INFO - Loaded Module: /home/vyzivus/work/chrysler/fe-trunk/fe-ejb/eclipse-target/classes So, we can see that FEInternalServicesEJB posts messages to "Default Queue", while CallAgentMDB expects messages in "queue/FE_QUEUE" queue. How can I set the CallAgentMDB to listen on "Default Queue"? Can you please provide me with some MDB examples on OpenEJB? Thanks! Martin -- Mgr. Martin Vysny | [EMAIL PROTECTED] Software Engineer Whitestein Technologies s.r.o | www.whitestein.com Panenska 28 | 811 03 Bratislava | Slovak Republic Main +421 2 5443-5502 | Direct +421 2 5930-0717 signature.asc Description: This is a digitally signed message part