• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

CMR problem in weblogic

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all!
I'm trying to develop a management app with Weblogic using EJB2.0. I
created some CM relations (many-to-many, many-to-one, etc.) with no
problems, but there is a one that gets the next problem at deployment time:
Error while reading 'META-INF/weblogic-cmp-rdbms-jar.xml'. The error
was:
In relationship 'Servicios-Contratados', role
'Servicios-de-un-contrato', invalid column 'nombre', a column-map element
contains an invalid key-column.The key-column is not defined in the related
bean or it's not recognized because of case mismatch.
In relationship 'Servicios-Contratados', role
'Contratos-que-usan-el-servicio', invalid column 'id', a column-map element
contains an invalid key-column. The key-column is not defined in the related
bean or it's not recognized because of case mismatch.
This is the ejb-jar.xml (a snippet):
<entity>
<display-name></display-name>
<ejb-name>ContratoBean</ejb-name>
<local-home>es.upm.dit.gestionabonados.ContratoLocalHome</local-home>
<local>es.upm.dit.gestionabonados.ContratoLocal</local>
<ejb-class>es.upm.dit.gestionabonados.ContratoBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Integer</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>Contrato</abstract-schema-name>
<cmp-field>
<field-name>id</field-name>
</cmp-field>
<cmp-field>
<field-name>numeroCuenta</field-name>
</cmp-field>
<primkey-field>id</primkey-field>
</entity>
<entity>
<display-name></display-name>
<ejb-name>ServicioBean</ejb-name>
<local-home>es.upm.dit.gestionabonados.ServicioLocalHome</local-home>
<local>es.upm.dit.gestionabonados.ServicioLocal</local>
<ejb-class>es.upm.dit.gestionabonados.ServicioBean</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>Servicio</abstract-schema-name>
<cmp-field>
<field-name>nombre</field-name>
</cmp-field>
<cmp-field>
<field-name>url</field-name>
</cmp-field>
<cmp-field>
<field-name>precio</field-name>
</cmp-field>
<cmp-field>
<field-name>descripcion</field-name>
</cmp-field>
<primkey-field>nombre</primkey-field>
<query>
<query-method>
<method-name>findAllServicios</method-name>
<method-params/>
</query-method>
<ejb-ql>SELECT OBJECT(s) FROM Servicio s</ejb-ql>
</query>
</entity>
...
<ejb-relation>
<ejb-relation-name>Servicios-Contratados</ejb-relation-name>
<ejb-relationship-role>
<ejb-relationship-role-name>Servicios-de-un-contrato</ejb-relationship-role-
name>
<multiplicity>Many</multiplicity>
<relationship-role-source>
<ejb-name>ContratoBean</ejb-name>
</relationship-role-source>
<cmr-field>
<cmr-field-name>servicios</cmr-field-name>
<cmr-field-type>java.util.Collection</cmr-field-type>
</cmr-field>
</ejb-relationship-role>
<ejb-relationship-role>
<ejb-relationship-role-name>Contratos-que-usan-el-servicio</ejb-relationship
-role-name>
<multiplicity>Many</multiplicity>
<relationship-role-source>
<ejb-name>ServicioBean</ejb-name>
</relationship-role-source>
<cmr-field>
<cmr-field-name>contratos</cmr-field-name>
<cmr-field-type>java.util.Collection</cmr-field-type>
</cmr-field>
</ejb-relationship-role>
</ejb-relation>
...
and this is the weblogic-cmp-rdbms-jar.xml
...
<weblogic-rdbms-bean>
<ejb-name>ContratoBean</ejb-name>
<data-source-name>jdbc/es/upm/dit/gestionabonados/DataSource</data-source-na
me>
<table-name>Contrato</table-name>
<field-map>
<cmp-field>id</cmp-field>
<dbms-column>id</dbms-column>
</field-map>
<field-map>
<cmp-field>numeroCuenta</cmp-field>
<dbms-column>numerocuenta</dbms-column>
</field-map>
</weblogic-rdbms-bean>
<weblogic-rdbms-bean>
<ejb-name>ServicioBean</ejb-name>
<data-source-name>jdbc/es/upm/dit/gestionabonados/DataSource</data-source-na
me>
<table-name>Servicio</table-name>
<field-map>
<cmp-field>nombre</cmp-field>
<dbms-column>nombre</dbms-column>
</field-map>
<field-map>
<cmp-field>url</cmp-field>
<dbms-column>url</dbms-column>
</field-map>
<field-map>
<cmp-field>precio</cmp-field>
<dbms-column>precio</dbms-column>
</field-map>
<field-map>
<cmp-field>descripcion</cmp-field>
<dbms-column>descripcion</dbms-column>
</field-map>
</weblogic-rdbms-bean>
...
<weblogic-rdbms-relation>
<relation-name>Servicios-Contratados</relation-name>
<table-name>suscripcion</table-name>
<weblogic-relationship-role>
<relationship-role-name>Servicios-de-un-contrato</relationship-role-name>
<column-map>
<foreign-key-column>servicio</foreign-key-column>
<key-column>nombre</key-column>
</column-map>
</weblogic-relationship-role>
<weblogic-relationship-role>
<relationship-role-name>Contratos-que-usan-el-servicio</relationship-role-na
me>
<column-map>
<foreign-key-column>contrato</foreign-key-column>
<key-column>id</key-column>
</column-map>
</weblogic-relationship-role>
</weblogic-rdbms-relation>
...
I cann't find where is the problem, because this code is equals to the
other which work. Anybody could help me?
Thank in advance.
 
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to Weblogic forum...
 
Ranch Hand
Posts: 977
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
(After a quick look on a rush today)
Hi as looks to me that this is a many-to-many relationship try to add the tags:
relationship-role-map
foreign-key-table
primary-key-table
under the weblogic-relationship-role tag to make the connection between the two tables, this should solve the problem.
regards,
Marcos Maia
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you know any site where i can find an example of complete weblogic-cmp-rdbms-jar.xml file? I have been trying to find one which i could follow, but i couldn't. So i do not know where to place these tags.
Thanks for your last reply.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I forget to say i am using weblogic 6.1. The information i found about the tags appears for weblogic 7.0.
 
So you made a portal in time and started grabbing people. This tiny ad thinks that's rude:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic