unable to deploy to IBM websphere application server using ant - websphere-8

I am using ant to deploy an ear file to WAS. I am successfully able to generate the ear and then using the following to deploy to localhost
<target name="deploy" depends="buildEar">
<echo message="${toString:was.runtime}"/>
<taskdef name="wsInstallApp" classpath="${was_cp}" classname="com.ibm.websphere.ant.tasks.InstallApplication" />
<wsInstallApp wasHome="${WAS.home}" ear="${earFile}" failonerror="true" />
</target>
This is what was_cp looks like
<property name="was_home" value="C:/ibm/WebSphere855/AppServer">
</property>
<path id="was.runtime">
<fileset dir="${was_home}/lib">
<include name="**/*.jar" />
</fileset>
<fileset dir="${was_home}/plugins">
<include name="**/*.jar" />
</fileset>
</path>
<property name="user.install.root" value="${was_home}/profiles/AppSrv01" />
<property name="was_cp" value="${toString:was.runtime}" />
<property name="java.endorsed.dirs" value="${toString:was.runtime}" />
I get the following error. Thanks for your help!
[wsInstallApp] Installing Application [K:\uoc-dev\bceEAR\build\ear\bce.ear]...
[wsadmin] WASX7209I: Connected to process "server1" on node zinfandelNode01 using SOAP connector; The type of process is: UnManagedProcess
[wsadmin] WASX7017E: Exception received while running file "C:\Users\IBM_AD~1\AppData\Local\Temp\wsant8484530159820548868jacl"; exception information: com.ibm.websphere.management.application.client.AppDeploymentException: com.ibm.websphere.management.application.client.AppDeploymentException: [Root exception is java.lang.NoClassDefFoundError: javax.annotation.security.RolesAllowed]
[wsadmin] java.lang.NoClassDefFoundError: java.lang.NoClassDefFoundError: javax.annotation.security.RolesAllowed

I was able to get it working by using the ws_ant.bat file to run the build instead of using default ant on my machine.

Related

Alfresco custom action dialog not showing

I created a custom Alfresco action dialog using one of the sample SDK projects
as a base. I kept the sample projects "org.alfresco.sample" package for my java files
and it worked fine.
Then I tried to change the package name to "com.xxxxxx.xxxxx" and it stopped working.
I have checked all of the files in the project to make sure that I have replaced every instance of "org.alfresco.sample" with my new package name.
Can anyone suggest a possible reason for this?
Thanks
I found that when I build the project, it is not building the java files. Can anyone
suggest why it is not building the java files with the new package name?
Thanks
I got the java files build again. But the new actions are still not being used. The new actions use an evaluator but it does not seem to be running. (It would normally write to
the log.)
Here is part of the build.xml:
<project name="Custom Dialog Build File" default="package-amp" basedir=".">
<property name="project.dir" value="."/>
<property name="build.dir" value="${project.dir}/build"/>
<property name="config.dir" value="${project.dir}/config"/>
<property name="jsp.dir" value="${project.dir}/web/jsp"/>
<property name="web.dir" value="${project.dir}/web" />
<property name="package.file.jar" value="${build.dir}/lib/custom-dialog.jar"/>
<property name="package.file.zip" value="${build.dir}/lib/custom-dialog.zip"/>
<property name="amp.file" value="${build.dir}/dist/retailChannels.amp"/>
<path id="class.path">
<dirset dir="${build.dir}" />
<fileset dir="../../lib/server" includes="**/*.jar"/>
</path>
<target name="compile">
<mkdir dir="${build.dir}" />
<javac classpathref="class.path" srcdir="${project.dir}/source" destdir="${build.dir}" />
</target>
<target name="package-jar" depends="increment-build-number">
<delete file="${package.file.jar}" />
<jar destfile="${package.file.jar}">
<fileset dir="${build.dir}">
<exclude name="dist/**" />
<exclude name="lib/**" />
<exclude name="web/**" />
</fileset>
</jar>
</target>
<target name="mkdirs">
<mkdir dir="${build.dir}/dist" />
<mkdir dir="${build.dir}/lib" />
</target>
<target name="clean">
<delete includeemptydirs="true">
<fileset dir="${build.dir}/dist" includes="**/*"/>
</delete>
</target>
<target name="package-amp" depends="clean, mkdirs, package-jar" description="Package the Module" >
<delete file="${amp.file}" />
<zip destfile="${amp.file}" >
<fileset dir="${project.dir}/build" includes="lib/*.jar" />
<fileset dir="${project.dir}/config/alfresco/module/alfresco" includes="*.properties" />
<fileset dir="${project.dir}" includes="config/**/*.*" excludes="**/module.properties" />
<fileset dir="${project.dir}/source">
<include name="web/jsp/**/*.jsp" />
<include name="web/images/**" />
</fileset>
</zip>
</target>
</project>
I just tried going through the maven SDK tutorial that you suggested but I got
this error:
Feb 14, 2014 3:42:48 PM org.apache.catalina.core.ContainerBase startInternal
SEVERE: A child container failed during start
java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: PermGen space
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:188)
Check the build.xml file. Double-check the compile and package-jar tasks (or similar). For example, one or both of these tasks may have a fileset that uses a pattern to include your classes using the package structure, and it may no longer match now that you've changed your package name.
It's hard to tell without seeing your build.xml.
By the way, if you want a more up-to-date example for creating actions in Alfresco, take a look at this tutorial: http://ecmarchitect.com/alfresco-developer-series-tutorials/actions/tutorial/tutorial.html
It uses the Alfresco Maven SDK to package AMPs. The Alfresco Maven SDK is preferred over the old SDK you are using.

