0

I have tomcat7 packages installed as follows

[root@mongos lib]# yum list installed | grep tomcat7
tomcat7.noarch          7.0.39-1.jpp6   @eng-support-jpackage                   
tomcat7-admin-webapps.noarch
tomcat7-el-2.2-api.noarch
tomcat7-jsp-2.2-api.noarch
tomcat7-lib.noarch      7.0.39-1.jpp6   @eng-support-jpackage                   
tomcat7-servlet-3.0-api.noarch

and enabled the manager web app.

It is my understanding that tomcat7-servlet-3.0-api provides the needed Servlet 3.0 API for Java web apps.

Now when i deploy a war file using the manager app, tomcat cannot find the WebApplicationInitializer class which was introduced in Servlet 3.0 api that does away with the need of a web.xml file inside the war file.

Now i believe there is a problem in the tomcat7 setup.

To confirm my claim, i did the following.

If the same war file is deployed on a standalone tomcat7 downloaded from http://tomcat.apache.org, the application works fine.

Is anyone familiar on correct setup of tomcat7 on CentOS?

Thank you.

0

The following bits of information helped me resolve the issue.

/etc/sysconfig/tomcat7

Ensure all the variables are accurate. Especially JAVA_HOME & CATALINA_HOME.

Ownership of folders for tomcat user

Ensure tomcat ownership for /var/log/tomcat7, /var/lib/tomcat7/webapps & /var/cache/tomcat7 In most cases, this should have been correct by the installation but could be in a weird state due to tomcat6 & tomcat7 multiple install.

Correct Home folder for tomcat user

The RPM based installation runs tomcat7 under the tomcat user. I had a previous installation of tomcat ( v6 ) and the user's home directory was set to ( /usr/share/tomcat6 ). Upon install of tomcat7 and un-install of tomcat6 the correct folder was not set ( /usr/share/tomcat7 ). This caused the lib folder under /usr/share/tomcat7 to be not found causing problems loading my webapp. You need to edit /etc/passwd file and make tomcat user have the correct home directory.

YMMV

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.