>> When you say "task's classpath...
 
Yes, I mean the classpath you supply to the middlegen ant task. 
 
>> do you mean the path that is built by the <path id="lib.class.path"> tag in the ant 
>script?
 
Well, "THE ant script" is your ant script. The one you use for building. Do you have a 
path element called lib.class.path that you specify as middlegen's classpath? If so 
then, yeah, that's the one I mean. I have my own ant script. I have not even looked at 
the demo script in months. 
 
Here's a sample classpath:
 
   <path id="classpath">
       <pathelement path="${j2ee.jar}"/>
       <pathelement path="${database.driver.classpath}"/>
       <pathelement path="${jboss.lib}"/>
       <fileset dir="${xdoclet.lib}">
               <include name="*.jar"/>
       </fileset>
        ... your jars if you need them ...
   </path>
 
Here's a sample usage. ...
 
  <target name="run-middlegen">
 
    <taskdef name="middlegen" classname="middlegen.MiddlegenTask" 
classpathref="classpath"/>
 
    <middlegen
       appname="${title}"
       prefsdir="${config}"
       gui="false"
       databaseurl="${database.url}"
       datasourceJNDIName="OracleDSX"
       driver="${database.driver}"
       username="${database.userid}"
       password="${database.password}"
       schema="${database.schema}"
       initialContextFactory="nop"
       providerURL="nop"
    >
    ... BLAH BLAH BLAH ...
 
 
-----Original Message----- 
From: Michael Bushe [mailto:[EMAIL PROTECTED]] 
Sent: Tue 2/18/2003 4:10 PM 
To: [EMAIL PROTECTED] 
Cc: 
Subject: [Middlegen-user] Build issue - newbie



        Thanks. 
        
        When you say "task's classpath", do you mean the path that is built by
        the   
        <path id="lib.class.path"> tag in the ant script? 
        
        If not, then please explain - sorry to be pain!
        
        If so, then that's what I'm doing, but something is wrong.  When I echo
        that path I have the whole world in it (I have 31 jars in Middlegen\lib,
        including all the xdoclet ones).  The trouble is, when it gets to:
        <available property="xdoclet1.2+"
        classname="xdoclet.modules.ejb.EjbDocletTask"
        classpathref="lib.class.path"/>
        
        then it acts like xdoclet.modules.ejb.EjbDocletTask isn't in the path.
        Now I'm no Java dummy, I've been doing it solid since '95.  I tested
        whether that class is in that path and it's there!  It's like ant isn't
        passing the class properly to the task.
        
        Thanks Again!
        
        Michael
        
        -----Original Message-----
        From: Rod Macpherson <[EMAIL PROTECTED]>
        Sent: Tuesday, February 18, 2003 6:25 PM
        Subject: [Middlegen-user] Build issue - newbie
        
        
        
         I installed  j2ee.jar ( http://java.sun.com/downloads/ ) and placed my
         oracle driver ( classes12.jar ) in the task's classpath path. Also
         download xdoclet and put the jar(s) in /xdoclet/lib in the task's
         classpath. Though jboss-common.jar or weblogic.jar or your appservers
         core jar in the task's classpath for grins (I think you need that. 
                -----Original Message-----
                From: Michael Bushe [mailto:Michael@Bu...]
                Sent: Monday, February 17, 2003 8:17 PM
                To: [EMAIL PROTECTED]
                Subject: [Middlegen-user] Build issue - newbie
               
               
                Howdy,
                
                I'm having trouble building the latest.  This may be an Ant
         problem, as I am fairly inexperienced with Ant, and new to Middlegen,
         but I figured I'd try here first.  I'm using Ant 1.5 on XP.  In short,
         if I let the ant script figure out the classpath, the build doesn't
         work.  However, if I set the same classpath in the shell and then run
         ant, it works.  I do have ANT_HOME set in my environment.
                
                In Long:
                I pulled Middlegen from the CVS, set my classpath to nothing (as
         the home page says), then ran ant. 
                
                The build told me to run the download-deps target from the
         samples, which I did (How cool is that!  I owe a beer to whoever
        checked
         that in).  I copied the files from the samples lib to the Middlegen
        lib.
         (I did have two FileNotFounds - ejb.jar and jdbc-2.0.jar. That's not my
         problem, but if you know where I should get these, let me know.  My
         guess is Sun's j2ee kit?).
                
                I ran the build again and it failed on "fail-if-no-xdoclet-1.2".
         This comes from the line:
                <available property="xdoclet1.2+"
         classname="xdoclet.modules.ejb.EjbDocletTask"
        classpathref="classpath"/>
                
                The build told me to re-download the libs, but I knew it was
         there.  To prove it, I added this to the build.xml:
                    <property name="classpath" refid="classpath"/>
                and added in the init task:
                      <echo message=" classpath =${ classpath }"/>
                
                The next build output a huge classpath.  I opened a new shell,
         set the classpath to the output and ran "javap
         xdoclet.modules.ejb.EjbDocletTask"  (javap is a handy disassembler that
         comes with the JDK.  Most folks don't know about it, but it's a great
         way to solve classpath problems - better than JWhich, because of
        reasons
         below).  javap output "Error: No binary file 'Task'"  This means that
         EjbDoclet is on the classpath (otherwise a ClassNotFound error would
         appear), but, most likely, it's parent class or related class could not
         be resolved.
                
                So, the remedy is to stick the Ant jar in the classpath, right?
         I'm not sure if this is right, shouldn't it be there anyway?  Well, to
         test I added this:
                   <property name="antlib.dir"
         value="C:\java\jakarta-ant-1.5.1\lib"/>
                and this:
                   <path id="classpath">
                      <fileset dir="${antlib.dir}">
                         <include name="*.jar"/>
                      </fileset>
                
                But this didn't help the build!  Using ant -verbose I got:
                 [available] Unable to load class
         xdoclet.modules.ejb.EjbDocletTask to set proper
                ty xdoclet1.2+
                
                However, I'm sure the classpath had enough info to resolve the
         class.  I proved it by opening another shell, set the classpath to the
         output'ed classpath, and ran javap again.  This time it worked (the
         signature for the xdoclet.modules.ejb.EjbDocletTask was output.
                
                My lame workaround is to set the classpath to this big honking
         classpath and then run ant.  If I do that, it builds successfully.  Can
         someone tell me what I'm doing wrong?
                
                I've done a lot of looking around in the Ant book I have and on
         various lists, but I'm not seeing the issue.
                
                Much Thanks In Advance!
                
                Michael Bushe
                Bushe Enterprises, Inc.
                
                
                
        
        
        
        
        -------------------------------------------------------
        This sf.net email is sponsored by:ThinkGeek
        Welcome to geek heaven.
        http://thinkgeek.com/sf
        _______________________________________________
        middlegen-user mailing list
        [EMAIL PROTECTED]
        https://lists.sourceforge.net/lists/listinfo/middlegen-user
        

<<winmail.dat>>

Reply via email to