This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java and have Dr. Raoul-Gabriel Urma & Richard Warburton on-line!
See this thread for details.
Win a copy of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java this week in the Agile and Other Processes forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

EJB relations first time Q

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi after having a single bean running on my JBOSS server am up for the relationship ehem..
am having a Pagina bean with a collection of BlokTekst beans
when i deploy i got following err:
MBeanException: org.jboss.deployment.DeploymentException: Atleast one role of a foreign-key mapped relationship must have key fields (or <primkey-field> is missing from ejb-jar.xml): ejb-relation-name=BloksRel

here is my 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 >

<description><![CDATA[No Description.]]></description>
<display-name>Generated by XDoclet</display-name>

<enterprise-beans>

<!-- Session Beans -->
<!--
To add session beans that you have deployment descriptor info for, add
a file to your XDoclet merge directory called session-beans.xml that contains
the <session></session> markup for those beans.
-->

<!-- Entity Beans -->
<entity >
<description><![CDATA[Pagina EJB]]></description>
<display-name>Pagina</display-name>

<ejb-name>Pagina</ejb-name>

<home>sven.ent.interfaces.PaginaHome</home>
<remote>sven.ent.interfaces.Pagina</remote>
<local-home>sven.ent.interfaces.PaginaLocalHome</local-home>
<local>sven.ent.interfaces.PaginaLocal</local>

<ejb-class>sven.ent.ejb.PaginaCMP</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>Pagina</abstract-schema-name>
<cmp-field >
<description><![CDATA[]]></description>
<field-name>id</field-name>
</cmp-field>
<cmp-field >
<description><![CDATA[]]></description>
<field-name>titel</field-name>
</cmp-field>
<primkey-field>id</primkey-field>

<!-- Write a file named ejb-finders-Pagina.xml if you want to define extra finders. -->
</entity>

<entity >
<description><![CDATA[BlokTekst EJB]]></description>
<display-name>BlokTekst</display-name>

<ejb-name>BlokTekst</ejb-name>

<home>sven.ent.interfaces.BlokTekstHome</home>
<remote>sven.ent.interfaces.BlokTekst</remote>
<local-home>sven.ent.interfaces.BlokTekstLocalHome</local-home>
<local>sven.ent.interfaces.BlokTekstLocal</local>

<ejb-class>sven.ent.ejb.BlokTekstCMP</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>BlokTekst</abstract-schema-name>
<cmp-field >
<description><![CDATA[]]></description>
<field-name>id</field-name>
</cmp-field>
<cmp-field >
<description><![CDATA[]]></description>
<field-name>tekst</field-name>
</cmp-field>
<primkey-field>id</primkey-field>

<!-- Write a file named ejb-finders-BlokTekst.xml if you want to define extra finders. -->
</entity>

<!--
To add entity beans that you have deployment descriptor info for, add
a file to your XDoclet merge directory called entity-beans.xml that contains
the <entity></entity> markup for those beans.
-->

<!-- Message Driven Beans -->
<!--
To add message driven beans that you have deployment descriptor info for, add
a file to your XDoclet merge directory called message-driven-beans.xml that contains
the <message-driven></message-driven> markup for those beans.
-->

</enterprise-beans>

<!-- Relationships -->
<relationships >
<ejb-relation >
<ejb-relation-name>BloksRel</ejb-relation-name>

<ejb-relationship-role >
<ejb-relationship-role-name>geefPagina</ejb-relationship-role-name>
<multiplicity>Many</multiplicity>
<relationship-role-source >
<ejb-name>BlokTekst</ejb-name>
</relationship-role-source>
<cmr-field >
<cmr-field-name>pagina</cmr-field-name>
</cmr-field>
</ejb-relationship-role>

<ejb-relationship-role >
<ejb-relationship-role-name>ZijnErBlokken</ejb-relationship-role-name>
<multiplicity>One</multiplicity>
<relationship-role-source >
<ejb-name>Pagina</ejb-name>
</relationship-role-source>
<cmr-field >
<cmr-field-name>bloks</cmr-field-name>
<cmr-field-type>java.util.Collection</cmr-field-type>
</cmr-field>
</ejb-relationship-role>

</ejb-relation>
</relationships>

<!-- Assembly Descriptor -->
<assembly-descriptor >
<!--
To add additional assembly descriptor info here, add a file to your
XDoclet merge directory called assembly-descriptor.xml that contains
the <assembly-descriptor></assembly-descriptor> markup.
-->

<!-- finder permissions -->

<!-- finder permissions -->

<!-- transactions -->

<!-- finder transactions -->
</assembly-descriptor>

</ejb-jar>


thank you for your time

Sven

ooops... can someone move me to JBOSS? thanx
[ August 31, 2004: Message edited by: Sven Sven ]
 
Be reasonable. You can't destroy everything. Where would you sit? How would you read a tiny ad?
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!