• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

is it bug in jboss3.0 in cmr need help

 
Ranch Hand
Posts: 179
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all;
Well i was trying to connect cmr relation ship with oracle ,it all works fine when i use <create-table>true</create-table>.But when i use forein key mapping it gives exception in case of table>false</create-table>.I have created table in oracle.
2002-07-06 20:09:58,805 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.AddressEJB] jar:file:/G:/jboss3/server/default/tmp/deploy/server/default/deploy/sh.jar/62.sh.jar!/META-INF/jbosscmp-jdbc.xml found. Overriding defaults
2002-07-06 20:09:58,875 ERROR [org.jboss.metadata.XmlFileLoader] File file:/G:/jboss3/server/default/tmp/deploy/server/default/deploy/sh.jar/62.sh.jar!/META-INF/jbosscmp-jdbc.xml process error. Line: 68. Error message:
org.xml.sax.SAXParseException: EMPTY content models must have no content.
at org.apache.crimson.parser.Parser2.error(Parser2.java:3086)
at org.apache.crimson.parser.ValidatingParser$EmptyValidator.consume(ValidatingParser.java:296)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1311)
at org.apache.crimson.parser.Parser2.content(Parser2.java:1766)
///////////////////////////////////////////////////////////
My jbosscmp-jdbc.xml
.///////////////////////////////////////////////////
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jbosscmp-jdbc PUBLIC
"-//JBoss//DTD JBOSSCMP-JDBC 3.0//EN"
"http://www.jboss.org/j2ee/dtd/jbosscmp-jdbc_3_0.dtd">
<jbosscmp-jdbc>
<defaults>
<datasource>java:/OracleDS</datasource>
<datasource-mapping>Oracle9i</datasource-mapping>
<create-table>false</create-table>
<remove-table>false</remove-table>
<read-only>false</read-only>
</defaults>

<enterprise-beans>
<entity>
<ejb-name>CustomerEJB</ejb-name>
<table-name>customer</table-name>
<cmp-field>
<field-name>id</field-name>
<column-name>USERID</column-name>
</cmp-field>
<cmp-field>
<field-name>name</field-name>
<column-name>USERNAME</column-name>
</cmp-field>
</entity>
<entity>
<ejb-name>AddressEJB</ejb-name>
<table-name>address</table-name>
<cmp-field>
<field-name>id</field-name>
<column-name>ADDRESSID</column-name>
</cmp-field>
<cmp-field>
<field-name>street</field-name>
<column-name>STREET</column-name>
</cmp-field>
<cmp-field>
<field-name>city</field-name>
<column-name>CITY</column-name>
</cmp-field>
</entity>
</enterprise-beans>
<relationships>
<ejb-relation>
<ejb-relation-name>Customer-Address</ejb-relation-name>
<foreign-key-mapping>
<ejb-relationship-role>
<ejb-relationship-role-name>Customer-has-Address</ejb-relationship-role-name>
<foreign-key-fields/>
</ejb-relationship-role>
<ejb-relationship-role>
<ejb-relationship-role-name>Address-belongs-to-Customer</ejb-relationship-role-name>
<foreign-key-fields>
<foreign-key-field>
<field-name>id</field-name>
<column-name>ADDRESSID</column-name>
</foreign-key-field>
</foreign-key-fields>
</ejb-relationship-role>
</foreign-key-mapping>
</ejb-relation>
</relationships>
</jbosscmp-jdbc>
///////////////////////////////////////////////
EJB-JAR.XML
///////////////////////////////////////////////<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
"http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar>
<enterprise-beans>
<entity>
<ejb-name>CustomerEJB</ejb-name>
<remote>com.ssuet.customer.Customer</remote>
<home>com.ssuet.customer.CustomerHome</home>
<ejb-class>com.ssuet.customer.CustomerBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.String</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>Customer</abstract-schema-name>
<cmp-field>
<field-name>id</field-name>
</cmp-field>
<cmp-field>
<field-name>name</field-name>
</cmp-field>
<primkey-field>id</primkey-field>
<ejb-local-ref>
<ejb-ref-name>ejb/AddressHome</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>com.ssuet.address.AddressHome</local-home>
<local>com.ssuet.address.Address</local>
<ejb-link>AddressEJB</ejb-link>
</ejb-local-ref>
</entity>
<entity>
<ejb-name>AddressEJB</ejb-name>
<local>com.ssuet.address.Address</local>
<local-home>com.ssuet.address.AddressHome</local-home>
<ejb-class>com.ssuet.address.AddressBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.String</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>Address</abstract-schema-name>
<cmp-field>
<field-name>id</field-name>
</cmp-field>

<cmp-field>
<field-name>street</field-name>
</cmp-field>
<cmp-field>
<field-name>city</field-name>
</cmp-field>
<primkey-field>id</primkey-field>
</entity>
</enterprise-beans>
<relationships>
<!--One-to-one Customer-Address-->
<ejb-relation>
<ejb-relation-name>Customer-Address</ejb-relation-name>
<!--defining relation shipof cstomer-->
<ejb-relationship-role>
<ejb-relationship-role-name>Customer-has-Address</ejb-relationship-role-name>
<multiplicity>One</multiplicity>
<relationship-role-source>
<ejb-name>CustomerEJB</ejb-name>
</relationship-role-source>
<cmr-field>
<cmr-field-name>homeAddress</cmr-field-name>
</cmr-field>
</ejb-relationship-role>
<!--defining relation shipof address-->
<ejb-relationship-role>
<ejb-relationship-role-name>Address-belongs-to-Customer</ejb-relationship-role-name>
<multiplicity>One</multiplicity>
<relationship-role-source>
<ejb-name>AddressEJB</ejb-name>
</relationship-role-source>
</ejb-relationship-role>
</ejb-relation>
</relationships>
</ejb-jar>
////////////////////////////////////////////////
Will be vey thank ful if some on can find errors.
 
What's wrong? Where are you going? Stop! Read this tiny ad:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic