configure data source

2004-04-16 Thread Niraj Alok

 Hi All,


 I am trying to obtain a connection using DataSource
 in Tomcat5 .

 I get the following error :

 org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of
 class '' for connect URL 'null', cause:

 java.sql.SQLException: No suitable driver



 My source code is :

 Context ctx = new InitialContext();

 if (ctx == null)

 throw new Exception(No context got! Exception);

 System.out.println(got ctx);

 DataSource ds =

 (DataSource) ctx.lookup(java:comp/env/jdbc/hypersonic);


 if(ds == null)

 throw new Exception(No ds got! Exception);

 else

 {

 System.out.println(got ds);

 Connection con = ds.getConnection();

 if(con != null)

  
  ...
 }


 My server.xml looks like :

GlobalNamingResources

Environment name=simpleValue type=java.lang.Integer value=30/

Resource auth=Container description=User database that can be updated
and saved name=UserDatabase type=org.apache.catalina.UserDatabase/

Resource name=hypersonic type=javax.sql.DataSource/

ResourceParams name=UserDatabase

parameter

namefactory/name

valueorg.apache.catalina.users.MemoryUserDatabaseFactory/value

/parameter

parameter

namepathname/name

valueconf/tomcat-users.xml/value

/parameter

/ResourceParams

ResourceParams name=hypersonic

parameter

namemaxWait/name

value5000/value

/parameter

parameter

namemaxActive/name

value20/value

/parameter

parameter

namepassword/name

value/value

/parameter

parameter

nameurl/name

valuejdbc:hsqldb:hsql://localhost:1701/value

/parameter

parameter

namedriverClassName/name

valueorg.hsqldb.jdbcDriver/value

/parameter

parameter

namemaxIdle/name

value2/value

/parameter

parameter

nameusername/name

valuesa/value

/parameter

/ResourceParams

/GlobalNamingResources



   My web.xml contains:



   resource-ref

   descriptionDB Connection/description

   res-ref-namejdbc/hypersonic/res-ref-name

   res-typejavax.sql.DataSource/res-type

   res-authContainer/res-auth

   /resource-ref



   Even if i comment this entry in web.xml the error is still the same.



   Can any one please tell me what am I doing wrong??

   Regards,
   Niraj




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



precompilation of jsps

2004-04-15 Thread Niraj Alok
Hi All,

Is it possible to precompile the jsps during the starting process of tomcat so that 
they are not compiled during run time? 

I know its possible in weblogic but am not sure about Tomcat. The HOW- TO also don't 
mention any thing about it.


Regards,
Niraj


configure hypersonic

2004-03-18 Thread Niraj Alok
Hi All,

This is my first post in this wonderful group and I am really looking forward to some 
helpful inputs...

I have a hypersonic database which I created using JBoss 3 and I want my Tomcat 5 to 
access this. 

My first question is Can i bundle my hypersonic database with my application in some 
way that the client who is running Tomcat can access it?

My second question is related to obtaining the connection using DataSource in Tomcat5 .

I get the following error :

org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for 
connect URL 'null', cause: 

java.sql.SQLException: No suitable driver



My source code is :

Context ctx = new InitialContext();

if (ctx == null)

throw new Exception(No context got! Exception);

System.out.println(got ctx);

DataSource ds =

(DataSource) ctx.lookup(java:comp/env/jdbc/hypersonic);


if(ds == null)

throw new Exception(No ds got! Exception);

else

{

System.out.println(got ds);

Connection con = ds.getConnection();

if(con != null)

 
 ...
}


My server.xml looks like :

  GlobalNamingResources

  !-- Test entry for demonstration purposes --

  Environment name=simpleValue type=java.lang.Integer value=30/

  !-- Editable user database that can also be used by

  UserDatabaseRealm to authenticate users --

  Resource name=UserDatabase auth=Container

  type=org.apache.catalina.UserDatabase

  description=User database that can be updated and saved

  /Resource

  ResourceParams name=UserDatabase

  parameter

  namefactory/name

  valueorg.apache.catalina.users.MemoryUserDatabaseFactory/value

  /parameter

  parameter

  nameremoveAbandoned/name

  valuetrue/value

  /parameter

  parameter

  nameremoveAbandonedTimeout/name

  value200/value

  /parameter

  parameter

  namepathname/name

  valueconf/tomcat-users.xml/value

  /parameter

  /ResourceParams

