openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Curtis <curti...@gmail.com>
Subject Re: NoSuchMethodError pcGetManagedFieldCount() error
Date Sun, 30 Jun 2013 21:00:10 GMT
It sounds like your mapped super class isn't getting enhanced? Try adding
your mapped super class to the <class> section of your persistence.xml file.

Thanks,
Rick


On Sun, Jun 30, 2013 at 3:45 PM, Serdyn du Toit <dutoitns@gmail.com> wrote:

> Okay, sorry - that was the last stacktrace and there was a previous one.
>  So the error I'm still getting:
>
> 543  clusterdb  TRACE  [main] openjpa.MetaData -
> java.lang.NoSuchMethodError:
>
> code.shared.AbstractDataBean.pcGetManagedFieldCount()Ijava.lang.NoSuchMethodError:
> code.shared.AbstractDataBean.pcGetManagedFieldCount()I
> at code.TestDataBean.<clinit>(TestDataBean.java)
>
> I'll refactor my standalone project to just use a portable in-memory
> database like HsqlDb and submit a bug attaching my code.  Except if there's
> something wrong with the usage of @Id within a @MappedSuperClass as above?
>
> Kind regards,
> Serdyn du Toit
>
>
>
> On Sun, Jun 30, 2013 at 8:51 PM, Serdyn du Toit <dutoitns@gmail.com>
> wrote:
>
> > Okay, can't get the standalone application to work due to another error.
> > Not sure what's going on :/
> >
> > Stacktrace:
> > INFO: Created cluster connection 'localhost:1186' with node id 0.
> > java.lang.NoClassDefFoundError: Could not initialize class
> > code.TestDataBean
> > at java.lang.Class.forName0(Native Method)
> > at java.lang.Class.forName(Unknown Source)
> >  at
> >
> org.apache.openjpa.meta.MetaDataRepository.classForName(MetaDataRepository.java:1558)
> > at
> >
> org.apache.openjpa.meta.MetaDataRepository.loadPersistentTypesInternal(MetaDataRepository.java:1534)
> >  at
> >
> org.apache.openjpa.meta.MetaDataRepository.loadPersistentTypes(MetaDataRepository.java:1512)
> > at
> >
> org.apache.openjpa.kernel.AbstractBrokerFactory.loadPersistentTypes(AbstractBrokerFactory.java:282)
> >  at
> >
> org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java:238)
> > at
> >
> org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:212)
> >  at
> >
> org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
> > at
> >
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
> >  at
> >
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:154)
> > at
> >
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
> >  at test.OpenJpaTest.test(OpenJpaTest.java:19)
> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >  at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> > at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> >  at java.lang.reflect.Method.invoke(Unknown Source)
> > at
> >
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
> >  at
> >
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> > at
> >
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
> >  at
> >
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
> > at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
> >  at
> >
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
> > 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.junit.runners.ParentRunner.run(ParentRunner.java:300)
> >  at
> >
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
> > 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)
> >
> >
> > On Sun, Jun 30, 2013 at 6:43 PM, Serdyn du Toit <dutoitns@gmail.com
> >wrote:
> >
> >> I'm still having this problem - even with the generics refactored out of
> >> the code.
> >>
> >> I think there might be a problem with having the @Id on the
> >> @MappedSuperclass.  If I have everything in just one object everything
> is
> >> okay.  I'll see about creating some freestanding code where this
> happens -
> >> but if someone can glean a solution from the code below that would be
> >> appreciated.
> >>
> >>
> >>
> >> Stacktrace:
> >> java.lang.NoSuchMethodError:
> >>
> com.mycode.core.util.dao.databeans.AbstractDataBean.pcGetManagedFieldCount()I
> >>  at
> >>
> com.mycode.core.util.dao.testobjects.TestDataBean.<clinit>(TestDataBean.java:41)
> >> at
> >>
> com.mycode.core.util.dao.testobjects.TestDataBeanMockGenerator.generateMock(TestDataBeanMockGenerator.java:13)
> >>  at
> >>
> com.mycode.core.util.dao.testobjects.TestDataBeanMockGenerator.createMock(TestDataBeanMockGenerator.java:18)
> >> at
> >>
> com.mycode.core.util.dao.daos.test.TestDataBeanDao_RegressionTest.testCreate_Success(TestDataBeanDao_RegressionTest.java:14)
> >>  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> >>  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> >> at java.lang.reflect.Method.invoke(Unknown Source)
> >>  at
> >>
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
> >> at
> >>
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> >>  at
> >>
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
> >> at
> >>
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
> >>  at
> >>
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
> >> at
> >>
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
> >>  at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
> >> at
> >>
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
> >>  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.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
> >> at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
> >>  at
> >>
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
> >> 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)
> >>
> >>
> >>
> >> Class hierarchy:
> >>
> >> 1. Interface top of the object graph:
> >> public interface IDataBean<DATABEAN extends IDataBean<DATABEAN>>
{
> >>
> >> 2. Second layer:
> >> @MappedSuperclass
> >> public abstract class DataBean<DATABEAN extends DataBean<DATABEAN>>
> >> implements IDataBean<DATABEAN> {
> >>
> >>     @Id
> >>     public Long id = null;
> >>
> >> 3. Third layer
> >> @MappedSuperclass
> >> public abstract class AbstractDataBean<DATABEAN extends
> >> AbstractDataBean<DATABEAN>>
> >>  extends DataBean<DATABEAN> {
> >>
> >> 4. Concrete
> >> @Entity
> >> public class TestDataBean extends AbstractDataBean<TestDataBean> {
> >>
> >> Kind regards,
> >> Serdyn du Toit
> >>
> >>
> >> On Mon, Jun 3, 2013 at 10:42 PM, Pinaki Poddar <ppoddar@apache.org
> >wrote:
> >>
> >>> The type of a field that represents persistent identity must be one of
> >>> java.lang.Integer, Long etc.  and well-specified by JPA specification.
> A
> >>> generic type (i.e. a type non-determinable at compile time) is not
> >>> permitted
> >>> by spec.
> >>>
> >>> > OpenJpa implementation might be struggling to determine the "id"
> field
> >>> > type in my @MappedSuperclass
> >>>
> >>> It is a struggle that OpenJPA is bound to lose, as any compiler will as
> >>> well.
> >>>
> >>>
> >>>
> >>>
> >>> -----
> >>> Pinaki Poddar
> >>> Chair, Apache OpenJPA Project
> >>> --
> >>> View this message in context:
> >>>
> http://openjpa.208410.n2.nabble.com/NoSuchMethodError-pcGetManagedFieldCount-error-tp7584060p7584063.html
> >>> Sent from the OpenJPA Users mailing list archive at Nabble.com.
> >>>
> >>
> >>
> >
>



-- 
*Rick Curtis*

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message