You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by Milinda Pathirage <mi...@gmail.com> on 2009/02/12 09:55:39 UTC

org.apache.openjpa.persistence.ArgumentException: No table was given for persistent type

I am using OpenJPA inside a OSGi environment with APache ODE. I got the
following exception while testing the OpenJPA data access layer in Apache
ODE:
<openjpa-0.0.0-rnull fatal user error>
org.apache.openjpa.persistence.ArgumentException: No table was given for
persistent type "org.apache.ode.store.jpa.DeploymentUnitDaoImpl".
    at
org.apache.openjpa.jdbc.meta.MappingInfo.createTable(MappingInfo.java:437)
    at
org.apache.openjpa.jdbc.meta.ClassMappingInfo.getTable(ClassMappingInfo.java:229)
    at
org.apache.openjpa.jdbc.meta.strats.FullClassStrategy.map(FullClassStrategy.java:71)
    at
org.apache.openjpa.jdbc.meta.ClassMapping.setStrategy(ClassMapping.java:373)
    at
org.apache.openjpa.jdbc.meta.RuntimeStrategyInstaller.installStrategy(RuntimeStrategyInstaller.java:55)
    at
org.apache.openjpa.jdbc.meta.MappingRepository.prepareMapping(MappingRepository.java:318)
    at
org.apache.openjpa.meta.MetaDataRepository.preMapping(MetaDataRepository.java:662)
    at
org.apache.openjpa.meta.MetaDataRepository.resolve(MetaDataRepository.java:549)

Did any one have any idea about the cause for this exception. I have attched
full log.

Thanks in advance,
Milinda

-- 
http://mpathirage.com
http://wso2.org "Oxygen for Web Service Developers"
http://wsaxc.blogspot.com "Web Services With Axis2/C"

Re: org.apache.openjpa.persistence.ArgumentException: No table was given for persistent type

Posted by Pinaki Poddar <pp...@apache.org>.
Hi,
  Good point.
  Another way to verify what ProductDerivations are available (and if they
are active) is to run 

  $ java org.apache.openjpa.lib.conf.ProductDerivations

with a classpath that is same with the application's runtime classpath.


Michael Dick wrote:
> 
> Another relatively common way to get this error is if the classloader
> can't
> load the OpenJPA product derivations. You should have
> services/org.apache.openjpa.lib.conf.ProductDerivation on the classpath.
> That file should contain these entries (with a copy of the Apache license
> between them):
> 
> org.apache.openjpa.jdbc.conf.JDBCProductDerivation
> org.apache.openjpa.persistence.jdbc.JDBCPersistenceProductDerivation
> org.apache.openjpa.persistence.PersistenceProductDerivation
> org.apache.openjpa.slice.ProductDerivation
> 
> If the product derivations are missing OpenJPA won't pick up the default
> table name for your entity class (actually more things are going wrong but
> the table name is the most visible symptom).
> 
> HTH
> -mike
> 
> On Thu, Feb 12, 2009 at 9:04 AM, Milinda Pathirage <
> milinda.pathirage@gmail.com> wrote:
> 
>> Thanks, I'll try it and let you know if there is any problem.
>>
>> Milinda
>>
>> On Thu, Feb 12, 2009 at 7:52 PM, Pinaki Poddar <pp...@apache.org>
>> wrote:
>>
>> >
>> > It is "openjpa.jdbc.SynchronizeMappings"
>> >
>> >
>> > Pinaki Poddar wrote:
>> > >
>> > > Hi,
>> > >   Try in the given sequence
>> > > 1. Declare all the known persistent entities in <class> clause of
>> > > persistence.xml
>> > > 2. Ask OpenJPA to map the known classes to database (also in
>> > > persistence.xml)
>> > >     <property name="openjpa.SynchronizeMappings"
>> value="buildSchema"/>
>> > >
>> > >
>> >
>> > --
>> > View this message in context:
>> >
>> http://n2.nabble.com/org.apache.openjpa.persistence.ArgumentException%3A-No-table-was-given--for-persistent-type-tp2313758p2315114.html
>> > Sent from the OpenJPA Users mailing list archive at Nabble.com.
>> >
>> >
>>
>>
>> --
>> http://mpathirage.com
>> http://wso2.org "Oxygen for Web Service Developers"
>> http://wsaxc.blogspot.com "Web Services With Axis2/C"
>>
> 
> 

-- 
View this message in context: http://n2.nabble.com/org.apache.openjpa.persistence.ArgumentException%3A-No-table-was-given--for-persistent-type-tp2313758p2315390.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Re: org.apache.openjpa.persistence.ArgumentException: No table was given for persistent type

