Jetty 9 not able to load jndi datasource driver class

Viewed 190

I searched for the issues for several days and could not find out what can fix the problem. Please help.

I have the standalone web app with jetty-9.3.10.v20160621 and the datasource is defined in jetty.xml.
I have put the jars into the JETTY_HOME/lib/ext.

But it still failed to start the application:

Caused by: java.lang.ClassNotFoundException: org.apache.commons.dbcp.BasicDataSource
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at org.eclipse.jetty.util.Loader.loadClass(Loader.java:86)
    at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.newObj(XmlConfiguration.java:758)

I also tried with jetty-env.xml and which had the similar issue that the class loader could not find the class even though the jars shown in the classpath.

0 Answers
Related