lovin
lovin

Reputation: 563

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

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.

Upvotes: 1

Views: 25408

Answers (2)

Christian Ceballos
Christian Ceballos

Reputation: 86

Previous answer worked very well for me, I'm using Jdeveloper 12c with integrated weblogic, in my case I used sqljdbc4 jar file because it provides support for java 7:

" 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
".

Commented just in case anyone is facing the same problem.

Upvotes: 0

lovin
lovin

Reputation: 563

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

Upvotes: 5

Related Questions