Discussion:
[Middlegen-user] Trouble building the sample code
Mike Grass
2004-10-30 18:09:25 UTC
Permalink
Hey all,

I just downloaded middlegen and I am trying to get it to work with my
configuration (JBoss 4.0.0, mysql 4.1.6, xdoclet-1.2.2).

I am trying to use cmp20 persistence and struts for the action layer.
I've successfully run `ant create-tables`, but now when I run `ant`, I
get the following errors:

============= BEGIN ERROR DUMP ===============
compile-adapter:
[javac] Compiling 5 source files to
/home/mike/project-2/StudentEJB/middlegen-2.1/samples/build/
classes
[javac] /home/mike/project-2/StudentEJB/middlegen-2.1/samples/build/gen-src/airline/adapter/StrutsSeqBlockDelegate.java:33:
cannot resolve symbol
[javac] symbol : class SeqBlockFacadeUtil
[javac] location: package interfaces
[javac] seqBlockPersistence =
airline.interfaces.SeqBlockFacadeUtil.getHome().create().create(seqBlockPersistence);
[... 5 more failures to resolve SeqBlockFacadeUtil ... ]
[javac] /home/mike/project-2/StudentEJB/middlegen-2.1/samples/build/gen-src/airline/adapter/TranslatorUtil.java:106:
cannot resolve symbol
[javac] symbol : method setIdx (java.lang.Integer)
[javac] location: class airline.interfaces.SeqBlockValue
[javac] seqBlockPersistence.setIdx(seqBlockForm.getIdx());
[javac] ^
[javac] /home/mike/project-2/StudentEJB/middlegen-2.1/samples/build/gen-src/airline/adapter/TranslatorUtil.java:118:
setIdx(java.lang.Integer) in airline.web.struts.SeqBlockForm cannot be
applied
to (int)
[javac] seqBlockForm.setIdx(seqBlockPersistence.getIdx());
[javac] ^
============= END ERROR DUMP ===============

Any ideas?

Thanks,
--Mike
Darren Hartford
2004-11-01 11:45:10 UTC
Permalink
Hi Mike,
After create-tables, could you try running just 'ant middlegen', followed by 'ant ejbdoclet', then 'ant compile-ejb'. This will help determine which task to take a specific look at. It looks like it is missing the ejbdoclet task, but just want to make sure.

-D
-----Original Message-----
Sent: Saturday, October 30, 2004 4:08 PM
Subject: [Middlegen-user] Trouble building the sample code
Hey all,
I just downloaded middlegen and I am trying to get it to work with my
configuration (JBoss 4.0.0, mysql 4.1.6, xdoclet-1.2.2).
I am trying to use cmp20 persistence and struts for the action layer.
I've successfully run `ant create-tables`, but now when I run `ant`, I
============= BEGIN ERROR DUMP ===============
[javac] Compiling 5 source files to
/home/mike/project-2/StudentEJB/middlegen-2.1/samples/build/
classes
[javac]
/home/mike/project-2/StudentEJB/middlegen-2.1/samples/build/ge
cannot resolve symbol
[javac] symbol : class SeqBlockFacadeUtil
[javac] location: package interfaces
[javac] seqBlockPersistence =
airline.interfaces.SeqBlockFacadeUtil.getHome().create().creat
e(seqBlockPersistence);
[... 5 more failures to resolve SeqBlockFacadeUtil ... ]
[javac]
/home/mike/project-2/StudentEJB/middlegen-2.1/samples/build/ge
cannot resolve symbol
[javac] symbol : method setIdx (java.lang.Integer)
[javac] location: class airline.interfaces.SeqBlockValue
[javac] seqBlockPersistence.setIdx(seqBlockForm.getIdx());
[javac] ^
[javac]
/home/mike/project-2/StudentEJB/middlegen-2.1/samples/build/ge
setIdx(java.lang.Integer) in airline.web.struts.SeqBlockForm cannot be
applied
to (int)
[javac] seqBlockForm.setIdx(seqBlockPersistence.getIdx());
[javac] ^
============= END ERROR DUMP ===============
Any ideas?
Thanks,
--Mike
Mike Grass
2004-11-01 20:39:24 UTC
Permalink
Darren,

The build succeeds on all of those targets. It fails when compiling the war.

After further poking around, I noticed that the ejbdoclet target
contained the following ejbdoclet task:

<ejbdoclet
destdir="${build.gen-src.dir}"
excludedtags="@version,@author"
ejbspec="2.0"
<fileset dir="${build.gen-src.dir}">
<include name="**/ejb/**/*Bean.java" />
<exclude name="**/ejb/**/SeqBlockBean.java" />
<exclude name="**/ejb/**/SequenceBean.java" />
</fileset>

<packageSubstitution packages="ejb" substituteWith="interfaces"/>

<entityfacade>
</entityfacade>
</ejbdoclet>

If I modify this task to *not* exclude those two files
(SeqBlockBean.java and SequenceBean.java), everything compiles fine.
There must be a reason why these two files were excluded, though,
right?

