I have changed my Tomcat Server from version 6 to 7 and now my ant deploy fails.
At first i had my ant build like the following and got a 403 error
<taskdef resource="org/apache/catalina/ant/catalina.tasks" classpathref="x.classpath" />
<target name="tomcatdeploy" depends="tomcatundeploy,war">
<deploy url="http://localhost/manager/html" username="x" password="x" path="/xx" war="file:x.war"/>
</target>
I found several sources on the internet an changed the manager/html to manager/text and added the roles manager-script and admin-script in the tomcat-user file.
The error I am getting now is
java.net.HttpRetryException: cannot retry due to server authentication, in streaming mode
I found that this may be because of the size of the .war file which i deploy which is about 250M, but i didn't find a solution how to deploy it to tomcat 7 from ant.
I finally found a comprehensive post about this Problem:
http://paulgrenyer.blogspot.co.at/2011/11/catalina-ant-for-tomcat-7.html
Related
We trigger jetty through ant target as below
<target name="jettysh" depends="init">
<exec executable="${JETTY_HOME}/bin/jetty.sh" failonerror="true">
<env key="JAVA_OPTIONS"
value="-server -d64 ${x} ${y} ${z} ${l} -Dsettings.path=${p.path} -Dlog4j.configuration=file:///${dpath}/conf/sample.xml -Djetty.secure.port=${JETTY_SECURE_PORT} -Dapp.dir=${app.dir}"/>
</exec>
</target>
In this we pass -Dlog4j.configuration path in the older log4j 1.X version as we are migrating to newer version we are passing the new configuration -Dlog4j2.configurationFile but the logs are not getting generated .
And also we are not seeing any log files getting generated that means that log configuration itself is not picked
Help is very much appreciated as it is a time bound one.
Jetty Hightide 7.x does not have support for log4j2 at the server level.
Using that ancient EOL version of Jetty, you only have support for log4j2 within your webapps.
That means you have to put the log4j2 jars and it's configuration files in your WAR file.
Recently I upgraded my WAS application to use JDK 1.8 provided by IBM. But when I try to build my application using Ant. I see the error
BUILD FAILED
C:\Workspace\trunk\APPInstallation\build.xml:1132: The following error occurred while executing this line:
java.lang.AssertionError: org.xml.sax.SAXParseException: Failed to read external schema document "jar:file:/C:/IBM/WebSphere/AppServer/plugins/com.ibm.jaxb.tools.jar!/com/ibm/jtc/jax/tools/xjc/reader/xmlschema/bindinfo/xjc.xsd", because "jar" access is not allowed.
Total time: 29 seconds
I Googled a bit about it, and found that i have to create a jaxp.properties file in the jre/lib folder, which I did, with the value:
javax.xml.accessExternalSchema=all
but it still doesn't work. Any help with this would be welcome! This is area of the ant file where the error comes from:
<wsimport wsdl="${build.dir}/src/${wsdl.file}" destdir="build" wsdlLocation="file:/WEB-INF/wsdl/${wsdl.file}" failonerror="true">
<depends dir="${build.dir}/src" includes="*.xsd" />
<produces dir="${lib.dir}" includes="${webservice.name}${webservice.component}WSBeans.jar"/>
</wsimport>
Do nesting any of these inside your wsimport task resolve it?
<xjcarg value="-Djavax.xml.accessExternalSchema=all"/>
<arg value="-Djavax.xml.accessExternalSchema=all"/>
<arg value="-J-Djavax.xml.accessExternalSchema=all"/>
I'm trying to create an OSGi wrapper for the newest version of jTDS. I'm trying to add the wrapping process to the existing jTDS build process (Ant-based). I've downloaded the latest bnd.jar and added the following to the jTDS build.xml:
<taskdef resource="aQute/bnd/ant/taskdef.properties" classpath="bnd.jar"/>
<bndwrap trace="true" definitions="${basedir}/bnd" output="${build}/${ant.project.name}-${version}.osgi.jar">
<fileset dir="${build}" includes="*.jar"/>
</bndwrap>
I've also got a very simple bnd definition defined:
version=1.2.6
Export-Package: net.sourceforge.jtds*;version=${version}
Bundle-Version: ${version}
Bundle-Name: net.sourceforge.jtds
When I execute the dist task in Ant, it should be creating a JAR with the proper OSGi manifest. It IS creating another JAR, but the manifest is identical to the original.
If I execute the same wrap directly against the bnd JAR:
java -jar bnd.jar wrap -p bnd\jtds-1.2.6.bnd -o build\jtds-1.2.6.osgi.jar build\jtds-1.2.6.jar
I get the correct OSGi manifest.
What is going wrong during the Ant build?
It seems to be a problem with the latest version of bnd, found here. The Ant WrapTask was retooled some and just doesn't seem to work (maybe it's just misconfigured; documentation hasn't kept up with code).
I dropped in version 1.50.0 instead and everything worked as expected both through the bnd.jar and through Ant.
I am trying to run an Ant task from within IBM RSA IDE using Ant build ...
I get the following error message:
BUILD FAILED
build.xml:21: Could
not create task or type of type: getProjectData.
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 'getProjectData'.
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 the JAR file and/or libraries
implementing the functionality were not found at the time you
yourself built your installation of Ant from the Ant sources.
Fix: Look in the ANT_HOME/lib for the 'ant-' JAR corresponding to the
task and make sure it contains more than merely a META-INF/MANIFEST.MF.
If all it contains is the manifest, then rebuild Ant with the needed
libraries present in ${ant.home}/lib/optional/ , or alternatively,
download a pre-built 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>.
- You are attempting to use a task defined using
<presetdef> or <macrodef> but have spelt wrong or not
defined it at the point of use
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.
Here's the Ant buildfile:
<!-- Get property locationName. -->
<target name="config">
<echo message="${ear.project.name}" />
<getProjectData projectName="${ear.project.name}" />
</target>
I am not quite sure what the problem is here because the error message seems not helpful. Any suggestions?
I believe getProjectData is an IBM extension to ant. Like you, I had a similar error, but I was able to get it working after ensuring the Run in the same JRE as the workspace option was enabled (which you can find by right-clicking the build file, run-as, Ant Build..., and selecting the option on the JRE tab).
I discovered the solution on the IBM info center:
The Run in the same JRE as the workspace option enables the classpath
of the workbench to access the additional Ant tasks that perform
operations that are specific to the workbench, such as projectImport,
projectBuild, workspaceBuild, ejbDeploy, or earExport. If your Ant
build script uses any Ant tasks that perform workbench operations,
verify that you selected the Run in the same JRE as the workspace
option; otherwise you might get the following error message in the
Console view:
Problem: failed to create task or type <Ant task> Cause:
The name is undefined.
The build file I used looked like this:
<?xml version="1.0"?>
<project name="Test" default="config" basedir=".">
<target name="config">
<getProjectData Basedir="${basedir}" />
<echo message="getProjectData: projectName=${projectName}
nature=${natureName}
workspace=${workspaceName}
basedir=${basedir}" />
</target>
</project>
And output:
Buildfile: C:\DATA\java\workspace\test-java\build.xml
config:
[getProjectData] Setting projectName=test-java
[getProjectData] Retrieved following Project Data :
[getProjectData] workspaceName=C:\DATA\java\workspace
[getProjectData] natureName=Java
[echo] getProjectData: projectName=test-java
nature=Java
workspace=C:\DATA\java\workspace
basedir=C:\DATA\java\workspace\test-java
BUILD SUCCESSFUL
Total time: 78 milliseconds
Ant task breaks at the <wsejbdeploy> tag. The exception message is :
[wsejbdeploy] Error executing deployment: java.lang.ClassNotFoundException.
Error is com.ibm.etools.ejbdeploy.batch.plugin.BatchExtension.
[wsejbdeploy] java.lang.ClassNotFoundException:
com.ibm.etools.ejbdeploy.batch.plugin.BatchExtension
[wsejbdeploy] at java.lang.Class.forName(Class.java:136)
In addition to that, ivy.xml reports problems, but when I inspect it, the messages have no sense (screenshot). I suspect the problems could be:
a) Additional files that I have for the build which conflict with the upgraded Ant (in RSA 7.0 i've had Ant 1.6.5 and RSA 8.0 comes with Ant 1.7.1). Additional files are:
required for ant tasks execution
ant-contrib/ant-contrib.jar
antelope-tasks/AntelopeTasks_3.2.10.jar
antform/antform.jar
antform/defaultStyle.txt
antlr/antlr.jar
checkstyle/checkstyle-4.2.jar
checkstyle/checkstyle-optional-4.2.jar
checkstyle/checkstyle-frames-errors.xsl
clover/clover.jar
clover/cenquatasks.jar
clover/clover.license
doccheck/doccheck-modified.jar
ivy/ivy-20060723172807.jar
jakarta-commons/commons-beanutils.jar
resources/checkstyle/checks-source.xml
resources/checkstyle/checksTransformation.xsl
b) Changes in the Ant regarding EJB build which require some settings to be reconfigured.
c) Something else :)
Except the Error, everything else is a stab in the dark so feel free to ask for any additional info.
The problem was in the additional file needed for wsejbdeploy. In the 6.0 version, you copy wsanttasks.jar and wsprofile.jar from the websphere 6.0 installation folder and then reference it like this
<taskdef name="wsejbdeploy" classname="com.ibm.websphere.ant.tasks.WsEjbDeploy"
classpathref="all-libs"/>
where "all-libs" is a reference to the folder where you copied the jars. In websphere 7.0 there is no wsanttasks.jar and you must reference the runtime file, eg
<taskdef name="wsejbdeploy" classname="com.ibm.websphere.ant.tasks.WsEjbDeploy">
<classpath>
<pathelement path="C:/IBM/SDP80/runtimes/base_v7/plugins/com.ibm.ws.runtime.jar" />
</classpath>