RE: [JBoss-user] JBossCMP Change Column Names in CMR

2002-07-31 Thread Luttrell, Peter


I actually tried that and it didn't work either. 
The only difference is that instead of complaining that it couldn't find
roles, now it complains that it can't find users.

Any other ideas?

thanks.
.peter

-Original Message-
From: Alex Loubyansky [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 1:11 AM
To: Peter Luttrell
Subject: Re: [JBoss-user] JBossCMP Change Column Names in CMR


You need to interchange key-fields for ejb-relationship-role's in
jbosscmp-jdbc.xml.

I.e.
ejb-relationship-role-nameRole-Belongs-To-User/ejb-relationship-role-name

   key-fields
  key-field
 field-nameroles/field-name
 column-namerole_name/column-name
  /key-field
   /key-fields
...

alex

Wednesday, July 31, 2002, 1:45:57 AM, you wrote:

PL How do you change the column names for a table generated by a
MANY-to-MANY
PL CMR?

PL Here's an example of what i've tried:

PL ejb-jar.xml:

PL ejb-relation
PL ejb-relation-nameUser-Roles/ejb-relation-name
PL ejb-relationship-role
PL
ejb-relationship-role-nameUser-has-multiple-Roles/ejb-relationship-role-n
ame
PL multiplicityMany/multiplicity
PL relationship-role-source
PL ejb-nameUsers/ejb-name
PL /relationship-role-source
PL cmr-field
PL cmr-field-nameroles/cmr-field-name
PL cmr-field-typejava.util.Set/cmr-field-type
PL /cmr-field
PL /ejb-relationship-role
PL ejb-relationship-role
PL
ejb-relationship-role-nameRole-Belongs-To-User/ejb-relationship-role-name

PL multiplicityMany/multiplicity
PL relationship-role-source
PL ejb-nameRoles/ejb-name
PL /relationship-role-source
PL cmr-field
PL cmr-field-nameusers/cmr-field-name
PL cmr-field-typejava.util.Set/cmr-field-type
PL /cmr-field
PL /ejb-relationship-role
PL /ejb-relation

PL My understanding of how to do this is via this entry in
jbosscmp-jdbc.xml:

PL ejb-relation
PL ejb-relation-nameUser-Roles/ejb-relation-name
PL relation-table-mapping
PL table-nameUser_Role/table-name
PL /relation-table-mapping

PL ejb-relationship-role
PL
ejb-relationship-role-nameRole-Belongs-To-User/ejb-relationship-role-name

PL key-fields
PL key-field
PL field-nameusers/field-name
PL column-nameuser_name/column-name
PL /key-field
PL /key-fields
PL /ejb-relationship-role
PL ejb-relationship-role
PL
ejb-relationship-role-nameUser-has-multiple-Roles/ejb-relationship-role-n
ame
PL key-fields
PL key-field
PL field-nameroles/field-name
PL column-namerole_name/column-name
PL /key-field
PL /key-fields
PL /ejb-relationship-role
PL /ejb-relation


PL But the problem is that jboss complains ~ It doesn't seam to be able to
PL locate the users or roles field-name's that i've declared. Here's
the
PL summary error:
PL [ObjectName: jboss.j2ee:service=EJB,jndiName=myBEAN
PL  state: FAILED
PL  I Depend On:
PL  Depends On Me: org.jboss.deployment.DeploymentException: CMP field for
PL key not found: field name=roles, ObjectName:
PL jboss.j2ee:service=EJB,jndiName=myBEAN

PL with the following exception:

PL 17:34:33,434 WARN  [ServiceController] Problem starting service
PL jboss.j2ee:service=EJB,jndiName=myBEAN
PL org.jboss.deployment.DeploymentException: CMP field for key not found:
PL field name=roles
PL at
PL
org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationshipRoleMetaData.loadKey
Fields(JDBCRe
PL lationshipRoleMetaData.java:374)
PL at
PL
org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationshipRoleMetaData.init(JD
BCRelationshi
PL pRoleMetaData.java:157)
PL at
PL
org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationMetaData.init(JDBCRela
tionMetaData.
PL java:308)
PL at
PL
org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCApplicationMetaData.init(JDBCA
pplicationMet
PL aData.java:383)
PL at
PL
org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCXmlFileLoader.load(JDBCXmlFileLo
ader.java:75)

PL at
PL
org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadJDBCEntityMetaData(JDBCS
toreManager.j
PL ava:677)
PL at
PL
org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.initStoreManager(JDBCStoreMa
nager.java:38
PL 9)
PL at
PL
org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:
339)
PL at
PL
org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java
:198)
PL at org.jboss.ejb.EntityContainer.start(EntityContainer.java:376)
PL

