geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <david_jen...@yahoo.com>
Subject Re: No registered metadata for type "class <entitybean class>"
Date Sun, 13 Apr 2008 17:00:42 GMT
I'm not sure if these relate to the problem you are seeing but...

1. remove orm.xml
2. remove the properties setting up the database driver from  
persistence.xml and rely on the jta-datasource
3. make sure both Material and MaterialType have appropriate  
annotations to show it is a persistent bean.

thanks
david jencks

On Apr 13, 2008, at 6:44 AM, CG wrote:

> Initially feel that it should be openjpa question , so sent to openjpa
> user mailing list. However,  seems like it is not active. Therefore,
> forward it to geronimo mailing list to get some help .
>
>
> =============================
>
> Hi all , I am a newbie of openjpa , and using openjpa to run on
>  geronimo, coding using eclipse
>
>  I face a runtime error sounds
>
>>>>> Caused by: java.lang.Exception: java.lang.IllegalStateException:
>  No registered metadata for type "class
>  com.quesofttech.entity.Material".
>
>  where "Material" is a class name of my EntityBean ,
>  com.quesofttech.entity is the package name.
>
>  I have search the google , and understand that it may caused by
>  configuration problem, in persistence.xml and orm.xm, however, I  
> still
>  cannot figure out what is the problem. l
>
>
>  my orm.xml is plain with no entity mapping.
>
>  orm.xml
>  =======
>  <?xml version="1.0" encoding="UTF-8"?>
>  <entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
>  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>  xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm
>  http://java.sun.com/xml/ns/persistence/orm_1_0.xsd" version="1.0">
>  </entity-mappings>
>
>
>  Here is the persistence.xml for the reference
>  ======================
>  <?xml version="1.0" encoding="UTF-8"?>
>  <persistence version="1.0"
>  xmlns="http://java.sun.com/xml/ns/persistence"
>  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>  xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
>  http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
>         <persistence-unit name="EJBStructsEJB">
>             <description>Entity Beans for Material</description>
>
> <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</ 
> provider>
>                 <jta-data-source>mysql</jta-data-source>
>                <class>com.quesofttech.entity.MaterialType</class>
>                <class>com.quesofttech.entity.Material</class>
>                <properties>
>                  <property name="openjpa.jdbc.SynchronizeMappings"
> value="false"/>
>                  <property name="openjpa.ConnectionDriverName"
>  value="com.mysql.jdbc.Driver"/>
>                 <property name="openjpa.ConnectionURL"
>  value="jdbc:mysql:localhost:3306/ERP"/>
>                         <property name="openjpa.ConnectionUserName"
> value="root"/>
>                         <property name="openjpa.ConnectionPassword"
> value="xxxxxx"/>
>             </properties>
>         </persistence-unit>
>  </persistence>
>
>
>  May I know what is the function and purpose of persistence.xml and
> orm.xml for ?
>  my understanding is , orm.xml is for entitybean and databases mapping
>  (table and field) , and persistence.xml is to define which entitybean
>  suppose to be persistent. Is it correct ?
>
>  Any help is appreciated , thanks.
>
>  CG


Mime
View raw message