This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I'm new at this so please forgive...I don't know if I have a Struts issue, or a Tomcat issue.
In trying to learn Struts, I've coded several "StrutsLoginDemo" apps, including the one on this site. I can get them to run on my personal instance of Tomcat running on my PC. But I can't get them to run on my department's internal development Tomcat server.
On this server, there are two folders in webapps: "example" and "ROOT". I was told to place my app in "example", and it would be immediatly available to run. I don't have administrator rights to this instance of Tomcat, so modifying server.xml or shutting down and restarting Tomcat are not options for me.
There are a lot of objects (tlds, jars, jsps, classes, & bmps) in my application, so I don't want to just dump them in the "example" folder...so when I deploy my app, it creates a folder in "example"...call it "MyApp". Inside "MyApp" is my "WEB-INF" folder containing "classes" and "lib" folders.
At first, MyApp couldn't find my tlds (it was looking in "example/WEB-INF"), but I changed my <taglib> statments to fix this problem. But now, I'm getting the dreaded "Cannot find ActionMappings or ActionFormBeans collection" error when I try to start the app.
Isn't there a way to tell Tomcat that for MyApp, its root is "MyApp", and ALL folder references are based off this?
A struts web application needs to run as it's own application. Just dropping the resources into another web application isn't going to work. If you want to run your Struts application on the department's server, you're going to have to get permission to copy the war file to the webapps folder.
Thanks Merrill...I tried putting the WAR file in "example"...didn't work. I'll give your suggestion a shot.
By the way, when I do this, will Tomcat need to be restarted for the app to work? [ April 06, 2006: Message edited by: Chuck Minarik ]
Joined: Feb 15, 2005
It depends on how Tomcat is configured. Most of the time in a development environment, Tomcat is configured to auto-deploy new applications placed in the webapps folder. However, in production environments sometimes this feature is turned off.
Since you say this is a development server, most likely the auto-deploy is turned on, so you probably won't have to restart the server.
Joined: Apr 06, 2006
I'm guessing from these settings that Tomcat would have to be bounced...right?
Joined: Feb 15, 2005
The settings you posted have to do with the example application, and have nothing to do with whether or not the server is set to auto-deploy.
The setting you're looking for is in a file named server.xml in the <Tomcat Root>/conf folder.
Give up on putting your struts app inside the example folder. It isn't going to work. The example app is a separate web application, and as I mentioned before, a struts app will not run inside another web app. The only way for you to run your app on this server is to copy the war file to the <tomcat root>/webapps folder.