Re[2]: [JBoss-user] JBossCMP Change Column Names in CMR

2002-07-31 Thread Alex Loubyansky

AFAIK, DD's are correct (with my remark). Do you really have in the
beans abstract accessors for cmr users and roles?

Wednesday, July 31, 2002, 6:47:55 PM, you wrote:


LP I actually tried that and it didn't work either. 
LP The only difference is that instead of complaining that it couldn't find
LP roles, now it complains that it can't find users.

LP Any other ideas?

LP thanks.
LP .peter

LP -Original Message-
LP From: Alex Loubyansky [mailto:[EMAIL PROTECTED]]
LP Sent: Wednesday, July 31, 2002 1:11 AM
LP To: Peter Luttrell
LP Subject: Re: [JBoss-user] JBossCMP Change Column Names in CMR


LP You need to interchange key-fields for ejb-relationship-role's in
LP jbosscmp-jdbc.xml.

LP I.e.
LP ejb-relationship-role-nameRole-Belongs-To-User/ejb-relationship-role-name

LPkey-fields
LP   key-field
LP  field-nameroles/field-name
LP  column-namerole_name/column-name
LP   /key-field
LP/key-fields
LP ...

LP alex

LP Wednesday, July 31, 2002, 1:45:57 AM, you wrote:

PL How do you change the column names for a table generated by a
LP MANY-to-MANY
PL CMR?

PL Here's an example of what i've tried:

PL ejb-jar.xml:

PL ejb-relation
PL ejb-relation-nameUser-Roles/ejb-relation-name
PL ejb-relationship-role
PL
LP ejb-relationship-role-nameUser-has-multiple-Roles/ejb-relationship-role-n
ame
PL multiplicityMany/multiplicity
PL relationship-role-source
PL ejb-nameUsers/ejb-name
PL /relationship-role-source
PL cmr-field
PL cmr-field-nameroles/cmr-field-name
PL cmr-field-typejava.util.Set/cmr-field-type
PL /cmr-field
PL /ejb-relationship-role
PL ejb-relationship-role
PL
LP ejb-relationship-role-nameRole-Belongs-To-User/ejb-relationship-role-name

PL multiplicityMany/multiplicity
PL relationship-role-source
PL ejb-nameRoles/ejb-name
PL /relationship-role-source
PL cmr-field
PL cmr-field-nameusers/cmr-field-name
PL cmr-field-typejava.util.Set/cmr-field-type
PL /cmr-field
PL /ejb-relationship-role
PL /ejb-relation

PL My understanding of how to do this is via this entry in
LP jbosscmp-jdbc.xml:

PL ejb-relation
PL ejb-relation-nameUser-Roles/ejb-relation-name
PL relation-table-mapping
PL table-nameUser_Role/table-name
PL /relation-table-mapping

PL ejb-relationship-role
PL
LP ejb-relationship-role-nameRole-Belongs-To-User/ejb-relationship-role-name

