Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 66856 invoked from network); 15 Aug 2005 20:23:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 15 Aug 2005 20:23:42 -0000 Received: (qmail 66031 invoked by uid 500); 15 Aug 2005 20:23:39 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 65974 invoked by uid 500); 15 Aug 2005 20:23:38 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 65961 invoked by uid 99); 15 Aug 2005 20:23:38 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Aug 2005 13:23:38 -0700 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=DNS_FROM_RFC_ABUSE,DNS_FROM_RFC_POST,DNS_FROM_RFC_WHOIS X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [68.142.198.206] (HELO smtp107.sbc.mail.mud.yahoo.com) (68.142.198.206) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 15 Aug 2005 13:23:57 -0700 Received: (qmail 25055 invoked from network); 15 Aug 2005 20:23:34 -0000 Received: from unknown (HELO ?192.168.178.100?) (jwyates@pacbell.net@84.154.53.179 with plain) by smtp107.sbc.mail.mud.yahoo.com with SMTP; 15 Aug 2005 20:23:34 -0000 Mime-Version: 1.0 (Apple Message framework v733) Content-Transfer-Encoding: 7bit Message-Id: <6C4DF75F-B4C9-4FA2-B1BA-413EBFCDE58C@pacbell.net> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed To: commons-dev@jakarta.apache.org From: John Yates Subject: [daemon] classloader and jsvc Date: Mon, 15 Aug 2005 22:23:31 +0200 X-Mailer: Apple Mail (2.733) X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N I recently tracked down a NullPointerException in my jsvc loaded java application to the fact that Thread.getContextClassLoader() returning null. JAXBContext.newInstance(String contextPath) effectively is JAXBContext.newInstance(contextPath, Thread.getContextClassLoader()) and dies if the class loader is null. For my application, a fix was if (Thread.getContextClassLoader() == null) { Thread.setContextClassLoader(ClassLoader.getSystemClassLoader()); } My question: is this is bug? If so, where? Should jsvc, since it loads the application, do this for me? Should JAXB do this (it should perhaps provide more info when this happens - it took debugging to find it)? --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org