Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] NPE when running with option javaagent:eclipselink.jar

Michael,
    If you were running in an EE container (does not look like it since you are using an agent) - Try changing the order of your modules in application.xml in your EAR as in some cases (JSF managed-bean with an @EJB injection for example is one case) - the jar containing an injected PersistenceContext (usually a SSB in an ejb.jar) must be loaded first (where it is weaved/instrumented) before any WAR or other ejb.jar module that injects the SSB that contains the persistence unit.
    See bug # 323148 for GlassFish and WebLogic in this case - if it helps your situation.
http://bugs.eclipse.org/323148

    The NullPointerException in this case is thrown by the JVM itself instead of a MethodNotFound Exception when trying to run a weaving function of the form _*_vh.

    thank you
    /michael

James Sutherland wrote:
It seems to be some issue occurred in weaving your class, PlanResultDetail. 
Does this class have inheritance, and was the super class in the same jar?

You can disable the internal weaving option, which should avoid the issue.
("eclipselink.weaving.internal"="false", in your persistence.xml).


Michael Simons wrote:
  
Hello,

when running my application without the option it works fine.
when running with the option "javaagent:eclipselink.jar" the exceptions
shown below are thrown.

Any hints what I'm doing wrong are appreciated.

Kind Regards, Michael


java.lang.NullPointerException
	at
org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getMethodReturnType(PrivilegedAccessHelper.java:302)
	at
org.eclipse.persistence.internal.descriptors.MethodAttributeAccessor.getGetMethodReturnType(MethodAttributeAccessor.java:105)
	at
org.eclipse.persistence.mappings.ForeignReferenceMapping.validateBeforeInitialization(ForeignReferenceMapping.java:1505)
	at
org.eclipse.persistence.descriptors.ClassDescriptor.validateBeforeInitialization(ClassDescriptor.java:5260)
	at
org.eclipse.persistence.descriptors.ClassDescriptor.preInitialize(ClassDescriptor.java:3323)
	at
org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.initializeDescriptors(DatabaseSessionImpl.java:429)
	at
org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.initializeDescriptors(DatabaseSessionImpl.java:406)
	at
org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.postConnectDatasource(DatabaseSessionImpl.java:671)
	at
org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:620)
	at
org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:228)
	at
org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:368)
	at
org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:151)
	at
org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:207)
	at
org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:195)
	at
de.optitool.persistence.DomainController.<init>(DomainController.java:58)
	at
de.optitool.persistence.DomainController.createInstance(DomainController.java:69)
	at de.optitool.persistence.Eval.<init>(Eval.java:33)
	at de.optitool.persistence.Eval.main(Eval.java:61)
java.lang.NoSuchMethodError:
net.uniopt.domain.ot.PlanResultDetail.<init>(Lorg/eclipse/persistence/internal/descriptors/PersistenceObject;)V
	at
net.uniopt.domain.ot.PlanResultDetailDouble.<init>(PlanResultDetailDouble.java)
	at
net.uniopt.domain.ot.PlanResultDetailDouble._persistence_new(PlanResultDetailDouble.java)
	at
org.eclipse.persistence.internal.descriptors.PersistenceObjectInstantiationPolicy.buildNewInstance(PersistenceObjectInstantiationPolicy.java:30)
	at
org.eclipse.persistence.descriptors.ClassDescriptor.selfValidationAfterInitialization(ClassDescriptor.java:3519)
	at
org.eclipse.persistence.descriptors.ClassDescriptor.validateAfterInitialization(ClassDescriptor.java:5247)
	at
org.eclipse.persistence.descriptors.ClassDescriptor.postInitialize(ClassDescriptor.java:3241)
	at
org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.initializeDescriptors(DatabaseSessionImpl.java:463)
	at
org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.initializeDescriptors(DatabaseSessionImpl.java:406)
	at
org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.postConnectDatasource(DatabaseSessionImpl.java:671)
	at
org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:620)
	at
org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:228)
	at
org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:368)
	at
org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:151)
	at
org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:207)
	at
org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:195)
	at
de.optitool.persistence.DomainController.<init>(DomainController.java:58)
	at
de.optitool.persistence.DomainController.createInstance(DomainController.java:69)
	at de.optitool.persistence.Eval.<init>(Eval.java:33)
	at de.optitool.persistence.Eval.main(Eval.java:61)


    

-----
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland 
http://www.eclipse.org/eclipselink/
 EclipseLink ,  http://www.oracle.com/technology/products/ias/toplink/
TopLink 
Wiki:  http://wiki.eclipse.org/EclipseLink EclipseLink , 
http://wiki.oracle.com/page/TopLink TopLink 
Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , 
http://www.nabble.com/EclipseLink-f26430.html EclipseLink 
Book:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence 
  


Back to the top