PL key-fields
PL key-field
PL field-nameusers/field-name
PL column-nameuser_name/column-name
PL /key-field
PL /key-fields
PL /ejb-relationship-role
PL ejb-relationship-role
PL
LP ejb-relationship-role-nameUser-has-multiple-Roles/ejb-relationship-role-n
ame
PL key-fields
PL key-field
PL field-nameroles/field-name
PL column-namerole_name/column-name
PL /key-field
PL /key-fields
PL /ejb-relationship-role
PL /ejb-relation


PL But the problem is that jboss complains ~ It doesn't seam to be able to
PL locate the users or roles field-name's that i've declared. Here's
LP the
PL summary error:
PL [ObjectName: jboss.j2ee:service=EJB,jndiName=myBEAN
PL  state: FAILED
PL  I Depend On:
PL  Depends On Me: org.jboss.deployment.DeploymentException: CMP field for
PL key not found: field name=roles, ObjectName:
PL jboss.j2ee:service=EJB,jndiName=myBEAN

PL with the following exception:

PL 17:34:33,434 WARN  [ServiceController] Problem starting service
PL jboss.j2ee:service=EJB,jndiName=myBEAN
PL org.jboss.deployment.DeploymentException: CMP field for key not found:
PL field name=roles
PL at
PL
LP org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationshipRoleMetaData.loadKey
LP Fields(JDBCRe
PL lationshipRoleMetaData.java:374)
PL at
PL
LP org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationshipRoleMetaData.init(JD
LP BCRelationshi
PL pRoleMetaData.java:157)
PL at
PL
LP org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationMetaData.init(JDBCRela
LP tionMetaData.
PL java:308)
PL at
PL
LP org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCApplicationMetaData.init(JDBCA
LP pplicationMet
PL aData.java:383)
PL at
PL
LP org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCXmlFileLoader.load(JDBCXmlFileLo
LP ader.java:75)

PL at
PL
LP org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadJDBCEntityMetaData(JDBCS
LP toreManager.j
PL ava:677)
PL at
PL
LP org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.initStoreManager(JDBCStoreMa
LP nager.java:38
PL 9

RE: Re[2]: [JBoss-user] JBossCMP Change Column Names in CMR

2002-07-31 Thread Luttrell, Peter


Yep, here's the snipped out of my ejb-jar.xml:

ejb-relation
ejb-relation-nameUser-Roles/ejb-relation-name
ejb-relationship-role
 
ejb-relationship-role-nameUser-has-multiple-Roles/ejb-relationship-role-n
ame
multiplicityMany/multiplicity
relationship-role-source
ejb-nameUsers/ejb-name
/relationship-role-source
cmr-field
cmr-field-nameroles/cmr-field-name
cmr-field-typejava.util.Set/cmr-field-type
/cmr-field
/ejb-relationship-role
ejb-relationship-role
 
ejb-relationship-role-nameRole-Belongs-To-User/ejb-relationship-role-name

multiplicityMany/multiplicity
relationship-role-source
ejb-nameRoles/ejb-name
/relationship-role-source
cmr-field
cmr-field-nameusers/cmr-field-name
cmr-field-typejava.util.Set/cmr-field-type
/cmr-field
/ejb-relationship-role
/ejb-relation

Do I need todo something else here to make the other work?

It's deployed fine and the code works perfectly. I only run into problems
when i added the section in the jbosscmp-jdbc.xml to attempt to change the
column-names.

thanks.
.peter

-Original Message-
From: Alex Loubyansky [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 11:13 AM
To: Luttrell, Peter
Subject: Re[2]: [JBoss-user] JBossCMP Change Column Names in CMR


AFAIK, DD's are correct (with my remark). Do you really have in the
beans abstract accessors for cmr users and roles?

Wednesday, July 31, 2002, 6:47:55 PM, you wrote:


LP I actually tried that and it didn't work either. 
LP The only difference is that instead of complaining that it couldn't find
LP roles, now it complains that it can't find users.

LP Any other ideas?

LP thanks.
LP .peter

LP -Original Message-
LP From: Alex Loubyansky [mailto:[EMAIL PROTECTED]]
LP Sent: Wednesday, July 31, 2002 1:11 AM
LP To: Peter Luttrell
LP Subject: Re: [JBoss-user] JBossCMP Change Column Names in CMR


LP You need to interchange key-fields for ejb-relationship-role's in
LP jbosscmp-jdbc.xml.

LP I.e.
LP
ejb-relationship-role-nameRole-Belongs-To-User/ejb-relationship-role-name

LPkey-fields
LP   key-field
LP  field-nameroles/field-name
LP  column-namerole_name/column-name
LP   /key-field
LP/key-fields
LP ...

LP alex

LP Wednesday, July 31, 2002, 1:45:57 AM, you wrote:

PL How do you change the column names for a table generated by a
LP MANY-to-MANY
PL CMR?

PL Here's an example of what i've tried:

PL ejb-jar.xml:

PL ejb-relation
PL ejb-relation-nameUser-Roles/ejb-relation-name
PL ejb-relationship-role
PL
LP
ejb-relationship-role-nameUser-has-multiple-Roles/ejb-relationship-role-n
ame
PL multiplicityMany/multiplicity
PL relationship-role-source
PL ejb-nameUsers/ejb-name
PL /relationship-role-source
PL cmr-field
PL cmr-field-nameroles/cmr-field-name
PL cmr-field-typejava.util.Set/cmr-field-type
PL /cmr-field
PL /ejb-relationship-role
PL ejb-relationship-role
PL
LP
ejb-relationship-role-nameRole-Belongs-To-User/ejb-relationship-role-name

PL multiplicityMany/multiplicity
PL relationship-role-source
PL ejb-nameRoles/ejb-name
PL /relationship-role-source
PL cmr-field
PL cmr-field-nameusers/cmr-field-name
PL cmr-field-typejava.util.Set/cmr-field-type
PL /cmr-field
PL /ejb-relationship-role
PL /ejb-relation

PL My understanding of how to do this is via this entry in
LP jbosscmp-jdbc.xml:

PL ejb-relation
PL ejb-relation-nameUser-Roles/ejb-relation-name
PL relation-table-mapping
PL table-nameUser_Role/table-name
PL /relation-table-mapping

PL ejb-relationship-role
PL
LP
ejb-relationship-role-nameRole-Belongs-To-User/ejb-relationship-role-name

PL key-fields
PL key-field
PL field-nameusers/field-name
PL column-nameuser_name/column-name
PL /key-field
PL /key-fields
PL /ejb-relationship-role
PL ejb-relationship-role
PL
LP
ejb-relationship-role-nameUser-has-multiple-Roles/ejb-relationship-role-n
ame
PL key-fields
PL key-field
PL field-nameroles/field-name
PL column-namerole_name/column-name
PL /key-field
PL /key-fields
PL /ejb-relationship-role
PL /ejb

RE: Re[2]: [JBoss-user] JBossCMP Change Column Names in CMR

2002-07-31 Thread Luttrell, Peter

I found the solution to my problem, so i thought i'd post it in case anyone
else runs into the same problem.

In the jbosscmp-jdbc.xml file, for the field-name fields, instead of the cmr
fields that i was specifying, you need to specify the primarykey fields for
the related beans. 

Thus this:

ejb-relation
ejb-relation-nameUser-Roles/ejb-relation-name
relation-table-mapping
table-nameUser_Role/table-name
/relation-table-mapping

ejb-relationship-role
 
ejb-relationship-role-nameRole-Belongs-To-User/ejb-relationship-role-name

key-fields
key-field
field-nameroles/field-name
column-namerole_name/column-name
/key-field
/key-fields
/ejb-relationship-role
ejb-relationship-role
 
ejb-relationship-role-nameUser-has-multiple-Roles/ejb-relationship-role-n
ame
key-fields
key-field
field-nameusers/field-name
column-nameuser_name/column-name
/key-field
/key-fields
/ejb-relationship-role
/ejb-relation

Becomes this:

ejb-relation
ejb-relation-nameUser-Roles/ejb-relation-name
relation-table-mapping
table-nameUser_Role/table-name
/relation-table-mapping

ejb-relationship-role
 
ejb-relationship-role-nameRole-Belongs-To-User/ejb-relationship-role-name

key-fields
key-field
field-namename/field-name
column-namerole_name/column-name
/key-field
/key-fields
/ejb-relationship-role
ejb-relationship-role
 
ejb-relationship-role-nameUser-has-multiple-Roles/ejb-relationship-role-n
ame
key-fields
key-field
field-nameuserName/field-name
column-nameuser_name/column-name
/key-field
/key-fields
/ejb-relationship-role
/ejb-relation


To figure it out, I used middlegen to reverse engineer my dbschema, at which
point i noticed that the field-names weren't what I was doing.

.peter

-Original Message-
From: Alex Loubyansky [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 11:13 AM
To: Luttrell, Peter
Subject: Re[2]: [JBoss-user] JBossCMP Change Column Names in CMR


AFAIK, DD's are correct (with my remark). Do you really have in the
beans abstract accessors for cmr users and roles?

Wednesday, July 31, 2002, 6:47:55 PM, you wrote:


LP I actually tried that and it didn't work either. 
LP The only difference is that instead of complaining that it couldn't find
LP roles, now it complains that it can't find users.

LP Any other ideas?

LP thanks.
LP .peter

LP -Original Message-
LP From: Alex Loubyansky [mailto:[EMAIL PROTECTED]]
LP Sent: Wednesday, July 31, 2002 1:11 AM
LP To: Peter Luttrell
LP Subject: Re: [JBoss-user] JBossCMP Change Column Names in CMR


LP You need to interchange key-fields for ejb-relationship-role's in
LP jbosscmp-jdbc.xml.

LP I.e.
LP
ejb-relationship-role-nameRole-Belongs-To-User/ejb-relationship-role-name

LPkey-fields
LP   key-field
LP  field-nameroles/field-name
LP  column-namerole_name/column-name
LP   /key-field
LP/key-fields
LP ...

LP alex

LP Wednesday, July 31, 2002, 1:45:57 AM, you wrote:

PL How do you change the column names for a table generated by a
LP MANY-to-MANY
PL CMR?

PL Here's an example of what i've tried:

PL ejb-jar.xml:

PL ejb-relation
PL ejb-relation-nameUser-Roles/ejb-relation-name
PL ejb-relationship-role
PL
LP
ejb-relationship-role-nameUser-has-multiple-Roles/ejb-relationship-role-n
ame
PL multiplicityMany/multiplicity
PL relationship-role-source
PL ejb-nameUsers/ejb-name
PL /relationship-role-source
PL cmr-field
PL cmr-field-nameroles/cmr-field-name
PL cmr-field-typejava.util.Set/cmr-field-type
PL /cmr-field
PL /ejb-relationship-role
PL ejb-relationship-role
PL
LP
ejb-relationship-role-nameRole-Belongs-To-User/ejb-relationship-role-name

PL multiplicityMany/multiplicity
PL relationship-role-source
PL ejb-nameRoles/ejb-name
PL /relationship-role-source
PL cmr-field
PL cmr-field-nameusers/cmr-field-name
PL cmr-field-typejava.util.Set/cmr-field-type
PL /cmr-field
PL /ejb-relationship-role
PL /ejb-relation

PL My understanding of how to do this is via this entry in
LP jbosscmp-jdbc.xml:

PL ejb-relation
PL

[JBoss-user] JBossCMP Change Column Names in CMR

2002-07-30 Thread Peter Luttrell

How do you change the column names for a table generated by a MANY-to-MANY
CMR?

Here's an example of what i've tried:

ejb-jar.xml:

ejb-relation
ejb-relation-nameUser-Roles/ejb-relation-name
ejb-relationship-role

ejb-relationship-role-nameUser-has-multiple-Roles/ejb-relationship-role-name
multiplicityMany/multiplicity
relationship-role-source
ejb-nameUsers/ejb-name
/relationship-role-source
cmr-field
cmr-field-nameroles/cmr-field-name
cmr-field-typejava.util.Set/cmr-field-type
/cmr-field
/ejb-relationship-role
ejb-relationship-role

ejb-relationship-role-nameRole-Belongs-To-User/ejb-relationship-role-name
multiplicityMany/multiplicity
relationship-role-source
ejb-nameRoles/ejb-name
/relationship-role-source
cmr-field
cmr-field-nameusers/cmr-field-name
cmr-field-typejava.util.Set/cmr-field-type
/cmr-field
/ejb-relationship-role
/ejb-relation

My understanding of how to do this is via this entry in jbosscmp-jdbc.xml:

ejb-relation
ejb-relation-nameUser-Roles/ejb-relation-name
relation-table-mapping
table-nameUser_Role/table-name
/relation-table-mapping

ejb-relationship-role

ejb-relationship-role-nameRole-Belongs-To-User/ejb-relationship-role-name
key-fields
key-field
field-nameusers/field-name
column-nameuser_name/column-name
/key-field
/key-fields
/ejb-relationship-role
ejb-relationship-role

ejb-relationship-role-nameUser-has-multiple-Roles/ejb-relationship-role-name
key-fields
key-field
field-nameroles/field-name
column-namerole_name/column-name
/key-field
/key-fields
/ejb-relationship-role
/ejb-relation


But the problem is that jboss complains ~ It doesn't seam to be able to
locate the users or roles field-name's that i've declared. Here's the
summary error:
[ObjectName: jboss.j2ee:service=EJB,jndiName=myBEAN
 state: FAILED
 I Depend On:
 Depends On Me: org.jboss.deployment.DeploymentException: CMP field for
key not found: field name=roles, ObjectName:
jboss.j2ee:service=EJB,jndiName=myBEAN

with the following exception:

17:34:33,434 WARN  [ServiceController] Problem starting service
jboss.j2ee:service=EJB,jndiName=myBEAN
org.jboss.deployment.DeploymentException: CMP field for key not found:
field name=roles
at
org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationshipRoleMetaData.loadKeyFields(JDBCRe
lationshipRoleMetaData.java:374)
at
org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationshipRoleMetaData.init(JDBCRelationshi
pRoleMetaData.java:157)
at
org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationMetaData.init(JDBCRelationMetaData.
java:308)
at
org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCApplicationMetaData.init(JDBCApplicationMet
aData.java:383)
at
org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCXmlFileLoader.load(JDBCXmlFileLoader.java:75)

at
org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadJDBCEntityMetaData(JDBCStoreManager.j
ava:677)
at
org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.initStoreManager(JDBCStoreManager.java:38
9)
at
org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:339)
at
org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:198)
at org.jboss.ejb.EntityContainer.start(EntityContainer.java:376)
at org.jboss.ejb.Container.invoke(Container.java:793)
at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:1055)
at
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
at
org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:950)
at $Proxy6.start(Unknown Source)
at
org.jboss.system.ServiceController.start(ServiceController.java:384)
at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284
)
at
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
at $Proxy224.start(Unknown Source)
at org.jboss.ejb.EjbModule.startService(EjbModule.java:440)
   

