Back Forum Reply New

2.0.3-RELEASE

.cbsjes.gp.domain.Projetoquot;
channel=quot;autorizaUsuarioTelaChannelquot; /gt;
lt;/int:payload-type-routergt;
lt;int:channel id=quot;autorizaUsuarioTelaChannelquot; /gt;
lt;int:service-activator id=quot;testequot;
input-channel=quot;autorizaUsuarioTelaChannelquot; ref=quot;pageAuthorizationManagerServicequot;
method=quot;testequot; /gt;
lt;int:channel id=quot;receiveChannelquot; /gt;
lt;int:service-activator input-channel=quot;receiveChannelquot;
expression=quot;payload + ' from the other side'quot; /gt;
And exception in the client side is this:Code:
Exception in thread quot;mainquot; org..integration.MessageHandlingException: from request execution failed for URI [gp/integration/securityService]
at org..integration.from.outbound.fromRequestExecutingMessageHandler.handleRequestMessage(fromRequestExecutingMessageHandler.java:262)
at org..integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:98)
at org..integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:78)
at org..integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:110)
at org..integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:97)
at org..integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:44)
at org..integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:157)
at org..integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:128)
at org..integration.core.MessagingTemplate.doSend(MessagingTemplate.java:288)
at org..integration.core.MessagingTemplate.doSendAndReceive(MessagingTemplate.java:318)
at org..integration.core.MessagingTemplate.sendAndReceive(MessagingTemplate.java:239)
at org..integration.core.MessagingTemplate.convertSendAndReceive(MessagingTemplate.java:274)
at org..integration.gateway.MessagingGatewaySupport.doSendAndReceive(MessagingGatewaySupport.java:224)
at org..integration.gateway.MessagingGatewaySupport.sendAndReceive(MessagingGatewaySupport.java:203)
at org..integration.gateway.GatewayProxyFactoryBean.invokeGatewayMethod(GatewayProxyFactoryBean.java:300)
at org..integration.gateway.GatewayProxyFactoryBean.doInvoke(GatewayProxyFactoryBean.java:269)
at org..integration.gateway.GatewayProxyFactoryBean.invoke(GatewayProxyFactoryBean.java:260)
at org..aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org..aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy0.securityService(Unknown Source)
at integrator.fromClient.main(fromClient.java:27)
Caused by: org..web.client.ResourceAccessException: I/O error: invalid stream header: 636C6965; nested exception is java.io.StreamCorruptedException: invalid stream header: 636C6965
at org..web.client.RestTemplate.doExecute(RestTemplate.java:453)
at org..web.client.RestTemplate.execute(RestTemplate.java:409)
at org..web.client.RestTemplate.exchange(RestTemplate.java:384)
at org..integration.from.outbound.fromRequestExecutingMessageHandler.handleRequestMessage(fromRequestExecutingMessageHandler.java:240)
... 20 more
Caused by: java.io.StreamCorruptedException: invalid stream header: 636C6965
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:782)
at java.io.ObjectInputStream.lt;initgt;(ObjectInputStream.java:279)
at org..integration.from.converter.SerializingfromMessageConverter.readInternal(SerializingfromMessageConverter.java:68)
at org..integration.from.converter.SerializingfromMessageConverter.readInternal(SerializingfromMessageConverter.java:38)
at org..from.converter.AbstractfromMessageConverter.read(AbstractfromMessageConverter.java:154)
at org..web.client.fromMessageConverterExtractor.extractData(fromMessageConverterExtractor.java:74)
at org..web.client.RestTemplate$ResponseEntityResponseExtractor.extractData(RestTemplate.java:619)
at org..web.client.RestTemplate$ResponseEntityResponseExtractor.extractData(RestTemplate.java:1)
at org..web.client.RestTemplate.doExecute(RestTemplate.java:446)
... 23 moreWARN [main] (MessagingGatewaySupport.java:240) - failure occurred in gateway sendAndReceive
org..integration.MessageHandlingException: from request execution failed for URI [gp/integration/securityService]
at org..integration.from.outbound.fromRequestExecutingMessageHandler.handleRequestMessage(fromRequestExecutingMessageHandler.java:262)
at org..integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:98)
at org..integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:78)
at org..integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:110)
at org..integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:97)
at org..integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:44)
at org..integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:157)
at org..integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:128)
at org..integration.core.MessagingTemplate.doSend(MessagingTemplate.java:288)
at org..integration.core.MessagingTemplate.doSendAndReceive(MessagingTemplate.java:318)
at org..integration.core.MessagingTemplate.sendAndReceive(MessagingTemplate.java:239)
at org..integration.core.MessagingTemplate.convertSendAndReceive(MessagingTemplate.java:274)
at org..integration.gateway.MessagingGatewaySupport.doSendAndReceive(MessagingGatewaySupport.java:224)
at org..integration.gateway.MessagingGatewaySupport.sendAndReceive(MessagingGatewaySupport.java:203)
at org..integration.gateway.GatewayProxyFactoryBean.invokeGatewayMethod(GatewayProxyFactoryBean.java:300)
at org..integration.gateway.GatewayProxyFactoryBean.doInvoke(GatewayProxyFactoryBean.java:269)
at org..integration.gateway.GatewayProxyFactoryBean.invoke(GatewayProxyFactoryBean.java:260)
at org..aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org..aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy0.securityService(Unknown Source)
at integrator.fromClient.main(fromClient.java:27)
Caused by: org..web.client.ResourceAccessException: I/O error: invalid stream header: 636C6965; nested exception is java.io.StreamCorruptedException: invalid stream header: 636C6965
at org..web.client.RestTemplate.doExecute(RestTemplate.java:453)
at org..web.client.RestTemplate.execute(RestTemplate.java:409)
at org..web.client.RestTemplate.exchange(RestTemplate.java:384)
at org..integration.from.outbound.fromRequestExecutingMessageHandler.handleRequestMessage(fromRequestExecutingMessageHandler.java:240)
... 20 more
Caused by: java.io.StreamCorruptedException: invalid stream header: 636C6965
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:782)
at java.io.ObjectInputStream.lt;initgt;(ObjectInputStream.java:279)
at org..integration.from.converter.SerializingfromMessageConverter.readInternal(SerializingfromMessageConverter.java:68)
at org..integration.from.converter.SerializingfromMessageConverter.readInternal(SerializingfromMessageConverter.java:38)
at org..from.converter.AbstractfromMessageConverter.read(AbstractfromMessageConverter.java:154)
at org..web.client.fromMessageConverterExtractor.extractData(fromMessageConverterExtractor.java:74)
at org..web.client.RestTemplate$ResponseEntityResponseExtractor.extractData(RestTemplate.java:619)
at org..web.client.RestTemplate$ResponseEntityResponseExtractor.extractData(RestTemplate.java:1)
at org..web.client.RestTemplate.doExecute(RestTemplate.java:446)
... 23 more
thanks

