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

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.

Related

how to deploy a war File on Respberry Pie(Rip)?

I am trying to deploy a war file on RPI which is an Linux device in webapps folder of tomcat 7 director.
When I am running this application I am getting
requested resources not not available
If I am running same war file on my windows tomcat 7 server then it is working fine.
Can you please help me how to deploy war file on Rpi device
You need to provide more information from the tomcat logs. The message is telling you that the web application is trying to use a resource that is not available on your Rpi. Look at the tomcat log, it should provide more details.
You need to know what resources your web app requires, database, thread pools, etc. When you deploy the war, do probably see error logs in the tomcat logs, that should help you figure out what the missing resource is.

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

GWT Upload file

I use this http://code.google.com/p/gwtupload/ to upload files to my app. But I have problem when I want save file out of my app in other folder in Tomcat. (for example my app's name is MyApp but I want save files in folder Data on the same Tomcat server). Can someone know why I can't do that ?
Is it what you are looking for ??
Tomcat home directory or Catalina directory is stored at the Java System Property environment. If the Java web application is deployed into Tomcat web server, we can get the Tomcat directory with the following command
System.getProperty("catalina.base");

Debugging java web application with secondary tomcat folder serving static content

I have a java web application which I can debug using IntelliJ or Eclipse through a local machine tomcat 7 configuration (localhost:8080/javaapp)
I was hoping to be able to reference static content not part of the java application - installed locally at /staticapp. However, IntelliJ launches tomcat with only the java application available, the other application is not launched or serving the files.
Is there a way to configure tomcat so that either:
- the /staticapp is also started when the /javaapp is launched so it may be accessed from /javapp pages
- tomcat will always serve the static content from the /staticapp folder while running... the staticapp folder tree is not a real "web application", it only contains folders with javascript/css/images
Thanks
In eclipse, open you Tomcat server settings and go to the "Server Locations" option. Choose "Use Tomcat installation".
Next, change the deploy path to Tomcat's (original) /webapps folder, instead of the eclipse setting wtpwebapps.
Add your static app manually (folder or .war file) or though eclipse to the webapps folder, then when you publish your "javaapp" Tomcat should start each web application in its deploy path.

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