Re: Cannot Solve "jdbc is not bound is this Context" problem

2003-08-17 Thread Kwok Peng Tuck
If you copy the DB2 driver into $CATALINA_HOME/common/lib , then it 
should be a jar rather than a zip or a tar file.
I think you should also change driverName to url.

Alan Nesbitt wrote:

We have been trying for over a week to solve this problem. It doesn't help
that we haven't used tomcat before, but our application works fine on
WebSphere. So I guess that it some configuration that we are missing.
We are trying to configure tomcat (4.1.24) to do a jndi lookup of a
DataSource which is a db2 jdbc app driver.
The Tomcat server.xml had a sample jdbc configuration which was modified to
the following...


user
password
driverClassName
COM.ibm.db2.jdbc.app.DB2Driver
driverName
jdbc:db2:SWPPDB2

The web.xml includes


 jdbc/SURESWIT
 javax.sql.DataSource
 Container
 
The Java code performs the following :-

if (ds == null)
{
try {
  Context ctx = new InitialContext();
 ds = (javax.sql.DataSource) ctx.lookup(("jdbc/SURESWIT");
 ctx.close();
}
 catch (Exception e)
   {
 logger.text( IRecordType.TYPE_ERROR_EXC,
   className,
   "init(ServletConfig)",
  "Naming service exception:" + e.toString());
  }
}
When the above code runs it throws the following exception
init(ServletConfig) Naming service
exception:javax.naming.NameNotFoundException:
Name jdbc is not bound in this Context
I have copied the DB2 jdbc driver file to $CATALINA_HOME/common/lib (I
copied it both as .zip and .tar as some web resources suggested tomcat would
only recognise it as .tar)
ANY and I mean ANY help would be greatly appreciated. Even if it's to say it
doesn't work with tomcat.
Many thanks Alan

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Cannot Solve "jdbc is not bound is this Context" problem

2003-08-17 Thread Alan Nesbitt
Of course I did mean .jar
>I have copied the DB2 jdbc driver file to $CATALINA_HOME/common/lib (I
> copied it both as .zip and .tar as some web resources suggested tomcat
would
> only recognise it as .tar)

- Original Message -
From: "Alan Nesbitt" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, August 17, 2003 8:25 PM
Subject: Cannot Solve "jdbc is not bound is this Context" problem


> We have been trying for over a week to solve this problem. It doesn't help
> that we haven't used tomcat before, but our application works fine on
> WebSphere. So I guess that it some configuration that we are missing.
> We are trying to configure tomcat (4.1.24) to do a jndi lookup of a
> DataSource which is a db2 jdbc app driver.
>
> The Tomcat server.xml had a sample jdbc configuration which was modified
to
> the following...
>
>  type="javax.sql.DataSource"/>
> 
> user
> password
> driverClassName
> COM.ibm.db2.jdbc.app.DB2Driver
> driverName
> jdbc:db2:SWPPDB2
> 
>
> The web.xml includes
>
> 
>   jdbc/SURESWIT
>   javax.sql.DataSource
>   Container
>   
>
> The Java code performs the following :-
>
> if (ds == null)
>  {
> try {
>Context ctx = new InitialContext();
>   ds = (javax.sql.DataSource) ctx.lookup(("jdbc/SURESWIT");
>   ctx.close();
>  }
>   catch (Exception e)
> {
>   logger.text( IRecordType.TYPE_ERROR_EXC,
> className,
> "init(ServletConfig)",
>"Naming service exception:" + e.toString());
>}
> }
>
> When the above code runs it throws the following exception
> init(ServletConfig) Naming service
> exception:javax.naming.NameNotFoundException:
> Name jdbc is not bound in this Context
>
> I have copied the DB2 jdbc driver file to $CATALINA_HOME/common/lib (I
> copied it both as .zip and .tar as some web resources suggested tomcat
would
> only recognise it as .tar)
>
> ANY and I mean ANY help would be greatly appreciated. Even if it's to say
it
> doesn't work with tomcat.
>
> Many thanks Alan
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]