字符串索引超出范围:在Weblogic Server中使用Oracle Wallet时为-1

时间:2017-07-20 21:42:27

标签: java oracle jdbc weblogic weblogic12c

当我使用Oracle Wallet连接到我的数据库启动weblogic服务时,我收到以下错误。使用weblogic 12.1.3

Jul 20, 2017 5:18:32 PM org.aspectj.weaver.tools.Jdk14Trace error
SEVERE: oracle/security/crypto/fips/a
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
    at java.lang.String.substring(String.java:1967)
    at org.aspectj.weaver.bcel.BcelObjectType.getOuterClass(BcelObjectType.java:904)
    at org.aspectj.weaver.AbstractReferenceTypeDelegate.getFormalTypeParametersFromOuterClass(AbstractReferenceTypeDelegate.java:108)
    at org.aspectj.weaver.bcel.BcelObjectType.ensureGenericSignatureUnpacked(BcelObjectType.java:772)
    at org.aspectj.weaver.bcel.BcelObjectType.getSuperclass(BcelObjectType.java:231)
    at org.aspectj.weaver.ReferenceType.getSuperclass(ReferenceType.java:987)
    at org.aspectj.weaver.bcel.BcelWeaver.weaveParentsFor(BcelWeaver.java:1300)
    at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeaver.java:1119)
    at org.aspectj.weaver.tools.WeavingAdaptor.getWovenBytes(WeavingAdaptor.java:527)
    at org.aspectj.weaver.tools.WeavingAdaptor.weaveClass(WeavingAdaptor.java:363)
    at org.aspectj.weaver.loadtime.Aj.preProcess(Aj.java:121)
    at org.aspectj.weaver.loadtime.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:54)
    at sun.instrument.TransformerManager.transform(TransformerManager.java:188)
    at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:428)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at oracle.security.crypto.fips.FIPS_140_2.assertReadyState(Unknown Source)
    at oracle.security.crypto.core.MessageDigest.getInstance(Unknown Source)
    at oracle.security.crypto.core.PKCS12PBE.a(Unknown Source)
    at oracle.security.crypto.core.PKCS12PBE.a(Unknown Source)
    at oracle.security.crypto.core.PKCS12PBE.a(Unknown Source)
    at oracle.security.crypto.core.PKCS12PBE.decrypt(Unknown Source)
    at oracle.security.crypto.cert.PKCS12Safe.input(PKCS12Safe.java:208)
    at oracle.security.crypto.cert.PKCS12Safe.<init>(PKCS12Safe.java:129)
    at oracle.security.crypto.cert.PKCS12.input(PKCS12.java:179)
    at oracle.security.crypto.cert.PKCS12.<init>(PKCS12.java:122)
    at oracle.security.pki.OracleKeyStoreSpi.load(Unknown Source)
    at oracle.security.pki.OracleKeyStoreSpi.engineLoad(Unknown Source)
    at oracle.security.pki.OracleSSOKeyStoreSpi.engineLoad(Unknown Source)
    at oracle.security.pki.OracleSecretStore.load(Unknown Source)
    at oracle.security.pki.OracleWallet.getSecretStore(Unknown Source)
    at oracle.security.pki.OracleWallet.open(Unknown Source)
    at oracle.jdbc.driver.PhysicalConnection.getSecretStoreCredentials(PhysicalConnection.java:1411)
    at oracle.jdbc.driver.PhysicalConnection.parseUrl(PhysicalConnection.java:1214)
    at oracle.jdbc.driver.PhysicalConnection.readConnectionProperties(PhysicalConnection.java:965)
    at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:624)
    at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:398)
    at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:31)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:566)
    at oracle.jdbc.pool.OracleDataSource.getPhysicalConnection(OracleDataSource.java:317)
    at oracle.jdbc.xa.client.OracleXADataSource.getPooledConnection(OracleXADataSource.java:486)
    at oracle.jdbc.xa.client.OracleXADataSource.getXAConnection(OracleXADataSource.java:174)
    at oracle.jdbc.xa.client.OracleXADataSource.getXAConnection(OracleXADataSource.java:109)
    at weblogic.jdbc.common.internal.XAConnectionEnvFactory.makeConnection0(XAConnectionEnvFactory.java:548)
    at weblogic.jdbc.common.internal.XAConnectionEnvFactory.access$000(XAConnectionEnvFactory.java:31)
    at weblogic.jdbc.common.internal.XAConnectionEnvFactory$1.run(XAConnectionEnvFactory.java:503)
    at java.security.AccessController.doPrivileged(Native Method)
    at weblogic.jdbc.common.internal.XAConnectionEnvFactory.makeConnection(XAConnectionEnvFactory.java:500)
    at weblogic.jdbc.common.internal.XAConnectionEnvFactory.createResource(XAConnectionEnvFactory.java:201)
    at weblogic.common.resourcepool.ResourcePoolImpl.makeResources(ResourcePoolImpl.java:1331)
    at weblogic.common.resourcepool.ResourcePoolImpl.makeResources(ResourcePoolImpl.java:1248)
    at weblogic.common.resourcepool.ResourcePoolImpl.start(ResourcePoolImpl.java:240)
    at weblogic.jdbc.common.internal.ConnectionPool.doStart(ConnectionPool.java:1626)
    at weblogic.jdbc.common.internal.ConnectionPool.start(ConnectionPool.java:202)
    at weblogic.jdbc.common.internal.ConnectionPoolManager.createAndStartPool(ConnectionPoolManager.java:524)
    at weblogic.jdbc.common.internal.ConnectionPoolManager.createAndStartPool(ConnectionPoolManager.java:446)
    at weblogic.jdbc.module.JDBCModule.prepare(JDBCModule.java:301)
    at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:100)
    at weblogic.application.internal.flow.ModuleStateDriver$1.next(ModuleStateDriver.java:175)
    at weblogic.application.internal.flow.ModuleStateDriver$1.next(ModuleStateDriver.java:170)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:42)
    at weblogic.application.internal.flow.ModuleStateDriver.prepare(ModuleStateDriver.java:41)
    at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:133)
    at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:55)
    at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:706)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:42)
    at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:237)
    at weblogic.application.internal.SingleModuleDeployment.prepare(SingleModuleDeployment.java:48)
    at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:158)
    at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:61)
    at weblogic.deploy.internal.targetserver.SystemResourceDeployment.prepare(SystemResourceDeployment.java:66)
    at weblogic.management.deploy.internal.DeploymentAdapter$1.doPrepare(DeploymentAdapter.java:39)
    at weblogic.management.deploy.internal.DeploymentAdapter.prepare(DeploymentAdapter.java:191)
    at weblogic.management.deploy.internal.AppTransition$1.transitionApp(AppTransition.java:21)
    at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:240)
    at weblogic.management.deploy.internal.ConfiguredDeployments.prepare(ConfiguredDeployments.java:165)
    at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:122)
    at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:210)
    at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:118)
    at weblogic.server.AbstractServerService.postConstruct(AbstractServerService.java:78)
    at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.glassfish.hk2.utilities.reflection.ReflectionHelper.invoke(ReflectionHelper.java:1017)
    at org.jvnet.hk2.internal.ClazzCreator.postConstructMe(ClazzCreator.java:388)
    at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:430)
    at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:456)
    at org.glassfish.hk2.runlevel.internal.AsyncRunLevelContext.findOrCreate(AsyncRunLevelContext.java:225)
    at org.glassfish.hk2.runlevel.RunLevelContext.findOrCreate(RunLevelContext.java:82)
    at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2488)
    at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:98)
    at org.jvnet.hk2.internal.ServiceLocatorImpl.getService(ServiceLocatorImpl.java:606)
    at org.jvnet.hk2.internal.ThreeThirtyResolver.resolve(ThreeThirtyResolver.java:77)
    at org.jvnet.hk2.internal.ClazzCreator.resolve(ClazzCreator.java:231)
    at org.jvnet.hk2.internal.ClazzCreator.resolveAllDependencies(ClazzCreator.java:254)
    at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:413)
    at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:456)
    at org.glassfish.hk2.runlevel.internal.AsyncRunLevelContext.findOrCreate(AsyncRunLevelContext.java:225)
    at org.glassfish.hk2.runlevel.RunLevelContext.findOrCreate(RunLevelContext.java:82)
    at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2488)
    at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:98)
    at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:87)
    at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.oneJob(CurrentTaskFuture.java:1162)
    at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.run(CurrentTaskFuture.java:1147)
    at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:548)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:311)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:263)

