Reading org.apache.catalina.startup.Tomcat.addWebapp(Host, String, String, String), I don't understand the following:
// prevent it from looking ( if it finds one - it'll have dup error ) ctxCfg.setDefaultWebXml("org/apache/catalin/startup/NO_DEFAULT_XML"); Why is this being used to prevent the code from seeing a web.xml in the basedir/conf? On Mon, Jun 20, 2011 at 11:31 AM, Benson Margulies <bimargul...@gmail.com> wrote: > I'm using import org.apache.catalina.startup.Tomcat to embed tomcat. > > After it is running, I'm trying to add another webapp with .addWebapp. > > The addWebapp call logs: > > 2011-06-20 11:23:23,385 ["http-bio-9167"-exec-2] INFO > org.apache.catalina.util.LifecycleBase - The start() method was called > on component [Realm[Simple]] after start() had already been called. > The second call will be ignored. > 2011-06-20 11:23:23,387 ["http-bio-9167"-exec-2] INFO > org.apache.catalina.startup.ContextConfig - No global web.xml found > > This second message is odd, since there is a global web.xml sitting in > the conf subdirectory of the pathname I passed to Tomcat.setBaseDir. > > However, this is followed in quick succession by an NPE. In > ContextConfig.java, jspServlet is null. Does it make sense that the > problem is the failure to find the global web.xml, since it would > define the jsp servlet? And, if so, why does this work for my first > webpp (defined before 'start') and not for my second? > > java.lang.NullPointerException > at > org.apache.catalina.startup.ContextConfig.convertJsp(ContextConfig.java:1360) > at > org.apache.catalina.startup.ContextConfig.convertJsps(ContextConfig.java:1339) > at > org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1330) > at > org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:881) > at > org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:316) > at > org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) > at > org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89) > at > org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5103) > at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) > at > org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:812) > at > org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:787) > at > org.apache.catalina.core.StandardHost.addChild(StandardHost.java:607) > at org.apache.catalina.startup.Tomcat.addWebapp(Tomcat.java:509) > at org.apache.catalina.startup.Tomcat.addWebapp(Tomcat.java:483) > at org.apache.catalina.startup.Tomcat.addWebapp(Tomcat.java:171) > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org