Spring RabbitMQ - Getting ClassCastException in MessageListener - rabbitmq

I am getting ClassCastException from AMQP internals while using Spring RabbitMQ. We found this in application logs on production and were not able to reproduce this, but it's a real pain for us.
Basically, it seems like the entire stack fails once this happens, because then we see invalid DeliveryTag being sent on that channel, which results in RabbitMQ closing this channel.
We are using AMQPClient 5.4.3 and SpringRabbit 2.1.2, RabbitMQ caching mode is Connection (because of HAProxy and failover), ACK mode is manual, Publisher returns are enabled and Publisher Confirms as well.
java.lang.ClassCastException: com.rabbitmq.client.impl.AMQImpl$Channel$OpenOk cannot be cast to com.rabbitmq.client.impl.AMQImpl$Confirm$SelectOk
at com.rabbitmq.client.impl.ChannelN.confirmSelect(ChannelN.java:1552)
at com.rabbitmq.client.impl.ChannelN.confirmSelect(ChannelN.java:52)
at org.springframework.amqp.rabbit.connection.CachingConnectionFactory.doCreateBareChannel(CachingConnectionFactory.java:658)
at org.springframework.amqp.rabbit.connection.CachingConnectionFactory.createBareChannel(CachingConnectionFactory.java:649)
at org.springframework.amqp.rabbit.connection.CachingConnectionFactory.getCachedChannelProxy(CachingConnectionFactory.java:608)
at org.springframework.amqp.rabbit.connection.CachingConnectionFactory.getChannel(CachingConnectionFactory.java:499)
at org.springframework.amqp.rabbit.connection.CachingConnectionFactory.access$1600(CachingConnectionFactory.java:100)
at org.springframework.amqp.rabbit.connection.CachingConnectionFactory$ChannelCachingConnectionProxy.createChannel(CachingConnectionFactory.java:1331)
at org.springframework.amqp.rabbit.core.RabbitTemplate.doExecute(RabbitTemplate.java:1967)
at org.springframework.amqp.rabbit.core.RabbitTemplate.execute(RabbitTemplate.java:1935)
at org.springframework.amqp.rabbit.core.RabbitTemplate.send(RabbitTemplate.java:889)
at org.springframework.amqp.rabbit.core.RabbitTemplate.convertAndSend(RabbitTemplate.java:955)
at org.springframework.amqp.rabbit.core.RabbitTemplate.convertAndSend(RabbitTemplate.java:948)
at net.homecredit.lisa.messaging.amqp.SaveApplicationResponseProducer.sendResponse(SaveApplicationResponseProducer.kt:40)
at net.homecredit.lisa.messaging.amqp.SaveApplicationConsumer.onReceiveRequestMessage(SaveApplicationConsumer.kt:87)
at sun.reflect.GeneratedMethodAccessor372.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:170)
at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:120)
at org.springframework.amqp.rabbit.listener.adapter.HandlerAdapter.invoke(HandlerAdapter.java:49)
at org.springframework.amqp.rabbit.listener.adapter.MessagingMessageListenerAdapter.invokeHandler(MessagingMessageListenerAdapter.java:190)
at org.springframework.amqp.rabbit.listener.adapter.MessagingMessageListenerAdapter.onMessage(MessagingMessageListenerAdapter.java:127)
at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:1521)
at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.actualInvokeListener(AbstractMessageListenerContainer.java:1444)
at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:1431)
at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.executeListener(AbstractMessageListenerContainer.java:1410)
at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.doReceiveAndExecute(SimpleMessageListenerContainer.java:848)
at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.receiveAndExecute(SimpleMessageListenerContainer.java:832)
at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.access$700(SimpleMessageListenerContainer.java:78)
at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run(SimpleMessageListenerContainer.java:1073)
at java.lang.Thread.run(Thread.java:748)
This is complete mystery for me.
Does anyone know what's wrong?

The RabbitMQ client can be configured to check the response type for RPC via channelShouldCheckRpcResponseType, see also https://github.com/rabbitmq/rabbitmq-java-client/issues/708.

Related

Apache camel / MQTT through SSL : Failed to create Producer for endpoint (java.lang.NullPointerException)

