Re: weblogic8.1 and mysql connection failure, please help - Weblogic

This is a discussion on Re: weblogic8.1 and mysql connection failure, please help - Weblogic ; 1. This assumes that you have downloaded the mysql database and configured it and started it by running mysqld. In my case, I installed it in d:/mysql. 2. It also assumes that you have configured a user on the database. ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: Re: weblogic8.1 and mysql connection failure, please help

  1. Re: weblogic8.1 and mysql connection failure, please help

    1. This assumes that you have downloaded the mysql database and configured it and started
    it by running mysqld. In my case, I installed it in d:/mysql.

    2. It also assumes that you have configured a user on the database.
    I configured a user "test" with password "test" on the database "mysql" on "localhost" using
    mysql --user=root mysql
    grant all privileges on *.* to test@localhost identified by 'test' with grant option;


    3. It assumes that you have downloaded the Connector/J zip file and pulled out the jar file.
    In my case, I renamed it and copied it to d:/mysql/lib/jdbc.jar.

    4. It is absolutely necessary that you put the jar file in your server classpath. It won't
    work without doing that. Then I booted the server.

    5. I used the WLS 8.1 console to configure the connection pool and associated data source.
    In my case, they look like the following:
    Name="mysql" Password="test"
    Properties="user=test"
    Targets="myserver"
    TestTableName="SQL SELECT 1"
    URL="jdbc:mysql://localhost:3306/mysql"/>
    JNDIName="myDataSource"
    Name="myDataSource"
    PoolName="mysql"
    Targets="myserver"/>

    Note that the console uses the old class name for the driver. There is a new class name but
    the old name still exists and we figured it would cover folks using the old and new classes.

    6. I'll attach a client program that looks up the datasource associated with the connection pool,
    gets a connection, and does some stuff with the connection.
    The user/password combination must have security priviledges in WLS to reserve a connection
    on the pool.

    The code for this program is taken almost entirely from the WLS JDBC documentation.
    This is all pretty standard stuff.






    "Roland" wrote in message news:3f44a0cc$1@newsgroups.bea.com...
    >
    > 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.
    >
    > The following is my connection pool setting found in config.xml:
    >
    > > Name="MySQLConnectionPool" Password="{3DES}aMsyd4ZSbSg="
    > Properties="user=root" Targets="cgServer" URL="jdbc:mysql://localhost/userdb"/>
    > > JNDIName="MySQLDataSource" Name="MySQLDataSource"
    > PoolName="MySQLConnectionPool" Targets="cgServer"/>
    >
    >
    >
    > The screen shot of the exceptions is as below:
    >
    > <2003-8-21 下午17时14分08秒 EST> > "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(Secure ClassLoader.java:12
    > 3)
    > at weblogic.utils.classloaders.GenericClassLoader.fin dLocalClass(Generic
    > ClassLoader.java:476)
    > at weblogic.utils.classloaders.GenericClassLoader.fin dClass(GenericClass
    > Loader.java:181)
    > at java.lang.ClassLoader.loadClass(ClassLoader.java:2 99)
    > at java.lang.ClassLoader.loadClass(ClassLoader.java:2 55)
    > at weblogic.utils.classloaders.GenericClassLoader.loa dClass(GenericClass
    > Loader.java:223)
    > at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:315)
    > at java.lang.Class.forName0(Native Method)
    > at java.lang.Class.forName(Class.java:217)
    > at weblogic.utils.classfile.utils.CodeGenerator.gener ateClass(CodeGenera
    > tor.java:71)
    > at weblogic.utils.wrapper.WrapperFactory.generateWrap perClass(WrapperFac
    > tory.java:331)
    > at weblogic.utils.wrapper.WrapperFactory.getWrapperCl ass(WrapperFactory.
    > java:167)
    > at weblogic.jdbc.wrapper.JDBCWrapperFactory.getWrappe r(JDBCWrapperFactor
    > y.java:66)
    > at weblogic.jdbc.pool.Driver.allocateConnection(Drive r.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.getCon nection(RmiDataSour
    > ce.java:298)
    > at jsp_servlet.__testmysql._jspService(__testmysql.ja va:129)
    > at weblogic.servlet.jsp.JspBase.service(JspBase.java: 33)
    > at weblogic.servlet.internal.ServletStubImpl$ServletI nvocationAction.run
    > (ServletStubImpl.java:1053)
    > at weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubIm
    > pl.java:387)
    > at weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubIm
    > pl.java:431)
    > at weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubIm
    > pl.java:305)
    > at weblogic.servlet.internal.WebAppServletContext$Ser vletInvocationActio
    > n.run(WebAppServletContext.java:6310)
    > at weblogic.security.acl.internal.AuthenticatedSubjec t.doAs(Authenticate
    > dSubject.java:317)
    > at weblogic.security.service.SecurityManager.runAs(Se curityManager.java:
    > 118)
    > at weblogic.servlet.internal.WebAppServletContext.inv okeServlet(WebAppSe
    > rvletContext.java:3622)
    > at weblogic.servlet.internal.ServletRequestImpl.execu te(ServletRequestIm
    > pl.java:2569)
    > at weblogic.kernel.ExecuteThread.execute(ExecuteThrea d.java:197)
    > at weblogic.kernel.ExecuteThread.run(ExecuteThread.ja va:170)
    > <2003-8-21 下午17时14分42秒 EST> <[ServletContext(id
    > =2960804,name=forum,context-path=/forum)] Root cause of ServletException.
    > java.sql.SQLException: Cannot obtain connection: driverURL = jdbc:weblogicool:
    > 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.createWrappe r(WrapperFactory.ja
    > va:141)
    > at weblogic.jdbc.wrapper.JDBCWrapperFactory.getWrappe r(JDBCWrapperFactor
    > y.java:73)
    > at weblogic.jdbc.pool.Driver.allocateConnection(Drive r.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.getCon nection(RmiDataSour
    > ce.java:298)
    > at jsp_servlet.__testmysql._jspService(__testmysql.ja va:129)
    > at weblogic.servlet.jsp.JspBase.service(JspBase.java: 33)
    > at weblogic.servlet.internal.ServletStubImpl$ServletI nvocationAction.run
    > (ServletStubImpl.java:1053)
    > at weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubIm
    > pl.java:387)
    > at weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubIm
    > pl.java:431)
    > at weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubIm
    > pl.java:305)
    > at weblogic.servlet.internal.WebAppServletContext$Ser vletInvocationActio
    > n.run(WebAppServletContext.java:6310)
    > at weblogic.security.acl.internal.AuthenticatedSubjec t.doAs(Authenticate
    > dSubject.java:317)
    > at weblogic.security.service.SecurityManager.runAs(Se curityManager.java:
    > 118)
    > at weblogic.servlet.internal.WebAppServletContext.inv okeServlet(WebAppSe
    > rvletContext.java:3622)
    > at weblogic.servlet.internal.ServletRequestImpl.execu te(ServletRequestIm
    > pl.java:2569)
    > at weblogic.kernel.ExecuteThread.execute(ExecuteThrea d.java:197)
    > at weblogic.kernel.ExecuteThread.run(ExecuteThread.ja va: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.getCon nection(RmiDataSour
    > ce.java:298)
    > at jsp_servlet.__testmysql._jspService(__testmysql.ja va:129)
    > at weblogic.servlet.jsp.JspBase.service(JspBase.java: 33)
    > at weblogic.servlet.internal.ServletStubImpl$ServletI nvocationAction.run
    > (ServletStubImpl.java:1053)
    > at weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubIm
    > pl.java:387)
    > at weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubIm
    > pl.java:431)
    > at weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubIm
    > pl.java:305)
    > at weblogic.servlet.internal.WebAppServletContext$Ser vletInvocationActio
    > n.run(WebAppServletContext.java:6310)
    > at weblogic.security.acl.internal.AuthenticatedSubjec t.doAs(Authenticate
    > dSubject.java:317)
    > at weblogic.security.service.SecurityManager.runAs(Se curityManager.java:
    > 118)
    > at weblogic.servlet.internal.WebAppServletContext.inv okeServlet(WebAppSe
    > rvletContext.java:3622)
    > at weblogic.servlet.internal.ServletRequestImpl.execu te(ServletRequestIm
    > pl.java:2569)
    > at weblogic.kernel.ExecuteThread.execute(ExecuteThrea d.java:197)
    > at weblogic.kernel.ExecuteThread.run(ExecuteThread.ja va:170)
    > >






  2. RE: Re: weblogic8.1 and mysql connection failure, please help

    Hi Steven,

    i also face weblogic8.1 and mysql connection problem as Roland. i've follow the step as you listed. i set the server classpath like this:
    set CLASSPATH=%WEBLOGIC_CLASSPATH%;C:\mysql\lib\jdbc.j ar;%POINTBASE_CLASSPATH%;%JAVA_HOME%\jre\lib\rt.ja r;%WL_HOME%\server\lib\webservices.jar;C:\bea\user _projects\domains\Training\applications\DefaultWeb App\WEB-INF\classes;%CLASSPATH%

    Is there any wrong with the class path?? Why i still got the exception??
    Pls help me.. i'll really appreciate your help!!

    Regards,
    Siau Wea

    "It is absolutely necessary that you put the jar file in your server classpath. It won't
    work without doing that. Then I booted the server."

  3. RE: Re: weblogic8.1 and mysql connection failure, please help

    Hi Steven,

    i also face weblogic8.1 and mysql connection problem as Roland. i've follow the step as you listed. i set the server classpath like this:
    set CLASSPATH=%WEBLOGIC_CLASSPATH%;C:\mysql\lib\jdbc.j ar;%POINTBASE_CLASSPATH%;%JAVA_HOME%\jre\lib\rt.ja r;%WL_HOME%\server\lib\webservices.jar;C:\bea\user _projects\domains\Training\applications\DefaultWeb App\WEB-INF\classes;%CLASSPATH%

    Is there any wrong with the class path?? Why i still got the exception??
    Pls help me.. i'll really appreciate your help!!

    Regards,
    Siau Wea

    "It is absolutely necessary that you put the jar file in your server classpath. It won't
    work without doing that. Then I booted the server."

  4. RE: Re: weblogic8.1 and mysql connection failure, please help


    siau wea wrote:
    >Hi Steven,
    >
    >i also face weblogic8.1 and mysql connection problem as Roland. i've
    >follow the step as you listed. i set the server classpath like this:
    >set CLASSPATH=%WEBLOGIC_CLASSPATH%;C:\mysql\lib\jdbc.j ar;%POINTBASE_CLASSPATH%;%JAVA_HOME%\jre\lib\rt.ja r;%WL_HOME%\server\lib\webservices.jar;C:\bea\user _projects\domains\Training\applications\DefaultWeb App\WEB-INF\classes;%CLASSPATH%
    >
    >Is there any wrong with the class path?? Why i still got the exception??
    >Pls help me.. i'll really appreciate your help!!
    >
    >Regards,
    >Siau Wea
    >
    >"It is absolutely necessary that you put the jar file in your server
    >classpath. It won't
    >work without doing that. Then I booted the server."


    I had same problem. I'm just set my CLASS_PATH as %WEBLOGIC_CLASSPATH%;D:\mysql-connector-java-3.0.11-stable-bin.jar;%WL_HOME%\server\lib\webservices.jar;%CLAS SPATH%;
    and then main
    !!!!! delete mysql-connector-java-3.0.11-stable-bin.jar from all classpath of
    your Java VM, especially from %JDK_PATH%/jre/lib/ext/ !!!!
    and then all work.

  5. RE: Re: weblogic8.1 and mysql connection failure, please help


    Thanks Salos for your reply.

    I tried what you suggest, i put the jar file in c:\ then i delete the same jar
    file from %JDK_PATH%/jre/lib/ext/, but when i want to test the connection in the
    configuration wizard, a message said the the JDBC driver is not in the CLASSPATH.


    My classpath is set as :
    "set CLASSPATH=%WEBLOGIC_CLASSPATH%;C:mysql-connector-java-3.0.11-stable-bin.jar;%POINTBASE_CLASSPATH%;%JAVA_HOME%\jre\lib\ rt.jar;%WL_HOME%\server\lib\webservices.jar;%CLASS PATH%"

    I already put it in classpath of my server, don't know why it still can not read
    the driver from that??



    Best Regards,
    Siau Wea


    "Salos" wrote:
    >
    >siau wea wrote:
    >>Hi Steven,
    >>
    >>i also face weblogic8.1 and mysql connection problem as Roland. i've
    >>follow the step as you listed. i set the server classpath like this:
    >>set CLASSPATH=%WEBLOGIC_CLASSPATH%;C:\mysql\lib\jdbc.j ar;%POINTBASE_CLASSPATH%;%JAVA_HOME%\jre\lib\rt.ja r;%WL_HOME%\server\lib\webservices.jar;C:\bea\user _projects\domains\Training\applications\DefaultWeb App\WEB-INF\classes;%CLASSPATH%
    >>
    >>Is there any wrong with the class path?? Why i still got the exception??
    >>Pls help me.. i'll really appreciate your help!!
    >>
    >>Regards,
    >>Siau Wea
    >>
    >>"It is absolutely necessary that you put the jar file in your server
    >>classpath. It won't
    >>work without doing that. Then I booted the server."

    >
    >I had same problem. I'm just set my CLASS_PATH as %WEBLOGIC_CLASSPATH%;D:\mysql-connector-java-3.0.11-stable-bin.jar;%WL_HOME%\server\lib\webservices.jar;%CLAS SPATH%;
    >and then main
    >!!!!! delete mysql-connector-java-3.0.11-stable-bin.jar from all classpath
    >of
    >your Java VM, especially from %JDK_PATH%/jre/lib/ext/ !!!!
    >and then all work.



  6. RE: Re: weblogic8.1 and mysql connection failure, please help


    Hi,

    I am so glad that to said that i have succesful to do the connection!!
    Before this i said still cant work may be because i missing some where i think..
    When i create a new domain with all the configuration u suggest, then everything
    is work perfectly!!
    Thanks a lot!! Really!!

    By the way, do u know how to store java object into mysql??

    Best Regards,
    Siau Wea


    "Salos" wrote:
    >
    >siau wea wrote:
    >>Hi Steven,
    >>
    >>i also face weblogic8.1 and mysql connection problem as Roland. i've
    >>follow the step as you listed. i set the server classpath like this:
    >>set CLASSPATH=%WEBLOGIC_CLASSPATH%;C:\mysql\lib\jdbc.j ar;%POINTBASE_CLASSPATH%;%JAVA_HOME%\jre\lib\rt.ja r;%WL_HOME%\server\lib\webservices.jar;C:\bea\user _projects\domains\Training\applications\DefaultWeb App\WEB-INF\classes;%CLASSPATH%
    >>
    >>Is there any wrong with the class path?? Why i still got the exception??
    >>Pls help me.. i'll really appreciate your help!!
    >>
    >>Regards,
    >>Siau Wea
    >>
    >>"It is absolutely necessary that you put the jar file in your server
    >>classpath. It won't
    >>work without doing that. Then I booted the server."

    >
    >I had same problem. I'm just set my CLASS_PATH as %WEBLOGIC_CLASSPATH%;D:\mysql-connector-java-3.0.11-stable-bin.jar;%WL_HOME%\server\lib\webservices.jar;%CLAS SPATH%;
    >and then main
    >!!!!! delete mysql-connector-java-3.0.11-stable-bin.jar from all classpath
    >of
    >your Java VM, especially from %JDK_PATH%/jre/lib/ext/ !!!!
    >and then all work.



+ Reply to Thread