• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Problem with Ant and weblogic.ejbc 7.0

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Has anyone successfully tried Ant 1.5 with weblogic.ejbc ?
When I use ejbc from command line (under Linux) everything works fine. But as an Ant 1.5 task weblogic.ejbc creates jar-files with a directory structure that's simply wrong.
Is this a bug ? I don't want to use Ant included in weblogic.jar.
WLS version 7.0 without SP.
Thanks for your help.
 
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using ant 1.5 with WLS 7 no problems.
However, I do not use the ant ejbc tasks from ant but always invoke weblogic.ejbc directly with a java task. Then I can supply all the command args that I want and I know exactly what it is supposed to be doing. Its a control freak thing.
Some other things I have found useful
- I always set fork and fail on error
- I always set the classpath explicitly to know exactly what is there (rather than relying on what was in users classpath when starting ant) - include weblogic.jar in that classpath
- I always set the dir so I know where ejbc is running, usually dir="."
 
Lars Fischer
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply Dave !
I think my Ant task is nearly the same as yours (used a template from BEA examples).
Maybe this is a Linux issue ?
I wanted to show you the code in this reply but the forum doesn't work the right way ('replace < with <' but this does not work).
 
Lars Fischer
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
NOW the forum did replace the charaters above ...
 
Dave Landers
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lars,
I have had this same problem with posts before - I tried to post my ant task to this thread but it would not work. I replaced everything (lt, gt, amp, quot, etc) with the html encoding equivalents and it still wouldn't take it.
--
Ant is such a pain sometimes - you really can't tell what you are doing. I have in the past actually written a small java file to echo properties and classpath and command line parameters to debug stuff like this (substute that program for ejbc and see what it thinks you are passing it).
So are you specifying the same jar or directory for input and output, or are you using a different one?
And what exactly is the problem you are seeing in the output?
 
Lars Fischer
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dave,
I'm using two .jar-files for input and output.
When used outside Ant, ejbc generates something like /META-INF
.-xml-files
which is correct and works with WLS 7.0.
Inside of Ant, ejbc generates something like this:
/META-INF
MANFIFEST...
/meta-inf
.xml-files
which doesn't work in WLS 7.0.
 
Dave Landers
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check and make sure the input jar is properly constructed.
I was unable to reproduce this. I tried:
a simple "normal" ejb jar - worked
a jar with all *.xml in meta-inf rather than META-INF - ejbc failed: unable to find ejb-jar.xml
a jar with the *.xml in both META-INF and meta-inf - I got an output jar with both directories.

I don't think it matters, but versions of stuff I used:
$ java weblogic.version
WebLogic Server 7.0 Thu Jun 20 11:47:11 PDT 2002 190955
WebLogic XMLX Module 7.0 Thu Jun 20 11:58:44 PDT 2002 190955
$ java -version
java version "1.4.0_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0_01-b03)
Java HotSpot(TM) Client VM (build 1.4.0_01-b03, mixed mode)
$ ant -version
Apache Ant version 1.5 compiled on July 9 2002
$ uname -r
2.4.18-3
(RedHat 7.3)
 
Lars Fischer
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dave, thanks again for your help !
The source jar is ok and works without using ejbc. The advantage of ejbc is it's possibility to verify the jar for WebLogic. There's (major) one difference I see: I'm using JDK131_03.
The problem still persists.
Meanwhile I'm thinking of throwing BEA out of the window because of the "support" they give to their paying "partners".
I'm glad to see that I'm not the only one working with Linux !
 
Dave Landers
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I only recently switched to 1.4 - it all worked for me using 1.3 also.
Since it is all working from the command line, it has got to be something about ant that is messing things up.
I have never been exactly sure how ant constructs classpath and other enviromnemt (I think it is some combination of what was in your environment when you started ant plus the classpath element in the build.xml. I have seen some weird things happen - usually they were related to my shell's CLASSPATH or something "bleeding thru" to the exec'ed java task.
Try cleaning out your env except for ANT_HOME and JAVA_HOME - especially unset CLASSPATH, JIKESPATH, and any other JAVA_* environment variables and see if that helps. I'd also thin out PATH to just have ANT_HOME/bin. See if that helps at all.
 
Lars Fischer
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dave,
you were exactly right !
After reworking my Ant script and my environment it finally works !
 
Won't you please? Please won't you be my neighbor? - Fred Rogers. Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic