Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

problem of connecting weblogic6.0 to Oracle8i

0 views
Skip to first unread message

jeff

unread,
Dec 27, 2001, 1:02:13 AM12/27/01
to

Any ideas?

I tried to connect weblogic6.0 with a table in Oracle8.16, but it shows:
"Error 500-Internal Server Error
From RFC 2068 Hypertext Transfer Protocol--HTTP/1.1. 10.5.1.500 Internal Server
Error. The server encountered an unexpected condition which prevented it from
fulfilling the request."

The main configurations I did are: set the path in setEnv of weblogic
set CLASSPATH=%JAVA_HOME%\lib\tools.jar;......;%WL_HOME%\oracle\classes;%CLASSPATH%
set PATH=%WL_HOME%\bin;%JAVA_HOME%\bin;%WL_HOME%\bin\oci816; D:\Oracle\Ora8i\bin;%PATH%

On the weblogic consol JDBC connection pool:
Name: oraclepool (you can given any name)
URL: jdbc:weblogic:oracle:myserver
Driver Classname: weblogic.jdbc.oci.Driver

Properties user=jeff
password=jeff
server=myserver

(Testing on the weblogic console seems no problem)

Oracle8.16, use sqlplus and login with jeff/jeff can get the table cdwrtier.
check oracle dba studio: can find schema/Table/jeff/cdwriter

Major jsp code ( I tried the same code on Jrun and Mysql , it works well. I only
changed the URL and Driver name for Oracl)
....
class.forName("weblogic.jdbc.oci.Driver");
Connection Cnt=DriverManager.getConnetion("jdbc:weblogic:oracle:myserver");
Statement stmnt=rdCnt.createStatement();
Resultset resultSet=stmnt.executeQuery("SELECT * FROM cdwriter");

if(resultSet != null){
while(resultSet.next(){
......

}.....


As I typed above, the jsp code runs fine on Jrun3.1 or Mysql, only the class name
and the drivername is changed here. It is said that the weblogic6.0 or above it
contains the type_ two driver for oracle, so no driver download is needed, only
need to set the path and classpath in weblogic and configure jdbc connection pool
in the weblogic consol.

Any suggestions?
Thanks in advance for your help.
Jeff

Deepak Vohra

unread,
Dec 27, 2001, 11:50:29 AM12/27/01
to
the detail of Error generated by server.

jeff

unread,
Dec 27, 2001, 1:06:21 PM12/27/01
to

Hi,Deepak

Thanks for your quick response. The detail of Error generated by server is as
follows:


<Dec 27, 2001 10:49:59 AM MST> <Info> <HTTP> <Initializing WEB server myserver>

<Dec 27, 2001 10:49:59 AM MST> <Notice> <WebLogicServer> <WebLogic Server starte
d>
<Dec 27, 2001 10:49:59 AM MST> <Notice> <WebLogicServer> <ListenThread listening
on port 7001>
<Dec 27, 2001 10:49:59 AM MST> <Notice> <WebLogicServer> <SSLListenThread listen
ing on port 7002>
<Dec 27, 2001 10:49:59 AM MST> <Info> <NT Performance Pack> <NATIVE: NTSocketMux
er was built on Nov 17 2000 17:38:02
>
<Dec 27, 2001 10:53:07 AM MST> <Info> <NT Performance Pack> <Allocating: '2' NT
reader threads>
<Dec 27, 2001 10:53:07 AM MST> <Info> <HTTP> <[WebAppServletContext(4409470,Defa
ultWebApp_myserver)] *.jsp: init>
<Dec 27, 2001 10:53:07 AM MST> <Info> <HTTP> <[WebAppServletContext(4409470,Defa
ultWebApp_myserver)] *.jsp: param verbose initialized to: true>
<Dec 27, 2001 10:53:07 AM MST> <Info> <HTTP> <[WebAppServletContext(4409470,Defa
ultWebApp_myserver)] *.jsp: param packagePrefix initialized to: jsp_servlet>
<Dec 27, 2001 10:53:07 AM MST> <Info> <HTTP> <[WebAppServletContext(4409470,Defa
ultWebApp_myserver)] *.jsp: param compilerclass initialized to: javac>
<Dec 27, 2001 10:53:07 AM MST> <Info> <HTTP> <[WebAppServletContext(4409470,Defa
ultWebApp_myserver)] *.jsp: param srcCompiler initialized to weblogic.jspc>
<Dec 27, 2001 10:53:07 AM MST> <Info> <HTTP> <[WebAppServletContext(4409470,Defa
ultWebApp_myserver)] *.jsp: param superclass initialized to null>
<Dec 27, 2001 10:53:07 AM MST> <Info> <HTTP> <[WebAppServletContext(4409470,Defa
ultWebApp_myserver)] *.jsp: param workingDir initialized to: D:\bea\wlserver6.0\
config\mydomain\applications\DefaultWebApp_myserver\WEB-INF\_tmp_war_myserver_my
server_DefaultWebApp_myserver>
<Dec 27, 2001 10:53:07 AM MST> <Info> <HTTP> <[WebAppServletContext(4409470,Defa
ultWebApp_myserver)] *.jsp: param pageCheckSeconds initialized to: 1>
<Dec 27, 2001 10:53:07 AM MST> <Info> <HTTP> <[WebAppServletContext(4409470,Defa
ultWebApp_myserver)] *.jsp: initialization complete>
<Dec 27, 2001 10:53:07 AM MST> <Info> <HTTP> <[WebAppServletContext(4409470,Defa
ultWebApp_myserver)] *.jsp: pageCheckSeconds over-ruled in JSPServlet to : 1>
<Dec 27, 2001 10:53:07 AM MST> <Error> <HTTP> <[WebAppServletContext(4409470,Def
aultWebApp_myserver)] Root cause of ServletException
java.sql.SQLException: "user" value unspecified in Properties
at weblogic.jdbcbase.oci.Driver.connect(Driver.java:42)
at java.sql.DriverManager.getConnection(DriverManager.java:517)
at java.sql.DriverManager.getConnection(DriverManager.java:199)
at jsp_servlet._cdwriter._jspService(_cdwriter.java:93)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:213)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:246)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java:1265)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:1631)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)

Slava Imeshev

unread,
Dec 27, 2001, 6:14:10 PM12/27/01
to
Hi Jeff,

In your code your are calling the WebLogic oracle driver,
not a pool driver. When making a connection, you have to
supply required properties to the driver, like

Properties props = new Properties();
props.setProperty("user", "jeff");
props.setProperty("password", "jeff");
DriverManager.getConnection("jdbc:webwogic:oracle:myserver", props);


If you want to make a connection using weblogic connection pool,
your code could look like:

Class.forName("weblogic.jdbc.pool.Driver").newInstance();
DriverManager.getConnection("jdbc:weblogic:pool:oraclepool", null);

Regards,

Slava Imeshev


"jeff" <jeff...@lycos.com> wrote in message
news:3c2b631d$1...@newsgroups.bea.com...

jeff

unread,
Dec 27, 2001, 9:47:36 PM12/27/01
to

Hi, Slava,

Thanks for your help.Your reply helps me a lot.

I prefer the make connection with weblogic connection pool. Cause no hard-code
details such as password is needed for every individual client.

I modified my jsp code, but the error shows: Pool connect fialed. Java.sqlSQLException:
connection pool oraclepool does not exist.

1.The details are:

<Dec 27, 2001 7:07:16 PM MST> <Info> <HTTP> <Initializing WEB server myserver>
<Dec 27, 2001 7:07:17 PM MST> <Notice> <WebLogicServer> <WebLogic Server started
>
<Dec 27, 2001 7:07:17 PM MST> <Notice> <WebLogicServer> <ListenThread listening
on port 7001>
<Dec 27, 2001 7:07:17 PM MST> <Notice> <WebLogicServer> <SSLListenThread listeni
ng on port 7002>
<Dec 27, 2001 7:07:17 PM MST> <Info> <NT Performance Pack> <NATIVE: NTSocketMuxe


r was built on Nov 17 2000 17:38:02
>


<Dec 27, 2001 7:09:22 PM MST> <Info> <NT Performance Pack> <Allocating: '2' NT
r
eader threads>
<Dec 27, 2001 7:09:45 PM MST> <Info> <HTTP> <[WebAppServletContext(4777182,conso
le)] *.html: init>
<Dec 27, 2001 7:09:45 PM MST> <Info> <HTTP> <[WebAppServletContext(4777182,conso
le)] *.html: Using standard I/O>
<Dec 27, 2001 7:10:45 PM MST> <Info> <HTTP> <[WebAppServletContext(4409470,Defau
ltWebApp_myserver)] *.jsp: init>
<Dec 27, 2001 7:10:45 PM MST> <Info> <HTTP> <[WebAppServletContext(4409470,Defau


ltWebApp_myserver)] *.jsp: param verbose initialized to: true>

<Dec 27, 2001 7:10:45 PM MST> <Info> <HTTP> <[WebAppServletContext(4409470,Defau


ltWebApp_myserver)] *.jsp: param packagePrefix initialized to: jsp_servlet>

<Dec 27, 2001 7:10:45 PM MST> <Info> <HTTP> <[WebAppServletContext(4409470,Defau


ltWebApp_myserver)] *.jsp: param compilerclass initialized to: javac>

<Dec 27, 2001 7:10:45 PM MST> <Info> <HTTP> <[WebAppServletContext(4409470,Defau


ltWebApp_myserver)] *.jsp: param srcCompiler initialized to weblogic.jspc>

<Dec 27, 2001 7:10:45 PM MST> <Info> <HTTP> <[WebAppServletContext(4409470,Defau


ltWebApp_myserver)] *.jsp: param superclass initialized to null>

<Dec 27, 2001 7:10:45 PM MST> <Info> <HTTP> <[WebAppServletContext(4409470,Defau


ltWebApp_myserver)] *.jsp: param workingDir initialized to: D:\bea\wlserver6.0\c

onfig\mydomain\applications\DefaultWebApp_myserver\WEB-INF\_tmp_war_myserver_mys
erver_DefaultWebApp_myserver>

<Dec 27, 2001 7:10:45 PM MST> <Info> <HTTP> <[WebAppServletContext(4409470,Defau


ltWebApp_myserver)] *.jsp: param pageCheckSeconds initialized to: 1>

<Dec 27, 2001 7:10:45 PM MST> <Info> <HTTP> <[WebAppServletContext(4409470,Defau
ltWebApp_myserver)] *.jsp: initialization complete>
<Dec 27, 2001 7:10:45 PM MST> <Info> <HTTP> <[WebAppServletContext(4409470,Defau


ltWebApp_myserver)] *.jsp: pageCheckSeconds over-ruled in JSPServlet to : 1>

<Dec 27, 2001 7:10:45 PM MST> <Error> <HTTP> <[WebAppServletContext(4409470,Defa


ultWebApp_myserver)] Root cause of ServletException

java.sql.SQLException: Pool connect failed: java.sql.SQLException: Connection
Po
ol oraclepool does not exist.
at weblogic.jdbcbase.pool.Driver.connect(Driver.java:218)
at java.sql.DriverManager.getConnection(DriverManager.java:517)
at java.sql.DriverManager.getConnection(DriverManager.java:146)
at jsp_servlet._cdwriter._jspService(_cdwriter.java:94)


at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm

pl.java:213)at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm


pl.java:246) at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java:1265)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:1631)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
>

2. The JSP CODE:
<html>
<head>
<title>
CDwriter
</title>
</head>
<%@ page language="java" import="java.sql.*" %>
<body>
<h1> Product CD writer </h1>
<table border="2" width="280">
<tr>
<td> <b>ProductId</b></td> <td> <b>ProductName</b></td>
<td> <b>ProductPrice</b></td> <td><b>Availability</b></td>
</tr>
<%

Class.forName("weblogic.jdbc.pool.Driver").newInstance();
//Create an instance of JDBC driver

Connection rdCnt=DriverManager.getConnection("jdbc:weblogic:pool:oraclepool",null);
//create a connection to mySql databse through the JDBC driver

Statement stmnt= rdCnt.createStatement();
//create a statment object and assign it to the stmnt reefeence

ResultSet resultSet=stmnt.executeQuery("SELECT * FROM cdwriter");
//execute a query and pass the result to the object reference

if (resultSet != null ) {
while (resultSet.next()) {
String id=resultSet.getString("productId");
String lt =resultSet.getString("productName");
String ft =resultSet.getString("productPrice");
String crs =resultSet.getString("Availability");

%>

<tr>
<td><%=id %></td>
<td><%=lt %></td>
<td><%=ft %></td>
<td><%=crs %></td>
</tr>

<%

}/* close of while */
} /* close of if */

stmnt.close();
rdCnt.close(); //release the connection and resultset
%>

</table>
</body>
</html>

3. The major setEnt.cmd code:
@rem Set user-defined variables.
set WL_HOME=D:\bea\wlserver6.0
set JAVA_HOME=D:\bea\jdk130

