Bugs item #514180, was opened at 2002-02-07 01:52
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=402704&aid=514180&group_id=31602
Category: None
Group: None
Status: Open
Resolution: Fixed
Priority: 9
Submitted By: Thomas Phan (twhphan)
Assigned to: David Budworth (dbudworth)
Summary: empty XDtEjbRel:rightEJBName
Initial Comment:
Problem:
XDtEjbRel:rightEJBName doesn't return correctly.
Note: My code worked in xdoclet 1.1.1, but doesn't now
(since after the newest jbosscmp-jdbc DTD has been
changed)
---
Code:
public abstract class ViewSettingBean implements
EntityBean {
...
/**
* @ejb:relation name="setting-shortcut" role-
name="one-setting-has-many-shortcuts" target-
ejb="ViewShortcut" target-role-name="one-shortcut-
belongs-to-one-setting"
* @ejb:interface-method view-type="local"
*
* @jboss:target-relation fk-constraint="true"
related-pk-field="username" fk-column="username"
*/
public abstract java.util.Collection getViewShortcuts
();
---
Ant/log4j output:
[ejbdoclet] Generating EJB deployment descriptor.
[ejbdoclet] RelationHolder
left=esb.ejb.ViewSettingBean.getViewShortcuts
right=null.null
[ejbdoclet] RelationHolder
left=esb.ejb.UserBean.getRoles right=null.null
[ejbdoclet] RelationHolder
left=esb.ejb.ViewSettingBean.getViewToolsBoxes
right=null.null
[ejbdoclet] Running <jboss/>
[ejbdoclet] Generating jboss.xml.
[ejbdoclet] Generating jaws.xml.
[ejbdoclet] Generating jbosscmp-jdbc.xml.
[ejbdoclet] RelationHolder
left=esb.ejb.ViewSettingBean.getViewShortcuts
right=null.null
[ejbdoclet] Running XDoclet failed.
[ejbdoclet] <<Cannot have null method when extracting
tag value.>>
[ejbdoclet] 1 error
---
ejb-jar.xml:
<ejb-relation>
<ejb-relation-name>setting-shortcut</ejb-relation-
name>
<!-- unidirectional -->
<ejb-relationship-role>
<ejb-relationship-role-name>one-setting-has-many-
shortcuts</ejb-relationship-role-name>
<multiplicity>One</multiplicity>
<relationship-role-source>
<ejb-name>ViewSetting</ejb-name>
</relationship-role-source>
<cmr-field>
<cmr-field-name>viewShortcuts</cmr-field-name>
<cmr-field-type>java.util.Collection</cmr-
field-type>
</cmr-field>
</ejb-relationship-role>
<ejb-relationship-role>
<ejb-relationship-role-name>one-shortcut-belongs-
to-one-setting</ejb-relationship-role-name>
<multiplicity>Many</multiplicity>
<relationship-role-source>
<ejb-name></ejb-name>
</relationship-role-source>
</ejb-relationship-role>
</ejb-relation>
---
jbosscmp-jdbc.xml:
<relationships>
<ejb-relation>
<ejb-relation-name>setting-shortcut</ejb-relation-
name>
<foreign-key-mapping/>
<ejb-relationship-role>
<ejb-relationship-role-name>one-setting-has-
many-shortcuts</ejb-relationship-role-name>
<key-fields>
<key-field>
<field-name>username</field-name>
<column-name>username</column-name>
</key-field>
</key-
fields>
^^
stopped generating, and the key-field is placed in the
wrong side
----------------------------------------------------------------------
>Comment By: Thomas Phan (twhphan)
Date: 2002-02-10 02:25
Message:
Logged In: YES
user_id=409109
yes, it works, cool
thanks
----------------------------------------------------------------------
Comment By: David Budworth (dbudworth)
Date: 2002-02-09 14:44
Message:
Logged In: YES
user_id=343354
fixed (this time for real hopefully) in
JBossRelationTagsHandler.java 1.3
It was a case of reversed logic on rightFKConstraint
processing. silly me.
----------------------------------------------------------------------
Comment By: David Budworth (dbudworth)
Date: 2002-02-09 02:39
Message:
Logged In: YES
user_id=343354
ok, well whatever threw that exception, didn't bother to
include the base exception along with it.
so, stack trace tells me nothing. But I do notice that
where it was failing in jbosscmp-jdbc.xml generation before,
it's now failing in jboss.xml generation, so I think this is
a different problem. Especially since jboss.xml never deals
with relationships.
Can you post the xdoclet tags around each EJB in the method,
and the getViewShortcuts doclet tags. (this is a uni
relationship right? there is no accessor to ViewSettingBean
in the ViewShortcuts bean, correct?)
----------------------------------------------------------------------
Comment By: Thomas Phan (twhphan)
Date: 2002-02-08 19:43
Message:
Logged In: YES
user_id=409109
Hi, Thx 4 ur work. Have I missed a setting/conf? Here's the
log4j output
...
[ejbdoclet] (DocletTask$DocletMain.start 532 )
Context successfully loaded.
[ejbdoclet] (DocletTask$DocletMain.start 543 )
SubTask homeInterfaceInitialized.
[ejbdoclet] Running <homeInterface/>
[ejbdoclet] (DocletTask$DocletMain.start 543 )
SubTask localHomeInterfaceInitialized.
[ejbdoclet] Running <localHomeInterface/>
[ejbdoclet] (DocletTask$DocletMain.start 543 )
SubTask remoteInterfaceInitialized.
[ejbdoclet] Running <remoteInterface/>
[ejbdoclet] (DocletTask$DocletMain.start 543 )
SubTask localInterfaceInitialized.
[ejbdoclet] Running <localInterface/>
[ejbdoclet] (DocletTask$DocletMain.start 543 )
SubTask sessionInitialized.
[ejbdoclet] Running <session/>
[ejbdoclet] (DocletTask$DocletMain.start 543 )
SubTask entitypkInitialized.
[ejbdoclet] Running <entitypk/>
[ejbdoclet] (DocletTask$DocletMain.start 543 )
SubTask dataobjectInitialized.
[ejbdoclet] Running <dataobject/>
[ejbdoclet] (DocletTask$DocletMain.start 543 )
SubTask entitycmpInitialized.
[ejbdoclet] Running <entitycmp/>
[ejbdoclet] (DocletTask$DocletMain.start 543 )
SubTask deploymentDescriptorInitialized.
[ejbdoclet] Running <deploymentDescriptor/>
[ejbdoclet] RelationHolder
left=esb.ejb.ViewSettingBean.getViewShortcuts
right=null.null
[ejbdoclet] RelationHolder left=esb.ejb.UserBean.getRoles
right=null.null
[ejbdoclet] RelationHolder
left=esb.ejb.ViewSettingBean.getViewToolsBoxes
right=null.null
[ejbdoclet] (DocletTask$DocletMain.start 543 )
SubTask jbossInitialized.
[ejbdoclet] Running <jboss/>
[ejbdoclet] RelationHolder
left=esb.ejb.ViewSettingBean.getViewShortcuts
right=null.null
[ejbdoclet] Running XDoclet failed.
[ejbdoclet] <<>>
[ejbdoclet] javadoc: In doclet class
xdoclet.DocletTask$DocletMain, method start has thrown an
exception java.lang.reflect.InvocationTargetException
[ejbdoclet] (DocletTask$DocletMain.start 577 )
Template Exception = xdoclet.XDocletException: Cannot have
null method when extracting tag value.
[ejbdoclet] (DocletTask$DocletMain.start 578 )
Nested Exception = null
[ejbdoclet] (DocletTask$DocletMain.start 586 )
Exception trace:
[ejbdoclet] xdoclet.XDocletException:
[ejbdoclet] at
xdoclet.TemplateSubTask.isGenerationNeeded
(TemplateSubTask.java:607)
[ejbdoclet] at xdoclet.TemplateSubTask.startProcess
(TemplateSubTask.java:319)
[ejbdoclet] at xdoclet.XmlSubTask.startProcess
(XmlSubTask.java:121)
[ejbdoclet] at xdoclet.ejb.vendor.JBossSubTask.execute
(JBossSubTask.java:183)
[ejbdoclet] at xdoclet.DocletTask$DocletMain.start
(DocletTask.java:549)
[ejbdoclet] at java.lang.reflect.Method.invoke(Native
Method)
[ejbdoclet] at
com.sun.tools.javadoc.DocletInvoker.invoke
(DocletInvoker.java:193)
[ejbdoclet] at com.sun.tools.javadoc.DocletInvoker.start
(DocletInvoker.java:95)
[ejbdoclet] at com.sun.tools.javadoc.Main.main
(Main.java:233)
[ejbdoclet]
[ejbdoclet] 1 error
[ejbdoclet] 12 warnings
----------------------------------------------------------------------
Comment By: David Budworth (dbudworth)
Date: 2002-02-08 12:29
Message:
Logged In: YES
user_id=343354
I can not re-produce this using the samples with xdoclet
(which include uni relationships).
Can you re-build your project (that produces this error)
with a higher log level?
To do this, do:
export
ANT_OPTS="-Dlog4j.configuration=file:/location/of/debug.log4j.props"
then run ant (or your build.sh type script)
And post the stack trace here please. (Or if it's gigantic,
send it to my email (sf email))
### begin debug.log4j.props ###
log4j.rootCategory=INFO, Console
log4j.appender.Console=org.apache.log4j.ConsoleAppender
log4j.appender.Console.layout=org.apache.log4j.PatternLayout
log4j.appender.Console.layout.ConversionPattern=(%-35c{2}
%-4L) %m%n
log4j.category.xdoclet.DocletTask$DocletMain=DEBUG
### end debug.log4j.props ###
----------------------------------------------------------------------
Comment By: David Budworth (dbudworth)
Date: 2002-02-08 10:39
Message:
Logged In: YES
user_id=343354
Thanks for the update, I'm checking it out now.
----------------------------------------------------------------------
Comment By: Thomas Phan (twhphan)
Date: 2002-02-08 00:03
Message:
Logged In: YES
user_id=409109
Hi, Thx 4 the fix/instruction. Here'r the steps I took: I
deleted the whole src tree, and rebuilt, but still doesn't
work
[root@es /tmp]# rm -r xdoclet/
[root@es /tmp]# cvs -
d:pserver:[EMAIL PROTECTED]:/cvsroot/xdo
clet login
(Logging in to [EMAIL PROTECTED])
CVS password:
[root@es /tmp]# cvs -z3 -
d:pserver:[EMAIL PROTECTED]:/cvsroot/xdo
clet co xdoclet
cvs server: Updating xdoclet
cvs server: Updating xdoclet/config
...
U xdoclet/script/build.xml
[root@es /tmp]# cd xdoclet/script/
[root@es script]# chmod +x build.sh
[root@es script]# ./build.sh
...
dist-zip:
[zip] Building zip: /tmp/xdoclet/xdoclet-1.1.1.zip
BUILD SUCCESSFUL
Total time: 1 minute 34 seconds
[root@es script]# cp ../dist/lib/xdoclet.jar /var/esb/lib/
[root@es script]# cd /var/esb/script/
[root@es script]# ./build.sh ejbdoclet
...
[ejbdoclet] Running <deploymentDescriptor/>
[ejbdoclet] RelationHolder
left=esb.ejb.ViewSettingBean.getViewShortcuts
right=null.null
[ejbdoclet] RelationHolder left=esb.ejb.UserBean.getRoles
right=null.null
[ejbdoclet] RelationHolder
left=esb.ejb.ViewSettingBean.getViewToolsBoxes
right=null.null
[ejbdoclet] Running <jboss/>
[ejbdoclet] RelationHolder
left=esb.ejb.ViewSettingBean.getViewShortcuts
right=null.null
[ejbdoclet] Running XDoclet failed.
[ejbdoclet] <<>>
[ejbdoclet] 1 error
[ejbdoclet] 10 warnings
[ejbdoclet] javadoc: In doclet class
xdoclet.DocletTask$DocletMain, method start has thrown an
exception java.lang.reflect.InvocationTargetException
BUILD SUCCESSFUL
Total time: 8 seconds
[root@es script]# ls -l ../lib/xdoclet.jar
-rw-r--r-- 1 root root 410295 Feb 8
15:36 ../lib/xdoclet.jar
[root@es script]#
^^^
note that this file (created at 15:36) has the same file
size as the one created at 12:46
---
[root@es script]# cat ../build/ejb/META-INF/ejb-jar.xml
...
<ejb-relation-name>setting-shortcut</ejb-relation-
name>
<!-- unidirectional -->
<ejb-relationship-role>
<ejb-relationship-role-name>one-setting-has-
many-shortcuts</ejb-relationship-role-name>
<multiplicity>One</multiplicity>
<relationship-role-source>
<ejb-name>ViewSetting</ejb-name>
</relationship-role-source>
<cmr-field>
<cmr-field-name>viewShortcuts</cmr-field-
name>
<cmr-field-type>java.util.Collection</cmr-
field-type>
</cmr-field>
</ejb-relationship-role>
<ejb-relationship-role>
<ejb-relationship-role-name>one-shortcut-
belongs-to-one-setting</ejb-relationship-role-name>
<multiplicity>Many</multiplicity>
<relationship-role-source>
<ejb-name></ejb-name>
</relationship-role-source>
</ejb-relationship-role>
</ejb-relation>
^^^
same bug as b4
----------------------------------------------------------------------
Comment By: David Budworth (dbudworth)
Date: 2002-02-07 23:28
Message:
Logged In: YES
user_id=343354
You did a CVS update at the toplevel xdoclet dir, then
cd xdoclet/script
./build total-clean
./build
cp ../dist/lib/xdoclet.jar /wherver/you/put/xdoclet.jar
And re-built your code (clean re-generate)?
(Sorry, don't mean to sound patronizing, just want to make sure)
The error you showed in the last post is different than the
original. Is that just a loglevel difference?
(If you did all this, just ignore this message, I'll go make
some EJBs to try to re-produce)
----------------------------------------------------------------------
Comment By: Thomas Phan (twhphan)
Date: 2002-02-07 21:14
Message:
Logged In: YES
user_id=409109
Hi, I updated my xdoclet.jar, but I don't see the changes
[root@es script]# cat build.sh
...
CP=../lib/xdoclet.jar:../lib/log4j.jar:$CP
...
$JAVA_HOME/bin/java -classpath $CP
org.apache.tools.ant.Main $1 $2 $3 $4 $5
...
[root@es script]# ./build.sh ejbdoclet
...
[ejbdoclet] RelationHolder
left=esb.ejb.ViewSettingBean.getViewShortcuts
right=null.null
[ejbdoclet] RelationHolder left=esb.ejb.UserBean.getRoles
right=null.null
[ejbdoclet] RelationHolder
left=esb.ejb.ViewSettingBean.getViewToolsBoxes
right=null.null
[ejbdoclet] Running <jboss/>
[ejbdoclet] RelationHolder
left=esb.ejb.ViewSettingBean.getViewShortcuts
right=null.null
[ejbdoclet] Running XDoclet failed.
[ejbdoclet] [ejbdoclet] javadoc: In doclet class
xdoclet.DocletTask$DocletMain, method start has thrown an
exception java.lang.reflect.InvocationTargetException
<<>>
[ejbdoclet] 1 error
[ejbdoclet] 10 warnings
BUILD SUCCESSFUL
Total time: 8 seconds
[root@es script]# ls -l ../lib/xdoclet.jar
-rw-r--r-- 1 root root 410295 Feb 8
12:46 ../lib/xdoclet.jar
[root@es script]#
----------------------------------------------------------------------
Comment By: David Budworth (dbudworth)
Date: 2002-02-07 18:58
Message:
Logged In: YES
user_id=343354
Sorry, I fixed/commited this before I saw someone was
working on it. It was a type-o in my previous commit.
should be fine now
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=402704&aid=514180&group_id=31602
_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel