The following is my connection pool setting found in config.xml:
<JDBCConnectionPool DriverName="com.mysql.jdbc.Driver"
Name="MySQLConnectionPool" Password="{3DES}aMsyd4ZSbSg="
Properties="user=root" Targets="cgServer" URL="jdbc:mysql://localhost/userdb"/>
<JDBCTxDataSource EnableTwoPhaseCommit="true"
JNDIName="MySQLDataSource" Name="MySQLDataSource"
PoolName="MySQLConnectionPool" Targets="cgServer"/>
The screen shot of the exceptions is as below:
<2003-8-21 下午17时14分08秒 EST> <Notice> <WebLogicServer> <BEA-000355> <Thread
"ListenThread.Default" listening on port 7001, ip address *.*>
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:12
3)
at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(Generic
ClassLoader.java:476)
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClass
Loader.java:181)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClass
Loader.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(CodeGenera
tor.java:71)
at weblogic.utils.wrapper.WrapperFactory.generateWrapperClass(WrapperFac
tory.java:331)
at weblogic.utils.wrapper.WrapperFactory.getWrapperClass(WrapperFactory.
java:167)
at weblogic.jdbc.wrapper.JDBCWrapperFactory.getWrapper(JDBCWrapperFactor
y.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(RmiDataSour
ce.java:298)
at jsp_servlet.__testmysql._jspService(__testmysql.java:129)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
(ServletStubImpl.java:1053)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:387)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:431)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:305)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
n.run(WebAppServletContext.java:6310)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:317)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
118)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java:3622)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:2569)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
<2003-8-21 下午17时14分42秒 EST> <Error> <HTTP> <BEA-101017> <[ServletContext(id
=2960804,name=forum,context-path=/forum)] Root cause of ServletException.
java.sql.SQLException: Cannot obtain connection: driverURL = jdbc:weblogic:pool:
MySQLConnectionPool, props = {enableTwoPhaseCommit=false, jdbcTxDataSource=true,
connectionPoolID=MySQLConnectionPool, dataSourceName=MySQLDataSource}.
Nested Exception: java.lang.RuntimeException: Failed to Generate Wrapper Class
at weblogic.utils.wrapper.WrapperFactory.createWrapper(WrapperFactory.ja
va:141)
at weblogic.jdbc.wrapper.JDBCWrapperFactory.getWrapper(JDBCWrapperFactor
y.java:73)
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(RmiDataSour
ce.java:298)
at jsp_servlet.__testmysql._jspService(__testmysql.java:129)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
(ServletStubImpl.java:1053)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:387)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:431)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:305)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
n.run(WebAppServletContext.java:6310)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:317)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
118)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java:3622)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:2569)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
at weblogic.jdbc.jts.Driver.wrapAndThrowSQLException(Driver.java:395)
at weblogic.jdbc.jts.Driver.getNonTxConnection(Driver.java:448)
at weblogic.jdbc.jts.Driver.connect(Driver.java:138)
at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSour
ce.java:298)
at jsp_servlet.__testmysql._jspService(__testmysql.java:129)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
(ServletStubImpl.java:1053)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:387)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:431)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:305)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
n.run(WebAppServletContext.java:6310)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:317)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
118)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java:3622)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:2569)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
>
Roland wrote:
> Pardon me for repeating this topic. I have spent 2 days on this but still ended
> up with failure.
> The similar configuration works very well under wls7.0.
> It should not be a problem of jdbc driver or its classpath setting, since the
> system console say "successful..."
> But when I try to access jsp and servlets, it always throws execeptions. All projects
> run successfully under wls7.0 don't work.
> Please give me some advice, thanks in advance.
Hi, that's odd. The other customer eventually found out it was a server classpath
problem, but I don''t recall how he resolved it... In your servlet, would you
print out what the servlet thinks is the class path:
String theClassPath = "The classpath is " + System.getProperty("java.class.path");
Thanks,
Joe
Thanks so much for your reply. <br>
I have printed the classpath following your instruction. Actually I put the jar
file of mysql jdbc driver under the folder D:\bea\jdk141_03\jre\lib\ext\, so it
should be unnecessary to specify the driver in the classpath, right? I am pretty
sure that the jdbc driver can be detected by the server, but I am not so clear
if there is anything wrong with the overall classpath setting.<br>
As I mentioned before, one error message (it's also the first exception thrown)
I always got is: <br>
java.lang.NoClassDefFoundError: weblogic/jdbc/wrapper/PoolConnection
at java.lang.ClassLoader.defineClass0(Native Method)
<br>
So I doubt that a class called PoolConnection is missing. I used the Configuration
Wizard to create the working domain, and after that I didn't modify any part of
the classpath or environment setting files generated by the Wizard.<br>
The classpath is d:\bea\WEBLOG~1\server\lib\weblogic_knex_patch.jar;d:\bea\WEBLOG~1\common\lib\log4j.jar;d:\bea\WEBLOG~1\server\lib\debugging.jar;d:\bea\WEBLOG~1\server\lib\knex.jar;d:\bea\WEBLOG~1\javelin\lib\javelin.jar;d:\bea\WEBLOG~1\server\lib\wlw-lang.jar;;d:\bea\JDK141~1\lib\tools.jar;d:\bea\WEBLOG~1\server\lib\weblogic_sp.jar;d:\bea\WEBLOG~1\server\lib\weblogic.jar;d:\bea\WEBLOG~1\server\lib\ojdbc14.jar;d:\bea\WEBLOG~1\server\lib\ant\ant.jar;d:\bea\JDK141~1\jre\lib\rt.jar;d:\bea\WEBLOG~1\common\eval\pointbase\lib\pbserver44.jar;d:\bea\WEBLOG~1\common\eval\pointbase\lib\pbclient44.jar;;d:\bea\WEBLOG~1\server\lib\webserviceclient.jar;d:\bea\WEBLOG~1\server\lib\webserviceclient+ssl.jar;d:\bea\WEBLOG~1\server\lib\xbean.jar;d:\bea\WEBLOG~1\server\lib\xmarshal.jar;d:\bea\WEBLOG~1\server\lib\xqrl.jar;d:\bea\WEBLOG~1\server\lib\netui\netui-compiler.jar;d:\bea\WEBLOG~1\server\lib\wli.jar;d:\bea\WEBLOG~1\server\lib\wlxtrt.jar;d:\bea\WEBLOG~1\server\lib\fop.jar;d:\bea\WEBLOG~1\integration\lib\wlai-server.jar;d:\bea\WEBLOG~1\integration\adapters\sample\lib\sample-eis.jar;
Anyway, thank you very much Joe.
Can you try to write a small program that connects and
executes a statement accessing MySQL driver directly?
That will help you to ensure that you really have the driver
in class path - the fact that weblogic doesn't complain about
the driver because you use default connection pool settings
and for those settings don't require creating connections
on startup.
I'd also provide explicit values for the pool size settings.
Regards,
Slava Imeshev
"Roland" <arie...@hotmail.com> wrote in message news:3f44a0cc$1...@newsgroups.bea.com...
I had a very similar problem (MySQL, classpath stuff, PointBase, etc). What
I found worked for me, was to follow the MySQL instructions (which I'm sure
you did :>), update the classpath stuff, and here's the crux, totally take
out the PointBase stuff from anywhere in any/all xml files! I asked several
times if I needed it, and it turns out, it's just some other DB wls installs
by default on every new domain. :< Once I took it out, I was gtg (good to
go :>).
Good luck! :>
"Roland" <arie...@hotmail.com> wrote in message
news:3f47...@newsgroups.bea.com...
2. The jar file for Pointbase should not be in the CLASSPATH before the MySQL
jar. I haven't confirmed this but that's what another newsgroup poster found.
Further information about using MySQL and a small sample program are at
news://newsgroups.bea.com/3f57...@newsgroups.bea.com
"Roland" <arie...@hotmail.com> wrote in message news:3f47...@newsgroups.bea.com...
>