You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by "magic.moose" <ma...@avedya.com> on 2007/01/15 18:48:10 UTC

Can't turn ObjectMessage serialization OFF!!

Hey all,

AcitveMQ 4.1.0, Jencks 1.1

I'm trying not to serialized ObjectMessage content while using jvm
transport. I can't force connectionFactory (or something else) to stop
serializing.

This is how the Spring conf looks like:

	<bean id="connectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory">
		<property name="brokerURL">
			<value>vm://localhost</value>
		</property>
		<property name="objectMessageSerializationDefered">
			<value>true</value>
		</property>
	</bean>

	<bean id="jmsResourceAdapter"
class="org.apache.activemq.ra.ActiveMQResourceAdapter">
		<property name="connectionFactory" ref="connectionFactory"/>
	</bean>


	<bean id="jencks" class="org.jencks.JCAContainer">
		<property name="bootstrapContext">
			<bean class="org.jencks.factory.BootstrapContextFactoryBean">
				<property name="threadPoolSize" value="5"/>
			</bean>
		</property>
		<property name="resourceAdapter">
			<ref bean="jmsResourceAdapter"/>
		</property>
	</bean>

	<bean id="eventQueueConsumer" class="org.jencks.JCAConnector">
		<property name="jcaContainer" ref="jencks" />

		<property name="activationSpec">
			<bean class="org.apache.activemq.ra.ActiveMQActivationSpec">
				<property name="destination" value="eventQueue" />
				<property name="destinationType" value="javax.jms.Queue" />
			</bean>
		</property>
		<property name="ref" value="dispatcher" />
	</bean>

<!-- for sending-->
	<bean id="jmsFactory"
		class="org.apache.activemq.pool.PooledConnectionFactory">
		<property name="connectionFactory" ref="connectionFactory"/>
	</bean>


	<bean id="eventSender"
		class="com.avedya.zapzone2.eventframework.client.EventQueueClient"
		singleton="true">
		<property name="jmsTemplate">
			<bean class="org.springframework.jms.core.JmsTemplate">
				<property name="connectionFactory">
					<ref local="connectionFactory" />
				</property>
			</bean>
		</property>
		<property name="queueName">
			<value>eventQueue</value>
		</property>

	</bean>

</beans>

The eventSender class uses MessageCreator:
	
   private class ObjectMessageCreator implements MessageCreator{
		
		private Serializable object;
		
		public ObjectMessageCreator(Serializable object){
			this.object = object;
		}

		public Message createMessage(Session session) throws JMSException {
			ObjectMessage msg = session.createObjectMessage();
			msg.setObject(object);
			return msg;
		}
		
	}
	
and sends using:

       jmsTemplate.send(queueName,new ObjectMessageCreator(event));

what I get is:

Caused by: java.io.NotSerializableException: javax.mail.internet.MimeMessage
	at java.io.ObjectOutputStream.writeObject0(Unknown Source)
	at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
	at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
	at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
	at java.io.ObjectOutputStream.writeObject0(Unknown Source)
	at java.io.ObjectOutputStream.writeObject(Unknown Source)
	at
org.apache.activemq.command.ActiveMQObjectMessage.storeContent(ActiveMQObjectMessage.java:96)

where MimeMessage is a part of serializable Object being sent. 

Perhaps I do something wrong. I took me a while to figure out how to force
resourceAdpater to use given connectionFactory so I know there is a lot of
things I dont know about ActiveMq. Anyway, seems like setting
objectMessageSerializationDefered doesnt really do the trick.

I appreciate your help.
m.
-- 
View this message in context: http://www.nabble.com/Can%27t-turn-ObjectMessage-serialization-OFF%21%21-tf3016083.html#a8375884
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Can't turn ObjectMessage serialization OFF!!

Posted by "magic.moose" <ma...@avedya.com>.
Thank you,

Okay, i thought about Externalizable, but its more like last resort to me. I
still do believe that it should be possible not to serialize at all. Here is
the stack trace, quite large, but hopefully it can tell you something:

(I am still seeing persitent=true in ActiveMQObjectMessage...)

10:43:37,965 [main] DEBUG ActiveMQSession:1542 - Sending message:
ActiveMQObjectMessage {commandId = 0, responseRequired = false, messageId =
ID:mdesktop-4813-1168940616450-2:3:1:1:1, originalDestination = null,
originalTransactionId = null, producerId =
ID:mdesktop-4813-1168940616450-2:3:1:1, destination = queue://eventQueue,
transactionId = null, expiration = 0, timestamp = 1168940617965, arrival =
0, correlationId = null, replyTo = null, persistent = true, type = null,
priority = 4, groupID = null, groupSequence = 0, targetConsumerId = null,
compressed = false, userID = null, content = null, marshalledProperties =
null, dataStructure = null, redeliveryCounter = 0, size = 0, properties =
null, readOnlyProperties = true, readOnlyBody = true, droppable = false}

10:43:38,028 [main] DEBUG Service:288 - Error occured while processing sync
command: java.lang.RuntimeException: javax.mail.internet.MimeMessage
java.lang.RuntimeException: javax.mail.internet.MimeMessage
	at
org.apache.activemq.command.ActiveMQObjectMessage.storeContent(ActiveMQObjectMessage.java:102)
	at
org.apache.activemq.command.ActiveMQObjectMessage.copy(ActiveMQObjectMessage.java:78)
	at
