Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
62 replies Latest Post - ‏2010-10-25T07:06:41Z by RobertMartin
SystemAdmin
SystemAdmin
6042 Posts
ACCEPTED ANSWER

Pinned topic Anyone using Headless ANT

‏2004-03-15T17:13:03Z |
Just wondered if anyone has used the headless ANT feature and if so, where you found information on using it. I've been through the out-dated 3-part article that explains some of it, but the information therein is lacking and incorrect at times.
Thanks
Updated on 2010-10-25T07:06:41Z at 2010-10-25T07:06:41Z by RobertMartin
  • SystemAdmin
    SystemAdmin
    6042 Posts
    ACCEPTED ANSWER

    Re: Anyone using Headless ANT

    ‏2004-03-22T19:06:07Z  in response to SystemAdmin
    "Headless Ant" is described in this article:

    http://www-106.ibm.com/developerworks/websphere/library/techarticles/020
    3_searle/searle1.html

    Unfortunately, Barry Searle's article appears to be out of date.

    The Online Help in WSAD 5.1.1 describes these Ant tasks:

    projectBuild
    getJavacErrorCount
    getProjectData
    setDebugInfo
    AppClientExport
    EARExport
    UtilJar
    WARExport
    AccessBeanRegeneration
    EJBDeploy
    EJBExport

    I found the runAnt.bat file in this directory:

    C:\Program Files\IBM\WebSphere Studio\Application
    Developer\v5.1.1\wstools\eclipse\plugins\com.ibm.etools.j2ee.ant_5.1.1

    When I execute runAnt.bat from a command prompt, it reports this error:

    Unknown argument: -consolelog

    Is this a flaw in IBM's batch file?
    • SystemAdmin
      SystemAdmin
      6042 Posts
      ACCEPTED ANSWER

      Re: Anyone using Headless ANT

      ‏2004-03-22T19:38:30Z  in response to SystemAdmin
      To workaround this issue, I removed "-consolelog" from the runAnt.bat file

      I guess IBM did not test runAnt.bat when they shipped WSAD 5.1.1
      • SystemAdmin
        SystemAdmin
        6042 Posts
        ACCEPTED ANSWER

        Re: Anyone using Headless ANT

        ‏2004-03-22T20:09:15Z  in response to SystemAdmin
        Yeah, they kind of did not mention that you have to tailor the runAnt.bat script, eh?

        Our problem (right now) is that it does not appear that the tasks will work properly if the source code is not directly beneath the workspace. So, while we can get the "echo" demo script to work, nothing else will.
        • SystemAdmin
          SystemAdmin
          6042 Posts
          ACCEPTED ANSWER

          Re: Anyone using Headless ANT

          ‏2004-03-22T22:11:46Z  in response to SystemAdmin
          > Yeah, they kind of did not mention that you have to
          > tailor the runAnt.bat script, eh?

          True. I had to tailor runAnt.bat for my local environment.

          > Our problem (right now) is that it does not appear
          > that the tasks will work properly if the source code
          > is not directly beneath the workspace. So, while we
          > can get the "echo" demo script to work, nothing else
          > will.

          Which type of project are you using?
          Java projects?
          Web application projects?
          EAR projects?

          I have a Java project called "Foo"

          Foo contains a source folder "src"

          My Java source files are in src.

          Will I be able to use headless ant to build this code?
          • SystemAdmin
            SystemAdmin
            6042 Posts
            ACCEPTED ANSWER

            Re: Anyone using Headless ANT

            ‏2004-03-22T22:20:30Z  in response to SystemAdmin
            We are using EARs, EJBs, and Java projects.
            I'd assume that your Foo project would work fine with headless ant, but you might just want to use regular ant (I guess that would be ant WITH a head?).

            The reason I think that our headless ant is not working is that our source code is in a ClearCase VOB, and the VOB is not directly physically under a defined WorkSpace. Barry said that he was looking into whether or not headless ant has an issue with that type of set up, i.e. where the projects are in a different physical area from the workspace. No feedback as yet, though.

            There is also a product out there (name escapes me but you can find a link to it on the eclipse plug-ins page) that will build outside of websphere. I haven't had time to dink with it, though.
            > > Yeah, they kind of did not mention that you have
            > to
            > > tailor the runAnt.bat script, eh?
            >
            > True. I had to tailor runAnt.bat for my local
            > environment.
            >
            > > Our problem (right now) is that it does not appear
            > > that the tasks will work properly if the source
            > code
            > > is not directly beneath the workspace. So, while
            > we
            > > can get the "echo" demo script to work, nothing
            > else
            > > will.
            >
            > Which type of project are you using?
            > Java projects?
            > Web application projects?
            > EAR projects?
            >
            > I have a Java project called "Foo"
            >
            > Foo contains a source folder "src"
            >
            > My Java source files are in src.
            >
            > Will I be able to use headless ant to build this
            > code?
            • SystemAdmin
              SystemAdmin
              6042 Posts
              ACCEPTED ANSWER

              Re: Anyone using Headless ANT

              ‏2004-03-22T22:55:12Z  in response to SystemAdmin
              > There is also a product out there (name escapes me
              > but you can find a link to it on the eclipse plug-ins
              > page) that will build outside of websphere. I
              > haven't had time to dink with it, though.
              >

              I found two tools:

              1) Instantiations CodePro Build

              http://www.instantiations.com

              2) OpenMake

              http://www.openmake.com/docs/openmake-eclipse.pdf
              • SystemAdmin
                SystemAdmin
                6042 Posts
                ACCEPTED ANSWER

                Re: Anyone using Headless ANT

                ‏2004-03-22T23:16:52Z  in response to SystemAdmin
                I am writing an Ant build script that will perform these
                tasks:

                1) checkout modules from CVS (using Ant's <cvs> task)
                2) tag the modules (using Ant's <cvs> task)
                3) build the WSAD projects using <projectBuild>
                4) export the projects to EAR files using <earExport>

                Is this possible?

                • SystemAdmin
                  SystemAdmin
                  6042 Posts
                  ACCEPTED ANSWER

                  Re: Anyone using Headless ANT

                  ‏2004-03-23T13:37:13Z  in response to SystemAdmin
                  Yep, that's what they say. That is what we are looking at doing if we can get around the VOB problem, then throw it in a nightly cron job (and append a Junit auto tester). That's also why we were curious if anyone else out there has ever successfully used the headless ant capability.
                • SystemAdmin
                  SystemAdmin
                  6042 Posts
                  ACCEPTED ANSWER

                  Re: Anyone using Headless ANT

                  ‏2004-03-23T18:23:27Z  in response to SystemAdmin
                  I wrote a simple Ant buildfile (wsadbuild.xml) which executes these tasks:

                  1. create a directory called workspace.temp

                  2. use Ant's cvs task to checkout all of my WSAD projects from CVS
                  The checkout puts the projects into workspace.temp

                  3. use WSAD's projectBuild task to build one of the projects
                  When I try to build the projects, I see an error message which says

                  "HeadlessWebProjectSettings save bypassed (no projects in workspace)"

                  Why does this happen?

                  This is the output from the project build:

                  C:\build\apps\build>headlessant wsadbuild.xml buildprojects

                  C:\build\apps\build>"C:\Program Files\IBM\WebSphere Studio\Application Developer
                  \v5.1.1\eclipse\jre\bin\java" -cp "C:\Program Files\IBM\WebSphere Studio\Applica
                  tion Developer\v5.1.1\eclipse\startup.jar" org.eclipse.core.launcher.Main -appli
                  cation com.ibm.etools.j2ee.ant.RunAnt -data .\workspace.temp -buildfile wsadbuil
                  d.xml buildprojects
                  HeadlessWorkspaceSettings: INITIAL autoBuild=true maxFile=1048576
                  HeadlessWorkspaceSettings: TEMP autoBuild=false maxFile=-1
                  HeadlessWebProjectSettings: HeadlessWebProjectSettings save bypassed (no project
                  s in workspace)
                  Buildfile: wsadbuild.xml

                  buildprojects:
                  setDebugInfo setDebugInfo: LocalVariable=generate, LineNumber=generate, Source
                  File=generate.
                  projectBuild ProjectBuild: FlashRemotingSampleEAR not found in Workspace.

                  BUILD FAILED
                  file:C:/build/apps/build/wsadbuild.xml:77: ProjectBuild: FlashRemotingSampleEAR
                  not found in Workspace.

                  Total time: 3 seconds
                  HeadlessWebProjectSettings: HeadlessWebProjectSettings restore bypassed (linksBu
                  ilderCommand was never saved)
                  HeadlessWorkspaceSettings: RESTORED autoBuild=true maxFile=1048576
                  java.lang.reflect.InvocationTargetException: file:C:/build/apps/build/wsadbuild.
                  xml:77: ProjectBuild: FlashRemotingSampleEAR not found in Workspace.
                  at com.ibm.etools.ant.extras.ProjectBuild.displayError(ProjectBuild.java
                  :138)
                  at com.ibm.etools.ant.extras.ProjectBuild.execute(ProjectBuild.java:51)
                  at org.apache.tools.ant.Task.perform(Task.java:341)
                  at org.apache.tools.ant.Target.execute(Target.java:309)
                  at org.apache.tools.ant.Target.performTasks(Target.java:336)
                  at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
                  at org.apache.tools.ant.Project.executeTargets(Project.java:1255)
                  at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRu
                  nner.java:569)
                  at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRu
                  nner.java:493)
                  at java.lang.reflect.Method.invoke(Native Method)
                  at org.eclipse.ant.core.AntRunner.run(AntRunner.java:464)
                  at com.ibm.ant.extras.RunAnt.run(RunAnt.java:27)
                  at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoa
                  der.java:858)
                  at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461)
                  at java.lang.reflect.Method.invoke(Native Method)
                  at org.eclipse.core.launcher.Main.basicRun(Main.java:291)
                  at org.eclipse.core.launcher.Main.run(Main.java:747)
                  at org.eclipse.core.launcher.Main.main(Main.java:583)
                  C:\build\apps\build>
                  • SystemAdmin
                    SystemAdmin
                    6042 Posts
                    ACCEPTED ANSWER

                    Re: Anyone using Headless ANT

                    ‏2004-03-23T18:31:12Z  in response to SystemAdmin
                    Cool, closely resembles the error msg we get:
                    C:\Program Files\IBM\WebSphere Studio\wstools\eclipse\plugins\com.ibm.etools.j2e
                    e.ant_5.0.1>"C:\Program Files\IBM\WebSphere Studio\eclipse\jre\bin\java" -cp "C:
                    \Program Files\IBM\WebSphere Studio\eclipse\startup.jar" org.eclipse.core.launch
                    er.Main -consolelog -application com.ibm.etools.j2ee.ant.RunAnt -buildfile Z:\ES
                    D\source\esd\LockTest\LockTestJunit\lockTestJunitBuild.xml
                    Headless RunAnt started
                    RunAnt.run antArgs.length=3
                    RunAnt.run about to null HeadlessWorkspaceSettings
                    RunAnt.run about to create new HeadlessWorkspaceSettings
                    nullTask: HeadlessWebProjectSettings save bypassed (no projects in workspace)
                    RunAnt.run DONE create new HeadlessWorkspaceSettings
                    RunAnt.runAntCommands args=[Ljava.lang.String;@1d0435b4
                    RunAnt.runAntCommands about to create new AntRunner
                    RunAnt.runAntCommands DONE create new AntRunner
                    RunAnt.runAntCommands args=[Ljava.lang.String;@1d0435b4

                    init:
                    projectBuild ProjectBuild: LockTestJunit not found in Workspace.
                    Z:\ESD\source\esd\LockTest\LockTestJunit\lockTestJunitBuild.xml:17: ProjectBuild
                    : LockTestJunit not found in Workspace.
                    at com.ibm.ant.extras.ProjectBuild.displayError(ProjectBuild.java:116)
                    at com.ibm.ant.extras.ProjectBuild.execute(ProjectBuild.java:46)
                    at org.apache.tools.ant.Task.perform(Task.java:217)
                    at org.apache.tools.ant.Target.execute(Target.java:184)
                    • SystemAdmin
                      SystemAdmin
                      6042 Posts
                      ACCEPTED ANSWER

                      Re: Anyone using Headless ANT

                      ‏2004-03-23T23:38:41Z  in response to SystemAdmin
                      > init:
                      > projectBuild ProjectBuild: LockTestJunit not found
                      > in Workspace.
                      > Z:\ESD\source\esd\LockTest\LockTestJunit\lockTestJunit
                      > uild.xml:17: ProjectBuild
                      > : LockTestJunit not found in Workspace.

                      It sounds like we are writing similar Ant scripts.

                      Please contact me via email, sullivan dot sean at menlolog dot c o m
                      • SystemAdmin
                        SystemAdmin
                        6042 Posts
                        ACCEPTED ANSWER

                        Re: Anyone using Headless ANT

                        ‏2004-03-24T20:16:54Z  in response to SystemAdmin
                        I am getting an error when I use the projectBuild task.

                        "ProjectBuild: FlashRemotingSampleEAR is not open"

                        The source code for the projectBuild task is online in Barry Searle's article:

                        http://www-106.ibm.com/developerworks/websphere/library/techarticles/0203_searle/searle3.html
                        The Ant task uses the org.eclipse.core.resources.IProject
                        interface to access the project.

                        It appears that the Ant task does not invoke IProject.open

                        I hope IBM can provide a fix for this bug.
                        • SystemAdmin
                          SystemAdmin
                          6042 Posts
                          ACCEPTED ANSWER

                          Re: Anyone using Headless ANT - importProject now working (and projects opened)

                          ‏2004-04-07T19:35:44Z  in response to SystemAdmin
                          I believe you now have this working. if not, please let me know since whenever I run the "importProjects" (WSBCExtImportOp), the project is imported and opened.
                  • SystemAdmin
                    SystemAdmin
                    6042 Posts
                    ACCEPTED ANSWER

                    Re: Anyone using Headless ANT

                    ‏2004-03-23T23:30:02Z  in response to SystemAdmin
                    > When I try to build the projects, I see an error
                    > message which says
                    >
                    > "HeadlessWebProjectSettings save bypassed (no
                    > (no projects in workspace)"
                    >

                    I exchanged email with Barry Searle at IBM.

                    Barry told me:

                    "putting project files on the filesystem underneath the
                    workspace directory does NOT create Eclipse projects."

                    In Websphere Studio, projects must be imported into the workspace. This is normally done within Studio's GUI.

                    According to Barry, a script can import projects into
                    the workspace by using a custom Ant task.

                    Barry provided a custom Ant know called WSBCExtImportOp

                    The WSBCExtImportOp task will import projects into the workspace.

                    IBM may rename this task in the future. Barry told me that the future name will probably be "importProject"

                    I hope IBM publishes this Ant task on Alphaworks soon.
                    • SystemAdmin
                      SystemAdmin
                      6042 Posts
                      ACCEPTED ANSWER

                      Re: Anyone using Headless ANT

                      ‏2004-04-21T15:39:21Z  in response to SystemAdmin
                      were can I download these custom tag called "WSBCExtImportOp"??? Its very important for me!

                      thx,
                      pitti
                      • SystemAdmin
                        SystemAdmin
                        6042 Posts
                        ACCEPTED ANSWER

                        Re: Anyone using Headless ANT

                        ‏2004-04-23T14:06:09Z  in response to SystemAdmin
                        you cannot download the "importProject" or "workspaceBuild" etc tasks from any public site, but just send me an EMail asking for them and I will be happy to send them to you.
                        • SystemAdmin
                          SystemAdmin
                          6042 Posts
                          ACCEPTED ANSWER

                          Re: Anyone using Headless ANT

                          ‏2004-09-01T16:10:47Z  in response to SystemAdmin
                          I just started on WebSphere (came from WebLogic & JBoss) and would like to use Headless Builds. The RunANT in the ...\v5.1\wstools\eclipse\plugins\com.ibm.etools.j2ee.ant_5.1.1 directory executes the 'build.xml' file in Current Directory if (and only if) I do not use '-data ...' to set my workspace. Also, the projects are imported into the data directory using the GUI, but runANT doesn' see them. Help!
                          • SystemAdmin
                            SystemAdmin
                            6042 Posts
                            ACCEPTED ANSWER

                            Re: Anyone using Headless ANT

                            ‏2004-09-01T16:44:29Z  in response to SystemAdmin
                            assuming you are running the current shipped "RunAnt.bat" (and not my much enhanced TechPreview), then it should work:
                            • if you removed the extraneous "-consolelog" from the invocation
                            • if you passin a "-buildfile X:\myPath\build.xml"
                            • you must leave the existing "-data %WORKSPACE%" or it wont work (it will use some default workspace somewhere
                            • you should just set the preceeding WORKSPACE variable to point to your workspace.
                            • SystemAdmin
                              SystemAdmin
                              6042 Posts
                              ACCEPTED ANSWER

                              Re: Anyone using Headless ANT

                              ‏2004-09-01T18:29:08Z  in response to SystemAdmin
                              I got it to work with:
                              1. removed consolelog
                              2. Moved the build.xml file to WORKSPACE
                              3. Shutdown my WSAD. (This was important).
                              Thanx for your help.
                              • SystemAdmin
                                SystemAdmin
                                6042 Posts
                                ACCEPTED ANSWER

                                Re: Anyone using Headless ANT

                                ‏2004-09-01T19:29:25Z  in response to SystemAdmin
                                1) build.xml can be anywhere, "-buildfile" just need a fully qualified path
                                2) my new techpreview includes additional/improved anttasks (importProject, importProjectSet, workspaceClasspathVariables, etc) as well as an improved RunAnt.bat (which detects/warns if the workspace is in use)

                                If you want a copy of the techpreview and to be on its distribution list, send me an email requesting it.
                                searle@ca.ibm.com
                                "Architect, WebSphere Tools for Automated Build and Deployment".
                        • SystemAdmin
                          SystemAdmin
                          6042 Posts
                          ACCEPTED ANSWER

                          Re: Anyone using Headless ANT

                          ‏2004-09-28T21:11:00Z  in response to SystemAdmin
                          Could you please send me the custom ant script. Thanks.

                          > you cannot download the "importProject" or
                          > "workspaceBuild" etc tasks from any public site, but
                          > just send me an EMail asking for them and I will be
                          > happy to send them to you.
            • SystemAdmin
              SystemAdmin
              6042 Posts
              ACCEPTED ANSWER

              Re: Anyone using Headless ANT

              ‏2004-05-25T14:32:52Z  in response to SystemAdmin

              > I'd assume that your Foo project would work fine with
              > headless ant, but you might just want to use regular
              > ant (I guess that would be ant WITH a head?).

              Funny - but it is not Ant that is running 'headless' it is WSAD that is the headless horseman in this configuration.

              FYI - headless refers to the lack of a GUI - Ant is a command line utility, it is by nature GUI-less, but in this environment it is WSAD that is getting the head (GUI) removed.

              And just to bore you with details: try running 'runAnt.bat' while WSAD is running to see what happens (or doesn't happen). The runAnt will not function as expected. My guess - Eclipse will see that it is already running and exit very quietly - not what one expects!
    • SystemAdmin
      SystemAdmin
      6042 Posts
      ACCEPTED ANSWER

      Re: Anyone using Headless ANT

      ‏2004-05-25T20:08:03Z  in response to SystemAdmin

      > When I execute runAnt.bat from a command prompt, it
      > reports this error:
      >
      > Unknown argument: -consolelog

      Barry Searle's Install Instructions - (sent via email) appear to be aware of this issue and instruct you to remove the '-consolelog' option from the command RunAnt.bat.
  • SystemAdmin
    SystemAdmin
    6042 Posts
    ACCEPTED ANSWER

    Re: Anyone using Headless ANT

    ‏2004-05-17T12:40:10Z  in response to SystemAdmin
    Update: we finally got an EAR file built via an ANT script outside of WSAD, and is checked out through ClearCase; here is a summary of major points:
    1) Do not use WSAD as the compiler in the ant script; use WAS. (You COULD use 1)WAS, 2)WSAD antTasks, 3)ANT built-in tasks, and/or 4)the headless ant approach; we wound up using the first approach.)
    2) Install WAS in a directory with no spaces, e.g. C:/WAS_51. This will save you many headaches.
    3) Do not use the built-in ejbdeploy ant task, instead use ejbdeploy.bat that comes with WAS.
    4) Found a glitch in ejbdeploy.bat where it does not pick up the manifest files properly from the build directory; it instead attempts to read them from the original source directory. This is no big deal except that ejbdeploy.bat will also write the rmi class files into the source directory rather than the build directory; makes it very difficult to reconcile all the class files needed for the output EAR. We got around this by a hack that renames the source directory before invoking the ejbdeploy.bat, then renaming it back once the rmi compile is complete. (Where the "source" directory is a snapshot checked out from ClearCase.)
    5. For checking the source out of clearcase, set up a snapshot view and use the commands contained in Diane Bowker's article for checking out of clearcase.
    • SystemAdmin
      SystemAdmin
      6042 Posts
      ACCEPTED ANSWER

      Re: Anyone using Headless ANT

      ‏2004-05-25T14:50:39Z  in response to SystemAdmin
      > Update: we finally got an EAR file built via an ANT
      > script outside of WSAD, and is checked out through
      > ClearCase; here is a summary of major points:
      ...
      > 2) Install WAS in a directory with no spaces, e.g.
      > C:/WAS_51. This will save you many headaches.

      GREAT POINT - the spaces in the typical 'Program Files' and in IBM's 'WebShpere Studio' pathnames will cause DOS/Windows batch files & you many headaches. Perhaps in the next century (2100) we will be using an OS that understand the basic parsing of our language is written with a space char. and that context is very important to parsing - we can only hope!
      ...
      > 5. For checking the source out of clearcase, set up a
      > snapshot view and use the commands contained in Diane
      > Bowker's article for checking out of clearcase.

      Can you post a detailed description of how you accomplished this great task?

      A pointer to Diane Bowker's article please?

      Thanks
      • SystemAdmin
        SystemAdmin
        6042 Posts
        ACCEPTED ANSWER

        Re: Anyone using Headless ANT

        ‏2004-06-03T18:32:32Z  in response to SystemAdmin
        > Can you post a detailed description of how you
        > accomplished this great task?
        >
        > A pointer to Diane Bowker's article please?
        Here is Diane's article:
        http://www-106.ibm.com/developerworks/websphere/library/techarticles/0404_bowker/0404_bowker1.html

        And just out of curiousity, why is poor Barry having to support headless WSAD via email? Wouldn't some updated instructions and anttasks on devworks do the trick?

        Also curious to see more detailed description of how the great task was accomplished.

        Cheers
      • SystemAdmin
        SystemAdmin
        6042 Posts
        ACCEPTED ANSWER

        Re: Anyone using Headless ANT

        ‏2004-06-08T22:02:04Z  in response to SystemAdmin
        Just migrating to websphere/studio and I have to say, the ANT support in
        WSAD should cause IBM serious embarrassment.

        I read with disappointment the instructions about how to run a "headless"
        WSAD to build studio projects with ant. Now... perhaps I have been
        misguided these past years (not), but I thought the point behind using ant
        was so that you could create repeatable builds with MINIMAL external
        resource requirements & dependencies? I want all of my developers/build
        mgrs/release mgrs/etc to use the same ant scripts to build a project. Those
        builds should NOT be dependent in any way shape or form on how some IDE is
        installed or configured. That is the whole point of a build script!

        Extend the classpath requirements for running ant to include some websphere
        specific tasks, fine, that is expected... but requiring an installed
        instance of the IDE? Give me a break.

        Please someone tell me it isn't really this way... For a high $ system from
        a major enterprise shop, I expected something far more professional.
        --
        Zed

        "davidakoontz" <dakoontz@yahoo.com> wrote in message
        news:935428578.1085496639432.JavaMail.wasadmin@swg3ws006...
        > > Update: we finally got an EAR file built via an ANT
        > > script outside of WSAD, and is checked out through
        > > ClearCase; here is a summary of major points:
        > ..
        > > 2) Install WAS in a directory with no spaces, e.g.
        > > C:/WAS_51. This will save you many headaches.
        >
        > GREAT POINT - the spaces in the typical 'Program Files' and in IBM's
        'WebShpere Studio' pathnames will cause DOS/Windows batch files & you many
        headaches. Perhaps in the next century (2100) we will be using an OS that
        understand the basic parsing of our language is written with a space char.
        and that context is very important to parsing - we can only hope!
        > ..
        > > 5. For checking the source out of clearcase, set up a
        > > snapshot view and use the commands contained in Diane
        > > Bowker's article for checking out of clearcase.
        >
        > Can you post a detailed description of how you accomplished this great
        task?
        >
        > A pointer to Diane Bowker's article please?
        >
        > Thanks

        • SystemAdmin
          SystemAdmin
          6042 Posts
          ACCEPTED ANSWER

          Re: Anyone using Headless ANT

          ‏2004-06-09T15:53:14Z  in response to SystemAdmin
          > Just migrating to websphere/studio and I have to say,
          > the ANT support in
          > WSAD should cause IBM serious embarrassment.
          >
          > I read with disappointment the instructions about how
          > to run a "headless"
          > WSAD to build studio projects with ant. Now...
          > perhaps I have been
          > misguided these past years (not), but I thought the
          > point behind using ant
          > was so that you could create repeatable builds with
          > MINIMAL external
          > resource requirements & dependencies? I want all of
          > my developers/build
          > mgrs/release mgrs/etc to use the same ant scripts to
          > build a project. Those
          > builds should NOT be dependent in any way shape or
          > form on how some IDE is
          > installed or configured. That is the whole point of
          > a build script!
          >
          > Extend the classpath requirements for running ant to
          > include some websphere
          > specific tasks, fine, that is expected... but
          > requiring an installed
          > instance of the IDE? Give me a break.
          >
          > Please someone tell me it isn't really this way...
          > For a high $ system from
          > a major enterprise shop, I expected something far
          > more professional.
          > --
          > Zed

          If it's any consolation, with some help from Barry (latest "patches" to the antextras.jar) I was able to get an ant build to work ok. Hopefully he can get that released to the general public soon.

          Agreed that there should be no dependency on the development environment. Currently it depends on the AntRunner within the eclipse plugins provided by WSAD, ant it literally starts up Eclipse in headless mode. Ideally IBM would simply ship the AntTasks.jar, the dependencies it has and some doc on how to use the custom tasks (see BEA's doc on using their Ant tasks for compiling, packaging and delploying). I think the main sticking point at the moment is the tight coupling with the dev environment - ie, the dependencies and metadata that the dev environment uses for it's builds and deployment features are in a proprietary format that only the dev environment can interpret, hence bootstrapping the whole thing to get a simple compile to work.

          Perhaps a lighter weight "build" environment could be created that understands the metadata and dependency tree of the workspace projects?

          If you do have suggestions for improvement, they are listening and Barry can add you to his mail list for this effort if you are interested.
        • SystemAdmin
          SystemAdmin
          6042 Posts
          ACCEPTED ANSWER

          Re: Anyone using Headless ANT

          ‏2004-06-09T16:11:54Z  in response to SystemAdmin
          I tried to reply last night, but that reply seems to be 'lost'.

          Yes, you CURRENTLY need a Studio install to run the 'headless' Studio AntTasks (projectBuild, WarExport, ejbDeploy, etc). Many customers have complained that they dont want the cost or size of a full Studio install in order to be able to do production builds. I cannot promise/commit/comment about unshipped/unannounced product, but I can say that this complaint has been clearly heard.

          While we are at it, others have complained about builds being limited to those platforms on which Studio is supported, and want to be able to do builds wherever WebSphere AppServer runs. Again, I cannot promise/commit/comment on unannounced/unshipped product, but that complaint has also been very clearly heard.

          In the meantime, anyone having any problems running Studio v5.0/5.1 Ant builds, or AppServer v5.0/5.1 Ant deploys, should contact me. I have an unofficial TechPreview of new build AntTasks (importProject, get/setClasspathVariable, etc) and new deploy AntTask scriptlets (setAttribute, etc) which works with v5.0/5.1.
          • SystemAdmin
            SystemAdmin
            6042 Posts
            ACCEPTED ANSWER

            Re: Anyone using Headless ANT

            ‏2004-06-22T13:46:56Z  in response to SystemAdmin
            As a Websphere customer, I am disappointed with the tight coupling of WAS and WSAD. I have spent countless hours trying to build and deploy a vendor's application (customized for us) in WAS 5 without WSAD. My requirements to build and deploy are:

            1. Utilize Ant to support build and deployment process
            2. App Server vendor will provide Ant integration jars which completely contain funcationality needed to build/deploy EJBs/EARs and WARs. External dependencies (such as WAS_HOME directory) should not be required.

            If WAS could meet these requirements, I would would be a very satisfied customer. I appriciate All of Barry's work. With more IBM management support, he might be able to satisfy my requirements.

            It seems that I may need to spend more time investigating the use of an alternative Application Server such as JBOSS. I hope that IBM can help me solve my problems soon.
            • SystemAdmin
              SystemAdmin
              6042 Posts
              ACCEPTED ANSWER

              Re: Anyone using Headless ANT

              ‏2004-06-22T14:48:12Z  in response to SystemAdmin
              you dont say what problems you are actually having.
              Sudio is for initial development and production build.
              WAS is for deployment/execution.

              Can you use the ws_Ant tasks to deploy/install yhou application? if not, what is the actual problem? (maybe I, or others, can help).
          • SystemAdmin
            SystemAdmin
            6042 Posts
            ACCEPTED ANSWER

            Re: Anyone using Headless ANT

            ‏2004-08-06T20:23:40Z  in response to SystemAdmin
            Hi Barry,

            Could you please send me the unpublished ant task jars? I need them very much. Here is what I tried with the headless ant script that comes with WSAD 5.1.0 stantard edition:

            1. Check out my projects from CVS repository into my workspace. I could not find the same function as "check out as projects" within WSAD in ant task, seems like WSAD does something different for the function "check out as project" from the normal "check out into". So far I have to back up the innitial projects somewhere and copy them over to my workspace.

            2. check out the code from CVS repository into my exsiting projects. There is no problem to finish this with my headless ant script.

            3. Build the web project. I used the <projectBuild> task and it builds the whole project. But at the end I got something like this:

            C:\wsad51\workspace\rm>c:\wsad51\eclipse\jre\bin\java -cp c:\wsad51\eclipse\startup.jar org.eclipse
            .core.launcher.Main -application com.ibm.etools.j2ee.ant.RunAnt -data c:\wsad51\workspace\rm -logf
            ile c:\wsad51\workspace\rm\runAnt.log -buildfile C:\wsad51\wstools\eclipse\plugins\com.ibm.etools.j2
            ee.ant_5.1.0\buildICSWeb.xml -Dsuper_tag=ICS_SEP04R1V6_6
            HeadlessWorkspaceSettings: INITIAL autoBuild=false maxFile=1048576
            HeadlessWorkspaceSettings: TEMP autoBuild=false maxFile=-1
            Using C:\wsad51\workspace\rm\runAnt.log file as build log.
            HeadlessWorkspaceSettings: RESTORED autoBuild=false maxFile=1048576
            java.lang.reflect.InvocationTargetException: file:C:/wsad51/wstools/eclipse/plugins/com.ibm.etools.j
            2ee.ant_5.1.0/buildICSWeb.xml:14: ProjectBuild: ICSWeb Exception=null
            at com.ibm.etools.ant.extras.ProjectBuild.displayError(ProjectBuild.java:109)
            at com.ibm.etools.ant.extras.ProjectBuild.execute(ProjectBuild.java:63)
            at org.apache.tools.ant.Task.perform(Task.java:341)
            at org.apache.tools.ant.Target.execute(Target.java:309)
            at org.apache.tools.ant.Target.performTasks(Target.java:336)
            at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
            at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:571)
            at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:493)
            at java.lang.reflect.Method.invoke(Native Method)
            at org.eclipse.ant.core.AntRunner.run(AntRunner.java:464)
            at com.ibm.ant.extras.RunAnt.run(RunAnt.java:27)
            at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:858)
            at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461)
            at java.lang.reflect.Method.invoke(Native Method)
            at org.eclipse.core.launcher.Main.basicRun(Main.java:291)
            at org.eclipse.core.launcher.Main.run(Main.java:747)
            at org.eclipse.core.launcher.Main.main(Main.java:583)

            I can see there is an exception but it equals "null" so I don't know what is wrong.

            That is all I did so far, can you tell me what I should change?

            Thanks a lot!

            Jerry

            > I tried to reply last night, but that reply seems to
            > be 'lost'.
            >
            > Yes, you CURRENTLY need a Studio install to run the
            > 'headless' Studio AntTasks (projectBuild, WarExport,
            > ejbDeploy, etc). Many customers have complained that
            > they dont want the cost or size of a full Studio
            > install in order to be able to do production builds.
            > I cannot promise/commit/comment about
            > unshipped/unannounced product, but I can say that
            > this complaint has been clearly heard.
            >
            > While we are at it, others have complained about
            > builds being limited to those platforms on which
            > Studio is supported, and want to be able to do builds
            > wherever WebSphere AppServer runs. Again, I cannot
            > promise/commit/comment on unannounced/unshipped
            > product, but that complaint has also been very
            > clearly heard.
            >
            > In the meantime, anyone having any problems running
            > Studio v5.0/5.1 Ant builds, or AppServer v5.0/5.1 Ant
            > deploys, should contact me. I have an unofficial
            > TechPreview of new build AntTasks (importProject,
            > get/setClasspathVariable, etc) and new deploy AntTask
            > scriptlets (setAttribute, etc) which works with
            > v5.0/5.1.
            • SystemAdmin
              SystemAdmin
              6042 Posts
              ACCEPTED ANSWER

              Re: Anyone using Headless ANT

              ‏2004-08-06T20:37:20Z  in response to SystemAdmin
              I cannot see your email address in your posting. Please send me an EMail asking for a copy of the TechPreview (just for my records of who has it), and I will send you the AntTask TechPreview, with all the new/improved functions, including projectSetImport, etc.

              Let me know if you have ANY problem when using it.

              Barry Searle, searle@ca.ibm.com,
              "Architect, WebSphere Tools for Automated Production Build and Deployment".
            • SystemAdmin
              SystemAdmin
              6042 Posts
              ACCEPTED ANSWER

              Re: Anyone using Headless ANT

              ‏2004-08-27T07:35:37Z  in response to SystemAdmin
              Hello,
              I have the same problem and I just wanted to know if it had been solved?
            • SystemAdmin
              SystemAdmin
              6042 Posts
              ACCEPTED ANSWER

              Re: Anyone using Headless ANT

              ‏2004-10-13T15:40:43Z  in response to SystemAdmin
              I also have the same problem during the headless build of a Web Project:
              java.lang.reflect.InvocationTargetException: HeadlessWorkspaceSettings: RESTORED autoBuild=false maxFile=1048576
              file:E:/Projekte/eServer/eUtilities/idi_snapshot/idi_eui/ubs2/euiMessageServiceWeb/build.xml:32: ProjectBuild: euiMessageServiceWeb Exception=null
              at com.ibm.etools.ant.extras.ProjectBuild.displayError(ProjectBuild.java:138)
              ...

              How can that problem be solved ?
              • SystemAdmin
                SystemAdmin
                6042 Posts
                ACCEPTED ANSWER

                Re: Anyone using Headless ANT - workaround for WAR build exception (and new tasks)

                ‏2004-10-13T19:48:46Z  in response to SystemAdmin
                send me an EMail (so I have your return address) and I'll send you my current Studio AntTask TechPreview.
                • runs on Studio v50/v51
                • includes many new and/or enhanced functions
                • includes workaround for the WAR project build problem.

                Barry Searle, searle@ca.ibm.com
                "Architect, WebSphere Tools for Automated Build and Deploy"
                • SystemAdmin
                  SystemAdmin
                  6042 Posts
                  ACCEPTED ANSWER

                  Re: Anyone using Headless ANT - workaround for WAR build exception (and new tasks)

                  ‏2004-11-17T15:49:31Z  in response to SystemAdmin
                  Barry,

                  Can you please send me the new version with the improved tasks? email: Periasamy.Vel@valueoptions.com

                  Also I get this error when I runAnt against my workspace. If i build the workspace from WSAD it goes fine. Please let me know what could be wrong.

                  BUILD FAILED
                  file:c:/workarea/autobuild/build.xml:43: ProjectBuild: MHSPlusCustSrvStrutsWeb Exception=Errors were detected after building MHSPlusCustSrvStrutsWeb

                  Total time: 1 minute 35 seconds
                  HeadlessWebProjectSettings: HeadlessWebProjectSettings restore exception=Exception running validator code.
                  HeadlessWorkspaceSettings: RESTORED autoBuild=true maxFile=1048576
                  java.lang.reflect.InvocationTargetException: file:c:/workarea/autobuild/build.xml:43: ProjectBuild: MHSPlusCustSrvStrutsWeb Exception=Errors were detected after building MHSPlusCustSrvStrutsWeb
                  at com.ibm.etools.ant.extras.ProjectBuild.displayError(ProjectBuild.java:138)
                  at com.ibm.etools.ant.extras.ProjectBuild.execute(ProjectBuild.java:69)
                  at org.apache.tools.ant.Task.perform(Task.java:341)
                  at org.apache.tools.ant.Target.execute(Target.java:309)
                  at org.apache.tools.ant.Target.performTasks(Target.java:336)
                  at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
                  at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:571)
                  at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:493)
                  at java.lang.reflect.Method.invoke(Native Method)
                  at org.eclipse.ant.core.AntRunner.run(AntRunner.java:464)
                  at com.ibm.ant.extras.RunAnt.run(RunAnt.java:27)
                  at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:858)
                  at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461)
                  at java.lang.reflect.Method.invoke(Native Method)
                  at org.eclipse.core.launcher.Main.basicRun(Main.java:291)
                  at org.eclipse.core.launcher.Main.run(Main.java:747)
                  at org.eclipse.core.launcher.Main.main(Main.java:583)
                • SystemAdmin
                  SystemAdmin
                  6042 Posts
                  ACCEPTED ANSWER

                  Re: Anyone using Headless ANT - workaround for WAR build exception (and new tasks)

                  ‏2004-12-29T22:34:19Z  in response to SystemAdmin
                  Hi Barry,

                  I am geting "Exception=null" when trying to build a war nature project. The whole build process goes through fine and prints out "projectBuild Building: myWARProject ... Done.". Immediately after printing this, it throws an exception and stops proceeding with the remaining tasks in the ant. I can actually see all the class files built properly. If this exception wasn't there, the WAR building would have been smooth, I believe.

                  Would the new set of JAR files for Headless ant build help me get out of this problem, or atleast pinpoint the problem?

                  I am using Websphere application server express 5.1 with site developer 5.1.

                  Below is the exception thrown:

                  projectBuild Building: myWARProject ... Building: /myWARProject. ...
                  projectBuild Building: myWARProject ... Updating....
                  projectBuild Building: myWARProject ... Done.
                  projectBuild ProjectBuild: myWARProject Exception=null

                  BUILD FAILED
                  file:C:/Vissu/Automation/buildscripts/ProjectBuild.xml:48: ProjectBuild: cg-ibs-apSummary Exception=null
                  at com.ibm.etools.ant.extras.ProjectBuild.displayError(ProjectBuild.java:138)
                  at com.ibm.etools.ant.extras.ProjectBuild.execute(ProjectBuild.java:69)
                  at org.apache.tools.ant.Task.perform(Task.java:341)
                  at org.apache.tools.ant.Target.execute(Target.java:309)
                  at org.apache.tools.ant.Target.performTasks(Target.java:336)
                  at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
                  at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:397)
                  at org.apache.tools.ant.Task.perform(Task.java:341)
                  at org.apache.tools.ant.Target.execute(Target.java:309)
                  at org.apache.tools.ant.Target.performTasks(Target.java:336)
                  at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
                  at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:571)
                  at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:493)
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                  at java.lang.reflect.Method.invoke(Method.java:324)
                  at org.eclipse.ant.core.AntRunner.run(AntRunner.java:464)
                  at com.ibm.ant.extras.RunAnt.run(RunAnt.java:27)
                  at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:858)
                  at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461)
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                  at java.lang.reflect.Method.invoke(Method.java:324)
                  at org.eclipse.core.launcher.Main.basicRun(Main.java:291)
                  at org.eclipse.core.launcher.Main.run(Main.java:747)
                  at org.eclipse.core.launcher.Main.main(Main.java:583)

                  I am stuckup with this at this point. so please respond.

                  my email address is visweswara.kottapalli@jci.com or vissu19@yahoo.com.

                  Thanks in advance,
                  Vissu
                  • SystemAdmin
                    SystemAdmin
                    6042 Posts
                    ACCEPTED ANSWER

                    Re: Anyone using Headless ANT - workaround for WAR build exception (and new tasks)

                    ‏2005-01-03T16:56:47Z  in response to SystemAdmin
                    what version plus fixlevel of WSSD? (I am guessing WSSD-512)

                    I dont have a techpreview for WSSD, just WSAD, but that WSAD techpreview has a workaround to detect/report/bypass exceptions caused during headless JSP v512 validation, a problem introduced when the WAR project builders updated their Xerces version in v512. Without such a fix, I suspect the best thing you can do is turn of JSP validation for that WAR project (and any other WAR projects).
                  • SystemAdmin
                    SystemAdmin
                    6042 Posts
                    ACCEPTED ANSWER

                    Re: Anyone using Headless ANT - workaround for WAR build exception (and new tasks)

                    ‏2007-07-13T16:43:12Z  in response to SystemAdmin
                    I am experiencing exactly the same problem as reported here i.e. "projectBuild .... Exception=null".

                    In my case the problem goes away when the old checkstyle plugin version 3.5 required for my WSAD 5.1.2 is removed.

                    This is not exactly a good solution, as I want to use checkstyle. Note that the WSAD projects that were not configured to use checkstyle succeeded to be built. I have not yet found a better workaround than complete removal of this plugin.

                    Sorry, if this is a red herring for your particular problem.
                    • SystemAdmin
                      SystemAdmin
                      6042 Posts
                      ACCEPTED ANSWER

                      Re: Anyone using Headless ANT - workaround for WAR build exception (and new

                      ‏2007-11-13T14:51:14Z  in response to SystemAdmin
                      i am desperately looking for a solution to this problem, too!

                      Where can i find the 'checkstyle plugin version 3.5' within my WSAD?
                      What do i have to do in order to remove it?

                      Stephan
                      • SystemAdmin
                        SystemAdmin
                        6042 Posts
                        ACCEPTED ANSWER

                        Re: Anyone using Headless ANT - workaround for WAR build exception (and new

                        ‏2007-11-29T08:15:11Z  in response to SystemAdmin
                        While I dont know about checkstyle in particular, have a look at the various builders and validators in the .project file inside each project folder.
                        These can be commented out or removed individually and may or may not result in a successful build.

                        Barry Searle explicity mentions the links builder in (one of) the first developerworks articles for using headles ant here:
                        http://www.ibm.com/developerworks/websphere/library/techarticles/0203_searle/searle1.html
                        > There is another important thing, required by the WarExport and EarExport operations (described in Part 2 of this
                        > article). Operations on Web projects invoke the links builder, and this builder tries to read a preference store
                        > value, which attempts to use the workbench GUI when it is not running, causing an exception. The current workaround
                        > for the RunAnt code is to go through all projects in the workspace and temporarily remove the links builder from
                        > the builder list (then later restore it).

                        If checkstyle isn't mentioned here do a raw text search of the workspace .metadata then use some guess work and trail and error.

                        Project folders also often contain a .settings folder
                        Updated on 2007-11-29T08:15:11Z at 2007-11-29T08:15:11Z by SystemAdmin
        • SystemAdmin
          SystemAdmin
          6042 Posts
          ACCEPTED ANSWER

          Re: Anyone using Headless ANT

          ‏2004-06-10T21:14:28Z  in response to SystemAdmin
          Zedi,

          You are so right about a build script supposed to being independent of
          IDE but this "headless" crap waxing about setting up for ANT. I
          totally agree that its got to be IDE neutral. But instead this is what
          we get!! Have you looked at Barry Searle's 3 part essay about using
          ANT in WSAD? It is mentioned in those essays that if we in anyway
          change the WSAD plugin to point to a newer version of ANT jars, IBM
          support to WSAD is voided. What a hypocrisy!!

          Thanks.

          "Zed" <zedi_master-j@yahoo.com> wrote in message news:<ca5d10$49k6$1@news.boulder.ibm.com>...
          > Just migrating to websphere/studio and I have to say, the ANT support in
          > WSAD should cause IBM serious embarrassment.
          >
          > I read with disappointment the instructions about how to run a "headless"
          > WSAD to build studio projects with ant. Now... perhaps I have been
          > misguided these past years (not), but I thought the point behind using ant
          > was so that you could create repeatable builds with MINIMAL external
          > resource requirements & dependencies? I want all of my developers/build
          > mgrs/release mgrs/etc to use the same ant scripts to build a project. Those
          > builds should NOT be dependent in any way shape or form on how some IDE is
          > installed or configured. That is the whole point of a build script!
          >
          > Extend the classpath requirements for running ant to include some websphere
          > specific tasks, fine, that is expected... but requiring an installed
          > instance of the IDE? Give me a break.
          >
          > Please someone tell me it isn't really this way... For a high $ system from
          > a major enterprise shop, I expected something far more professional.
          > --
          > Zed
          >
          > "davidakoontz" <dakoontz@yahoo.com> wrote in message
          > news:935428578.1085496639432.JavaMail.wasadmin@swg3ws006...
          > > > Update: we finally got an EAR file built via an ANT
          > > > script outside of WSAD, and is checked out through
          > > > ClearCase; here is a summary of major points:
          > ..
          > > > 2) Install WAS in a directory with no spaces, e.g.
          > > > C:/WAS_51. This will save you many headaches.
          > >
          > > GREAT POINT - the spaces in the typical 'Program Files' and in IBM's
          > 'WebShpere Studio' pathnames will cause DOS/Windows batch files & you many
          > headaches. Perhaps in the next century (2100) we will be using an OS that
          > understand the basic parsing of our language is written with a space char.
          > and that context is very important to parsing - we can only hope!
          > > ..
          > > > 5. For checking the source out of clearcase, set up a
          > > > snapshot view and use the commands contained in Diane
          > > > Bowker's article for checking out of clearcase.
          > >
          > > Can you post a detailed description of how you accomplished this great
          > task?
          > >
          > > A pointer to Diane Bowker's article please?
          > >
          > > Thanks
    • SystemAdmin
      SystemAdmin
      6042 Posts
      ACCEPTED ANSWER

      Re: Anyone using Headless ANT

      ‏2004-12-11T02:53:39Z  in response to SystemAdmin
      Hi mescgroup!

      Could you post an example of the ant build file you used create your EAR file? (Or, otherwise would you know of the location of a good example that utilizes ejbdeploy.bat in and ant task, this way?)

      Were you able to successfully deploy the EAR to WAS as well (it wasn't clear from your post whether this was the case)?

      I too, amd looking to eliminate any dependency on WASD as I attempt to create a continuous build process using a CVS repository.

      Thankyou for any help you can provide!!!
  • SystemAdmin
    SystemAdmin
    6042 Posts
    ACCEPTED ANSWER

    Re: Anyone using Headless ANT

    ‏2004-07-20T15:40:18Z  in response to SystemAdmin
    I am trying to use the WebSphere ANT tasks outside of WSAD. I have been developing on a project that was not WAS and has since converted to WAS. I would like to be able to continue using a text editor (at least at this point) and just modify my custom build files to do any specific WAS work and then deploy the file to WSAD (the server embedded into it). I can not seem to do this.

    I have successfully deployed the .ear file to a standalone WAS installation via the admin console, but cannot deploy the same .ear file to WSAD via the admin console.

    What is the recommended approach to doing this?
    • SystemAdmin
      SystemAdmin
      6042 Posts
      ACCEPTED ANSWER

      Re: Anyone using Headless ANT

      ‏2004-07-20T15:52:42Z  in response to SystemAdmin
      The bottom line is that you are NOT supposed to do that. The WTE (WebSphere Test Environment) inside Studio is a slightly modified WAS unique to the Studio edit/compile/run/debug environment. Studio takes over the WTE and modifies its WAS config files such that Studio WAR/EJB/EAR projects dont need to be actually export and individually installed on the WTE, rather it modifies the WTE WAS config files to point directly to the Studio project locations. The sole purpose of the WTE is to provide a rapid edit/compile/run/debug WAS for Studio use. Also note that the WSAD WTE is specifically licensed for development use only (with Studio) and not for use as a standalone WAS server.

      As you indicated, the WAS WsAnt tasks work fine for a generic WAS.

      If you are using WSAD for development, it has AntTasks to do builds (as well as the gui) and the resulting projects will simply run on its WTE the same as if they had been built using the GUI.
      • SystemAdmin
        SystemAdmin
        6042 Posts
        ACCEPTED ANSWER

        Re: Anyone using Headless ANT

        ‏2004-07-20T16:03:59Z  in response to SystemAdmin
        Baryy thanks for the quick reply. I wasn't able to find any documentation specifing that EAR deployment through the WSAD admin console was not allowed - thanks for confirming that this is the case.

        I actually haven't tried the wsAnt tasks against WAS.

        My situation here is that we were using 5.0.x standalone WAS with no Studio. We have since upgraded to 5.1.x and budget problems have made it so getting a 5.1.x standalone for my workstation is not possible - this is what started the investigation into studio (which we already have licenses for).

        Well, thanks again you have saved me some precious time (I don't have to keep trying to get this to work, since I know it is not supposed to).
  • SystemAdmin
    SystemAdmin
    6042 Posts
    ACCEPTED ANSWER

    Re: Anyone using Headless ANT

    ‏2004-08-09T16:15:12Z  in response to SystemAdmin
    I am interested in automating builds (using ANT outside of WSAD) of a fairly straightforward application (jsp->servlet->SLSBs->db). We are currently running on WAS 4.0.3 on Windows, but we are moving to 5.1 on linux in the very near future and I'd like to deploy to JBoss as well. Development environment is XP\WSAD 5.1.2 with WTE 4, 5.0, 5.1. I don't want to rely on an installation of the IDE for doing builds, so I don't therefore want to use things like "headless" WSAD with importProject and whatnot.

    A quick description on where we are:
    • I have an ANT script to get all code from PVCS, build/war the web application, build/jar the supporting jars, build ejbjar and deploy (using ANT "exec" to run ejbdeploy.bat) the EJBs, and ear the whole thing together. The ANT script appears to run flawlessly.

    However, when I install the ear on the server, I get a NoClassDefFoundError: com/ibm/ejs/container/EJSWrapperBase when it tries to start the EJBs. Inspection of the generated classes reveals no reference to this class. EJSWrapper? Yes. But EJSWrapperBase? No.

    • If I export an ear directly from WSAD and install it on the server all runs fine.

    I inspected the contents of the ejb.jar exported from WSAD and the ejb.jar generated by the ANT script. Each jar contains the exact same files except for some of the WSAD files needed for the workbench (like .project, etc). I then inspected the deployment code generated from the ejbdeploy.bat and compared it to the deployment code generated in WSAD. There were many differences, which surprised me since I thought WSAD would just use the deploy tools which are accessed by the ejbdeploy script. Anyway, the most glaring difference is that in the EJS* classes generated using ejbdeploy there are extra methods (get/setDeployedSupport) that are not in the WSAD classes.

    Has anyone else had similar experiences? Something that should be very simple has been utterly infuriating. I have wasted a lot of time on this and I am about to acquiesce to using WSAD in headless mode to do our WebSphere builds and use ANT for JBoss.

    Any help would be greatly appreciated!
    • SystemAdmin
      SystemAdmin
      6042 Posts
      ACCEPTED ANSWER

      Re: Anyone using Headless ANT

      ‏2004-08-09T16:35:43Z  in response to SystemAdmin
      Hi,

      Not sure if this will help, but I was able to get my ant build working using the WAS 4 ejbjar task in combination with the ant ear task. The end result is an ear that I install manually. I had problems automatically deploying from the script, but at least I can create a valid ear. Note: Ejbs are stateless session only.

      Commentary

      I have been able to get most ant functionality that I need from Barry's tools, as well as other WAS 4 ant extensions. I think my biggest gripe is the coupling with eclipse and the WAS installation directory itself.

      It would be awesome to download a handful of jars that enable developers to manage all build/deployment in a headless mode. If the coupling to external tools could be eliminated, you could really improve developer productivity and acceptance (maybe reliability too?)

      Dan
      • SystemAdmin
        SystemAdmin
        6042 Posts
        ACCEPTED ANSWER

        Re: Anyone using Headless ANT

        ‏2004-08-10T13:35:50Z  in response to SystemAdmin
        Hi,

        Would you be able to provide more info on your use of the WAS 4 ejbjar task?

        Like I said, I have what appears to be a good ear file, but it seems that the differences in the deployed code generated with the ejbdeploy script is what is causing the failure in the EJB module.

        Eric
        • SystemAdmin
          SystemAdmin
          6042 Posts
          ACCEPTED ANSWER

          Re: Anyone using Headless ANT

          ‏2004-08-10T14:46:40Z  in response to SystemAdmin
          Hope this helps:
          &LT;target name="APPejbjar" description="create ejb jar file"&GT;

          &LT;mkdir dir="lib"/&GT;
          &LT;ejbjar srcdir="${classes}" basejarname="APPEJB" descriptordir="${stage.ejb.APP}/ejbModule/META-INF" dependency="full"&GT;
          &LT;websphere dbvendor="ORACLE_V8"
          ejbdeploy="true"
          codegen="true"
          trace="true"
          oldCMP="false"
          rmicOptions="-verbose"
          destdir="lib"&GT;
          &LT;wasclasspath&GT;
          &LT;pathelement location="${websphere.home}/deploytool/itp/plugins/org.eclipse.core.boot/boot.jar"/&GT;
          &LT;pathelement location="${websphere.home}/deploytool/itp/plugins/com.ibm.etools.ejbdeploy/runtime/batch.jar"/&GT;
          &LT;/wasclasspath&GT;
          &LT;classpath&GT;
          &LT;path location="${resource.dir}/properties"/&GT;
          &LT;path location="${classes}"/&GT;
          &LT;fileset dir="${tmp.src}"&GT;
          &LT;include name="*/.jar"/&GT;
          &LT;include name="*/.zip"/&GT;
          &LT;/fileset&GT;
          &LT;fileset dir="${tmp.commlibs}"&GT;
          &LT;include name="*/.jar"/&GT;
          &LT;include name="*/.zip"/&GT;
          &LT;/fileset&GT;
          &LT;path location="${stage.ejb.APP}/ejbModule"/&GT;
          &LT;/classpath&GT;
          &LT;/websphere&GT;
          &LT;include name="**\ejb-jar.xml"/&GT;
          &LT;support dir="${classes}"&GT;
          &LT;include name="configuration/.class"/&GT;
          &LT;include name="exception/.class"/&GT;
          &LT;/support&GT;
          &LT;dtd publicId="-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
          location="resources/ejb-jar_2_0.dtd"/&GT;

          &LT;/ejbjar&GT;
          &LT;/target&GT;
  • SystemAdmin
    SystemAdmin
    6042 Posts
    ACCEPTED ANSWER

    Re: Anyone using Headless ANT

    ‏2004-11-17T18:20:14Z  in response to SystemAdmin
    The information is mostly still applicable. Only major difference is that the AntTasks have been incorporated and shipped with Studio vince version 5.0.0 (no downloads needed). I have an AntTask Tech Preview of new/enhanced tasks, send me an EMail is you want a copy and to be on its distribution list.

    I intend to updated these articles in late December, to describe the new/enhanced AntTasks (v6 ships in Dec).
    • SystemAdmin
      SystemAdmin
      6042 Posts
      ACCEPTED ANSWER

      Re: Anyone using Headless ANT

      ‏2004-11-17T19:25:02Z  in response to SystemAdmin
      Where can I find EJBDeploy and EJBExport tasks? They are not in antextras.jar or antj2ee.jar. But the documentation mentions them.
      • SystemAdmin
        SystemAdmin
        6042 Posts
        ACCEPTED ANSWER

        Re: Anyone using Headless ANT

        ‏2004-11-17T19:28:01Z  in response to SystemAdmin
        They should be there automatically whenever headless studio runs. They actually come from a different plugin (com.ibm..etools.ejb.ant_*).
        • SystemAdmin
          SystemAdmin
          6042 Posts
          ACCEPTED ANSWER

          Re: Anyone using Headless ANT

          ‏2004-11-17T19:50:13Z  in response to SystemAdmin
          Hmm, I don't see it. When i try to use the task it fails with this error:

          java.lang.reflect.InvocationTargetException: file:C:/workarea/autobuild/build.xml:19: Could not create task or type of type: ejbDeploy.

          Ant could not find the task or a class this task relies upon.

          This is common and has a number of causes; the usual
          solutions are to read the manual pages then download and
          install needed JAR files, or fix the build file:
          - You have misspelt 'ejbDeploy'.
          Fix: check your spelling.
          - The task needs an external JAR file to execute
          and this is not found at the right place in the classpath.
          Fix: check the documentation for dependencies.
          Fix: declare the task.
          - The task is an Ant optional task and optional.jar is absent
          Fix: look for optional.jar in ANT_HOME/lib, download if needed
          - The task was not built into optional.jar as dependent
          libraries were not found at build time.
          Fix: look in the JAR to verify, then rebuild with the needed
          libraries, or download a release version from apache.org
          - The build file was written for a later version of Ant
          Fix: upgrade to at least the latest release version of Ant
          - The task is not an Ant core or optional task
          and needs to be declared using <taskdef>.

          Remember that for JAR files to be visible to Ant tasks implemented
          in ANT_HOME/lib, the files must be in the same directory or on the
          classpath

          Please neither file bug reports on this problem, nor email the
          Ant mailing lists, until all of these causes have been explored,
          as this is not an Ant bug.
          at org.apache.tools.ant.UnknownElement.getNotFoundException(UnknownElement.java:351)
          at org.apache.tools.ant.UnknownElement.makeObject(UnknownElement.java:267)
          at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:115)
          at org.apache.tools.ant.Task.perform(Task.java:340)
          at org.apache.tools.ant.Target.execute(Target.java:309)
          at org.apache.tools.ant.Target.performTasks(Target.java:336)
          at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
          at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:571)
          at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:493)
          at java.lang.reflect.Method.invoke(Native Method)
          at org.eclipse.ant.core.AntRunner.run(AntRunner.java:464)
          at com.ibm.ant.extras.RunAnt.run(RunAnt.java:27)
          at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:858)
          at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461)
          at java.lang.reflect.Method.invoke(Native Method)
          at org.eclipse.core.launcher.Main.basicRun(Main.java:291)
          at org.eclipse.core.launcher.Main.run(Main.java:747)
          at org.eclipse.core.launcher.Main.main(Main.java:583)
          runAnt BUILD FAILED.
          Press any key to continue . . .
          Also, the plugin.xml doesn't contain ejbDeploy or ejbExport.

          Please let me know what i am missing.

          Thanks
          • SystemAdmin
            SystemAdmin
            6042 Posts
            ACCEPTED ANSWER

            Re: Anyone using Headless ANT

            ‏2004-11-17T20:10:57Z  in response to SystemAdmin
            Are you using the "runAnt.bat" task to run Studio headless?
            • you cannot just use the anttasks directly (by putting their jars on the classpath).

            Are you running WSAD ?
            • ejbDeploy is not in base Eclipse nor WSSD (SiteDeveloper)
            = ejb tooling is the major difference WSSD => WSAD
            • SystemAdmin
              SystemAdmin
              6042 Posts
              ACCEPTED ANSWER

              Re: Anyone using Headless ANT

              ‏2004-11-18T20:22:35Z  in response to SystemAdmin
              Thanks Barry. I got it working now. Appreciate your help.
            • SystemAdmin
              SystemAdmin
              6042 Posts
              ACCEPTED ANSWER

              Re: Anyone using Headless ANT

              ‏2005-10-07T17:11:22Z  in response to SystemAdmin
              Barry,

              I got the requirement to do nightly build against WSAD5.1.2 to get source from CVS using ANT and build against it. From reading the posts here, Seems that I need to get the importproject ant custom lib from you to do the job. So (1) Can you please email the importproject thing (2) Is it possible to start the server using ant too like what we did inside WSAD? Thanks for help. If so, we can run daily junit tests over WSAD server which is great.

              My email is george.zhao@kp.org
              • SystemAdmin
                SystemAdmin
                6042 Posts
                ACCEPTED ANSWER

                Re: Anyone using Headless ANT

                ‏2006-10-13T02:18:33Z  in response to SystemAdmin
                Hi,
                I'am trying to run WSAD v 5.1 Headless ANT using the runtime from <WSAD_INSTALL_PATH>Application Developer\v5.1\runtimes\base_v51\java\jre\bin.
                It is giving me a java.lang.ClassNotFoundException: com.ibm.etools.rdblib.dcm.DriverConnectionManager. Here is the stack.
                java.lang.ClassNotFoundException: com.ibm.etools.rdblib.dcm.DriverConnectionManager
                at java.net.URLClassLoader.findClass(URLClassLoader.java(Compiled Code))
                at java.lang.ClassLoader.loadClass(ClassLoader.java(Compiled Code))
                at java.lang.ClassLoader.loadClass(ClassLoader.java(Compiled Code))
                at at com.ibm.etools.rdblib.AvailableDrivers.<clinit>(AvailableDrivers.java:223).null(Unknown Source)
                at com.ibm.etools.rdblib.RDBConnectionAPI.getAvailableDriversSingleton(RDBConnectionAPI.java:202)
                at com.ibm.etools.rdblib.RDBConnectionAPI.getAvailableDrivers(RDBConnectionAPI.java:192)
                at com.ibm.etools.websphere.tools.internal.util.Db2LocationFinder.getInstalledDB2DriverLocation(Db2LocationFinder.java:53)
                at com.ibm.etools.websphere.tools.WebSpherePlugin.startup(WebSpherePlugin.java:575)
                at org.eclipse.core.internal.plugins.PluginDescriptor$1.run(PluginDescriptor.java:736)
                at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1006)
                at org.eclipse.core.internal.plugins.PluginDescriptor.internalDoPluginActivation(PluginDescriptor.java:748)
                at org.eclipse.core.internal.plugins.PluginDescriptor.doPluginActivation(PluginDescriptor.java:188)
                at org.eclipse.core.internal.plugins.PluginClassLoader.activatePlugin(PluginClassLoader.java:112)
                at org.eclipse.core.internal.plugins.PluginClassLoader.internalFindClassParentsSelf(PluginClassLoader.java(Compiled Code))
                at org.eclipse.core.internal.boot.DelegatingURLClassLoader.findClassParentsSelf(DelegatingURLClassLoader.java(Compiled Code))
                at org.eclipse.core.internal.boot.DelegatingURLClassLoader.loadClass(DelegatingURLClassLoader.java(Inlined Compiled Code))
                at org.eclipse.core.internal.boot.DelegatingURLClassLoader.access$0(DelegatingURLClassLoader.java(Inlined Compiled Code))
                at org.eclipse.core.internal.boot.DelegatingURLClassLoader$DelegateLoader.loadClass(DelegatingURLClassLoader.java(Inlined Compiled Code))
                at org.eclipse.core.internal.boot.DelegatingURLClassLoader.findClassPrerequisites(DelegatingURLClassLoader.java(Compiled Code))
                at org.eclipse.core.internal.boot.DelegatingURLClassLoader.loadClass(DelegatingURLClassLoader.java(Compiled Code))
                at org.eclipse.core.internal.boot.DelegatingURLClassLoader.loadClass(DelegatingURLClassLoader.java(Compiled Code))
                at java.lang.ClassLoader.loadClass(ClassLoader.java(Compiled Code))

                The same exact script runs fine when I run it with in WSAD.
                I even included the jar containing this class in the runtime classpath extension of the plugin.
                Extract from plugin.xml of com.ibm.etools.rdblib_5.1.2 plugin.
                <extension point="org.eclipse.ant.core.extraClasspathEntries">
                <extraClasspathEntry library="runtime/dcm.jar"/>
                </extension>

                If anyone has any idea of what it could be I will really appreciate it. I'am running out of time at this point and would really appreciate any help.

                Thanks for taking time to read my post.

                Sowjanya Janga
              • SystemAdmin
                SystemAdmin
                6042 Posts
                ACCEPTED ANSWER

                Re: Anyone using Headless ANT

                ‏2006-10-18T18:02:21Z  in response to SystemAdmin
                1) use WSAD-512-IF7 or later
                2) or, send me an email requesting the old techpreview (for older 5.1 etc)
                searle@ca.ibm.com
  • RobertMartin
    RobertMartin
    2 Posts
    ACCEPTED ANSWER

    Re: Anyone using Headless ANT

    ‏2010-10-21T10:10:23Z  in response to SystemAdmin
    “Headless" means running builds from the command line without using the Web Sphere Studio or Rational Application Developer GUI. The headless Ant feature lets us run a series of unattended tasks, such as build and deploy. I am generating the ANTLR package through Headless ANT. I have already done this ANTLR package through ANT Script by the help of buy research papers.
  • RobertMartin
    RobertMartin
    2 Posts
    ACCEPTED ANSWER

    Re: Anyone using Headless ANT

    ‏2010-10-25T07:06:41Z  in response to SystemAdmin
    Definitely, The number essay writing service company provide deep information about the Headless Ant and its working. Headless Ant to build and export our projects. It is working successfully when no SQLJ support is added. When adding SQLJ support to one of our projects (not even having any *.sqlj created, just add the builders and nature to the project. Go ahead..