You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Paul Hodgetts <pa...@zzyzxtek.com> on 2000/07/09 18:29:28 UTC

WebLogic 4.x EJB Tasks

I've been using the new WebLogic 4.x EJB tasks and I have a few
comments/questions.  These tasks are very cool and help us out a
whole lot with our builds.  Thank you!

DDCreator works great.  No issues there.

Ejbc works well, with the following comments/questions:

1.  There are some command line parameters that are not passed in.
     For example, -g -nowarn -debug can't be set.  -keepgenerated is
     hard coded as always on.  I was playing around in EjbcHelper by
     just putting them on the command line, and they seem to work
     fine.  It looks pretty straightforward to pass them through (if
     I understand the design).

2.  I was trying to add -compiler jikes to the EjbcHelper command
     line, and it didn't work.  It seemed to generate the first bean
     that it came across, but didn't continue on to any more.  I
     think it may have something to do with how it's invoked, but I
     don't understand it enough to know why and how to fix it.  The
     reason I want to use Jikes is because Jikes is twice as fast as
     the JDK compiler.  We have a lot of beans to generate, and it
     cuts 5 minutes off a full build.

3.  The task uses the -noexit parameter.  I don't see this
     documented anywhere in the WebLogic docs.  Is this a secret
     parameter?  I would guess it allows the VM to stay open, but
     I've never seen it mentioned in the WebLogic stuff before.

4.  I'm not sure how the connection is made (if it is) between the
     bean sources and the generated classes.  For example, if I have
     the user written MyClassBean.java, MyClassHome.java, etc., how
     does the Ejbc task know to regen if any of the user sources have
     changed?  My suspicion is that this is difficult/impossible in a
     generic way (without some naming conventions), so maybe I just
     have to code up something custom for our situation.

5.  It seems like the Ejbc task using javac is noticeably slower
     than when I was using the java task to fire it off (even with
     javac as the compiler both ways).  Is it invoking ejbc in a
     different way or am I just hallucinating?  ;-)

Any insights into my questions would be appreciated.  As to the
changes that I know how to do, what should I do next?  Do I make the
changes and submit them to someone, or wait for someone else to make
them, or what?  I'm new to this, so I'm not sure how to proceed.

Thanks,
-Paul Hodgetts


RE: WebLogic 4.x EJB Tasks

Posted by Ken Liu <kl...@auctionlogic.com>.
Conor,

I just got around to trying out the DDCreator and ejbc tasks.  I'm following
up here on a post from last week:

My questions:
1) Did anyone ever come up with a patch to EjbcHelper to allow the
"-compiler jikes" to be passed in?  I may do this if it hasn't already been
done.  It's great to be able to skip the ejbc, but ejbc is really really
slow without jikes.

2) I am using TOPLink for Weblogic, which requires that the System variables
"weblogic.home" and "weblogic.system.home" be set in the JVM for the
DDCreator.  When you install TOPLink it installs some jar file into
/weblogic/lib which DDCreator then finds using those System variables.  This
is only for TOPLink beans of course.  So my current DDCreator task looks
something like this:

<java classname="${ejb.ddcreator}" fork="yes"
jvmargs="-Dweblogic.home=${lib.weblogic.dir} -Dweblogic.system.home=${lib.we
blogic.dir} -cp ${classpath}" args="-dir /build/classes/[path to
bean] -outputfile SomeEjbDD.ser ${src.dir}/[path to bean]SomeEjbDD.txt"/>

So my question is: Can I pass the jvmargs to the <ddcreator> task?

Ken

> -----Original Message-----
> From: Conor MacNeill [mailto:conor@cognet.com.au]
> Sent: Monday, July 10, 2000 6:47 AM
> To: ant-dev@jakarta.apache.org
> Subject: RE: WebLogic 4.x EJB Tasks
>
>
> Paul,
>
> > From: Paul Hodgetts [mailto:paulh@zzyzxtek.com]
> >
> > I've been using the new WebLogic 4.x EJB tasks and I have a few
> > comments/questions.  These tasks are very cool and help us out a
> > whole lot with our builds.  Thank you!
>
> Thanks for the feedback.
>
> >
> > DDCreator works great.  No issues there.
> >
> > Ejbc works well, with the following comments/questions:
> >
> > 1.  There are some command line parameters that are not passed in.
> >      For example, -g -nowarn -debug can't be set.  -keepgenerated is
> >      hard coded as always on.  I was playing around in EjbcHelper by
> >      just putting them on the command line, and they seem to work
> >      fine.  It looks pretty straightforward to pass them through (if
> >      I understand the design).
>
> I developed these tasks initially to serve the EJB builds we are doing at
> Cortex without much regard for supporting all options. It
> shouldn't be hard
> to add those options. The whole split between ejbc and ejbcHelper was done
> for classpath reasons and I just put the things I needed into the
> interface.
>
> I am happy if you want to make changes and submit patches.
>
> >
> > 2.  I was trying to add -compiler jikes to the EjbcHelper command
> >      line, and it didn't work.  It seemed to generate the first bean
> >      that it came across, but didn't continue on to any more.  I
> >      think it may have something to do with how it's invoked, but I
> >      don't understand it enough to know why and how to fix it.  The
> >      reason I want to use Jikes is because Jikes is twice as fast as
> >      the JDK compiler.  We have a lot of beans to generate, and it
> >      cuts 5 minutes off a full build.
>
> I haven't tried to use Jikes with ejbc. I have heard from someone who has
> done it. They added


