Raible's Wiki

Raible Designs
Wiki Home
News
Recent Changes

AppFuse

Homepage
  - Korean
  - Chinese
  - Italian
  - Japanese

QuickStart Guide
  - Chinese
  - French
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish
  - Japanese

User Guide
  - Korean
  - Chinese

Tutorials
  - Chinese
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish

FAQ
  - Korean

Latest Downloads

Other Applications

Struts Resume
Security Example
Struts Menu

Set your name in
UserPreferences


Referenced by
...nobody




JSPWiki v2.2.33

[RSS]


Hide Menu

XDocletActionForms


This is version 3. It is not the current version, and thus it cannot be edited.
[Back to current version]   [Restore this version]


This post is meant to simply document the struggles I went through trying to get XDoclet's task to play nicely with Ant. Below are my findings. These findings occurred while developing AppFuse 1.6.

1. Even after creating this <actionform> task, I found that Hibernate doclet still seemed to need XDoclet's ejb module in the classpath. This is because the apache module has references to a bunch of tasks that depend on EjbDoclet. Removing these tasks when building is a workaround, but adding the xdoclet-ejb module to the classpath is the easiest solution.

2. If using Ant 1.5.x, and you're using Struts, you will get the following error when you run "ant compile" with 1.5.

    compile-web:
       [xdoclet] (XDocletMain.start                   47  ) Running 
    <actionform/>
       [xdoclet] java.lang.NullPointerException
       [xdoclet]     at 
    java.util.StringTokenizer.<init>(StringTokenizer.java:146)
       [xdoclet]     at 
    xdoclet.tagshandler.PackageTagsHandler.getPackageNameFor(Pack
    ageTagsHandler.java:61)
       [xdoclet]     at 
    xdoclet.modules.apache.struts.ActionFormTagsHandler.getAction
    FormClassFor(ActionFormTagsHandler.java:46)
       [xdoclet]     at 
    xdoclet.modules.apache.struts.ActionFormSubTask.getGeneratedF
    ileName(ActionFormSubTask.java:132)
       [xdoclet]     at 
    xdoclet.TemplateSubTask.generateForClass(TemplateSubTask.java
    :751)

3. If I define the "xdoclet" task inside the "compile-web" target, it will work, but only when I call that target explicitly. When I make another target depend on it, I get the following error with Ant 1.5.x.

    file:c:/Source/appfuse/build.xml:779: Class 
    xdoclet.modules.apache.struts.Action
    FormSubTask doesn't support the nested "packageSubstitution" element.
NOTE: The original reference e-mail for the above issues is on the XDoclet Developers mailing list.

4. If I put the xdoclet <taskdef> outside of any targets it seems work fine, however the error "destDir attribute must be present" shows up every so often. More information in XDoclet's JIRA.

5. My final solution: Move the xdoclet/actionform task into it's own target and prevent it from executing if it doesn't need to.

Below is a list I created while comping up with a solution.


Ant version:                      1.5.4                            1.6.2
Task outside of all targets      
    compile compile               destDir error                    destDir error
    compile                       succeeds                         succeeds
    test-cactus                   succeeds                         succeeds
    
Task in "init" target
    compile compile               NPE w/ StringTokenizer           destDir error
    compile                       "                                succeeds
    test-cactus                   "                                succeeds
    
Task in "compile-web" target     
    compile compile               succeeds                         destDir error
    compile                       "                                succeeds
    test-cactus                   packageSubstitution error        succeeds
    
AppFuse 1.5 Source                
    compile compile               NPE w/ StringTokenizer           succeeds
    compile                       "                                succeeds
    test-cactus                   "                                succeeds
    
Move actionform task to gen-forms target                 
    compile compile               succeeds                         succeeds
    compile                       "                                "
    test-cactus                   "                                "


Go to top   More info...   Attach file...
This particular version was published on 06-Nov-2006 13:52:39 MST by MattRaible.