Re: [JBoss-user] JBossCMP Change Column Names in CMR

2002-07-30 Thread Alex Loubyansky

You need to interchange key-fields for ejb-relationship-role's in
jbosscmp-jdbc.xml.

I.e.
ejb-relationship-role-nameRole-Belongs-To-User/ejb-relationship-role-name
   key-fields
  key-field
 field-nameroles/field-name
 column-namerole_name/column-name
  /key-field
   /key-fields
...

alex

Wednesday, July 31, 2002, 1:45:57 AM, you wrote:

PL How do you change the column names for a table generated by a MANY-to-MANY
PL CMR?

PL Here's an example of what i've tried:

PL ejb-jar.xml:

PL ejb-relation
PL ejb-relation-nameUser-Roles/ejb-relation-name
PL ejb-relationship-role
PL 
ejb-relationship-role-nameUser-has-multiple-Roles/ejb-relationship-role-name
PL multiplicityMany/multiplicity
PL relationship-role-source
PL ejb-nameUsers/ejb-name
PL /relationship-role-source
PL cmr-field
PL cmr-field-nameroles/cmr-field-name
PL cmr-field-typejava.util.Set/cmr-field-type
PL /cmr-field
PL /ejb-relationship-role
PL ejb-relationship-role
PL 
ejb-relationship-role-nameRole-Belongs-To-User/ejb-relationship-role-name
PL multiplicityMany/multiplicity
PL relationship-role-source
PL ejb-nameRoles/ejb-name
PL /relationship-role-source
PL cmr-field
PL cmr-field-nameusers/cmr-field-name
PL cmr-field-typejava.util.Set/cmr-field-type
PL /cmr-field
PL /ejb-relationship-role
PL /ejb-relation

