activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Newsham <jnews...@referentia.com>
Subject Re: can't deserialize proxy instance with non-jdk interface
Date Fri, 12 Nov 2010 20:06:41 GMT

Anyone have any idea whether this might be user error or a problem with 
ActiveMQ?  If it's the latter I can open a JIRA issue.

Thanks,
Jim

On 11/9/2010 5:19 PM, Jim Newsham wrote:
>
> P.S.  ActiveMQ 5.3.2, Camel 2.4.0.  I'm running both embedded (i.e., 
> starting up in Java code), and no custom class loaders (no osgi, 
> spring, or anything fancy).  As stated before, the classes (proxy, 
> non-proxy, interfaces) are all in the same (global) classpath.
>
> Jim
>
> On 11/9/2010 5:15 PM, Jim Newsham wrote:
>>
>> Hi,
>>
>> I just ran into a class loading exception when trying to serialize a 
>> proxy instance (an instance of java.lang.reflect.Proxy).  I have no 
>> problems serializing our non-proxy objects.  My proxy handler class 
>> is serializable (as required) and located in the same class path as 
>> the non-proxy classes.  I have found that if I construct my proxy 
>> using jdk interfaces only (i.e., java.util.Collection), then it 
>> works, but if I use one of our own interfaces, ActiveMQ fails to load 
>> it as follows:
>>
>> Caused by: java.lang.IllegalArgumentException: interface 
>> com.referentia.liveaction.common.core.camel.clientstream.StreamIdProvider 
>> is not visible from class loader
>>     at java.lang.reflect.Proxy.getProxyClass(Proxy.java:353)
>>     at 
>> org.apache.activemq.util.ClassLoadingAwareObjectInputStream.resolveProxyClass(ClassLoadingAwareObjectInputStream.java:48)
>>     ... 34 more
>>
>> Here's the entire stack trace:
>>
>> 2010-11-09 17:02:37,660 [DefaultMessageListenerContainer-1] WARN  
>> org.springframework.jms.listener.DefaultMessageListenerContainer - 
>> Execution of JMS message listener failed
>> org.apache.camel.RuntimeCamelException: Failed to extract body due 
>> to: javax.jms.JMSException: Failed to build body from content. 
>> Serializable class not available to broker. Reason: 
>> java.lang.ClassNotFoundException. Message: ActiveMQObjectMessage 
>> {commandId = 19, responseRequired = true, messageId = 
>> ID:rsi-eng-newsham-56811-1289358131963-0:2:3:1:3, originalDestination 
>> = null, originalTransactionId = null, producerId = 
>> ID:rsi-eng-newsham-56811-1289358131963-0:2:3:1, destination = 
>> queue://ServiceExport, transactionId = null, expiration = 
>> 1289358177656, timestamp = 1289358157656, arrival = 0, brokerInTime = 
>> 1289358157656, brokerOutTime = 1289358157658, correlationId = 
>> 215512f0-0d7e-4f3c-8cc2-5e459d59b582, replyTo = 
>> temp-queue://ID:rsi-eng-newsham-56811-1289358131963-0:2:1, persistent 
>> = true, type = null, priority = 4, groupID = null, groupSequence = 0, 
>> targetConsumerId = null, compressed = false, userID = null, content = 
>> org.apache.activemq.util.ByteSequence@115e628, marshalledProperties = 
>> org.apache.activemq.util.ByteSequence@b977bc, dataStructure = null, 
>> redeliveryCounter = 0, size = 1860, properties = 
>> {sessionId=04fd4b1b-0a01-40f7-8bf8-fda514c773e9}, readOnlyProperties 
>> = true, readOnlyBody = true, droppable = false}
>>     at 
>> org.apache.camel.component.jms.JmsBinding.extractBodyFromJms(JmsBinding.java:158)
>>     at 
>> org.apache.camel.component.jms.JmsMessage.createBody(JmsMessage.java:183)
>>     at 
>> org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:42)
>>     at 
>> org.apache.camel.impl.DefaultUnitOfWork.<init>(DefaultUnitOfWork.java:65)
>>     at 
>> org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:90)
>>     at 
>> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
>>     at 
>> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
>>     at 
>> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
>>     at 
>> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
>>     at 
>> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:91)
>>     at 
>> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:85)
>>     at 
>> org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:85)
>>     at 
>> org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:543)
>>     at 
>> org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:482)
>>     at 
>> org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:451)
>>     at 
>> org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:323)
>>     at 
>> org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:261)
>>     at 
>> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:982)
>>     at 
>> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:974)
>>     at 
>> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:876)
>>     at java.lang.Thread.run(Thread.java:662)
>> Caused by: javax.jms.JMSException: Failed to build body from content. 
>> Serializable class not available to broker. Reason: 
>> java.lang.ClassNotFoundException
>>     at 
>> org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:35)
>>     at 
>> org.apache.activemq.command.ActiveMQObjectMessage.getObject(ActiveMQObjectMessage.java:179)
>>     at 
>> org.apache.camel.component.jms.JmsBinding.extractBodyFromJms(JmsBinding.java:125)
>>     ... 20 more
>> Caused by: java.lang.ClassNotFoundException
>>     at 
>> org.apache.activemq.util.ClassLoadingAwareObjectInputStream.resolveProxyClass(ClassLoadingAwareObjectInputStream.java:50)
>>     at 
>> java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1530)
>>     at 
>> java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1492)
>>     at 
>> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1731)
>>     at 
>> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
>>     at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1666)
>>     at 
>> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1322)
>>     at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
>>     at 
>> org.apache.camel.component.bean.BeanInvocation.readExternal(BeanInvocation.java:105)
>>     at 
>> java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1791)
>>     at 
>> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1750)
>>     at 
>> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
>>     at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
>>     at 
>> org.apache.activemq.command.ActiveMQObjectMessage.getObject(ActiveMQObjectMessage.java:177)
>>     ... 21 more
>> Caused by: java.lang.IllegalArgumentException: interface 
>> com.referentia.liveaction.common.core.camel.clientstream.StreamIdProvider 
>> is not visible from class loader
>>     at java.lang.reflect.Proxy.getProxyClass(Proxy.java:353)
>>     at 
>> org.apache.activemq.util.ClassLoadingAwareObjectInputStream.resolveProxyClass(ClassLoadingAwareObjectInputStream.java:48)
>>     ... 34 more
>>
>> Thanks,
>> Jim
>


Mime
View raw message