I'm trying to publish to a MQTT topic thanks to the appropriate Apache Camel MQTT component.
So in my spring context XML I have the following:
<camel:to uri="mqtt:test?host=ssl://myhost:8883&publishTopicName=test&userName=test&password=test"/>
But I'm getting the following error at startup :
Failed to create Producer for endpoint:
Endpoint[mqtt:test?host=ssl://myhost:8883&publishTopicName=test&userName=test&password=test]. Reason: java.lang.NullPointerException
Everything is working fine when not using ssl, the following configuration (regular tcp instead of ssl) is working well :
<camel:to uri="mqtt:test?host=tcp://myhost:1883&publishTopicName=test&userName=test&password=test"/>
I've added the javax.net.ssl.trustStore JVM property pointing to my certificates store but without any effect.
Does someone already met this issue ? Is there something to specifically add in the spring DSL configuration file when using the camel mqtt component with ssl ?
EDIT :
The stacktrace of the NPE :
Caused by: java.lang.NullPointerException at
org.fusesource.hawtdispatch.transport.SslTransport.connecting(SslTransport.java:194)
at
org.fusesource.mqtt.client.CallbackConnection.createTransport(CallbackConnection.java:285)
at
org.fusesource.mqtt.client.CallbackConnection.connect(CallbackConnection.java:138)
at
org.apache.camel.component.mqtt.MQTTEndpoint.connect(MQTTEndpoint.java:305)
at
org.apache.camel.component.mqtt.MQTTProducer.doStart(MQTTProducer.java:38)
at
org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
at
org.apache.camel.impl.DefaultCamelContext.startService(DefaultCamelContext.java:3219)
at
org.apache.camel.impl.DefaultCamelContext.doAddService(DefaultCamelContext.java:1209)
at
org.apache.camel.impl.DefaultCamelContext.addService(DefaultCamelContext.java:1170)
at
org.apache.camel.impl.ProducerCache.doGetProducer(ProducerCache.java:442)
... 33 more
Debugging through javax.net.debug=ssl was useful.
Actually there were an issue on the java.security where the security.provider property was not set properly. That was manually changed for testing purpose related to another application.
Since, everything is working fine. Sorry for the post related to a internal specific mistake.
Alex.

JUnit tests using embedded ActiveMQ throws javax.jms.JMSException: peer stopped

I've a java application that consumes messages from ActiveMQ. I've JUnit test cases that uses embedded ActiveMQ (version: 5.10.0). The test cases execute fine but throws this error post execution. I tried with latest version (5.14.0) and the error is thrown. There is no error with 5.8.0 though. I see a related thread that describes the same issue for ActiveMQ version 5.6.0 but could not see a solution. Appreciate your inputs.
#Bean
public ConnectionFactory jmsConnectionFactory() {
ActiveMQConnectionFactory amqConnectionFactory = new ActiveMQConnectionFactory("vm://my-amq-host");
CachingConnectionFactory cachingConnectionFactory = new CachingConnectionFactory(amqConnectionFactory);
cachingConnectionFactory.setCacheConsumers(false);
return cachingConnectionFactory;
}
2016-09-23 13:53:37,083 WARN [org.springframework.jms.connection.CachingConnectionFactory][ActiveMQ Connection Executor: vm://my-amq-host#0][301] Encountered a JMSException - resetting the underlying JMS Connection
javax.jms.JMSException: peer (vm://my-amq-host#1) stopped.
at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:54)
at org.apache.activemq.ActiveMQConnection.onAsyncException(ActiveMQConnection.java:1998)
at org.apache.activemq.ActiveMQConnection.onException(ActiveMQConnection.java:2017)
at org.apache.activemq.transport.TransportFilter.onException(TransportFilter.java:101)
at org.apache.activemq.transport.ResponseCorrelator.onException(ResponseCorrelator.java:126)
at org.apache.activemq.transport.TransportFilter.onException(TransportFilter.java:101)
at org.apache.activemq.transport.vm.VMTransport.stop(VMTransport.java:206)
at org.apache.activemq.transport.TransportFilter.stop(TransportFilter.java:65)
at org.apache.activemq.transport.TransportFilter.stop(TransportFilter.java:65)
at org.apache.activemq.transport.ResponseCorrelator.stop(ResponseCorrelator.java:132)
at org.apache.activemq.broker.TransportConnection.doStop(TransportConnection.java:1102)
at org.apache.activemq.broker.TransportConnection$4.run(TransportConnection.java:1068)
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: org.apache.activemq.transport.TransportDisposedIOException: peer (vm://my-amq-host#1) stopped.
... 9 more
My guess would be that the test code is running in such a way that the connection factory when creating the connection to the VM transport which create an in-VM broker if none is running is actually capturing an instance of an in-VM broker before it has fully cleaned up and gone down. Without seeing the test code completely it's hard to say for sure though.
It's usually a good idea to have the test create it's own BrokerService that you can control and have the factories use the VM transport with the create=false URI option.

JBoss AS7 Hornetq - RemoteConenctionFactory lookup fails with RoundRobinConnectionLoadBalancingPolicy NotSerializableException

I'm using JBoss AS 7 Hornetq. Our standalone java application interacts with a queue and sends messages. We had the entire environment setup and it was working pretty smoothly. Suddenly, one fine day, our standalone application failed with the below exception:
Caused by: java.io.NotSerializableException: org.hornetq.api.core.client.loadbalance.RoundRobinConnectionLoadBalancingPolicy
Detailed exception stack trace is below
javax.naming.NamingException: Failed to lookup [Root exception is java.io.NotSerializableException: org.hornetq.api.core.client.loadbalance.RoundRobinConnectionLoadBalancingPolicy]
at org.jboss.naming.remote.client.ClientUtil.namingException(ClientUtil.java:36)
at org.jboss.naming.remote.protocol.v1.Protocol$1.execute(Protocol.java:104)
at org.jboss.naming.remote.protocol.v1.RemoteNamingStoreV1.lookup(RemoteNamingStoreV1.java:79)
at org.jboss.naming.remote.client.RemoteContext.lookup(RemoteContext.java:79)
at org.jboss.naming.remote.client.RemoteContext.lookup(RemoteContext.java:83)
at javax.naming.InitialContext.lookup(Unknown Source)
at com.infosys.lbs.publishing.LocationProcessor.postMessageInQueue(LocationProcessor.java:377)
at com.infosys.lbs.publishing.LocationProcessor.process(LocationProcessor.java:69)
at com.infosys.lbs.publishing.main.Publisher.main(Publisher.java:34)
Caused by: java.io.NotSerializableException: org.hornetq.api.core.client.loadbalance.RoundRobinConnectionLoadBalancingPolicy
at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:891)
at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1063)
at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:1019)
at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:885)
at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1063)
at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:1019)
at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:998)
at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:885)
at org.jboss.marshalling.AbstractObjectOutput.writeObject(AbstractObjectOutput.java:62)
at org.jboss.marshalling.AbstractMarshaller.writeObject(AbstractMarshaller.java:119)
at org.jboss.naming.remote.protocol.v1.Protocol$1$2.write(Protocol.java:138)
at org.jboss.naming.remote.protocol.v1.WriteUtil.write(WriteUtil.java:61)
at org.jboss.naming.remote.protocol.v1.Protocol$1.handleServerMessage(Protocol.java:128)
at org.jboss.naming.remote.protocol.v1.RemoteNamingServerV1$MessageReciever$1.run(RemoteNamingServerV1.java:73)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: an exception which occurred:
in field loadBalancingPolicy
in field serverLocator
in object org.hornetq.jms.client.HornetQJMSConnectionFactory#ea074d
Exception was happening when the app was trying to lookup the connection factory
QueueConnectionFactory qcf = (QueueConnectionFactory)context.lookup("jms/RemoteConnectionFactory");
Below are the steps on how we resolved the issue
There was almost zero help for resolving this issue. A web search on this exception returned next to nothing. However, this particular thread on JBoss AS Dev site spinned a thought in my head: RemoteConnectionFactory is not found when looking up in a remote client
The scenario mentioned in this thread was not same as ours. (In our app this is the first and the only lookup happening.) This thread got me thinking towards a possible connection factory initialization issue. While there is nothing I could do to debug or find the issue around it, I thought that if I could reinitialize it, that would help.
So I tried lookup with java:jboss/exported/jms/RemoteConnectionFactory As expected it failed with a NamingException. Hoping that this naming syntax (using java:/) would have resulted in a reinitialization, I tried lookup again with jms/RemoteConnectionFactory. And bingo!!! it worked!
Unfortunately, we still don't know why it happened, and if it is just a one-off case! Documenting it here just in case some mortal soul hits this issue.

