2 Replies Latest reply on Sep 12, 2007 7:03 AM by Robert Hirst

    NullPointerException when calling DataServiceTransaction.refreshFill


      I have tried almost every combination of possibilities and I am still getting java.lang.NullPointerException on a refreshFill.

      My Assembler fills are very generic, as in a lot of different possible fillitems combinations. So, after an update (createItem or deleteItem), I would like the Flex frontend determine which fills need to be refreshed.

      I created a RemoteObject on the same smtp channel as the assemblers, in one of my assemblers. This remoteObject is working well as other method are executing and returning correct results.

      My RemoteObject method is the following:
      public void redoFill(String destination, List fillParameters)
      DataServiceTransaction dtx = DataServiceTransaction.getCurrentDataServiceTransaction();
      dtx.refreshFill( destination, fillParameters); // this line consistently throws a NullPointerException
      //even dtx.refreshFill(destination, Arrays.asList(fillParameters) throws the same exception

      A trace in this method shows that the correct destination is transferred as well as the correct fillParameters

      The parameters on the frontend are added to the calling method like ("my.destination", ["fillparam1", 2, ...etc..])

      What do I need to change in the java method to make this work?

      The relevant stackTrace on the java side is where com.my.flex.assembler.SessionAssembler.redoFill is my RemotingObject method:
      at com.my.flex.assembler.SessionAssembler.resetFill(SessionAssembler.java:60)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at flex.messaging.services.remoting.adapters.JavaAdapter.invoke(JavaAdapter.java:168)
      at flex.messaging.services.RemotingService.serviceMessage(RemotingService.java:173)
      at flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java:1165)
      at flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:727)
      at flex.messaging.endpoints.rtmp.AbstractRTMPServer.dispatchMessage(AbstractRTMPServer.java: 816)
      at flex.messaging.endpoints.rtmp.NIORTMPConnection$RTMPReader.run(NIORTMPConnection.java:424 )
      at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPo olExecutor.java:665)
      at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolEx ecutor.java:690)
      at java.lang.Thread.run(Unknown Source)

      Thanks for any help,

      -Rogier Doekes