org.apache.activemq.command.ActiveMQObjectMessage.copy(ActiveMQObjectMessage.java:73)
	at
org.apache.activemq.ActiveMQConnection.onCommand(ActiveMQConnection.java:1466)
	at
org.apache.activemq.transport.ResponseCorrelator.onCommand(ResponseCorrelator.java:95)
	at
org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:65)
	at
org.apache.activemq.transport.vm.VMTransport.syncOneWay(VMTransport.java:96)
	at org.apache.activemq.transport.vm.VMTransport.oneway(VMTransport.java:83)
	at
org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java:43)
	at
org.apache.activemq.transport.ResponseCorrelator.oneway(ResponseCorrelator.java:60)
	at
org.apache.activemq.broker.TransportConnection.dispatch(TransportConnection.java:1051)
	at
org.apache.activemq.broker.TransportConnection.processDispatch(TransportConnection.java:772)
	at
org.apache.activemq.broker.TransportConnection.dispatchSync(TransportConnection.java:749)
	at
org.apache.activemq.broker.region.PrefetchSubscription.dispatch(PrefetchSubscription.java:404)
	at
org.apache.activemq.broker.region.QueueSubscription.dispatch(QueueSubscription.java:172)
	at
org.apache.activemq.broker.region.PrefetchSubscription.add(PrefetchSubscription.java:129)
	at
org.apache.activemq.broker.region.policy.RoundRobinDispatchPolicy.dispatch(RoundRobinDispatchPolicy.java:54)
	at org.apache.activemq.broker.region.Queue.dispatch(Queue.java:472)
	at org.apache.activemq.broker.region.Queue.send(Queue.java:298)
	at
org.apache.activemq.broker.region.AbstractRegion.send(AbstractRegion.java:292)
	at
org.apache.activemq.broker.region.RegionBroker.send(RegionBroker.java:377)
	at
org.apache.activemq.broker.TransactionBroker.send(TransactionBroker.java:193)
	at org.apache.activemq.broker.BrokerFilter.send(BrokerFilter.java:126)
	at
org.apache.activemq.broker.CompositeDestinationBroker.send(CompositeDestinationBroker.java:98)
	at
org.apache.activemq.broker.MutableBrokerFilter.send(MutableBrokerFilter.java:136)
	at
org.apache.activemq.broker.TransportConnection.processMessage(TransportConnection.java:480)
	at
org.apache.activemq.command.ActiveMQMessage.visit(ActiveMQMessage.java:604)
	at
org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:284)
	at
org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:177)
	at
org.apache.activemq.transport.ResponseCorrelator.onCommand(ResponseCorrelator.java:95)
	at
org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:65)
	at
org.apache.activemq.transport.vm.VMTransport.syncOneWay(VMTransport.java:96)
	at org.apache.activemq.transport.vm.VMTransport.oneway(VMTransport.java:83)
	at
org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java:43)
	at
org.apache.activemq.transport.ResponseCorrelator.asyncRequest(ResponseCorrelator.java:69)
	at
org.apache.activemq.transport.ResponseCorrelator.request(ResponseCorrelator.java:74)
	at
org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1171)
	at org.apache.activemq.ActiveMQSession.send(ActiveMQSession.java:1548)
	at
org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProducer.java:465)
	at org.apache.activemq.pool.PooledProducer.send(PooledProducer.java:75)
	at org.apache.activemq.pool.PooledProducer.send(PooledProducer.java:60)
	at org.springframework.jms.core.JmsTemplate.doSend(JmsTemplate.java:522)
	at org.springframework.jms.core.JmsTemplate.doSend(JmsTemplate.java:504)
	at org.springframework.jms.core.JmsTemplate$3.doInJms(JmsTemplate.java:489)
	at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:432)
	at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:486)
	at
com.mma.event.client.EventQueueClient.sendEvent(EventQueueClient.java:51)
	at
com.mma.service.impl.CommunicationServiceImpl.sendEmail(CommunicationServiceImpl.java:100)
	at
com.mma.test.service.impl.CommunicationServiceImplTest.testSendEmail(CommunicationServiceImplTest.java:28)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at junit.framework.TestCase.runTest(TestCase.java:154)
	at junit.framework.TestCase.runBare(TestCase.java:127)
	at junit.framework.TestResult$1.protect(TestResult.java:106)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.framework.TestResult.run(TestResult.java:109)
	at junit.framework.TestCase.run(TestCase.java:118)
	at junit.framework.TestSuite.runTest(TestSuite.java:208)
	at junit.framework.TestSuite.run(TestSuite.java:203)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: java.io.NotSerializableException: javax.mail.internet.MimeMessage
	at java.io.ObjectOutputStream.writeObject0(Unknown Source)
	at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
	at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
	at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
	at java.io.ObjectOutputStream.writeObject0(Unknown Source)
	at java.io.ObjectOutputStream.writeObject(Unknown Source)
	at
org.apache.activemq.command.ActiveMQObjectMessage.storeContent(ActiveMQObjectMessage.java:96)
	... 63 more
10:43:38,043 [main] ERROR EventQueueClient:53 - Uncategorized exception
occured during JMS processing; nested exception is javax.jms.JMSException:
javax.mail.internet.MimeMessage; nested exception is javax.jms.JMSException:
javax.mail.internet.MimeMessage
org.springframework.jms.UncategorizedJmsException: Uncategorized exception
occured during JMS processing; nested exception is javax.jms.JMSException:
javax.mail.internet.MimeMessage; nested exception is javax.jms.JMSException:
javax.mail.internet.MimeMessage
javax.jms.JMSException: javax.mail.internet.MimeMessage
	at
