Fail to start application after deploy to tomcat - java

I have a linux vps, i had installed tomcat 9 and everything are working fine. But after i had deployed a Java Spring MVC war file to tomcat (let's call it example.war), when i pressed "start", it showed a message: FAIL - Application at context path [/example] could not be started (i used the tomcat manager). My Java Spring project used to be deployed by tomcat 7 plugin on my home computer.

java.lang.ClassNotFoundException: org.springframework.web.filter.CharacterEncodingFilter
Basically means that there is no class available in the classpath of your application.
This class is a part of jar spring-web-<YOUR_VERSION_OF_SPRING>.jar
So first open up your WAR file and check whether its in WEB-INF/lib folder.
If it isn't the changes are that it was deployed into the lib folder of tomcat 7 (that works) and in tomcat 9 both on your linux machine and development PC there is no jar like this.

Related

Run war file on localhost without having tomcat installed

Is there any way to run a war file on localhost without having the need to have tomcat installed on the machine? I have built a web application using gradle, spring and tomcat and I would like to be able to send the project as a war file to someone else and have them run it, even if they don't have tomcat installed.
Make it a runnable jar which contains tomcat inside. And then start the application with:
java -jar myWebApplication.jar
https://www.baeldung.com/deployable-fat-jar-spring-boot

How to start tomcat server outside netbeans IDE

I have created an application in Java EE, I have learned how to deploy it in the tomcat server using the manager app or by copying the war file to the webapps folder. Now I can start the tomcat server only from the Netbeans IDE.
I want to know how to start the apache tomcat server without using the IDE and run my web application from the war file deployed. If I'm headed in the wrong direction please correct me. I'm asking this to gain knowledge of how to deploy the .war file in another server system without using the IDE only the tomcat server.
The shell scripts located in "CATALINA_HOME/bin" are the most bare-bones way of getting Tomcat up and running. The two scripts capable of starting Tomcat in this directory are named "catalina" and "startup", with extensions that vary by platform.
In your tomcat installation directory, there would be a startup.bat/sh file which will start the server for you. Moreover you can see the conf folder as well if you want to change any configurations. Whatever war you copy to the webapps folder will be automatically deployed

Install Application on Tomcat7

I wrote a Java Application in IntelliJ Idea 13 and can start this application on a Tomcat 7 server. Now I want to test the application on a Windows XP pc. So I installed Tomcat 7 and XAMPP(for database) on the Windows XP pc. I got some files in my .../target folder like "projectname-SNAPSHOT" folder, "projectname.war", "generated-sources" folder and so on. So do I have to put all these files to my Windows XP pc into the webapp folder from Tomcat and start Tomcat? When I try it this way, I can't open the application when I go to "localhost:8080".
What files are missing to start the Application? Or do I have to compile all the java files again on the XP pc?
If things are built correctly and there are no external dependences (such as a database JDNI resource), you should be able to put "projectname.war" in the /webapps folder, start tomcat, and then browse to http://localhost:8080/projectname.
projectname.war should be sufficient in your "webapps" folder for most cases. Tomcat should deploy this automatically.
See: How to deploy a war file in Tomcat 7 for more information

Tomcat: java.io.IOException : Destination "xxx" directory cannot be created"

I would like to do projects backup from one location to another location in network.this sample application has been written in struts.
This was achieved by using org.apache.commons.io.FileUtils.
My problem here is, when I ran this application in netbeans 6.9 IDE tomcat server its working fine, but when I tried to run this application in apache tomcat 7.0 server by deploying this application WAR file, I get exception like
java.io.IOException : Destination "xxx" directory cannot be created"
this destination path is another machine in our local network.
I assume some kind of netbeans IDE options which are enabling tomcat server to copy folder to a destination directory when I ran it in netbeans tomcat.
where as, if I run this application in tomcat server some kind of tomcat file permissions are blocking.
Both source and destination are shared folders.
You will have to setup a permission (in your case File Permission) for your webapplication as Tomcat runs a Security Manager, for security precautions. See here for configuration.

Glassfish v2.1.1 and java-web-start

I've started a job that uses Glassfish 2.1.1 app server and noticed there's a java-web-start directory under the domain1 folder. In That folder there are empty directories which correspond 1:1 with ear (and other files) files deployed under ....\domain1\applications\j2ee-apps.
What is the purpose of the java-web-start folder and why does it have those empty directories in it?
New to Glassfish.
TIA
Glassfish allows the user to launch a local client which can access the application inside Glassfish directly. The launching happens with Java WebStart.
See http://java.sun.com/developer/technicalArticles/J2EE/jws-glassfish/ for an introduction.

Categories