You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by THMayr <Th...@adesso.de> on 2016/03/16 11:06:05 UTC
Exception in createSesson() inside an EJB user transaction
Hi,
I get an exception creating a session in a MDB when the session is created
inside a user transaction. The code sequence in the MDB looks like this:
connectionFactory = (ConnectionFactory)
environmentContext.lookup("jms/ConnectionFactory");
ejbContext = (MessageDrivenContext)
initialContext.lookup("java:comp/EJBContext");
userTransaction = ejbContext.getUserTransaction ();
userTransaction.setTransactionTimeout (60000);
userTransaction.begin ();
connection = connectionFactory.createConnection ();
connection.start ();
session = connection.createSession ();
...
userTransaction.commit ();
When I remove /userTransaction.begin () /and /userTransaction.commit ()/ it
works. The MDB is deployed on a WildFly 10.0.0 and the ActiveMQ resource
adapter activemq-rar-5.13.1.rar is deployed.
Another interesting error message may be this one, which is printed after
/onMessage()/ is left:
11:10:08,426 ERROR
[org.jboss.jca.core.connectionmanager.listener.TxConnectionListener]
(default-threads - 8) IJ000315: Pool ConnectionFactory has 1 active handles
Any ideas what is going wrong or missing here?
Here the stack trace:
11:10:08,357 INFO [stdout] (default-threads - 8) TestMessageBeanLow, Low
Priority 0: Exception occurred:
org.apache.activemq.ra.ManagedConnectionProxy.createSession()Ljavax/jms/Session;
11:10:08,359 ERROR [stderr] (default-threads - 8)
java.lang.AbstractMethodError:
org.apache.activemq.ra.ManagedConnectionProxy.createSession()Ljavax/jms/Session;
11:10:08,359 ERROR [stderr] (default-threads - 8) at
de.adesso.tma.test.ejb.TestMessageBean.onMessage(TestMessageBean.java:212)
11:10:08,359 ERROR [stderr] (default-threads - 8) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
11:10:08,360 ERROR [stderr] (default-threads - 8) at
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
11:10:08,361 ERROR [stderr] (default-threads - 8) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
11:10:08,361 ERROR [stderr] (default-threads - 8) at
java.lang.reflect.Method.invoke(Unknown Source)
11:10:08,363 ERROR [stderr] (default-threads - 8) at
org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)
11:10:08,363 ERROR [stderr] (default-threads - 8) at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
11:10:08,364 ERROR [stderr] (default-threads - 8) at
org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437)
11:10:08,365 ERROR [stderr] (default-threads - 8) at
org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:82)
11:10:08,366 ERROR [stderr] (default-threads - 8) at
org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:93)
11:10:08,366 ERROR [stderr] (default-threads - 8) at
org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)
11:10:08,367 ERROR [stderr] (default-threads - 8) at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
11:10:08,367 ERROR [stderr] (default-threads - 8) at
org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43)
11:10:08,369 ERROR [stderr] (default-threads - 8) at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
11:10:08,369 ERROR [stderr] (default-threads - 8) at
org.jboss.as.ejb3.tx.EjbBMTInterceptor.handleInvocation(EjbBMTInterceptor.java:103)
11:10:08,370 ERROR [stderr] (default-threads - 8) at
org.jboss.as.ejb3.tx.BMTInterceptor.processInvocation(BMTInterceptor.java:58)
11:10:08,370 ERROR [stderr] (default-threads - 8) at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
11:10:08,372 ERROR [stderr] (default-threads - 8) at
org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437)
11:10:08,372 ERROR [stderr] (default-threads - 8) at
org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:73)
11:10:08,373 ERROR [stderr] (default-threads - 8) at
org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:83)
11:10:08,374 ERROR [stderr] (default-threads - 8) at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
11:10:08,376 ERROR [stderr] (default-threads - 8) at
org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45)
11:10:08,376 ERROR [stderr] (default-threads - 8) at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
11:10:08,378 ERROR [stderr] (default-threads - 8) at
org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)
11:10:08,378 ERROR [stderr] (default-threads - 8) at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
11:10:08,379 ERROR [stderr] (default-threads - 8) at
org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
11:10:08,379 ERROR [stderr] (default-threads - 8) at
org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:52)
11:10:08,380 ERROR [stderr] (default-threads - 8) at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
11:10:08,381 ERROR [stderr] (default-threads - 8) at
org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51)
11:10:08,382 ERROR [stderr] (default-threads - 8) at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
11:10:08,383 ERROR [stderr] (default-threads - 8) at
org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)
11:10:08,384 ERROR [stderr] (default-threads - 8) at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
11:10:08,384 ERROR [stderr] (default-threads - 8) at
org.jboss.as.ejb3.component.invocationmetrics.WaitTimeInterceptor.processInvocation(WaitTimeInterceptor.java:43)
11:10:08,385 ERROR [stderr] (default-threads - 8) at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
11:10:08,386 ERROR [stderr] (default-threads - 8) at
org.jboss.as.ejb3.security.AuthorizationInterceptor.processInvocation(AuthorizationInterceptor.java:138)
11:10:08,387 ERROR [stderr] (default-threads - 8) at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
11:10:08,387 ERROR [stderr] (default-threads - 8) at
org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:100)
11:10:08,388 ERROR [stderr] (default-threads - 8) at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
11:10:08,388 ERROR [stderr] (default-threads - 8) at
org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64)
11:10:08,390 ERROR [stderr] (default-threads - 8) at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
11:10:08,390 ERROR [stderr] (default-threads - 8) at
org.jboss.as.ejb3.deployment.processors.EjbSuspendInterceptor.processInvocation(EjbSuspendInterceptor.java:53)
11:10:08,391 ERROR [stderr] (default-threads - 8) at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
11:10:08,392 ERROR [stderr] (default-threads - 8) at
org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:66)
11:10:08,393 ERROR [stderr] (default-threads - 8) at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
11:10:08,393 ERROR [stderr] (default-threads - 8) at
org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
11:10:08,394 ERROR [stderr] (default-threads - 8) at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
11:10:08,395 ERROR [stderr] (default-threads - 8) at
org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:54)
11:10:08,396 ERROR [stderr] (default-threads - 8) at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
11:10:08,396 ERROR [stderr] (default-threads - 8) at
org.jboss.as.ejb3.component.messagedriven.MessageDrivenComponentDescription$5$1.processInvocation(MessageDrivenComponentDescription.java:239)
11:10:08,397 ERROR [stderr] (default-threads - 8) at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
11:10:08,398 ERROR [stderr] (default-threads - 8) at
org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64)
11:10:08,399 ERROR [stderr] (default-threads - 8) at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
11:10:08,399 ERROR [stderr] (default-threads - 8) at
org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:356)
11:10:08,400 ERROR [stderr] (default-threads - 8) at
org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:636)
11:10:08,400 ERROR [stderr] (default-threads - 8) at
org.jboss.invocation.AccessCheckingInterceptor.processInvocation(AccessCheckingInterceptor.java:61)
11:10:08,402 ERROR [stderr] (default-threads - 8) at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
11:10:08,402 ERROR [stderr] (default-threads - 8) at
org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:356)
11:10:08,403 ERROR [stderr] (default-threads - 8) at
org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80)
11:10:08,404 ERROR [stderr] (default-threads - 8) at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
11:10:08,405 ERROR [stderr] (default-threads - 8) at
org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
11:10:08,405 ERROR [stderr] (default-threads - 8) at
org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:195)
11:10:08,406 ERROR [stderr] (default-threads - 8) at
org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:185)
11:10:08,407 ERROR [stderr] (default-threads - 8) at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
11:10:08,408 ERROR [stderr] (default-threads - 8) at
org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
11:10:08,408 ERROR [stderr] (default-threads - 8) at
org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:73)
11:10:08,410 ERROR [stderr] (default-threads - 8) at
de.adesso.tma.test.ejb.TestMessageBean$$$view10.onMessage(Unknown Source)
11:10:08,410 ERROR [stderr] (default-threads - 8) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
11:10:08,411 ERROR [stderr] (default-threads - 8) at
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
11:10:08,411 ERROR [stderr] (default-threads - 8) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
11:10:08,413 ERROR [stderr] (default-threads - 8) at
java.lang.reflect.Method.invoke(Unknown Source)
11:10:08,413 ERROR [stderr] (default-threads - 8) at
org.jboss.as.ejb3.inflow.MessageEndpointInvocationHandler.doInvoke(MessageEndpointInvocationHandler.java:139)
11:10:08,415 ERROR [stderr] (default-threads - 8) at
org.jboss.as.ejb3.inflow.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:73)
11:10:08,415 ERROR [stderr] (default-threads - 8) at
de.adesso.tma.test.ejb.TestMessageBean$$$endpoint6.onMessage(Unknown Source)
11:10:08,416 ERROR [stderr] (default-threads - 8) at
org.apache.activemq.ra.MessageEndpointProxy$MessageEndpointAlive.onMessage(MessageEndpointProxy.java:123)
11:10:08,417 ERROR [stderr] (default-threads - 8) at
org.apache.activemq.ra.MessageEndpointProxy.onMessage(MessageEndpointProxy.java:64)
11:10:08,418 ERROR [stderr] (default-threads - 8) at
org.apache.activemq.ActiveMQSession.run(ActiveMQSession.java:1041)
11:10:08,418 ERROR [stderr] (default-threads - 8) at
org.apache.activemq.ra.ServerSessionImpl.run(ServerSessionImpl.java:169)
11:10:08,419 ERROR [stderr] (default-threads - 8) at
org.jboss.jca.core.workmanager.WorkWrapper.run(WorkWrapper.java:223)
11:10:08,419 ERROR [stderr] (default-threads - 8) at
org.jboss.threads.SimpleDirectExecutor.execute(SimpleDirectExecutor.java:33)
11:10:08,421 ERROR [stderr] (default-threads - 8) at
org.jboss.threads.QueueExecutor.runTask(QueueExecutor.java:808)
11:10:08,421 ERROR [stderr] (default-threads - 8) at
org.jboss.threads.QueueExecutor.access$100(QueueExecutor.java:45)
11:10:08,422 ERROR [stderr] (default-threads - 8) at
org.jboss.threads.QueueExecutor$Worker.run(QueueExecutor.java:828)
11:10:08,423 ERROR [stderr] (default-threads - 8) at
java.lang.Thread.run(Unknown Source)
11:10:08,424 ERROR [stderr] (default-threads - 8) at
org.jboss.threads.JBossThread.run(JBossThread.java:320)
11:10:08,425 INFO [stdout] (default-threads - 8)
--
View this message in context: http://activemq.2283324.n4.nabble.com/Exception-in-createSesson-inside-an-EJB-user-transaction-tp4709452.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: Exception in createSesson() inside an EJB user transaction
Posted by THMayr <Th...@adesso.de>.
Add on:
When I call createSession() with the following parameters, i get rid of the
exception:
session = connection.createSession (true, Session.AUTO_ACKNOWLEDGE);
Both parameters should be ignored, when the method is called in an EJB
container and a JTA transaction is active (see Connection.createSession()
<https://docs.oracle.com/javaee/7/api/javax/jms/Connection.html#createSession-boolean-int->
. But even when I leave out the /transacted/ parameter the exception is
thrown. The following error message remains:
14:46:50,221 ERROR
[org.jboss.jca.core.connectionmanager.listener.TxConnectionListener]
(default-threads - 45) IJ000315: Pool ConnectionFactory has 1 active handles
So I think this could be considered as a bug.
Now arises the next problem. I use the session to send response messages via
a response queue to the client. After sending the message I have to commit
the transaction, so that the message is actually delivered to the client:
producer = session.createProducer (responseQueue);
producer.setDeliveryMode (DeliveryMode.NON_PERSISTENT);
responseMessage = session.createTextMessage ();
...
producer.send (responseMessage);
userTransaction.commit ();
userTransaction.begin ();
This is done in a loop to send progress messages to the client. This works
for the first message. But when the second message is sent an exception
occurs saying the session is closed. Why this?? Does a commit close the
session??
In my opinion this is a bug, too.
Thomas
--
View this message in context: http://activemq.2283324.n4.nabble.com/Exception-in-createSesson-inside-an-EJB-user-transaction-tp4709452p4709457.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: Exception in createSesson() inside an EJB user transaction
Posted by Tim Bain <tb...@alumni.duke.edu>.
It looks like you're compiling against JMS 2.0, but ActiveMQ only
implements JMS 1.1. Here is the 1.1 version of the Connection interface:
http://grepcode.com/file/repository.springsource.com/javax.jms/com.springsource.javax.jms/1.1.0/javax/jms/Connection.java#Connection.
Notice that the only createSession() method it includes is the two-argument
one.
Either use JMS 1.1, or consider using Artemis instead, since it implements
JMS 2.0.
Tim
On Mar 23, 2016 12:57 AM, "THMayr" <Th...@adesso.de> wrote:
> Hi Tim,
>
> here the complete list of imports:
>
> import javax.ejb.MessageDrivenContext;
> import javax.jms.Connection;
> import javax.jms.ConnectionFactory;
> import javax.jms.DeliveryMode;
> import javax.jms.Destination;
> import javax.jms.JMSException;
> import javax.jms.Message;
> import javax.jms.MessageListener;
> import javax.jms.MessageProducer;
> import javax.jms.Session;
> import javax.jms.TextMessage;
> import javax.naming.Context;
> import javax.naming.InitialContext;
> import javax.transaction.SystemException;
> import javax.transaction.UserTransaction;
>
> And here the relevant lines of code in /onMessage()/:
>
> initialContext = new javax.naming.InitialContext();
> environmentContext = (Context) initialContext.lookup ("java:comp/env");
> connectionFactory = (ConnectionFactory)
> environmentContext.lookup("jms/ConnectionFactory");
> ejbContext = (MessageDrivenContext)
> initialContext.lookup("java:comp/EJBContext");
> userTransaction = ejbContext.getUserTransaction ();
> userTransaction.setTransactionTimeout (60000);
> userTransaction.begin ();
> connection = connectionFactory.createConnection ();
> connection.start ();
> session = connection.createSession (); // <- This is line 212
>
> The last line is line 212. When I replace this line with the following, the
> exception doesn't occur:
>
> session = connection.createSession (false, Session.AUTO_ACKNOWLEDGE);
>
> Hope this helps
>
> Thomas
>
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/Exception-in-createSesson-inside-an-EJB-user-transaction-tp4709452p4709897.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
Re: Exception in createSesson() inside an EJB user transaction
Posted by THMayr <Th...@adesso.de>.
Hi Tim,
here the complete list of imports:
import javax.ejb.MessageDrivenContext;
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.DeliveryMode;
import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.MessageProducer;
import javax.jms.Session;
import javax.jms.TextMessage;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.transaction.SystemException;
import javax.transaction.UserTransaction;
And here the relevant lines of code in /onMessage()/:
initialContext = new javax.naming.InitialContext();
environmentContext = (Context) initialContext.lookup ("java:comp/env");
connectionFactory = (ConnectionFactory)
environmentContext.lookup("jms/ConnectionFactory");
ejbContext = (MessageDrivenContext)
initialContext.lookup("java:comp/EJBContext");
userTransaction = ejbContext.getUserTransaction ();
userTransaction.setTransactionTimeout (60000);
userTransaction.begin ();
connection = connectionFactory.createConnection ();
connection.start ();
session = connection.createSession (); // <- This is line 212
The last line is line 212. When I replace this line with the following, the
exception doesn't occur:
session = connection.createSession (false, Session.AUTO_ACKNOWLEDGE);
Hope this helps
Thomas
--
View this message in context: http://activemq.2283324.n4.nabble.com/Exception-in-createSesson-inside-an-EJB-user-transaction-tp4709452p4709897.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: Exception in createSesson() inside an EJB user transaction
Posted by Tim Bain <tb...@alumni.duke.edu>.
Here's part of the stack trace: "at
de.adesso.tma.test.ejb.TestMessageBean.onMessage(TestMessageBean.java:212)"
Can you tell us what is at line 212 and the types of any objects referenced
in it (including packages)?
I'd also try to figure out what version of
org.apache.activemq.ra.ManagedConnectionProxy you're using and which JAR
it's coming from. I'd probably attach a debugger and step into the
classloader when it's loading that class, but you might be able to figure
it out using jar tvf or another method I haven't thought of.
Tim
.. some more thoughts:
The MDB is in fact not compiled or linked against any concrete ActiveMQ
classes. The MDB uses only the standard interfaces defined in the package
javax.jms. I need the ActiveMQ client library in my developement project
only to run a JUnit test, which sends and receives messages. So there is no
need to include the ActiveMQ client library in the EAR, which contains the
MDB.
So, if there are conflicting classes, they must be provided by WildFly.
Thomas
--
View this message in context:
http://activemq.2283324.n4.nabble.com/Exception-in-createSesson-inside-an-EJB-user-transaction-tp4709452p4709665.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: Exception in createSesson() inside an EJB user transaction
Posted by THMayr <Th...@adesso.de>.
.. some more thoughts:
The MDB is in fact not compiled or linked against any concrete ActiveMQ
classes. The MDB uses only the standard interfaces defined in the package
javax.jms. I need the ActiveMQ client library in my developement project
only to run a JUnit test, which sends and receives messages. So there is no
need to include the ActiveMQ client library in the EAR, which contains the
MDB.
So, if there are conflicting classes, they must be provided by WildFly.
Thomas
--
View this message in context: http://activemq.2283324.n4.nabble.com/Exception-in-createSesson-inside-an-EJB-user-transaction-tp4709452p4709665.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: Exception in createSesson() inside an EJB user transaction
Posted by THMayr <Th...@adesso.de>.
Hi Tim,
thanks for your idea! I'm compiling against activemq-client-5.13.1.jar and
deployed this jar in the EAR. Due to the fact that the resource adapter
activemq-rar-5.13.1.rar contains this jar, too, I removed the JAR from the
EAR. I got the same exception. To be shure, I extracted the
activemq-client-5.13.1.jar from the RA and compiled against this file, the
result was the same. I searched also for apache files under the WildFly
installation directory and found some under "artemis". But I think these
jars contain different classes.
So I have no idea what causes the AbstractMethodError.
I could live with specifiying the parameters for createSession() because
these are just ignored on other application servers. But the bigger problem
is, that the session seems to be closed when the transaction is commited or
restarted.
Regards Thomas
--
View this message in context: http://activemq.2283324.n4.nabble.com/Exception-in-createSesson-inside-an-EJB-user-transaction-tp4709452p4709572.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: Exception in createSesson() inside an EJB user transaction
Posted by Tim Bain <tb...@alumni.duke.edu>.
I see java.lang.AbstractMethodError:
org.apache.activemq.ra.ManagedConnectionProxy.createSession()Ljavax/jms/Session;
in the logs, which implies that the version of that class at runtime is
different than what you compiled against. (source:
http://stackoverflow.com/questions/17969365/why-i-am-getting-java-lang-abstractmethoderror-errors
)
Is there any chance you upgraded the RA JAR without recompiling, and that
your code won't compile against the latest version? Alternatively, might
there be two copies of that class with different versions on the classpath,
such that the JVM might be finding the wrong one?
On Mar 16, 2016 8:29 AM, "THMayr" <Th...@adesso.de> wrote:
> Hi,
>
> I get an exception creating a session in a MDB when the session is created
> inside a user transaction. The code sequence in the MDB looks like this:
>
> connectionFactory = (ConnectionFactory)
> environmentContext.lookup("jms/ConnectionFactory");
> ejbContext = (MessageDrivenContext)
> initialContext.lookup("java:comp/EJBContext");
> userTransaction = ejbContext.getUserTransaction ();
> userTransaction.setTransactionTimeout (60000);
> userTransaction.begin ();
> connection = connectionFactory.createConnection ();
> connection.start ();
> session = connection.createSession ();
> ...
> userTransaction.commit ();
>
> When I remove /userTransaction.begin () /and /userTransaction.commit ()/ it
> works. The MDB is deployed on a WildFly 10.0.0 and the ActiveMQ resource
> adapter activemq-rar-5.13.1.rar is deployed.
>
> Another interesting error message may be this one, which is printed after
> /onMessage()/ is left:
>
> 11:10:08,426 ERROR
> [org.jboss.jca.core.connectionmanager.listener.TxConnectionListener]
> (default-threads - 8) IJ000315: Pool ConnectionFactory has 1 active handles
>
> Any ideas what is going wrong or missing here?
>
> Here the stack trace:
>
> 11:10:08,357 INFO [stdout] (default-threads - 8) TestMessageBeanLow, Low
> Priority 0: Exception occurred:
>
> org.apache.activemq.ra.ManagedConnectionProxy.createSession()Ljavax/jms/Session;
> 11:10:08,359 ERROR [stderr] (default-threads - 8)
> java.lang.AbstractMethodError:
>
> org.apache.activemq.ra.ManagedConnectionProxy.createSession()Ljavax/jms/Session;
> 11:10:08,359 ERROR [stderr] (default-threads - 8) at
> de.adesso.tma.test.ejb.TestMessageBean.onMessage(TestMessageBean.java:212)
> 11:10:08,359 ERROR [stderr] (default-threads - 8) at
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 11:10:08,360 ERROR [stderr] (default-threads - 8) at
> sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> 11:10:08,361 ERROR [stderr] (default-threads - 8) at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> 11:10:08,361 ERROR [stderr] (default-threads - 8) at
> java.lang.reflect.Method.invoke(Unknown Source)
> 11:10:08,363 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)
> 11:10:08,363 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
> 11:10:08,364 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437)
> 11:10:08,365 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:82)
> 11:10:08,366 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:93)
> 11:10:08,366 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)
> 11:10:08,367 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
> 11:10:08,367 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43)
> 11:10:08,369 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
> 11:10:08,369 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.as.ejb3.tx.EjbBMTInterceptor.handleInvocation(EjbBMTInterceptor.java:103)
> 11:10:08,370 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.as.ejb3.tx.BMTInterceptor.processInvocation(BMTInterceptor.java:58)
> 11:10:08,370 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
> 11:10:08,372 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437)
> 11:10:08,372 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:73)
> 11:10:08,373 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:83)
> 11:10:08,374 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
> 11:10:08,376 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45)
> 11:10:08,376 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
> 11:10:08,378 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)
> 11:10:08,378 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
> 11:10:08,379 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
> 11:10:08,379 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:52)
> 11:10:08,380 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
> 11:10:08,381 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51)
> 11:10:08,382 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
> 11:10:08,383 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)
> 11:10:08,384 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
> 11:10:08,384 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.as.ejb3.component.invocationmetrics.WaitTimeInterceptor.processInvocation(WaitTimeInterceptor.java:43)
> 11:10:08,385 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
> 11:10:08,386 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.as.ejb3.security.AuthorizationInterceptor.processInvocation(AuthorizationInterceptor.java:138)
> 11:10:08,387 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
> 11:10:08,387 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:100)
> 11:10:08,388 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
> 11:10:08,388 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64)
> 11:10:08,390 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
> 11:10:08,390 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.as.ejb3.deployment.processors.EjbSuspendInterceptor.processInvocation(EjbSuspendInterceptor.java:53)
> 11:10:08,391 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
> 11:10:08,392 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:66)
> 11:10:08,393 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
> 11:10:08,393 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
> 11:10:08,394 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
> 11:10:08,395 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:54)
> 11:10:08,396 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
> 11:10:08,396 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.as.ejb3.component.messagedriven.MessageDrivenComponentDescription$5$1.processInvocation(MessageDrivenComponentDescription.java:239)
> 11:10:08,397 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
> 11:10:08,398 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64)
> 11:10:08,399 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
> 11:10:08,399 ERROR [stderr] (default-threads - 8) at
> org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:356)
> 11:10:08,400 ERROR [stderr] (default-threads - 8) at
>
> org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:636)
> 11:10:08,400 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.invocation.AccessCheckingInterceptor.processInvocation(AccessCheckingInterceptor.java:61)
> 11:10:08,402 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
> 11:10:08,402 ERROR [stderr] (default-threads - 8) at
> org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:356)
> 11:10:08,403 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80)
> 11:10:08,404 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
> 11:10:08,405 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
> 11:10:08,405 ERROR [stderr] (default-threads - 8) at
> org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:195)
> 11:10:08,406 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:185)
> 11:10:08,407 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
> 11:10:08,408 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
> 11:10:08,408 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:73)
> 11:10:08,410 ERROR [stderr] (default-threads - 8) at
> de.adesso.tma.test.ejb.TestMessageBean$$$view10.onMessage(Unknown Source)
> 11:10:08,410 ERROR [stderr] (default-threads - 8) at
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 11:10:08,411 ERROR [stderr] (default-threads - 8) at
> sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> 11:10:08,411 ERROR [stderr] (default-threads - 8) at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> 11:10:08,413 ERROR [stderr] (default-threads - 8) at
> java.lang.reflect.Method.invoke(Unknown Source)
> 11:10:08,413 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.as.ejb3.inflow.MessageEndpointInvocationHandler.doInvoke(MessageEndpointInvocationHandler.java:139)
> 11:10:08,415 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.as.ejb3.inflow.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:73)
> 11:10:08,415 ERROR [stderr] (default-threads - 8) at
> de.adesso.tma.test.ejb.TestMessageBean$$$endpoint6.onMessage(Unknown
> Source)
> 11:10:08,416 ERROR [stderr] (default-threads - 8) at
>
> org.apache.activemq.ra.MessageEndpointProxy$MessageEndpointAlive.onMessage(MessageEndpointProxy.java:123)
> 11:10:08,417 ERROR [stderr] (default-threads - 8) at
>
> org.apache.activemq.ra.MessageEndpointProxy.onMessage(MessageEndpointProxy.java:64)
> 11:10:08,418 ERROR [stderr] (default-threads - 8) at
> org.apache.activemq.ActiveMQSession.run(ActiveMQSession.java:1041)
> 11:10:08,418 ERROR [stderr] (default-threads - 8) at
> org.apache.activemq.ra.ServerSessionImpl.run(ServerSessionImpl.java:169)
> 11:10:08,419 ERROR [stderr] (default-threads - 8) at
> org.jboss.jca.core.workmanager.WorkWrapper.run(WorkWrapper.java:223)
> 11:10:08,419 ERROR [stderr] (default-threads - 8) at
>
> org.jboss.threads.SimpleDirectExecutor.execute(SimpleDirectExecutor.java:33)
> 11:10:08,421 ERROR [stderr] (default-threads - 8) at
> org.jboss.threads.QueueExecutor.runTask(QueueExecutor.java:808)
> 11:10:08,421 ERROR [stderr] (default-threads - 8) at
> org.jboss.threads.QueueExecutor.access$100(QueueExecutor.java:45)
> 11:10:08,422 ERROR [stderr] (default-threads - 8) at
> org.jboss.threads.QueueExecutor$Worker.run(QueueExecutor.java:828)
> 11:10:08,423 ERROR [stderr] (default-threads - 8) at
> java.lang.Thread.run(Unknown Source)
> 11:10:08,424 ERROR [stderr] (default-threads - 8) at
> org.jboss.threads.JBossThread.run(JBossThread.java:320)
> 11:10:08,425 INFO [stdout] (default-threads - 8)
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/Exception-in-createSesson-inside-an-EJB-user-transaction-tp4709452.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>