Db2 未满足LinkError/通过Ant脚本启动OpenJPA Junit测试时打开套接字时出错

Db2 未满足LinkError/通过Ant脚本启动OpenJPA Junit测试时打开套接字时出错,db2,openjpa,Db2,Openjpa,您好,OpenJpa和DB2专家 我收到下面的错误消息(下面是stacktrace)。错误出现在 受影响的Junit测试是从ant脚本启动的。启动Junit测试 在Eclipse中手动工作没有任何问题。因此,例外情况似乎有所不同 奇怪。对于任何能将分析推向正确方向的意见,我将不胜感激 Further Information : Drivers: db2jcc.jar db2jcc_license_cu.jar [Version 3.64.82] OpenJPA Ver

您好,OpenJpa和DB2专家

我收到下面的错误消息(下面是stacktrace)。错误出现在 受影响的Junit测试是从ant脚本启动的。启动Junit测试 在Eclipse中手动工作没有任何问题。因此,例外情况似乎有所不同 奇怪。对于任何能将分析推向正确方向的意见,我将不胜感激

Further Information :

Drivers:
    db2jcc.jar
    db2jcc_license_cu.jar
    [Version 3.64.82]

OpenJPA Version : 2.1.2

Persistence.xml:

<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0"
    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">

    <persistence-unit name="mypersistenceunit" transaction-type="RESOURCE_LOCAL">
    <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
    <class>common.data.domain.MyDomainObjectx</class>
    <class>common.data.domain.MyDomainObjecty</class>

     <properties>
       <property name="openjpa.ReadLockLevel" value="none"/> 
       <property name="openjpa.Log" value="DefaultLevel=TRACE, Runtime=TRACE, Tool=TRACE, SQL=TRACE, Enhance=TRACE"/>
       <property name="openjpa.ConnectionFactoryProperties" value="PrettyPrint=true, PrettyPrintLineLength=72"/>             
<property name="javax.persistence.jdbc.driver" value="com.ibm.db2.jcc.DB2Driver"/>                       
       <property name="javax.persistence.jdbc.url" value="jdbc:db2://xyz:62000/MyDBInstance"/>                                                             
       <property name="javax.persistence.jdbc.user" value="myuser"/>
       <property name="javax.persistence.jdbc.password" value="mypass"/>         
     </properties>

    </persistence-unit>
</persistence>

