tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From SK Leung <siukaile...@yahoo.com.hk>
Subject Re: CMP Example with field mapping file
Date Wed, 14 May 2008 14:32:32 GMT

I have created the openejb-jar.xml file as below.

<?xml version="1.0" encoding="UTF-8"?>
<openejb-jar xmlns="http://www.openejb.org/xml/ns/openejb-jar-2.1"
xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.1"
xmlns:pkgen="http//www.openejb.org/xml/ns/pkgen-2.0"
xmlns:sec="http://geronimo.apache.org/xml/ns/security-1.1"
xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.1">
	<cmp-connection-factory>
		<resource-link>jdbc/OracleCMTadmuser</resource-link>
	</cmp-connection-factory>
	<enterprise-beans>
		<entity>
			<ejb-name>ProductEJB</ejb-name>
			<table-name>PRODUCTS</table-name>
			<cmp-field-mapping>
				<cmp-field-name>productID</cmp-field-name>
				<table-column>PRODUCTID</table-column>
			</cmp-field-mapping>
			<cmp-field-mapping>
				<cmp-field-name>name</cmp-field-name>
				<table-column>NAME</table-column>
			</cmp-field-mapping>
			<cmp-field-mapping>
				<cmp-field-name>description</cmp-field-name>
				<table-column>DESCRIPTION</table-column>
			</cmp-field-mapping>
			<cmp-field-mapping>
				<cmp-field-name>basePrice</cmp-field-name>
				<table-column>BASEPRICE</table-column>
			</cmp-field-mapping>
		</entity>
	</enterprise-beans>
</openejb-jar>

But the same error message is shown when creating the object. I have the
following resource defined in openejb.xml.

<Resource id="jdbc/OracleCMTadmuser" type="DataSource">
  JdbcDriver oracle.jdbc.driver.OracleDriver
  JdbcUrl jdbc:oracle:thin:@localhost:1521:xe
  UserName adm_user
  Password password
</Resource>

I do not know whether the problem is in making connection to database or
creating the record. If it is the latter one, then what is the cause for
such error? I even try to insert all nulls into the table and it accepts.
Please give help, much thanks.

SK
-- 
View this message in context: http://www.nabble.com/CMP-Example-with-field-mapping-file-tp17211487p17232520.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Mime
View raw message