Discussion:
[Middlegen-user] RE: just a dumb user
Aslak Hellesøy
2002-04-10 20:42:54 UTC
Permalink
If you're dumb, it would be because you're using an immature tool. Your
feedback is invaluable both for bug fixing and for building an FAQ ;-)
-----Original Message-----
Sent: 10. april 2002 23:27
To: Aslak Hellesøy
Subject: Fw: just a dumb user
It, midgen, also only creates 5 out of about 200 files that it
created when
it worked. is ther another place besides .middlegen or registry
that could
be doing it? I mean the db cant cause a problem can it?
Hmmm. Do you have 200 tables in your database? That's a lot! You know,
Middlegen only generates one file (the XXXBean file with @tags in it) per
table. All the rest is generated by XDoclet. -So I need to know whether it's
XDoclet or Middlegen that doesn't generate enough files...
Thanks,
Grant
so i have looked again to try to find my error and i cant....
I have gone to the registry and deleted the javasoft stuff... then i re
run
midgen and it crashes here... now i am 99% sure its my error because it
worked for once then died, and i dont remember what i changed.... any
clues.. sorry...
Try to specify only a few <table>s in your <middlegen> task and see if it
works. It's easier to debug on small things. If it works, increase the
number of tables and see if the problem persists. Tell me how it's going.

You can also try to insert the following line in
xdoclet.template.TemplateEngine line 598 (where the
InvocationTargetException is caught):
e.getTargetException().printStackTrace();

That will give you (and me) a more informative stack trace - a stack trace
from Middlegen in stead of XDoclet!

Let me know how it goes...

Aslak
grant
[middlegen] (TemplateEngine.invokeMethod 604 ) Invoking method
failed: middlegen.EntityCMPTagsHandler.primkeyField, line=1
of template file: jar:file:/C:/lib/middlegen.jar!/entity-cmp.j
[middlegen] java.lang.reflect.InvocationTargetException
[middlegen] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
[middlegen] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorIm
pl.java:42
)
[middlegen] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAc
cessorImpl
.java:28)
[middlegen] at java.lang.reflect.Method.invoke(Method.java:313)
[middlegen] at
xdoclet.template.TemplateEngine.invoke(TemplateEngine.java:719)
[middlegen] at
xdoclet.template.TemplateEngine.invokeMethod(TemplateEngine.java:594)
[middlegen] at
xdoclet.template.TemplateEngine.invokeContentMethod(TemplateEngine
.java:689)
[middlegen] at
xdoclet.template.TemplateEngine.handleTag(TemplateEngine.java:543)
[middlegen] at
xdoclet.template.TemplateEngine.generate(TemplateEngine.java:427)
[middlegen] at
xdoclet.template.TemplateTagHandler.generate(TemplateTagHandler.java:76)
[middlegen] at
middlegen.EntityCMPTagsHandler.ifHasPrimkeyField(Unknown
Source)
[middlegen] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
[middlegen] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorIm
pl.java:42
)
[middlegen] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAc
cessorImpl
.java:28)
[middlegen] at java.lang.reflect.Method.invoke(Method.java:313)
[middlegen] at
xdoclet.template.TemplateEngine.invoke(TemplateEngine.java:719)
[middlegen] at
xdoclet.template.TemplateEngine.invokeMethod(TemplateEngine.java:594)
[middlegen] at
xdoclet.template.TemplateEngine.invokeBlockMethod(TemplateEngine.j
ava:1037)
[middlegen] at
xdoclet.template.TemplateEngine.handleBlockTag(TemplateEngine.java:1001)
[middlegen] at
xdoclet.template.TemplateEngine.handleTag(TemplateEngine.java:539)
[middlegen] at
xdoclet.template.TemplateEngine.generate(TemplateEngine.java:427)
[middlegen] at
xdoclet.template.TemplateEngine.start(TemplateEngine.java:483)
[middlegen] at middlegen.Middlegen.writeSource(Unknown Source)
[middlegen] at middlegen.MiddlegenTask.execute(Unknown Source)
[middlegen] at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:104)
[middlegen] at org.apache.tools.ant.Task.perform(Task.java:217)
[middlegen] at org.apache.tools.ant.Target.execute(Target.java:184)
[middlegen] at
org.apache.tools.ant.Target.performTasks(Target.java:202)
[middlegen] at
org.apache.tools.ant.Project.executeTarget(Project.java:601)
[middlegen] at
org.apache.tools.ant.Project.executeTargets(Project.java:560)
[middlegen] at org.apache.tools.ant.Main.runBuild(Main.java:454)
[middlegen] at org.apache.tools.ant.Main.start(Main.java:153)
[middlegen] at org.apache.tools.ant.Main.main(Main.java:176)
[middlegen] Caused by: java.lang.NullPointerException
[middlegen] at middlegen.EntityCMPTagsHandler.primkeyField(Unknown
Source)
[middlegen] ... 33 more
BUILD FAILED
a***@netcom.no
2002-04-11 12:44:23 UTC
Permalink
----- Original Message -----
From: Grant Marblestone <***@ATSER.com>
Date: Thursday, April 11, 2002 4:06 pm
Subject: Re: just a dumb user
Aksak,
Aslak ;-)
Acutally i exagerate. Really it creates about 5 of 60 *Bean.java,
Does this mean you have 60 tables and Mg only generates 5 *Bean.java,
and for some reason it doesn't generate the other 55?
xdoclet,files. It gives this error, if true is set for gui, just
Does this mean that you don't get the error if gui="false" ?
after the gui aka
generate beans time. Do you know why this is happening, middlegen
problem?
If I knew I would be the first to tell you. Unfortunately, I'm not able
to reproduce the behaviour, so I hope you can try out the trick I
mentioned in my last mail: Hack the CVS version of xdoclet, build it
and rerun.
And btw, i think this program is amazing and has great potential, i
I have big visions for it. I will extend it to generate Castor, Struts,
JDO, Taglibs.... Still, XDoclet will do the dirty work of generating
the remaining stuff.