ResourceParams name=hypersonic

parameter

namefactory/name

valueorg.apache.catalina.users.MemoryUserDatabaseFactory/value

/parameter

parameter

namepathname/name

valueconf/value

/parameter

/ResourceParams

ResourceParams name=jdbc/hypersonic

parameter

namemaxWait/name

value5000/value

/parameter

parameter

namemaxActive/name

value40/value

/parameter

parameter

namepassword/name

value/value

/parameter

parameter

nameurl/name

valuejdbc:hsqldb:hsql://localhost:1701/value

/parameter

parameter

namedriverClassName/name

valueorg.hsqldb.jdbcDriver/value

/parameter

parameter

namemaxIdle/name

value2/value

/parameter

parameter

nameusername/name

valuesa/value

/parameter

/ResourceParams

  /GlobalNamingResources

  My web.xml contains:



  resource-ref

  descriptionDB Connection/description

  res-ref-namejdbc/hypersonic/res-ref-name

  res-typejavax.sql.DataSource/res-type

  res-authContainer/res-auth

  /resource-ref



  Even if i comment this entry in web.xml the error is still the same.



  Can any one please tell me what am I doing wrong??

  Regards,
  Niraj 




tar checksum error

2001-12-20 Thread Sheth, Niraj

Hi,

I just downloaded 4.0.1 and trying to install it on SunOS 5.6.

gzip -cd jakarta-tomcat-4.0.1.tar.gz | tar -xvf - gives me directory
checksum error.

What I am missing?

Thanks,
-Niraj


LEGAL NOTICE
Unless expressly stated otherwise, this message is confidential and may be privileged. 
It is intended for the addressee(s) only. Access to this E-mail by anyone else is 
unauthorized. If you are not an addressee, any disclosure or copying of the contents 
of this E-mail or any action taken (or not taken) in reliance on it is unauthorized 
and may be unlawful. If you are not an addressee, please inform the sender immediately.

--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: unable to process 200 response from Tomcat using isapi_redirect.dll

2001-07-18 Thread niraj


