I have written a java web application(deployed on glassfish server) to deploy on to Tomcat server. I copied the project file along with build.xml to a linux system and tried
[packwolf src]$ ant
Buildfile: build.xml
BUILD FAILED
/home/packwolf/Application/src/build.xml:12: The following error occurred while executing this line:
/home/packwolf/Application/src/nbproject/build-impl.xml:22: Class org.apache.tools.ant.taskdefs.condition.Not doesn't support the nested "antversion" element.
The web application is supposed to be portable, but it isn't. Any ideas to fix this?
You need to check your ant version. It might not be the same as on your other box.
Related
My question is about deploying a project written in scala and java with springboot as backend. First I tried to build it with IDEA as .war file and put it under
my-tomcat-dir/webapps/
on my Ubuntu 18.04 server. When I run it with
sh my-tomcat-dir/bin/catalina.sh run
it just seems well, however it didn't respond to any request from my frontend application and there is no any errors log in my terminal screen. So I tried to build the project on my Ubuntu server. First I upload my project files to the server and run
sbt assembly
in the project directory, later I run
sbt package
and got a .war file. Again I put the file under
my-tomcat-dir/webapps/
and it just got the same result as before. How can I get this project built and run well under this situation? Any further information please inform me to provide, thanks!
I'm trying to deploy a java web application to Tomcat using Visual Studio Code and I'm having some issues that I'd like to share.
After installing the extension Tomcat for Java, I've tried to deploy a Maven Java Web project. To do so, I've clicked over project's folder and selected "Run on Tomcat Server" option. The result is an error with this message: The folder is not a valid web app to run on Tomcat Server.
Then, I've realized that maybe I should create a war file before running it on Tomcat. Therefore, I've executed mvn clean package command and afterwards execute "Run on Tomcat Server" option over the war file. Doing this the project has been deployed correctly.
However, compared to Eclipse's way to work with Tomcat, it seems to me a bit tedious. Particularly if I'm working with static files, like css or js, because every time I modify a file I should execute mvn clean package and "Run on Tomcat Server". Whereas, in Eclipse, these files are deployed automatically on Tomcat without restarting.
I wonder if there is another way to work with VS Code and Tomcat for Java.
Thanks!
If you use Spring, there is an easy way.
The Spring Initializr extension comes with an embedded Tomcat installation, and hot reloading works out of the box.
Rely on the following guide to install it:
https://code.visualstudio.com/docs/java/java-spring-boot
I am relatively new to Java/Maven and am attempting to build an existing Java app downloaded from SVN on my machine. The issue is when attempting to compile/package via Maven I get the following error...
org.apache.cxf.tools.common.ToolException: java.lang.RuntimeException: Resource http://testserver:8080/imp-inbound-services-1.0/common.xsd can not be read
I have built this in both NetBeans and Eclipse using JDK 1.7 on a Windows 7 machine and get the error via both. I would assume it is an issue reaching the "testserver" but other developers within the organization have no issue. I see no differences in their configurations and mine.
Am I missing some Eclipse/Maven configuration that could be causing this? Any ideas where to look or best way to troubleshoot?
You have to ask the developers where does testserver run and what starts it. It seems like a local process, so there may be a Maven goal that starts the server.
It's a Java project where we are using Java 1.5.0 but I can't find a list of javac error codes anywhere. I've tried Invalidating the Cache and restarting. I've tried Rebuilding the Project. It's a maven project so I am able to compile from the Maven panel within IntelliJ but I need to run it as a Tomcat configuration which I don't know how to do outside of IntelliJ.
Edit: in IntelliJ, you can run your project via their Run/Debug Configurations. You can set up a configuration for an app, junit, tomcat etc... this is how I've been running my project to get the error
2nd Edit: It appears that my Java 1.5 was corrupt. When I removed it from intelliJ and then tried to add it back, IntelliJ told me that it was corrupt. Also I get bus errors at the command line...
$ ~/Java\ 1.5.0/Home/bin/javac -version
bus error
$ ~/Java\ 1.5.0/Home/bin/java -version
bus error
One option is to call mvn package to create the war file and deploy it manually to an already installed tomcat.
Another option is to use the tomcat maven plugin and to call mvn tomcat:run This will run your application within an tomcat.
I use ant script to create a war file of my application. Is there a way to debug my application in eclipse?
If you are using tomcat server. Install Mongrel plug-in to your eclipse. After building ant script, just add break points to code and click on tomcat start button provided by Mongrel plug-in. Your app will be automatically running in debug mode. And Mongrel(Tomcat) automatically deploys your war file.
I am currently using the same for my projects.
If you have all the source code in Eclipse and merely use the ant script for building, you should be able to do debugging by just putting the generated war in the deploy folder of your server (or doing whatever else your server requires to deploy a war), and then simply start up your server via Eclipse.
Eclipse wouldn't 'know' that anything has been deployed to the server it has just started, but the connection between WTP's deployer and JDT's debugger is pretty weak anyway. It will simply try to match classes in the JVM to Java files in your workspace. If you have the actual source there this will of course match and you can debug.