org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:46)
	at
org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1177)
	at org.apache.activemq.ActiveMQSession.send(ActiveMQSession.java:1548)
	at
org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProducer.java:465)
	at org.apache.activemq.pool.PooledProducer.send(PooledProducer.java:75)
	at org.apache.activemq.pool.PooledProducer.send(PooledProducer.java:60)
	at org.springframework.jms.core.JmsTemplate.doSend(JmsTemplate.java:522)
	at org.springframework.jms.core.JmsTemplate.doSend(JmsTemplate.java:504)
	at org.springframework.jms.core.JmsTemplate$3.doInJms(JmsTemplate.java:489)
	at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:432)
	at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:486)
	at
com.mma.event.client.EventQueueClient.sendEvent(EventQueueClient.java:51)
	at
com.mma.service.impl.CommunicationServiceImpl.sendEmail(CommunicationServiceImpl.java:100)
	at
com.mma.test.service.impl.CommunicationServiceImplTest.testSendEmail(CommunicationServiceImplTest.java:28)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at junit.framework.TestCase.runTest(TestCase.java:154)
	at junit.framework.TestCase.runBare(TestCase.java:127)
	at junit.framework.TestResult$1.protect(TestResult.java:106)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.framework.TestResult.run(TestResult.java:109)
	at junit.framework.TestCase.run(TestCase.java:118)
	at junit.framework.TestSuite.runTest(TestSuite.java:208)
	at junit.framework.TestSuite.run(TestSuite.java:203)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: java.lang.RuntimeException: javax.mail.internet.MimeMessage
	at
org.apache.activemq.command.ActiveMQObjectMessage.storeContent(ActiveMQObjectMessage.java:102)
	at
org.apache.activemq.command.ActiveMQObjectMessage.copy(ActiveMQObjectMessage.java:78)
	at
org.apache.activemq.command.ActiveMQObjectMessage.copy(ActiveMQObjectMessage.java:73)
	at
org.apache.activemq.ActiveMQConnection.onCommand(ActiveMQConnection.java:1466)
	at
org.apache.activemq.transport.ResponseCorrelator.onCommand(ResponseCorrelator.java:95)
	at
org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:65)
	at
org.apache.activemq.transport.vm.VMTransport.syncOneWay(VMTransport.java:96)
	at org.apache.activemq.transport.vm.VMTransport.oneway(VMTransport.java:83)
	at
org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java:43)
	at
org.apache.activemq.transport.ResponseCorrelator.oneway(ResponseCorrelator.java:60)
	at
org.apache.activemq.broker.TransportConnection.dispatch(TransportConnection.java:1051)
	at
org.apache.activemq.broker.TransportConnection.processDispatch(TransportConnection.java:772)
	at
org.apache.activemq.broker.TransportConnection.dispatchSync(TransportConnection.java:749)
	at
org.apache.activemq.broker.region.PrefetchSubscription.dispatch(PrefetchSubscription.java:404)
	at
org.apache.activemq.broker.region.QueueSubscription.dispatch(QueueSubscription.java:172)
	at
org.apache.activemq.broker.region.PrefetchSubscription.add(PrefetchSubscription.java:129)
	at
org.apache.activemq.broker.region.policy.RoundRobinDispatchPolicy.dispatch(RoundRobinDispatchPolicy.java:54)
	at org.apache.activemq.broker.region.Queue.dispatch(Queue.java:472)
	at org.apache.activemq.broker.region.Queue.send(Queue.java:298)
	at
org.apache.activemq.broker.region.AbstractRegion.send(AbstractRegion.java:292)
	at
org.apache.activemq.broker.region.RegionBroker.send(RegionBroker.java:377)
	at
org.apache.activemq.broker.TransactionBroker.send(TransactionBroker.java:193)
	at org.apache.activemq.broker.BrokerFilter.send(BrokerFilter.java:126)
	at
org.apache.activemq.broker.CompositeDestinationBroker.send(CompositeDestinationBroker.java:98)
	at
org.apache.activemq.broker.MutableBrokerFilter.send(MutableBrokerFilter.java:136)
	at
org.apache.activemq.broker.TransportConnection.processMessage(TransportConnection.java:480)
	at
org.apache.activemq.command.ActiveMQMessage.visit(ActiveMQMessage.java:604)
	at
org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:284)
	at
org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:177)
	at
org.apache.activemq.transport.ResponseCorrelator.onCommand(ResponseCorrelator.java:95)
	at
org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:65)
	at
org.apache.activemq.transport.vm.VMTransport.syncOneWay(VMTransport.java:96)
	at org.apache.activemq.transport.vm.VMTransport.oneway(VMTransport.java:83)
	at
org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java:43)
	at
org.apache.activemq.transport.ResponseCorrelator.asyncRequest(ResponseCorrelator.java:69)
	at
org.apache.activemq.transport.ResponseCorrelator.request(ResponseCorrelator.java:74)
	at
org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1171)
	... 27 more
Caused by: java.io.NotSerializableException: javax.mail.internet.MimeMessage
	at java.io.ObjectOutputStream.writeObject0(Unknown Source)
	at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
	at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
	at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
	at java.io.ObjectOutputStream.writeObject0(Unknown Source)
	at java.io.ObjectOutputStream.writeObject(Unknown Source)
	at