That looks like an issue with a serialized object as the request body content. Is there any chance you have something out of synch between the client and server in terms of your shared classes?

.cbsjes.gp.domain.Projeto@1fbaf73][Headers={timestamp=1297776413097, id=1485620b-7f36-4811-a323-ab44b5344aaa, errorChannel=org..integration.core.MessagingTemplate$TemporaryReplyChannel@bbe282, from_requestMethod=POST, replyChannel=org..integration.core.MessagingTemplate$TemporaryReplyChannel@bbe282, Host=localhost:9090, Content-Length=323, User-Agent=Java/1.6.0_22, from_requestucl=gp/integration/securityService, Connection=keep-alive, Content-Type=application/x-java-serialized-object, Accept=[text/plain, */*]}]
DEBUG [qtp23462603-20] (AbstractMessageHandler.java:72) - (inner bean)#26 received message: [Payload=br.com.cbsjes.gp.domain.Projeto@1fbaf73][Headers={timestamp=1297776413097, id=1485620b-7f36-4811-a323-ab44b5344aaa, errorChannel=org..integration.core.MessagingTemplate$TemporaryReplyChannel@bbe282, from_requestMethod=POST, replyChannel=org..integration.core.MessagingTemplate$TemporaryReplyChannel@bbe282, Host=localhost:9090, Content-Length=323, User-Agent=Java/1.6.0_22, from_requestucl=gp/integration/securityService, Connection=keep-alive, Content-Type=application/x-java-serialized-object, Accept=[text/plain, */*]}]
DEBUG [qtp23462603-20] (AbstractBeanFactory.java:242) - Returning cached instance of singleton bean 'autorizaUsuarioTelaChannel'
DEBUG [qtp23462603-20] (AbstractMessageChannel.java:224) - preSend on channel 'autorizaUsuarioTelaChannel', message: [Payload=br.com.cbsjes.gp.domain.Projeto@1fbaf73][Headers={timestamp=1297776413097, id=1485620b-7f36-4811-a323-ab44b5344aaa, errorChannel=org..integration.core.MessagingTemplate$TemporaryReplyChannel@bbe282, from_requestMethod=POST, replyChannel=org..integration.core.MessagingTemplate$TemporaryReplyChannel@bbe282, Host=localhost:9090, Content-Length=323, User-Agent=Java/1.6.0_22, from_requestucl=gp/integration/securityService, Connection=keep-alive, Content-Type=application/x-java-serialized-object, Accept=[text/plain, */*]}]
DEBUG [qtp23462603-20] (AbstractMessageHandler.java:72) - ServiceActivator for [org..integration.handler.MethodInvokingMessageProcessor@113cd63] received message: [Payload=br.com.cbsjes.gp.domain.Projeto@1fbaf73][Headers={timestamp=1297776413097, id=1485620b-7f36-4811-a323-ab44b5344aaa, errorChannel=org..integration.core.MessagingTemplate$TemporaryReplyChannel@bbe282, from_requestMethod=POST, replyChannel=org..integration.core.MessagingTemplate$TemporaryReplyChannel@bbe282, Host=localhost:9090, Content-Length=323, User-Agent=Java/1.6.0_22, from_requestucl=gp/integration/securityService, Connection=keep-alive, Content-Type=application/x-java-serialized-object, Accept=[text/plain, */*]}]
nome
cliente
DEBUG [qtp23462603-20] (AbstractReplyProducingMessageHandler.java:157) - handler 'ServiceActivator for [org..integration.handler.MethodInvokingMessageProcessor@113cd63]' sending reply Message: [Payload=cliente][Headers={timestamp=1297776413105, id=7193aa7d-cea3-4a55-b47c-27f5ad67739a, errorChannel=org..integration.core.MessagingTemplate$TemporaryReplyChannel@bbe282, from_requestMethod=POST, replyChannel=org..integration.core.MessagingTemplate$TemporaryReplyChannel@bbe282, Host=localhost:9090, Content-Length=323, User-Agent=Java/1.6.0_22, from_requestucl=gp/integration/securityService, Accept=[text/plain, */*], Content-Type=application/x-java-serialized-object, Connection=keep-alive}]
DEBUG [qtp23462603-20] (AbstractMessageChannel.java:237) - postSend (sent=true) on channel 'autorizaUsuarioTelaChannel', message: [Payload=br.com.cbsjes.gp.domain.Projeto@1fbaf73][Headers={timestamp=1297776413097, id=1485620b-7f36-4811-a323-ab44b5344aaa, errorChannel=org..integration.core.MessagingTemplate$TemporaryReplyChannel@bbe282, from_requestMethod=POST, replyChannel=org..integration.core.MessagingTemplate$TemporaryReplyChannel@bbe282, Host=localhost:9090, Content-Length=323, User-Agent=Java/1.6.0_22, from_requestucl=gp/integration/securityService, Connection=keep-alive, Content-Type=application/x-java-serialized-object, Accept=[text/plain, */*]}]
DEBUG [qtp23462603-20] (AbstractMessageChannel.java:237) - postSend (sent=true) on channel 'securityChannel', message: [Payload=br.com.cbsjes.gp.domain.Projeto@1fbaf73][Headers={timestamp=1297776413097, id=1485620b-7f36-4811-a323-ab44b5344aaa, errorChannel=org..integration.core.MessagingTemplate$TemporaryReplyChannel@bbe282, from_requestMethod=POST, replyChannel=org..integration.core.MessagingTemplate$TemporaryReplyChannel@bbe282, Host=localhost:9090, Content-Length=323, User-Agent=Java/1.6.0_22, from_requestucl=gp/integration/securityService, Connection=keep-alive, Content-Type=application/x-java-serialized-object, Accept=[text/plain, */*]}]
DEBUG [qtp23462603-20] (DefaultfromHeaderMapper.java:273) - outboundHeaderNames=[Accept-Ranges, Age, Allow, Cache-Control, Content-Encoding, Content-Language, Content-Length, Content-Location, Content-MD5, Content-Range, Content-Type, Date, ETag, Expires, Last-Modified, Location, Pragma, Proxy-Authenticate, Refresh, Retry-After, Server, Set-Cookie, Trailer, Transfer-Encoding, Vary, Via, Warning, WWW-Authenticate]
DEBUG [qtp23462603-20] (DefaultfromHeaderMapper.java:374) - headerName=[timestamp] WILL NOT be mapped
DEBUG [qtp23462603-20] (DefaultfromHeaderMapper.java:374) - headerName=[id] WILL NOT be mapped
DEBUG [qtp23462603-20] (DefaultfromHeaderMapper.java:374) - headerName=[from_requestMethod] WILL NOT be mapped
DEBUG [qtp23462603-20] (DefaultfromHeaderMapper.java:374) - headerName=[Host] WILL NOT be mapped
DEBUG [qtp23462603-20] (DefaultfromHeaderMapper.java:353) - headerName=[Content-Length] WILL be mapped, matched pattern=Content-Length
DEBUG [qtp23462603-20] (DefaultfromHeaderMapper.java:286) - setting headerName=[Content-Length], value=323
DEBUG [qtp23462603-20] (DefaultfromHeaderMapper.java:374) - headerName=[User-Agent] WILL NOT be mapped
DEBUG [qtp23462603-20] (DefaultfromHeaderMapper.java:374) - headerName=[from_requestucl] WILL NOT be mapped
DEBUG [qtp23462603-20] (DefaultfromHeaderMapper.java:374) - headerName=[Connection] WILL NOT be mapped
DEBUG [qtp23462603-20] (DefaultfromHeaderMapper.java:353) - headerName=[Content-Type] WILL be mapped, matched pattern=Content-Type
DEBUG [qtp23462603-20] (DefaultfromHeaderMapper.java:286) - setting headerName=[Content-Type], value=application/x-java-serialized-object
DEBUG [qtp23462603-20] (DefaultfromHeaderMapper.java:374) - headerName=[Accept] WILL NOT be mappedLooks to me like it's not being serialized on the server side; object streams start with a magic value and a version (0xaecd0005). Your stream starts with 'clie',

I don't understante, the method quot;testequot; of quot;service-activatorquot; and return a StringCode:
lt;int:channel id=quot;autorizaUsuarioTelaChannelquot; /gt;
lt;int:service-activator id=quot;testequot; input-channel=quot;autorizaUsuarioTelaChannelquot;
ref=quot;pageAuthorizationManagerServicequot; method=quot;testequot; /gt;

Code:
public String teste( Projeto message ) {   System.out.println(message.getNome());   System.out.println(message.getCliente().getNome());
   return message.getCliente().getNome();
}
when i was using version 2.0.1 it was working

Looks like the inbound content-type header is being carried over to the output, which seems to be incorrect in this case.

DEBUG [qtp23462603-20] (DefaultfromHeaderMapper.java:353) - headerName=[Content-Type] WILL be mapped, matched pattern=Content-Type
DEBUG [qtp23462603-20] (DefaultfromHeaderMapper.java:321) - setting headerName=[Content-Type], value=application/x-java-serialized-object
...
DEBUG [qtp23462603-20] (DefaultfromHeaderMapper.java:353) - headerName=[Content-Type] WILL be mapped, matched pattern=Content-Type
DEBUG [qtp23462603-20] (DefaultfromHeaderMapper.java:286) - setting headerName=[Content-Type], value=application/x-java-serialized-object

So, on the client we're trying to deserialize plain text.

As a work-around, try adding a lt;header-enricher/gt; on the server side to change the content-type header to 'text/plain'.

Ignore my last post; although that log shows the inbound content-type being copied to the outbound, it is later replaced downstream with a match from the accept header (text/plain). I just ran a test where I sent a serializable object and returned a string and all is OK.

It does, however, look like there is a problem in your case because it definitely looks like we are trying to deserialize a not-serialized string.

Since you are running with a localhost ucl, can you use the eclipse/STS tcp/ip monitor to get a trace of the from headers in both directions?

.cbsjes.gp.domain.Projeto@12e7cb6] as quot;application/x-java-serialized-objectquot; using [org..integration.from.converter.SerializingfromMessageConverter@19a639b]

Code:
Receiving
----------
DEBUG [main] (RestTemplate.java:465) - POST request for quot;gp-web-v1-SNAPSHOT/integration/securityServicequot; resulted in 200 (OK)
DEBUG [main] (fromMessageConverterExtractor.java:71) - Reading [java.lang.String] as quot;application/x-java-serialized-objectquot; using [org..integration.from.converter.SerializingfromMessageConverter@19a639b]
The content type in response should be quot;text/plainquot;, right ?
And my question is, why it wasn't converted to text/plain on the server side ?
Loking at the code, it is getting contentType like quot;application/x-java-serialized-objectquot;

Could it be a bug ? Or am i doing something wrong ?

With the 2.0.1 version the same code is working.

I don't know exactly what's going on because I can't reproduce it; I can, however confirm a behavior change between 2.0.1 and 2.0.3; I am having problems with the content-length header.

As a work-around, try configuring your service activator as follows...Code:
lt;int:chain input-channel=quot;autorizaUsuarioTelaChannelquot;gt;
lt;int:service-activator id=quot;testequot;
ref=quot;pageAuthorizationManagerServicequot;
method=quot;testequot; /gt;       lt;int:header-filter header-names=quot;content-type, content-lengthquot;/gt;
lt;/int:chaingt;It still not working, i will continue investigating ...
¥
Back Forum Reply New