Unable to deploy EAR in WebSphere Application Server in Unix with ANT Scripts

I am trying to deploy EAR in my WAS 7.0 in Unix Server by means of ANT Scripts but couldn't get it working.It works fine in Windows environment.
A part of ws_ant.xml is as follows,
<property name="options" value="-appname CRMWeb -MapModulesToServers {{.* .* WebSphere:cell=Cell01,node=Node01_POR,server=Web_Server1}}" />
<property name="application" value="CRMWeb" />
<property name="conntype" value="SOAP" />
<property name="host" value="172.20.10.10" />
<property name="port" value="20062" />
<property name="profile_root" value="/opt/app/was7/wasprd02/AppServer" />
<property name="webserverName" value="Web_Server1" />
<taskdef name="wsStartApp" classname="com.ibm.websphere.ant.tasks.StartApplication"/>
<taskdef name="wsStopApp" classname="com.ibm.websphere.ant.tasks.StopApplication"/>
<taskdef name="wsUninstallApp" classname="com.ibm.websphere.ant.tasks.UninstallApplication"/>
<taskdef name="wsInstallApp" classname="com.ibm.websphere.ant.tasks.InstallApplication"/>
<target name="uninstallApp">
<wsUninstallApp
application="${application}"
conntype="${conntype}"
host="${host}"
port="${port}"
user="${userId}"
password="${password}"
failonerror="false"
/>
</target>
When I try to install / uninstall the EAR in Unix with above script, there is no effect. Manual deployment from WebSphere console is working fine.
I have referred Using Ant to deploy EAR to remote websphere application server and tried to make some changes but still it is not working.
Please suggest.
Thanks

Is there a basic, standard .build file for NAnt?

Basically, I'm trying to integrate CruiseControl.NET with NAnt. I've got CC.NET set up, but I'm getting an exception when it tries to build with NAnt.
BUILD FAILED - Could not find a '*.build' file in 'C:\inetpub\MyProject\'
Okay, no big deal, I just have to create a build file. Not sure what that is, but I found one in the HelloWorld example that came with NAnt, it looks like this:
<project name="Hello World" default="run">
<property name="basename" value="HelloWorld"/>
<property name="debug" value="true"/>
<target name="clean">
<delete>
<fileset>
<include name="bin/${basename}-??.exe"/>
<include name="bin/${basename}-??.pdb"/>
</fileset>
</delete>
</target>
<target name="build">
<mkdir dir="bin" />
<csc target="exe" output="bin/${basename}-cs.exe" debug="${debug}">
<sources>
<include name="${basename}.cs"/>
</sources>
</csc>
<jsc target="exe" output="bin/${basename}-js.exe" debug="${debug}">
<sources>
<include name="${basename}.js"/>
</sources>
</jsc>
<vbc target="exe" output="bin/${basename}-vb.exe" debug="${debug}">
<sources>
<include name="${basename}.vb"/>
</sources>
</vbc>
</target>
<target name="run" depends="build">
<exec program="bin/${basename}-cs.exe" basedir="."/>
<exec program="bin/${basename}-js.exe" basedir="."/>
<exec program="bin/${basename}-vb.exe" basedir="."/>
</target>
</project>
There's a lot more content in this file than I was expecting. I tried searching around to find out what everything meant, what was required, etc. But I couldn't find anything.
Is there just a basic and standard file that I could use? All I want to do is simply build my entire application, nothing crazy.
Nant's tasks and attributes are described here: NAnt Help
Task Reference
Also,
A Brief Introduction to NAnt
NAnt Starter Series
This article has a template:
The Anatomy of a NAnt Build File
Plus, previous SO question:
Simple HelloWorld build script

Flex Ant compile project