ActiveMQ Message Groups - ConcurrentModificationException

I'm using AMQ message groups with AMQ 5.6 with Kahadb persistent messaging and periodically see this WARN in the logs. I don't see any specific errors that result from this, but am wondering what the side effects of this are, etc.
My consumer is a Camel (2.9.2) route with maxConcurrentConsumers=5 (using AMQ connection pool, etc). I'll try to boil this down to a unit test at some point...for now, here is the stack trace
Async error occurred: java.util.concurrent.ExecutionException: java.util.ConcurrentModificationException
java.util.concurrent.ExecutionException: java.util.ConcurrentModificationException
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)
at java.util.concurrent.FutureTask.get(FutureTask.java:83)
at org.apache.activemq.broker.region.Queue.doMessageSend(Queue.java:785)
at org.apache.activemq.broker.region.Queue.send(Queue.java:707)
at org.apache.activemq.broker.region.AbstractRegion.send(AbstractRegion.java:407)
at org.apache.activemq.broker.region.RegionBroker.send(RegionBroker.java:503)
at org.apache.activemq.broker.jmx.ManagedRegionBroker.send(ManagedRegionBroker.java:305)
at org.apache.activemq.broker.BrokerFilter.send(BrokerFilter.java:129)
at org.apache.activemq.broker.CompositeDestinationBroker.send(CompositeDestinationBroker.java:96)
at org.apache.activemq.broker.TransactionBroker.send(TransactionBroker.java:306)
at org.apache.activemq.broker.MutableBrokerFilter.send(MutableBrokerFilter.java:135)
at org.apache.activemq.broker.TransportConnection.processMessage(TransportConnection.java:453)
at org.apache.activemq.command.ActiveMQMessage.visit(ActiveMQMessage.java:681)
at org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:292)
at org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:150)
at org.apache.activemq.transport.ResponseCorrelator.onCommand(ResponseCorrelator.java:116)
at org.apache.activemq.transport.MutexTransport.onCommand(MutexTransport.java:50)
at org.apache.activemq.transport.vm.VMTransport.iterate(VMTransport.java:231)
at org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:122)
at org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:43)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)
Caused by: java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:793)
at java.util.HashMap$KeyIterator.next(HashMap.java:828)
at org.apache.activemq.util.MarshallingSupport.marshalPrimitiveMap(MarshallingSupport.java:64)
at org.apache.activemq.command.Message.beforeMarshall(Message.java:210)
at org.apache.activemq.command.ActiveMQObjectMessage.beforeMarshall(ActiveMQObjectMessage.java:199)
at org.apache.activemq.openwire.v6.MessageMarshaller.looseMarshal(MessageMarshaller.java:277)
at org.apache.activemq.openwire.v6.ActiveMQMessageMarshaller.looseMarshal(ActiveMQMessageMarshaller.java:111)
at org.apache.activemq.openwire.v6.ActiveMQObjectMessageMarshaller.looseMarshal(ActiveMQObjectMessageMarshaller.java:111)
at org.apache.activemq.openwire.OpenWireFormat.marshal(OpenWireFormat.java:168)
at org.apache.activemq.store.kahadb.KahaDBStore$KahaDBMessageStore.addMessage(KahaDBStore.java:429)
at org.apache.activemq.store.kahadb.KahaDBStore$StoreQueueTask.run(KahaDBStore.java:1177)
logged a JIRA for this (AMQ-4092), it sounds like an issue with a combination of KahaDB and message groups. setting concurrentStoreAndDispatchQueues=false solves the issue (thanks to Gary Tully for the suggestion)

