I have the same experience. I only managed to run XDoclet within a separate
jwm too. I had encountered other problems. The subtasks of ejbdoclet are
not recognized by Jelly and I had trouble with the classloader. I really
like the Jelly builds scripts but unfortunally they seem to be not fully
backwards compatible with Ant  in the moment.

How do you manage the different source trees? I had to patch several
plugins to make them work with the additional generated source tree.

Thomas.


                                                                                       
                                    
                    "Ara                                                               
                                    
                    Abrahamian"          To:     "'Turbine Maven Users List'" 
<[EMAIL PROTECTED]>      
                    <ara_e_w@yaho        cc:                                           
                                    
                    o.com>               Subject:     RE: Xdoclet & maven, take 2      
                                    
                                                                                       
                                    
                    09/10/2002                                                         
                                    
                    12:27 AM                                                           
                                    
                    Please                                                             
                                    
                    respond to                                                         
                                    
                    "Turbine                                                           
                                    
                    Maven Users                                                        
                                    
                    List"                                                              
                                    
                                                                                       
                                    
                                                                                       
                                    




OK, it's working for me, but my workaround is quite ugly. A copy of my
previous message is attached.

I fork a new instance of Ant in a separate jvm and let a pure Ant build
file do the xdoclet stuff for me. Here's my maven.xml:

...

And run-xdoclet.xml looks like this:

...

You may ask why don't you use <ant/> from the maven.xml file? Well,
because it doesn't work:

java:compile:
ejbdoclet:

[ERROR] BUILD FAILED
[ERROR] File...... D:\Projects\Petsoar\maven.xml
[ERROR] Element... ant
[ERROR] Line...... 13
[ERROR] Column.... 81
[ERROR] java.lang.NullPointerException
Total time: 25 seconds

But I can run run-xdoclet.xml from command line easily. Folks, Maven
seems to have some classloader problems, or maybe some trouble with path
refs.

Ara.

