Bug 287478 - jpa.delimited.DelimitedPUTestSuite.testReadEmployee failed on WebLogic Server
Summary: jpa.delimited.DelimitedPUTestSuite.testReadEmployee failed on WebLogic Server
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords: test
Depends on:
Blocks:
 
Reported: 2009-08-24 15:33 EDT by Kevin Yuan CLA
Modified: 2022-06-09 10:33 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Yuan CLA 2009-08-24 15:33:24 EDT
When trying to run jpa.delimited.DelimitedPUTestSuite on WebLogic server, the "testPopulate" failed during em.refresh(pn)with the following exception (but all other three tests passed on WLS):

  <testcase classname="org.eclipse.persistence.testing.tests.jpa.delimited.DelimitedPUTestSuite" name="testPopulate" time="2.64">
    <error message="The method public abstract void javax.persistence.EntityManager.refresh(java.lang.Object) must be called in the context of a transaction." type="javax.persistence.TransactionRequiredException">javax.persistence.TransactionRequiredException: The method public abstract void javax.persistence.EntityManager.refresh(java.lang.Object) must be called in the context of a transaction.
	at weblogic.deployment.BasePersistenceContextProxyImpl.validateInvocation(BasePersistenceContextProxyImpl.java:121)
	at weblogic.deployment.BasePersistenceContextProxyImpl.invoke(BasePersistenceContextProxyImpl.java:86)
	at weblogic.deployment.TransactionalEntityManagerProxyImpl.invoke(TransactionalEntityManagerProxyImpl.java:89)
	at weblogic.deployment.BasePersistenceContextProxyImpl.invoke(BasePersistenceContextProxyImpl.java:80)
	at weblogic.deployment.TransactionalEntityManagerProxyImpl.invoke(TransactionalEntityManagerProxyImpl.java:24)
	at $Proxy81.refresh(Unknown Source)
	at org.eclipse.persistence.testing.tests.jpa.delimited.DelimitedPUTestSuite.testPopulate(DelimitedPUTestSuite.java:99)
	at org.eclipse.persistence.testing.framework.junit.JUnitTestCase.runBareServer(JUnitTestCase.java:411)
	at org.eclipse.persistence.testing.framework.server.TestRunnerBean.runTest(TestRunnerBean.java:87)

If I commented out "em.refresh(pn);" in testPopulate in line 99, The testReadEmployee failed with the following exception:
    <failure message="testCreateEmployee emp not properly persisted" type="junit.framework.AssertionFailedError">junit.framework.AssertionFailedError: testCreateEmployee emp not properly persisted
	at org.eclipse.persistence.testing.tests.jpa.delimited.DelimitedPUTestSuite.testReadEmployee(DelimitedPUTestSuite.java:114)
	at org.eclipse.persistence.testing.framework.junit.JUnitTestCase.runBareServer(JUnitTestCase.java:411)
	at org.eclipse.persistence.testing.framework.server.TestRunnerBean.runTest(TestRunnerBean.java:87)
	at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:281)
	at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:187)
	at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:154)
	at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:126)
	at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:114)
	at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
	at com.bea.core.repackaged.springframework.jee.spi.MethodInvocationVisitorImpl.visit(MethodInvocationVisitorImpl.java:15)
	at weblogic.ejb.container.injection.EnvironmentInterceptorCallbackImpl.callback(EnvironmentInterceptorCallbackImpl.java:54)

Note: only "compareObjects(emp, returnedEmp)" failed, "compareObjects(emp2, returnedWorker)" passed.
Comment 1 Tom Ware CLA 2009-08-25 11:17:29 EDT
Moved refresh inside a transaction
Comment 2 Kevin Yuan CLA 2009-08-25 11:39:26 EDT
After put em.refresh(pn) within a transaction, testPopulate failed with the following exception:
  <testcase classname="org.eclipse.persistence.testing.tests.jpa.delimited.DelimitedPUTestSuite" name="testPopulate" time="7.438">
    <error message="Can not refresh not managed object: PhoneNumber[work]: (709) 555-1234." type="java.lang.IllegalArgumentException">java.lang.IllegalArgumentException: Can not refresh not managed object: PhoneNumber[work]: (709) 555-1234.
	at org.eclipse.persistence.internal.jpa.EntityManagerImpl.refresh(EntityManagerImpl.java:769)
	at org.eclipse.persistence.internal.jpa.EntityManagerImpl.refresh(EntityManagerImpl.java:675)
	at weblogic.deployment.BasePersistenceContextProxyImpl.invoke(BasePersistenceContextProxyImpl.java:90)
	at weblogic.deployment.TransactionalEntityManagerProxyImpl.invoke(TransactionalEntityManagerProxyImpl.java:89)
	at weblogic.deployment.BasePersistenceContextProxyImpl.invoke(BasePersistenceContextProxyImpl.java:80)
	at weblogic.deployment.TransactionalEntityManagerProxyImpl.invoke(TransactionalEntityManagerProxyImpl.java:24)
	at $Proxy65.refresh(Unknown Source)

but testReadEmployee passed.
Comment 3 Tom Ware CLA 2009-08-25 11:59:08 EDT
Updated to properly set id in phoneNumber.setOwner()
Comment 4 Tom Ware CLA 2009-08-25 14:49:18 EDT
Should be address by change above.
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:33:41 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink