Re: WebappClassLoaderBase error when upgrading Tomcat 8 to 8.5
Confirmed that running 8.5.34 resolves the issue. I'll have no choice but to run this version until the issue is resolved, or a workaround is found. Thanks all! On Mon, May 1, 2023 at 2:46 PM Jeremy Nguyen wrote: > I noticed this change was introduced: > https://bz.apache.org/bugzilla/show_bug.cgi?id=62868 > > https://github.com/apache/tomcat/blame/8.5.x/java/org/apache/catalina/loader/WebappClassLoaderBase.java#L1122 > > I'll try running 8.5.34 and report back. > > Jeremy > > > > On Mon, May 1, 2023 at 2:12 PM Rob Sargent wrote: > >> >> >> On 5/1/23 14:36, Christopher Schultz wrote: >> > Jeremy, >> > >> > On 5/1/23 14:22, Jeremy Nguyen wrote: >> >> I'm trying to upgrade Tomcat 8 to 8.5 and I'm getting a >> >> nullpointerexception within >> >> WebappClassLoaderBase.CombinedEnumeration.inc. >> >> It seems to occur when it's trying to initialize commons-logging >> >> LogFactory >> >> for any class specified in Web.xml, and it's calling >> >> getResources("commons-logging.properties") which I never had. Is it >> >> required in 8.5? Even if I put it in conf/, it's not being picked up. >> >> >> >> We're running Tomcat using a wrapper and it's erroring out here: >> >> >> https://github.com/CodeGerm/osgi-server/blob/master/plugins/org.cg.dao.webcontainer/src/org/cg/dao/webcontainer/tomcat/TomcatWrapper.java#L185 >> >> >> >> >> >> I posted my web.xml and error trace here as well: >> >> >> https://stackoverflow.com/questions/76139108/web-xml-configuration-is-broken-when-upgrading-to-tomcat-8-5-and-spring-5-1 >> >> >> > >> > I have no idea how this is throwing an NPE. The only pointer being >> > dereferenced by the inc() method is "sources": >> > >> > 2773private boolean inc() { >> > 2774while (index < sources.length) { >> > 2775if (sources[index].hasMoreElements()) { >> > 2776return true; >> > 2777} >> > 2778index++; >> > 2779} >> > 2780return false; >> > 2781} >> > >> > That member (sources) is instantiated in the one-and-only-one >> > constructor: >> > >> > CombinedEnumeration(Enumeration enum1, Enumeration >> > enum2) { >> > @SuppressWarnings("unchecked") >> > Enumeration[] sources = new Enumeration[] { enum1, >> > enum2 }; >> > this.sources = sources; >> > } >> > >> > Also weird is that this throws NPE on line 2775 and not 2774. I can't >> > explain how line 2775 could throw an NPE if line 2774 did not. >> > >> > >:/ >> >> Is the null pointer in the index'th position of source, not source itself? >> >> > >> > I use Tomcat 8.5.x and I have never had a commons-logging.properties >> > file, and I use some components which are surely causing >> > commons-logging LogFactory to initialize, and I've never seen this >> > problem before. >> > >> > -chris >> > >> > - >> > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org >> > For additional commands, e-mail: users-h...@tomcat.apache.org >> > >> >> >> - >> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org >> For additional commands, e-mail: users-h...@tomcat.apache.org >> >>
Re: WebappClassLoaderBase error when upgrading Tomcat 8 to 8.5
I noticed this change was introduced: https://bz.apache.org/bugzilla/show_bug.cgi?id=62868 https://github.com/apache/tomcat/blame/8.5.x/java/org/apache/catalina/loader/WebappClassLoaderBase.java#L1122 I'll try running 8.5.34 and report back. Jeremy On Mon, May 1, 2023 at 2:12 PM Rob Sargent wrote: > > > On 5/1/23 14:36, Christopher Schultz wrote: > > Jeremy, > > > > On 5/1/23 14:22, Jeremy Nguyen wrote: > >> I'm trying to upgrade Tomcat 8 to 8.5 and I'm getting a > >> nullpointerexception within > >> WebappClassLoaderBase.CombinedEnumeration.inc. > >> It seems to occur when it's trying to initialize commons-logging > >> LogFactory > >> for any class specified in Web.xml, and it's calling > >> getResources("commons-logging.properties") which I never had. Is it > >> required in 8.5? Even if I put it in conf/, it's not being picked up. > >> > >> We're running Tomcat using a wrapper and it's erroring out here: > >> > https://github.com/CodeGerm/osgi-server/blob/master/plugins/org.cg.dao.webcontainer/src/org/cg/dao/webcontainer/tomcat/TomcatWrapper.java#L185 > >> > >> > >> I posted my web.xml and error trace here as well: > >> > https://stackoverflow.com/questions/76139108/web-xml-configuration-is-broken-when-upgrading-to-tomcat-8-5-and-spring-5-1 > >> > > > > I have no idea how this is throwing an NPE. The only pointer being > > dereferenced by the inc() method is "sources": > > > > 2773private boolean inc() { > > 2774while (index < sources.length) { > > 2775if (sources[index].hasMoreElements()) { > > 2776return true; > > 2777} > > 2778index++; > > 2779} > > 2780return false; > > 2781} > > > > That member (sources) is instantiated in the one-and-only-one > > constructor: > > > > CombinedEnumeration(Enumeration enum1, Enumeration > > enum2) { > > @SuppressWarnings("unchecked") > > Enumeration[] sources = new Enumeration[] { enum1, > > enum2 }; > > this.sources = sources; > > } > > > > Also weird is that this throws NPE on line 2775 and not 2774. I can't > > explain how line 2775 could throw an NPE if line 2774 did not. > > > > >:/ > > Is the null pointer in the index'th position of source, not source itself? > > > > > I use Tomcat 8.5.x and I have never had a commons-logging.properties > > file, and I use some components which are surely causing > > commons-logging LogFactory to initialize, and I've never seen this > > problem before. > > > > -chris > > > > - > > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > > For additional commands, e-mail: users-h...@tomcat.apache.org > > > > > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > >
Re: WebappClassLoaderBase error when upgrading Tomcat 8 to 8.5
On 5/1/23 14:36, Christopher Schultz wrote: Jeremy, On 5/1/23 14:22, Jeremy Nguyen wrote: I'm trying to upgrade Tomcat 8 to 8.5 and I'm getting a nullpointerexception within WebappClassLoaderBase.CombinedEnumeration.inc. It seems to occur when it's trying to initialize commons-logging LogFactory for any class specified in Web.xml, and it's calling getResources("commons-logging.properties") which I never had. Is it required in 8.5? Even if I put it in conf/, it's not being picked up. We're running Tomcat using a wrapper and it's erroring out here: https://github.com/CodeGerm/osgi-server/blob/master/plugins/org.cg.dao.webcontainer/src/org/cg/dao/webcontainer/tomcat/TomcatWrapper.java#L185 I posted my web.xml and error trace here as well: https://stackoverflow.com/questions/76139108/web-xml-configuration-is-broken-when-upgrading-to-tomcat-8-5-and-spring-5-1 I have no idea how this is throwing an NPE. The only pointer being dereferenced by the inc() method is "sources": 2773 private boolean inc() { 2774 while (index < sources.length) { 2775 if (sources[index].hasMoreElements()) { 2776 return true; 2777 } 2778 index++; 2779 } 2780 return false; 2781 } That member (sources) is instantiated in the one-and-only-one constructor: CombinedEnumeration(Enumeration enum1, Enumeration enum2) { @SuppressWarnings("unchecked") Enumeration[] sources = new Enumeration[] { enum1, enum2 }; this.sources = sources; } Also weird is that this throws NPE on line 2775 and not 2774. I can't explain how line 2775 could throw an NPE if line 2774 did not. >:/ Is the null pointer in the index'th position of source, not source itself? I use Tomcat 8.5.x and I have never had a commons-logging.properties file, and I use some components which are surely causing commons-logging LogFactory to initialize, and I've never seen this problem before. -chris - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: WebappClassLoaderBase error when upgrading Tomcat 8 to 8.5
Jeremy, On 5/1/23 14:22, Jeremy Nguyen wrote: I'm trying to upgrade Tomcat 8 to 8.5 and I'm getting a nullpointerexception within WebappClassLoaderBase.CombinedEnumeration.inc. It seems to occur when it's trying to initialize commons-logging LogFactory for any class specified in Web.xml, and it's calling getResources("commons-logging.properties") which I never had. Is it required in 8.5? Even if I put it in conf/, it's not being picked up. We're running Tomcat using a wrapper and it's erroring out here: https://github.com/CodeGerm/osgi-server/blob/master/plugins/org.cg.dao.webcontainer/src/org/cg/dao/webcontainer/tomcat/TomcatWrapper.java#L185 I posted my web.xml and error trace here as well: https://stackoverflow.com/questions/76139108/web-xml-configuration-is-broken-when-upgrading-to-tomcat-8-5-and-spring-5-1 I have no idea how this is throwing an NPE. The only pointer being dereferenced by the inc() method is "sources": 2773private boolean inc() { 2774while (index < sources.length) { 2775if (sources[index].hasMoreElements()) { 2776return true; 2777} 2778index++; 2779} 2780return false; 2781} That member (sources) is instantiated in the one-and-only-one constructor: CombinedEnumeration(Enumeration enum1, Enumeration enum2) { @SuppressWarnings("unchecked") Enumeration[] sources = new Enumeration[] { enum1, enum2 }; this.sources = sources; } Also weird is that this throws NPE on line 2775 and not 2774. I can't explain how line 2775 could throw an NPE if line 2774 did not. >:/ I use Tomcat 8.5.x and I have never had a commons-logging.properties file, and I use some components which are surely causing commons-logging LogFactory to initialize, and I've never seen this problem before. -chris - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
WebappClassLoaderBase error when upgrading Tomcat 8 to 8.5
Hi, I'm trying to upgrade Tomcat 8 to 8.5 and I'm getting a nullpointerexception within WebappClassLoaderBase.CombinedEnumeration.inc. It seems to occur when it's trying to initialize commons-logging LogFactory for any class specified in Web.xml, and it's calling getResources("commons-logging.properties") which I never had. Is it required in 8.5? Even if I put it in conf/, it's not being picked up. We're running Tomcat using a wrapper and it's erroring out here: https://github.com/CodeGerm/osgi-server/blob/master/plugins/org.cg.dao.webcontainer/src/org/cg/dao/webcontainer/tomcat/TomcatWrapper.java#L185 I posted my web.xml and error trace here as well: https://stackoverflow.com/questions/76139108/web-xml-configuration-is-broken-when-upgrading-to-tomcat-8-5-and-spring-5-1 Thanks, Jeremy