PL My understanding of how to do this is via this entry in jbosscmp-jdbc.xml:

PL ejb-relation
PL ejb-relation-nameUser-Roles/ejb-relation-name
PL relation-table-mapping
PL table-nameUser_Role/table-name
PL /relation-table-mapping

PL ejb-relationship-role
PL 
ejb-relationship-role-nameRole-Belongs-To-User/ejb-relationship-role-name
PL key-fields
PL key-field
PL field-nameusers/field-name
PL column-nameuser_name/column-name
PL /key-field
PL /key-fields
PL /ejb-relationship-role
PL ejb-relationship-role
PL 
ejb-relationship-role-nameUser-has-multiple-Roles/ejb-relationship-role-name
PL key-fields
PL key-field
PL field-nameroles/field-name
PL column-namerole_name/column-name
PL /key-field
PL /key-fields
PL /ejb-relationship-role
PL /ejb-relation


PL But the problem is that jboss complains ~ It doesn't seam to be able to
PL locate the users or roles field-name's that i've declared. Here's the
PL summary error:
PL [ObjectName: jboss.j2ee:service=EJB,jndiName=myBEAN
PL  state: FAILED
PL  I Depend On:
PL  Depends On Me: org.jboss.deployment.DeploymentException: CMP field for
PL key not found: field name=roles, ObjectName:
PL jboss.j2ee:service=EJB,jndiName=myBEAN

PL with the following exception:

PL 17:34:33,434 WARN  [ServiceController] Problem starting service
PL jboss.j2ee:service=EJB,jndiName=myBEAN
PL org.jboss.deployment.DeploymentException: CMP field for key not found:
PL field name=roles
PL at
PL 
org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationshipRoleMetaData.loadKeyFields(JDBCRe
PL lationshipRoleMetaData.java:374)
PL at
PL 
org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationshipRoleMetaData.init(JDBCRelationshi
PL pRoleMetaData.java:157)
PL at
PL 
org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationMetaData.init(JDBCRelationMetaData.
PL java:308)
PL at
PL 
org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCApplicationMetaData.init(JDBCApplicationMet
PL aData.java:383)
PL at
PL 
org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCXmlFileLoader.load(JDBCXmlFileLoader.java:75)

PL at
PL 
org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadJDBCEntityMetaData(JDBCStoreManager.j
PL ava:677)
PL at
PL 
org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.initStoreManager(JDBCStoreManager.java:38
PL 9)
PL at
PL org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:339)
PL at
PL org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:198)
PL at org.jboss.ejb.EntityContainer.start(EntityContainer.java:376)
PL at org.jboss.ejb.Container.invoke(Container.java:793)
PL at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:1055)
PL at
PL org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
PL at
PL org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:950)
PL at $Proxy6.start(Unknown Source)