我删除了以下文件并将它们添加到我的类路径中:

  1. ojdbc7.jar(使用Java 1.8.0_92)
  2. osdt_core.jar
  3. osdt_cert.jar
  4. oraclepki.jar
  5. 我还添加了以下java选项

    set JAVA_OPTIONS=%JAVA_OPTIONS% -Doracle.net.tns_admin=*myWallet*
    set JAVA_OPTIONS=%JAVA_OPTIONS% -Doracle.net.wallet_location=*myWallet*
    

    以下是我的一个jdbc.xmls

    <?xml version='1.0' encoding='UTF-8'?>
    <jdbc-data-source xmlns="http://xmlns.oracle.com/weblogic/weblogic-jms" xmlns:sec="http://xmlns.oracle.com/weblogic/security" xmlns:wls="http://xmlns.oracle.com/weblogic/security/wls" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-jms http://xmlns.oracle.com/weblogic/weblogic-jms/1.0/weblogic-jms.xsd">
     <name>my.PoolSource</name>
      <jdbc-driver-params>
        <url>jdbc:oracle:thin:/@my_alias</url>
        <driver-name>oracle.jdbc.xa.client.OracleXADataSource</driver-name>
        <properties>
          <property>
            <name>oracle.net.wallet_location</name>
            <value>*myWallet*</value>
          </property>
        </properties>
      </jdbc-driver-params>
      <jdbc-connection-pool-params>
        <test-table-name>SQL SELECT 1 FROM DUAL</test-table-name>
      </jdbc-connection-pool-params>
      <jdbc-data-source-params>
        <jndi-name>my.PoolSource</jndi-name>
        <global-transactions-protocol>TwoPhaseCommit</global-transactions-protocol>
      </jdbc-data-source-params>
    </jdbc-data-source>
    

    最后,我将以下安全提供程序添加到java.security

    security.provider.3=oracle.security.pki.OraclePKIProvider 
    

    我错过了什么吗?任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:0)

要解决此问题,我必须将以下jar放在我的JDK的这个位置:\ jre \ lib \ ext

  • osdt_core.jar
  • osdt_cert.jar
  • oraclepki.jar