openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From CG <learn....@gmail.com>
Subject No registered metadata for type "class <entitybean class>"
Date Sun, 13 Apr 2008 05:08:48 GMT
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