org.apache.activemq.command.ActiveMQObjectMessage.storeContent(ActiveMQObjectMessage.java:96)
	... 63 more
com.mma.event.client.EventSendingException: Uncategorized exception occured
during JMS processing; nested exception is javax.jms.JMSException:
javax.mail.internet.MimeMessage; nested exception is javax.jms.JMSException:
javax.mail.internet.MimeMessage
	at
com.mma.event.client.EventQueueClient.sendEvent(EventQueueClient.java:54)
	at
com.mma.service.impl.CommunicationServiceImpl.sendEmail(CommunicationServiceImpl.java:100)
	at
com.mma.test.service.impl.CommunicationServiceImplTest.testSendEmail(CommunicationServiceImplTest.java:28)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at junit.framework.TestCase.runTest(TestCase.java:154)
	at junit.framework.TestCase.runBare(TestCase.java:127)
	at junit.framework.TestResult$1.protect(TestResult.java:106)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.framework.TestResult.run(TestResult.java:109)
	at junit.framework.TestCase.run(TestCase.java:118)
	at junit.framework.TestSuite.runTest(TestSuite.java:208)
	at junit.framework.TestSuite.run(TestSuite.java:203)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: org.springframework.jms.UncategorizedJmsException: Uncategorized
exception occured during JMS processing; nested exception is
javax.jms.JMSException: javax.mail.internet.MimeMessage; nested exception is
javax.jms.JMSException: javax.mail.internet.MimeMessage
	at
org.springframework.jms.support.JmsUtils.convertJmsAccessException(JmsUtils.java:183)
	at
org.springframework.jms.support.JmsAccessor.convertJmsAccessException(JmsAccessor.java:147)
	at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:435)
	at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:486)
	at
com.mma.event.client.EventQueueClient.sendEvent(EventQueueClient.java:51)
	... 17 more
Caused by: javax.jms.JMSException: javax.mail.internet.MimeMessage
	at
org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:46)
	at
org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1177)
	at org.apache.activemq.ActiveMQSession.send(ActiveMQSession.java:1548)
	at
org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProducer.java:465)
	at org.apache.activemq.pool.PooledProducer.send(PooledProducer.java:75)
	at org.apache.activemq.pool.PooledProducer.send(PooledProducer.java:60)
	at org.springframework.jms.core.JmsTemplate.doSend(JmsTemplate.java:522)
	at org.springframework.jms.core.JmsTemplate.doSend(JmsTemplate.java:504)
	at org.springframework.jms.core.JmsTemplate$3.doInJms(JmsTemplate.java:489)
	at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:432)
	... 19 more
Caused by: java.lang.RuntimeException: javax.mail.internet.MimeMessage
	at
org.apache.activemq.command.ActiveMQObjectMessage.storeContent(ActiveMQObjectMessage.java:102)
	at
org.apache.activemq.command.ActiveMQObjectMessage.copy(ActiveMQObjectMessage.java:78)
	at
org.apache.activemq.command.ActiveMQObjectMessage.copy(ActiveMQObjectMessage.java:73)
	at
org.apache.activemq.ActiveMQConnection.onCommand(ActiveMQConnection.java:1466)
	at
org.apache.activemq.transport.ResponseCorrelator.onCommand(ResponseCorrelator.java:95)
	at
org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:65)
	at
org.apache.activemq.transport.vm.VMTransport.syncOneWay(VMTransport.java:96)
	at org.apache.activemq.transport.vm.VMTransport.oneway(VMTransport.java:83)
	at
org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java:43)
	at
org.apache.activemq.transport.ResponseCorrelator.oneway(ResponseCorrelator.java:60)
	at
org.apache.activemq.broker.TransportConnection.dispatch(TransportConnection.java:1051)
	at
org.apache.activemq.broker.TransportConnection.processDispatch(TransportConnection.java:772)
	at
org.apache.activemq.broker.TransportConnection.dispatchSync(TransportConnection.java:749)
	at
org.apache.activemq.broker.region.PrefetchSubscription.dispatch(PrefetchSubscription.java:404)
	at
org.apache.activemq.broker.region.QueueSubscription.dispatch(QueueSubscription.java:172)
	at
org.apache.activemq.broker.region.PrefetchSubscription.add(PrefetchSubscription.java:129)
	at
org.apache.activemq.broker.region.policy.RoundRobinDispatchPolicy.dispatch(RoundRobinDispatchPolicy.java:54)
	at org.apache.activemq.broker.region.Queue.dispatch(Queue.java:472)
	at org.apache.activemq.broker.region.Queue.send(Queue.java:298)
	at
org.apache.activemq.broker.region.AbstractRegion.send(AbstractRegion.java:292)
	at
org.apache.activemq.broker.region.RegionBroker.send(RegionBroker.java:377)
	at
org.apache.activemq.broker.TransactionBroker.send(TransactionBroker.java:193)
	at org.apache.activemq.broker.BrokerFilter.send(BrokerFilter.java:126)
	at
org.apache.activemq.broker.CompositeDestinationBroker.send(CompositeDestinationBroker.java:98)
	at
org.apache.activemq.broker.MutableBrokerFilter.send(MutableBrokerFilter.java:136)
	at
org.apache.activemq.broker.TransportConnection.processMessage(TransportConnection.java:480)
	at
org.apache.activemq.command.ActiveMQMessage.visit(ActiveMQMessage.java:604)
	at
