tuscany-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Raymond Feng <enjoyj...@gmail.com>
Subject Re: error on ArrayList return from a contribution
Date Tue, 19 Apr 2011 05:50:46 GMT
Your QueryResult interface is probably remotable. Can you share it?

Sent from my iPad

On Apr 18, 2011, at 10:43 PM, Monosij Dutta-Roy <monosij.forums@gmail.com> wrote:

> hi Raymond - thanks for your help.
> 
> I created a QueryResults object, not Remotable and injected its interface as a reference
to the objects creating and reading the ArrayList of patients. So QueryExecutor creates the
QueryResults by Reference and returns to QueryOrchestrator which returns it to QueryService
(the webapp).
> 
> The Reference injection is only setup for QueryExecutor.
> I still get the error below.
> I am attaching the class QueryOrchestratorImpl and QueryServiceImpl where the errors
happen. I am also attahcing QueryResults.
> The qmAppSCA01 (webapp with QueryServiceImpl) composite qmAppSCA01.composite is attached.
> The qmController (contribution with QueryOrchestratorImpl, QeryExecutorImpl and QueryResultsImpl)
composite qmController.composite is attached.
> 
> 
> Thanks again.
> 
> monosij
> -------------------------------------------------------------------------
> [INFO] Started Jetty Server
> QueryServlet reference injection failed, using ComponentContext
> **************************************************
> select distinct * from vw_patient_encounter WHERE sex = 'F' AND cptCode = '77057' AND
rownum <= 10
> Patients Count: 9
> 2011-04-19 01:33:09.381:WARN::/qmAppSCA01/QueryServlet
> java.lang.IllegalArgumentException: Pass-by-value is not supported for the given object:
$Proxy37
> 	at org.apache.tuscany.sca.databinding.javabeans.JavaBeansDataBinding.copy(JavaBeansDataBinding.java:132)
> 	at org.apache.tuscany.sca.databinding.DefaultDataBindingExtensionPoint$LazyDataBinding.copy(DefaultDataBindingExtensionPoint.java:169)
> 	at org.apache.tuscany.sca.databinding.impl.MediatorImpl.copy(MediatorImpl.java:542)
> 	at org.apache.tuscany.sca.databinding.impl.MediatorImpl.copyOutput(MediatorImpl.java:615)
> 	at org.apache.tuscany.sca.binding.sca.provider.SCABindingInvoker.processResponse(SCABindingInvoker.java:120)
> 	at org.apache.tuscany.sca.core.invocation.InterceptorAsyncImpl.invoke(InterceptorAsyncImpl.java:59)
> 	at org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:322)
> 	at org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:278)
> 	at org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:125)
> 	at org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.doInvokeSync(AsyncJDKInvocationHandler.java:239)
> 	at org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.invoke(AsyncJDKInvocationHandler.java:161)
> 	at $Proxy33.getPatients(Unknown Source)
> 	at org.rd.qm.impl.QueryOrchestratorImpl.getPatients(QueryOrchestratorImpl.java:27)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:616)
> 	at org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:164)
> 	at org.apache.tuscany.sca.binding.sca.provider.SCABindingLocalInvocationInterceptor.invoke(SCABindingLocalInvocationInterceptor.java:49)
> 	at org.apache.tuscany.sca.core.invocation.InterceptorAsyncImpl.invoke(InterceptorAsyncImpl.java:58)
> 	at org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:322)
> 	at org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:278)
> 	at org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:125)
> 	at org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.doInvokeSync(AsyncJDKInvocationHandler.java:239)
> 	at org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.invoke(AsyncJDKInvocationHandler.java:161)
> 	at $Proxy32.getPatients(Unknown Source)
> 	at org.rd.qm.impl.QueryServiceImpl.getPatients(QueryServiceImpl.java:19)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:616)
> 	at org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:164)
> 	at org.apache.tuscany.sca.binding.sca.provider.SCABindingLocalInvocationInterceptor.invoke(SCABindingLocalInvocationInterceptor.java:49)
> 	at org.apache.tuscany.sca.core.invocation.InterceptorAsyncImpl.invoke(InterceptorAsyncImpl.java:58)
> 	at org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:322)
> 	at org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:278)
> 	at org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:125)
> 	at org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.doInvokeSync(AsyncJDKInvocationHandler.java:239)
> 	at org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.invoke(AsyncJDKInvocationHandler.java:161)
> 	at $Proxy31.getPatients(Unknown Source)
> 	at org.rd.qm.servlet.QueryServlet.service(QueryServlet.java:82)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
> 	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
> 	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:401)
> 	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
> 	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
> 	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
> 	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450)
> 	at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
> 	at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
> 	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
> 	at org.mortbay.jetty.Server.handle(Server.java:326)
> 	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
> 	at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:945)
> 	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
> 	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
> 	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
> 	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
> 	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
> 
> 
> 
> 
> On Mon, Apr 18, 2011 at 11:51 PM, Raymond Feng <enjoyjava@gmail.com> wrote:
> Hi,
> 
> Do you use List as the parameter or return type of a remotable operation? If so, please
try to wrap the collection into a class that contains the list.
> 
> Raymond
> 
> Sent from my iPad
> 
> On Apr 18, 2011, at 6:38 PM, Monosij Dutta-Roy <monosij.forums@gmail.com> wrote:
> 
>> hi Simon - Here's the full trace.
>> 
>> Thanks.
>> 
>> monosij
>> 
>> [INFO] Started Jetty Server
>> QueryServlet reference injection failed, using ComponentContext
>> **************************************************
>> select distinct * from vw_patient_encounter WHERE sex = 'F' AND cptCode = '77057'
AND rownum <= 10
>> Count: 9
>> 2011-04-18 21:35:43.565:WARN::/qmAppSCA01/QueryServlet
>> java.lang.IllegalArgumentException: Pass-by-value is not supported for the given
object: java.util.ArrayList
>> 	at org.apache.tuscany.sca.databinding.javabeans.JavaBeansDataBinding.copy(JavaBeansDataBinding.java:132)
>> 	at org.apache.tuscany.sca.databinding.DefaultDataBindingExtensionPoint$LazyDataBinding.copy(DefaultDataBindingExtensionPoint.java:169)
>> 	at org.apache.tuscany.sca.databinding.impl.MediatorImpl.copy(MediatorImpl.java:542)
>> 	at org.apache.tuscany.sca.databinding.impl.MediatorImpl.copyOutput(MediatorImpl.java:615)
>> 	at org.apache.tuscany.sca.binding.sca.provider.SCABindingInvoker.processResponse(SCABindingInvoker.java:120)
>> 	at org.apache.tuscany.sca.core.invocation.InterceptorAsyncImpl.invoke(InterceptorAsyncImpl.java:59)
>> 	at org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:322)
>> 	at org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:278)
>> 	at org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:125)
>> 	at org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.doInvokeSync(AsyncJDKInvocationHandler.java:239)
>> 	at org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.invoke(AsyncJDKInvocationHandler.java:161)
>> 	at $Proxy34.getPatients(Unknown Source)
>> 	at org.rd.qm.impl.QueryControllerImpl.getPatients(QueryControllerImpl.java:29)
>> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>> 	at java.lang.reflect.Method.invoke(Method.java:616)
>> 	at org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:164)
>> 	at org.apache.tuscany.sca.binding.sca.provider.SCABindingLocalInvocationInterceptor.invoke(SCABindingLocalInvocationInterceptor.java:49)
>> 	at org.apache.tuscany.sca.core.invocation.InterceptorAsyncImpl.invoke(InterceptorAsyncImpl.java:58)
>> 	at org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:322)
>> 	at org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:278)
>> 	at org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:125)
>> 	at org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.doInvokeSync(AsyncJDKInvocationHandler.java:239)
>> 	at org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.invoke(AsyncJDKInvocationHandler.java:161)
>> 	at $Proxy32.getPatients(Unknown Source)
>> 	at org.rd.qm.impl.QueryServiceImpl.getPatients(QueryServiceImpl.java:21)
>> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>> 	at java.lang.reflect.Method.invoke(Method.java:616)
>> 	at org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:164)
>> 	at org.apache.tuscany.sca.binding.sca.provider.SCABindingLocalInvocationInterceptor.invoke(SCABindingLocalInvocationInterceptor.java:49)
>> 	at org.apache.tuscany.sca.core.invocation.InterceptorAsyncImpl.invoke(InterceptorAsyncImpl.java:58)
>> 	at org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:322)
>> 	at org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:278)
>> 	at org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:125)
>> 	at org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.doInvokeSync(AsyncJDKInvocationHandler.java:239)
>> 	at org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.invoke(AsyncJDKInvocationHandler.java:161)
>> 	at $Proxy31.getPatients(Unknown Source)
>> 	at org.rd.qm.servlet.QueryServlet.service(QueryServlet.java:80)
>> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
>> 	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
>> 	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:401)
>> 	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
>> 	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
>> 	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
>> 	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450)
>> 	at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
>> 	at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
>> 	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
>> 	at org.mortbay.jetty.Server.handle(Server.java:326)
>> 	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
>> 	at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:945)
>> 	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
>> 	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
>> 	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
>> 	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
>> 	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
>> 
>> --------------------------------------------------
>> 
>> 
>> On Mon, Apr 18, 2011 at 5:55 AM, Simon Nash <nash@apache.org> wrote:
>> This stack trace appears to be incomplete.  Please can you attach
>> the full stack trace.
>> 
>>  Simon
>> 
>> 
>> Monosij Dutta-Roy wrote:
>> 
>> I am getting the following error when executing a query in webapp I have been working
on.
>> All composites load fine in webapp and I also tried out a few empty get / sets with
strings.
>> However on db access and in returning an ArrayList of Person.
>> Person is the interface to concrete class PatientImpl. I am passing ArrayList of
Person.
>> I put PatientImpl objects in ArrayList of Person.
>> ---------------------------------------------------------
>> Problem accessing /qmAppSCA01/QueryServlet. Reason:
>> 
>>    Pass-by-value is not supported for the given object: java.util.ArrayList
>> Caused by:
>> 
>> java.lang.IllegalArgumentException: Pass-by-value is not supported for the given
object: java.util.ArrayList
>> at org.apache.tuscany.sca.databinding.javabeans.JavaBeansDataBinding.copy(JavaBeansDataBinding.java:132)
>> at org.apache.tuscany.sca.databinding.DefaultDataBindingExtensionPoint$LazyDataBinding.copy(DefaultDataBindingExtensionPoint.java:169)
>> at org.apache.tuscany.sca.databinding.impl.MediatorImpl.copy(MediatorImpl.java:542)
>> at org.apache.tuscany.sca.databinding.impl.MediatorImpl.copyOutput(MediatorImpl.java:615)
>> at org.apache.tuscany.sca.binding.sca.provider.SCABindingInvoker.processResponse(SCABindingInvoker.java:120)
>> at org.apache.tuscany.sca.core.invocation.InterceptorAsyncImpl.invoke(InterceptorAsyncImpl.java:59)
>> at org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:322)
>> at org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:278)
>> at org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:125)
>> at org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.doInvokeSync(AsyncJDKInvocationHandler.java:239)
>> at org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.invoke(AsyncJDKInvocationHandler.java:161)
>> at $Proxy34.getPatients(Unknown Source)
>> at org.rd.qm.impl.QueryControllerImpl.getPatients(QueryControllerImpl.java:29)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>> at java.lang.reflect.Method.invoke(Method.java:616)
>> ...
>> ...
>> ---------------------------------------------------------
>> When:
>> QueryControllerImpl in qmController (QueryControllerComponent/QueryController) is
attempting to return the ArrayList of Persons to
>> QueryServiceImpl in qmAppSCA01
>> 
>> QueryControllerImpl in qmController being called:
>> public ArrayList<Person> getPatients(HashMap<String, String> requestMap_)
{
>> String query = queryComposer.getQuery(requestMap_);
>> ArrayList<Person> patients = queryExecutor.getPatients(query);
>> return patients;
>> }
>> ---------------------------------------------------------
>> By:
>> QueryServiceImpl from qmAppSCA01:
>> public ArrayList<Person> getPatients(HashMap<String, String> requestMap_)
{
>> return queryController.getPatients(requestMap_);
>> }
>> ---------------------------------------------------------
>> Composte defs for QueryControllerComponent and QueryServiceComponent
>> ---------------------------------------------------------
>>    <component name="QueryControllerComponent">
>>        <implementation.java class="org.rd.qm.impl.QueryControllerImpl"/>
>>        <service name="QueryController">
>>            <interface.java interface="org.rd.qm.QueryController"/>
>>        </service>
>>        <reference name="queryComposer" target="QueryComposerComponent/QueryComposer">
>>            <interface.java interface="org.rd.qm.QueryComposer"/>
>>        </reference>
>>        <reference name="queryExecutor" target="QueryExecutorComponent/QueryExecutor">
>>            <interface.java interface="org.rd.qm.QueryExecutor"/>
>>        </reference>
>>    </component>
>> ---------------------------------------------------------
>>    <component name="QueryServiceComponent">
>>        <implementation.java class="org.rd.qm.impl.QueryServiceImpl"/>
>>        <service name="QueryService">
>> <interface.java interface="org.rd.qm.QueryService" />
>>        </service>
>>        <reference name="queryController" target="QueryControllerComponent/QueryController">
>>         <interface.java interface="org.rd.qm.QueryController" />
>>        </reference>
>>    </component>
>> ---------------------------------------------------------
>> 
>> Thanks for your help.
>> 
>> monosij
>> 
>> 
> 
> <QueryOrchestratorImpl.java>
> <QueryResultsImpl.java>
> <QueryServiceImpl.java>
> <qmController.composite>
> <qmAppSCA01.composite>

Mime
View raw message