Posted by Michael Dick <mi...@gmail.com>.
Another relatively common way to get this error is if the classloader can't
load the OpenJPA product derivations. You should have
services/org.apache.openjpa.lib.conf.ProductDerivation on the classpath.
That file should contain these entries (with a copy of the Apache license
between them):

org.apache.openjpa.jdbc.conf.JDBCProductDerivation
org.apache.openjpa.persistence.jdbc.JDBCPersistenceProductDerivation
org.apache.openjpa.persistence.PersistenceProductDerivation
org.apache.openjpa.slice.ProductDerivation

If the product derivations are missing OpenJPA won't pick up the default
table name for your entity class (actually more things are going wrong but
the table name is the most visible symptom).

HTH
-mike

On Thu, Feb 12, 2009 at 9:04 AM, Milinda Pathirage <
milinda.pathirage@gmail.com> wrote:

> Thanks, I'll try it and let you know if there is any problem.
>
> Milinda
>
> On Thu, Feb 12, 2009 at 7:52 PM, Pinaki Poddar <pp...@apache.org> wrote:
>
> >
> > It is "openjpa.jdbc.SynchronizeMappings"
> >
> >
> > Pinaki Poddar wrote:
> > >
> > > Hi,
> > >   Try in the given sequence
> > > 1. Declare all the known persistent entities in <class> clause of
> > > persistence.xml
> > > 2. Ask OpenJPA to map the known classes to database (also in
> > > persistence.xml)
> > >     <property name="openjpa.SynchronizeMappings" value="buildSchema"/>
> > >
> > >
> >
> > --
> > View this message in context:
> >
> http://n2.nabble.com/org.apache.openjpa.persistence.ArgumentException%3A-No-table-was-given--for-persistent-type-tp2313758p2315114.html
> > Sent from the OpenJPA Users mailing list archive at Nabble.com.
> >
> >
>
>
> --
> http://mpathirage.com
> http://wso2.org "Oxygen for Web Service Developers"
> http://wsaxc.blogspot.com "Web Services With Axis2/C"
>

Re: org.apache.openjpa.persistence.ArgumentException: No table was given for persistent type

Posted by Milinda Pathirage <mi...@gmail.com>.
Thanks, I'll try it and let you know if there is any problem.

Milinda

On Thu, Feb 12, 2009 at 7:52 PM, Pinaki Poddar <pp...@apache.org> wrote:

>
> It is "openjpa.jdbc.SynchronizeMappings"
>
>
> Pinaki Poddar wrote:
> >
> > Hi,
> >   Try in the given sequence
> > 1. Declare all the known persistent entities in <class> clause of
> > persistence.xml
> > 2. Ask OpenJPA to map the known classes to database (also in
> > persistence.xml)
> >     <property name="openjpa.SynchronizeMappings" value="buildSchema"/>
> >
> >
>
> --
> View this message in context:
> http://n2.nabble.com/org.apache.openjpa.persistence.ArgumentException%3A-No-table-was-given--for-persistent-type-tp2313758p2315114.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>
>


-- 
http://mpathirage.com
http://wso2.org "Oxygen for Web Service Developers"
http://wsaxc.blogspot.com "Web Services With Axis2/C"

Re: org.apache.openjpa.persistence.ArgumentException: No table was given for persistent type

Posted by Pinaki Poddar <pp...@apache.org>.
It is "openjpa.jdbc.SynchronizeMappings"


Pinaki Poddar wrote:
> 
> Hi,
>   Try in the given sequence
> 1. Declare all the known persistent entities in <class> clause of
> persistence.xml
> 2. Ask OpenJPA to map the known classes to database (also in
> persistence.xml)
>     <property name="openjpa.SynchronizeMappings" value="buildSchema"/>
> 
> 

-- 
View this message in context: http://n2.nabble.com/org.apache.openjpa.persistence.ArgumentException%3A-No-table-was-given--for-persistent-type-tp2313758p2315114.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Re: org.apache.openjpa.persistence.ArgumentException: No table was given for persistent type

Posted by Pinaki Poddar <pp...@apache.org>.
Hi,
  Try in the given sequence
1. Declare all the known persistent entities in <class> clause of
persistence.xml
2. Ask OpenJPA to map the known classes to database (also in
persistence.xml)
    <property name="openjpa.SynchronizeMappings" value="buildSchema"/>

-- 
View this message in context: http://n2.nabble.com/org.apache.openjpa.persistence.ArgumentException%3A-No-table-was-given--for-persistent-type-tp2313758p2315105.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.