Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Eclipselink 1.0(Error Executing Unit Tests within Eclipse)
Eclipselink 1.0 [message #881473] Mon, 04 June 2012 12:17 Go to next message
Ron DiFrango is currently offline Ron DiFrango
Messages: 5
Registered: June 2012
Junior Member
I'm attempting to execute integration tests within Eclipse 3.5 and I'm using the Weblogic built-in version of ecpliselink of 1.0 and when I run them I get the following exception:

EL Severe]: 2012-06-04 12:07:36.503--ServerSession(10460287)--java.lang.NullPointerException
	at java.util.ResourceBundle.getBundle(ResourceBundle.java:960)
	at org.eclipse.persistence.exceptions.i18n.ExceptionMessageGenerator.buildMessage(ExceptionMessageGenerator.java:47)
	at org.eclipse.persistence.exceptions.ValidationException.errorDecryptingPassword(ValidationException.java:845)
	at org.eclipse.persistence.internal.security.JCEEncryptor.decryptPassword(JCEEncryptor.java:102)
	at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.updateLogins(EntityManagerSetupImpl.java:1064)
	at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.updateServerSession(EntityManagerSetupImpl.java:1356)
	at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:260)
	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:146)
	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:198)
	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:186)
	at com.capitalone.epf.preference.service.ApplicationServiceIntTest$ContextConfiguration.entityManager(ApplicationServiceIntTest.java:50)
	at com.capitalone.epf.preference.service.ApplicationServiceIntTest$ContextConfiguration$$EnhancerByCGLIB$$5a97a193.CGLIB$entityManager$3(<generated>)
	at com.capitalone.epf.preference.service.ApplicationServiceIntTest$ContextConfiguration$$EnhancerByCGLIB$$5a97a193$$FastClassByCGLIB$$a000a0b5.invoke(<generated>)
	at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:215)
	at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:280)
	at com.capitalone.epf.preference.service.ApplicationServiceIntTest$ContextConfiguration$$EnhancerByCGLIB$$5a97a193.entityManager(<generated>)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:149)
	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:570)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1015)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:911)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
	at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:103)
	at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:1)
	at org.springframework.test.context.TestContext.loadApplicationContext(TestContext.java:124)
	at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:148)
	at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:109)
	at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:75)
	at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:321)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:211)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:288)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:290)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
	at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
	at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)


This code happens when the following is executed:

@Bean
		EntityManager entityManager() {
			return entityManagerFactory().createEntityManager();
		}

		@Bean(name = "epfPreferencePU")
		EntityManagerFactory entityManagerFactory() {
			return Persistence
					.createEntityManagerFactory("epfPreferenceTestPU");
		}


