Cannot load JDBC driver class 'org.gjt.mm.mysql.Driver'
Hi,
I'm trying to run my web app and connect to a MySQL database but keep getting this error:
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot load JDBC driver class 'org.gjt.mm.mysql.Driver'
any ideas?
Thanks!
Lookup the stacktrace and find the root cause of the exception.
My cents on a ClassNotFoundException which is rather self-explaining.
By the way, the mentioned driver class name is a very old driver. You shouldn't be using that anymore. Surf to the MySQL homepage and download the most recent Connector/J JDBC driver for your database version. Documentation is also available over there.
Similar Messages
-
Driver class 'org.gjt.mm.mysql.Driver' not Found JSP
OS ->Windows XP Pro
Tomcat version ->4.0.1
jdk version -> 1.3.1
database -> mysql
Classpath = .;C:\jakarta-tomcat-4.0.1\common\lib\servlet.jar;C:\jakarta-tomcat-4.0.1\common\lib\mm.mysql.jdbc-1.2c\mysql_uncomp.jar;
I am trying to run a function in a javabean to startup up a connection to a database. Code as follows...
public void connect() throws ClassNotFoundException,
SQLException,
Exception {
try {
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
con = DriverManager.getConnection(
"jdbc:mysql://localhost/Wrox ?user=root&password=lunchbox ");
} catch (ClassNotFoundException cnfe) {
error = "ClassNotFoundException: Could not locate DB driver.";
throw new ClassNotFoundException(error);
} catch (SQLException cnfe) {
error = "SQLException: Could not connect to database.";
throw new SQLException(error);
} catch (Exception e) {
error = "Exception: An unknown error occurred while connecting " +
"to database.";
throw new Exception(error);
I call it from my jsp page code as follows.. connect in bold
<%@ page language="java"
import="java.sql.*, java.io.*, java.util.*, com.wrox.databases.*"
errorPage="error.jsp" %>
<jsp:useBean id="book" class="com.wrox.databases.Books" />
<html>
<head>
<title> Wrox Press Ltd. </title>
</head>
<body>
<h1> Wrox Press Ltd.</h1>
<h2> List of Books </h2>
<b>Add More Books</b>
<form action="delete.jsp" method="post">
<table border="1">
<tr>
<td><b>ID:</b></td>
<td><B>Title:</b></td>
<td><B>Price:</b></td>
</tr>
<%
book.connect();
ResultSet rs = book.viewBooks();
while (rs.next()) {
%>
<tr>
<td>
<input type="checkbox" name="pkey"
value="<%= rs.getString("Title_ID") %>" />
</td>
<td><%= rs.getString("Title") %></td>
<td><%= rs.getString("Price") %></td>
</tr>
<%
%>
</table>
Check books for deletion.<BR>
<input type="submit" value="Delete All Checked Books">
</form>
<% book.disconnect(); %>
</body>
</html>
The name of the bean is correct and so is the package it is stored under. I tried it in the bean and got "ClassNotFoundException" Could not locate DB driver". I tried it with DBtags and got
Driver class 'org.gjt.mm.mysql.Driver' not Found
any help would be really appreciated.When using any 3rd party library with tomcat. the jar file of that library has to be put in the WEB-INF/lib directory of your application. Then only tomcat will find it.
So the my-sql driver would have come in a jar file. just put that jar file in the WEB-INF/lib directory.
After that things should work. If they don't please post again.
hope this helps.
regards,
Abhishek. -
Hi,
I am a new user in this forum..
I have just installed tomcat and mysql and jdbc fresh on my new system..
first of all here is what i have done...
i have installed mysql integrated in xampp at c:\xampp\mysql
i have installed my tomcat at C:\Programme\Apache Software Foundation\Tomcat 5.5
i have put jdbc <dirver>.jar file copied in all sorts of directories like ....
<tomcat_home>\common\lib
<tomcat_home>\webapps\axis\WEB-INF\lib\ext
<java_home>\lib
<java_home>\jre\lib\ext
my calsspath looks something like this
.;C:\Programme\QuickTime\QTSystem\QTJava.zip;C:\Programme\"Apache Software Foundation"\"Tomcat 5.5"\common\lib\mysql-connector-java-5.0.6-bin.jar;C:\Programme\"Apache Software Foundation"\"Tomcat 5.5"\webapps\axis\WEB-INF\lib\mysql-connector-java-5.0.6-bin.jar;C:\Programme\"Apache Software Foundation"\"Tomcat 5.5"\common\lib\servlet-api.jar;C:\Programme\"Apache Software Foundation"\"Tomcat 5.5"\common\lib\jsp-api.jar;C:\Programme\Java\jdk1.5.0_05\jre\lib\ext\mysql-connector-java-5.0.6-bin.jar;C:\Programme\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF;C:\Programme\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF\lib\activation.jar;C:\Programme\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF\lib\axis.jar;C:\Programme\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF\lib\axis-ant.jar;C:\Programme\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF\lib\commons-discovery-0.2.jar;C:\Programme\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF\lib\commons-logging-1.0.4.jar;C:\Programme\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF\lib\jaxrpc.jar;C:\Programme\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF\lib\log4j-1.2.8.jar;C:\Programme\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF\lib\mail.jar;C:\Programme\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF\lib\saaj.jar;C:\Programme\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF\lib\wsdl4j-1.5.1.jar;C:\Programme\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF\lib\mysql-connector-java-5.0.6-bin.jar
which is basically all the jar files in the web-inf\lib folder and references to all the copies of driver as mentioned before
these are results of a lot of desperatio but still the code which i run....
package mypackage;
import java.sql.*;
public class JDBCConnector
public static void main(String[] arg) throws Exception
System.out.println("Initiating Database Mysql Connection");
//try {
Statement stmt;
// Register the JDBC driver for MySQL.
Class.forName("org.gjt.mm.mysql.Driver ").newInstance();
// Define URL of database server for
// database named mysql on the localhost
// with the default port number 3306.
String url = "jdbc:mysql://wifh-1.fhso.ch:3306/";
// Get a connection to the database for a
// user named root with a blank password.
// This user is the default administrator
// having full privileges to do anything.
Connection con = DriverManager.getConnection(url,"root", "birnExy");
//Display URL and connection information
System.out.println("URL: " + url);
System.out.println("Connection: " + con);
//Get a Statement object
stmt = con.createStatement();
// Create the new database
stmt.executeUpdate("CREATE DATABASE JunkDB3");
//Register a new user named auser on the
// database named JunkDB with a password
// drowssap enabling several different
// privileges.
stmt.executeUpdate("GRANT SELECT,INSERT,UPDATE,DELETE," +"CREATE,DROP " +"ON JunkDB3.* TO 'nishant'@'localhost' " +"IDENTIFIED BY 'nishant';");
con.close();
//}catch( Exception e ) {
// e.printStackTrace();
//}//end catch
//return hook;
}//end main
}//end class JDBCConnector
gives the following error.....
<soapenv:Envelope>
−
<soapenv:Body>
−
<soapenv:Fault>
<faultcode>soapenv:Server.userException</faultcode>
−
<faultstring>
java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
</faultstring>
−
<detail>
<ns1:hostname>SADMC0087</ns1:hostname>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
please help me20.05.2007 22:43:26 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Programme\Java\jdk1.5.0_05\jre\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Programme\QuickTime\QTSystem\;C:\Programme\ATI Technologies\ATI Control Panel;C:\Programme\Java\jdk1.5.0_05\bin;C:\Programme\Apache Software Foundation\Tomcat 5.5\common\lib;
20.05.2007 22:43:27 org.apache.coyote.http11.Http11BaseProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
20.05.2007 22:43:27 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1203 ms
20.05.2007 22:43:27 org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
20.05.2007 22:43:27 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.23
20.05.2007 22:43:27 org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
20.05.2007 22:43:28 org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive SIpages.war
20.05.2007 22:43:31 org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
20.05.2007 22:43:31 org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
20.05.2007 22:43:31 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/109 config=null
20.05.2007 22:43:31 org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
20.05.2007 22:43:32 org.apache.catalina.startup.Catalina start
INFO: Server startup in 4813 ms
now this is when i run from eclipse where SIpages.war is my war file to be deployed...which looks something like this
sipages/web-inf/classes
sipages/web-inf/src
sipages/web-inf/lib-this has the jar file as you mentioned
and come other files...nwo where soes my .java file go in this war and how do i compile the java file -
Including org.gjt.mm.mysql.Driver with my application
So, lets say I have a Java program that connects to an SQL server and it runs fine on my machine. I have all the nessicarry classpath's and Connector/J properly installed. But, when I run it on a client machine I get:
java.lang.ClassNotFoundException: org.gjt.mm.mysql.DriverNow, I can solve this issue by putting the Connector/J onto their computer but, I'm wondering if there's a way to package the application and the driver so that anyone can run it without having to install Connector/J manually.
Any help would be much appreciated.
Thanks!JonasWon wrote:
So, lets say I have a Java program that connects to an SQL server and it runs fine on my machine. I have all the nessicarry classpath's and Connector/J properly installed. But, when I run it on a client machine I get:
java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
That's the old, deprecated JDBC driver class name.
Now, I can solve this issue by putting the Connector/J onto their computer but, I'm wondering if there's a way to package the application and the driver so that anyone can run it without having to install Connector/J manually.
Any help would be much appreciated.
Thanks!"install" it manually? Nobody "installs" a 3rd party JAR. These aren't quite DLLs.
I'll assume your app is a desktop deployment. Package it into an executable JAR, add the Connector/J JAR to the Classpath in the manifest, and zip that JAR up with the Connector/J JAR. Your users will just unzip the ZIP file and execute the JAR.
% -
hi
I am facing followig error.
java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
How to set the class path.
I am using Windows XP, NetBeans IDE 5.5, MySQL-5.0
I have made one simple servlet program in order to read one small table from the MySQL database.
I got the connectivity but above error is i have been facing.
Please tell me how to write to set the class path and where should i put my mysql-connector-java-5.0.4-bin file. so i can read the data from the database.
thanking you.
regards
discuss.hi
I am facing followig error.
java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
How to set the class path.
I am using Windows XP, NetBeans IDE 5.5, MySQL-5.0
I have made one simple servlet program in order to read one small table from the MySQL database.
I got the connectivity but above error is i have been facing.
Please tell me how to write to set the class path and where should i put my mysql-connector-java-5.0.4-bin file. so i can read the data from the database.
thanking you.
regards
discuss. -
Org.gjt.mm.mysql.Driver
I want to send a WAR file of my web applications to my clients. The application consiting of servlets and jsps connects to a database and requires org.gjt.mm.mysql.Driver how do i incorperate the .jar inside the WAR so my client doesn't have to fiddle with dropping jars in tomcats lib directory? I've tried including the org.gjt.mm.mysql.Driver driver jar inside the war WEB-INF/lib but it still says it cant find the driver?
If you have set up connection pooling within Tomcat, there is no way around it. The connection pooling is controlled by Tomcat, so it requires the driver file in [TOMCAT]/common/lib.
The only way to have a completely independant WAR file would be to handle all the database connections and connection pooling yourself within the web application. -
Org.gjt.mm.mysql.Driver not found help!!
hi all
it's the first time for me working with MySql, and when i try to connect to the db, i have the following exception:
java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
i know that i shall download it from Mysql site, but i don't know WHERE to put it
i'm using forte 3.0 - jdk 1.4.0 on Win2K
please help me!
thanx
sandroNo problem,
in general you should modify the CLASSPATH of your JDK to point to the jar-driver-file, e.g. (on unix): CLASSPATH = "someDirectory"\driverFIle.jar:$CLASSPATH
and then: export CLASSPATH. That should solve your problem. if using windows: Just take a look at systemControlCenter. There it's possible to modify the CLASSPAT-environment.
So far... -
Help. JDBCRealm error -- org.gjt.mm.mysql.Driver not found
Hi All,
I tried to setup JDBCRealm. After I config. to JDBCRealm and restart tomcat. I got this error:
java.sql.SQLException: org.git.mm.mysql.Driver error.
Can someone help. Thanksweb-inf/lib is not sufficient in this case, as the Tomcat engine needs access to the driver - not just your application.
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/realm-howto.html#JDBCRealm
You need to
Place a copy of the JDBC driver you will be using inside the $CATALINA_HOME/server/lib directory (if you do not need it visible to web applications) or $CATALINA_HOME/common/lib (if it will be used both by Tomcat 4 and by your apps).
Cheers.
evnafets -
I am trying to connect to mysql Db through RMI but i am getting this exception.
When trying to connect to db through a normal class implementation without RMI it is connected succesfully.
What is causing the problem????
Thanks in advaceCLASSPATH, man. The RMI server needs to have the MySQL driver JAR in its CLASSPATH.
That's usually what that exception means.
% -
Org.gjt.mm.mysql.Driver under tomcat?
hi all
anybody knows where to put this driver under tomcat in order to let my servlet connect to a MySql db?
thanx all
sandrosandro
Put the driver on "lib/common/" directory of Tomcat, and since lib is directly located by tomcat when you restart it. You must have to restart the tomcat after copying the file. The folder path may be "/var/tomcat/lib/commomn/" and may vary during installation.
Cheers
Rahul// -
Java.sql.SQLException: Cannot load JDBC driver class 'null'
Hi,
I am a beginner of using jdbc, i use the tomcat4.1.x, mysql3.23.54 and it's jdbc driver 2.0.14. I place the drive <in jar file> in tomcat/commons/lib and configure the server.xml, web.xml and some testing coding. But there are some error like the following:
java.sql.SQLException: Cannot load JDBC driver class 'null'
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:529)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:312)
at foo.DBTest.init(DBTest.java:18)
at org.apache.jsp.test_jsp._jspService(test_jsp.java:48)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:136)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:204)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
of course its some of the error code and there are more.
Why I have this problems and how can I fix it? Can someone help me??
Thanks,
Tong
I place my test.jsp at tomcat/webapps/DBTest and DBTest.java at tomcat/webapps/DBTest/WEB-INF/classes/foo
additional of the tomcat/conf/server.xml
<Resource name="TestDB" auth="Container" type="javax.sql.DataSource" description="MySQL TestDB"/>
<ResourceParams name="TestDB">
<parameter><name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<parameter><name>maxActive</name><value>10</value></parameter>
<parameter><name>maxIdle</name><value>1</value></parameter>
<parameter><name>maxWait</name><value>10000</value></parameter>
<parameter><name>username</name><value>javauser</value></parameter>
<parameter><name>password</name><value>javadude</value></parameter>
<parameter>
<name>driverClassName</name>
<value>org.gjt.mm.mysql.Driver</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc:mysql://localhost:3306/javatest?autoReconnect=true</value>
</parameter>
</ResourceParams>
tomcat/webapps/DBTest/WEB-INF/web.xml :
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<description>MySQL Test App</description>
</web-app>Post the part of your code that loads the driver and connects. My guess is you are using a variable for the name of the driver and the variable has not been set to anything(intially set to null).
Thanks
Cardwell -
SOA WebLogic : Cannot load JDBC driver class
Hi, I'm new to this Oracle SOA World. Currently I'm trying to configure environment on my system. I found a very useful document to install all related SOA component to my system, the document name was 'Quick Start Guide for Oracle® SOA Suite 11gR1 (11.1.1.5.0)'. I did all the steps written in the document and have installed all the components successfully, component including Database, Jdevelper, WebLogic Server, RCU, SOA suite, service bus, all are installed successfully.
But when I'm trying to Configure Application Server (start -> Oracle SOA 11g-Home1), at one step 'Configure JDBC Component Schema' , here I'm getting this message
* The driver class listed below was not found in product installation
vendor: Derby
Driver: org.apache.derby.jdbc.clientdriver
A Test will not be performed on any database connections using this driver
In addition, when i just ignore this message and continue installation, after installation when i run weblogic server then it gives error and gets terminated
here is weblogic server log:
* To start WebLogic Server, use a username and *
* password assigned to an admin-level user. For *
* server administration, use the WebLogic Server *
* console at http:\\hostname:port\console *
starting weblogic with Java version:
Listening for transport dt_socket at address: 8453
java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b50)
Java HotSpot(TM) Client VM (build 19.1-b02, mixed mode)
Starting WLS with line:
C:\Oracle\MIDDLE~1\JDK160~1\bin\java -client -Xdebug -Xnoagent -Xrunjdwp:transpo
rt=dt_socket,address=8453,server=y,suspend=n -Djava.compiler=NONE -Xms512m -Xmx
1024m -XX:PermSize=128m -XX:MaxPermSize=512m -Dweblogic.Name=AdminServer -Djava.
security.policy=C:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\weblogic.policy -Xveri
fy:none -Xverify:none -da:org.apache.xmlbeans... -ea -da:com.bea... -da:javeli
n... -da:weblogic... -ea:com.bea.wli... -ea:com.bea.broker... -ea:com.bea.sbcons
ole... -Dplatform.home=C:\Oracle\MIDDLE~1\WLSERV~1.3 -Dwls.home=C:\Oracle\MIDDLE
~1\WLSERV~1.3\server -Dweblogic.home=C:\Oracle\MIDDLE~1\WLSERV~1.3\server -Dcom
mon.components.home=C:\Oracle\MIDDLE~1\ORACLE~1 -Djrf.version=11.1.1 -Dorg.apach
e.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Logger -Ddomain.home=
C:\Oracle\MIDDLE~1\USER_P~1\domains\BASE_D~2 -Djrockit.optfile=C:\Oracle\MIDDLE~
1\ORACLE~1\modules\oracle.jrf_11.1.1\jrocket_optfile.txt -Doracle.server.config.
dir=C:\Oracle\MIDDLE~1\USER_P~1\domains\BASE_D~2\config\FMWCON~1\servers\AdminSe
rver -Doracle.domain.config.dir=C:\Oracle\MIDDLE~1\USER_P~1\domains\BASE_D~2\con
fig\FMWCON~1 -Digf.arisidbeans.carmlloc=C:\Oracle\MIDDLE~1\USER_P~1\domains\BAS
E_D~2\config\FMWCON~1\carml -Digf.arisidstack.home=C:\Oracle\MIDDLE~1\USER_P~1\
domains\BASE_D~2\config\FMWCON~1\arisidprovider -Doracle.security.jps.config=C:\
Oracle\MIDDLE~1\USER_P~1\domains\BASE_D~2\config\fmwconfig\jps-config.xml -Dorac
le.deployed.app.dir=C:\Oracle\MIDDLE~1\USER_P~1\domains\BASE_D~2\servers\AdminSe
rver\tmp\_WL_user -Doracle.deployed.app.ext=\- -Dweblogic.alternateTypesDirector
y=C:\Oracle\MIDDLE~1\ORACLE~1\modules\oracle.ossoiap_11.1.1,C:\Oracle\MIDDLE~1\O
RACLE~1\modules\oracle.oamprovider_11.1.1 -Djava.protocol.handler.pkgs=oracle.md
s.net.protocol"|"oracle.fabric.common.classloaderurl.handler"|"oracle.fabric.com
mon.uddiurl.handler"|"oracle.bpm.io.fs.protocol -Dweblogic.jdbc.remoteEnabled=f
alse -da:org.apache.xmlbeans... -Dsoa.archives.dir=C:\Oracle\Middleware\Oracle_
SOA1\soa -Dsoa.oracle.home=C:\Oracle\Middleware\Oracle_SOA1 -Dsoa.instance.home=
C:\Oracle\MIDDLE~1\USER_P~1\domains\BASE_D~2 -Dtangosol.coherence.clusteraddress
=227.7.7.9 -Dtangosol.coherence.clusterport=9778 -Dtangosol.coherence.log=jdk -D
javax.xml.soap.MessageFactory=oracle.j2ee.ws.saaj.soap.MessageFactoryImpl -Dwebl
ogic.transaction.blocking.commit=true -Dweblogic.transaction.blocking.rollback=t
rue -Djavax.net.ssl.trustStore=C:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\DemoTrus
t.jks -Dem.oracle.home=C:\Oracle\Middleware\oracle_common -Djava.awt.headless=tr
ue -Dums.oracle.home=C:\Oracle\Middleware\Oracle_SOA1 -Dweblogic.management.disc
over=true -Dwlw.iterativeDev= -Dwlw.testConsole= -Dwlw.logErrorsToConsole= -Dwe
blogic.ext.dirs=C:\Oracle\MIDDLE~1\patch_wls1035\profiles\default\sysext_manifes
t_classpath;C:\Oracle\MIDDLE~1\patch_jdev1111\profiles\default\sysext_manifest_c
lasspath weblogic.Server
Listening for transport dt_socket at address: 8453
<2012-mar-02 kl 21:14 CET> <Info> <Security> <BEA-090905> <Disabling CryptoJ JCE
Provider self-integrity check for better startup performance. To enable this ch
eck, specify -Dweblogic.security.allowCryptoJDefaultJCEVerification=true>
<2012-mar-02 kl 21:14 CET> <Info> <Security> <BEA-090906> <Changing the default
Random Number Generator in RSA CryptoJ from ECDRBG to FIPS186PRNG. To disable th
is change, specify -Dweblogic.security.allowCryptoJDefaultPRNG=true>
<2012-mar-02 kl 21:14 CET> <Info> <WebLogicServer> <BEA-000377> <Starting WebLog
ic Server with Java HotSpot(TM) Client VM Version 19.1-b02 from Sun Microsystems
Inc.>
<2012-mar-02 kl 21:14 CET> <Info> <Management> <BEA-141107> <Version: WebLogic S
erver 10.3.5.0 Fri Apr 1 20:20:06 PDT 2011 1398638 >
<2012-mar-02 kl 21:14 CET> <Notice> <WebLogicServer> <BEA-000365> <Server state
changed to STARTING>
<2012-mar-02 kl 21:14 CET> <Info> <WorkManager> <BEA-002900> <Initializing self-
tuning thread pool>
<2012-mar-02 kl 21:14 CET> <Notice> <Log Management> <BEA-170019> <The server lo
g file C:\Oracle\Middleware\user_projects\domains\base_domain\servers\AdminServe
r\logs\AdminServer.log is opened. All server side log events will be written to
this file.>
<2012-mar-02 kl 21:14 CET> <Notice> <Security> <BEA-090082> <Security initializi
ng using security realm myrealm.>
<2012-mar-02 kl 21:14 CET> <Warning> <oracle.as.jmx.framework.MessageLocalizatio
nHelper> <J2EE JMX-46041> <The resource for bundle "oracle.jrf.i18n.MBeanMessage
Bundle" with key "oracle.jrf.JRFServiceMBean.checkIfJRFAppliedOnMutipleTargets"
cannot be found.>
<2012-mar-02 kl 21:14 CET> <Notice> <WebLogicServer> <BEA-000365> <Server state
changed to STANDBY>
<2012-mar-02 kl 21:14 CET> <Notice> <WebLogicServer> <BEA-000365> <Server state
changed to STARTING>
<2012-mar-02 kl 21:15 CET> <Critical> <JTA> <BEA-110482> <A logging last resourc
e failed during initialization. The server cannot boot unless all configured log
ging last resources (LLRs) initialize. Failing reason:
weblogic.common.resourcepool.ResourceSystemException: Cannot load driver class:
org.apache.derby.jdbc.ClientDriver
weblogic.common.resourcepool.ResourceSystemException: Cannot load driver class:
org.apache.derby.jdbc.ClientDriver
at weblogic.jdbc.common.internal.JDBCUtil.parseException(JDBCUtil.java:3
01)
at weblogic.jdbc.common.internal.ConnectionEnvFactory.loadDriver(Connect
ionEnvFactory.java:75)
at weblogic.jdbc.common.internal.ConnectionEnvFactory.<init>(ConnectionE
nvFactory.java:131)
at weblogic.jdbc.common.internal.ConnectionPool.initPooledResourceFactor
y(ConnectionPool.java:712)
at weblogic.common.resourcepool.ResourcePoolImpl.start(ResourcePoolImpl.
java:235)
Truncated. see log file for complete stacktrace
>
<2012-mar-02 kl 21:15 CET> <Error> <Deployer> <BEA-149205> <Failed to initialize
the application 'wlsbjmsrpDataSource' due to error weblogic.application.ModuleE
xception: .
weblogic.application.ModuleException:
at weblogic.jdbc.module.JDBCModule.prepare(JDBCModule.java:302)
at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(Modu
leListenerInvoker.java:199)
at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(Depl
oymentCallbackFlow.java:517)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineD
river.java:52)
at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(Dep
loymentCallbackFlow.java:159)
Truncated. see log file for complete stacktrace
Caused By: weblogic.common.resourcepool.ResourceSystemException: Cannot load dri
ver class: org.apache.derby.jdbc.ClientDriver
at weblogic.jdbc.common.internal.JDBCUtil.parseException(JDBCUtil.java:3
01)
at weblogic.jdbc.common.internal.ConnectionEnvFactory.loadDriver(Connect
ionEnvFactory.java:75)
at weblogic.jdbc.common.internal.ConnectionEnvFactory.<init>(ConnectionE
nvFactory.java:131)
at weblogic.jdbc.common.internal.ConnectionPool.initPooledResourceFactor
y(ConnectionPool.java:712)
at weblogic.common.resourcepool.ResourcePoolImpl.start(ResourcePoolImpl.
java:235)
Truncated. see log file for complete stacktrace
>
<2012-mar-02 kl 21:16 CET> <Alert> <OSB Security> <BEA-387068> <There is no PKI
credential mapper provider configured in your security realm. Service key provid
er management will be disabled. Configure a PKI credential mapper provider if yo
u need service provider support. This is typically the case if you have Oracle S
ervice Bus proxy services with web service security enabled or outbound 2-way SS
L connections.>
<2012-mar-02 kl 21:16 CET> <Warning> <Coherence> <BEA-000000> <Oracle Coherence
3.6.0.4 (member=n/a): Local address "127.0.0.1" is a loopback address; this clus
ter node will not connect to nodes located on different machines>
<2012-mar-02 kl 21:17 CET> <Warning> <J2EE> <BEA-160140> <Unresolved optional pa
ckage references (in META-INF/MANIFEST.MF): [Extension-Name: oracle.applcore.mod
el, Specification-Version: 0.1, Implementation-Version: 11.1.1.0.0, referenced f
rom: C:\Oracle\Middleware\user_projects\domains\base_domain\servers\AdminServer\
tmp\_WL_user\usermessagingserver\a7bt7z]. Make sure the referenced optional pack
age has been deployed as a libraryHi:
try placing the jars that represent ur driver, here
For both Windows and Linux, you must perform the following steps:
Drop the vendor-specific driver JAR files to the user_projects/domains/soainfra/lib directory.
Drop the vendor-specific driver JAR files to the <Weblogic_Home>/server/lib.
Edit the classpath to include the vendor-specific jar file in <Weblogic_HOME>/common/bin/commEnv.sh
This info was copied, from here: http://docs.oracle.com/cd/E21764_01/integration.1111/e10231/adptr_db.htm#CHDBEJDC
Hope this helps
best -
Hi,
i am doing a forum application.
i am trying to connect database connection through javax.sql.DataSource.
I am using Eclipse editor for developing this application and i am using sql server 2000 database.
i have create a servlet file.
here is the coding.
DatabaseGetConnection.java
`````````````````````````````````````````
import java.io.IOException;
import java.sql.Connection;
import java.sql.SQLException;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.sql.DataSource;
public class DatabaseGetConnection extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet {
private Connection con=null;
private DataSource ds=null;
public DatabaseGetConnection() throws ServletException {
super();
public DatabaseGetConnection(final HttpServletRequest req, final HttpServletResponse res) throws ServletException, IOException {
this.doPost(req, res);
public void init() throws ServletException {
try
final Context initContext = new InitialContext();
final Context envContext = (Context)initContext.lookup("java:/comp/env");
this.ds = (DataSource)initContext.lookup("jdbc/mySQLServer");
}catch(final NamingException ne)
ne.printStackTrace();
}catch(final Exception e)
e.printStackTrace();
public DataSource getDS()
System.out.println("Datasource method calling");
if (this.ds!=null)
System.out.println("Datasource not null");
}else
System.out.println("Datasource null");
return this.ds;
public Connection getCon()
try
this.con=this.getDS().getConnection();
if (this.con!=null)
System.out.println("Connection Successfull");
}catch(final SQLException se)
System.out.print("Connection Establishment Error : ");
se.printStackTrace();
return this.con;
I have configured server.xml. here is the configuration
server.xml
````````````````
<GlobalNamingResources>
<Resource name="jdbc/mySQLServer" global="jdbc/mySQLServer" auth="Container"
type="javax.sql.DataSource" factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory" driverClassName="com.microsoft.jdbc.sqlserver.SQLServerDriver"
url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=forum;SelectMethod=cursor"
username="sa" password="sa" maxActive="20" maxIdle="10"
maxWait="-1"/>
</GlobalNamingResources>
here is the web.xml file
``````````````````````````````````
<resource-ref>
<res-ref-name>jdbc/mySQLServer</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
is this configuration correct? plz help me about the configuration and coding through Eclipse.
i have run the application and i got the error. here is the error details
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot load JDBC driver class 'com.microsoft.jdbc.sqlserver.SQLServerDriver'
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:766)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
at com.forum.database.DatabaseGetConnection.getCon(DatabaseGetConnection.java:85)
at com.forum.database.DatabaseGetConnection.GetAllTopicSearch(DatabaseGetConnection.java:101)
at org.apache.jsp.test_jsp._jspService(test_jsp.java:73)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:760)
... 24 more
thanks and regards,
k.s.kumarPlease don't multipost, it's rude: http://forum.java.sun.com/thread.jspa?threadID=5219591
Please continue on that thread. -
Cannot load JDBC Driver Class in Tomcat5.5 using struts.
Hello to all,
I'm working in the struts environment using Esclipse3.2 IDE.
And I have installed Tomcat5.5 server.I have created the LoginForm
in struts.Now i like to connect my LoginForm with MySql database.I
have also created the database in MySql naming strutsdatabase.
I had also download the mysql-connector-java-3.0.16-ga-bin.jar and
save that in C:/tomcat/commons/lib directory.
While running I have got the below error:
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot load JDBC driver class 'com.mysql.jdbc.Driver'
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:766)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.setLogWriter(BasicDataSource.java:598)
at org.apache.struts.action.ActionServlet.initModuleDataSources(ActionServlet.java:808)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:335)
at javax.servlet.GenericServlet.init(GenericServlet.java:211)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1105)
Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
javax.servlet.UnavailableException: Initializing application data source org.apache.struts.action.DATA_SOURCE
at org.apache.struts.action.ActionServlet.initModuleDataSources(ActionServlet.java:812)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:335)
at javax.servlet.GenericServlet.init(GenericServlet.java:211)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1105)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:932)
And I have attached my struts-config.xml:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software
Foundation//DTD Struts Configuration 1.2//EN"
"http://struts.apache.org/dtds/struts-config_1_2.dtd">
<struts-config>
<data-sources>
<data-source
type="org.apache.tomcat.dbcp.dbcp.BasicDataSource">
<set-property property="url"
value="jdbc:mysql://localhost:3306/strutsdatabase?autoReconnect
=true"/>
<set-property property="driverClassName"
value="com.mysql.jdbc.Driver"/>
<set-property property="username" value=""/>
<set-property property="password" value=""/>
<set-property property="maxActive" value="10"/>
<set-property property="validationQuery" value="SELECT
COUNT(*) FROM test"/>
<set-property property="maxWait" value="5000"/>
<set-property property="defaultAutoCommit" value="false"/>
</data-source>
</data-sources>
<form-beans>
<form-bean name="LoginForm"
type="fino.web.struts.action.LoginForm"/>
</form-beans>
<global-exceptions/>
<global-forwards/>
<action-mappings>
<action name="LoginForm" path="/login" scope="request"
type="fino.web.struts.action.LoginAction" validate="true">
<forward name="success" path="/success.jsp"/>
<forward name="failure" path="/failure.jsp"/>
</action>
</action-mappings>
<controller/>
<message-resources null="false"
parameter="org.apache.struts.action.ActionResources"/>
</struts-config>
Friends,please help me to find solution to this problem.Note: This thread was originally posted in the [Java Compiler|http://forums.sun.com/forum.jspa?forumID=7] forum, but moved to this forum for closer topic alignment.
-
Cannot load JDBC driver class 'com.mysql.jdbc.Driver'
Hi,
At the moment I'm trying to get an example working. The error message I get is:
Unable to get connection, DataSource invalid: "org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot load JDBC driver class 'com.mysql.jdbc.Driver'"
The example I tried is http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html.
Configuration:
Wampserver 2.0 (Apache, MySQL, PHP for Windows XP), Tomcat 6.0 and jdk1.6.0_03.
The following files are installed in %CATALINA_HOME%/webabbs/
- Dbtest/test.jsp
- Dbtest/WEB-INF/web.xml
- Dbtest/WEB-INF/lib/standard.jar
- Dbtest/WEB-INF/lib/tomcat-dbcp.jar
- Dbtest/WEB-INF/lib/jstl.jar
Tia,
Abel.Hi,
I added the jar file containing the requested class to my lib directory. So the current contents of that directory is:
The following files are installed in %CATALINA_HOME%/webabbs/
- Dbtest/test.jsp
- Dbtest/WEB-INF/web.xml
- Dbtest/WEB-INF/lib/standard.jar
- Dbtest/WEB-INF/lib/tomcat-dbcp.jar
- Dbtest/WEB-INF/lib/jstl.jar
- Dbtest/WEB-INF/lib/mysql-connector-java-5.1.5-bin.jar
More importantly, I started my Wamp server.
The example works as it should have. Thanks for the feedback.
Abel
Maybe you are looking for
-
Hello, i need to read a XML from an iView (JSP page) which lays somewhere on a/the server. (http://xyz.abc.com/test.xml). Is there any API available to do this? JDOM maybe? regards, Markus
-
Acrobat will not Activate. Ever, Ever? Ever.
STILL HAVING issues with Acrobat closing for no reason after about 8 seconds, also when converting to PDF in Word 2013 I get error statement that Acrobat is not activated. Also keep having to delete the OBEE folder every day to use CC. Ridiculous!!!!
-
HELP! Messages received lost in Inbox...
Hi. Have a problem with my N79. When I have more than a hundred messages in my INBOX, new messages go to the middle of the list, not to the top. If I don't read a message the moment I receive it I have to look it through the whole Inbox! It isn't a m
-
so i just lost all firewire capability about an hour ago, and after poking around online it seems i'm not the only one having this sort of trouble. i'm on a dual 2.7 G5, running 10.4.6.. has anybody else here had to deal with this? everything was goi
-
I have really slow internet, i bought OS X mountain lion & tried for days to download it. my internet cuts every time & the download restarts from the beginning is thr a way to download the software as a "zip" file or from a link not app store?