[OpenSIPS-Users] Cannot load JDBC driver class 'com.mysql.jdbc.Driver'
Ginés Gómez
gines at voztele.com
Thu Dec 18 10:08:17 CET 2008
Hi Marco,
copy the jar to the ${WESIP_HOME}/common/lib. Classes in this
directory are available to all applications while classes in lib
directory are only available to the container itself (for internal
purposes). It should do the trick
Thank you
Ginés
> Hello everyone,
>
> I have configured a mysql datasource on wesip's server.xml,
> copied the file mysql-connector-java-5.1.7-bin.jar under $
> {WESIP_HOME}/lib,
> restarted wesip but I always obtain the following exception running
> the Apache example for testing the connection pool
>
> EXCEPTION:
> -----------------------------------------------------------------------------------------------------------
>
> org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver
> class 'com.mysql.jdbc.Driver'
> at
> org
> .apache
> .commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:
> 766)
> at
> org
> .apache
> .commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
> at foo.DBTest.init(DBTest.java:23)
> at org.apache.jsp.index$jsp._jspService(index$jsp.java:60)
> at org.apache.jasper.runtime.HttpJspBase.service(Unknown Source)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at org.apache.jasper.servlet.JspServlet
> $JspServletWrapper.service(Unknown Source)
> at org.apache.jasper.servlet.JspServlet.serviceJspFile(Unknown Source)
> at org.apache.jasper.servlet.JspServlet.service(Unknown Source)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
> org
> .apache
> .catalina
> .core
> .ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
> 200)
> at
> org
> .apache
> .catalina
> .core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146)
> at
> org
> .apache
> .catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:
> 206)
> at org.apache.catalina.core.StandardPipeline
> $StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
> at
> org
> .apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:
> 433)
> at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:
> 946)
> at
> com
> .voztele
> .sipservlet
> .valves.ConvergedContextValve.invokeHTTP(ConvergedContextValve.java:
> 144)
> at
> com
> .voztele
> .sipservlet
> .valves.ConvergedContextValve.invoke(ConvergedContextValve.java:64)
> at org.apache.catalina.core.StandardPipeline
> $StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
> at
> org
> .apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:
> 433)
> at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:
> 946)
> at
> org
> .apache
> .catalina.core.StandardHttpContext.invoke(StandardHttpContext.java:
> 2377)
> at
> com
> .voztele
> .sipservlet.core.ConvergedContext.invoke(ConvergedContext.java:98)
> at
> com
> .voztele
> .sipservlet
> .valves.ConvergedHostValve.invokeHTTP(ConvergedHostValve.java:337)
> at
> com
> .voztele
> .sipservlet.valves.ConvergedHostValve.invoke(ConvergedHostValve.java:
> 98)
> at org.apache.catalina.core.StandardPipeline
> $StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
> at
> org
> .apache
> .catalina
> .valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:124)
> at org.apache.catalina.core.StandardPipeline
> $StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
> at
> org
> .apache
> .catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
> at org.apache.catalina.core.StandardPipeline
> $StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
> at
> org
> .apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:
> 433)
> at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:
> 946)
> at
> com
> .voztele
> .sipservlet
> .valves.ConvergedEngineValve.invoke(ConvergedEngineValve.java:98)
> at org.apache.catalina.core.StandardPipeline
> $StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
> at
> org
> .apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:
> 433)
> at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:
> 946)
> at
> org
> .apache
> .catalina.connector.http.HttpProcessor.process(HttpProcessor.java:994)
> at
> org
> .apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:
> 1105)
> at java.lang.Thread.run(Thread.java:595)
> Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
> at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:164)
> at
> org
> .apache
> .commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:
> 760)
> ... 38 more
>
> -----------------------------------------------------------------------------------------------------------
>
> Follows the server.xml:
> -----------------------------------------------------------------------------------------------------------
> - <Server port="5005" shutdown="SHUTDOWN" debug="1">
> - <Service name="WeSIP-Standalone">
> <Connector
> className="org.apache.catalina.connector.http.HttpConnector"
> port="5075" minProcessors="5" maxProcessors="75"
> enableLookups="true" acceptCount="10" debug="1" />
> - <Connector
> className="com.voztele.sipservlet.connector.SipConnector"
> minProcessors="5" maxProcessors="75" enableLookups="true"
> acceptCount="10" debug="1" addresses="10.107.109.108:5060"
> pathName="com.voztele" protocol="udp">
> - <ExtraProperties>
> <Property key="com.voztele.javax.sip.SER_ADDRESS"
> value="10.107.109.108" />
> <Property key="com.voztele.javax.sip.SER_PORT" value="5080" />
> <Property key="com.voztele.STATISTICS" value="false" />
> <Property key="javax.sip.STACK_NAME" value="shootist" />
> <Property key="javax.sip.THREAD_POOL_SIZE" value="100" />
> <Property key="com.voztele.javax.sip.THREAD_POOL_SIZE" value="100" />
> <Property key="com.voztele.javax.sip.REENTRANT_LISTENER"
> value="true" />
> <Property key="javax.sip.AUTOMATIC_DIALOG_SUPPORT" value="false" />
> <Property key="com.voztele.javax.sip.TRACE_LEVEL" value="0" />
> </ExtraProperties>
> </Connector>
> - <Engine name="Standalone" defaultHost="10.107.109.108" debug="1"
> className="com.voztele.sipservlet.core.ConvergedEngine">
> <Mapper className="org.apache.catalina.core.StandardEngineMapper"
> protocol="HTTP/1.1" />
> <Mapper className="org.apache.catalina.core.StandardEngineMapper"
> protocol="HTTP/1.0" />
> <Mapper className="com.voztele.sipservlet.core.EngineSipMapper"
> protocol="SIP/2.0" />
> <Logger className="org.apache.catalina.logger.FileLogger"
> timestamp="true" />
> <Realm className="org.apache.catalina.realm.MemoryRealm" />
> - <Host name="10.107.109.108" nameSip="10.107.109.108_5060"
> debug="1" appBase="wesipapps" unpackWARs="true" autoDeploy="true"
> className="com.voztele.sipservlet.core.ConvergedHost" port="5060">
> <Logger className="org.apache.catalina.logger.FileLogger"
> timestamp="true" />
> <Mapper className="com.voztele.sipservlet.core.SipHostMapper"
> protocol="SIP/2.0" />
> <Mapper className="org.apache.catalina.core.HttpHostMapper"
> protocol="HTTP/1.1" />
> <Mapper className="org.apache.catalina.core.HttpHostMapper"
> protocol="HTTP/1.0" />
> - <DefaultContext useNaming="true" reloadable="true">
> <Resource name="jdbc/TestDB" auth="Container"
> type="javax.sql.DataSource" />
> - <ResourceParams name="jdbc/TestDB">
> - <parameter>
> <name>username</name>
> <value>javauser</value>
> </parameter>
> - <parameter>
> <name>password</name>
> <value>javauser</value>
> </parameter>
> - <parameter>
> <name>driverClassName</name>
> <value>com.mysql.jdbc.Driver</value>
> </parameter>
> - <parameter>
> <name>url</name>
> <value>jdbc:mysql://opensips.server:3306/test</value>
> </parameter>
> - <parameter>
> <name>maxActive</name>
> <value>8</value>
> </parameter>
> - <parameter>
> <name>maxIdle</name>
> <value>4</value>
> </parameter>
> </ResourceParams>
> </DefaultContext>
> </Host>
> </Engine>
> </Service>
> </Server>
>
> -----------------------------------------------------------------------------------------------------------
>
>
> Thans in advance
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.opensips.org/pipermail/users/attachments/20081218/19b6ee0e/attachment-0001.htm
More information about the Users
mailing list