org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:284)
	at
org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:177)
	at
org.apache.activemq.transport.ResponseCorrelator.onCommand(ResponseCorrelator.java:95)
	at
org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:65)
	at
org.apache.activemq.transport.vm.VMTransport.syncOneWay(VMTransport.java:96)
	at org.apache.activemq.transport.vm.VMTransport.oneway(VMTransport.java:83)
	at
org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java:43)
	at
org.apache.activemq.transport.ResponseCorrelator.asyncRequest(ResponseCorrelator.java:69)
	at
org.apache.activemq.transport.ResponseCorrelator.request(ResponseCorrelator.java:74)
	at
org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1171)
	... 27 more
Caused by: java.io.NotSerializableException: javax.mail.internet.MimeMessage
	at java.io.ObjectOutputStream.writeObject0(Unknown Source)
	at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
	at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
	at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
	at java.io.ObjectOutputStream.writeObject0(Unknown Source)
	at java.io.ObjectOutputStream.writeObject(Unknown Source)
	at
org.apache.activemq.command.ActiveMQObjectMessage.storeContent(ActiveMQObjectMessage.java:96)
	... 63 more



James.Strachan wrote:
> 
> On 1/16/07, magic.moose <ma...@avedya.com> wrote:
>>
>> thank you,
>>
>> you're right, I forgot to turn the persistance off.
>> Anyway,
>> vm://localhost?broker.persistent=false disables persistance, no more db
>> (derby?) is used, no ddl executed. Is there something more I can do about
>> that?
> 
> Your producer really should specify the DeliveryMode of
> NON_PERSISTENT. Setting the broker to persistent=false just makes it
> use a VM (RAM) based persistence implementation, not to disable
> persistence per se. i.e. it means don't use JDBC or the journal.
> 
> 
>> I thought that maybe JmsTemplate overides global connectionFactory
>> setting
>> for each send and so I set deliveryPersistent to false.
> 
> Yes, the delivery mode is set on the producer (which JmsTemplate creates)
> 
> 
>> Still, I got the same serialization exception when Activemq tries to
>> storeContent.
>>
>> any clue?
> 
> Do you have a full stack trace? I'm not sure how easy its gonna be to
> never, ever, try to persist the message to some file at some point
> (e.g. if the broker is running low on RAM it can spool messages to
> disk) - so a more JMS-complaint solution to your problem might be to
> implement Externalizable or something.
> 
> 
> -- 
> 
> James
> -------
> http://radio.weblogs.com/0112098/
> 
> 



James.Strachan wrote:
> 
> On 1/16/07, magic.moose <ma...@avedya.com> wrote:
>>
>> thank you,
>>
>> you're right, I forgot to turn the persistance off.
>> Anyway,
>> vm://localhost?broker.persistent=false disables persistance, no more db
>> (derby?) is used, no ddl executed. Is there something more I can do about
>> that?
> 
> Your producer really should specify the DeliveryMode of
> NON_PERSISTENT. Setting the broker to persistent=false just makes it
> use a VM (RAM) based persistence implementation, not to disable
> persistence per se. i.e. it means don't use JDBC or the journal.
> 
> 
>> I thought that maybe JmsTemplate overides global connectionFactory
>> setting
>> for each send and so I set deliveryPersistent to false.
> 
> Yes, the delivery mode is set on the producer (which JmsTemplate creates)
> 
> 
>> Still, I got the same serialization exception when Activemq tries to
>> storeContent.
>>
>> any clue?
> 
> Do you have a full stack trace? I'm not sure how easy its gonna be to
> never, ever, try to persist the message to some file at some point
> (e.g. if the broker is running low on RAM it can spool messages to
> disk) - so a more JMS-complaint solution to your problem might be to
> implement Externalizable or something.
> 
> 
> -- 
> 
> James
> -------
> http://radio.weblogs.com/0112098/
> 
> 

-- 
View this message in context: http://www.nabble.com/Can%27t-turn-ObjectMessage-serialization-OFF%21%21-tf3016083.html#a8386790
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Can't turn ObjectMessage serialization OFF!!

Posted by James Strachan <ja...@gmail.com>.
On 1/16/07, magic.moose <ma...@avedya.com> wrote:
>
> thank you,
>
> you're right, I forgot to turn the persistance off.
> Anyway,
> vm://localhost?broker.persistent=false disables persistance, no more db
> (derby?) is used, no ddl executed. Is there something more I can do about
> that?

Your producer really should specify the DeliveryMode of
NON_PERSISTENT. Setting the broker to persistent=false just makes it
use a VM (RAM) based persistence implementation, not to disable
persistence per se. i.e. it means don't use JDBC or the journal.


> I thought that maybe JmsTemplate overides global connectionFactory setting
> for each send and so I set deliveryPersistent to false.

Yes, the delivery mode is set on the producer (which JmsTemplate creates)


> Still, I got the same serialization exception when Activemq tries to
> storeContent.
>
> any clue?

Do you have a full stack trace? I'm not sure how easy its gonna be to
never, ever, try to persist the message to some file at some point
(e.g. if the broker is running low on RAM it can spool messages to
disk) - so a more JMS-complaint solution to your problem might be to
implement Externalizable or something.


-- 

James
-------
http://radio.weblogs.com/0112098/

Re: Can't turn ObjectMessage serialization OFF!!

Posted by "magic.moose" <ma...@avedya.com>.

I just traced this log. It still says persistent = true !! I've no idea
why...