Old Version of Commons-HttpClient gives IOException in the Axis2 Web Service Client

I am using a wsdl2java generated web service client for the axis2 web service (axis2 version is 1.6.1). So for http connection the old version of commons-httpclient 3.1 is used. While doing some load tests to my web service client. In some cases i came across this exception
org.apache.axis2.AxisFault: org.apache.axiom.ext.io.StreamCopyException: Error reading from source
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at com.ardic.arcsp.carbon.registry.ws.stub.WSStorageServiceStub.fromOM(WSStorageServiceStub.java:16706)
at com.ardic.arcsp.carbon.registry.ws.stub.WSStorageServiceStub.wSgetById(WSStorageServiceStub.java:6659)
at com.ardic.arcsp.update.wsclient.WSStorageServiceClient.getResourceById(WSStorageServiceClient.java:177)
at com.ardic.arcsp.update.wsclient.OTAUpdateTestServlet.downloadResource(OTAUpdateTestServlet.java:162)
at com.ardic.arcsp.update.wsclient.OTAUpdateTestServlet.doGet(OTAUpdateTestServlet.java:91)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:273)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:270)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:305)
at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:298)
at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:57)
at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:189)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.wso2.carbon.server.CarbonStuckThreadDetectionValve.invoke(CarbonStuckThreadDetectionValve.java:154)
at org.wso2.carbon.server.TomcatServer$1.invoke(TomcatServer.java:254)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:399)
at org.apache.coyote.http11.Http11NioProcessor.process(Http11NioProcessor.java:396)
at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:356)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1534)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:705)
Caused by: org.apache.axiom.om.OMException: org.apache.axiom.ext.io.StreamCopyException: Error reading from source
at org.apache.axiom.attachments.impl.PartFactory.createPart(PartFactory.java:172)
at org.apache.axiom.attachments.Attachments.getPart(Attachments.java:705)
at org.apache.axiom.attachments.Attachments.getNextPartDataHandler(Attachments.java:623)
at org.apache.axiom.attachments.Attachments.getDataHandler(Attachments.java:350)
at org.apache.axiom.om.impl.builder.OMAttachmentAccessorMimePartProvider.getDataHandler(OMAttachmentAccessorMimePartProvider.java:45)
at org.apache.axiom.util.stax.xop.XOPDecodingStreamReader$DataHandlerProviderImpl.getDataHandler(XOPDecodingStreamReader.java:81)
at org.apache.axiom.util.stax.xop.XOPDecodingStreamReader.getDataHandler(XOPDecodingStreamReader.java:472)
at org.apache.axiom.om.impl.SwitchingWrapper.getDataHandler(SwitchingWrapper.java:1360)
at org.apache.axiom.util.stax.XMLStreamReaderUtils.getDataHandlerFromElement(XMLStreamReaderUtils.java:230)
at com.ardic.arcsp.carbon.registry.ws.stub.xsd.WSResource$Factory.parse(WSResource.java:2087)
at com.ardic.arcsp.carbon.registry.ws.stub.WSgetByIdResponse$Factory.parse(WSgetByIdResponse.java:417)
at com.ardic.arcsp.carbon.registry.ws.stub.WSStorageServiceStub.fromOM(WSStorageServiceStub.java:16273)
... 37 more
Caused by: org.apache.axiom.ext.io.StreamCopyException: Error reading from source
at org.apache.axiom.attachments.utils.BAAOutputStream.readFrom(BAAOutputStream.java:114)
at org.apache.axiom.attachments.impl.BufferUtils.inputStream2OutputStream(BufferUtils.java:76)
at org.apache.axiom.attachments.impl.PartFactory.createPart(PartFactory.java:136)
... 48 more
Caused by: java.io.IOException: CRLF expected at end of chunk: 116/161
at org.apache.commons.httpclient.ChunkedInputStream.readCRLF(ChunkedInputStream.java:207)
at org.apache.commons.httpclient.ChunkedInputStream.nextChunk(ChunkedInputStream.java:219)
at org.apache.commons.httpclient.ChunkedInputStream.read(ChunkedInputStream.java:176)
at java.io.FilterInputStream.read(FilterInputStream.java:116)
at org.apache.commons.httpclient.AutoCloseInputStream.read(AutoCloseInputStream.java:108)
at java.io.FilterInputStream.read(FilterInputStream.java:116)
at org.apache.axiom.om.util.DetachableInputStream.read(DetachableInputStream.java:147)
at java.io.FilterInputStream.read(FilterInputStream.java:116)
at java.io.PushbackInputStream.read(PushbackInputStream.java:169)
at org.apache.axiom.attachments.BoundaryPushbackInputStream.readFromStream(BoundaryPushbackInputStream.java:114)
at org.apache.axiom.attachments.BoundaryPushbackInputStream.read(BoundaryPushbackInputStream.java:248)
at org.apache.axiom.attachments.MIMEBodyPartInputStream.read(MIMEBodyPartInputStream.java:87)
at org.apache.axiom.attachments.utils.BAAOutputStream.readFrom(BAAOutputStream.java:112)
... 50 more
The web service client request files from the server and downloads the file. These exceptions occurs on the response while receiving files in chunks.
While searching i came across this fix mentioned here.
https://issues.apache.org/jira/browse/HTTPCORE-190
However the exceptions still occur. So what else can cause this exceptions?
UPDATE:
Ok, i got the real reason for exception.On the client side if the memory allocation for jvm is low, the response from the server cannot be processed due to SocketTimeOut. But the exception itself could not stress this. Increasing the heap on the client side can solve the problem temporary.
You definitely need enough memory to hold all the data that is chucked to the client. Java can give really weird results, especially the older JVMs, when there isn't enough memory to go around. It can be tricky sometimes to identify that as the root cause so bravo on that find.
There are a few helpful big on the Apache Axis2 User's Guide - Creating Clients page that might be helpful if you are new to wsdl2java.
Our next step is to learn what command line options are available. One thing you can try is using the -u option to generate separate classes for the data bindings instead of creating them as inner classes. (Take a look at this Stack Overflow question.)
Since this question is 10 years old if you run into this or another error please create a new question specific to that context.