RE: integration of apache2.0.40 tomcat4.1.27

2003-08-14 Thread Aditya Kapur
I have been struggling for past few days to integrate apache with tomcat
4.1.27 on my red hat 9.0 and I found your document very useful.
I have a problem. I don't have apache-devel package installed. Can you tell
me how/where to get it from? I don't have kpackage and gnome-rpm
applications installed on my red hat either.
Thanks,
Adi

-Original Message-
From: Mike Millson [mailto:[EMAIL PROTECTED] 
Sent: Monday, August 11, 2003 10:59 AM
To: Tomcat Users List
Subject: Re: integration of apache2.0.40  tomcat4.1.27


Here is my documentation on integrating apache + tomcat on RH 9.0. For admin
simplicity, I keep the RedHat apache install.

http://www.meritonlinesystems.com/docs/
 

On Mon, 2003-08-11 at 09:18, John Turner wrote:
 unplug wrote:
 
 I have installed RH9 and it contains apache2.0.40.  Then I 
  installed tomcat4.1.27 by binary.  After that I want to integrate 
  them to work together by using jk2.  What is the easy way to 
  integrate them?
 
 Use a connector.
 
 http://jakarta.apache.org/tomcat/faq/connectors.html
 
   Any
  document that shows step by step integration?
 
 http://jakarta.apache.org/tomcat/faq/connectors.html
 
 I found jakarta site have a related document about it.  But I 
  can't find the bin mod_jk2 for 2.0.40 in jakarta site.  Where can I 
  find mod_jk2 for 2.0.40?  Any guide line to build it myself?  I 
  wonder why jakarta site doesn't have mod_jk2-2.0.40 for download.
 
 Because the 2.0.40 included with RH default installations is a munged
 Apache distribution.
 
 In my opinion, you shouldn't use it, and instead should build and
 install Apache from source.  But that's me.
 
 If you want to use RH's 2.0.40, you will need to download the 
 connector
 source from here:
 
 http://jakarta.apache.org/builds/jakarta-tomcat-connectors/
 
 and build your .so file yourself against the 2.0.40 distribution that
 you have.  You will need to know the location of apxs.  Typcially, the 
 steps for building the .so files from source are:
 
 1. unpack source
 2. find buildconf.sh
 3. execute buildconf.sh
 4. execute configure like this:
 
 ./configure --with-apxs=/some/path/to/apxs
 
 5. make
 6. make install
 
 If step #6 doesn't work for you, and step #5 was successful, then do a
 find for mod_jk*.so and when you find it, copy it to your Apache 
 modules directory.
 
 John
 
 
 
 
 
 -
 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]

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



RE: tomcat shutdown

2003-08-14 Thread Aditya Kapur
Running tomcat on different ports is not enough. You have to specify
different ports for startup and shutdown in server.xml

-Original Message-
From: Chris Daly [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 12, 2003 11:05 AM
To: mailto:@magic.lif.icnet.uk
Subject: tomcat shutdown


hi

i have two instances of tomcat runnign as a stand olone but on different 
ports - i can neither stop nor start either tomcat as all that i'm getting
is

Catalina.stop: java.net.ConnectException: Connection refused
java.net.ConnectException: Connection refused
   at java.net.PlainSocketImpl.socketConnect(Native Method)
 at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:320)
 at
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:133)
 at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:120)
 at java.net.Socket.init(Socket.java:273)
 at java.net.Socket.init(Socket.java:100)
 at org.apache.catalina.startup.Catalina.stop(Catalina.java:831)
 at org.apache.catalina.startup.Catalina.execute(Catalina.java:683)
 at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
 at java.lang.reflect.Method.invoke(Native Method)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)

how do i stop the service  ?  i'm trying to use bin/shutdown.sh but its not 
working.

i have two instances of tomcat runnign as a stand olone but on different
ports

cheers

chris


-
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]



running rmi...

2003-07-17 Thread Aditya Gujarathi
i am using struts framework for my jsp pages..
one of my action class is supposed to create an object of rmi client,
and call a remote method..
the rmi client and server are well tested, compiled and stub is also
generated..
all these files are apprpriately placed on the server and client
machines along with the policy file..

but when i run the jsp, i get an error saying access denied..
could you plz tell me the detail steps as to how to specify the policy
file, and where to specify it on the client machine, and any other
settings like server.codebase setting etc...

Thanks,
Aditya


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



Re: apache2 output filter, mod_jk and JSP content type

2002-12-26 Thread Aditya
In case anyone is wondering, I've found the fix for this based on:

  http://article.gmane.org/gmane.comp.apache.devel/7922
  http://article.gmane.org/gmane.comp.apache.devel/7928

There was a small missing Apache API call in mod_jk that has been
implemented in mod_jk (I just used the latest HEAD from CVS) by Henri
Gomez and it all works.

Thanks,
Adi

 On Wed, 25 Dec 2002 20:27:53 -0800, Aditya [EMAIL PROTECTED] said:
 I'm trying to apply a Apache2 output filter (mod-xslt) on JSPs,
 served by mod_jk, based on the JSP content MIME Type using the
 Apache AddOutputFilterByType directive.

 However, it looks like Apache2 decides the content type of a file
 when the request comes in rather than from the response
 headers. This causes the Output Filter not to be applied when the
 Content Type is overridden explictly in the headers of a JSP using:

   %@ page contentType=text/xml %

 The note at:


 http://httpd.apache.org/docs-2.0/mod/core.html#addoutputfilterbytype

 seems to suggest that. It also notes that The by-type output
 filters are never applied on proxy requests. -- would mod_jk served
 files qualify as proxy requests?

 It sounds like an Apache output filter bug/feature but perhaps I'm
 misunderstanding how it should work? Is that the way it's supposed
 to work?

 Thanks, Adi

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




apache2 output filter, mod_jk and JSP content type

2002-12-25 Thread Aditya
I'm trying to apply a Apache2 output filter (mod-xslt) on JSPs, served by
mod_jk, based on the JSP content MIME Type using the Apache
AddOutputFilterByType directive.

However, it looks like Apache2 decides the content type of a file when the
request comes in rather than from the response headers. This causes the Output
Filter not to be applied when the Content Type is overridden explictly in the
headers of a JSP using:

  %@ page contentType=text/xml %

The note at:

  http://httpd.apache.org/docs-2.0/mod/core.html#addoutputfilterbytype

seems to suggest that. It also notes that The by-type output filters are
never applied on proxy requests. -- would mod_jk served files qualify as
proxy requests?

It sounds like an Apache output filter bug/feature but perhaps I'm
misunderstanding how it should work? Is that the way it's supposed to work?

Thanks,
Adi

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




JVM or tomcat aggressive caching DNS lookups?

2002-12-08 Thread Aditya
This seems to be a problem with the JVM, but since I only run into it in long
running programs like Tomcat, I'm asking here -- it seems that in an JSP, if
I'm using URLConnection to retrieve a remote webpage, the IP address that is
obtained when doing the lookup in URLConnection persists for the life of
Tomcat/JVM even past the ttl for that record. For example:

- www.foo.com resolves to 1.2.3.4 with a ttl of 15 minutes

- 30 minutes later, if I look up www.foo.com, it's still 1.2.3.4 though in the
meantime I've updated it to 4.5.6.7

Is there a way to force the JVM internal DNS cache to be flushed?

