帮忙求助阿,谢了

05-03-18 一剑封喉
我用JB+wl+acess做的ejb(SessionBean带access数据库)
编译部署都OK,但是客户端调用一下后,就是当执行 con=ds.getConnection();句时,总出现以下异常(我检测过了,datasource,即ds,都没问题的。问题肯定在 con=ds.getConnection();):
java.lang.NoClassDefFoundError: weblogic/jdbc/wrapper/PoolConnection

at java.lang.ClassLoader.defineClass0(Native Method)

at java.lang.ClassLoader.defineClass(ClassLoader.java:502)

at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)

at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:476)

at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:181)

at java.lang.ClassLoader.loadClass(ClassLoader.java:299)

at java.lang.ClassLoader.loadClass(ClassLoader.java:255)

at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:223)

at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:217)

at weblogic.utils.classfile.utils.CodeGenerator.generateClass(CodeGenerator.java:71)

at weblogic.utils.wrapper.WrapperFactory.generateWrapperClass(WrapperFactory.java:331)

at weblogic.utils.wrapper.WrapperFactory.getWrapperClass(WrapperFactory.java:167)

at weblogic.jdbc.wrapper.JDBCWrapperFactory.getWrapper(JDBCWrapperFactory.java:66)

at weblogic.jdbc.pool.Driver.allocateConnection(Driver.java:242)

at weblogic.jdbc.pool.Driver.connect(Driver.java:158)

at weblogic.jdbc.jts.Driver.getNonTxConnection(Driver.java:444)

at weblogic.jdbc.jts.Driver.connect(Driver.java:138)

at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:298)

at untitled5.Enterprise1Bean.ejbCreate(Enterprise1Bean.java:18)

at untitled5.Enterprise1_qozm0g_Impl.ejbCreate(Enterprise1_qozm0g_Impl.java:135)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:324)

at weblogic.ejb20.manager.StatefulSessionManager.create(StatefulSessionManager.java:826)

at weblogic.ejb20.manager.StatefulSessionManager.remoteCreate(StatefulSessionManager.java:878)

at weblogic.ejb20.internal.StatefulEJBHome.create(StatefulEJBHome.java:133)

at untitled5.Enterprise1_qozm0g_HomeImpl.create(Enterprise1_qozm0g_HomeImpl.java:72)

at untitled5.Enterprise1_qozm0g_HomeImpl_WLSkel.invoke(Unknown Source)

at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:466)

at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:108)

at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:409)

at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:353)

at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:144)

at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:404)

at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)

at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)

at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)

好像是驱动的问题啊。这就怪了,数据源设置是这样的:
Driver: sun.jdbc.odbc.JdbcOdbcDriver
url: jdbc:odbc:TestDB(TesDB是我设置的数据源名称,没问题)
我用一般的java程序都用这样的驱动阿,请高手解答
谢谢

bigsurge
2005-11-15 23:56
> Right then, I guess you can try placing the driver
> class in the WEB-INF/lib or APP-INF/lib directory as
> well as leaving it on the system or application
> classpath.
>
> In case this is some sort of odd classloading bug
> occuring on your OS I would try exploding the jar
> file and try adding the directory structure to your
> classpath or WEB-INF/classes etc.
>
> Hoos

I don't think this is an issue with the classloader not finding the driver. From the output, it appears that when Weblogic tries to generate the Proxy Class, the classpath at that point is () or empty. I base that on the debug output from the class loaders

猜你喜欢