There is a book on Ant coming out in a month or two that spends quite a
few pages on XDoclet and Middlegen. The book is written by one of the
Ant authors, so I guess it's a good indication that it'll catch on
pretty soon.
subjected it just a dumb user, becuase while i "know" java, i have
greattroubles reading entire programs and cant find bugs too
easily. I do want
to help debug and develop.
For starters, if you hack it and think what you do is of general
interest, please submit patches (do a diff in your CVS) to the patches
page on the Middlegen SF page.
THanks for all your help
Grant
No prob. Btw, please CC middlegen-***@lists.sourceforge.net when you
mail me, unless you have some top-secret information you only want to
share with me. Information wants to be free.

Peace,
Aslak
----- Original Message -----
Sent: Wednesday, April 10, 2002 5:34 PM
Subject: RE: just a dumb user
If you're dumb, it would be because you're using an immature tool.
Yourfeedback is invaluable both for bug fixing and for building an
FAQ ;-)
-----Original Message-----
Sent: 10. april 2002 23:27
To: Aslak Helles�y
Subject: Fw: just a dumb user
It, midgen, also only creates 5 out of about 200 files that it
created when
it worked. is ther another place besides .middlegen or registry
that could
be doing it? I mean the db cant cause a problem can it?
Hmmm. Do you have 200 tables in your database? That's a lot! You know,
it) per
table. All the rest is generated by XDoclet. -So I need to know
whether it's
XDoclet or Middlegen that doesn't generate enough files...
Thanks,
Grant
so i have looked again to try to find my error and i cant....
I have gone to the registry and deleted the javasoft stuff...
then i re
run
midgen and it crashes here... now i am 99% sure its my error
because it
worked for once then died, and i dont remember what i
changed.... any
clues.. sorry...
Try to specify only a few <table>s in your <middlegen> task and
see if it
works. It's easier to debug on small things. If it works, increase the
number of tables and see if the problem persists. Tell me how it's
going.
You can also try to insert the following line in
xdoclet.template.TemplateEngine line 598 (where the
e.getTargetException().printStackTrace();
That will give you (and me) a more informative stack trace - a
stack trace
from Middlegen in stead of XDoclet!
Let me know how it goes...
Aslak
grant
[middlegen] (TemplateEngine.invokeMethod 604 )
Invoking method
failed: middlegen.EntityCMPTagsHandler.primkeyField, line=1
of template file: jar:file:/C:/lib/middlegen.jar!/entity-cmp.j
[middlegen] java.lang.reflect.InvocationTargetException
[middlegen] at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native> > Method)
[middlegen] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorIm
pl.java:42
)
[middlegen] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAc
cessorImpl
.java:28)
[middlegen] at
java.lang.reflect.Method.invoke(Method.java:313)> > [middlegen]
at
xdoclet.template.TemplateEngine.invoke(TemplateEngine.java:719)
[middlegen] at
xdoclet.template.TemplateEngine.invokeMethod(TemplateEngine.java:594)
[middlegen] at
xdoclet.template.TemplateEngine.invokeContentMethod(TemplateEngine
.java:689)
[middlegen] at
xdoclet.template.TemplateEngine.handleTag(TemplateEngine.java:543)
[middlegen] at
xdoclet.template.TemplateEngine.generate(TemplateEngine.java:427)
[middlegen] at
xdoclet.template.TemplateTagHandler.generate
(TemplateTagHandler.java:76)> > [middlegen] at
middlegen.EntityCMPTagsHandler.ifHasPrimkeyField(Unknown
Source)
[middlegen] at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native> > Method)
[middlegen] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorIm
pl.java:42
)
[middlegen] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAc
cessorImpl
.java:28)
[middlegen] at
java.lang.reflect.Method.invoke(Method.java:313)> > [middlegen]
at
xdoclet.template.TemplateEngine.invoke(TemplateEngine.java:719)
[middlegen] at
xdoclet.template.TemplateEngine.invokeMethod(TemplateEngine.java:594)
[middlegen] at
xdoclet.template.TemplateEngine.invokeBlockMethod(TemplateEngine.j
ava:1037)
[middlegen] at
xdoclet.template.TemplateEngine.handleBlockTag
(TemplateEngine.java:1001)> > [middlegen] at
xdoclet.template.TemplateEngine.handleTag(TemplateEngine.java:539)
[middlegen] at
xdoclet.template.TemplateEngine.generate(TemplateEngine.java:427)
[middlegen] at
xdoclet.template.TemplateEngine.start(TemplateEngine.java:483)
[middlegen] at middlegen.Middlegen.writeSource(Unknown Source)
[middlegen] at middlegen.MiddlegenTask.execute(Unknown Source)
[middlegen] at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:104)>
[middlegen] at org.apache.tools.ant.Task.perform(Task.java:217)
[middlegen] at
org.apache.tools.ant.Target.execute(Target.java:184)> >
[middlegen] at
org.apache.tools.ant.Target.performTasks(Target.java:202)
[middlegen] at
org.apache.tools.ant.Project.executeTarget(Project.java:601)
[middlegen] at
org.apache.tools.ant.Project.executeTargets(Project.java:560)
[middlegen] at
org.apache.tools.ant.Main.runBuild(Main.java:454)> > [middlegen]
at org.apache.tools.ant.Main.start(Main.java:153)
[middlegen] at org.apache.tools.ant.Main.main(Main.java:176)
[middlegen] Caused by: java.lang.NullPointerException
[middlegen] at
middlegen.EntityCMPTagsHandler.primkeyField(Unknown> > Source)
[middlegen] ... 33 more
BUILD FAILED
Grant Marblestone
2002-04-11 14:11:56 UTC
Permalink
Howdy,

