I got some issues to deploy my application.
Environment: Ubuntu 10.04, Tomcat 7.02 (Install from archive from tomcat site, not from repositories), server is run and stoped manualy, not using any IDE.
For the first I’ve created host in $CATALINA_HOME/conf/server.xml:
<Host name="java.dev"
appBase="/home/krasilich/java/"
autoDeploy="true" >
<Alias>www.java.dev</Alias>
</Host>
Then create a context in $CATALINA_HOME/conf/Catalina/java.dev/siloc.xml:
<Context docBase="siloc/web/" />
And got the error
A docBase /home/krasilich/java/siloc/web/ inside the host appBase has been specified, and will be ignored
But, if I copy manager.xml to $CATALINA_HOME/conf/Catalina/java.dev/ I can run manager app.
If I deploy my application through manager – it says that everything is going well, but I still see the 404 on java.dev:8080/siloc/
That’s all about custom host.
I’ve tried to deploy application through manager on localhost also and it works, I can see my “Hello Word” on localhost:8080/siloc/
But, if I change the text in my index.jsp it’ll not affected on frontend. The “Redeploy” button isn’t help for me.
As I mentioned manager just copy application files to webapps directory, and don’t make any changes in config files.
All I need that I can deploy application in any directory in my filesystem (actually it will be /home/krasilich/java/).
And it would be great if I can do this on custom host like java.dev
I need the answer, why the context in $CATALINA_HOME/conf/Catalina/java.dev/siloc.xml isn’t working for me, and what shall I do to make it consistent?
Thanks.
I have been able to replicate your problem.
There are 2 workaround I can suggest after tinkering around with combinations of
appBaseanddocBase. Looks like the two do not operate together.Option 1 – remove appBase
Remove the
appBasefromserver.xmland specify the full path to the web app indocBasein the$CATALINA_HOME/conf/Catalina/java.dev/siloc.xmlI assume your value will be
/home/krasilich/java/siloc/web/siloc.Note: specifying only up to the parent folder
/home/krasilich/java/siloc/web/will show you a directory listing of the parent folderOption 2 – Remove docBase
In
$CATALINA_HOME/conf/Catalina/java.dev/siloc.xmlremove the
docBaseand keep only<Context/>Tomcat infers the webapp name
silocfrom the$CATALINA_HOME/conf/Catalina/java.dev/siloc.xmland it looks for the webapp namedsilocin the appBase.This allows java.dev:8080/siloc/ to work provided you also change the
appBaseinserver.xmlto the parent folder of your webappsiloc.In response to why
managerworks, same reason – there is no docBase in the manager.xmlI am trying other combinations of docBase but any value I give throws the
So my conclusion is to remove the docBase. This is not a good idea – since the full path to parent folder is then hardcoded in server.xml.