Tomcat and Oracle custom tag library

From: GiannisA <gexakis_at_hotmail.com>
Date: Wed, 19 Feb 2003 22:49:11 +0200
Message-ID: <b30qka$5mr$1_at_usenet.otenet.gr>



When i am trying to open a database connection using this command

<%--Retrieving profiles for current user --%>
<database:dbOpen connId="ProfilesConnection"

                  user="<%=UserSession.getdbUser()%>"
                  password="<%=UserSession.getdbPass()%>"
                  URL="<%=UserSession.getdbURL()%>"
                  scope="page" commitOnClose="true">

</database:dbOpen>

using the oracle custom tag library for Jdeveloper

I get the error bellow although the same program works fine on Tomcat 3.

javax.servlet.ServletException:
oracle.jsp.dbutil.ConnBean.getDataSource()Ljava/lang/String;

        at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp l.java:497)

        at org.apache.jsp.profiles_jsp._jspService(profiles_jsp.java:309)
        at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:136)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java)
        at

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2 02)

        at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)

        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java)
        at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDi
        .......

Steps to reproduce:
  Try mike_at_in.gr/mike at http://www.intelligence.tuc.gr/aler/login.html as email/password.

Additional Builds and Platforms:

  • Occurs on Tomcat 4.1 on Linux or Windows.
  • Doesn't occur on Tomcat 3 on Linux or Windows.

the whole file that this happens is profiles.jsp bellow.

<%_at_ taglib uri="sqltaglib.tld" prefix="database" %>
<html>

<jsp:useBean id="UserSession" class="alert.LoginBean" scope="session" >
</jsp:useBean>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
<meta name="description" content="Library Alert System Technical University
of Crete">
<meta name="keywords" content="library , alert , technical , university ,
crete">
<meta name="author" content="Giannis Alexakis">

<title>Library Alert Service</title>
<link rel="stylesheet" type="text/css" href="style.css" />

</head>

<body >

<!-- First div, this is the left bar -->
<div align="center" class="menu">

  <table border="1">
    <tbody>
    <tr>

      <td>
      <table cellpadding="4">
        <tbody>
        <tr>
          <th>Menu</th>
        </tr>
        <tr>
          <th><hr /></th>
        </tr>
        <tr>
          <td class="button"

onMouseover="this.style.backgroundColor='#ADD1E9'" onMouseout="this.style.backgroundColor='#EEEEEE'">
          <a href="logout.jsp">Logout</a></td>
        </tr>
        <tr>
          <td class="button"

onMouseover="this.style.backgroundColor='#ADD1E9'" onMouseout="this.style.backgroundColor='#EEEEEE'">
          <a href="userinfo.jsp">Personal</a></td>
        </tr>
        <tr>
          <td class="button"

onMouseover="this.style.backgroundColor='#ADD1E9'" onMouseout="this.style.backgroundColor='#EEEEEE'">
          <a href="profiles.jsp">Profiles</a></td>
        </tr>
        <tr>
          <td class="button"

onMouseover="this.style.backgroundColor='#ADD1E9'" onMouseout="this.style.backgroundColor='#EEEEEE'">
          <a href="helpuser.html">Help</a></td>
        </tr>
      </tbody>
      </table>
      </td>

    </tr>
  </tbody>
  </table>
</div>

<!-- Second div, bar at top -->
<div class="top" align="right">

  <h3 class="header">Library Alert Service</h3>
</div>
<div class="image">

  <img src="tuc_logo.gif" width="40" height="40" alt="logo" />
</div>

<!-- Third div, bar at bottom -->
<div class="footer" align="left">

  Send comments to the
  <a class="author" href="mailto:galexakis_at_intelligence.tuc.gr?subject=Alert comments">
  author</a> <br />
  <script language="JavaScript" type="text/javascript"> // append a modification date only if server provides a valid date if (Date.parse(document.lastModified) > 0) {
document.write('last modified:' + document.lastModified + '<BR>'); }
  </script>
</div>

<!--Main div-->
<div class="main">
<center>

<%--This is the command that produces the bug--%>
<database:dbOpen connId="ProfilesConnection"

                  user="<%=UserSession.getdbUser()%>"
                  password="<%=UserSession.getdbPass()%>"
                  URL="<%=UserSession.getdbURL()%>"
                  scope="page" commitOnClose="true">

</database:dbOpen>

<database:dbQuery queryId="FindProfiles" connId="ProfilesConnection"

                  scope="page" output="JDBC">
select * from profiles where email='<%=UserSession.getUsername()%>'
</database:dbQuery>

<% String email,profile_desc,title_rule,author_rule,abstract_rule,body_rule;
%>

<br>
<table border="1" cellpadding="10" bordercolor="#111111" cellspacing="0"

       style="border-collapse: collapse" bordercolorlight="#754D41"
       bordercolordark="#111111">
    <tr >
      <td align="center" ><u><b>Profile description</b></u></td>
      <td align="center" colspan="2"><u><b>Options</b></u></td>
    </tr>

<database:dbNextRow queryId="FindProfiles">
<%profile_desc=FindProfiles.getString(1);%>
 <tr valign="middle">

      <td align="center"><%=profile_desc%></td>
      <form action="profileinfo.jsp" method="post">
          <td valign="middle" align="center">
          <input type="submit" value="edit">
          </td>
          <input type="hidden" name="Action" value="update">
          <input type="hidden" name="ProfileDesc" value="<%=profile_desc%>">
      </form>
      <form action="submitprofile.jsp" method="post">
          <td valign="middle" align="center" ><input type="submit"
value="delete"></td>
          <input type="hidden" name="Action" value="delete">
          <input type="hidden" name="OldProfileDesc"
value="<%=profile_desc%>">
      </form>

</tr>
</database:dbNextRow>
</table>

<database:dbCloseQuery queryId="FindProfiles" />
<database:dbClose connId="ProfilesConnection" />

<br><br>
<form action="newprofile.jsp" method="post">

          <input type="submit" value="new profile">
          <input type="hidden" name="Action" value="insert">

</form>

</center>
</div>
<br><br>
</body>
</html>
Received on Wed Feb 19 2003 - 21:49:11 CET

Original text of this message