Any thoughts on why this occurring? The interesting thing is that this runs ok from our command line Ant build and it deploys and runs within the container.
Re: Eclipselink 1.0 [message #881478 is a reply to message #881473] Mon, 04 June 2012 12:22 Go to previous messageGo to next message
Ron DiFrango is currently offline Ron DiFrango
Messages: 5
Registered: June 2012
Junior Member
One other thing, here is the persistence.xml

<persistence-unit name="testPU"
		transaction-type="RESOURCE_LOCAL">
		<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>

		<mapping-file>META-INF/orm.xml</mapping-file>

		<properties>
			<property name="javax.persistence.logging.level" value="FINEST" />
			<property name="javax.persistence.jdbc.driver" value="oracle.jdbc.OracleDriver" />
			<property name="javax.persistence.jdbc.url" value="jdbc:oracle:thin:@myserver:1540:myserver" />
			<property name="javax.persistence.jdbc.user" value="user" />
			<property name="javax.persistence.jdbc.password" value="*****" />
			
			<property name="eclipselink.target-database" value="Oracle" />
			<property name="javax.persistence.validation.mode" value="NONE" />
		</properties>

	</persistence-unit>


and orm.xml

<entity-mappings>

	<mapped-superclass
		class="com.test.entity.PreferenceEntityBase">

		<attributes>
			<basic name="createDate">
				<column name="CRET_TS" />
				<temporal>TIMESTAMP</temporal>
			</basic>

			<basic name="updateDate">
				<column name="UPDT_TS" />
				<temporal>TIMESTAMP</temporal>
			</basic>
		</attributes>

	</mapped-superclass>

	<entity class="com.test.entity.Preference"
		access="PROPERTY">
		<table name="EPF_PREFNC" />

		<sequence-generator name="EPF_PREF_SEQ"
			allocation-size="1" sequence-name="PREFNC_ID_SEQ" initial-value="1" />

		<attributes>
			<id name="preferenceId">
				<column name="PREFNC_ID" />
				<generated-value strategy="SEQUENCE" generator="EPF_PREF_SEQ" />
			</id>

			<basic name="preferenceName">
				<column name="USER_PREFNC_NM" />
			</basic>

			<basic name="preferenceDescription">
				<column name="USER_PREFNC_DESC" />
			</basic>

			<basic name="displayOrderValue">
				<column name="DSPL_ORD_NUM" />
			</basic>

			<version name="version">
				<column name="UPDT_VERS_CNTL_NUM" />
			</version>

			<many-to-one name="user"
				target-entity="com.test.entity.User" fetch="EAGER"
				optional="false">
				<join-column name="USER_ID" />
			</many-to-one>

			<many-to-one name="preferenceCategory"
				target-entity="com.test.entity.PreferenceCategory"
				fetch="EAGER" optional="false">
				<join-column name="PREFNC_CATG_CD" />
			</many-to-one>

			<many-to-one name="application"
				target-entity="com.test.entity.Application"
				fetch="EAGER" optional="false">
				<join-column name="APPN_SYS_CD" />
			</many-to-one>

			<one-to-many name="preferenceDetails" fetch="EAGER"
				target-entity="com.test.entity.PreferenceDetail"
				mapped-by="preference">
				<cascade>
					<cascade-all />
				</cascade>
			</one-to-many>
			<transient name="applicationSystemCode" />
			<transient name="preferenceCategoryCode" />

		</attributes>

	</entity>
	<entity class="com.test.entity.PreferenceDetail"
		access="PROPERTY">
		<table name="EPF_PREFNC_DETL" />
		<sequence-generator name="EPF_PREF_DETL_SEQ"
			allocation-size="1" sequence-name="PREFNC_DETL_ID_SEQ" initial-value="1" />

		<attributes>
			<id name="preferenceDetailId">
				<column name="PREFNC_DETL_ID" />
				<generated-value strategy="SEQUENCE" generator="EPF_PREF_DETL_SEQ" />
			</id>

			<basic name="preferenceDetailDescription">
				<column name="PREFNC_DETL_TXT" />
			</basic>

			<basic name="displayOrderValue">
				<column name="DSPL_ORD_NUM" />
			</basic>

			<version name="version">
				<column name="UPDT_VERS_CNTL_NUM" />
			</version>

			<many-to-one name="preference" fetch="EAGER">
				<join-column name="PREFNC_ID" />
			</many-to-one>

		</attributes>
	</entity>

	<entity class="com.test.entity.User"
		access="PROPERTY">
		<table name="EPF_USER" />
		<attributes>
			<id name="userId">
				<column name="USER_ID" />
			</id>

			<basic name="userTypeCode">
				<column name="USER_TYPE_CD" />
			</basic>


			<one-to-many name="preferences" fetch="LAZY"
				target-entity="com.test.entity.Preference">
				<join-column name="User_Id" />
				<cascade>
					<cascade-all />
				</cascade>
			</one-to-many>
		</attributes>
	</entity>

	<entity class="com.test.entity.PreferenceCategory"
		access="PROPERTY">
		<table name="EPF_PREFNC_CATG" />
		<attributes>
			<id name="preferenceCategoryCode">
				<column name="PREFNC_CATG_CD" />
			</id>

			<basic name="preferenceCategoryDescription">
				<column name="PREFNC_CATG_DESC" />
			</basic>

		</attributes>
	</entity>

	<entity class="com.test.entity.Application"
		access="PROPERTY">
		<table name="EPF_APPN" />
		<attributes>
			<id name="applicationSystemCode">
				<column name="APPN_SYS_CD" />
			</id>

			<basic name="applicationSystemName">
				<column name="APPN_SYS_NM" />
			</basic>

		</attributes>
	</entity>
</entity-mappings>
Re: Eclipselink 1.0 [message #881954 is a reply to message #881478] Tue, 05 June 2012 10:39 Go to previous messageGo to next message
James Sutherland is currently offline James Sutherland
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

What JVM version are you using?

java.util.ResourceBundle.getBundle(ResourceBundle.java:960)

Look at line 960 in your JVM source code, it does match with mine, but the closest line I see is something that throws NullPointer if the class loader is null.
Is it possible that in Eclipse the class loader for the EclipseLink classes is null? This would be very odd...
Are you using OSGi?


James : Wiki : Book : Blog : Twitter
Re: Eclipselink 1.0 [message #881993 is a reply to message #881954] Tue, 05 June 2012 11:44 Go to previous message
Ron DiFrango is currently offline Ron DiFrango
Messages: 5
Registered: June 2012
Junior Member
I'm NOT using OSGi and the JVM is the JRockit 1.6 version that is bundled with Weblogic 10.3.2. I have also seen this same error with JRockit from 10.3.5.
Previous Topic:Update Query stored procedure cannot transparently handle nullable values
Next Topic:class not found javax/validation/ValidatorFactory and ValidationException.errorDecryptingPassword
Goto Forum:
  


Current Time: Sat Aug 30 22:33:40 EDT 2014

Powered by FUDForum. Page generated in 0.01696 seconds