Reputation: 1208
We have two web applications developed using Spring and Hibernate. We have deployed these two applications on Tomcat 7. Sometimes these applications are running fine if we don't access both applications. Sometimes it is giving some exceptions if the both the applications are accessed at the same time.
Ex: java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser
.
Whichever the application we have accessed first works fine but second one doesn't work.
We are sure that we can run n
number of applications on server.
Upvotes: 1
Views: 976
Reputation: 37896
Answering your actual question,
Is it possible to run multiple web application on the same port in tomcat 7?
Yes, it is. Tomcat can run multiple web applications on a single port. The default Tomcat port number is 8080.
java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser
Something else is causing this error.
Upvotes: 1
Reputation: 2120
Multiple web applications running on the tomcat, on the same port will not create problem unless and until each others context-path is overridden.
From the exception it is clear that one of the web-application is not correctly configured to access the required jar. You can copy the required jars to Tomcat/libs, e.g on windows the path is "C:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0\lib".
Jars in $Tomcat/lib directory are visible to all the deployed web-apps. Reference: Difference between keeping jar files in WAR and Tomcat lib folder
Feel free to comment out for further help.
Upvotes: 0