Discussions

General J2EE: Websphere Studio 5.1.1, Headless Ant

  1. Websphere Studio 5.1.1, Headless Ant (8 messages)

    Is anybody using the "headless Ant" capability in WSAD 5.1.1?

    Headless Ant is described in this article:

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

    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
  2. "Unknown argument: -consolelog"[ Go to top ]

    I am using Websphere Studio Application Developer 5.1.1 on Windows 2000

    I found the runAnt.bat file in C:\Program Files\IBM\WebSphere Studio\Application
    Developer\v5.1.1\wstools\eclipse\plugins\com.ibm.etools.j2ee.ant_5.1.1

    I modified the batch file so that it will reference my local workspace (c:\workspace)

    When I run the batch file, I get this error message:

             Unknown argument: -consolelog

    Since IBM wrote the runAnt.bat batch file, I'm not sure why this error is happening.

    Is the batch file flawed?
  3. "Unknown argument: -consolelog"[ Go to top ]

    IBM Support told me to remove "-consolelog" from the batch file.

    This was a sufficient workaround.
  4. I am using WSAD 5.1.1 on Windows 2000

    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 the workspace.temp directory

    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>
  5. 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)"
    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 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.
  6. See also:

    http://marc.theaimsgroup.com/?l=ant-user&m=108091490711343&w=2

    http://www-106.ibm.com/developerworks/websphere/library/techarticles/0404_bowker/0404_bowker1.html

    http://www-106.ibm.com/developerworks/websphere/library/techarticles/0404_bowker/0404_bowker2.html
  7. Hi,

    I am having problems with the headless Ant ejbDeploy task with WSAD 5.1.1. I can build and export the ejb but I cannot deploy it as I get the following error:

     Caused by: com.ibm.etools.wft.util.WFTWrappedException
         [java] at com.ibm.etools.j2ee.operations.HeadlessJ2EEOperation.run(HeadlessJ2EEOperation.java:105)
         [java] at com.ibm.etools.ejb.ant.EJBDeploy.execute(EJBDeploy.java:111)
         [java] ... 24 more
         [java] Caused by: com.ibm.etools.ejbdeploy.RMICExecutionError: Error generating RMI code: Cannot run RMIC because it is not installed. Expected location of RMIC is the following: C:\Program Files\IBM\WebSphere Studio\Application Developer IE\v5.1.1\runtimes\base_v5\java\lib\.

    My relevant parts of my Ant build file are


    <target name="deployEjb" depends="init">
    <!-- Deploys the EJB file -->
    <ejbDeploy EJBProject="${project.ejb}" />
    </target>

    <target name="init">
    <!-- Create the time stamp -->
    <tstamp />
    <property name="earfile.dist" value="${dist.lib}/${project.ear}-${DSTAMP}.ear" />
    <property name="warfile.dist" value="${dist.lib}/${project.war}-${DSTAMP}.war" />
    <property name="ejbfile.dist" value="${dist.lib}/${project.ejb}-${DSTAMP}.jar" />
    <eclipse.refreshLocal resource="${project.war}" depth="infinite"/>
    <eclipse.refreshLocal resource="${project.ejb}" depth="infinite"/>
    </target>
  8. i'm having nearly the same issue. was there a resolution to this?
  9. Headless State Ant Build[ Go to top ]

    Has anyone seen this before? When I try to use the 'importProject' Ant task I get the following: [importProject] Importing project : PolAdminCoreJava [importProject] Exception! [importProject] java.lang.IllegalStateException: Workbench has not been created yet. importProject] at com.merant.team.pvcs.scc.PvcsSccOperation.getMyShell(PvcsSccOperation.java:274) [importProject] at com.merant.team.pvcs.scc.PvcsSccOperation.getWindowHandle(PvcsSccOperation.java:264) [importProject] at com.merant.team.pvcs.scc.PvcsSccTeamProvider.projectConfigure(PvcsSccTeamProvider.java:299) [importProject] at com.merant.team.pvcs.PvcsTeamProvider.restoreConfiguration(PvcsTeamProvider.java:128) [importProject] at com.merant.team.pvcs.PvcsTeamProvider.setProject(PvcsTeamProvider.java:145) [importProject] at org.eclipse.team.core.RepositoryProvider.mapNewProvider(RepositoryProvider.java:176) [importProject] at org.eclipse.team.core.RepositoryProvider.mapExistingProvider(RepositoryProvider.java:205) [importProject] at org.eclipse.team.core.RepositoryProvider.getProvider(RepositoryProvider.java:409) [importProject] at org.eclipse.team.internal.core.TeamHookDispatcher.getProvider(TeamHookDispatcher.java:71) [importProject] at org.eclipse.team.internal.core.TeamHookDispatcher.getRuleFactory(TeamHookDispatcher.java:79) [importProject] at org.eclipse.core.internal.resources.Rules.factoryFor(Rules.java:86) [importProject] at org.eclipse.core.internal.resources.Rules.createRule(Rules.java:67) [importProject] at org.eclipse.core.internal.resources.Project.create(Project.java:246) [importProject] at com.ibm.ant.extras.ProjectImportWorkspaceModifyOperation.execute(ProjectImportWorkspaceModifyOperation.java:51) [importProject] at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:91) [importProject] at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1673) [importProject] at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:105) [importProject] at com.ibm.ant.extras.ImportProject.runAsExternalProjectImportOp(ImportProject.java:199) [importProject] at com.ibm.ant.extras.ImportProject.execute(ImportProject.java:63) [importProject] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275) [importProject] at org.apache.tools.ant.Task.perform(Task.java:364) [importProject] at org.apache.tools.ant.Target.execute(Target.java:341) [importProject] at org.apache.tools.ant.Target.performTasks(Target.java:369) [importProject] at org.apache.tools.ant.Project.executeTarget(Project.java:1214) [importProject] at org.apache.tools.ant.Project.executeTargets(Project.java:1062) [importProject] at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:633) [importProject] at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:539) [importProject] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [importProject] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85) [importProject] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58) [importProject] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60) [importProject] at java.lang.reflect.Method.invoke(Method.java:391) [importProject] at org.eclipse.ant.core.AntRunner.run(AntRunner.java:488) [importProject] at com.ibm.ant.extras.RunAnt.run(RunAnt.java:29) [importProject] at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:335) [importProject] at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:273) [importProject] at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:129) [importProject] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [importProject] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85) [importProject] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58) [importProject] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60) [importProject] at java.lang.reflect.Method.invoke(Method.java:391) [importProject] at org.eclipse.core.launcher.Main.basicRun(Main.java:185) [importProject] at org.eclipse.core.launcher.Main.run(Main.java:704) [importProject] at org.eclipse.core.launcher.Main.main(Main.java:688)