Simon - Thanks for your help with the ServiceReference - it is almost there but am getting a null-pointer error on trying to access the QueryResults. I have attached the error file generated. --------------------- Starting with QueryExecutor where I create the ServiceReference object as: @Reference protected ServiceReference<QueryResults> queryResults;
I pass it back through QueryOrchestrator > QueryService > QueryServlet and I declare the reference in *each* object the same as above. And refer to it in the composite file as: <reference name="queryResults" target="QueryResultsComponent/QueryResults"> <interface.java interface="org.rd.qm.QueryResults"/> </reference> It seems to work as now I do not get the PassByValue error anymore. --------------------- But now I get a null-pointer error when trying to access the QueryResults object in the ServiceReference object. I set the ServiceReference<QueryResults> queryResults in QueryExecutor as: first this way: queryResults.getService().setResults(alPatients); second in this way: QueryResults quRes = new QueryResultsImpl(); quRes.setResults(alPatients); queryResults.getBusinessInterface().cast(quRes); Essentially I am trying to set the ArrayList of results in QueryResults and in QueryServlet trying to display the ArrayList. So in QueryServlet I try to access the ArrayList as: ArrayList alPatients = queryResults.getService().getResults(); This seems to be fine as I get an ArrayList But I get a null-pointer when I try to iterate the ArrayList. --------------------- Questions: 1. Seems the way I set I have set up the ServiceReference is working. Is that the best way to set up the ServiceReference? If so it seems like it would be a good idea to have ServiceReferences as a separate contribution that is 'passed around'. And then take it a step further by setting ServiceReferences as JAXB datatypes. 2. I had to set up the ServiceReference in each obect, even in QueryServlet. QueryServlet which calls QueryService (in same composite) still needs to pass back QueryResults as a ServiceReference since QueryService is defined as Remotable. I was planning on using QueryService for housekeeping while still making it Remotable - and pass back to QueryServlet only what is needed (so servlet framework can be swapped out). But now it seems I have to make the QueryServlet (ie the Servlet framework) depend on QueryResult or such. Is there a way to avoid this? Am I thinking about this the right way? I am thinking QueryServlet should only know and depend on QueryService in the same composite. I guess then QueryService has to be Local? 3. This is a question for later once I get this working but I am currently importing QueryOrchestrator in QueryService (webapp). Would there be a way to go around this and not have QueryOrchestrator connected at all. I am assuming I can go the ws.binding route and just call the webservice that QueryOrchestrator will service - but I lose the non-ws.binding connectivity. Would there be a way to just depend on QueryResults - that is shared by everyone and is a ServiceReference - to make it happen. I am just shooting in dark here a little. But my thought is I should only want to depend on QueryResults and not worry about how I get QueryResults. I guess I will need to try some approaches. 4. This maybe related, not a big deal but strange. I am using Eclipse Helios on Ubuntu and since I started using ServiceReference - the objects from the third composite: domainBCA - which are Person and PhysicalLocation have an error marker on them as 'import not found'. I tried deleting them and recreating the imports, it still remains. Removing ServiceReference makes those go away. However it does not create a problem as such as Maven compiles fine - but it is happening in both the composites: controller and servlet. --------------------- Thanks for all your help and patience. monosijTitle: Error 500 INTERNAL_SERVER_ERROR
HTTP ERROR 500
Problem accessing /qmAppSCA01/QueryServlet. Reason:
INTERNAL_SERVER_ERROR
Caused by:
java.lang.NullPointerException at org.rd.qm.servlet.QueryServlet.getPatients(QueryServlet.java:74) at org.rd.qm.servlet.QueryServlet.service(QueryServlet.java:91) 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)
Powered by Jetty://