RE: get NPE from NamingContextListener in app moved from TomEE to Tomcat
> -Original Message- > From: Mark Thomas [mailto:ma...@apache.org] > Sent: Friday, March 10, 2017 9:42 AM > To: Tomcat Users List > Subject: Re: get NPE from NamingContextListener in app moved from TomEE > to Tomcat > > On 10/03/2017 17:39, KARR, DAVID wrote: > > I have a CXF/REST/Spring/JDBC app running in TomEE (7.0.1). I've > decided to try to move it to Tomcat (8.5.11) because of some classloader > conflicts (CXF classes) I'm now seeing in trying to add some new code to > the app. > > > > Initially, I'm just running the server in Eclipse. > > > > When I add the apps to Tomcat and start it up, without changing the > server conf, it starts up, but it fails to find my JNDI resources > (obviously). > > > > I have the following DataSource definition in the "tomee.xml" file in > TomEE, which is working fine: > > -- > > > > testOnBorrow = true > > testOnReturn = true > > testWhileIdle = true > > logValidationErrors = true > > validationQuery = select 1 from dual > > JdbcDriver = oracle.jdbc.OracleDriver > > InitialSize = 2 > > MaxActive = 2 > > MinIdle = 2 > > MaxIdle = 2 > > JdbcUrl = ... > > UserName = ... > > Password = ... > > > > - > > > > When I attempt to add this Resource definition to the "context.xml" > file in Tomcat 8.5.11, I see errors like the following, and Tomcat fails > to start up: > > > > Caused by: java.lang.NullPointerException > > at java.util.StringTokenizer.(StringTokenizer.java:199) > > at java.util.StringTokenizer.(StringTokenizer.java:221) > > at > org.apache.catalina.core.NamingContextListener.createSubcontexts(NamingC > ontextListener.java:1300) > > at > org.apache.catalina.core.NamingContextListener.addResource(NamingContext > Listener.java:1081) > > at > org.apache.catalina.core.NamingContextListener.createNamingContext(Namin > gContextListener.java:661) > > at > org.apache.catalina.core.NamingContextListener.lifecycleEvent(NamingCont > extListener.java:249) > > - > > > > I've tried converting the Resource definition to look more "normal", > but nothing I've tried makes any difference. This is the current state > of it: > > -- > > auth="Container" > > name="jdbc/tst36" not id=... That was it, thanks. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: get NPE from NamingContextListener in app moved from TomEE to Tomcat
On 10/03/2017 17:39, KARR, DAVID wrote: > I have a CXF/REST/Spring/JDBC app running in TomEE (7.0.1). I've decided to > try to move it to Tomcat (8.5.11) because of some classloader conflicts (CXF > classes) I'm now seeing in trying to add some new code to the app. > > Initially, I'm just running the server in Eclipse. > > When I add the apps to Tomcat and start it up, without changing the server > conf, it starts up, but it fails to find my JNDI resources (obviously). > > I have the following DataSource definition in the "tomee.xml" file in TomEE, > which is working fine: > -- > > testOnBorrow = true > testOnReturn = true > testWhileIdle = true > logValidationErrors = true > validationQuery = select 1 from dual > JdbcDriver = oracle.jdbc.OracleDriver > InitialSize = 2 > MaxActive = 2 > MinIdle = 2 > MaxIdle = 2 > JdbcUrl = ... > UserName = ... > Password = ... > > - > > When I attempt to add this Resource definition to the "context.xml" file in > Tomcat 8.5.11, I see errors like the following, and Tomcat fails to start up: > > Caused by: java.lang.NullPointerException > at java.util.StringTokenizer.(StringTokenizer.java:199) > at java.util.StringTokenizer.(StringTokenizer.java:221) > at > org.apache.catalina.core.NamingContextListener.createSubcontexts(NamingContextListener.java:1300) > at > org.apache.catalina.core.NamingContextListener.addResource(NamingContextListener.java:1081) > at > org.apache.catalina.core.NamingContextListener.createNamingContext(NamingContextListener.java:661) > at > org.apache.catalina.core.NamingContextListener.lifecycleEvent(NamingContextListener.java:249) > - > > I've tried converting the Resource definition to look more "normal", but > nothing I've tried makes any difference. This is the current state of it: > -- >testOnBorrow="true" testOnReturn="true" testWhileIdle="true" > logValidationErrors="true" validationQuery="select 1 from dual" > JdbcDriver="oracle.jdbc.OracleDriver" > InitialSize="2" MaxActive="2" MinIdle="2" MaxIdle="2" > JdbcUrl="..." > UserName="..." Password="..."> > > -- > > - > 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