@if exist %WL_HOME%\lib\weblogic.jar goto checkJava
@echo.
@echo The WebLogic Server wasn't found in directory %WL_HOME%.
@echo Please edit the setExamplesEnv.cmd script so that the WL_HOME
@echo variable points to the WebLogic Server installation directory.
@echo Your environment has not been set.
@goto finish

:checkJava
@if exist %JAVA_HOME%\bin\java.exe goto setEnv
@echo.
@echo The JDK wasn't found in directory %JAVA_HOME%.
@echo Please edit the setEnv.cmd script so that the JAVA_HOME
@echo variable points to the location of your JDK.
@echo Your environment has not been set.
@goto finish

:setEnv
set CLASSPATH=%JAVA_HOME%\lib\tools.jar;%WL_HOME%\lib\weblogic_spn.jar;%WL_HOME%\lib\weblogic.jar;%WL_HOME%\oracle\classes;%CLASSPATH%
set PATH=%WL_HOME%\bin;%JAVA_HOME%\bin;%WL_HOME%\bin\oci816_8;D:\Oracle\Ora8i\bin;%PATH%
@echo.
@echo Your environment has been set.

:finish

4.jdbc Connection pool of weblogic6.0
Name: oraclepool
URL: jdbc:weblogic:pool:oraclepool
Driver Classname: weblogic.jdbc.pool.Driver
Properties: user=none password=none server=none

intial Capacity 1 /Maximum Capacity 8/Capacity increment 2/ LoginDelay Seconds
1/Refersh Period 1/Shrink Period 15/

5.Database Information:
Oracle8.16,database instance name ordb,Schema table/jeff, table name cdwriter,
user/password jeff/jeff,

Any suggestions?

Thanks in advance for your help

Best regards

Jeff

Slava Imeshev

unread,
Dec 27, 2001, 10:52:28 PM12/27/01
to
Hi Jeff,

Have you created a connection pool named oraclepool?
If you have, have you assigned a target to the pool?

Regards,

Slava Imeshev


"jeff" <jeff...@lycos.com> wrote in message

news:3c2bdd48$1...@newsgroups.bea.com...

onfig\mydomain\applications\DefaultWebApp_myserver\WEB-INF\_tmp_war_myserver
_mys
> erver_DefaultWebApp_myserver>

Jeff

unread,
Dec 28, 2001, 5:39:44 PM12/28/01
to

Hi, Slava,

Thanks for your reply. I have created a connection pool named oraclepool on the
jdbc console of weblogic6.0. The details are:



Name: oraclepool
URL: jdbc:weblogic:pool:oraclepool
Driver Classname: weblogic.jdbc.pool.Driver
Properties: user=none
password=none
server=none

But not assign a trget to the pool. I will put it on the properties of weblogic
jdbc consol like this:
Properties: user=none
password=none
server=none
Targttable=cdwriter
I will try it
Thanks

Slava Imeshev

unread,
Dec 28, 2001, 6:08:26 PM12/28/01
to
What is Targttable? You assign target by clicking on Targets tab
at the connection pool definition when using weblogic console.

Regards,

Slava Imeshev

"Jeff" <Jeff...@lycos.com> wrote in message
news:3c2cf4b0$1...@newsgroups.bea.com...

>onfig\mydomain\applications\DefaultWebApp_myserver\WEB-INF\_tmp_war_myserve
r
> >_mys
> >> erver_DefaultWebApp_myserver>

Deepak Vohra

unread,
Dec 30, 2001, 9:30:20 PM12/30/01
to
Jeff
Connection Pool configuration

Name: oraclepool

url=jdbc:weblogic:oracle

Driver Classname= weblogic.jdbc.pool.Driver

Properties
user=<user>
password=<password>
server=<server>

After setting the configuration select Targets tab. Select server Available to
Chosen.

Deepak

Deepak Vohra

unread,
Dec 30, 2001, 9:32:35 PM12/30/01
to
driver class should be
driver Class= weblogic.jdbc.oci.Driver

jeff

unread,
Jan 2, 2002, 7:10:52 PM1/2/02
to

Hello Deepak and Slava,

My target table was not set, the ">" should be clicked to set myserver as the
target.

Now I upgrade the system to Weblogic 6.1 from 6.0.
Databse is upgraded to oracle8.1.7 from 8.1.6.