RE: WebLogic 4.x EJB Tasks

Posted by Conor MacNeill <co...@cognet.com.au>.
Paul,

> From: Paul Hodgetts [mailto:paulh@zzyzxtek.com]
>
> I've been using the new WebLogic 4.x EJB tasks and I have a few
> comments/questions.  These tasks are very cool and help us out a
> whole lot with our builds.  Thank you!

Thanks for the feedback.

>
> DDCreator works great.  No issues there.
>
> Ejbc works well, with the following comments/questions:
>
> 1.  There are some command line parameters that are not passed in.
>      For example, -g -nowarn -debug can't be set.  -keepgenerated is
>      hard coded as always on.  I was playing around in EjbcHelper by
>      just putting them on the command line, and they seem to work
>      fine.  It looks pretty straightforward to pass them through (if
>      I understand the design).

I developed these tasks initially to serve the EJB builds we are doing at
Cortex without much regard for supporting all options. It shouldn't be hard
to add those options. The whole split between ejbc and ejbcHelper was done
for classpath reasons and I just put the things I needed into the interface.

I am happy if you want to make changes and submit patches.

>
> 2.  I was trying to add -compiler jikes to the EjbcHelper command
>      line, and it didn't work.  It seemed to generate the first bean
>      that it came across, but didn't continue on to any more.  I
>      think it may have something to do with how it's invoked, but I
>      don't understand it enough to know why and how to fix it.  The
>      reason I want to use Jikes is because Jikes is twice as fast as
>      the JDK compiler.  We have a lot of beans to generate, and it
>      cuts 5 minutes off a full build.

I haven't tried to use Jikes with ejbc. I have heard from someone who has
done it. They added

-compiler jikes

and

-classpath blah

If that works we would need to pass the classpath across the interface too.


>
> 3.  The task uses the -noexit parameter.  I don't see this
>      documented anywhere in the WebLogic docs.  Is this a secret
>      parameter?  I would guess it allows the VM to stay open, but
>      I've never seen it mentioned in the WebLogic stuff before.
>

OK, I saw it had been added to ddcreator and guessed it was also done for
ejbc. It worked. While I was reluctant to use an undocumented feature, I
think the ability to run multiple ejbcs in one VM was a performance gain.

The downside to the -noexit tag is that when it is used and there is a
problem ejbc swallows the exception that caused the error and throws a
simple exception to terminate. If you look at the code you will see that
when I catch an exception I rerun the last ejbc call without the -noexit
flag to get it to give me the real exception. It is a big ugly but it works.

> 4.  I'm not sure how the connection is made (if it is) between the
>      bean sources and the generated classes.  For example, if I have
>      the user written MyClassBean.java, MyClassHome.java, etc., how
>      does the Ejbc task know to regen if any of the user sources have
>      changed?  My suspicion is that this is difficult/impossible in a
>      generic way (without some naming conventions), so maybe I just
>      have to code up something custom for our situation.
>

EjbcHelper reads in the serialised deployment descriptor to discover the
interface names and class names including the bean class name. The generated
code class names is derived from the beanclass name. The derivation is
indeed based on the naming conventions used by Weblogic. Once I have all the
class names I can determine the source file names and check what things are
out of date. It is not truly generic but it does seem reasonably reliable.
Being able to avoid ejbc compiles cuts down build time in a major way.

> 5.  It seems like the Ejbc task using javac is noticeably slower
>      than when I was using the java task to fire it off (even with
>      javac as the compiler both ways).  Is it invoking ejbc in a
>      different way or am I just hallucinating?  ;-)

I think you are hallucinating :-). Seriously I can't think why it would be
slower. If you find something, let us know.

>
> Any insights into my questions would be appreciated.  As to the
> changes that I know how to do, what should I do next?  Do I make the
> changes and submit them to someone, or wait for someone else to make
> them, or what?  I'm new to this, so I'm not sure how to proceed.
>

Have a read of http://jakarta.apache.org/guidelines/source.html
It discusses how to submit patches. Then just jump in :-)

Conor