Sending message: ActiveMQObjectMessage {commandId = 0, responseRequired =
false, messageId = ID:mdesktop-4340-1168937587996-2:3:1:1:1,
originalDestination = null, originalTransactionId = null, producerId =
ID:mdesktop-4340-1168937587996-2:3:1:1, destination = queue://eventQueue,
transactionId = null, expiration = 0, timestamp = 1168937589512, arrival =
0, correlationId = null, replyTo = null, persistent = true, type = null,
priority = 4, groupID = null, groupSequence = 0, targetConsumerId = null,
compressed = false, userID = null, content = null, marshalledProperties =
null, dataStructure = null, redeliveryCounter = 0, size = 0, properties =
null, readOnlyProperties = true, readOnlyBody = true, droppable = false}


magic.moose wrote:
> 
> thank you,
> 
> you're right, I forgot to turn the persistance off.
> Anyway,
> vm://localhost?broker.persistent=false disables persistance, no more db
> (derby?) is used, no ddl executed. Is there something more I can do about
> that?
> I thought that maybe JmsTemplate overides global connectionFactory setting
> for each send and so I set deliveryPersistent to false.
> 
> Still, I got the same serialization exception when Activemq tries to
> storeContent.
> 
> any clue?
> maciek
> 
> 
> James.Strachan wrote:
>> 
>> Are you using non-persistent messaging? Otherwise your messages will
>> get written to disk as part of the serialization effort in the broker,
>> irrespective of whether or not you are serializing in the transport
>> layer.
>> 
>> 
>> On 1/15/07, magic.moose <ma...@avedya.com> wrote:
>>>
>>> Hey all,
>>>
>>> AcitveMQ 4.1.0, Jencks 1.1
>>>
>>> I'm trying not to serialized ObjectMessage content while using jvm
>>> transport. I can't force connectionFactory (or something else) to stop
>>> serializing.
>>>
>>> This is how the Spring conf looks like:
>>>
>>>         <bean id="connectionFactory"
>>> class="org.apache.activemq.ActiveMQConnectionFactory">
>>>                 <property name="brokerURL">
>>>                         <value>vm://localhost</value>
>>>                 </property>
>>>                 <property name="objectMessageSerializationDefered">
>>>                         <value>true</value>
>>>                 </property>
>>>         </bean>
>>>
>>>         <bean id="jmsResourceAdapter"
>>> class="org.apache.activemq.ra.ActiveMQResourceAdapter">
>>>                 <property name="connectionFactory"
>>> ref="connectionFactory"/>
>>>         </bean>
>>>
>>>
>>>         <bean id="jencks" class="org.jencks.JCAContainer">
>>>                 <property name="bootstrapContext">
>>>                         <bean
>>> class="org.jencks.factory.BootstrapContextFactoryBean">
>>>                                 <property name="threadPoolSize"
>>> value="5"/>
>>>                         </bean>
>>>                 </property>
>>>                 <property name="resourceAdapter">
>>>                         <ref bean="jmsResourceAdapter"/>
>>>                 </property>
>>>         </bean>
>>>
>>>         <bean id="eventQueueConsumer" class="org.jencks.JCAConnector">
>>>                 <property name="jcaContainer" ref="jencks" />
>>>
>>>                 <property name="activationSpec">
>>>                         <bean
>>> class="org.apache.activemq.ra.ActiveMQActivationSpec">
>>>                                 <property name="destination"
>>> value="eventQueue" />
>>>                                 <property name="destinationType"
>>> value="javax.jms.Queue" />
>>>                         </bean>
>>>                 </property>
>>>                 <property name="ref" value="dispatcher" />
>>>         </bean>
>>>
>>> <!-- for sending-->
>>>         <bean id="jmsFactory"
>>>                
>>> class="org.apache.activemq.pool.PooledConnectionFactory">
>>>                 <property name="connectionFactory"
>>> ref="connectionFactory"/>
>>>         </bean>
>>>
>>>
>>>         <bean id="eventSender"
>>>                
>>> class="com.avedya.zapzone2.eventframework.client.EventQueueClient"
>>>                 singleton="true">
>>>                 <property name="jmsTemplate">
>>>                         <bean
>>> class="org.springframework.jms.core.JmsTemplate">
>>>                                 <property name="connectionFactory">
>>>                                         <ref local="connectionFactory"
>>> />
>>>                                 </property>
>>>                         </bean>
>>>                 </property>
>>>                 <property name="queueName">
>>>                         <value>eventQueue</value>
>>>                 </property>
>>>
>>>         </bean>
>>>
>>> </beans>
>>>
>>> The eventSender class uses MessageCreator:
>>>
>>>    private class ObjectMessageCreator implements MessageCreator{
>>>
>>>                 private Serializable object;
>>>
>>>                 public ObjectMessageCreator(Serializable object){
>>>                         this.object = object;
>>>                 }
>>>
>>>                 public Message createMessage(Session session) throws
>>> JMSException {
>>>                         ObjectMessage msg =
>>> session.createObjectMessage();
>>>                         msg.setObject(object);
>>>                         return msg;
>>>                 }
>>>
>>>         }
>>>
>>> and sends using:
>>>
>>>        jmsTemplate.send(queueName,new ObjectMessageCreator(event));
>>>
>>> what I get is:
>>>
>>> Caused by: java.io.NotSerializableException:
>>> javax.mail.internet.MimeMessage
>>>         at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>>>         at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
>>>         at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
>>>         at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown
>>> Source)
>>>         at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>>>         at java.io.ObjectOutputStream.writeObject(Unknown Source)
>>>         at
>>> org.apache.activemq.command.ActiveMQObjectMessage.storeContent(ActiveMQObjectMessage.java:96)
>>>
>>> where MimeMessage is a part of serializable Object being sent.
>>>
>>> Perhaps I do something wrong. I took me a while to figure out how to
>>> force
>>> resourceAdpater to use given connectionFactory so I know there is a lot
>>> of
>>> things I dont know about ActiveMq. Anyway, seems like setting
>>> objectMessageSerializationDefered doesnt really do the trick.
>>>
>>> I appreciate your help.
>>> m.
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Can%27t-turn-ObjectMessage-serialization-OFF%21%21-tf3016083.html#a8375884
>>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>>
>>>
>> 
>> 
>> -- 
>> 
>> James
>> -------
>> http://radio.weblogs.com/0112098/
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Can%27t-turn-ObjectMessage-serialization-OFF%21%21-tf3016083.html#a8386583
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Can't turn ObjectMessage serialization OFF!!

