1

当我使用数据库向导对其进行测试时,我获得了成功。但是当我运行我的 jsf/adf 应用程序时出现以下错误::

    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]

即使我在类路径中添加了 jar 文件。我使用的是 sqljdbc4.jar 版本。

4

2 回答 2

5

如果在 IDE 中运行,请将slqjdbc4.jarsqljdbc.jar库文件放在安装路径中 DefaultDomain 下的lib 文件夹中。-IntegratedWLS
C:\Documents and Settings\user\Application Data\JDeveloper\system11.1.1.3.37.56.60\DefaultDomain\lib

或者

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

于 2012-07-10T09:25:06.760 回答
0

以前的答案对我来说效果很好,我正在使用带有集成 weblogic 的 Jdeveloper 12c,在我的情况下,我使用了 sqljdbc4 jar 文件,因为它提供了对 java 7 的支持:

" 如果在 IDE 中运行,请将 slqjdbc4.jar 或 sqljdbc.jar 库文件放在 IntegratedWLS 安装路径中 DefaultDomain 下的 lib 文件夹中。

C:\Documents and Settings\user\Application Data\JDeveloper\system11.1.1.3.37.56.60\DefaultDomain\lib - 

或者

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

评论以防万一有人面临同样的问题。

于 2014-04-30T19:52:11.703 回答