On 20.12.19 13:28, Kushagra Bindal wrote: > Hi, > > We are working on upgrading our tomcat version from 8.5.24 to 9.0.29. In > this process, while starting one of our services we found that while > starting catalina.out is having some exception. > > Note: This exception we are getting before start of tomcat. > > 20-Dec-2019 09:52:09.144 WARNING [main] > org.apache.tomcat.jdbc.pool.DataSourceFactory.getObjectInstance > org.apache.catalina.UserDatabase is not a valid class name/type for this > JNDI factory. > 20-Dec-2019 09:52:09.145 SEVERE [main] > org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans > Unexpected error creating MBeans > java.lang.NullPointerException > at > org.apache.naming.NamingContextBindingsEnumeration.nextElementInternal(NamingContextBindingsEnumeration.java:129) > at > org.apache.naming.NamingContextBindingsEnumeration.next(NamingContextBindingsEnumeration.java:71) > ... > 20-Dec-2019 09:52:09.148 SEVERE [main] > org.apache.catalina.realm.CombinedRealm.startInternal Failed to start > [org.apache.catalina.realm.UserDatabaseRealm] realm > org.apache.catalina.LifecycleException: No UserDatabase component > found under key [UserDatabase] > ... > > Below is the server.xml file details. > > > ------------------------------------------------------------------------------------------------------------------ > > ... > <Resource name="UserDatabase" auth="Container" > type="org.apache.catalina.UserDatabase" > description="User database that can be updated and saved" > factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" > > url="jdbc:postgresql://<<DBServer>>:5444/<<DBName>>?targetServerType=master&currentSchema=common" > pathname="conf/tomcat-users.xml" /> > </GlobalNamingResources> > ... > > Phew, that server.xml would have been so much more readable if you'd removed all the commented xml before posting.
Anyway, I've shortened the log and server.xml in my quote to what I assume is the cause for the error message. The stock server.xml contains a MemoryUserDatabaseFactory, while it looks like your declaration is for a generic JDBC connection. <Resource name="UserDatabase" auth="Container" type="org.apache.catalina.UserDatabase" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" pathname="conf/tomcat-users.xml" /> >From the top of my head I can't give you the right class name to use, but knowing this cause might put you on the right track. Olaf --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org