Now the error shows: no weblogic oci37 in java.libaray.path. The details are:


<Jan 2, 2002 4:50:44 PM MST> <Notice> <WebLogicServer> <Started WebLogic Admin
S
erver "myserver" for domain "mydomain" running in Production Mode>
<Jan 2, 2002 4:53:14 PM MST> <Error> <HTTP> <[WebAppServletContext(6374053,Defau
ltWebApp,/DefaultWebApp)] Root cause of ServletException
java.sql.SQLException: System.loadLibrary(weblogicoci37) threw java.lang.Unsatis
fiedLinkError: no weblogicoci37 in java.library.path
at weblogic.jdbc.oci.Driver.loadLibraryIfNeeded(Driver.java:226)
at weblogic.jdbc.oci.Driver.connect(Driver.java:76)
at jsp_servlet._cdwriter._jspService(_cdwriter.java:100)


at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm

pl.java:263)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:302)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:200)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java:2390)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:1959)


at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)

The key part of the JSP code is:
Properties props=new Properties();
props.put("user","jeff");
props.put("password","jeff");
props.put("server","orant");

Driver myDriver=(Driver)Class.forName("weblogic.jdbc.oci.Driver").newInstance();


//Create an instance of JDBC driver


Connection rdCnt=myDriver.connect("jdbc:weblogic:oracle:orant:cdwriter",props);


//create a connection to mySql databse through the JDBC driver

Statement stmnt= rdCnt.createStatement();
//create a statment object and assign it to the stmnt reefeence

ResultSet resultSet=stmnt.executeQuery("SELECT * FROM cdwriter");
//execute a query and pass the result to the object reference


The SetEnv code:
set WL_HOME=C:\bea\wlserver6.1
set JAVA_HOME=C:\bea\jdk130
setEnv
set CLASSPATH=%JAVA_HOME%\lib\tools.jar; %WL_HOME%\lib\weblogic_sp.jar;%WL_HOME%\lib\weblogic.jar;%WL_HOME%\oci\classes;
%CLASSPATH%
set PATH=%WL_HOME%\bin;%JAVA_HOME%\bin;%WL_HOME%\bin\oci817_8;C:\oracle\ora81\bin;C:\oracle\ora81\lib;%PATH%

orant is the databse name, cdwriter name is the table name.

Is anything with the Enviroment setting?
Best Regards
jeff

jeff

unread,
Jan 2, 2002, 7:19:53 PM1/2/02
to

"jeff" <jeff...@lycos.com> wrote:
>
>Hello all,

I think that maybe something wrong with the env. setting.
I have put oracle\ora81\lib\class12.zip in the classpath also( in front of weblogic.jar),
similar error occured.

Regards

Jeff

Sree Bodapati

unread,
Jan 3, 2002, 11:19:59 AM1/3/02
to
jeff

Your setenv looks ok except for the extra setEnv inside it. may be thats the
problem. Make sure you are executing the setenv in the same command propt
window as the place where you plan to start the server from.


try:

set WL_HOME=C:\bea\wlserver6.1
set JAVA_HOME=C:\bea\jdk130

set CLASSPATH=%JAVA_HOME%\lib\tools.jar;
%WL_HOME%\lib\weblogic_sp.jar;%WL_HOME%\lib\weblogic.jar;%CLASSPATH%


set
PATH=%WL_HOME%\bin;%JAVA_HOME%\bin;%WL_HOME%\bin\oci817_8;C:\oracle\ora81\bi
n;C:\oracle\ora81\lib;%PATH%

hth
/
sree


"jeff" <jeff...@lycos.com> wrote in message

news:3c33a18c$2...@newsgroups.bea.com...

Hello Deepak and Slava,

>onfig\mydomain\applications\DefaultWebApp_myserver\WEB-INF\_tmp_war_myserve
r
>> >_mys
>> >> erver_DefaultWebApp_myserver>

jeff22_7

unread,
Jan 3, 2002, 1:26:26 PM1/3/02
to

Helo Stree,

Thanks for your email, I follow your suggestion and run it on the same command,
it works perfect.

Thanks fro your help again, it save us plent of time.

Regards
jeff

Sree Bodapati

unread,
Jan 3, 2002, 1:48:06 PM1/3/02
to
Nice to know it helped.

Anytime
/
sree

"jeff22_7" <jeff...@lycos.com> wrote in message
news:3c34a252$1...@newsgroups.bea.com...

0 new messages