NetBeans Forums
| View previous topic :: View next topic |
| Author |
Message |
99sono
Joined: 26 Oct 2011 Posts: 1 Location: Portugal
|
Posted: Wed Oct 26, 2011 4:29 pm Post subject: Netbeans Project To Hudson / Jenkins - Do Compile Failure |
|
|
Hello,
For a dynamic web application (generates a WAR file), I am having some trouble executing an the build command: "ant dist".
(A) In the Netbeans environment, this target executes successfully and deploys the application to a tomcat app server.
(B) In the machine running Jenkins this command fails in the -do-compile the.
The step is
<webproject2:javac destdir="${build.classes.dir}" gensrcdir="${build.generated.sources.dir}"/>
The errors are such as:
(a) error: package javax.servlet.http does not exist
[javac] import javax.servlet.http.HttpSession;
(b) error: cannot find symbol
[javac] private ValueExpression lang;
Basically, it seems that all the jars, project dependencies, and so on, that can be found inside project's ./lib/ ../projecnames/dist/ folders are being ignored.
I would like know what sort of task the webproject2:javac is.
How I can tune its classpath without touching netbeans generated code.
I have tried setting the CLASSPATH global variable with the necessary jar paths, but this task keeps on failing.
It seems that the do-compile task that I mentioned is compiling an awful large amount of classes without having any explicit classpath attribute defined.
Originally, I loaded the Netbeans project into jenkins using Netbeans to create the project.
Any help would be appreciated.
Should I just forget about the Netbeans ant file and right a custom ant file to compile the web project? |
|
| Back to top |
|
 |
a4fingers
Joined: 11 Nov 2011 Posts: 1
|
Posted: Fri Nov 11, 2011 3:12 pm Post subject: |
|
|
This also happened to me but using another CI server called Bamboo. At this point I am assuming you have set up the correct J2EE server home path e.g.
| Quote: | | -Dj2ee.server.home='C:\Program Files\Apache Software Foundation\Tomcat' |
To find out what is happening you can increase the level of logging to verbose by adding a line to the -pre-init target in the build.xml file:
| Code: | <target name="-pre-init">
<record name="build.log" loglevel="verbose" append="false"/>
</target> |
In the build.log file you can search for "-do-compile" which is responsible for compiling the source files. You can then skip some lines until you reach a line saying:
| Quote: | | [javac] Using modern compiler |
For me the lines that followed showed what the problem was:
| Quote: | dropping E:\Program Files\Apache Software Foundation\Tomcat 6.0.18'\lib\annotations-api.jar from path as it doesn't exist
dropping E:\Program Files\Apache Software Foundation\Tomcat 6.0.18'\lib\catalina-ant.jar from path as it doesn't exist
dropping E:\Program Files\Apache Software Foundation\Tomcat 6.0.18'\lib\catalina-ha.jar from path as it doesn't exist
dropping E:\Program Files\Apache Software Foundation\Tomcat 6.0.18'\lib\catalina-tribes.jar from path as it doesn't exist
dropping E:\Program Files\Apache Software Foundation\Tomcat 6.0.18'\lib\catalina.jar from path as it doesn't exist
dropping E:\Program Files\Apache Software Foundation\Tomcat 6.0.18'\lib\el-api.jar from path as it doesn't exist
dropping E:\Program Files\Apache Software Foundation\Tomcat 6.0.18'\lib\jasper-el.jar from path as it doesn't exist
dropping E:\Program Files\Apache Software Foundation\Tomcat 6.0.18'\lib\jasper.jar from path as it doesn't exist
dropping E:\Program Files\Apache Software Foundation\Tomcat 6.0.18'\lib\jsp-api.jar from path as it doesn't exist
dropping E:\Program Files\Apache Software Foundation\Tomcat 6.0.18'\lib\servlet-api.jar from path as it doesn't exist
... |
Even though I had specified the C drive it was still using the E drive where ANT was running from. Moving the J2EE home directory to the E drive and using a path that didn’t have any spaces ensured the lib files were being detected and were no longer being dropped.
Hope that helps |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|