Error building war file with ant in olio setup - ant

I'm currently installing olio using the olio_java_setup:
https://svn.apache.org/repos/asf/incubator/olio/docs/java_setup.html
I installed within the setup JDK 1.7, ANT 1.8.3, FABAN 1.0.1 and Glassfish v3.
I finished all previous steps of the setup and i am stuck in step 7 of Building the Web Application.
When i enter the "ant" command in the terminal the Build fails with the following output:
foo#ubuntu:~/olio/webapp/java/trunk/ws/apps/webapp$ ant
Buildfile: /home/foo/olio/webapp/java/trunk/ws/apps/webapp/build.xml
default-ear:
init:
-pre-compile:
bpp-actual-compilation:
[echo] Compiling webapp
[javac] /home/foo/olio/webapp/java/trunk/ws/bp-project/command-line-ant-tasks.xml:96: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
[javac] Compiling 9 source files to /home/foo/olio/webapp/java/trunk/ws/apps/webapp/build/classes
BUILD FAILED
/home/foo/olio/webapp/java/trunk/ws/bp-project/command-line-ant-tasks.xml:96: /home/foo/olio/webapp/java/trunk/ws/apps/webapp/${javaee.lib.dir} does not exist.
Can somebody please tell me where my mistake is and how can I fix it?
Kind regards,
Kim

It looks like you may have missed some steps when setting up the properties in previous steps. The message you are getting indicates that a path cannot be found, but in that path is an unassigned property, ${javaee.lib.dir}. When you see this in ant output, it means that there is a property named javaee.lib.dir that is is trying to use as part of the path that has not been assigned a value. You'll have to find out why that variable is not getting assigned a value by looking for it in one of the .properties files or the build.xml.

Olio doesn't support JDK 1.7 yet, check the Olio developer's response here

Related

class org.apache.tools.ant.taskdefs.optional.ssh.SSHExec was not found

I have somewhat common problem with ant not being able to find the class org.apache.tools.ant.taskdefs.optional.ssh.SSHExec. However, the common solutions don't work for me:
ensuring that the jsch.jar and ant-jsch.jar exists in the classpath
ensuring that there are not multiple different versions of the mentioned jars
ensuring that ant -diagnostics is infact seeing the jars
I have no idea what I should try out next. The output I get is the good 'ol:
build.xml: Problem: failed to create task or type sshexec
Cause: the class org.apache.tools.ant.taskdefs.optional.ssh.SSHExec was not found.
This looks like one of Ant's optional components.
Action: Check that the appropriate optional JAR exists in
-/usr/share/ant/lib
-/opt/home/myname/.ant/lib
-a directory added on the command line with the -lib argument
Do not panic, this is a common problem.
The commonest cause is a missing JAR.
My setup:
ant version: Apache Ant(TM) version 1.9.2 compiled on January 22 2014
ant-jsch version: 1.9.2
jsch version: 0.1.52
Ant diagnostics log can be found here: http://pastebin.com/q5AURxuk
As seen from the diagnostics log, the jars are there but ant reports:
sshexec : Not Available (the implementation class is not present)
I also extracted the jar file and ensured that the class is there.
Any ideas?
I've been hit by nearly the same problem, especially ant -diagnostics shows that sshexec task is "Not available".
On my system the solution was to install package "ant-optional" additionally (as I've already posted here: ANT can't find specific libraries)
Maybe this helps.
Regards
Came across a problem very similar to yours, problem with SCP rather than SSH but otherwise the same. Tou don't say if you compiled Ant yourself ot used a binary distribution, but or us it turned out to be a problem with the ant-jsch.jar not compiling properly. There was no suggestion of a problem on compile, but the jar was much smaller than expected, only 6k. We fixed the issue by using the ant-jsch.jar from the binary distribution, which is 48k. This was with ant-1.9.4 and ant-1.9.5, Java 1.8.0_45.

Can't run DynaForm - BUILD FAILED - Ant

To run the sample application of DynaForm (a dynamic web form generator) I followed the readme instruction:
DynaForm - a dynamic web form genrator
To run the sample application use your command line and type "ant".
Then open localhost:2000/ on your browser.
The build script requires ANT and JDK (at least Java 1.6) to be in the path.
The DynaForm's project site is hostet at:
http://code.google.com/p/xsd-web-forms/
Rein Raudjärv
May 23 2010
In my Mac I have ANT and JDK (with Java 1.6). When launch in my command line "ant" I have this error:
BUILD FAILED
/Users/colet/Desktop/dynaform/build.xml:64: /Users/colet/Desktop/dynaform/${env.ANT_HOME}/lib does not exist.
Maybe I misunderstood the sentence:
The build script requires ANT and JDK (at least Java 1.6) to be in the path.
what does "to be in the path" mean?
Thanks!
Please clone the DynaForm project from GitHub instead of Google Code:
https://github.com/reinra/dynaform
The newer version builds via Maven instead of Ant, so it's simpler and should work better.
Check that you have defined ANT_HOME environment variable correctly. Refer to Ant installation instructions, if needed.

"JUnitTask was not found" error (Hudson, Ant, JUnit)