> -----Original Message-----
> From: Jim Crossley [mailto:[EMAIL PROTECTED]]
> Sent: Monday, September 09, 2002 10:02 PM
> To: Turbine Maven Users List
> Subject: Re: Xdoclet & maven, take 2
>
> Ok, I think I may have an idea what's wrong.  Xdoclet seems to want to
> serialize its "context" to the file system.  Apparently, there are
some
> objects in that context that are not Serializable.  In particular,
> MavenJellyContext.  Making that class Serializable revealed that
> org.apache.commons.grant.GrantProject is also not Serializable.  :-(
>
> Jim
>
> On Monday 09 September 2002 01:59 pm, you wrote:
> > I'm not dumb, but I'm not smart enough to solve this.
> >
> > I'm still trying to get maven to invoke xdoclet and generate some
source
> (I
> > haven't even gotten to the point of compiling the source yet).
> >
> > I have this very simple goal in my maven.xml:
> >
> > <project default="prepare">
> >   <goal name="prepare" description="Generate some source files">
> >     <taskdef name="ejbdoclet" classname="xdoclet.ejb.EjbDocletTask"
> > classpathref="maven.dependency.classpath"/>
> >     <ejbdoclet sourcepath="${maven.src.dir}/java" destdir="src-gen">
> >       <fileset dir="${maven.src.dir}/java">
> >         <include name="**/*Bean.java" />
> >       </fileset>
> >     </ejbdoclet>
> >   </goal>
> > </project>
> >
> > Here's the error I get using jdk 1.4, maven 1.0-beta-6 and xdoclet
> 1.1.2:
> >
> > prepare:
> >     [ejbdoclet] [ERROR] log4j:WARN No appenders could be found for
> logger
> >
>
(xdoclet.ConfigParamIntrospector.fillConfigParamsHashtableUsingReflectio
nF
> o
> >r). [ejbdoclet] [ERROR] log4j:WARN Please initialize the log4j system
> > properly.
> >
> > [ERROR] BUILD FAILED
> > [ERROR] Running ejbdoclet task failed. An IO error occured while
writing
> > context data.
> > [ERROR]         at xdoclet.DocletTask.execute(DocletTask.java:250)
> > [ERROR]         at org.apache.tools.ant.Task.perform(Task.java:317)
> > [ERROR]         at
> > org.apache.commons.jelly.tags.ant.AntTag.doTag(AntTag.java:198)
> > [ERROR]         at
> >
org.apache.commons.jelly.impl.DynaTagScript.run(DynaTagScript.java:141)
> > [ERROR]         at
> > org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:134)
> > [ERROR]         at
> > org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:190)
> > [ERROR]         at
> >
>
org.apache.commons.jelly.tags.werkz.GoalTag$1.performAction(GoalTag.java
:1
> 1
> >9) [ERROR]         at com.werken.werkz.Goal.attain(Goal.java:524)
> > [ERROR]         at
org.apache.maven.app.Maven.runGoals(Maven.java:941)
> > [ERROR]         at
> org.apache.maven.app.Maven.attainGoals(Maven.java:842)
> > [ERROR]         at org.apache.maven.app.App.doMain(App.java:334)
> > [ERROR]         at org.apache.maven.app.App.main(App.java:842)
> > [ERROR]         at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> > Method) [ERROR]         at
> >
>
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:
> 3
> >9) [ERROR]         at
> >
>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Im
> p
> >l.java:25) [ERROR]         at
> > java.lang.reflect.Method.invoke(Method.java:324) [ERROR]         at
> > com.werken.forehead.Forehead.run(Forehead.java:543) [ERROR]
at
> > com.werken.forehead.Forehead.main(Forehead.java:573) [ERROR]
File......
> > /home/jim/personal/jcrossley/projects/tracker/maven.xml [ERROR]
> Element...
> > ejbdoclet
> > [ERROR] Line...... 14
> > [ERROR] Column.... 21
> > [ERROR] Running ejbdoclet task failed. An IO error occured while
writing
> > context data.
> > Total time:  9 seconds
> >
> > Anyone else seen this?  I'm not sure what else to try.
>
> --
> To unsubscribe, e-mail:   <mailto:turbine-maven-user-
> [EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:turbine-maven-user-
> [EMAIL PROTECTED]>

----- Message from "Ara Abrahamian" <[EMAIL PROTECTED]> on Tue, 3 Sep 2002
22:25:12 +0330 -----
                                                          
      To: "'Turbine Maven Users List'"                    
          <[EMAIL PROTECTED]>         
                                                          
 Subject: RE: projects with multiple source directories   
                                                          

> > It did as the antlr plugin provides a much better way to deal with
> > generated sources: you generate your sources to any given directory and

> > they you modify the the path using the <addPath/> so that you can
> > compile static sources along with generated sources.
> Ah, so someone just needs to do something similar for xdoclet...?


OK, I tried to use xdoclet (latest cvs code) from within maven but this is
the result:
    [ejbdoclet] [ERROR] java.lang.NullPointerException
    [ejbdoclet] [ERROR]         at
org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:326)
    [ejbdoclet] [ERROR]         at
org.apache.commons.logging.LogFactory.getLog(LogFactory.java:401)
    [ejbdoclet] [ERROR]         at
xdoclet.util.LogUtil.getLog(LogUtil.java:26)


If you take a look at where the NPE is thrown you'll see that
contextClassLoader is null. That's very strange! I think maven is setting a
null contextClassLoader.


This is my maven.xml file:


<project xmlns:j="jelly:core" xmlns:m="maven">


        <preGoal name="java:compile">
                <attainGoal name="ejbdoclet"/>
    </preGoal>


        <goal name="ejbdoclet">


                <taskdef name="ejbdoclet" classname
="xdoclet.modules.ejb.EjbDocletTask">
                        <classpath>
                                <path refid="maven.dependency.classpath"/>
</classpath>
                </taskdef>


                <ejbdoclet
                        destdir="src/gen-java"
                        excludedtags="@version,@author"
                        ejbspec="2.0">


                        <fileset dir="${pom.build.SourceDirectory}">
                                <include name="**/service/**Bean.java" />
                        </fileset>


                        <session/>
...


Note the taskdef uses maven.dependency.classpath for the classpath. My
remote repository contains the dependency jars and the jars are found as
you can see.


Anyone succeeded in running xdoclet inside maven?


Ara. --
To unsubscribe, e-mail:   <
mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <
mailto:[EMAIL PROTECTED]>








--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to