tomcat7 - External web app location does not create directory under webapps in Tomcat -
so far have been using tomcat 6 specify war deployed in context.xml file under $catalina_home/conf/catalina/localhost application1-context.xml, application2-context.xml. etc.
example application1-context.xml
<context path="/myapps/app1" docbase="c:\warfiles\appone.war" debug="0" privileged="true"> <loader classname="mycustomapplicationloader"/> <logger classname="org.apache.catalina.logger.systemoutlogger" verbosity="4" timestamp="true"/> </context>
this create folder myapps#app1 under $catalina_home/webapps folder.
but since migrating tomcat7, not happen more. unless have war file "appone.war" directly under tomcat appbase directory i.e. $catalina_home/webapps war not unpacked folder under $catalina_home/webapps directory.
i have read apache bug report: https://issues.apache.org/bugzilla/show_bug.cgi?id=51294"%3b>%3b51294<%3b/a>%3b
question: there way can force behavior in tomcat 7?
it sounds issue has been fixed in tomcat version 7.0.48 which, @ time of writing, still in development. it's been added version 8.
edit: have managed resolve without having wait for/use 7.0.48. in context.xml file add unpackwar="false"
, specify virtualclasspath
attribute points target\classes folder so:
<?xml version="1.0" encoding="utf-8"?> <context docbase="(path .war file)"> <loader classname="org.apache.catalina.loader.virtualwebapploader" virtualclasspath="(path folder contain .class files, {project folder}\target\classes\)" searchexternalfirst="true" unpackwar="false" /> </context>
searchexternalfirst
means class loader invirtualclasspath
folder before looking in web-inf directory.unpackwar
set false because war file exploded in /target/classes folder there's no need tomcat well.
hopefully helps too.
Comments
Post a Comment