i want to use Ant task to compile flex project(with many libraries, modules)
i use -dump-config build.xml compiler option in flash builder to extract build config
after i create this Ant task(for start, i try to compile only one mxml-module) :
<project name="My App Builderrrr" basedir="." default="main">
<property name="QA_PM_DEST" value="[my project dir]\src"/>
<property name="BIN_DEBUG" value="[my project dir]\bin-debug"/>
<property name="FLEX_HOME" value="C:/Program Files/Adobe/Adobe Flash Builder 4/sdks/4.0.0"/>
<property name="APP_ROOT" value="src"/>
<property name="DEPLOY_DIR" value="c:\output"/>
<taskdef resource="flexTasks.tasks" classpath="${basedir}/libs/flexTasks.jar"/>
<target name="main">
<mxmlc file="${QA_PM_DEST}/***.mxml"
output="${DEPLOY_DIR}/***.swf">
<load-config filename="***\build.xml"/>
</mxmlc>
</target>
and after
ant -buldfile mybuildfile.xml
but it generates very small swf file that runs with errors(67kb insted of 300kb in release build and 800kb in debug)
I think you need to load the following config, too:
<property name="flex.config" value="${FLEX_HOME}/frameworks/flex-config.xml"/>
<load-config filename="${flex.config}" />
(UPDATE 2010-08-19)
I also add incremental="false" to my mxmlc call and the libraries this way:
<library-path dir="${lib.dir}" append="true">
<include name="**.swc" />
</library-path>
An the following is also missing in your file:
<source-path path-element="${src.dir}"/>

Could not load definitions from resource flexTasks.tasks. It could not be found

I'm attempting to compile a Flex application from an ANT script, inside of Eclipse (CFBuilder, based on Eclipse), and I've run into this error:
Could not load definitions from resource flexTasks.tasks. It could not be found.
I haven't been able to find anything that gives directions on where this file (flexTasks.tasks) should be copied to, if it's needed at all. Some places indicate that it should be part of the flexTasks.jar file. I've tried two different things:
Copy the jar file into the ant/plugins/lib folder (and restart my CF Builder instance)
Specify the path to the jar in the classpath attribute, as suggested by the comment on this page
Neither helps me get past this error.
Here's my build script, for reference:
<project name="Tagging" default="compile-tagging" basedir=".">
<!-- setup flex compilation capability -->
<taskdef resource="flexTasks.tasks" />
<property name="flex.src" value="./src" />
<property name="flex.bin" value="./bin"/>
<target name="compile-tagging">
<mxmlc
file="${flex.src}/main.mxml"
output="${flex.bin}/main.swf"
keep-generated-actionscript="true">
<source-path path-element="${FLEX_HOME}/frameworks" />
</mxmlc>
</target>
</project>
Adam, I believe you need to tell taskdef where to look for the file. try keeping flextasks.jar in the same directory as your ant file (for now... you can move it later after you get it working).
then, you can do something like this:
<taskdef name="mxmlc" classname="WhateverTheTaskIsNamed" classpath="flexTAsks.jar" />
While not ideal, this code is working for me at the moment:
<project name="IOLTagging" default="go" basedir=".">
<!-- setup flex compilation capability -->
<property name="FLEX_HOME" value="C:/program files (x86)/Adobe/Adobe Flash Builder Beta 2/sdks/3.4.1/" />
<taskdef name="mxmlc" classname="flex.ant.MxmlcTask" classpath="${FLEX_HOME}/ant/lib/flexTasks.jar" />
<taskdef name="html-wrapper" classname="flex.ant.HtmlWrapperTask" classpath="${FLEX_HOME}/ant/lib/flexTasks.jar" />
<property name="flex.src" value="./src" />
<property name="flex.bin" value="./bin"/>
<property name="swf.name" value="main" />
<target name="go" depends="compile-flex" />
<target name="compile-flex">
<mxmlc
file="${flex.src}/main.mxml"
output="${flex.bin}/${swf.name}.swf"
debug="false"
keep-generated-actionscript="false">
<source-path path-element="${FLEX_HOME}/frameworks" />
<compiler.library-path dir="${basedir}/libs" append="true">
<include name="*.swc" />
</compiler.library-path>
</mxmlc>
</target>
</project>
I had the same problem, and the reason was in lack of permissions to acces $FLEX_HOME/ant.
You can also put the flexTasks.jar in ~/.ant/lib directory
If you run ant -diagnostics you should see the jar in USER_HOME/.ant/lib jar listing
I think you should have solved this problem. just trying flexmonkey today and also got the same problem.
"Could not load definitions from resource flexTasks.tasks. It could not be found."
solution is to make sure the flexTasks.jar is included in the dir lib of your project workplace.
when I copied flexTasks.jar from flashbuild folder \ant\lib and built it again. the problem is fixed.

Resources