You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by "Howard W. Smith, Jr." <sm...@gmail.com> on 2015/08/05 23:37:35 UTC
No exception until attempt to use ActiveMQ on 2 separate tomee instances
When I had 1 or 2 web applications on 1 tomee instance (and default tomee
ActiveMQ configuration),
app1
- has MDBs, using ActiveMQ JMS
- JAX RS (web) client to execute REST service on app2
app2
- has MDBs, using ActiveMQ JMS
- REST service running, uses MDBs to execute business logic
This works great on 1 tomee instance, but when I create a 2nd tomee
instance for app2 (above), I am getting the exception below.
For tomee 2nd instance, I changed server shutdown port, connector port, and
add the following to tomee.xml:
<tomee>
<Resource id="MyJmsResourceAdapter" type="ActiveMQResourceAdapter">
BrokerXmlConfig = broker:(tcp://someHostName:61616)
ServerUrl = tcp://someHostName:61616
</Resource>
<Resource id="MyJmsConnectionFactory" type="javax.jms.ConnectionFactory">
ResourceAdapter = MyJmsResourceAdapter
</Resource>
<Container id="MyJmsMdbContainer" ctype="MESSAGE">
ResourceAdapter = MyJmsResourceAdapter
</Container>
</tomee>
as per
Internal ActiveMQ Broker
http://tomee.apache.org/jms-resources-and-mdb-container.html
app1 on tomee 1 starts and runs well
app2 on tomee 2 starts, but has the following exception:
Aug 05, 2015 5:22:38 PM
com.mcms.googleCalendar.GoogleCalendarUpdateQueueBean
updateGoogleCalendarViaSchedule
INFO: Error occurred while adding 07/20/2018 to the Google Calendar update
queue
javax.jms.JMSException: Object is not a primitive:
com.mcms.googleCalendar.GoogleCalendarEvent@715c993d
at
org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:72)
at
org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1435)
at
org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1345)
at org.apache.activemq.ActiveMQSession.send(ActiveMQSession.java:1904)
at
org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProducer.java:289)
at
org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProducer.java:224)
at
org.apache.activemq.ActiveMQMessageProducerSupport.send(ActiveMQMessageProducerSupport.java:241)
at
com.mcms.application.ApplicationMessageBean.updateGoogleCalendar(ApplicationMessageBean.java:150)
at
com.mcms.application.ApplicationMessageBean$$OwbNormalScopeProxy0.updateGoogleCalendar(com/mcms/application/ApplicationMessageBean.java)
at
com.mcms.application.ApplicationScopeBean.sendUpdateGoogleCalendarMsg(ApplicationScopeBean.java:217)
at
com.mcms.application.ApplicationScopeBean$$OwbNormalScopeProxy0.sendUpdateGoogleCalendarMsg(com/mcms/application/ApplicationScopeBean.java)
at
com.mcms.googleCalendar.GoogleCalendarUpdateQueueBean.updateGoogleCalendarViaSchedule(GoogleCalendarUpdateQueueBean.java:425)
at sun.reflect.GeneratedMethodAccessor27.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at
org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:192)
at
org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:173)
at
org.apache.openejb.monitoring.StatsInterceptor.record(StatsInterceptor.java:181)
at
org.apache.openejb.monitoring.StatsInterceptor.AroundTimeout(StatsInterceptor.java:145)
at sun.reflect.GeneratedMethodAccessor26.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at
org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:192)
at
org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:173)
at
org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:85)
at
org.apache.openejb.core.singleton.SingletonContainer._invoke(SingletonContainer.java:256)
at
org.apache.openejb.core.singleton.SingletonContainer.invoke(SingletonContainer.java:212)
at
org.apache.openejb.core.timer.EjbTimerServiceImpl.ejbTimeout(EjbTimerServiceImpl.java:803)
at
org.apache.openejb.core.timer.EjbTimeoutJob.execute(EjbTimeoutJob.java:39)
at org.apache.openejb.quartz.core.JobRunShell.run(JobRunShell.java:202)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: Object is not a primitive:
com.mcms.googleCalendar.GoogleCalendarEvent@715c993d
at
org.apache.activemq.util.MarshallingSupport.marshalPrimitive(MarshallingSupport.java:156)
at
org.apache.activemq.util.MarshallingSupport.marshalPrimitiveList(MarshallingSupport.java:107)
at
org.apache.activemq.util.MarshallingSupport.marshalPrimitive(MarshallingSupport.java:154)
at
org.apache.activemq.util.MarshallingSupport.marshalPrimitiveMap(MarshallingSupport.java:64)
at org.apache.activemq.command.Message.beforeMarshall(Message.java:231)
at
org.apache.activemq.openwire.v10.MessageMarshaller.tightMarshal1(MessageMarshaller.java:122)
at
org.apache.activemq.openwire.v10.ActiveMQMessageMarshaller.tightMarshal1(ActiveMQMessageMarshaller.java:76)
at
org.apache.activemq.openwire.OpenWireFormat.marshal(OpenWireFormat.java:217)
at
org.apache.activemq.transport.tcp.TcpTransport.oneway(TcpTransport.java:175)
at
org.apache.activemq.transport.AbstractInactivityMonitor.doOnewaySend(AbstractInactivityMonitor.java:304)
at
org.apache.activemq.transport.AbstractInactivityMonitor.oneway(AbstractInactivityMonitor.java:286)
at
org.apache.activemq.transport.TransportFilter.oneway(TransportFilter.java:85)
at
org.apache.activemq.transport.WireFormatNegotiator.oneway(WireFormatNegotiator.java:104)
at
org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java:68)
at
org.apache.activemq.transport.ResponseCorrelator.asyncRequest(ResponseCorrelator.java:81)
at
org.apache.activemq.transport.ResponseCorrelator.request(ResponseCorrelator.java:86)
at
org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1406)
... 31 more
Re: No exception until attempt to use ActiveMQ on 2 separate tomee instances
Posted by "Howard W. Smith, Jr." <sm...@gmail.com>.
Interesting, okay.
On Wed, Aug 5, 2015 at 6:58 PM, Romain Manni-Bucau <rm...@gmail.com>
wrote:
> Local transport can skip serialization in some cases
> Le 5 août 2015 15:57, "Howard W. Smith, Jr." <sm...@gmail.com> a
> écrit :
>
> > Okay, I just recognized that after searching internet, but I still wonder
> > why the code below works when I have one tomee (activemq) instance. Prior
> > to today, GoogleCalendarEvent did not need to implement Serializable.
> >
> > public void updateGoogleCalendar(List<GoogleCalendarEvent>
> eventsToAdd)
> > throws Exception {
> > Message message = session.createMessage();
> > /*
> > *
> >
> >
> http://stackoverflow.com/questions/6904048/object-with-collection-containing-serializable-non-primitive-objects-cant-be-s
> > */
> > message.setObjectProperty("List<GoogleCalendarEvent>",
> > eventsToAdd);
> > gCalProducer.send(message);
> > }
> >
> >
> > On Wed, Aug 5, 2015 at 6:52 PM, Romain Manni-Bucau <
> rmannibucau@gmail.com>
> > wrote:
> >
> > > Surely cause not serialized
> > > Le 5 août 2015 14:40, "Howard W. Smith, Jr." <sm...@gmail.com>
> a
> > > écrit :
> > >
> > > > Below, is what is in my tomee.xml for tomee 2nd instance,
> > > >
> > > > On Wed, Aug 5, 2015 at 5:37 PM, Howard W. Smith, Jr. <
> > > > smithh032772@gmail.com
> > > > > wrote:
> > > >
> > > > > For tomee 2nd instance, I changed server shutdown port, connector
> > port,
> > > > > and add the following to tomee.xml:
> > > > >
> > > >
> > > > <!--
> > > > Internal ActiveMQ Broker
> > > > http://tomee.apache.org/jms-resources-and-mdb-container.html
> > > > -->
> > > > <Resource id="MyJmsResourceAdapter" type="ActiveMQResourceAdapter">
> > > > BrokerXmlConfig = broker:(tcp://localhost:62616)
> > > > ServerUrl = tcp://localhost:62616
> > > > </Resource>
> > > >
> > > > <Resource id="MyJmsConnectionFactory"
> > type="javax.jms.ConnectionFactory">
> > > > ResourceAdapter = MyJmsResourceAdapter
> > > > </Resource>
> > > >
> > > > <Container id="MyJmsMdbContainer" ctype="MESSAGE">
> > > > ResourceAdapter = MyJmsResourceAdapter
> > > > </Container>
> > > >
> > >
> >
>
Re: No exception until attempt to use ActiveMQ on 2 separate tomee instances
Posted by Romain Manni-Bucau <rm...@gmail.com>.
Local transport can skip serialization in some cases
Le 5 août 2015 15:57, "Howard W. Smith, Jr." <sm...@gmail.com> a
écrit :
> Okay, I just recognized that after searching internet, but I still wonder
> why the code below works when I have one tomee (activemq) instance. Prior
> to today, GoogleCalendarEvent did not need to implement Serializable.
>
> public void updateGoogleCalendar(List<GoogleCalendarEvent> eventsToAdd)
> throws Exception {
> Message message = session.createMessage();
> /*
> *
>
> http://stackoverflow.com/questions/6904048/object-with-collection-containing-serializable-non-primitive-objects-cant-be-s
> */
> message.setObjectProperty("List<GoogleCalendarEvent>",
> eventsToAdd);
> gCalProducer.send(message);
> }
>
>
> On Wed, Aug 5, 2015 at 6:52 PM, Romain Manni-Bucau <rm...@gmail.com>
> wrote:
>
> > Surely cause not serialized
> > Le 5 août 2015 14:40, "Howard W. Smith, Jr." <sm...@gmail.com> a
> > écrit :
> >
> > > Below, is what is in my tomee.xml for tomee 2nd instance,
> > >
> > > On Wed, Aug 5, 2015 at 5:37 PM, Howard W. Smith, Jr. <
> > > smithh032772@gmail.com
> > > > wrote:
> > >
> > > > For tomee 2nd instance, I changed server shutdown port, connector
> port,
> > > > and add the following to tomee.xml:
> > > >
> > >
> > > <!--
> > > Internal ActiveMQ Broker
> > > http://tomee.apache.org/jms-resources-and-mdb-container.html
> > > -->
> > > <Resource id="MyJmsResourceAdapter" type="ActiveMQResourceAdapter">
> > > BrokerXmlConfig = broker:(tcp://localhost:62616)
> > > ServerUrl = tcp://localhost:62616
> > > </Resource>
> > >
> > > <Resource id="MyJmsConnectionFactory"
> type="javax.jms.ConnectionFactory">
> > > ResourceAdapter = MyJmsResourceAdapter
> > > </Resource>
> > >
> > > <Container id="MyJmsMdbContainer" ctype="MESSAGE">
> > > ResourceAdapter = MyJmsResourceAdapter
> > > </Container>
> > >
> >
>
Re: No exception until attempt to use ActiveMQ on 2 separate tomee instances
Posted by "Howard W. Smith, Jr." <sm...@gmail.com>.
Okay, I just recognized that after searching internet, but I still wonder
why the code below works when I have one tomee (activemq) instance. Prior
to today, GoogleCalendarEvent did not need to implement Serializable.
public void updateGoogleCalendar(List<GoogleCalendarEvent> eventsToAdd)
throws Exception {
Message message = session.createMessage();
/*
*
http://stackoverflow.com/questions/6904048/object-with-collection-containing-serializable-non-primitive-objects-cant-be-s
*/
message.setObjectProperty("List<GoogleCalendarEvent>", eventsToAdd);
gCalProducer.send(message);
}
On Wed, Aug 5, 2015 at 6:52 PM, Romain Manni-Bucau <rm...@gmail.com>
wrote:
> Surely cause not serialized
> Le 5 août 2015 14:40, "Howard W. Smith, Jr." <sm...@gmail.com> a
> écrit :
>
> > Below, is what is in my tomee.xml for tomee 2nd instance,
> >
> > On Wed, Aug 5, 2015 at 5:37 PM, Howard W. Smith, Jr. <
> > smithh032772@gmail.com
> > > wrote:
> >
> > > For tomee 2nd instance, I changed server shutdown port, connector port,
> > > and add the following to tomee.xml:
> > >
> >
> > <!--
> > Internal ActiveMQ Broker
> > http://tomee.apache.org/jms-resources-and-mdb-container.html
> > -->
> > <Resource id="MyJmsResourceAdapter" type="ActiveMQResourceAdapter">
> > BrokerXmlConfig = broker:(tcp://localhost:62616)
> > ServerUrl = tcp://localhost:62616
> > </Resource>
> >
> > <Resource id="MyJmsConnectionFactory" type="javax.jms.ConnectionFactory">
> > ResourceAdapter = MyJmsResourceAdapter
> > </Resource>
> >
> > <Container id="MyJmsMdbContainer" ctype="MESSAGE">
> > ResourceAdapter = MyJmsResourceAdapter
> > </Container>
> >
>
Re: No exception until attempt to use ActiveMQ on 2 separate tomee instances
Posted by Romain Manni-Bucau <rm...@gmail.com>.
Surely cause not serialized
Le 5 août 2015 14:40, "Howard W. Smith, Jr." <sm...@gmail.com> a
écrit :
> Below, is what is in my tomee.xml for tomee 2nd instance,
>
> On Wed, Aug 5, 2015 at 5:37 PM, Howard W. Smith, Jr. <
> smithh032772@gmail.com
> > wrote:
>
> > For tomee 2nd instance, I changed server shutdown port, connector port,
> > and add the following to tomee.xml:
> >
>
> <!--
> Internal ActiveMQ Broker
> http://tomee.apache.org/jms-resources-and-mdb-container.html
> -->
> <Resource id="MyJmsResourceAdapter" type="ActiveMQResourceAdapter">
> BrokerXmlConfig = broker:(tcp://localhost:62616)
> ServerUrl = tcp://localhost:62616
> </Resource>
>
> <Resource id="MyJmsConnectionFactory" type="javax.jms.ConnectionFactory">
> ResourceAdapter = MyJmsResourceAdapter
> </Resource>
>
> <Container id="MyJmsMdbContainer" ctype="MESSAGE">
> ResourceAdapter = MyJmsResourceAdapter
> </Container>
>
Re: No exception until attempt to use ActiveMQ on 2 separate tomee instances
Posted by "Howard W. Smith, Jr." <sm...@gmail.com>.
Below, is what is in my tomee.xml for tomee 2nd instance,
On Wed, Aug 5, 2015 at 5:37 PM, Howard W. Smith, Jr. <smithh032772@gmail.com
> wrote:
> For tomee 2nd instance, I changed server shutdown port, connector port,
> and add the following to tomee.xml:
>
<!--
Internal ActiveMQ Broker
http://tomee.apache.org/jms-resources-and-mdb-container.html
-->
<Resource id="MyJmsResourceAdapter" type="ActiveMQResourceAdapter">
BrokerXmlConfig = broker:(tcp://localhost:62616)
ServerUrl = tcp://localhost:62616
</Resource>
<Resource id="MyJmsConnectionFactory" type="javax.jms.ConnectionFactory">
ResourceAdapter = MyJmsResourceAdapter
</Resource>
<Container id="MyJmsMdbContainer" ctype="MESSAGE">
ResourceAdapter = MyJmsResourceAdapter
</Container>