You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "P.Miller" <p....@brocom.de> on 2001/08/09 09:33:12 UTC

DBTaglibs - initparameter problem

Hello,

I try to use the DBTags with initparameters in web.xml like:

web.xml:

<servlet>
      <servlet-name>dbURL</servlet-name>
     
<servlet-class>org.apache.taglibs.dbtags.connection.DatabaseURLTag</servlet-class>
      <init-param>
         <param-name>oraURL</param-name>
        
<param-value>jdbc:oracle:thin:@192.168.1.200:1521:ORC1</param-value>
      </init-param>
</servlet>

<servlet>
      <servlet-name>dbDriver</servlet-name>
     
<servlet-class>org.apache.taglibs.dbtags.connection.DriverTag</servlet-class>
      <init-param>
         <param-name>oraDriver</param-name>
         <param-value>oracle.jdbc.driver.OracleDriver</param-value>
      </init-param>
</servlet>

<servlet>
      <servlet-name>dbUserId</servlet-name>
     
<servlet-class>org.apache.taglibs.dbtags.connection.UserIdTag</servlet-class>
      <init-param>
         <param-name>oraUserId</param-name>
         <param-value>xyz</param-value>
      </init-param>
</servlet>

<servlet>
      <servlet-name>dbPassword</servlet-name>
     
<servlet-class>org.apache.taglibs.dbtags.connection.PasswordTag</servlet-class>
      <init-param>
         <param-name>oraPassword</param-name>
         <param-value>xyz</param-value>
      </init-param>
</servlet>

to define the init parameters.
When I try to use them in a jsp-file:

<%-- store your connection info in the web.xml file --%>
<sql:connection id="conn1">
  <sql:url initParameter="oraURL"/> 
  <sql:driver initParameter="oraDriver"/>
  <sql:userId initParameter="oraUserId"/> 
  <sql:password initParameter="oraPassword"/>
</sql:connection>

I allways get the error: javax.Servlet.ServletException: Driver '' class
not found

I thought the methods in the Tag-classes

  /**
   * The name of the init parameter containing the driver name.
   * 
   * @param paramName driver class name
   */
  public void setInitParameter(String paramName) {
    _driverClass =
pageContext.getServletContext().getInitParameter(paramName);
  }

looks in web.xml for this parameters??

Any help would be greatly appreciated.

Peter

Re: Load balancing

Posted by Kumar Vijayaratnam <ku...@sourceree.com>.
Hi Ananta,

Could you please provide your example configurations... Are you running
tomcat and apache on two seperate servers ?. I have been trying get Tomcat
and Apache to run on separate machines like you have  for some time withouth
success

Thanks
Kumar

AnantaS wrote:

> Hi,
>
> I am having some problem with apache and tomcat.=20
> Problem is as follows:
>
> I have two tomcat server installed in two machine. Let's say 'A' and =
> 'B'.
> Two apache server installed in two different machine , say 'C' and 'D'.
> I have configured them and they all working fine.  I have done this =
> setup to achive load balancing.=20
> For apache and tomcat communication I am using mod_jk. Now the proble is =
> how to handle the sessions.
> What I want is a request from a user should be handled by the same =
> tomcat server during the session.
> Whenever any request comes from any user there is a load balancer which =
> will direct the request to one of the apache server based on the load.
> Now it's the job of the apache server to redirect the request to correct =
> tomcat server.
>
> I am not able to achive this.=20
>
> Please let me know where is the problem and how to fix it.
>
> Thnaks,
> Ananta


Load balancing

Posted by AnantaS <an...@tarangtech.com>.
Hi,

I am having some problem with apache and tomcat.=20
Problem is as follows:

I have two tomcat server installed in two machine. Let's say 'A' and =
'B'.
Two apache server installed in two different machine , say 'C' and 'D'.
I have configured them and they all working fine.  I have done this =
setup to achive load balancing.=20
For apache and tomcat communication I am using mod_jk. Now the proble is =
how to handle the sessions.
What I want is a request from a user should be handled by the same =
tomcat server during the session.
Whenever any request comes from any user there is a load balancer which =
will direct the request to one of the apache server based on the load.
Now it's the job of the apache server to redirect the request to correct =
tomcat server.

I am not able to achive this.=20

Please let me know where is the problem and how to fix it.

Thnaks,
Ananta