weblogic 1036 创建JDBC store失败,报错如下
登录数据库检查,table "test0616_WLStore"已经成功创建
-
<2017-6-16 上午11时30分34秒 CST> JDBCStore-0" failed to open table "test0616_WLStore".
-
java.lang.Exception: java.lang.NoSuchMethodError: weblogic/jdbc/wrapper/PreparedStatement.init(Ljava/sql/Statement;Lweblogic/jdbc/wrapper/Connection;Ljava/lang/String;II)V
-
at weblogic.store.io.jdbc.JDBCStoreIO.open(JDBCStoreIO.java:545)
-
at weblogic.store.internal.PersistentStoreImpl.recoverStoreConnections(PersistentStoreImpl.java:435)
-
at weblogic.store.internal.PersistentStoreImpl.open(PersistentStoreImpl.java:423)
-
at weblogic.store.admin.AdminHandler.activate(AdminHandler.java:126)
-
at weblogic.store.admin.JDBCAdminHandler.activate(JDBCAdminHandler.java:71)
-
Truncated. see log file for complete stacktrace
-
Caused By: java.lang.NoSuchMethodError: weblogic/jdbc/wrapper/PreparedStatement.init(Ljava/sql/Statement;Lweblogic/jdbc/wrapper/Connection;Ljava/lang/String;II)V
-
at weblogic.jdbc.wrapper.PreparedStatement.makePreparedStatement(PreparedStatement.java:41)
-
at weblogic.jdbc.wrapper.Connection.prepareStatement(Connection.java:559)
-
at weblogic.store.io.jdbc.ReservedConnection.prepareStatement(ReservedConnection.java:527)
-
at weblogic.store.io.jdbc.ReservedConnection.getReadOneRowStatement(ReservedConnection.java:594)
-
at weblogic.store.io.jdbc.JDBCStoreIO.internalRead(JDBCStoreIO.java:851)
-
Truncated. see log file for complete stacktrace
-
>
找出进程552951 加载的所有的JAR文件,并zipinfo看下哪个文件中包含PreparedStatement.class
结果找到如下第四行有个非weblogic自带的,第三个的JAR包中包含此方法,类冲突。
-
[root@linuxServr ~]# for file in `lsof -p 552951 |grep "war$\|jar$"| awk '{print $NF}'`;do ret=`zipinfo "$file" |grep -l PreparedStatement`;if [ ! -z "$ret" ];then echo $file;echo $ret;fi;done
-
/bea1036/jrockit-jdk1.6.0_37-R28.2.5-4.1.0/jre/lib/rt.jar
-
(standard input)
-
/xxx_app/lib/PSTrace.jar
-
(standard input)
-
/bea1036/wlserver_10.3/server/lib/weblogic.jar
-
(standard input)
-
/bea1036/modules/com.bea.core.descriptor.wl_1.4.0.0.jar
-
(standard input)
-
/bea1036/modules/com.bea.core.descriptor.wl.binding_1.4.0.0.jar
-
(standard input)
-
/bea1036/modules/com.bea.core.datasource6_1.10.0.0.jar
-
(standard input)
-
/bea1036/modules/org.apache.openjpa_1.3.0.0_1-1-1-SNAPSHOT.jar
-
(standard input)
-
/bea1036/modules/com.bea.core.kodo_1.5.0.0_4-2-1.jar
-
(standard input)
-
/bea1036/modules/com.bea.core.compat.wl.90_1.4.0.0.jar
-
(standard input)
-
/bea1036/wlserver_10.3/server/lib/ojdbc6.jar
-
(standard input)
-
/bea1036/wlserver_10.3/server/lib/ucp.jar
-
(standard input)
-
/bea1036/wlserver_10.3/server/lib/mysql-connector-java-commercial-5.1.17-bin.jar
-
(standard input)
-
1/bea1036/wlserver_10.3/server/lib/wlsqlserver.jar
-
(standard input)
-
/bea1036/wlserver_10.3/server/lib/wldb2.jar
-
(standard input)
-
/bea1036/wlserver_10.3/server/lib/wlsybase.jar
-
(standard input)
-
/bea1036/wlserver_10.3/server/lib/wlinformix.jar
-
(standard input)
-
另外在启动JVM时加上
-verbose:class也可以看到哪些类被装载,从而也能发现问题。
如下摘自网络,是对verbose的解释。
When running a Java program, verbose options can be used to tell the JVM which kind of information to see. JVM suports three verbose options out of the box. As the name suggests, verbose is for displaying the work done by JVM. Mostly the information provided by these parameters is used for debugging purposes. Since it is used for debugging, its use is in development. One would never have to use verbose parameters in production enviornment. The three verbose options supported by JVM are:
-verbose:class
-verbose:gc
-verbose:jni
-verbose:class is used to display the information about classes being loaded by JVM. This is useful when using class loaders for loading classes dynamically or for analysing what all classes are getting loaded in a particular scenario. A very simple program which does nothing also loads so many classes as shown below:
package com.example;
public class Test {
public static void main(String args[]) {
}
}
Output:
[Opened C:\Program Files\Java\jdk1.7.0_04\jre\lib\rt.jar]
[Loaded java.lang.Object from C:\Program Files\Java\jdk1.7.0_04\jre\lib\rt.jar]
[Loaded java.io.Serializable from C:\Program Files\Java\jdk1.7.0_04\jre\lib\rt.jar]
[Loaded java.lang.Comparable from C:\Program Files\Java\jdk1.7.0_04\jre\lib\rt.jar]
[Loaded java.lang.CharSequence from C:\Program Files\Java\jdk1.7.0_04\jre\lib\rt.jar]
..............................................................................
..............................................................................
..............................................................................
[Loaded java.lang.Void from C:\Program Files\Java\jdk1.7.0_04\jre\lib\rt.jar]
[Loaded java.lang.Shutdown from C:\Program Files\Java\jdk1.7.0_04\jre\lib\rt.jar]
[Loaded java.lang.Shutdown$Lock from C:\Program Files\Java\jdk1.7.0_04\jre\lib\rt.jar]
I am showing only selected output from Eclipse console. Classes from java.lang, java.io and java.util packages are loaded into memory by default.
As stated earlier, one would use the verbose:class option when checking for what all classes are getting loaded which is usually a requirement when working with class loaders in Java.
-verbose:gc is used to check garbage collection event information. When used as command line argument for running Java program, the details of garbage collection are printed on the console. The following program demonstrates the usage:
package com.example;
public class Test {
public static void main(String args[]) throws InterruptedException {
Test t1 = new Test();
t1=null;
System.gc();
}
}
Output:
[GC 318K->304K(61056K), 0.0081277 secs]
[Full GC 304K->225K(61056K), 0.0054004 secs]
-verbose:jni is used for printing the native methods as and when they are registered in the application. These methods include JDK as well as custom native methods. Note that jni stands for Java Native Interface. The sourcecode and output demonstrating the usage of this option is shown below:
package com.example;
public class Test {
public static void main(String args[]) throws InterruptedException {
}
}
Output:
[Dynamic-linking native method java.lang.Object.registerNatives ... JNI]
[Registering JNI native method java.lang.Object.hashCode]
[Registering JNI native method java.lang.Object.wait]
[Registering JNI native method java.lang.Object.notify]
[Registering JNI native method java.lang.Object.notifyAll]
[Registering JNI native method java.lang.Object.clone]
[Dynamic-linking native method java.lang.System.registerNatives ... JNI]
...............................................................
...............................................................
...............................................................
[Registering JNI native method sun.misc.Perf.highResCounter]
[Registering JNI native method sun.misc.Perf.highResFrequency]
[Dynamic-linking native method java.lang.ClassLoader.defineClass1 ... JNI]
[Dynamic-linking native method java.lang.Runtime.gc ... JNI]
[Dynamic-linking native method java.lang.ref.Finalizer.invokeFinalizeMethod ... JNI]
阅读(1384) | 评论(0) | 转发(0) |