Return-Path: X-Original-To: apmail-tomcat-dev-archive@www.apache.org Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5D7E56CE0 for ; Thu, 16 Jun 2011 18:15:20 +0000 (UTC) Received: (qmail 37229 invoked by uid 500); 16 Jun 2011 18:15:19 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 37172 invoked by uid 500); 16 Jun 2011 18:15:19 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 37162 invoked by uid 99); 16 Jun 2011 18:15:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Jun 2011 18:15:19 +0000 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of mrisaliti@libero.it designates 212.52.84.103 as permitted sender) Received: from [212.52.84.103] (HELO outrelay03.libero.it) (212.52.84.103) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Jun 2011 18:15:13 +0000 X-CTCH-Spam: Unknown X-CTCH-RefID: str=0001.0A0B020B.4DFA481B.0106,ss=1,re=0.000,fgs=0 X-libjamoibt: 1821 Received: from wmail46 (172.31.0.236) by outrelay03.libero.it (8.5.133) (authenticated as mrisaliti@libero.it) id 4DE4FF1D00526B49 for dev@tomcat.apache.org; Thu, 16 Jun 2011 20:14:51 +0200 Message-ID: <12376471.371051308248091505.JavaMail.defaultUser@defaultHost> Date: Thu, 16 Jun 2011 20:14:51 +0200 (CEST) From: "mrisaliti@libero.it" Reply-To: "mrisaliti@libero.it" To: Tomcat Developers List Subject: Re: Embedding Tomcat 7 in Apache OFBiz MIME-Version: 1.0 Content-Type: text/plain;charset="UTF-8" Content-Transfer-Encoding: 7bit X-SenderIP: 151.40.188.142 Thanks Konstantin, I'm using tomcat 7.0.14 and the code I'm migrate is actually done in this way. Anyway I will check if it's working with your suggestions and if it's negative open a bug. Marco 2011/6/16 mrisaliti@libero.it : Hi all, I'm one of the Apache OFBiz committer and I'm trying to migrate our embedded version of Tomcat 6 to 7 and I have discover a small issue when try to do this code: StandardWrapper defaultServlet = new StandardWrapper(); defaultServlet.setServletClass("org.apache.catalina.servlets.DefaultServlet"); defaultServlet.setServletName("default"); defaultServlet.setLoadOnStartup(1); defaultServlet.addInitParameter("debug", "0"); defaultServlet.addInitParameter("listing", "true"); defaultServlet.addMapping("/"); I'll receive an NullPointerException on org.apache.catalina.core. StandardWrapper.addMapping(StandardWrapper.java:755). Any hint to solve it ? 1. What exactly version of Tomcat 7.0.x ? 2. Why are you using this internal Tomcat class? What do you do with StandardWrapper later? 3. Apparently the line that fails is the following: (line numbers in the most recent Tomcat version differ from the one you are mentioning) if(parent.getState().equals(LifecycleState.STARTED)) I think it fails because parent is null. So either a) Add StandardWrapper as a child to a context. - See StandardContext#createWrapper() - See - o.a.c.startup.Tomcat#addServlet(..) (a helper class for embedding Tomcat) - o.a.c.deploy.WebXml#configureContext(..) - o.a.c.core.ApplicationContext#addServlet(String, Class) b) If you want to change Tomcat code, file an issue in Bugzilla. It should be easy to fix: do not see why not to add parent!=null check there. Though I do not know whether it will fail further down the road. The same may be said about similar code in removeMapping() method. Best regards, Konstantin Kolinko --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org