WSWS3344W / TRAS0014I / NullPointerException when spawning threads with the Web Services Engine in the Web Container
 Technote (FAQ)
 
Problem
The web service client logs the following messages to the SystemOut.log:

[7/19/05 18:26:23:672 CDT] 822c64c EngineConfigu W
com.ibm.ws.webservices.engine.configuration.EngineConfigurationFactoryFi
nder WSWS3344W: Warning: Factory
com.ibm.ws.webservices.axis.ws.configuration.ServerConfigurationFactory
Ignored: invoke method failed: public static EngineConfigurationFactory
newFactory(Object).
[7/19/05 18:26:23:688 CDT] 822c64c EngineConfigu W
com.ibm.ws.webservices.engine.configuration.EngineConfigurationFactoryFi
nder TRAS0014I: The following exception was logged
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a(Compiled Code))
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a(Compiled Code))
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java(Compiled Code))
at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
at
com.ibm.ws.webservices.engine.configuration.EngineConfigurationFactoryFi
nder.newFactory(EngineConfigurationFactoryFinder.java:238)
...
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a(Compiled Code))
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a(Compiled Code))
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java(Compiled Code))
at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
at
com.ibm.ws.webservices.engine.configuration.EngineConfigurationFactoryFi
nder.newFactory(EngineConfigurationFactoryFinder.java:238)
...
java.lang.NullPointerException
at com.ibm.ws.webservices.collaborators.MetaDataHolder.getHolder(MetaDataHolder.java:40)
at com.ibm.ws.webservices.component.WSServerImpl.getServerMetaData(WSServerImpl.java:2123)
at com.ibm.ws.webservices.component.WSServerImpl.isServerWebServiceEnabled(WSServerImpl.java:441)
at com.ibm.ws.webservices.axis.ws.configuration.ServerConfigurationFactory.newFactory(ServerConfigurationFactory.java:64)


This error occurs when trying to spawn a new thread within the Web Container.
 
Cause
The issue is related to creating a new *ServiceLocator class inside user-spawned thread, a spawned-thread is a thread started from a J2EE application; the spawned thread does not inherit the entire J2EE context, which is why this problem occurs. The NullPointerException occurs because the MetaData is not being copied over to the new thread by the container. The J2EE specification does not provide explicit support for user-spawned threads within a container.
 
Solution
Unfortunately, catching the NullPointerException is not a suitable solution. In general, there is no place to add an effective try/catch block. Without the MetaData information, the Web service engine will continue to have problem after problem even if the first NullPointerException is caught.

The correct solution is to not spawn new threads within the Web Container (the EJB Container does not support user-defined threads). Alternatively, asynchronous beans can be used. Asynchronous beans do inherit context because the application server will control the threading of these resources.
 
 
Cross Reference information
Segment Product Component Platform Version Edition
Application Servers Runtimes for Java Technology Java SDK
 
 


Document Information


Product categories: Software > Application Servers > Distributed Application & Web Servers > WebSphere Application Server > Web Services (for example: SOAP or UDDI or WSGW or WSIF)
Operating system(s): AIX
Software version: 6.1
Software edition:
Reference #: 1212988
IBM Group: Software Group
Modified date: Sep 1, 2005