so i specified only two tables this time and this is what i get now....

I know its obvious and that my xdoclet doesnt have the optional weblogic
package... do you know how i can get this when i self compile??

Grant
________________________________________________

[xdoclet-bootstrapper] Adding create method createWeblogic to
xdoclet.ejb.EjbDocletTask

BUILD FAILED

java.lang.NoClassDefFoundError:
xdoclet/optional/weblogic/ejb/WebLogicSubTask
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:1618)
at java.lang.Class.privateGetPublicMethods(Class.java:1646)
at java.lang.Class.getMethods(Class.java:810)
at
org.apache.tools.ant.IntrospectionHelper.<init>(IntrospectionHelper.java:123
)
at
org.apache.tools.ant.IntrospectionHelper.getHelper(IntrospectionHelper.java:
256)
at
org.apache.tools.ant.UnknownElement.handleChildren(UnknownElement.java:120)
at
org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:88)
at org.apache.tools.ant.Task.perform(Task.java:216)
at org.apache.tools.ant.Target.execute(Target.java:184)
at org.apache.tools.ant.Target.performTasks(Target.java:202)
at org.apache.tools.ant.Project.executeTarget(Project.java:601)
at org.apache.tools.ant.Project.executeTargets(Project.java:560)
at org.apache.tools.ant.Main.runBuild(Main.java:454)
at org.apache.tools.ant.Main.start(Main.java:153)
at org.apache.tools.ant.Main.main(Main.java:176)

