-----Message d'origine-----
De : Daniele Dellafiore [mailto:ilde...@gmail.com] 
Envoyé : vendredi 29 octobre 2010 13:52
À : discuss@restlet.tigris.org
Objet : Can't make two container talk with success

Hi.

I lost all the morning trying to figure out a nice setup for my app..
still can't make it work, so I ask for some help.

I have two different war, one is a restlet server deployed as a servlet, the
other is the web frontent, made with wicket.
If I run both the wars in jetty embedded in maven with mvn jetty:run, they
starts on two different ports and can talk together succesfully.

But in my  final production setup with tomcat 6 running the server on
8080 and jetty 6 running the web client, on 9090, both answer and works
properly till I make a POST from the client to the server, and I receive a
"IllegalArgumentException: argument type mismatch" as shown in trace below.

This beats me, cause in two jetty, same machine, different instances and
port it works. And the error is not saying enough.

Before leaving you to the exception I want to add this question: does seems
reasonable to you this kind of architecure? Basically I want to build the
client on the REST API I build for the server. So in the frontent, with
wicket, I inject a restlet client and not the services that are only in the
domain of the server.
This seems clear to me but maybe there is a draw back.

If I try to make both client and server run on the same jetty/tomcat as
separate war, they can't communicate, I receive a Communication Error (1001)
- Connection refused

I did not take further investigations cause the two-container setup is fine
for me, maybe you can tell more about that, seems like a security issue
here.

Thanks for help.
Here is the exception.

29-Oct-2010 11:45:21 org.restlet.resource.UniformResource doCatch
WARNING: Exception or error caught in resource
java.lang.IllegalArgumentException: argument type mismatch
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at
org.restlet.resource.ServerResource.doHandle(ServerResource.java:453)
        at
org.restlet.resource.ServerResource.post(ServerResource.java:1095)
        at
org.restlet.resource.ServerResource.doHandle(ServerResource.java:506)
        at
org.restlet.resource.ServerResource.doNegotiatedHandle(ServerResource.java:5
63)
        at
org.restlet.resource.ServerResource.doConditionalHandle(ServerResource.java:
299)
        at
org.restlet.resource.ServerResource.handle(ServerResource.java:821)
        at org.restlet.resource.Finder.handle(Finder.java:513)
        at org.restlet.routing.Filter.doHandle(Filter.java:156)
        at org.restlet.routing.Filter.handle(Filter.java:203)
        at org.restlet.routing.Router.doHandle(Router.java:495)
        at org.restlet.routing.Router.handle(Router.java:735)
        at org.restlet.routing.Filter.doHandle(Filter.java:156)
        at org.restlet.routing.Filter.handle(Filter.java:203)
        at org.restlet.routing.Filter.doHandle(Filter.java:156)
        at org.restlet.routing.Filter.handle(Filter.java:203)
        at org.restlet.routing.Filter.doHandle(Filter.java:156)
        at
org.restlet.engine.application.StatusFilter.doHandle(StatusFilter.java:154)
        at org.restlet.routing.Filter.handle(Filter.java:203)
        at org.restlet.routing.Filter.doHandle(Filter.java:156)
        at org.restlet.routing.Filter.handle(Filter.java:203)
        at org.restlet.engine.ChainHelper.handle(ChainHelper.java:111)
        at
org.restlet.engine.application.ApplicationHelper.handle(ApplicationHelper.ja
va:72)
        at org.restlet.Application.handle(Application.java:386)
        at org.restlet.routing.Filter.doHandle(Filter.java:156)
        at org.restlet.routing.Filter.handle(Filter.java:203)
        at org.restlet.routing.Router.doHandle(Router.java:495)
        at org.restlet.routing.Router.handle(Router.java:735)
        at org.restlet.routing.Filter.doHandle(Filter.java:156)
        at org.restlet.routing.Filter.handle(Filter.java:203)
        at org.restlet.routing.Router.doHandle(Router.java:495)
        at org.restlet.routing.Router.handle(Router.java:735)
        at org.restlet.routing.Filter.doHandle(Filter.java:156)
        at org.restlet.routing.Filter.handle(Filter.java:203)
        at org.restlet.engine.ChainHelper.handle(ChainHelper.java:111)
        at org.restlet.Component.handle(Component.java:387)
        at org.restlet.Server.handle(Server.java:488)
        at org.restlet.engine.ServerHelper.handle(ServerHelper.java:71)
        at
org.restlet.engine.http.HttpServerHelper.handle(HttpServerHelper.java:150)
        at
org.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:1037)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:290)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:206)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:233)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:191)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127
)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102
)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:109)
        at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
        at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
        at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http
11Protocol.java:588)
        at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
        at java.lang.Thread.run(Thread.java:619)
29-Oct-2010 11:45:21 org.restlet.engine.log.LogFilter afterHandle
INFO: 2010-10-29        11:45:21        127.0.0.1       -       127.0.0.1
8080    POST    /server/requests        -       500     415     -       40
http://localhost:8080   Restlet-Framework/2.0.1 -


--
Daniele Dellafiore
http://danieledellafiore.net

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=26770
91

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2677167

Reply via email to