i have a problem with tcpprotocol.
I've written a wrapper of muleclient: one of its methods call a remote
mule server (using remotedispatcher) in sync mode. The schema is: the
client invokes mule-server (on another host in the same intranet)
which has a component with an inbound endpoint implemented by
RESTServiceWrapper.
The problem that arises is always the same. Let me explain:
- if server & client are in the same machine everything is ok,
RESTServiceWrapper returns the target html page, as expected (test
environment)
- if server & client are in 2 different hosts but with very low
latency net time (i mean: i'm developing using a virtual machine.
client is inside the vm, server in the host machine) everything is ok
(another test env)
- BUT if i deploy my project to a remote host inside the same (of
course reliable) network i have a very strange behaviour: client calls
the method and for the first time the result is the expected one.
After the first invocation i notice (every time) an EOFException
serverside, and a message complaining about "message payload of type
byte[]".
Well, the error server side is (pay attention to first lines that
reports the first good method invocation):
16:01:10,458 INFO [VMMessageDispatcher] Connected:
VMMessageDispatcher{this=19b9b1b, endpoint=vm://OFA_RESTQueue}
16:01:10,469 INFO [LoggingInterceptor] About to process event for
OFA_RESTBridge
16:01:10,477 INFO [RestServiceWrapper] Invoking REST service:
http://wwwsv.intra.infocamere.it
16:01:10,652 INFO [AntblHttpClientMessageDispatcher] Connected:
AntblHttpClientMessageDispatcher{this=12ebf9a, endpoint=http://
wwwsv.intra.infocamere.it}
16:01:10,900 INFO [AntblHttpClientMessageDispatcher] Antiblema
customizing "User-Agent" header properties in send method
16:01:11,113 WARN [CookieSpec] Invalid cookie state: domain not
specified
16:01:11,641 INFO [LoggingInterceptor] Processed event for
OFA_RESTBridge
16:01:11,667 WARN [MuleEvent] Property on the current message
MULE_ORIGINATING_ENDPOINT=.muleManagerEndpoint overrides property on
the previous event:
MULE_ORIGINATING_ENDPOINT=endpoint.vm.OFA.RESTQueue
16:01:32,681 ERROR [DefaultComponentExceptionStrategy]
********************************************************************************
Message : Failed to transform from "byte[]" to "Object"
Type : org.mule.umo.transformer.TransformerException
Code : MULE_ERROR-65110
Transformer : ByteArrayToSerializable{this=1bea611,
name='ByteArrayToSerializable', ignoreBadInput=false,
returnClass=null, sourceTypes=[class [B, class java.io.InputStream]}
JavaDoc :
http://mule.mulesource.org/docs/apidocs/org/mule/umo/transformer/TransformerException.html
********************************************************************************
Exception stack is:
1. null (java.io.EOFException)
java.io.ObjectInputStream$PeekInputStream:2232 (http://java.sun.com/
j2se/1.5.0/docs/api/java/io/EOFException.html)
2. java.io.EOFException
(org.apache.commons.lang.SerializationException)
org.apache.commons.lang.SerializationUtils:167 (null)
3. Failed to transform from "byte[]" to
"Object" (org.mule.umo.transformer.TransformerException)
org.mule.transformers.simple.ByteArrayToSerializable:50 (http://
mule.mulesource.org/docs/apidocs/org/mule/umo/transformer/
TransformerException.html)
********************************************************************************
Root Exception stack trace:
java.io.EOFException
at java.io.ObjectInputStream
$PeekInputStream.readFully(ObjectInputStream.java:2232)
at java.io.ObjectInputStream
$BlockDataInputStream.readUTFBody(ObjectInputStream.java:2967)
at java.io.ObjectInputStream
$BlockDataInputStream.readUTF(ObjectInputStream.java:2768)
at java.io.ObjectInputStream.readUTF(ObjectInputStream.java:
1021)
.....and so on...
Here is the relevant portion of my server conf file. The component
called is "OFA_RESTBridge",
which uses (cause is found in the conf file) the connector
"httpConnector":
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mule-configuration PUBLIC "-//MuleSource //DTD mule-
configuration XML V1.0//EN"
"http://mule.mulesource.org/dtds/mule-
spring-configuration.dtd">
<!-- interfacciamento ad applicazioni varie presso infocamere -->
<mule-configuration id="mule-config" version="1.0">
<mule-environment-properties synchronous="true"
recoverableMode="true" >
<queue-profile persistent="true"></queue-profile>
<persistence-strategy
className="org.mule.util.queue.FilePersistenceStrategy">
</persistence-strategy>
</mule-environment-properties>
<!-- CONNECTOR USED BY THE RESTSERVICEWRAPPER-->
<connector name="httpConnector"
className="org.mule.providers.http.HttpConnector">
<properties>
<property name="proxyHostname" value="***" />
<property name="proxyUsername" value="***" />
<property name="proxyPassword" value="***" />
<property name="proxyPort" value="38080" />
<!-- TRIED ALSO WITH OTHER PROTOS...SAME
RESULT! -->
<property name="tcpProtocolClassName"
value="org.mule.providers.tcp.protocols.EOFProtocol" />
<property name="enableCookies" value="true" />
<map name="serviceOverrides">
<property name="dispatcher.factory"
value="com.antiblema.esb.ofa.AntblHttpClientMessageDispatcherFactory" /
>
</map>
</properties>
<connection-strategy
className="org.mule.providers.SimpleRetryConnectionStrategy">
<properties>
<property name="retryCount" value="3" /
>
<property name="frequency"
value="2000" />
</properties>
</connection-strategy>
</connector>
<transformers>
<transformer name="mailWrapperTransformer"
className="com.antiblema.esb.MailWrapperTransformer"
returnClass="org.mule.impl.MuleMessage">
</transformer>
<!-- la property "returnClass" e' fondamentale:
serve ad aggirare MULE_ERROR-65110 -->
<transformer name="byteArray2ObjectTransformer"
className="org.mule.transformers.simple.ByteArrayToObject"
returnClass="java.lang.String">
</transformer>
<transformer name="object2MimeMessageTransformer"
className="org.mule.providers.email.transformers.ObjectToMimeMessage">
</transformer>
<transformer name="ofaTransformer"
className="com.antiblema.esb.ofa.OfaTransformer">
</transformer>
</transformers>
<model name="ESBInfoCert">
... other stuff here, not concerning with my
problem ...
<!-- interact with OFA -->
<mule-descriptor name="OFA_RESTBridge"
implementation="org.mule.components.rest.RestServiceWrapper">
<inbound-router>
<endpoint address="vm://OFA_RESTQueue"
connector="vmConnector"
synchronous="true" remoteSync="true"
responseTransformers="byteArray2ObjectTransformer">
</endpoint>
</inbound-router>
<interceptor name="default_stack"></
interceptor>
<properties>
<!-- url passata come property nel
MuleMessage -->
<property name="urlFromMessage"
value="true" />
<property name="httpMethod"
value="GET" />
</properties>
</mule-descriptor>
</model>
</mule-configuration>
Client side, the code is:
// inside the method who returns the html from the
url
message.setProperty("rest.service.url", "http://
wwwsv.intra.***.it");
/*
* REST CALL
*/
MuleMessage result = (MuleMessage)
dispatcher.sendRemote(
PropertyHandler.getPropertyValue("ofaEndpoint"), message, null);
return result.getPayload();
I knows mule error 65110 is a well known error, in fact i tried using
every type of tcpprotocol avalaible in mule 1.4.3: i get always the
same behaviour....when the server is remote only the first invocation
of rest returns succesfully.
I tried also to build the client using its own conf file, setting a
"LengthProtocol" on both sides...it seems to be ignored..
PLEASE HELP!!! Anyone has the same problem? Any suggestion?
Thanks, Andrea
--
View this message in context: http://www.nabble.com/MuleClient%2C-RestServiceWrapper%2C-EOFException-tf4592735.html#a13111223
Sent from the Mule - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list please visit:
I've been able to set the lengthprotocol also client-side, using the
mulemanager, bypassing the client config file.
But still EOFException server-side and the message: "Message payload is of
type: byte[]" client-side.
Maybe i'm missing something?
Bye
--
View this message in context: http://www.nabble.com/MuleClient%2C-RestServiceWrapper%2C-EOFException-tf4592735.html#a13114921