[junit] at org.apache.openjpa.jdbc.schema.DataSourceFactory.newConnectException(DataSourceFactory.java:261)
[junit] at org.apache.openjpa.jdbc.schema.DataSourceFactory.installDBDictionary(DataSourceFactory.java:247)
[junit] at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getConnectionFactory(JDBCConfigurationImpl.java:733)
[junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[junit] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
[junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
[junit] at java.lang.reflect.Method.invoke(Method.java:611)
[junit] at org.apache.openjpa.lib.conf.ConfigurationImpl.instantiateAll(ConfigurationImpl.java:295)
[junit] at org.apache.openjpa.conf.OpenJPAConfigurationImpl.instantiateAll(OpenJPAConfigurationImpl.java:1652)
[junit] at org.apache.openjpa.kernel.AbstractBrokerFactory.makeReadOnly(AbstractBrokerFactory.java:645)
[junit] at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:204)
[junit] at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
[junit] at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
[junit] at com.ibm.ws.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:50)
[junit] at com.ibm.ws.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:35)
[junit] xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
[junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[junit] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
[junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
[junit] at java.lang.reflect.Method.invoke(Method.java:611)
[junit] at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
[junit] at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
[junit] at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
[junit] at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
[junit] at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
[junit] at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
[junit] at junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:39)
[junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:420)
[junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:911)
[junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:768)
[junit] Caused by: com.ibm.db2.jcc.am.DisconnectNonTransientConnectionException: [jcc][t4][2043][11550][3.64.82] Exception java.lang.reflect.InvocationTargetException: Error opening socket to server xyz.com/11.11.111.11 on port 62,000 with message: null. ERRORCODE=-4499, SQLSTATE=08001
[junit] at com.ibm.db2.jcc.am.bd.a(bd.java:321)
[junit] at com.ibm.db2.jcc.am.bd.a(bd.java:340)
[junit] at com.ibm.db2.jcc.t4.vb.a(vb.java:436)
[junit] at com.ibm.db2.jcc.t4.vb.<init>(vb.java:93)
[junit] at com.ibm.db2.jcc.t4.a.b(a.java:355)
[junit] at com.ibm.db2.jcc.t4.b.newAgent_(b.java:2026)
[junit] at com.ibm.db2.jcc.am.Connection.initConnection(Connection.java:718)
[junit] at com.ibm.db2.jcc.am.Connection.<init>(Connection.java:667)
[junit] at com.ibm.db2.jcc.t4.b.<init>(b.java:332)
[junit] at com.ibm.db2.jcc.DB2SimpleDataSource.getConnection(DB2SimpleDataSource.java:232)
[junit] at com.ibm.db2.jcc.DB2SimpleDataSource.getConnection(DB2SimpleDataSource.java:198)
[junit] at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:475)
[junit] at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:116)
[junit] at org.apache.openjpa.jdbc.schema.SimpleDriverDataSource.getSimpleConnection(SimpleDriverDataSource.java:96)
[junit] at org.apache.openjpa.jdbc.schema.SimpleDriverDataSource.getConnection(SimpleDriverDataSource.java:92)
[junit] at org.apache.openjpa.jdbc.schema.SimpleDriverDataSource.getConnection(SimpleDriverDataSource.java:88)
[junit] at org.apache.openjpa.lib.jdbc.DelegatingDataSource.getConnection(DelegatingDataSource.java:139)
[junit] at org.apache.openjpa.lib.jdbc.DecoratingDataSource.getConnection(DecoratingDataSource.java:112)
[junit] at org.apache.openjpa.jdbc.schema.DataSourceFactory.installDBDictionary(DataSourceFactory.java:239)
[junit] ... 28 more
[junit] Caused by: java.lang.reflect.InvocationTargetException
[junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[junit] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
[junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
[junit] at java.lang.reflect.Method.invoke(Method.java:611)
[junit] at com.ibm.db2.jcc.t4.v.run(v.java:69)
[junit] at java.security.AccessController.doPrivileged(AccessController.java:251)
[junit] at com.ibm.db2.jcc.t4.vb.a(vb.java:422)
[junit] ... 44 more
[junit] Caused by: java.lang.UnsatisfiedLinkError: com/ibm/net/SocketUtils.configureKeepAlive(JIII)V
[junit] at com.ibm.net.SocketUtils.configureKeepAlive(SocketUtils.java:233)
[junit] ... 51 more
[junit] )
[junit] class load: org.apache.tools.ant.taskdefs.optional.junit.JUnitTaskMirrorImpl$VmExitErrorTest from: file:/C:/IBM/Ressource/SDP/plugins/org.apache.ant_1.7.1.v20100518-1145/lib/ant-junit.jar
[junit] class load: java/util/Collections$1
[junit] class load: org/w3c/dom/CDATASection
[junit] class load: org/apache/xerces/dom/CDATASectionImpl
[junit] Tests run: 0, Failures: 0, Errors: 1, Time elapsed: 3.391 sec
[junit] class load: sun/nio/cs/UTF8_Encoder
[junit] class load: sun/nio/cs/UTF_8$Encoder
[junit] class load: org.apache.tools.ant.util.DOMElementWriter from: file:/C:/IBM/Ressource/SDP/plugins/org.apache.ant_1.7.1.v20100518-1145/lib/ant.jar
[junit] class load: org.apache.tools.ant.util.DOMElementWriter$XmlNamespacePolicy from: file:/C:/IBM/Ressource/SDP/plugins/org.apache.ant_1.7.1.v20100518-1145/lib/ant.jar
[junit] class load: java/util/IdentityHashMap$1
[junit] class load: java/util/IdentityHashMap$IdentityHashMapIterator
[junit] class load: java/util/IdentityHashMap$1$1
[junit] class load: java/util/IdentityHashMap$IdentityHashMapEntry
[junit] class load: com/ibm/tools/attach/javaSE/AttachHandler$1
[junit] class load: java/lang/Thread$State
[junit] class load: java/io/DeleteOnExitHook 
更多信息:
司机:
db2jcc.jar
db2jcc_license_cu.jar
[版本3.64.82]
OpenJPA版本:2.1.2
Persistence.xml:
org.apache.openjpa.persistence.PersistenceProviderImpl
common.data.domain.MyDomainObjectx
common.data.domain.MyDomainObjecty
[junit]位于org.apache.openjpa.jdbc.schema.DataSourceFactory.newConnectException(DataSourceFactory.java:261)
[junit]位于org.apache.openjpa.jdbc.schema.DataSourceFactory.installDBDictionary(DataSourceFactory.java:247)
[junit]位于org.apache.openjpa.jdbc.conf.jdbcconfigurationmpl.getConnectionFactory(jdbcconfigurationmpl.java:733)
[junit]位于sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)
[junit]位于sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
[junit]位于sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
[junit]位于java.lang.reflect.Method.invoke(Method.java:611)
[junit]位于org.apache.openjpa.lib.conf.configurationmpl.instanceAll(configurationmpl.java:295)
[junit]位于org.apache.openjpa.conf.OpenJPAConfigurationImpl.instanceAll(OpenJPAConfigurationImpl.java:1652)
[junit]位于org.apache.openjpa.kernel.AbstractBrokerFactory.makeReadOnly(AbstractBrokerFactory.java:645)
[junit]位于org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:204)
[junit]位于org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
[junit]位于org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
[junit]位于com.ibm.ws.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:50)
[junit]位于com.ibm.ws.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:35)
[junit]XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[junit]位于sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)
[junit]位于sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
[junit]位于sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
[junit]位于java.lang.reflect.Method.invoke(Method.java:611)
[junit]位于org.junit.runners.model.FrameworkMethod$1.runReflectCall(FrameworkMethod.java:45)
[junit]位于org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
[junit]位于org.junit.runners.model.FrameworkMethod.invokeeexplosive(FrameworkMethod.java:42)
[junit]位于org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
[junit]位于org.junit.internal.runners.statements.runafter.evaluate(runafter.java:30)
[junit]位于org.junit.runners.ParentRunner.run(ParentRunner.java:300)
[junit]位于junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:39)
[junit]位于org.apache.tools.ant.taskdefs.optional.junit.junitestrunner.run(junitestrunner.java:420)
[junit]位于org.apache.tools.ant.taskdefs.optional.junit.junitestrunner.launch(junitestrunner.java:911)
[junit]位于org.apache.tools.ant.taskdefs.optional.junit.junitestrunner.main(junitestrunner.java:768)
[junit]由以下原因引起:com.ibm.db2.jcc.am.DisconnectNonTransientConnectionException:[jcc][t4][2043][11550][3.64.82]异常java.lang.reflect.InvocationTargetException:打开端口62000上服务器xyz.com/11.11.111.11的套接字时出错,消息为空。ERRORCODE=-4499,SQLSTATE=08001
[junit]位于com.ibm.db2.jcc.am.bd.a(bd.java:321)
[junit]位于com.ibm.db2.jcc.am.bd.a(bd.java:340)
[junit]位于com.ibm.db2.jcc.t4.vb.a(vb.java:436)
[junit]位于com.ibm.db2.jcc.t4.vb(vb.java:93)
[junit]位于com.ibm.db2.jcc.t4.a.b(a.java:355)
[junit]位于com.ibm.db2.jcc.t4.b.newAgent铹(b.java:2026)
[junit]位于com.ibm.db2.jcc.am.Connection.initConnection(Connection.java:718)
[junit]位于com.ibm.db2.jcc.am.Connection.(Connection.java:667)
[junit]位于com.ibm.db2.jcc.t4.b.(b.java:332)
[junit]位于com.ibm.db2.jcc.DB2SimpleDataSource.getConnection(DB2SimpleDataSource.java:232)
[junit]位于com.ibm.db2.jcc.DB2SimpleDataSource.getConnection(DB2SimpleDataSource.java:198)
[junit]位于com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:475)
[junit]位于com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:116)
[junit]位于org.apache.openjpa.jdbc.schema.SimpleDriverDataSource.getSimpleConnection(SimpleDriverDataSource.java:96)
[junit]位于org.apache.openjpa.jdbc.schema.SimpleDriverDataSource.getConnection(SimpleDriverDataSource.java:92)
[junit]位于org.apache.openjpa.jdbc.schema.SimpleDriverDataSource.getConnection(SimpleDriverDataSource.java:88)
[junit]位于org.apache.openjpa.lib.jdbc.DelegatingDataSource.getConnection(DelegatingDataSource.java:139)
[junit]位于org.apache.openjpa.lib.jdbc.DecoratingDataSource.getConnection(DecoratingDataSource.java:112)
[junit]位于org.apache.openjpa.jdbc.schema.DataSourceFactory.installDBDictionary(DataSourceFactory.java:239)
[junit]。。。28多
[junit]由以下原因引起:java.lang.reflect.InvocationTargetException
[junit]位于sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)
[junit]位于sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
[junit]位于sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
[junit]位于java.lang.reflect.Method.invoke(Method.java:611)
[junit]位于com.ibm.db2.jcc.t4.v.run(v.java:69)
[
Caused by: com.ibm.db2.jcc.am.DisconnectNonTransientConnectionException: 
[jcc][t4][2043][11550][3.64.82] Exception java.lang.reflect.InvocationTargetException:
Error opening socket to server xyz.com/11.11.111.11 on port 62,000 with message: null.
ERRORCODE=-4499, SQLSTATE=08001
telnet xyz.com 62000
telnet 11.11.111.11 62000
${DB2_DIR}/java/jdk64/bin/java -cp ${DB2_DIR}/java/db2jcc4.jar:${DB2_DIR}/java/db2jcc_license_cu.jar com.ibm.db2.jcc.DB2Jcc -url jdbc:db2://xyz.com:62000/MyDBInst -user myuser -password mypass