- Original Message -
From: Bruyn, Bill [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, July 17, 2001 10:20 PM
Subject: unable to process 200 response from Tomcat using isapi_redirect.dll


 Hello All,

 I am trying to configure Tomcat to handle servlet/JSP requests from an
 instance of IIS hosted on another machine.  In short, it appears to be
 working until it's time to process the AJP12 response body, then the thing
 goes to lunch.

 First, the installation details.  I should tell you that the hardware and
OS
 information will change eventually, as this is a practice run for an IIS
 installation.  For now, Personal Web Server sits on an old laptop (which
 obtains its IP address via DHCP) running NT Workstation 4.0 SP5.  The real
 configuration is going to be IIS on NT Server SP6.

 The version of Tomcat that I have is actually the Embedded Tomcat 3.2.2,
 distributed with JBoss 2.2.2.  I'm told that full Tomcat configuration is
 supported, and so far that appears to be the case.  For now, JBoss/Tomcat
 runs on a Redhat Linux 7 box with a static IP address and Sun's JDK 1.3.
 HTTP requests made directly to this box on port 8080 yield the expected
 results.  The app server will eventually run on Solaris 8.

 The isapi_redirect.dll is loaded at c:\jakarta-tomcat\bin.  I also have a
 conf directory (containing workers.properties and uriworkermap.properties)
 and a logs directory (containing the isapi_redirect log file) there.

 I made the following registry entries at
HKEY_LOCAL_MACHINE\SOFTWARE\Apache
 Software Foundation\Jakarta Isapi Redirector\1.0

 extension_uri = /jakarta/isapi_redirect.dll

 log_file =
 c:\jakarta-tomcat\logs\isapi.log
 log_level = debug
 worker_file =
 c:\jakarta-tomcat\conf\workers.properties
 worker_mount_file =
 c:\jakarta-tomcat\conf\uriworkermap.properties

 per G Shacor's Tomcat IIS HowTo document.  I was then able to create the
 virtual directory, assign it execute permission, and create my ISAPI
filter.
 I did have to modify the configuration files, of course, but they look
okay
 to me.  I'll attach them for your review if you think it's worthwhile.
All
 I did was remove the default workers for clarity's sake, add a new worker
 named csg1 of type AJP12, and map it to my Linux box at port 8007 (where
it
 listens for AJP12 requests).

 Anyway, when the PWS service starts, I have the green arrow of victory,
the
 log is created, the worker is verified, and all is well.  I guess I should
 mention that stopping the service is a lot like pulling teeth - It stops,
 but an error is returned stating that it could not be stopped, and
 subsequent attempts to start it also yield errors.  In short, I'm forced
to
 reboot every time I want to stop the ridiculous web server.  I'm looking
for
 another place to run IIS to rule out web server issues, but for now, this
is
 what I'm forced to deal with.

 Requests made to both /examples and /servlet contexts are proxied
correctly.
 i.e., the ISAPI filter hands the request off to Tomcat as it should.  I
have
 no problems with the 404 errors so prevalent on the lists.  In fact, the
 only time the thing seems to work as expected is when I ask for a resource
 that doesn't exist.  By that, I mean you can see the filter hand the
request
 to Tomcat, Tomcat return the response, and the 404 error gets returned to
 the client as it should.  My problem comes when I request resources that
 return a 200 code.

 I'm including the entire contents of the log, but it looks to me like
Tomcat
 returns the response and the filter reads the header, then dies trying to
 process the body.  Could it be as simple as a bad copy of the DLL?  Either
 that, or Embedded Tomcat is different enough that the DLL can't deal with
 the AJP12 response?  I spent most of the day yesterday troubleshooting,
and
 I don't know what else to think at this point...

 I'm a little new to this, so please be kind.  :o]

 Bill Bruyn
 Programmer / Analyst
 Application Services, Avnet ISD

 Following are the entire contents of the log:
 
 [jk_uri_worker_map.c (156)]: Into
jk_uri_worker_map_t::uri_worker_map_alloc
 [jk_uri_worker_map.c (196)]: Into jk_uri_worker_map_t::uri_worker_map_open
 [jk_uri_worker_map.c (211)]: jk_uri_worker_map_t::uri_worker_map_open,
rule
 map size is 2
 [jk_uri_worker_map.c (267)]: Into
jk_uri_worker_map_t::uri_worker_map_open,
 match rule /servlet/=csg1 was added
 [jk_uri_worker_map.c (267)]: Into
jk_uri_worker_map_t::uri_worker_map_open,
 match rule /examples/=csg1 was added
 [jk_uri_worker_map.c (296)]: Into
jk_uri_worker_map_t::uri_worker_map_open,
 there are 2 rules
 [jk_uri_worker_map.c (317)]: jk_uri_worker_map_t::uri_worker_map_open,
done
 [jk_worker.c (82)]: Into wc_open
 [jk_worker.c (207)]: Into build_worker_map, creating 1 workers
 [jk_worker.c (213)]: build_worker_map, creating worker csg1
 [jk_worker.c (138)]: Into wc_create_worker
 [jk_worker.c (152)]: wc_create_worker, about to create instance csg1 of
 ajp12
 

IIS5 + isapi_redirect.dll GREEN ARROW

2001-07-18 Thread niraj

hi all,

We have just setup win2k server + iis5 + jdk1.3.1 + tomcat3.2.2  and have
done the installations as per the manual (help file ).

We are not able to get the green arrow up for isapi_redirect.dll filter. We
have tried all possibilities. Even we tried the old isapi_redirect.dll file
which we are currently using on our nt4.0. We have double checked the
registry settings, but no luck.

Can anyone throw light on this.

thanks in advance
niraj.





problem in getHeader()

2001-06-17 Thread niraj

i can't  get headers in second  page set in first page .
i am  using  tomact 3.2.2 .


this is my detail problem
this is first.jsp
response.setHeader(Cache-Control, no-cache);
 response.setHeader(Pragma, no-cache);
 response.setDateHeader(max-age, 0);
 response.setDateHeader(Expires, 0);

this is second.jsp

 Enumeration e = request.getHeaderNames();

 while(e.hasMoreElements()){
  String  = (String) e.nextElement();
  System.out.println(Header is  = ++  = +
request.getHeader());


 }

 System.out.println( Our Header is  = +
request.getDateHeader(max-age));
 System.out.println( Our Header is  =  +
request.getDateHeader(Expires));

i can't get  headers in second.jsp  what  i set in first.jsp .
i am  using  tomact 3.2.2




cache control problem in tomact 3.2.1

2001-06-11 Thread niraj

hi All

i have a global include file . i have put to header in the file as given
below.
response.addHeader(Cache-Control,no-cache);
response.addHeader(expires,0);
when i work with tomact + IISboth header works fine.
but when only tomact is running  the these headers doesn't work. is this is
the bug in tomact ?
any solution please help.
i am using WINNT and Tomact 3.2.1 and IIS 4.0
thanks in advance.

niraj




tomcat and security manager

2001-05-30 Thread niraj



i have an application in servlet and 
jsp
in directory format 
in /myapp

i have put the /myapp in 
c:\sites\myapp

i have created a host int server.xml file 
like

Host name="10.0.0.1" 
 Context 
path="" 
docBase="c:\sites\myapp" //Host
now i start the tomcat in secure mode by giving 

command 

startup.bat -security

now i request in browser 
like 
http://10.0.0.0/servlet/MyServlet

it gives error like 
java.security.AccessControlException: access denied (java.io.FilePermission 
C:\sites\myapp\web-inf\classes read)

i add lines in tomcat.policy

grant codeBase "file:C:\sites\myapp\-" { 
permission java.io.FilePermission "*", "read";};

still geting same error 

any idea

please help me

thanks in advance




problem running tomcat in secure mode

2001-05-30 Thread niraj




i have an application in servlet and 
jsp
in directory format 
in /myapp

i have put the /myapp in 
c:\sites\myapp

i have created a host int server.xml file 
like

Host name="10.0.0.1" 
 Context 
path="" 
docBase="c:\sites\myapp" //Host
now i start the tomcat in secure mode by giving 

command 

startup.bat -security

now i request in browser 
like 
http://10.0.0.0/servlet/MyServlet

it gives error like 
java.security.AccessControlException: access denied (java.io.FilePermission 
C:\sites\myapp\web-inf\classes read)

i add lines in tomcat.policy

grant codeBase "file:C:\sites\myapp\-" { 
permission java.io.FilePermission "*", "read";};

still geting same error 

any idea

please help me

thanks in advance




migrating php to tomcat ?.. help

2001-04-11 Thread niraj

hi all

here is a site in php www.goodlookingindia.com
we would like to migrate to jsp/servlet  for better performance

please let  me know it wheter to migrate to tomcat or not

is tomcat is best for jsp/servlet adon engine or any other servlet engine in
market better then tomcat?

your help/reviews will be apriciated

thanks in advance




not runing admin context

2001-01-12 Thread niraj





hello everybody
my problem is that i want to access /admin context 
of tomcat web server. 
when i go to http://localhost:8080/admin
the index page is coming
but when i goto admincontext it asking for 
password
what is that password?
i used my nt password but its not 
working.
i also used admin-admin
tomcat-tomcat
admin-tomcat 
but it still not working please help 
me
how can i start my /admin 
context?


virtual host with iis --new comer

2001-01-10 Thread niraj





hello, i am
i have a problem with virtual host with iis and 
tomcat
i have created tow sites abc.com and 
xyz.com
abc.com 100.100.100.101
root of abc in iis c:\webs\abc\iis

xyz.com 100.100.100.102
root of xyz in iis c:\webs\xyz\iis

the real ip of the computer is 
100.100.100.100
both sites are created on iis
just i want that the request of 
abc(100.100.100.101) of jsp and servlet is handled by tomcat
as well as with xyz(100.100.100.101)
so i have created two context with host 
tag

my last lines of server.xml is


Host name="192.168.100.21" 

 Context path="" 

  
 docBase="C:/webs/abc/tomcat" 
 
crossContext="false"
 
debug="0" 
 
reloadable="true" /
/Host

Host name="192.168.100.22" 

 Context path="" 
docBase="C:\webs\xyz\tomcat" 
crossContext="false"
 
bug="0"
 
loadable="true" /
/Host

due to less speed and mem. usage of java i want only one 
instance of tomcat
i also want that the request of xyz(100.100.100.102) is must 
not received by abc

same thing i want to update in my real server

in tomcat home directory of abc and xyz contains two folders
1. jsp
2. web-inf

my problem is that request is handeled by tomcat using port like http://100.100.100.101:8080/jsp
for both xyz and abc
but there is 404 error with http://100.100.100.101/jsp

as given in docs i check my registry,
jakarta virtual directory and rights
arrow of isapi filter allt these are ok 

so what is the problem?