- This topic has 3 replies, 2 voices, and was last updated 19 years, 8 months ago by
Scott Anderson.
-
AuthorPosts
-
java_user_hereMemberHi,
This is a bit lengthy post. Kindly spare your time and give me your suggestions.I have a J2EE web project named med1 with web-context specified as /med/app. While deploying this application to Tomcat when I select the server as Tomcat4, I could see the deploy location as INVALID. Hence I choose externally launched and specify the deployment location as h:/tomcat_4/webapps/medmed1. It does get deployed successfully to the server.
Now when I try to launch my application with the web-context as http://localhost:8887/med/app/myjsp.jsp I could only see a 404 status returned by Tomcat. While if I access the application with http://localhost:8887/medmed1/myjsp.jsp it works fine (Kindly note medmed1 is the folder I have chosen while deploying to tomcat).
Now when I change my web-context to a single word as medapplication and after deploying, I am able to access the application with http://localhost:8887/medapplication/med.jsp
My query is, why is that if the web-context has more than one word separated with /, I’m not able to access the application with web-context name specified for the J2EE project, rather the application is accessible only through the folder name I had specified while deploying. If I wanted to access the application with the web context name what I should do?
Thanks in advance for your suggestions.
Regards,
Sun.
Scott AndersonParticipantSun,
My query is, why is that if the web-context has more than one word separated with /, I’m not able to access the application with web-context name specified for the J2EE project, rather the application is accessible only through the folder name I had specified while deploying.
It doesn’t work because the deployment location really is INVALID for automatic deployment. That’s why the deployer won’t allow you to do it. We’re protecting you from a configuration that won’t work “out of the box”, as you’ve discovered.
If I wanted to access the application with the web context name what I should do?
You’ll need to manually modify the external Tomcat server’s server.xml configuration to add a specific context root if you’re determined to deploy to a subdirectory. For that, please see the Tomcat documentation at Apache.
java_user_hereMemberIf I wanted to access the application with the web context name what I should do?
You’ll need to manually modify the external Tomcat server’s server.xml configuration to add a specific context root if you’re determined to deploy to a subdirectory. For that, please see the Tomcat documentation at Apache.
Scott,
For successfully deployed application (with valid context root) My eclipse is not writing to tomcat’s server.xml file the doc base and the context root? Then how is MyEclipse able to access and invoke the application with the context root we have specified in the web-context properties of new web project deploymnet wizard??Regards,
Sundar.
Scott AndersonParticipantMy eclipse is not writing to tomcat’s server.xml file the doc base and the context root?
Correct. We *do not* modify any configuration file on any server we support. Our connectors simply take advantage of the default loading and launching that the servers support.
Then how is MyEclipse able to access and invoke the application with the context root we have specified in the web-context properties of new web project deploymnet wizard??
Tomcat will automatically respect deployments that are exploded war directories located in the autodeploy directory and load them with a context root that is the same as their directory name. So, we just supply the correct directory name, as you requested. However, Tomcat will *not* load an application that is not in exploded war format, such as the one you’re trying to supply since it is two-levels deep. Again, to do what you seem to want, you’ll have to manually configure Tomcat by modifying the server.xml file yourself. However, you could always just test with the default configuration and then deploy two levels down, with a customized Tomcat, for production.
-
AuthorPosts