With the generated site, however, I can't create a reservation. An
exception is thrown saying "javax.servlet.ServletException: CMR not
supported yet". I *can* create flights and users, which clearly
wouldn't need CMR. Is there some way to work around the lack of CMR
support? Is this a jboss problem or a middlegen problem?

One more question . . . if I wanted to switch from using cmp20
persistence to hibernate, how painful would that be? Just for fun, I
tried just changing the build.properties setting from cmp20 to
hibernate, but I get more compile errors with methods being undefined,
etc. It looks like it is generating several ejb-specific files . . .
is there some specific order I should invoke ant targets for creating
a deployable hibernate build?

Thanks for all suggestions,
--Mike
Post by Darren Hartford
Hi Mike,
After create-tables, could you try running just 'ant middlegen', followed by 'ant ejbdoclet', then 'ant compile-ejb'. This will help determine which task to take a specific look at. It looks like it is missing the ejbdoclet task, but just want to make sure.
-D
-----Original Message-----
Sent: Saturday, October 30, 2004 4:08 PM
Subject: [Middlegen-user] Trouble building the sample code
Hey all,
I just downloaded middlegen and I am trying to get it to work with my
configuration (JBoss 4.0.0, mysql 4.1.6, xdoclet-1.2.2).
I am trying to use cmp20 persistence and struts for the action layer.
I've successfully run `ant create-tables`, but now when I run `ant`, I
============= BEGIN ERROR DUMP ===============
[javac] Compiling 5 source files to
/home/mike/project-2/StudentEJB/middlegen-2.1/samples/build/
classes
[javac]
/home/mike/project-2/StudentEJB/middlegen-2.1/samples/build/ge
cannot resolve symbol
[javac] symbol : class SeqBlockFacadeUtil
[javac] location: package interfaces
[javac] seqBlockPersistence =
airline.interfaces.SeqBlockFacadeUtil.getHome().create().creat
e(seqBlockPersistence);
[... 5 more failures to resolve SeqBlockFacadeUtil ... ]
[javac]
/home/mike/project-2/StudentEJB/middlegen-2.1/samples/build/ge
cannot resolve symbol
[javac] symbol : method setIdx (java.lang.Integer)
[javac] location: class airline.interfaces.SeqBlockValue
[javac] seqBlockPersistence.setIdx(seqBlockForm.getIdx());
[javac] ^
[javac]
/home/mike/project-2/StudentEJB/middlegen-2.1/samples/build/ge
setIdx(java.lang.Integer) in airline.web.struts.SeqBlockForm cannot be
applied
to (int)
[javac] seqBlockForm.setIdx(seqBlockPersistence.getIdx());
[javac] ^
============= END ERROR DUMP ===============
Any ideas?
Thanks,
--Mike
-------------------------------------------------------
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_idU88&alloc_id065&opclick
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
Darren Hartford
2004-11-02 19:48:50 UTC
Permalink
I do not use the SeqBlock or Sequence beans...I thought they were Oracle specific, but I might be thinking of one of Middlegen's generic UID generators.

As for hibernate versus cmp20, it is only a small deal in so far as changing (or adding in another) Ant tasks/Maven goals (which isn't that hard). However, by switching persistance you may break your business code if it has dependencies already on your persistance layer. I will mention using hibernate will eliminate all the problems you have mentioned so far in the tutorial for Middlegen.

CMR issue - Known problem with Jboss deployments. I personally don't use CMR anymore because of this (and sometimes better for more specific business-rules-relations).

-D
-----Original Message-----
Sent: Monday, November 01, 2004 5:34 PM
Subject: Re: [Middlegen-user] Trouble building the sample code
Darren,
The build succeeds on all of those targets. It fails when
compiling the war.
After further poking around, I noticed that the ejbdoclet target
<ejbdoclet
destdir="${build.gen-src.dir}"
ejbspec="2.0"
<fileset dir="${build.gen-src.dir}">
<include name="**/ejb/**/*Bean.java" />
<exclude name="**/ejb/**/SeqBlockBean.java" />
<exclude name="**/ejb/**/SequenceBean.java" />
</fileset>
<packageSubstitution packages="ejb"
substituteWith="interfaces"/>
<entityfacade>
</entityfacade>
</ejbdoclet>
If I modify this task to *not* exclude those two files
(SeqBlockBean.java and SequenceBean.java), everything compiles fine.
There must be a reason why these two files were excluded, though,
right?
With the generated site, however, I can't create a reservation. An
exception is thrown saying "javax.servlet.ServletException: CMR not
supported yet". I *can* create flights and users, which clearly
wouldn't need CMR. Is there some way to work around the lack of CMR
support? Is this a jboss problem or a middlegen problem?
One more question . . . if I wanted to switch from using cmp20
persistence to hibernate, how painful would that be? Just for fun, I
tried just changing the build.properties setting from cmp20 to
hibernate, but I get more compile errors with methods being undefined,
etc. It looks like it is generating several ejb-specific files . . .
is there some specific order I should invoke ant targets for creating
a deployable hibernate build?
Thanks for all suggestions,
--Mike
Loading...