Posted by "magic.moose" <ma...@avedya.com>.
thank you,

you're right, I forgot to turn the persistance off.
Anyway,
vm://localhost?broker.persistent=false disables persistance, no more db
(derby?) is used, no ddl executed. Is there something more I can do about
that?
I thought that maybe JmsTemplate overides global connectionFactory setting
for each send and so I set deliveryPersistent to false.

Still, I got the same serialization exception when Activemq tries to
storeContent.

any clue?
maciek


James.Strachan wrote:
> 
> Are you using non-persistent messaging? Otherwise your messages will
> get written to disk as part of the serialization effort in the broker,
> irrespective of whether or not you are serializing in the transport
> layer.
> 
> 
> On 1/15/07, magic.moose <ma...@avedya.com> wrote:
>>
>> Hey all,
>>
>> AcitveMQ 4.1.0, Jencks 1.1
>>
>> I'm trying not to serialized ObjectMessage content while using jvm
>> transport. I can't force connectionFactory (or something else) to stop
>> serializing.
>>
>> This is how the Spring conf looks like:
>>
>>         <bean id="connectionFactory"
>> class="org.apache.activemq.ActiveMQConnectionFactory">
>>                 <property name="brokerURL">
>>                         <value>vm://localhost</value>
>>                 </property>
>>                 <property name="objectMessageSerializationDefered">
>>                         <value>true</value>
>>                 </property>
>>         </bean>
>>
>>         <bean id="jmsResourceAdapter"
>> class="org.apache.activemq.ra.ActiveMQResourceAdapter">
>>                 <property name="connectionFactory"
>> ref="connectionFactory"/>
>>         </bean>
>>
>>
>>         <bean id="jencks" class="org.jencks.JCAContainer">
>>                 <property name="bootstrapContext">
>>                         <bean
>> class="org.jencks.factory.BootstrapContextFactoryBean">
>>                                 <property name="threadPoolSize"
>> value="5"/>
>>                         </bean>
>>                 </property>
>>                 <property name="resourceAdapter">
>>                         <ref bean="jmsResourceAdapter"/>
>>                 </property>
>>         </bean>
>>
>>         <bean id="eventQueueConsumer" class="org.jencks.JCAConnector">
>>                 <property name="jcaContainer" ref="jencks" />
>>
>>                 <property name="activationSpec">
>>                         <bean
>> class="org.apache.activemq.ra.ActiveMQActivationSpec">
>>                                 <property name="destination"
>> value="eventQueue" />
>>                                 <property name="destinationType"
>> value="javax.jms.Queue" />
>>                         </bean>
>>                 </property>
>>                 <property name="ref" value="dispatcher" />
>>         </bean>
>>
>> <!-- for sending-->
>>         <bean id="jmsFactory"
>>                 class="org.apache.activemq.pool.PooledConnectionFactory">
>>                 <property name="connectionFactory"
>> ref="connectionFactory"/>
>>         </bean>
>>
>>
>>         <bean id="eventSender"
>>                
>> class="com.avedya.zapzone2.eventframework.client.EventQueueClient"
>>                 singleton="true">
>>                 <property name="jmsTemplate">
>>                         <bean
>> class="org.springframework.jms.core.JmsTemplate">
>>                                 <property name="connectionFactory">
>>                                         <ref local="connectionFactory" />
>>                                 </property>
>>                         </bean>
>>                 </property>
>>                 <property name="queueName">
>>                         <value>eventQueue</value>
>>                 </property>
>>
>>         </bean>
>>
>> </beans>
>>
>> The eventSender class uses MessageCreator:
>>
>>    private class ObjectMessageCreator implements MessageCreator{
>>
>>                 private Serializable object;
>>
>>                 public ObjectMessageCreator(Serializable object){
>>                         this.object = object;
>>                 }
>>
>>                 public Message createMessage(Session session) throws
>> JMSException {
>>                         ObjectMessage msg =
>> session.createObjectMessage();
>>                         msg.setObject(object);
>>                         return msg;
>>                 }
>>
>>         }
>>
>> and sends using:
>>
>>        jmsTemplate.send(queueName,new ObjectMessageCreator(event));
>>
>> what I get is:
>>
>> Caused by: java.io.NotSerializableException:
>> javax.mail.internet.MimeMessage
>>         at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>>         at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
>>         at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
>>         at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
>>         at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>>         at java.io.ObjectOutputStream.writeObject(Unknown Source)
>>         at
>> org.apache.activemq.command.ActiveMQObjectMessage.storeContent(ActiveMQObjectMessage.java:96)
>>
>> where MimeMessage is a part of serializable Object being sent.
>>
>> Perhaps I do something wrong. I took me a while to figure out how to
>> force
>> resourceAdpater to use given connectionFactory so I know there is a lot
>> of
>> things I dont know about ActiveMq. Anyway, seems like setting
>> objectMessageSerializationDefered doesnt really do the trick.
>>
>> I appreciate your help.
>> m.
>> --
>> View this message in context:
>> http://www.nabble.com/Can%27t-turn-ObjectMessage-serialization-OFF%21%21-tf3016083.html#a8375884
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> 
> James
> -------
> http://radio.weblogs.com/0112098/
> 
> 