I tried several ways to install ant and junit on the same server as hudson. I eventually downloaded the Ant source, installed the optional dependencies by using the included fetch.xml file, built the source code, and dropped junit-4.8.1.jar into the lib directory where the compiled ant code [that I just built] is. Then I set ANT_HOME to the ant root directory by using the "export ANT_HOME=/usr/share/ant" command. I also set a Hudson configuration variable of "ANT_HOME" with the same value (/usr/share/ant) and I also put a new file into the /etc/profile.d directory with the export ANT_HOME command as well. At this point I'm not sure what else to try, but Hudson still gives me the error:
BUILD FAILED /var/lib/hudson/jobs/MyProject/build.xml:31: Problem:
failed to create task or type junit Cause: the class
org.apache.tools.ant.taskdefs.optional.junit.JUnitTask was not found.
This looks like one of Ant's optional components. Action: Check that the appropriate optional JAR exists in
-/usr/share/ant/lib
-/var/lib/hudson/.ant/lib
-a directory added on the command line with the -lib argument
Do not panic, this is a common problem. The commonest cause is a
missing JAR.
This is not a bug; it is a configuration problem
I did, in fact, check /usr/share/ant/lib and the class "org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.class" is located in the ant-junit jar file as I confirmed by running the command: jar tfv ant-junit.jar | grep org.apache.tools.ant.taskdefs.optional.junit.JUnitTask
Can someone please tell me what to try, I am not sure where to go from here.
If you are on Ubuntu you can simply apt-get ant; I did that and linked to the junit jar within my project.
Cheers,
Neil
It turns out that hudson itself installs some version of Ant in one of its own libraries. I suppose that somehow caused a conflict because when I got rid of it, things worked. I think it is in /var/hudson or /var/hudson/lib. That path is added to the PATH environment variable during hudson installation. So your choice is either to add your own Ant install to the BEGINNING of the path, to delete hudson's version of Ant, or to delete that part of the PATH.

Can not compile Nutch1.4 with ant

all
I'm trying to deploy Nutch1.4 to Hadoop cluster(following this page). I got some problems when compiling Nutch with ant.
problem 1
When I run ant command, I got the following error:
/home/xenserver/apache-nutch-1.4-bin/build.xml:71: invalid Date syntax in "01/25/1971 2:00 pm"
I remove attribute "datetime" from line 71 in file build.xml and run ant again. Then I got another problem.
problem 2
The error is:
/home/xenserver/apache-nutch-1.4/build.xml:412: syntax errors in ivy file: java.text.ParseException: http://java.sun.com/xml/jaxp/properties/schemaLanguage in file:/home/xenserver/apache-nutch-1.4/ivy/ivy.xml
at org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParser$Parser.parse(XmlModuleDescriptorParser.java:273)
........
What's wrong with the steps above? Is there any tutorial for compiling Nutch1.4?
Need your help.Thanks in advance.
For compiling nutch 1.4, all you have to do is run ant clean deploy from the nutch directory. The output is created in the directory named 'runtime' with 2 folders: one for local mode and other one for cluster mode.
please check the date settings and ant installation on your machine. I think that is casing the issue. Also have you tampered/ edited /home/xenserver/apache-nutch-1.4/ivy/ivy.xml ? Please check that file too.
EDIT:
There is some problem with the build file when executed on your Linux box.
Check these out: this and this.
These are the things that you should verify on your setup:
java version and ant version : dont use old ones. get the latest ones or ones that are compatible with your nutch release. FYI: for nutch-1.4 I am using apache-ant-1.8.3 and java jdk1.6.0_18. This combination works perfectly fine with me.
Check that you have installed a JDK and not a JRE
Check if your JAVA_HOME environment variable point to the JDK. System PATH variable must have $JAVA_HOME/bin and $ANT_HOME/bin appended to it. ANT_HOME variable must point to the ant installation directory.
Can you successfully run normal ant targets on any other build files ? try out with small ant build file.
Still facing the same issue, run ant command with -v option. This will provide more information about the error faced.
eg.
ant -v clean deploy

migrating ant from 1.7 to 1.8.2 issue

I have migrated Ant1.7 to 1.8.2. Getting follwing warning in my eclipse as:
The following error occurred while executing this line:
jar:file:/C:/software/apache-ant-1.8.2/lib/
ant.jar!/org/apache/tools/ant/antlib.xml:37:
Problem: failed to create task or type
componentdef
Cause: The name is undefined. Action: Check the spelling. Action:
Check that any custom tasks/
types have been declared. Action: Check that any /
declarations have
taken place.
from my build.xml importing another build xml file as:
<import file="../../../BUILD/ESW/ESWBUILD/build-utils.xml"/>
Analysis:
1)if i point to 1.7, error doesnt occur.
2) Open build.xml, modify something and save, after saving error is gone.
How can I solve above issue?
It sounds like you might have multiple versions of Ant in your classpath, and the older one is picked up first, but then it also tries to load the descriptor for 1.8.1, which will result in this sort of error. I would check the following:
Check your CLASSPATH and ensure that it is set to the newer version of ant, and does not include the older version of ant
Run ant -version and ensure it is using ant 1.8.1
Check the version of ant that eclipse is using and ensure it is using the correct path as well
If this is a grails application, and you are using an older version of grails, you may need to update it - see this question. It's possible other frameworks might have similar problems, but I'd need to know more about your application to say for certain.
If none of this solves your problem, you could try temporarily removing ant 1.7. If some component then complains that it cant find that version, then you will have to update that component to use 1.8.1 instead.
I ran into the same issue and there is a ant packaged with one of the vendor jars that I included. Removed the vendor jar and it fixed it

Resources