Thanks,
Adi

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




Re: JVM or tomcat aggressive caching DNS lookups?

2002-12-08 Thread Aditya
Great, thank you, I'll give it a try. It's also documented at:

  http://java.sun.com/j2se/1.4/docs/guide/net/properties.html

Thanks,
Adi

 On Sun, 8 Dec 2002 13:08:16 -0800, Schnitzer, Jeff [EMAIL PROTECTED] said:
 I had to deal with this last week.  Here's the important bit of
 documentation:

 http://java.sun.com/j2se/1.4.1/docs/api/java/net/InetAddress.html

 Jeff Schnitzer [EMAIL PROTECTED] The Sims Online


 -Original Message-
 From: Aditya [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, December 07, 2002 6:28 PM
 To: [EMAIL PROTECTED]
 Subject: JVM or tomcat aggressive caching DNS lookups?
 
 This seems to be a problem with the JVM, but since I only run into it
 in long running programs like Tomcat, I'm asking here -- it seems
 that in an JSP, if I'm using URLConnection to retrieve a remote
 webpage, the IP address that is obtained when doing the lookup in
 URLConnection persists for the life of Tomcat/JVM even past the ttl
 for that record. For example:
 
 - www.foo.com resolves to 1.2.3.4 with a ttl of 15 minutes
 
 - 30 minutes later, if I look up www.foo.com, it's still 1.2.3.4
 though in the meantime I've updated it to 4.5.6.7
 
 Is there a way to force the JVM internal DNS cache to be flushed?
 
 Thanks, Adi
 
 -- To unsubscribe, e-mail: mailto:tomcat-user-
 [EMAIL PROTECTED] For additional commands, e-mail:
 mailto:tomcat-user- [EMAIL PROTECTED]
 

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




Re: Security

2002-04-22 Thread Aditya

Vladimir,

On Mon, Apr 22, 2002 at 03:11:09PM +0900, Joel Rees wrote:
 Vladimir Vanyukov asked
  I have seen this question here many times and have seen many answers but
  most of them never really ANSWERED the question. So I figured I'd ask
  one more time. Is there anyway to programmatically authenticate users?

are you asking if you can call a method in your servlet or JSP that would
force the user to login if they weren't already? If so, no, not directly.
Ideally, you could do something like:

  if (req.getRemoteUser() == null){
authenticate(); //this would pop-up the login form or box
  }

but instead you have to do it as part of an auth-constraint in the web.xml;
for example, what we've done is to put an auth-constraint on a url pattern of

  /secure/* 

and our authenticateUser() method redirects them to

  /secure/go?url=$the_url_they_just_came_from

which forces them to authenticate (using form-based authentication) and then
redirect them back to where they came from without having to declare every
single url pattern in the web.xml; kludgy, but somewhat programmatic. I wish
there was a better way and if someone can show me one in the servlet spec
(without using filters which suffer from the same type of web.xml-itis) I'd be
very, very happy.

  Example:
  If I have s simple username/password form somewhere on an unprotected
  page, how do I use that information (assuming the user filled it out and
  submitted it) to allow him to view protected pages?

you'd probably want to redirect them to a centralized login page rather than
implement a login form on multiple pages; that the regular servlet spec let's
you do pretty easily using the login-config stanza.

Hope that helps,
Adi

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




Integrating TC, SQL/JDBC, XML, XSL

2002-04-18 Thread Aditya

Hi Tomcat-users,

We've been using Tomcat, servlets and JSPs for a while now and have built a
few SQL database-backed web applications using them. For what it's worth, we
think the whole system is quite complicated to setup and one keeps reinventing
the wheel before settling down to the real task of application development.
Granted, there are ISPs that provide Tomcat w/JDBC hosting etc., but even then
it means knowing how to setup a web-application under Tomcat, knowing about
the SQL database and how to implement connection pooling and things that don't
directly contribute to quality application development time. Furthermore, all
the popular application development frameworks, ie. JSPs, Struts, Taglibs
leave something to be desired (ie. no clear distinction between code and
content, no easy templating etc.).

Based on our experience, we're developing a web-based application development
framework as a service to make it easy to setup a web-enabled database
application. Unlike ISP hosting, it is tailored for Java developers who want
to concentrate on producing web applications without having to worry about all
the system integration bits. Unlike a J2EE application server, it isn't an
overly-complex, shrink-wrapped product or really expensive hosting service.
Furthermore, it's meant to be developer-driven and community-built. We want
others to benefit from this -- we want people to be able to build useful
web-applications with a minimum of effort and not have to worry about the
mundane problems like backups, 24x7 availability, keeping the server OS, TC or
the SQL database patched etc. saving you time and money.

The service integrates Java servlets (courtesy of Tomcat4), XML, XSL and SQL.
It is currently in pre-public beta and more details are at
http://www.zapatec.com

There is also a draft whitepaper that explains our motivations at:

  http://www.zapatec.com/doc/framework.htmt

It would be wonderful to hear feedback and comments about whether this is a
service you would find useful? Interesting? What features would make it so? Do
you have comments on the approach? Once the codebase matures, we will probably
open it up to the public, however, we'll probably be the sole commercial
provider of the service (in case you're wondering how we're going to make
money).

Thanks,
Adi

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




Re: autoDeploy scan timer setting?

2002-04-16 Thread Aditya

Remy,


On Sat, Apr 06, 2002 at 05:22:17PM -0800, Remy Maucherat wrote:
  In org.apache.catalina.startup.HostConfig I see a variable that sets the
 scan
  timer to deploy new contexts:
 
 /**
   * The number of seconds between checks for web app deployment.
   */
  private int checkInterval = 15;
 
  is there a server.xml config file setting to alter this? 15 seconds is a
 bit
  too fast...
 
  I've noticed that if you happen to hit the URL for the context while it's
  being deployed then the deployment aborts and you have to restart tomcat
 to be
  able to start that context. Is this a known bug?
 
 I've been doing this, and this does not happen.

I tracked down the behaviour to the fact that the appBase directory was on a
loaded down NFS server so even though the directory existed, WEB-INF/web.xml
was unavailable.

In any case, I put it on a better NFS server and it worked fine under 4.0.2 --
I upgraded to 4.0.3 running the security manager and left autoDeploy=true in
server.xml but now apps added to the appBase directory don't get autoDeploy'd
at all, even after checkInterval seconds:

  Host name=localhost debug=0 appBase=/data/webapps
   unpackWARs=true autoDeploy=true

Is there something additional I have to configure in 4.0.3 that wasn't in
4.0.2? BugID 3724 which is listed as resolved as of 4.0.1-B1 describes
something similar but under Windows -- I'm running this on FreeBSD.

Any hints?

Thanks,
Adi

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




Re: SSL redirects with mod_jk

2002-04-15 Thread Aditya

On Mon, Apr 15, 2002 at 09:26:40AM -0400, Rich wrote:
 I'm curious about a few things. Why did you choose mod_jk over mod_webapp?

- I needed to send everything Apache receives to Tomcat

- We auto-add contexts to appbase and I don't need to update the config and
restart apache each time that happens

 And when you enabled the SSL connector, did you also add jsse and basically
 configure tomcat as a standalone SSL enabled server?

yes, in order to get Tomcat running with the SSL connector, it had to have
jsse etc. -- for testing I'd already configured Tomcat with SSL standalone and
a self-signed cert, and so that was straightforward.

At this point it works but I had to make the non-intutive leap of adding the
SSL connector and thought others might benefit from knowing about it.

Thanks,
Adi

 -Original Message-
 From: Aditya [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, April 14, 2002 3:47 PM
 To: [EMAIL PROTECTED]
 Subject: SSL redirects with mod_jk
 
 
 I have apache 1.3+mod_ssl and mod_jk (ajp13) fronting a Tomcat 4.0.3
 server
 which has a servlet protected by:
 
   user-data-constraint
 transport-guaranteeCONFIDENTIAL/transport-guarantee
   /user-data-constraint
 
 I assume that for performance reasons that it would be best if I could run
 no
 connectors other than the AJP13 one.
 
 Ideally, calls to the above servlet as http should be redirected to the
 equivalent https page. To that end, I have, in my server.xml:
 
 !-- Define an AJP 1.3 Connector on port 8009 --
 Connector className=org.apache.ajp.tomcat4.Ajp13Connector
port=8009 minProcessors=30 maxProcessors=150
acceptCount=10 debug=0
enableLookups=false redirectPort=443
secure=false scheme=http
address=127.0.0.1
tomcatAuthentication=true/
 
 however the redirect won't work (Status 500 error) unless I put in an HTTPS
 connector as well in server.xml (note that it doesn't have to be accessible
 at
 all, hence the 127.0.0.1 and port 8443 is blocked off so it doesn't seem to
 play any part in the whole deal other than to signal to Tomcat that it can
 handle redirects to SSL):
 
 !-- Define an SSL HTTP/1.1 Connector on port 8443 --
 Connector className=org.apache.catalina.connector.http.HttpConnector
address=127.0.0.1 port=8443 minProcessors=5
 maxProcessors=75
enableLookups=false
acceptCount=10 debug=0 scheme=https secure=true
   Factory className=org.apache.catalina.net.SSLServerSocketFactory
clientAuth=false protocol=TLS
keystorePass=foo/
 /Connector
 
 (I tried putting in an additional ajp13 connector that mod_jk sent anything
 that showed up as SSL to, but that didn't work).
 
 Is this how it's supposed to work? If so, it should be documented
 somewhere...
 
 Thanks,
 Adi
 
 --
 To unsubscribe:   mailto:[EMAIL PROTECTED]
 For additional commands: mailto:[EMAIL PROTECTED]
 Troubles with the list: mailto:[EMAIL PROTECTED]
 
 

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




Re: SSL redirects with mod_jk

2002-04-15 Thread Aditya

On Mon, Apr 15, 2002 at 01:39:33PM -0400, Rich wrote:
 You would prefer to have the SSL handshake to occur with Apache, right? So
 I'm wondering, with Tomcat configured as a standalone SSL server are you
 sure that apache is doing the handshake, and not Tomcat.

notice the address that I give the SSL connector - 127.0.0.1 -- and I've
verfied that it's only listening on 127.0.0.1:8443 so yes, I'm sure that
Tomcat is not doing the handshake (plus I verified which cert I'm getting).

 -You can say that again. This might be the root of my SSL problem too,
 although hard to tell since we are using different apache modules and I use
 Tomcat's role based auth. I kludged a fix in code and am limited for time
 so may not attempt the exercise of getting Tomcat's SSL working.

I'm also using JDBCRealm authentication on Tomcat and I have:

tomcatAuthentication=true

set in the AJP13 connector config stanza.

What would be ideal would be a programmatic way in a servlet to force
authentication rather than having to hard-code stuff via auth-constraint's in
web.xml.

Adi

 Rich
 -Original Message-
 From: Aditya [mailto:[EMAIL PROTECTED]]
 Sent: Monday, April 15, 2002 1:07 PM
 To: [EMAIL PROTECTED]
 Subject: Re: SSL redirects with mod_jk
 
 
 On Mon, Apr 15, 2002 at 09:26:40AM -0400, Rich wrote:
  I'm curious about a few things. Why did you choose mod_jk over mod_webapp?
 
 - I needed to send everything Apache receives to Tomcat
 
 - We auto-add contexts to appbase and I don't need to update the config and
 restart apache each time that happens
 
  And when you enabled the SSL connector, did you also add jsse and
 basically
  configure tomcat as a standalone SSL enabled server?
 
 yes, in order to get Tomcat running with the SSL connector, it had to have
 jsse etc. -- for testing I'd already configured Tomcat with SSL standalone
 and
 a self-signed cert, and so that was straightforward.
 
 At this point it works but I had to make the non-intutive leap of adding
 the
 SSL connector and thought others might benefit from knowing about it.
 
 Thanks,
 Adi
 
  -Original Message-
  From: Aditya [mailto:[EMAIL PROTECTED]]
  Sent: Sunday, April 14, 2002 3:47 PM
  To: [EMAIL PROTECTED]
  Subject: SSL redirects with mod_jk
 
 
  I have apache 1.3+mod_ssl and mod_jk (ajp13) fronting a Tomcat 4.0.3
  server
  which has a servlet protected by:
 
user-data-constraint
  transport-guaranteeCONFIDENTIAL/transport-guarantee
/user-data-constraint
 
  I assume that for performance reasons that it would be best if I could run
  no
  connectors other than the AJP13 one.
 
  Ideally, calls to the above servlet as http should be redirected to the
  equivalent https page. To that end, I have, in my server.xml:
 
  !-- Define an AJP 1.3 Connector on port 8009 --
  Connector className=org.apache.ajp.tomcat4.Ajp13Connector
 port=8009 minProcessors=30 maxProcessors=150
 acceptCount=10 debug=0
 enableLookups=false redirectPort=443
 secure=false scheme=http
 address=127.0.0.1
 tomcatAuthentication=true/
 
  however the redirect won't work (Status 500 error) unless I put in an
 HTTPS
  connector as well in server.xml (note that it doesn't have to be
 accessible
  at
  all, hence the 127.0.0.1 and port 8443 is blocked off so it doesn't seem
 to
  play any part in the whole deal other than to signal to Tomcat that it can
  handle redirects to SSL):
 
  !-- Define an SSL HTTP/1.1 Connector on port 8443 --
  Connector
 className=org.apache.catalina.connector.http.HttpConnector
 address=127.0.0.1 port=8443 minProcessors=5
  maxProcessors=75
 enableLookups=false
 acceptCount=10 debug=0 scheme=https secure=true
Factory className=org.apache.catalina.net.SSLServerSocketFactory
 clientAuth=false protocol=TLS
 keystorePass=foo/
  /Connector
 
  (I tried putting in an additional ajp13 connector that mod_jk sent
 anything
  that showed up as SSL to, but that didn't work).
 
  Is this how it's supposed to work? If so, it should be documented
  somewhere...
 
  Thanks,
  Adi
 
  --
  To unsubscribe:   mailto:[EMAIL PROTECTED]
  For additional commands: mailto:[EMAIL PROTECTED]
  Troubles with the list: mailto:[EMAIL PROTECTED]
 
 
 
 --
 To unsubscribe:   mailto:[EMAIL PROTECTED]
 For additional commands: mailto:[EMAIL PROTECTED]
 Troubles with the list: mailto:[EMAIL PROTECTED]
 
 
 
 --
 To unsubscribe:   mailto:[EMAIL PROTECTED]
 For additional commands: mailto:[EMAIL PROTECTED]
 Troubles with the list: mailto:[EMAIL PROTECTED]
 

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




SSL redirects with mod_jk

2002-04-14 Thread Aditya

I have apache 1.3+mod_ssl and mod_jk (ajp13) fronting a Tomcat 4.0.3 server
which has a servlet protected by:

  user-data-constraint
transport-guaranteeCONFIDENTIAL/transport-guarantee
  /user-data-constraint

I assume that for performance reasons that it would be best if I could run no
connectors other than the AJP13 one.
 
Ideally, calls to the above servlet as http should be redirected to the
equivalent https page. To that end, I have, in my server.xml:

!-- Define an AJP 1.3 Connector on port 8009 --
Connector className=org.apache.ajp.tomcat4.Ajp13Connector
   port=8009 minProcessors=30 maxProcessors=150
   acceptCount=10 debug=0
   enableLookups=false redirectPort=443
   secure=false scheme=http
   address=127.0.0.1
   tomcatAuthentication=true/

however the redirect won't work (Status 500 error) unless I put in an HTTPS
connector as well in server.xml (note that it doesn't have to be accessible at
all, hence the 127.0.0.1 and port 8443 is blocked off so it doesn't seem to
play any part in the whole deal other than to signal to Tomcat that it can
handle redirects to SSL):

!-- Define an SSL HTTP/1.1 Connector on port 8443 --
Connector className=org.apache.catalina.connector.http.HttpConnector
   address=127.0.0.1 port=8443 minProcessors=5 maxProcessors=75
   enableLookups=false
   acceptCount=10 debug=0 scheme=https secure=true
  Factory className=org.apache.catalina.net.SSLServerSocketFactory
   clientAuth=false protocol=TLS
   keystorePass=foo/
/Connector

(I tried putting in an additional ajp13 connector that mod_jk sent anything
that showed up as SSL to, but that didn't work).

Is this how it's supposed to work? If so, it should be documented somewhere...

Thanks,
Adi

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




Re: Session Tacking across hostnames?

2002-04-13 Thread Aditya

Hi Neil,

cookies are bound to the server name, so you can't use cookies (the default
method with Tomcat) to track sessions. If you are not doing form-based realm
authentication, you can use URL rewriting to track the session by setting:

cookies=false

for the contexts you are serving (you could also do it for the default
context).

I think this is what you are asking.

Thanks,
Adi

On Sat, Apr 13, 2002 at 11:48:40PM -0500, Neil Aggarwal wrote:
 Hello:
 
 I am using Apache 1.3 and Tomcat 4.0.3.
 
 For an application we are building, we are using a shared SSL certificate
 so the hostname has to be different for http and https.  For example,
 public pages are loaded from http://www.futurescope.com/fscope/myPage.jsp
 and private pages are loaded from
 http://www.JAMMConsulting.com/fscope/privatePage.jsp
 
 Unforutnately, when we switch from http to https or vice versa, we lose
 track of the session.  Is there a way to keep the session is this
 instance?
 
 Thanks,
   Neil.
 
 --
 Neil Aggarwal
 JAMM Consulting, Inc.(972) 612-6056, http://www.JAMMConsulting.com
 Custom Internet DevelopmentWebsites, Ecommerce, Java, databases
 
 
 --
 To unsubscribe:   mailto:[EMAIL PROTECTED]
 For additional commands: mailto:[EMAIL PROTECTED]
 Troubles with the list: mailto:[EMAIL PROTECTED]
 

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




$CATALINA_HOME/shared deprecated? [was Re: NoClassDefFoundError With Tomcat 4.0.2 and Xalan 2.3.1]

2002-04-09 Thread Aditya

4.0.4-B2-01 doesn't seem to include $CATALINA_HOME/shared in the classpath
however the documentation still says that that's the place to put local,
shared jars:

  http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html

Thanks,
Adi

On Tue, Apr 09, 2002 at 01:38:27PM -0400, Larry Isaacs wrote:
 Yes, it is a known issue for Tomcat 4.0.2 and 4.0.3. Putting
 the jars in $CATALINA_HOME/lib or $CATALINA_HOME/common/lib
 is the only workaround for these versions.  To get the bugfix,
 you will need to upgrade to the nightly Tomcat 4.x or
 Tomcat 4.0.4-b1, or later.
 
 Cheers,
 Larry
 
  -Original Message-
  From: Bryan Joyner [mailto:[EMAIL PROTECTED]] 
  Sent: Tuesday, April 09, 2002 1:21 PM
  To: [EMAIL PROTECTED]
  Subject: NoClassDefFoundError With Tomcat 4.0.2 and Xalan 2.3.1 
  
  
  I'm getting a NoClassDefFoundError in a servlet when loading
  javax.xml.transform.Source. Im using Tomcat 4.0.2 and Xalan 2.3.1.
  xalan.jar and xml-apis.jar are both in my war file in the WEB-INF/lib
  directory. I have worked around the problem  by putting these jars in
  the $CATALINA_HOME/lib. But I don't want to have to do this. Is this a
  known issues? 
  
  Bryan Joyner
  Sr. Software Engineer
  ZixIt Corporation
  
  Office: (214) 370-2027
  Fax: (214) 370-2073
  [EMAIL PROTECTED]
  To send email secure and certified, Just ZixIt!(tm) 
  zixmail(tm) is the most convenient way to add security to 
  your email. If
  you would like to add privacy, security and certified receipts to your
  email, download zixmail(tm) from http://www.zixmail.com. 
  
  
  
  --
  To unsubscribe:   mailto:[EMAIL PROTECTED]
  For additional commands: mailto:[EMAIL PROTECTED]
  Troubles with the list: mailto:[EMAIL PROTECTED]
  
 
 --
 To unsubscribe:   mailto:[EMAIL PROTECTED]
 For additional commands: mailto:[EMAIL PROTECTED]
 Troubles with the list: mailto:[EMAIL PROTECTED]
 

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




Re: $CATALINA_HOME/shared deprecated? [was Re: NoClassDefFoundErr or With Tomcat 4.0.2 and Xalan 2.3.1]

2002-04-09 Thread Aditya

On Tue, Apr 09, 2002 at 04:13:44PM -0400, Larry Isaacs wrote:
 More acurately, $CATALINA_HOME/lib is the shared classloader
 (there is no $CATALINA_HOME/shared directory).  It is the place
 to put shared jars that you don't want to be visible to the
 Catalina classloader.

okay, then the documentation at the URL below needs to be updated to reflect
that. At the bottom of the document is a list of repositories tomcat looks in
at startup and $CATALINA_HOME/lib is not listed

 I'm not sure whether include $CATALINA_HOME/shared in the
 classpath is referring to the JVM's classpath or that classes
 aren't visible to your web application.  They won't appear
 on the JVM's classpath because Catalina builds the classloader
 hierarchy at startup.  The JVM's classpath appears as part
 of the system classloader in the diagram shown on the document
 cited.

I was referring to the Catalina built classpath as per the
$CATALINA_HOME/bin/setclasspath.sh script

Thanks,
Adi

 Cheers,
 Larry
 
  -Original Message-
  From: Aditya [mailto:[EMAIL PROTECTED]] 
  Sent: Tuesday, April 09, 2002 3:52 PM
  To: Tomcat Users List
  Subject: $CATALINA_HOME/shared deprecated? [was Re: 
  NoClassDefFoundError With Tomcat 4.0.2 and Xalan 2.3.1]
  
  
  4.0.4-B2-01 doesn't seem to include $CATALINA_HOME/shared in 
  the classpath
  however the documentation still says that that's the place to 
  put local,
  shared jars:
  

  http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-h
  owto.html
  
  Thanks,
  Adi
  
  On Tue, Apr 09, 2002 at 01:38:27PM -0400, Larry Isaacs wrote:
   Yes, it is a known issue for Tomcat 4.0.2 and 4.0.3. Putting
   the jars in $CATALINA_HOME/lib or $CATALINA_HOME/common/lib
   is the only workaround for these versions.  To get the bugfix,
   you will need to upgrade to the nightly Tomcat 4.x or
   Tomcat 4.0.4-b1, or later.
   
   Cheers,
   Larry
   
-Original Message-
From: Bryan Joyner [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, April 09, 2002 1:21 PM
To: [EMAIL PROTECTED]
Subject: NoClassDefFoundError With Tomcat 4.0.2 and Xalan 2.3.1 


I'm getting a NoClassDefFoundError in a servlet when loading
javax.xml.transform.Source. Im using Tomcat 4.0.2 and Xalan 2.3.1.
xalan.jar and xml-apis.jar are both in my war file in the 
  WEB-INF/lib
directory. I have worked around the problem  by putting 
  these jars in
the $CATALINA_HOME/lib. But I don't want to have to do 
  this. Is this a
known issues? 

Bryan Joyner
Sr. Software Engineer
ZixIt Corporation

Office: (214) 370-2027
Fax: (214) 370-2073
[EMAIL PROTECTED]
To send email secure and certified, Just ZixIt!(tm) 
zixmail(tm) is the most convenient way to add security to 
your email. If
you would like to add privacy, security and certified 
  receipts to your
email, download zixmail(tm) from http://www.zixmail.com. 



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

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

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




autoDeploy scan timer setting?

2002-04-06 Thread Aditya

In org.apache.catalina.startup.HostConfig I see a variable that sets the scan
timer to deploy new contexts:

   /**
 * The number of seconds between checks for web app deployment.
 */
private int checkInterval = 15;

is there a server.xml config file setting to alter this? 15 seconds is a bit
too fast...

I've noticed that if you happen to hit the URL for the context while it's
being deployed then the deployment aborts and you have to restart tomcat to be
able to start that context. Is this a known bug?

Thanks,
Adi

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




single-sign-on and cookies

2002-04-03 Thread Aditya

Is there any reason why the JSESSIONIDSSO cookie, if set via a SSL'd login
form, wouldn't be presented on the same server on a subsequent non-SSL page?

Adi

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




Re: Question about container-managed security

2002-04-02 Thread Aditya

On Tue, Apr 02, 2002 at 06:42:40PM -0500, Wellie W. Chao wrote:
 It's within the same webapp (the context path is the same). At first I
 thought it was a cache issue, but I hit reload on both protected and
 unprotected pages and it shows what I originally pulled up on each
 particular page. That is, users remain logged in, but when they visit
 unprotected sites, request.getRemoteUser() and other authentication methods
 behave as if the user is unauthenticated until the user revisits a protected
 page, at which point the authentication methods return valid information.
 Tomcat does not ask the user to log back in, so it remembers. I can visit
 other web sites and return to my application, and Tomcat still remembers
 authentication information, and Tomcat still returns null for
 request.getRemoteUser() on the unprotected pages (most served by Struts and
 Tiles).

are both protected and uprotected pages using the same scheme; ie. https for
both or http for both? because the logged-in cookie doesn't work across
schemes...

Adi

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




Re: Standalone tomcat 4.0 on port 80

2002-04-02 Thread Aditya

On Tue, Apr 02, 2002 at 06:42:51PM -0600, D Henton wrote:
 I want to run tomcat 4.0x on a Solaris 8 box in standalone mode on port 80
 as a user other than root.
 
 Is this possible? I been zipping through the archives and what I am hearing
 is that because root can only open ports  100, this scenario wouldn't be
 possible. There was a post on jguru saying that this feature might be added
 in newer versions.
 
 Am I missing something? Is this one of those magical sysadmin things,  via
 sudo or whatever?

It's a unix/linux thing that privileged ports (1024) can only be opened by
root. Other than running tomcat as root (which is probably not a good idea),
there isn't much tomcat can do to work around this.

 I could proxy it via apache and ajp13, but we are TOTALLY jsp/servlet, so I
 don't want to put apache in if I can avoid it.

you could use nat/redirection to send requests to port 80 to port 8080 etc.

Adi

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




programmatic way to invoke authentication?

2002-03-31 Thread Aditya

Is there a programmatic way to force a user to authenticate without using a
security-constraint in web.xml? It seems like I should be able to do something
like:

  String myremotename = request.getRemoteUser();
  if (myremotename == null){
LoginConfig myconfig = new LoginConfig();
myconfig.setAuthMethod(FORM);
myconfig.setErrorPage(/admin/error.html);
myconfig.setLoginPage(/admin/Login);
myconfig.setRealmName(My Login);
if (authenticate(request, response, myconfig)){
  return;
}
  } else {
out.println(username:  + myremotename + br);
  }

but needless to say, that doesn't work -- I've been through the javadocs and
source and can't figure it out. hints?

Thanks,
Adi

 

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




mod_webapp/SSL and transport-guarantee

2002-03-31 Thread Aditya

I'm trying to use apache/mod_ssl as an SSL front-end to tomcat 4. I have a few
issues:

- Is there anyway to get apache to forward all requests to tomcat? Apache with
mod_ssl is quite a bit faster than the standalone SSL container...

- Can I use single-sign-on with FORMs? How is the hostname in the session
cookie constructed?

- Since only SSL access will be allowed, tomcat shouldn't try any redirects
and isSecure() calls should always return true. Likewise, security-constraints
like:

  transport-guaranteeCONFIDENTIAL/transport-guarantee

should be always true. Is there any special way of doing this?

If anyone has a better way of designing this or tips, I would really
appreciate the advice.

Thanks,
Adi

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




webdav over SSL with http-auth?

2002-03-11 Thread Aditya

I'm trying to allow users to upload their files to their context via webdav on
a Tomcat 4.0.2 server over SSL and with auth-constraints on who can upload
stuff (I've tried it without auth-constraints and it works as expected). I've
followed the basic template offered at:

  http://www.jguru.com/faq/view.jsp?EID=544213

Unfortunately, Tomcat doesn't seem to be requiring the webdav client to
present the http auth login prompt. I've tried logging in as:

  https://username:password@server/context

and that seems not to make a difference. If I try to PUT a file (this is with
the cadaver client) I get a 302 error instead of a 403 as I would expect:

dav:/blah/ put foo.html
Uploading foo.html to `/blah/foo.html':
Progress: [=] 100.0% of 255 bytes failed:
302 Moved Temporarily

My auth config in the context web.xml looks like the following:

security-constraint
  web-resource-collection
 web-resource-nameThe Entire Web/web-resource-name
 url-pattern/*/url-pattern
 http-methodCOPY/http-method
 http-methodDELETE/http-method
 http-methodMOVE/http-method
 http-methodPOST/http-method
 http-methodPUT/http-method
 http-methodLOCK/http-method
  /web-resource-collection
  auth-constraint
 role-namemanager/role-name
  /auth-constraint
/security-constraint

  login-config
auth-methodBASIC/auth-method
realm-nameBlah realm/realm-name
  /login-config

  security-role
   descriptionAn example role defined in a JNDI realm/description
role-namemanager/role-name
  /security-role

does anyone have any hints on what I might be doing wrong?

Thanks,
Adi

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




Re: webdav over SSL with http-auth?

2002-03-11 Thread Aditya

It turned out that the problem fixed itself when I restarted tomcat. ugh.

On Mon, Mar 11, 2002 at 12:54:52PM -0800, Aditya wrote:
 I'm trying to allow users to upload their files to their context via webdav on
 a Tomcat 4.0.2 server over SSL and with auth-constraints on who can upload
 stuff (I've tried it without auth-constraints and it works as expected). I've
 followed the basic template offered at:
 
   http://www.jguru.com/faq/view.jsp?EID=544213
 
 Unfortunately, Tomcat doesn't seem to be requiring the webdav client to
 present the http auth login prompt. I've tried logging in as:
 
   https://username:password@server/context
 
 and that seems not to make a difference. If I try to PUT a file (this is with
 the cadaver client) I get a 302 error instead of a 403 as I would expect:
 
 dav:/blah/ put foo.html
 Uploading foo.html to `/blah/foo.html':
 Progress: [=] 100.0% of 255 bytes failed:
 302 Moved Temporarily
 
 My auth config in the context web.xml looks like the following:
 
 security-constraint
   web-resource-collection
  web-resource-nameThe Entire Web/web-resource-name
  url-pattern/*/url-pattern
  http-methodCOPY/http-method
  http-methodDELETE/http-method
  http-methodMOVE/http-method
  http-methodPOST/http-method
  http-methodPUT/http-method
  http-methodLOCK/http-method
   /web-resource-collection
   auth-constraint
  role-namemanager/role-name
   /auth-constraint
 /security-constraint
 
   login-config
 auth-methodBASIC/auth-method
 realm-nameBlah realm/realm-name
   /login-config
 
   security-role
descriptionAn example role defined in a JNDI realm/description
 role-namemanager/role-name
   /security-role
 
 does anyone have any hints on what I might be doing wrong?
 
 Thanks,
 Adi
 
 --
 To unsubscribe:   mailto:[EMAIL PROTECTED]
 For additional commands: mailto:[EMAIL PROTECTED]
 Troubles with the list: mailto:[EMAIL PROTECTED]
 

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




Configuring tomcat to serve static content

2001-11-26 Thread Aditya Sharma

Hi, 

We have an installation of Tomcat 3.3 on Windows 2000, and are using Tomcat to serve 
our static content (as a web-server). 

I have issues with serving binary documents (word and excel files).  The files are 
viewed correctly (by the respective plug-ins) in Internet Explorer, but Netscape 
displays garbled information in the browser.  I use the standard a 
href=../docs/name_of_file.doc File /a html comand to provide a link to the file. 

I am curious to find out what do I need to do to resolve this issue. 

Should I use Apache as the web-server, instead of Tomcat? 

Thanks in advance, 

Cheers,
Aditya Sharma

[EMAIL PROTECTED]

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




Re: Tomcat / J2EE - JNDI Help!!!

2001-08-13 Thread Aditya Anand

Okie... just pondering if tomcat provides a directory
service standalone i tried binding regular
serializable java objects to the  directory and get a
security exception saying the context is read-only!

--- Sophie [EMAIL PROTECTED] wrote:
 Hi,
 
 I am not working with your configuration, but I was
 wondering whether you had set your
 JNDI parameters correctly. For the tomcat server
 there is a need to update tomcat.sh
 (or tomcat.bat) and also your EJB server needs to
 have the correct address. Please let
 me know if the statements I am using would be useful
 for you.
 Sophie
 
 Papo Napolitano schreef:
 
  Hi all!
 
  I't trying to make a webapp with JSP and Session
 Beans.
  I've written my own EJB called usermanager and it
 was tested in my machine
  (localhost). I've made the deploy with deploytool
 from sun and works fine.
 
  Now, I want to install it on my server (Tomcat
 4.06b / J2EE). I made the
  deploy with the and application but I don't know
 how must I do to bound this
  EJB to a JNDI name to use it from JSP.
 
  This is my JSP code:
 
  %
  InitialContext ctx = new InitialContext();
  Object objref = ctx.lookup(usermanager);
  UserManagerHome homeuser =
 
 (UserManagerHome)PortableRemoteObject.narrow(objref,
 UserManagerHome.class);
  UserManager UsrMgr = homeuser.create();
  .
  .
  %
 
  When I run it from my browser I get the following
 error:
 
  javax.servlet.ServletException: Name usermanager
 is not bound in this
  Context
  at
 

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

org.apache.jsp._0002fuserfunc_jsp._jspService(_0002fuserfunc_jsp.java:121)
  at

org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
  at

javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
  at
 

org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
  va:200)
  at

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

org.apache.jasper.servlet.JspServlet.service(JspServlet.java:456)
  at

javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
  at
 

org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
  FilterChain.java:247)
  at
 

org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
  ain.java:193)
  at
 

org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
  va:243)
  at
 

org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
  66)
  at
 

org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
  at

org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
  at
 

org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
  va:219)
  at
 

org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
  66)
  at
 

org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
  at

org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
  at
 

org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2251)
  at
 

org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164
  )
  at
 

org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
  66)
  at
 

org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:446)
  at
 

org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
  64)
  at
 

org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
  at

org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
  at
 

org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
  :163)
  at
 

org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
  66)
  at
 

org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
  at

org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
  at
 

org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:
  984)
  at
 

org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1074
  )
  at java.lang.Thread.run(Thread.java:484)
 
  Cheers,
  Papo
 


__
Do You Yahoo!?
Send instant messages  get email alerts with Yahoo! Messenger.
http://im.yahoo.com/



RE: Generate Excel File

2001-07-19 Thread Aditya Anand

Actually using tabs is like running from the problem,
it the data contains a tab, then it would mess things
up again...you'll need to do a litle encoding for
this...

if the data is like..
Col1Col2col3
data1   data2  data,3
data4   data,5  data6
data,7   data8  data9

then you output as

col1,col2,col3
data1,data2,data,3
data4,data,5,data6
data,7,data8,data9

note here that these should be no space between the
deliminator comma and the enclosing double-quote. If
there is one, excel will presume the data not encoded
and treat the enclosing double quotes as part of the
element breaking on the first comma it hits...this is
one reason i donot use tabs, you could as well switch
to tabs instead of commas as long as you use the
double quotes, but tabs make it visually harder to
notice if spaces were pumped after the deliminator and
before the enclosing dbl-quotes... i use the following
code to accomplish this...


public class CSVEncoder{

private static final char DOUBLE_QUOTE = '';
private static final String COMMA_DOUBLE_QUOTE =
,\;

/**
 * This method encodes a String array into a row for
a CSV file
 * ex:
 * if you were to pass in the following array
 *  String[] values = {data1, data\2, data3};
 *
 * using a syntax like..
 *  String encodedValus = CSVEncoder.encode(values);
 *
 * you'd get...
 *  \data1\,\data\\2\,\data,3\
 *
 * appearing as...
 *  data1,data2,data,3
 * in the data stream
 **/
public static String encode(String[] columns){

if(columns.length  1)
return null;

StringBuffer encoded = new StringBuffer();

// encode the firstElement
encoded.append(DOUBLE_QUOTE);
encoded.append(encode(columns[0]));
encoded.append(DOUBLE_QUOTE);

//encode the rest of'em
int maxLoop = columns.length;
for (int loop = 1; loop  maxLoop; loop++){

encoded.append(COMMA_DOUBLE_QUOTE);
encoded.append(encode(columns[loop]));
encoded.append(DOUBLE_QUOTE);
}
return encoded.toString();
}

/**
 * encodes a given string into a CSV safe format
 * ex:
 * if you were to pass a String...
 *  String value = 6\3\', 190.5 cm; //63', 190.5
cm
 *
 * using a syntax like...
 *  String encodedValue = CSVEncoder.encode(value);
 *
 * you'd get...
 *  63', 190.5 cm
 *
 * which would look like...
 *  63', 190.5 cm
 * in the data stream
 **/
public static String encode(String s){

StringBuffer encoded = new StringBuffer();

int maxLoop = s.length();
for(int loop = 0; loop  maxLoop; loop++){

char theChar = encoded.charAt(loop);

//if the current char is a dbl-quote, stuff another
dbl-quote into the buffer
if(theChar == DOUBLE_QUOTE)
encoded.append(DOUBLE_QUOTE);

encoded.append(theChar);
}

return encoded.toString();
}
}
--- Erin Lester [EMAIL PROTECTED]
wrote:
 Actually that's how it was formatted.  I tried what
 someone else
 suggested, using tabs instead of commas, and that
 worked.
 
 Thanks,
 Erin
 
 On Thu, 19 Jul 2001, Paul Kofon wrote:
 
 Hi,
 I've never done what you'd like to do. But if I
 remember correctly, the CSV 
 text below will display correctly in Excel:
 
 Item,Price
 Doll,30
 GameBoy,200
 
 You'd have two rows and two columns (with headers
 Item and Price) of data. 
 If the CSV data you're feeding Excel is not
 formatted like this, then 
 chances are that you'd get wrong results - that
 explains why your single row 
 of data isn't showing up correctly.
 
 Regards,
 
 Paul
 
 From: William Kaufman [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 To: '[EMAIL PROTECTED]'
 [EMAIL PROTECTED]
 Subject: RE: Generate Excel File
 Date: Wed, 18 Jul 2001 17:58:12 -0700
 
 We've got it working exactly as you say, but
 only if the data is delimited
 with _tabs_, not _commas_.
 
  -- Bill
 K.
 
   -Original Message-
   From: Erin Lester
 [mailto:[EMAIL PROTECTED]]
   Sent: Wednesday, July 18, 2001 2:21 PM
   To: [EMAIL PROTECTED]
   Subject: Generate Excel File
  
  
   Hi, I'm trying to generate an excel file as
 the response
   returned from a
   servlet.  I have set the response's content
 type to
   application/vnd.ms-excel and this seems to
 cause excel to open.  The
   data 

Re: JSP's not finding classes in WEB-INF

2001-07-18 Thread Aditya Anand

 Greetings!
 
 Ok - running Tomcat 3.2 on SunOS 2.7, with Java 1.2.
  
 
 I have a working application with servlets and JSP
 pages running under
 Tomcat 3.1.  I'm trying to port it to 3.2.
 
 However, every time I hit a JSP page, it gives a 500
 error about how it
 cannot find classes to compile.  Those classes are
 located in the WEB-INF
 directory, under the /classes folder.  

I assume these are your bean classes. These should be
put under the WEB-INF/lib directory rather than the
classes directory. The classes directory is ment only
for un-jarred servlet classes that have been declared
in the web.xml file.

 The classpath does *not* contain the WEB-INF/classes
 directory.
you donot have to specify WEB-INF/classes in the
system classpath
 
 If I hard-code the WEB-INF/classes directory into
 the classpath, they
 work.  However, I do not want to do this.  
 
 What is the problem, and how can I resolve it?
 
 I have tried settiing the environment variables
 TOMCAT_HOME and JAVA_HOME,
 and moving tools.jar into TOMCAT_HOME/lib.
Put any servlet jars, beans, and required
non-statndard libraries under the lib folder (like
log4J, or xalan)

cheers
Adi


__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/



Re: JSP's not finding classes in WEB-INF

2001-07-18 Thread Aditya Anand

this seems stupid but did u restart the server!...
also you do have the servlets defined in
web.xml..right?

I use 4.0 b-5, and I haven't come across this problem,

My servlets and Beans are in separate jar files under
WEB-INF/lib, which also contains other jars need,
Ihave never touched the classpath setup by Tomcat, and
it orks just fine

Can I have a peek at the logs?


--- Will England [EMAIL PROTECTED] wrote:
 On Wed, 18 Jul 2001, Aditya Anand wrote:
 
   However, every time I hit a JSP page, it gives a
 500
   error about how it
   cannot find classes to compile.  Those classes
 are
   located in the WEB-INF
   directory, under the /classes folder.  
  
  I assume these are your bean classes. These should
 be
  put under the WEB-INF/lib directory rather than
 the
  classes directory. The classes directory is ment
 only
  for un-jarred servlet classes that have been
 declared
  in the web.xml file.
 
 Actually, just to make things interesting, those
 *are* servlet
 classes.  We have both servlets and JSP's that use
 library classes for
 various things.  Currently, they live in
 WEB-INF/classes.  One of these
 years we'll get things sorted out a bit better.
 
  Put any servlet jars, beans, and required
  non-statndard libraries under the lib folder (like
  log4J, or xalan)
 
 Ok, so I created a jar file with the servlet classes
 and library classes
 in it and moved it to WEB-INF/lib.
 
 Didn't work.
 
 I cannot put this .jar file in TOMCAT_HOME/lib --
 each context / virtual
 host will have slightly different bits in the
 servlets.
 
 Will
 


__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/



RE: The 4.0b5 doesn't recognize a servlet class

2001-07-18 Thread Aditya Anand

hmm... did you recompile the classes using the tomcat
lib jars?
--- Vernon Wu [EMAIL PROTECTED] wrote:

HR
htmlDIV
PHi, /P
Pnbsp;/P
PAs you suggested, I moved the j2ee.jar from the
web-inf\lib to common\lib. And then I restarted the
Tomcat 4.0b5. Here is what I got:/P
PCatalina.start: LifecycleException:nbsp; start:
:nbsp;
java.lang.NoSuchMethodErrorBRLifecycleException:nbsp;
start: :nbsp;
java.lang.NoSuchMethodErrorBRnbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;
at
org.apache.catalina.loader.StandardLoader.start(StandardLoader.java:6BR49)BRnbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1100)/P
Pnbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp; at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3BR189)BRnbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)/P
Pnbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp; at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)/P
Pnbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp; at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:278BR)BRnbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;
at
org.apache.catalina.core.StandardService.start(StandardService.java:3BR53)BRnbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;
at
org.apache.catalina.core.StandardServer.start(StandardServer.java:458BR)BRnbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;
at
org.apache.catalina.startup.Catalina.start(Catalina.java:725)BRnbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;
at
org.apache.catalina.startup.Catalina.execute(Catalina.java:647)BRnbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;
at
org.apache.catalina.startup.Catalina.process(Catalina.java:177)BRnbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;
at java.lang.reflect.Method.invoke(Native
Method)BRnbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;
at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:196)BR-
Root Cause
-BRjava.lang.NoSuchMethodErrorBRnbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;
at
org.apache.catalina.loader.StandardLoader.start(StandardLoader.java:6BR27)BRnbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1100)/P
Pnbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp; at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3BR189)BRnbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)/P
Pnbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp; at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)/P
Pnbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp; at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:278BR)BRnbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;
at
org.apache.catalina.core.StandardService.start(StandardService.java:3BR53)BRnbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;
at
org.apache.catalina.core.StandardServer.start(StandardServer.java:458BR)BRnbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;
at
org.apache.catalina.startup.Catalina.start(Catalina.java:725)BRnbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;
at
org.apache.catalina.startup.Catalina.execute(Catalina.java:647)BRnbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;
at
org.apache.catalina.startup.Catalina.process(Catalina.java:177)BRnbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;
at java.lang.reflect.Method.invoke(Native
Method)BRnbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;
at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:196)/P
Pnbsp;/P
PIf I don't relocate the j2ee.jar file, when I try
to open up the main page which doesn't call any
servlet instance. What I get is the followings:/P
H3Exception
Report:/H3PREjavax.servlet.ServletException: Class
org.apache.jasper.servlet.JspServlet is not a
Servlet/PREPRE.../PREPREH3Root
Cause:/H3PREjava.lang.ClassCastException:
org.apache.jasper.servlet.JspServlet/PREPRE...BR/PREPREPlease
advise what steps I shall
take/PREPREnbsp;/PREPREThanks.BR/PRE/PRE/DIV
DIV/DIV
DIV/DIVOriginal Message Follows 
DIV/DIVFrom: Wells Tiedeman
[EMAIL PROTECTED]
DIV/DIVReply-To: [EMAIL PROTECTED] 
DIV/DIVTo: '[EMAIL PROTECTED]'
[EMAIL PROTECTED]
DIV/DIVSubject: RE: The 4.0b5 doesn't recognize a
servlet class 
DIV/DIVDate: Tue, 17 Jul 2001 16:06:10 -0400 
DIV/DIVMIME-Version: 1.0 
DIV/DIVReceived: from [64.208.42.41] by
hotmail.com (3.2) with ESMTP id
MHotMailBD1DE6CE00214004389F40D02A290FE90; Tue, 17 Jul
2001 13:10:55 -0700 
DIV/DIVReceived: (qmail 38493 invoked by uid 500);
17 Jul 2001 20:10:46 - 
DIV/DIVReceived: (qmail 38486 invoked from
network); 17 Jul 2001 20:10:45 - 
DIV/DIVReceived: from
salesvision-gw.youcentric.com (HELO
yc?exchange.yc?exchange.salesvision.com) (12.19.52.2)
by h31.sny.collab.net with SMTP; 17 Jul 2001 20:10:45
- 
DIV/DIVReceived: by
yc_exchange.yc_exchange.salesvision.com with Internet
Mail Service (5.5.2653.19)id lt;3XZSJXH3gt;; Tue, 17
Jul 2001 16:06:11 -0400 
DIV/DIVFrom tomcat-user-return-41410-vwu0 Tue, 17
Jul 2001 13:11:00 -0700 
DIV/DIVMailing-List: contact
[EMAIL PROTECTED]; run by ezmlm 
DIV/DIVPrecedence: bulk 
DIV/DIVlist-help: ?xml:namespace prefix = mailto
/mailto:[EMAIL PROTECTED]
DIV/DIVlist-unsubscribe:
mailto:[EMAIL 

Re: Tomcat: subject

2001-07-18 Thread Aditya Anand

why don't you just setup a filter based on the 'to'
address!
--- Li, Jerry [EMAIL PROTECTED] wrote:
 Hi, All:
 
 We have been flooded by emails from the mailing
 lists of CVS, apache,
 tomcat, and so on. All of them come into our inbox,
 it is very tough to
 separate them. If you send emails with Tomcat in
 the subject, we could
 easily group them and redirect them into a dedicated
 folder. For example,
 Windows user may create a rule in outlook to
 redirect all emails with Tomcat
 in the subject to a folder called Tomcat.
 
 thanks,
 
 Jerry
 
 


__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/



what's wrong here?

2001-07-17 Thread Aditya Anand

Hi what is wrong with this code?

ic = new InitialContext();
Object myObj = new MyObject();
ic.rebind(java:comp/env/my_object, myObj);
// I even tried java:/comp/env/my_obj
ic.close();

I get a NamingException saying the context is
readonly.
I am using Tomcat 4.0 beta5 on NT / JVM 1.3.0_02

any suggestion?

Adi


__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/



Re: relative path to real one

2001-07-16 Thread Aditya Anand

Use ServletContext.getRealPath(xyz); to do this.
This assumes that xyz is a resource in your context
root
--- Jaume Pausas [EMAIL PROTECTED] wrote:
 Hi!
 
 Is it possible to translate a relative path to its
 absolute one in the web
 pages under Tomcat 4.0b5?
 
 So if I have a context named mycontext and some
 day I decided to change
 its name to myothercontext how can I manage to
 perform any changes?
 
 Thanks,
 JPausas
 
 
 
 
 

___
 ¡Tienes cuentas de e-mail GRATIS en Excite España!
 A tu disposición en http://correo.excite.es 
 


__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/



read-only initial context

2001-07-16 Thread Aditya Anand

Hi i'm trying to bind an object to java:comp/env
using initial context and i get the attached exception
message. I am using tomcat-4.0-b5, Clearly the message
says the context is read-only, how do i change this.
The same code executes fine over resin and jrun.

TIA

Aditya
--- The Exception ---
javax.naming.NamingException: Context is read only
at
org.apache.naming.NamingContext.checkWritable(NamingContext.java:935)
at
org.apache.naming.NamingContext.bind(NamingContext.java:863)
at
org.apache.naming.NamingContext.rebind(NamingContext.java:249)
at
org.apache.naming.NamingContext.rebind(NamingContext.java:264)
at
org.apache.naming.SelectorContext.rebind(SelectorContext.java:253)
at
javax.naming.InitialContext.rebind(InitialContext.java:366)
at
com.casewerks.web.controller.Controller.init(Controller.java:34)
at
javax.servlet.GenericServlet.init(GenericServlet.java:258)
at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:833)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3277)
at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:785)
at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:413)
at
org.apache.catalina.core.StandardHost.install(StandardHost.java:641)
at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:300)
at
org.apache.catalina.startup.HostConfig.start(HostConfig.java:389)
at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:232)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:155)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1131)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:278)
at
org.apache.catalina.core.StandardService.start(StandardService.java:353)
at
org.apache.catalina.core.StandardServer.start(StandardServer.java:458)
at
org.apache.catalina.startup.Catalina.start(Catalina.java:725)
at
org.apache.catalina.startup.Catalina.execute(Catalina.java:647)
at
org.apache.catalina.startup.Catalina.process(Catalina.java:177)
at java.lang.reflect.Method.invoke(Native
Method)
at 
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:196)


__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/