Total time: 5 seconds
xdoclet/optional/weblogic/ejb/WebLogicSubTask
a***@netcom.no
2002-04-11 12:51:15 UTC
Permalink
[middlegen] (TemplateEngine.invokeMethod 604 )
Invoking method
failed: middlegen.EntityCMPTagsHandler.primkeyField, line=1
It looks like it's middlegen.EntityCMPTagsHandler.primkeyField() which
fails. When you hack XDoclet for me, we'll get a stack trace from the
primkeyField() method, and I'll be able to fix it.

However, I already have a hunch. I think the method might be throwing
an NPE, and that might be because one of your tables doesn't specify
any primary key at all. Am I right or wrong?

Aslak
of template file: jar:file:/C:/lib/middlegen.jar!/entity-cmp.j
[middlegen] java.lang.reflect.InvocationTargetException
[middlegen] at
a***@netcom.no
2002-04-11 15:08:05 UTC
Permalink
If you execute xdoclet/core/script/build (default ant target) you'll
find optional-weblogic.jar somewhere under xdoclet afterwards. copy
weblogic-optional.jar, xjavadoc.jar and xdoclet.jar to
middlegen/samples/lib. If you follow Ant's output closely, you'll see
where these files are written to.

hth,
aslak

----- Original Message -----
From: Grant Marblestone <***@ATSER.com>
Date: Thursday, April 11, 2002 4:17 pm
Subject: Re: just a dumb user
Post by Grant Marblestone
Howdy,
so i specified only two tables this time and this is what i get
now....
I know its obvious and that my xdoclet doesnt have the optional
weblogicpackage... do you know how i can get this when i self
compile??
Grant
________________________________________________
[xdoclet-bootstrapper] Adding create method createWeblogic to
xdoclet.ejb.EjbDocletTask
BUILD FAILED
xdoclet/optional/weblogic/ejb/WebLogicSubTask
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:1618)
at java.lang.Class.privateGetPublicMethods(Class.java:1646)
at java.lang.Class.getMethods(Class.java:810)
at
org.apache.tools.ant.IntrospectionHelper.<init>
(IntrospectionHelper.java:123
Post by Grant Marblestone
)
at
org.apache.tools.ant.IntrospectionHelper.getHelper
256)
at
org.apache.tools.ant.UnknownElement.handleChildren
(UnknownElement.java:120)
Post by Grant Marblestone
at
org.apache.tools.ant.UnknownElement.maybeConfigure
(UnknownElement.java:88)
Post by Grant Marblestone
at org.apache.tools.ant.Task.perform(Task.java:216)
at org.apache.tools.ant.Target.execute(Target.java:184)
at org.apache.tools.ant.Target.performTasks(Target.java:202)
at
org.apache.tools.ant.Project.executeTarget(Project.java:601)
at org.apache.tools.ant.Project.executeTargets(Project.java:560)
at org.apache.tools.ant.Main.runBuild(Main.java:454)
at org.apache.tools.ant.Main.start(Main.java:153)
at org.apache.tools.ant.Main.main(Main.java:176)
Total time: 5 seconds
xdoclet/optional/weblogic/ejb/WebLogicSubTask
Grant Marblestone
2002-04-11 18:26:32 UTC
Permalink
yes, the guy who designed the db didnt include the pk's on several tables,

I will have him add some dummy fields.


Grant

Loading...