-- 
View this message in context: http://www.nabble.com/Can%27t-turn-ObjectMessage-serialization-OFF%21%21-tf3016083.html#a8386368
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Can't turn ObjectMessage serialization OFF!!

Posted by James Strachan <ja...@gmail.com>.
Are you using non-persistent messaging? Otherwise your messages will
get written to disk as part of the serialization effort in the broker,
irrespective of whether or not you are serializing in the transport
layer.


On 1/15/07, magic.moose <ma...@avedya.com> wrote:
>
> Hey all,
>
> AcitveMQ 4.1.0, Jencks 1.1
>
> I'm trying not to serialized ObjectMessage content while using jvm
> transport. I can't force connectionFactory (or something else) to stop
> serializing.
>
> This is how the Spring conf looks like:
>
>         <bean id="connectionFactory"
> class="org.apache.activemq.ActiveMQConnectionFactory">
>                 <property name="brokerURL">
>                         <value>vm://localhost</value>
>                 </property>
>                 <property name="objectMessageSerializationDefered">
>                         <value>true</value>
>                 </property>
>         </bean>
>
>         <bean id="jmsResourceAdapter"
> class="org.apache.activemq.ra.ActiveMQResourceAdapter">
>                 <property name="connectionFactory" ref="connectionFactory"/>
>         </bean>
>
>
>         <bean id="jencks" class="org.jencks.JCAContainer">
>                 <property name="bootstrapContext">
>                         <bean class="org.jencks.factory.BootstrapContextFactoryBean">
>                                 <property name="threadPoolSize" value="5"/>
>                         </bean>
>                 </property>
>                 <property name="resourceAdapter">
>                         <ref bean="jmsResourceAdapter"/>
>                 </property>
>         </bean>
>
>         <bean id="eventQueueConsumer" class="org.jencks.JCAConnector">
>                 <property name="jcaContainer" ref="jencks" />
>
>                 <property name="activationSpec">
>                         <bean class="org.apache.activemq.ra.ActiveMQActivationSpec">
>                                 <property name="destination" value="eventQueue" />
>                                 <property name="destinationType" value="javax.jms.Queue" />
>                         </bean>
>                 </property>
>                 <property name="ref" value="dispatcher" />
>         </bean>
>
> <!-- for sending-->
>         <bean id="jmsFactory"
>                 class="org.apache.activemq.pool.PooledConnectionFactory">
>                 <property name="connectionFactory" ref="connectionFactory"/>
>         </bean>
>
>
>         <bean id="eventSender"
>                 class="com.avedya.zapzone2.eventframework.client.EventQueueClient"
>                 singleton="true">
>                 <property name="jmsTemplate">
>                         <bean class="org.springframework.jms.core.JmsTemplate">
>                                 <property name="connectionFactory">
>                                         <ref local="connectionFactory" />
>                                 </property>
>                         </bean>
>                 </property>
>                 <property name="queueName">
>                         <value>eventQueue</value>
>                 </property>
>
>         </bean>
>
> </beans>
>
> The eventSender class uses MessageCreator:
>
>    private class ObjectMessageCreator implements MessageCreator{
>
>                 private Serializable object;
>
>                 public ObjectMessageCreator(Serializable object){
>                         this.object = object;
>                 }
>
>                 public Message createMessage(Session session) throws JMSException {
>                         ObjectMessage msg = session.createObjectMessage();
>                         msg.setObject(object);
>                         return msg;
>                 }
>
>         }
>
> and sends using:
>
>        jmsTemplate.send(queueName,new ObjectMessageCreator(event));
>
> what I get is:
>
> Caused by: java.io.NotSerializableException: javax.mail.internet.MimeMessage
>         at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>         at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
>         at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
>         at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
>         at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>         at java.io.ObjectOutputStream.writeObject(Unknown Source)
>         at
> org.apache.activemq.command.ActiveMQObjectMessage.storeContent(ActiveMQObjectMessage.java:96)
>
> where MimeMessage is a part of serializable Object being sent.
>
> Perhaps I do something wrong. I took me a while to figure out how to force
> resourceAdpater to use given connectionFactory so I know there is a lot of
> things I dont know about ActiveMq. Anyway, seems like setting
> objectMessageSerializationDefered doesnt really do the trick.
>
> I appreciate your help.
> m.
> --
> View this message in context: http://www.nabble.com/Can%27t-turn-ObjectMessage-serialization-OFF%21%21-tf3016083.html#a8375884
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>


-- 

James
-------
http://radio.weblogs.com/0112098/