openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Heiko Kopp <it-media.k...@daimler.com>
Subject NullPointerException in pcGet-Method
Date Mon, 26 Jul 2010 11:04:16 GMT

Hello everybody,

I've had a weird situation with the OpenJPA Version 1.3 where I got a
NullPointerException inside a pcGet-Method. The Stacktrace is as follows:


java.lang.NullPointerException
	at XXX.model.EconomicRelationship.pcGetgroup(EconomicRelationship.java)
	at XXX.model.EconomicRelationship.getGroup(EconomicRelationship.java:316)
	at
XXX.GetEconomicUnitHandler.createOrGetCurrentUnit(GetEconomicUnitHandler.java:411)
	at
XXX.GetEconomicUnitHandler.fillEconomicUnits(GetEconomicUnitHandler.java:479)
	at
XXX.GetEconomicUnitHandler.handleGetEconomicUnit(GetEconomicUnitHandler.java:623)
	at
XXX.PartnerAccessServiceSoapBindingImpl.getEconomicUnit(PartnerAccessServiceSoapBindingImpl.java:89)
	at sun.reflect.GeneratedMethodAccessor80.invoke(Unknown Source)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:618)
	at
org.apache.axis2.jaxws.server.dispatcher.JavaDispatcher.invokeTargetOperation(JavaDispatcher.java:70)
	at
org.apache.axis2.jaxws.server.dispatcher.JavaBeanDispatcher.invoke(JavaBeanDispatcher.java:97)
	at
org.apache.axis2.jaxws.server.EndpointController.invoke(EndpointController.java:100)
	at
org.apache.axis2.jaxws.server.JAXWSMessageReceiver.receive(JAXWSMessageReceiver.java:142)
	at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:375)
	at
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:305)
	at
com.ibm.ws.websvcs.transport.http.WASAxis2Servlet.doPost(WASAxis2Servlet.java:921)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
	at
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1146)
	at
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:593)
	at
com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:534)
	at
com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:90)
	at
com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:751)
	at
com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1478)
	at
com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:126)
	at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:458)
	at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:387)
	at
com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102)
	at
com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
	at
com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
	at
com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
	at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
	at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:196)
	at
com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:751)
	at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:881)
	at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1497)


I've decompiled the generated pcGetgroup() method:


 private static final EconomicRelationshipGroup
pcGetgroup(EconomicRelationship paramEconomicRelationship)
  {
    if (paramEconomicRelationship.pcStateManager == null)
      return paramEconomicRelationship.group;
    int i = pcInheritedFieldCount + 1;
    paramEconomicRelationship.pcStateManager.accessingField(i);
    return paramEconomicRelationship.group;
  }


It will be called by getGroup with its parameter set to self, leading to the
assumption that paramEconomicRelationship is not 'null'. Thus the only
possible NPE can occur when pcStateManager is null.

Can someone shed some light on me why the pcStateManager can be 'null'? 

Some more information about the system environment:

OpenJPA Version 1.3.0 (SNAPSHOT), the only version information i found was
Bnd-LastModified: 1270704087063
Websphere 6.1.0.29 with EJB 3.0 and Webservice Feature Pack.

The system does NOT have exclusive access to the data. External modification
of the entities occurs and is taken care of by using refresh() on every
delivered entity (even twice sometimes as EntityNotFoundException and/or
ArgumentException may occur).

The Entity itself that countains the 'group' member is defined as follows:


@Entity
@Table(name = "WBZ")
@NamedQueries({
    ....
})
public class EconomicRelationship
{
    @EmbeddedId
    private EconomicRelationshipKey key;

    ....

    @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
    @JoinColumn(name = "GRP_NR", referencedColumnName = "GRP_NR", unique =
true)
    private EconomicRelationshipGroup group;
    
    ....
}


I'm very thankful for any help or idea you may have. So far this is been a
single failure and we where not able to reproduce it. The whole system is
highly multithreaded, the multithreaded property for openJPA is set in
persistence.xml. It is taken care that entity managers are thread safe by
the use of ThreadLocal.

Sincerely,

Heiko
-- 
View this message in context: http://openjpa.208410.n2.nabble.com/NullPointerException-in-pcGet-Method-tp5337474p5337474.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Mime
View raw message