Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E34B46E3E for ; Mon, 20 Jun 2011 17:12:08 +0000 (UTC) Received: (qmail 63495 invoked by uid 500); 20 Jun 2011 17:12:05 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 63360 invoked by uid 500); 20 Jun 2011 17:12:05 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 63351 invoked by uid 99); 20 Jun 2011 17:12:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Jun 2011 17:12:05 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of bimargulies@gmail.com designates 209.85.214.45 as permitted sender) Received: from [209.85.214.45] (HELO mail-bw0-f45.google.com) (209.85.214.45) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Jun 2011 17:12:00 +0000 Received: by bwz16 with SMTP id 16so1672066bwz.18 for ; Mon, 20 Jun 2011 10:11:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=7n76QWc2muwEq3pB++v2EulptYOkvvko2PEjkfNj0Po=; b=r1bZ1s1Nlc9gdkpjl0I0OaQrtvSYLGu5cSYK29Ca5X3GH+ZG/90awLksF2ijarw4OF P8NKcuM1OJGtpKyZ+tfQI3/D/VfWqujCTIBBf50zCccWJUSkzO81rHKyg3tViWas0QGb wBr9xUzShXVuFi8WkgJXmqXQ7SpOD6yg1RXU4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=Kes7C1Fs1ZDoxneHiXtZDZ6Ev23XPN4WPCn5Pggv2G1ei4ktafOBuy2KiDb0JGTnB7 DRPPEOOLcwoGAndexZoxNktLOiTv9kZGtLXKRxuJ/FVDT/iUUwlI3Yog0v9hvH3xXZUN EigWq14r4N7sL6rszTFJ7Kt7o15g4fno/V/E4= MIME-Version: 1.0 Received: by 10.204.11.22 with SMTP id r22mr673483bkr.172.1308589898736; Mon, 20 Jun 2011 10:11:38 -0700 (PDT) Received: by 10.204.58.207 with HTTP; Mon, 20 Jun 2011 10:11:38 -0700 (PDT) In-Reply-To: <4DFF7BBC.8080503@kippdata.de> References: <4DFF7BBC.8080503@kippdata.de> Date: Mon, 20 Jun 2011 13:11:38 -0400 Message-ID: Subject: Re: Adding a webapp via the API to a running instance From: Benson Margulies To: Tomcat Users List Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Ranier, I don't have a problem executing jsps. I have a problem configuring a webapp with entire servlets defined by jsps. My code works perfectly fine launching another webapp with jsps in it which are not declared in elements. --benson On Mon, Jun 20, 2011 at 12:56 PM, Rainer Jung wro= te: > Hi Benson, > > On 20.06.2011 17:51, Benson Margulies wrote: >> Reading org.apache.catalina.startup.Tomcat.addWebapp(Host, String, >> String, String), I don't understand the following: >> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 // prevent it from looking ( if it finds one= - it'll have dup error ) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 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? > > I'd say it is not. > > Have a look at ourr test suite. It uses the jsp servlet without > programmatically configuring. I'm pretty sure it comes from the global > web.xml. The test suite also logs > > ... org.apache.catalina.startup.ContextConfig webConfig > ... INFO: No global web.xml found > > but that doesn't keep it from executing JSPs. > > For instance TestAbstractHttp11Processor deploys test/webapp-3.0 and > calls /echo-params.jsp. The basics are in TomcatBaseTest. > > So I'd say there's something wrong in your setup. > HTH. > > Rainer > >> On Mon, Jun 20, 2011 at 11:31 AM, Benson Margulies >> 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 >>> =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.apache.catalina.startup.ContextConfig= .convertJsp(ContextConfig.java:1360) >>> =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.apache.catalina.startup.ContextConfig= .convertJsps(ContextConfig.java:1339) >>> =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.apache.catalina.startup.ContextConfig= .webConfig(ContextConfig.java:1330) >>> =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.apache.catalina.startup.ContextConfig= .configureStart(ContextConfig.java:881) >>> =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.apache.catalina.startup.ContextConfig= .lifecycleEvent(ContextConfig.java:316) >>> =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.apache.catalina.util.LifecycleSupport= .fireLifecycleEvent(LifecycleSupport.java:119) >>> =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.apache.catalina.util.LifecycleBase.fi= reLifecycleEvent(LifecycleBase.java:89) >>> =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.apache.catalina.core.StandardContext.= startInternal(StandardContext.java:5103) >>> =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.apache.catalina.util.LifecycleBase.st= art(LifecycleBase.java:145) >>> =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.apache.catalina.core.ContainerBase.ad= dChildInternal(ContainerBase.java:812) >>> =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.apache.catalina.core.ContainerBase.ad= dChild(ContainerBase.java:787) >>> =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.apache.catalina.core.StandardHost.add= Child(StandardHost.java:607) >>> =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.apache.catalina.startup.Tomcat.addWeb= app(Tomcat.java:509) >>> =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.apache.catalina.startup.Tomcat.addWeb= app(Tomcat.java:483) >>> =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.apache.catalina.startup.Tomcat.addWeb= app(Tomcat.java:171) > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > For additional commands, e-mail: users-help@tomcat.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org