Cannot load driver class: com.microsoft.sqlserver.jdbc.SQLServerDriver

24,707

Put the slqjdbc4.jar or sqljdbc.jar library file in lib folder under DefaultDomain in your IntegratedWLS installation path, if running in in IDE.
C:\Documents and Settings\user\Application Data\JDeveloper\system11.1.1.3.37.56.60\DefaultDomain\lib -

or

C:\Users\user\AppData\Roaming\JDeveloper\system11.1.1.3.37.56.60\DefaultDomain\lib

Share:
24,707
lovin
Author by

lovin

just another software programmer :p

Updated on July 06, 2022

Comments

  • lovin
    lovin almost 2 years

    I get success when i test it using database wizard. But I get the following error while i run my jsf/adf application ::

        C:\Users\dev4\AppData\Roaming\JDeveloper\system11.1.1.3.37.56.60\o.j2ee\drs\sqlConnTestApp\ViewController_sqlWebApp.war
    [12:55:18 PM] Wrote Enterprise Application Module to C:\Users\dev4\AppData\Roaming\JDeveloper\system11.1.1.3.37.56.60\o.j2ee\drs\sqlConnTestApp
    [12:55:18 PM] Deploying Application...
    <Jul 10, 2012 12:55:19 PM IST> <Warning> <J2EE> <BEA-160195> <The application version lifecycle event listener oracle.security.jps.wls.listeners.JpsAppVersionLifecycleListener is ignored because the application sqlConnTestApp is not versioned.> 
        <Jul 10, 2012 12:55:20 PM IST> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID '1341905118356' for task '4'. Error is: 'weblogic.application.ModuleException: '
        weblogic.application.ModuleException: 
            at weblogic.jdbc.module.JDBCModule.prepare(JDBCModule.java:290)
            at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
            at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:507)
            at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
            at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:149)
            Truncated. see log file for complete stacktrace
    
        Caused By: weblogic.common.resourcepool.ResourceSystemException: Cannot load driver class: com.microsoft.sqlserver.jdbc.SQLServerDriver
            at weblogic.jdbc.common.internal.JDBCUtil.parseException(JDBCUtil.java:301)
            at weblogic.jdbc.common.internal.ConnectionEnvFactory.loadDriver(ConnectionEnvFactory.java:75)
            at weblogic.jdbc.common.internal.ConnectionEnvFactory.<init>(ConnectionEnvFactory.java:131)
            at weblogic.jdbc.common.internal.ConnectionPool.initPooledResourceFactory(ConnectionPool.java:686)
            at weblogic.common.resourcepool.ResourcePoolImpl.start(ResourcePoolImpl.java:230)
            Truncated. see log file for complete stacktrace
        > 
        <Jul 10, 2012 12:55:20 PM IST> <Warning> <Deployer> <BEA-149004> <Failures were detected while initiating deploy task for application 'sqlConnTestApp'.> 
        <Jul 10, 2012 12:55:20 PM IST> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004
        weblogic.application.ModuleException: 
            at weblogic.jdbc.module.JDBCModule.prepare(JDBCModule.java:290)
            at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
            at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:507)
            at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
            at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:149)
            Truncated. see log file for complete stacktrace
    
        Caused By: weblogic.common.resourcepool.ResourceSystemException: Cannot load driver class: com.microsoft.sqlserver.jdbc.SQLServerDriver
            at weblogic.jdbc.common.internal.JDBCUtil.parseException(JDBCUtil.java:301)
            at weblogic.jdbc.common.internal.ConnectionEnvFactory.loadDriver(ConnectionEnvFactory.java:75)
            at weblogic.jdbc.common.internal.ConnectionEnvFactory.<init>(ConnectionEnvFactory.java:131)
            at weblogic.jdbc.common.internal.ConnectionPool.initPooledResourceFactory(ConnectionPool.java:686)
            at weblogic.common.resourcepool.ResourcePoolImpl.start(ResourcePoolImpl.java:230)
            Truncated. see log file for complete stacktrace
        > 
        [12:55:21 PM] ####  Deployment incomplete.  ####
        [12:55:21 PM] Remote deployment failed (oracle.jdevimpl.deploy.common.Jsr88RemoteDeployer)
        #### Cannot run application sqlConnTestApp due to error deploying to IntegratedWebLogicServer.
        [Application sqlConnTestApp stopped and undeployed from Server Instance IntegratedWebLogicServer]
    

    Even i added the jar file in the classpath.I am using sqljdbc4.jar version.

    • Olaf
      Olaf almost 12 years
      If you want to get answer to your question, you might need to be more clear: is your connection successfull or are you getting an error? Is your database Oracle or Microsft SQL Server?
    • lovin
      lovin almost 12 years
      i am using sql server as database.i am getting success when i test connection but i get error on running the jsf page.
    • Olaf
      Olaf almost 12 years
      You need to make sure that Microsoft SQL Server JDBC driver jar is in the class path of your JSF application.
    • lovin
      lovin almost 12 years
      i added that to the class path still it shows error while running application ::: Caused By: weblogic.common.resourcepool.ResourceSystemException: Cannot load driver class: com.microsoft.sqlserver.jdbc.SQLServerDriver