- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 27
 
Description
New Play application created through sbt running with the following versions:
- play-soap v. 1.1.3
 - Play v. 2.6.5
 - Scala v. 2.11.11
 
My Java-classes are generated from the following internal service:
WsdlKeys.wsdlUrls in Compile += url("http://172.x.x.x/SOAP/PortalService.svc?wsdl")
Below is a simple index method in my controller. I've deliberately avoided the return type CompletionStage<Result> on the method for simplicity's sake:
     public Result index() {
        ObjectFactory factory = new ObjectFactory();
        PortalUserDTO portalUserDTO = new PortalUserDTO();
	portalUserDTO.setUsername(factory.createPortalUserDTOUsername("test"));
        portalUserDTO.setFullName(factory.createPortalUserDTOFullName("Test User"));
        ICitizenEndpoint client = portalService.getPortalServiceCitizenEndpoint();
        
        CompletionStage<PortalCitizenDTO> citizen = client.fetchCitizen(10, portalUserDTO);
        // Thread.sleep(500);
        
        citizen.thenApply(x -> x);
        return ok("Everything is fine.");
    }The NullPointerException appears to be sporadic (roughly 20% of the time), and can be avoided by sleeping the running thread. Below is a stack trace of when the exception is thrown:
Exception in thread "default-workqueue-1" java.lang.NullPointerException
	at org.apache.cxf.endpoint.ClientImpl$1.onMessage(ClientImpl.java:505)
	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream$1.run(HTTPConduit.java:1185)
	at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$3.run(AutomaticWorkQueueImpl.java:428)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$AWQThreadFactory$1.run(AutomaticWorkQueueImpl.java:353)
	at java.lang.Thread.run(Thread.java:748)
Wireshark shows that the endpoint does provide it with data.
I'm unsure if this behaviour was introduced when you moved from promises to CompletionStages, but I imagine that it is likely. This does prevent me from using the plugin.