Announcement Announcement Module
Collapse
No announcement yet.
What is shouldUseShadowLoader() ? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • What is shouldUseShadowLoader() ?

    Can someone help me understand what shadow loading is? The reason I ask is I created an application that uses EclipseLink, CXF (JAXRS), and Spring. I could not get the application to work without overriding it (jpa-standalone-comp.zip).

    Code:
    	@Override
    	protected boolean shouldUseShadowLoader() {
    		return false;
    	}
    I then created another project with the same classes and configuration, this time it would not run with it. (jpa-test-three.zip)

    org.springframework.dao.InvalidDataAccessApiUsageE xception: Object: jpa.standalone.comp.Employee@1d20ae9 is not a known entity type.; nested exception is java.lang.IllegalArgumentException: Object: jpa.standalone.comp.Employee@1d20ae9 is not a known entity type.
    at org.springframework.orm.jpa.EntityManagerFactoryUt ils.convertJpaAccessExceptionIfPossible(EntityMana gerFactoryUtils.java:271)
    at org.springframework.orm.jpa.DefaultJpaDialect.tran slateExceptionIfPossible(DefaultJpaDialect.java:12 0)
    at org.springframework.dao.support.DataAccessUtils.tr anslateIfNecessary(DataAccessUtils.java:212)
    at org.springframework.orm.jpa.JpaAccessor.translateI fNecessary(JpaAccessor.java:152)
    at org.springframework.orm.jpa.JpaTemplate.execute(Jp aTemplate.java:189)
    at org.springframework.orm.jpa.JpaTemplate.persist(Jp aTemplate.java:266)
    at jpa.standalone.comp.CustomerResourceDAO.save(Custo merResourceDAO.java:48)
    at jpa.standalone.comp.CustomerResourceTest.onSetUpIn Transaction(CustomerResourceTest.java:31)
    at org.springframework.test.AbstractTransactionalSpri ngContextTests.onSetUp(AbstractTransactionalSpring ContextTests.java:176)
    at org.springframework.test.AbstractSingleSpringConte xtTests.setUp(AbstractSingleSpringContextTests.jav a:89)
    at junit.framework.TestCase.runBare(TestCase.java:132 )
    at org.springframework.test.ConditionalTestCase.runBa re(ConditionalTestCase.java:69)
    at org.springframework.test.annotation.AbstractAnnota tionAwareTransactionalTests.access$001(AbstractAnn otationAwareTransactionalTests.java:47)
    at org.springframework.test.annotation.AbstractAnnota tionAwareTransactionalTests$1.run(AbstractAnnotati onAwareTransactionalTests.java:113)
    at org.springframework.test.annotation.AbstractAnnota tionAwareTransactionalTests.runTest(AbstractAnnota tionAwareTransactionalTests.java:176)
    at org.springframework.test.annotation.AbstractAnnota tionAwareTransactionalTests.runTestTimed(AbstractA nnotationAwareTransactionalTests.java:150)
    at org.springframework.test.annotation.AbstractAnnota tionAwareTransactionalTests.runBare(AbstractAnnota tionAwareTransactionalTests.java:109)
    at org.springframework.test.jpa.AbstractJpaTests.runB are(AbstractJpaTests.java:163)
    at junit.framework.TestResult$1.protect(TestResult.ja va:110)
    at junit.framework.TestResult.runProtected(TestResult .java:128)
    at junit.framework.TestResult.run(TestResult.java:113 )
    at junit.framework.TestCase.run(TestCase.java:124)
    at junit.framework.TestSuite.runTest(TestSuite.java:2 32)
    at junit.framework.TestSuite.run(TestSuite.java:227)
    at org.junit.internal.runners.JUnit38ClassRunner.run( JUnit38ClassRunner.java:91)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestR eference.run(JUnit4TestReference.java:45)
    at org.eclipse.jdt.internal.junit.runner.TestExecutio n.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.runTests(RemoteTestRunner.java:460)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.runTests(RemoteTestRunner.java:673)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.run(RemoteTestRunner.java:386)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.main(RemoteTestRunner.java:196)
    Caused by: java.lang.IllegalArgumentException: Object: jpa.standalone.comp.Employee@1d20ae9 is not a known entity type.
    at org.eclipse.persistence.internal.sessions.UnitOfWo rkImpl.registerNewObjectForPersist(UnitOfWorkImpl. java:4039)
    at org.eclipse.persistence.internal.jpa.EntityManager Impl.persist(EntityManagerImpl.java:251)
    at org.springframework.orm.jpa.JpaTemplate$5.doInJpa( JpaTemplate.java:268)
    at org.springframework.orm.jpa.JpaTemplate.execute(Jp aTemplate.java:184)
    ... 26 more
    Last edited by Mike Carr; Jun 10th, 2009, 04:28 PM. Reason: add stacktrace
Working...
X