Hi all,
i havd a one to one bidirectional relationship bewtween two
EJBs, UserBean and UserInfoBean (it is the sample from rick hightower..).
i have followed the samples that come with XDoclet (in concrete, the Language
and LanguageCode cmr samples) but i am getting this exception, and i cannot figure
out what's wrong
[ejbdoclet] file:C:/FalcoDevelopment/EJB20/XDoclet/cmr/build.xml:66: XDoclet failed.
[ejbdoclet] at xdoclet.DocletTask.start(DocletTask.java:461)
[ejbdoclet] at xjavadoc.ant.XJavadocTask.execute(XJavadocTask.java:95)
[ejbdoclet] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:193)
[ejbdoclet] at org.apache.tools.ant.Task.perform(Task.java:341)
[ejbdoclet] at org.apache.tools.ant.Target.execute(Target.java:309)
[ejbdoclet] at org.apache.tools.ant.Target.performTasks(Target.java:336)
[ejbdoclet] at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
[ejbdoclet] at org.apache.tools.ant.Project.executeTargets(Project.java:1255)
[ejbdoclet] at org.apache.tools.ant.Main.runBuild(Main.java:609)
[ejbdoclet] at org.apache.tools.ant.Main.start(Main.java:196)
[ejbdoclet] at org.apache.tools.ant.Main.main(Main.java:235)
[ejbdoclet] Caused by: xdoclet.XDocletException: There cmr.UserInfoBean bean doesn't
specify ejb.persistence column-name
[ejbdoclet] at
xdoclet.modules.bea.wls.ejb.WeblogicRelationTagsHandler.keyColumn(WeblogicRelationTagsHandler.java:262
)
[ejbdoclet] at
xdoclet.modules.bea.wls.ejb.WeblogicRelationTagsHandler.ifHasKeyColumn(WeblogicRelationTagsHandler.jav
a:225)
[ejbdoclet] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ejbdoclet] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[ejbdoclet] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[ejbdoclet] at java.lang.reflect.Method.invoke(Method.java:324)
[ejbdoclet] at xdoclet.template.TemplateEngine.invoke(TemplateEngine.java:603)
[ejbdoclet] at
xdoclet.template.TemplateEngine.invokeMethod(TemplateEngine.java:502)
[ejbdoclet] at
xdoclet.template.TemplateEngine.invokeBlockMethod(TemplateEngine.java:927)
[ejbdoclet] at
xdoclet.template.TemplateEngine.handleBlockTag(TemplateEngine.java:894)
[ejbdoclet] at xdoclet.template.TemplateEngine.handleTag(TemplateEngine.java:434)
[ejbdoclet] at xdoclet.template.TemplateEngine.generate(TemplateEngine.java:333)
[ejbdoclet] at xdoclet.XDocletTagSupport.generate(XDocletTagSupport.java:738)
[ejbdoclet] at
xdoclet.modules.bea.wls.ejb.WeblogicRelationTagsHandler.forAllColumnMaps(WeblogicRelationTagsHandler.j
ava:88)
[ejbdoclet] at
xdoclet.modules.bea.wls.ejb.WeblogicRelationTagsHandler.forAllLeftColumnMaps(WeblogicRelationTagsHandl
er.java:94)
[ejbdoclet] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ejbdoclet] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[ejbdoclet] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[ejbdoclet] at java.lang.reflect.Method.invoke(Method.java:324)
[ejbdoclet] at xdoclet.template.TemplateEngine.invoke(TemplateEngine.java:603)
[ejbdoclet] at
xdoclet.template.TemplateEngine.invokeMethod(TemplateEngine.java:502)
[ejbdoclet] at
xdoclet.template.TemplateEngine.invokeBlockMethod(TemplateEngine.java:927)
[ejbdoclet] at
xdoclet.template.TemplateEngine.handleBlockTag(TemplateEngine.java:894)
[ejbdoclet] at xdoclet.template.TemplateEngine.handleTag(TemplateEngine.java:434)
[ejbdoclet] at xdoclet.template.TemplateEngine.generate(TemplateEngine.java:333)
[ejbdoclet] at xdoclet.XDocletTagSupport.generate(XDocletTagSupport.java:738)
[ejbdoclet] at
xdoclet.modules.ejb.dd.RelationTagsHandler.forAllRelationships(RelationTagsHandler.java:327)
[ejbdoclet] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ejbdoclet] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[ejbdoclet] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
and that's weird, since i am putting proper ejb.persistence tags in all methods..
i attach the files, can anyone give me some help? it's been two days that i am stuck
on this problem..
if in the UserBean i use the tag weblogic.target-column-map i don't get exception but
in the weblogic-cmp-rdbms-jar.xml following part will never be generated
<column-map>
<foreign-key-column>email</foreign-key-column>
<key-column>email</key-column>
</column-map>
so, i am assuming that there's something wrong with the ejb.relation tag information
that i am putting...
thanx in advance and regards
marco
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of ext
> Sent: 09 November, 2003 18:11
> To: [EMAIL PROTECTED]
> Subject: [Xdoclet-user] relationship 1->1 weblogic-relationship-role /
> column map not generated
>
>
> Hi all,
> i am little new to XDoclet..
> i have been generating successfully EJBs using XDoclet, but
> now i am encountering problems with CMR.
>
> I have two EJBS, UserBean and UserInfoBean which have
> 1 to 1 relationship.
>
> in the UserBean i have defined following method
>
> /**
> * @return return the User associated to this UserInfo
> * @ejb.interface-method
> * @ejb.transaction type="Required"
> * @ejb.relation
> * name="UserHasUserInfo"
> * role-name="UserHasUserInfo"
> * @weblogic.target-column-map
> * foreign-key-column="email"
>
> */
> public abstract UserInfoLocal getUserInfo();
>
>
> and in the UserInfoBean i have defined following method :
>
> /**
> * @return return the User associated to this UserInfo
> * @ejb.interface-method
> * @ejb.transaction type="Required"
> * @ejb.relation
> * name="UserHasUserInfo"
> * role-name="UserInfoPartOfUser"
> * @weblogic.target-column-map
> * foreign-key-column="email"
> **/
> public abstract UserLocal getUser();
>
> for some reason, in the weblogic-cmp-rdbms-jar.xml the following part
> does not get generated
>
> - <column-map>
> <foreign-key-column>email</foreign-key-column>
> <key-column>email</key-column>
> </column-map>
>
> i have the table tbl_user which contains an email field, and
> a tbl_userinfo
> which also contains an email field, and i have added the
> constraint email_fk to the table.
>
> can anyone help me in figuring out what is the problem?
>
> thanx in advance and regards
> marco
>
>
>
>
>
>
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] Behalf Of
> > ext Pedro
> > Salazar
> > Sent: 04 November, 2003 20:48
> > To: [EMAIL PROTECTED]
> > Subject: [Xdoclet-user] relationship 1:N --> CMP field for
> > key not found
> >
> >
> > Greetings,
> >
> > I have a table Access_Permission that _has_ relation 1-N to
> > Access_Schedule.
> >
> > This table Access_Permission has two attributes (uniques),
> SID_ID and
> > PRIMITIVE_ID, that would be the foreign keys of the table
> > Access_Schedule.
> >
> > Access_Permission Access_Schedule
> > ----------------- ---------------
> > SID_ID -- 1-N --> SID_ID
> > PRIMITIVE_ID PRIMITIVE_ID
> > ... ...
> > (SID_ID,PRIMITIVE_ID) UNIQUE (SID_ID,PRIMITIVE_ID) FK
> >
> > These tables are mapped in two entity beans (CMP). The
> Access_Schedule
> > bean has *no primary keys*, only foreign keys. I created a
> > field in the
> > entity that not exist in the database (I don't know if this
> > is the right
> > procedure):
> >
> > /**
> > * @ejb.pk-field
> > * @ejb.interface-method
> > * view-type="local"
> > * @ejb.persistence
> > **/
> > public abstract void setUnknownPK(int unknownPK);
> >
> >
> > I'm using xdoclet to generate the descriptors and this is
> the entry of
> > my relation on Access_Permission bean:
> > /**
> > * @ejb.relation
> > * name="access_permission_TO__access_schedule"
> > * role-name="access_permission_HAS_schedules"
> > * cascade-delete="no"
> > * target-ejb="AccessSchedule"
> > * target-role-name="schedules_BELONG_TO_access_permission"
> > * target-cascade-delete="yes"
> > * @ejb.interface-method
> > * view-type="local"
> > * @ejb.transaction
> > * type="Supports"
> > * @jboss.relation
> > * related-pk-field="SIDId"
> > * fk-column="SIDId"
> > * @jboss.relation
> > * related-pk-field="primitiveId"
> > * fk-column="primitiveId"
> > * @jboss.target-relation
> > * related-pk-field="SIDId"
> > * fk-column="SIDId"
> > * @jboss.target-relation
> > * related-pk-field="primitiveId"
> > * fk-column="primitiveId"
> > * @jboss.relation-mapping
> > * style="relation-table"
> > * @jboss.relation-table
> > * table-name="uif_access_permission"
> > */
> > public abstract java.util.Collection getSchedules();
> >
> > This is the error I got:
> >
> > ...
> > [ObjectName: jboss.j2ee:jndiName=ejb/AccessScheduleLocal,service=EJB
> > state: FAILED
> > I Depend On:
> > Depends On Me: org.jboss.deployment.DeploymentException: CMP
> > field for
> > key not found: field name=SIDId, ObjectName:
> > jboss.j2ee:jndiName=ejb/AccessPermissionLocal,service=EJB
> > state: FAILED
> > I Depend On:
> > Depends On Me: org.jboss.deployment.DeploymentException: CMP
> > field for
> > key not found: field name=SIDId]
> >
> > Any comments are welcome!
> >
> > thanks,
> > Pedro Salazar.
> > --
> > -PS
> >
> >
> >
> > -------------------------------------------------------
> > This SF.net email is sponsored by: SF.net Giveback Program.
> > Does SourceForge.net help you be more productive? Does it
> > help you create better code? SHARE THE LOVE, and help us help
> > YOU! Click Here: http://sourceforge.net/donate/
> > _______________________________________________
> > xdoclet-user mailing list
> > [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/xdoclet-user
> >
>
>
> -------------------------------------------------------
> This SF.Net email sponsored by: ApacheCon 2003,
> 16-19 November in Las Vegas. Learn firsthand the latest
> developments in Apache, PHP, Perl, XML, Java, MySQL,
> WebDAV, and more! http://www.apachecon.com/
> _______________________________________________
> xdoclet-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/xdoclet-user
>
UserBean.java
Description: UserBean.java
UserInfoBean.java
Description: UserInfoBean.java
