Tomcat Web Application Manager Not Listing Deployed App - java

I uploaded myapp.war file to server using Tomcat Web Application Manager
It upload myapp.war file but does not list in List of application.
myapp.war file and myapp (unzipped folder) is inside wepapps folder but also not listed in Application list. It only shows the default applications only.
Then i tried to upload again the same file and got error file already exists.
Why is it not listing the app though it is deployed?

Had the same issue. Even though tomcat manager says app is deployed successfully, you might be able to find the relevant issues in the catalina log.
<tomcat_home>/logs/catalina.xxxx-xx-xx.log

Related

can't see website after deploying a .war file to tomcat

I have created a java web application and created the file thymeleaf.war to deploy it on a tomcat server.
I access the tomcat manager using www.lux-systems.com/manager/html and have uploaded the thymeleaf.war file on this page.
Now i can see /thymeleaf in the application list, but when i click on that link (www.lux-systems.com/thymeleaf) I only see the directory listing instead of the web-page I want to see.
The problem is that I can't find the url to the working web page, and I am wondering why www.lux-systems.com/thymeleaf is only showing the directory listing.

Save files into deployed application folder with Openshift

I have an Java web application that uploads images and saves in a specific folder into main application folder:
- MyApplication
-- WEB-INF
-- META-INF
-- img_tmp
-- index.xhtml
...
My application saves images into img_tmp folder and the web pages get its. I'm using the getRealPath() method to get the root directory in local environment and it's working, but I've tried using the same method in Openshift environment and it doesn't work because I'm using WAR archives to deploy the application.
The question is: where Openshift unzips the WAR file and how can I access it? (OR) Is there an other way to deploy application in Openshift without using WAR files?
Thanks
In openshift you only can save files in a directory that is in an envirioment variable called $OPENSHIFT_DATA_DIR
And you can acess this value by
System.getenv("OPENSHIFT_DATA_DIR");
Heres a link to the openshift info about envirioment variables
https://developers.openshift.com/en/managing-environment-variables.html#directory-variables
Hope that helps.

Tomcat 404 for a folder in webapps

I have a folder called attachments in my webapps folder in my Apache Tomcat directory, in which I need to save some files and images. When I'm giving the local path i.e. in C:/ the files needed are being saved in the correct location.
However I need to load these images from the server at runtime so I'm trying to access the image by the localhost url /attachments/img.png. The image is not being found (404 error).
I tried opening Tomcat's manager to see if attachments is listed. It is there however when I click it a 404 error is being thrown too. Other deployed web applications are being found.
What could be the cause of this?
You cannot just create a folder in $CATALINA_HOME/webapps like this and access it from web browser.
webapps folder is supposed to be home for all web applications with proper J2EE web app like directory structure e.g. WEB-INF/web.xml, WEB-INF/classes, WEB-INF/lib, META-INF etc.
Read more about Web Application Directory Stricture

Deploy a .rar on cloudfoundry using eclipse plugin

I am currently using the cloudfoundry eclipse plugin to deploy my JSP/Servlet web application. My application is now using a Db (Sqlite). However I am having problem deploying the sqlitejdbc.rar to cloudfoundry (all i do to update the application is right click on my application under VMware Cloud-foundry server and select update. But that doesn't seem to work and i get an exception saying that it cant find the rar file.
In my local system i simply paste the sqlitejdb.rar to the lib directory of Tomcat and when i run the webapp locally it works
If you place the sqlitejdbc.rar file into your lib directory (inside your WEB-INF directory) that should get deployed as part of your application into cloudfoundry and become accessible.
You can also try to deploy your app using vmc push to see what errors you get from vmc.
I also recommend looking at the log files on cloudfoundry.com

new File not found in Webcontent. Need to refresh

Hello i have a java backend running on tomcat. java creates a .txt File that is saved locally in the Webcontent Folder. But the file is not found on the client side, altought it exists on the Webserver. After a refresh of my java workspace the file is found. Is there a way to tell tomcat to refresh / redeploy using java?
greetings!
Tomcat does not see your WebContents folder, but a copy create by the Tomcat server connector. Refreshing updates the copy.
What generates the .txt file? A separate program or code embedded in your web application?
There are a number of cases where the app would have to generate the file to be immediately available to the browser. For example, an image upload window. When the server creates the file from within WTP, it will have to also create the file at the published location where Tomcat is expected to pick it up. Open the server properties, tomcat arguments, catalina root parameter to find out where this location is. When the application is deployed this functionality will need to be disabled, of course.

Categories

Resources