RE: Using Tomcat Without a Webserver

2002-02-12 Thread Tom Drake

Apache also adds load balancing (via mod_jk).

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of
Mark Woon
Sent: Monday, February 11, 2002 5:11 PM
To: [EMAIL PROTECTED]
Subject: Using Tomcat Without a Webserver


Hi all.

I know it's standard practice to hook Tomcat up to a webserver, but is
this really necessary?  According to the docs, the main reason for this
is that Tomcat's performance when serving static files is sub-par,
although it usually goes on to note that this has improved recently.  I
can't seem to find anything on Tomcat 4.0x though, and I'm wondering if
this advice is outdated?  I thinking of using Tomcat only on a
production system with light to moderate traffic.  Almost all pages are
JSP's, so the only static content would be images.

So:  What's the word on running Tomcat 4.02 without a webserver?  What
does using Apache+Tomcat buy me?


Thanks,
-Mark


--
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: Multi-user problem

2002-02-06 Thread Tom Drake

See my comments below.

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, February 06, 2002 3:23 PM
Subject: Multi-user problem


... snip ...
| Apache 1.3 is a service on Windows 2000 running Tomcat 4 on the same
server, with SQL server 2000 SP1 on the same server.
| My system has 2 servlets, AUDREPORT and NEXTIMAGE.  AUDREPORT is run once
per user at login.
| NEXTIMAGE is called repeatedly (say 1000 to 3000 times per workshift per
user).
| Database connections are made through ODBC with the JDBC:ODBC:DSN bridge
using the sun.jdbc.odbc.JdbcOdbcDriver driver.  I used a SYSTEM DSN.


The JDBC/ODBC bridge is notoriously bad and not thread safe.
This could be the root of your problems. If you are using
MS-ACCESS, I think you're probably stuck with it and will
have to synchronize around your database calls. I'm pretty
sure there is a 'real' JDBC driver available for SQL Server.


... snip ...
|
| The NEXTIMAGE servlet looks something like this pseudo-code:
| public static void login(...){ Tell database user is logged in. }
| public static void logout(...) {Tell database user is logged out.}
| public static void updateaccesstime(...) {Tell Database I made a request}

Are the above functions keeping class data
(such as a connection to your database)?

If a 'login' request gets a new database connection,
then any other thread that is using
the original connection will break.




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




Re: RMI remote Method which returns File object.

2002-02-06 Thread Tom Drake

Sucharitha:

A File object represents a files name (and location).
It does not represent or store the contents of a file.
Therefore, using RMI to pass a File object around doesn't
make much sense. It is likely that a File object
that points to a valid file on the client is completely
invalid on the server. Worse yet, it is valid, but points
to a different copy of the file.

If you need to transfer a file from one side of an RMI
connection to another, you'll need to read the file into
a buffer of some sort and pass that across your RMI
interface.

This explains why your client program only works when
you run it on the same computer as your server.

Tom

- Original Message -
From: Sucharitha Panthika [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Wednesday, February 06, 2002 5:16 PM
Subject: RMI remote Method which returns File object.


Hey

I have a qution using RMI to return files . If I have a a remote method
public File getFile();
method in a Server and I implemented this method to return one file from
my local drive C:\.  When the remote Client from different system calls
this method should it return the my File
to that Client or not.  i have give allpermission in the policy files.

I have similar example. When I run the Client from a different system I
don't get the File
object instead when I run the Client from myy system in another window
without the required classes in the classpath I get the File.

Can Any one let me know what could be the problem? I am attaching the
Server, ServerImpl, Client and policy files for review if required.


Sucharitha



-Original Message-
From: Gearoid Coughlan [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 06, 2002 3:32 PM
To: 'Tomcat Users List'
Subject: tomcat 4.0 + apache 1.3.12 + mod_jk


Hi

I am getting the following error reported in mod_jk.log when
executing servlets
--
[Wed Feb 06 23:14:56 2002]  [jk_connect.c (143)]: jk_open_socket,
connect()
failed errno = 146
[Wed Feb 06 23:14:56 2002]  [jk_ajp13_worker.c (196)]: In
jk_endpoint_t::connect_to_tomcat, failed errno = 146
[Wed Feb 06 23:14:56 2002]  [jk_ajp13_worker.c (635)]: Error connecting
to
the Tomcat process.
[Wed Feb 06 23:14:56 2002]  [jk_ajp13_worker.c (848)]: In
jk_endpoint_t::service, send_request failed in send loop 2
---

Im running apache version 1.3.12
with tomcat 4.0.x

when I run tomcat 3.0 everything is fine.
BTW im running this on a Sparc Solaris SunOS 8

Any ideas..

thanks
gearoid



--
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: DistributedManager

2002-02-03 Thread Tom Drake

Yes. It does not achieve the desired effect, in that updates are not
persisted across the cluster, only newly created sessions.

I'm working on a replacement that solves the problem of distributed session
management, thus providing fail-over capability for a properly configured tc
cluster.

Tom

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, February 03, 2002 5:27 PM
Subject: DistributedManager


| Has anyone played with the DistributedManager?
|
| Jonathan.
|
| --
| 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: How Session-Replication works when clustering Apache/Tomcat

2002-01-30 Thread Tom Drake

Alexander:

Currently, Tomcat 4 doesn't really do session
replication. However, I've been working on a
clustering / distributed session management
solution that should work beautifully in the
the scenario you describe below.

The way it works is that all tomcats in the
cluster are given the same 'cluster multicast ip/port'
information (via server.xml). At startup time,
tomcat will discover all the session replication
(RMI) services, and obtain copies of sessions already
stored elsewhere in the cluster.

If a tc instance is required to create a new session
or update an existing session, it will, on completion
of the HttpServletRequest, persist that session to
all known session repositories in the cluster.

If a request for an 'unknown' jsession id comes to a
tc instance, it will query one of the other 'session
repositories' in the cluster, and obtain that session.
Normally, it would already have a copy of the session
because of what I described in the preceeding paragraph.

There is more to this, but this description is a fairly
accurate yet simple description.

I've completed (and tested) the multicast RMI registry
code which enables the auto-discovery of RMI services.

I've also completed (and tested) the distributed
object management code.

I've also done some of the integration work including
- a new SessionManager that performs the required
  interactions with the 'other' repositories in the cluster.
- a new Valve that notifies the new SessionManager when an
  HttpServletRequest is complete (so that it can then persist
  the new or changed session across the cluster).

But I've yet to properly integrate the session / object
repository into Tomcat such that it's lifecycle is properly
managed.

I really should have finished this all weeks ago, but I've
been pounding the pavement looking for a paying gig, as
resources are getting a bit thin around my place.

Regards,

Tom

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, January 30, 2002 6:48 AM
Subject: How Session-Replication works when clustering Apache/Tomcat


| Hi everybody,
|
|
| to distribute the load of client requests of our web application and to
| guarantee reliability we have to do hardware load balancing and use two
| redundant web servers.
| For that we have to cluster Apache 1.3.23 with Tomcat 3.3a on our
machines.
|
| The file (sketch.txt) shows a scenario with our actual
| hardware-architecture:
|
| (2)
| __\/
|  webserver1 |Ap\ac/he |
| | To\/mcat | - Session-ID (3)
|/|___/\_|
|   //  \  ||
|  /   ||
| /_   ||
| |  HW-   |   || (4) Session-
| (1) |Balancer|   || Replication??
| ||   ||
| \||
|  \   ||
|   \  \/
|\
| | Apache  |
|  webserber2 |  Tomcat  | - Session-ID?? (5)
| |__|
|
|
| Look at following scenario:
|
| For example, if a user logs in he gets his own session ID. The hardware
| load
| balancer decides to forward his request to webserver1 and some information
| of
| this session is stored on that machine.
| Then the same user sends a request again but webserver1 is not reachable
| anymore
| of any reasons! Of course the hardware load balancer forwards his request
| to
| webserver2. How that machine gets the previous session information?
|
|   - Is it possible to configure Tomcat 3.3a in that way to do Session
| Replication?
|   - Is there any plugin to install for Tomcat 3.3a to guarantee this?
|   - Or have I implement that for my own?
|
|
| Of course I've searched in the internet to get information about it and
| read
| almost all newsletters on jakarta's website. But I didn't found any useful
| information.
|
|
|
| With kind regards,
|
| Alexander Ladinig
| System Architect
|
|
| --
| 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: About persistent

2002-01-23 Thread Tom Drake

Bo:

Each one of your requests will burn a socket and a thread
(both of which are managed by Tomcat).

So, you'll need to make sure that you don't exceed the limits
on these resources.

However, keeping an open socket connection for 'long' periods
of time may not be the best way of meeting your goals.

RMI may be a better choice, however, you may run into firewall
issues.

Assuming that you really want to stick to the HTTP connection,
your initial request could start a new 'thread' on the server (that
you manage with code you write). The server would need
to return an identifier that the applet passes along with subsequent
requests so that your server can find the corresponding object/thread,
and retrieve any data that is 'available'. This way, you don't burn
more sockets than you really need. The server could 'cancel'
any objects/threads that haven't been asked for (by an applet) after
some time period. This would help limit the number of threads in your
server.

The cost of this solution is in making/breaking multiple TCP connections
for each request, but the advantage is that you gain control over what
resources the server is using.

Good Luck

Tom Drake


- Original Message -
From: Bo Xu [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Wednesday, January 23, 2002 10:41 AM
Subject: Re: About persistent


| - Original Message -
| From: Vjeran Marcinko [EMAIL PROTECTED]
| To: Tomcat Users List [EMAIL PROTECTED]
| Sent: Wednesday, January 23, 2002 12:45 PM
| Subject: About persistent
|
|
| Hi again.
| One more question, and yes, I know this
| isn't standard usage that servlets are made for, but
| situation is like this -
|
| I have to create servlet that will never exit its doPost() method,
| and that way be able to keep response's output stream constantly
| open, and send asinchronous messages to applet which has sent
| that POST request.
| Tell me, since there will be bunch of applets keeping this persistent
| connections, will it crash somehow Tomcat ?
| I don't know Tomcat's internal structure, so I'm wondering is there
| a case when all servlet threads from thread pool (I assume it exists in
| Tomcat) could be used (since never exiting), thus freezing whole web
| service ?
| And is there some timeout implemented for response, when they last too
long
| ?
|
| Thanx,
| Vjeran
| [...]
|
|
|
| * about timeout:
|the following is from server.xml in TOMCAT4.0:
| !-- Define a non-SSL HTTP/1.1 Connector on port 8080 --
| Connector
className=org.apache.catalina.connector.http.HttpConnector
|port=8080 minProcessors=5 maxProcessors=75
|enableLookups=true redirectPort=8443
|acceptCount=10 debug=0 connectionTimeout=6/
| !-- Note : To disable connection timeouts, set connectionTimeout
value
|  to -1 --
|
| I think 6(60s) will be set into
| org.apache.catalina.connector.http.HttpConnector, and in:
| org.apache.catalina.connector.http.HttpConnector,java:
|  ...
|  private int connectionTimeout = Constants.DEFAULT_CONNECTION_TIMEOUT;
|  ...
|  public void setConnectionTimeout(int connectionTimeout) {
| this.connectionTimeout = connectionTimeout;
| }
|  ...
| public void run() {
|  ...
|socket = serverSocket.accept();
|  ...
|if (connectionTimeout  0)
|   socket.setSoTimeout(connectionTimeout);
|   socket.setTcpNoDelay(tcpNoDelay);
|} catch (AccessControlException ace) {
|  ...
|
|
| so I guess there will be a TimeOut Exception when container is in a
| reading-status but can not get any(more-than-1) byte within 60s.
| so normally your Applet need to send at least 1 byte during 60s.
|
| but if your Servlet is writing bytes to client, I guess you will not
| get TimeOut. (Is my guessing  right?   Thanks :-)  )   the following
| is from doc of J2SE1.3:
|
| java.net.Socket.setSoTimeout
| public void setSoTimeout(int timeout)
| throws SocketExceptionEnable/disable SO_TIMEOUT with the specified
timeout,
| in milliseconds. With this option set to a non-zero timeout, a read() call
| on the InputStream associated with this Socket will block for only this
| amount of time. If the timeout expires, a java.io.InterruptedIOException
is
| raised, though the Socket is still valid. The option must be enabled prior
| to entering the blocking operation to have effect. The timeout must be 
0.
| A timeout of zero is interpreted as an infinite timeout.
|
|
|
| * about Thread:
|I guess it is better to keep a short-time HTTP request/response, but
|because your application need a long/forever one, so I think you can
|try, and:
| -  another way is keep the client-status in server-side(for ex., how many
| bytes have already been read/written), and in client-side(Applet),
| connect to Servlet periodicly(to release/re-made the http-connection)
|
|
| Bo
| Jan232002
|
|
|
| --
| To unsubscribe:   mailto:[EMAIL PROTECTED]
| For additional commands: mailto:[EMAIL PROTECTED]
| Troubles

Re: IOException, that reset by peer thing.

2002-01-15 Thread Tom Drake

That message means the the 'other' end of the connection
was closed. This could happen if you press the 'stop'
button on your browser.


- Original Message -
From: Mike Curwen [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, January 15, 2002 7:21 AM
Subject: IOException, that reset by peer thing.


| Hi,
|
| This has probably been covered before, but thought I'd risk a 'stfw' and
ask
| anyways. ;)
|
| What is the cause (and solution?) for this fairly frequent and non-fatal
| error?
|
| IOException in R(/myfolder+/jsp/somepage.jsp+null) Connection reset by
peer:
| socket write error.
|
| p.s. - I have done a google search, and there were a few references to
| WinSock errors (ie: it isn't tomcat).  But I'm not sure I 100% buy that.
|
| Thanks everyone.
|
| MikeC
|
|
| --
| 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: Periodically Refresh Application Bean?

2002-01-12 Thread Tom Drake

Rick:

There is no need to restart Tomcat just update the 
data stored in your bean.

You could provide a jsp or servlet that maps the input
parameter names / values to setter methods in your 
application bean. Then your external process simply 
needs to send a URL GET (or POST) request with 
the new data.

Alternatively, you could write a class that implements 
ServletContextListener and that also implements Runnable. 
This class could start itself in a new thread in the 
contextInitialized() method. The run() method could wake 
up every now and then and go and get the 'updated' data
you need, then update your Application scope bean.
Don't forget to provide the means to stop your thread in 
the contextDestroyed() method.

The 2.3 Servlet spec features really provide elegant
ways of solving many of the problems that required 
container specific hacks in earlier spec versions.

Good Luck

Tom Drake
- Original Message - 
From: Rick Roberts [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Saturday, January 12, 2002 12:52 PM
Subject: Periodically Refresh Application Bean?


| I have an application that has a bean with application scope.
| I would like to run a cron job once a day to refresh the data in this 
| bean.  It would be nice if I did not have to restart Tomcat everytime. 
| Anyone know how I could do this?
| 
| Thanks,
| 
| -- 
| ***
| * Rick Roberts*
| * Advanced Information Technologies, Inc. *
| ***
| 
| 
| --
| 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: Problems using same port for several services (even with different IP / hostname)

2002-01-10 Thread Tom Drake

Contrary to your statement below, only one process may bind to the
same port (80 in this case) at the same time.

Your IIS and Inktomi servers do not both share port 80.

No, they don't.

I've never worked with Inktomi, but it's conceivable that it is
being front-ended by IIS, (via an ISAPI connector of some sort).
This would explain why you think that it is available through port 80.

Tomcat may be front-ended via IIS in a similar manner. All client
requests go to IIS, which funnels them to Tomcat via an ISAPI connector.

Instructions for setting this up may be found here:
http://jakarta.apache.org/tomcat/tomcat-3.3-doc/in-process-howto.html

Tom Drake
- Original Message -
From: chris brown [EMAIL PROTECTED]
To: tomcat-user [EMAIL PROTECTED]
Sent: Thursday, January 10, 2002 6:51 AM
Subject: Problems using same port for several services (even with different
IP / hostname)


| Hello,
|
| I've got to add a small Tomcat-based webapp onto a machine which already
is
| already several webservers.  One is an IIS webserver, the other is a
search
| engine (Inktomi Enterprise Search) with it's own built-in search engine.
| All must run on port 80 because that's company firewall policy, and all
must
| run on the same host because that's all the company's prepared to dedicate
| in terms of resources...
|
| So far, no problem with the other services.  The machine has been assigned
| several unique IP addresses and different names in the DNS.  A similar
setup
| has been created for the Tomcat service (a unique IP address and DNS
entry).
| Tomcat responds on this IP address and domain name correctly when the port
| is anything other than 80.  I believe that the elements Engine,
Host,
| and Alias (the latter is within the Host element) are all correctly
| set... the problem seems to be with the Connector element:
|
|  Connector className=org.apache.catalina.connector.http.HttpConnector
|   address=x.x.x.x port=80 minProcessors=5 maxProcessors=75
|   enableLookups=true redirectPort=443
|   acceptCount=10 debug=0 connectionTimeout=6/
|
| My server.xml file is pretty standard, except that the Apache Service
for
| mod_webapp has been removed and I've changed hostnames and ports as
| appropriate.  I added the address argument as described in the Tomcat
| documentation, but the results I'm getting are as if this attribute was
| ignored.
|
| When checking the logs and STDOUT/STDERR, I see that when the port is 80,
| Tomcat fails to start due to an exception being thrown (the basic message
is
| that the port is in use.  This is not the case for the specified port:
it's
| as if Tomcat tried binding to a different port + ip/hostname.
|
| None of the other services intercept each other's requests erroneously -
| there doesn't seem to any conflicts with them.
|
| Am I doing something wrong?  What should I do or check, and how can I make
| all these services work together correctly?
|
| Thanks,
| Christopher Brown
|
|
|
| --
| 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: Problems using same port for several services (even with different IP / hostname)

2002-01-10 Thread Tom Drake

Oops! I missed the statement about multiple IP address, sorry.

However, instructions for setting this up may be found here:
http://jakarta.apache.org/tomcat/tomcat-3.3-doc/in-process-howto.html

- Original Message -
From: chris brown [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Thursday, January 10, 2002 9:10 AM
Subject: Re: Problems using same port for several services (even with
different IP / hostname)


| Yes they *do* have the same port, but use different IP addresses.
|
| In IIS, go to the Management Console for the web server, and open the
| properties window for any web site.  If you look at the Web Site tab,
| you'll see an IP address listbox, which is by default set to (All
| Unassigned). If you look at the listbox's options, you'll see a list of
all
| IP addresses bound to the machine (normally, there's only one, but you can
| add more if your network is set up appropriately - check out TCP/IP
| properties for the machine).  Inktomi Search is a stand-alone server, with
| its own in-built web server (it's NOT an ISAPI extension); it too can bind
| to the same port as long as the IP address is different.  I should know --
I
| distribute it !!! ;-)
|
| I'm not trying to start a flame war or whatever, I just have a problem
that
| I'm trying to solve, which is why I'd like to explain the problem in more
| detail, because I still need a solution.
|
| I'm well aware of the impossibility of using the same port on the same IP
| address, and do know the difference between that and domain-name-based
| virtual hosting.
|
| Thank you anyway for taking the time to reply.  But unfortunately, the
| problem still remains.  Any other ideas ?
|
| Thanks,
| -Chris
|
| - Original Message -
| From: Tom Drake [EMAIL PROTECTED]
| To: Tomcat Users List [EMAIL PROTECTED]
| Sent: Thursday, January 10, 2002 4:40 PM
| Subject: Re: Problems using same port for several services (even with
| different IP / hostname)
|
|
|  Contrary to your statement below, only one process may bind to the
|  same port (80 in this case) at the same time.
| 
|  Your IIS and Inktomi servers do not both share port 80.
| 
|  No, they don't.
| 
|  I've never worked with Inktomi, but it's conceivable that it is
|  being front-ended by IIS, (via an ISAPI connector of some sort).
|  This would explain why you think that it is available through port 80.
| 
|  Tomcat may be front-ended via IIS in a similar manner. All client
|  requests go to IIS, which funnels them to Tomcat via an ISAPI connector.
| 
|  Instructions for setting this up may be found here:
|  http://jakarta.apache.org/tomcat/tomcat-3.3-doc/in-process-howto.html
| 
|  Tom Drake
|  - Original Message -
|  From: chris brown [EMAIL PROTECTED]
|  To: tomcat-user [EMAIL PROTECTED]
|  Sent: Thursday, January 10, 2002 6:51 AM
|  Subject: Problems using same port for several services (even with
| different
|  IP / hostname)
| 
| 
|  | Hello,
|  |
|  | I've got to add a small Tomcat-based webapp onto a machine which
already
|  is
|  | already several webservers.  One is an IIS webserver, the other is a
|  search
|  | engine (Inktomi Enterprise Search) with it's own built-in search
engine.
|  | All must run on port 80 because that's company firewall policy, and
all
|  must
|  | run on the same host because that's all the company's prepared to
| dedicate
|  | in terms of resources...
|  |
|  | So far, no problem with the other services.  The machine has been
| assigned
|  | several unique IP addresses and different names in the DNS.  A similar
|  setup
|  | has been created for the Tomcat service (a unique IP address and DNS
|  entry).
|  | Tomcat responds on this IP address and domain name correctly when the
| port
|  | is anything other than 80.  I believe that the elements Engine,
|  Host,
|  | and Alias (the latter is within the Host element) are all
correctly
|  | set... the problem seems to be with the Connector element:
|  |
|  |  Connector
className=org.apache.catalina.connector.http.HttpConnector
|  |   address=x.x.x.x port=80 minProcessors=5 maxProcessors=75
|  |   enableLookups=true redirectPort=443
|  |   acceptCount=10 debug=0 connectionTimeout=6/
|  |
|  | My server.xml file is pretty standard, except that the Apache
Service
|  for
|  | mod_webapp has been removed and I've changed hostnames and ports as
|  | appropriate.  I added the address argument as described in the
Tomcat
|  | documentation, but the results I'm getting are as if this attribute
was
|  | ignored.
|  |
|  | When checking the logs and STDOUT/STDERR, I see that when the port is
| 80,
|  | Tomcat fails to start due to an exception being thrown (the basic
| message
|  is
|  | that the port is in use.  This is not the case for the specified port:
|  it's
|  | as if Tomcat tried binding to a different port + ip/hostname.
|  |
|  | None of the other services intercept each other's requests
erroneously -
|  | there doesn't seem to any conflicts with them.
|  |
|  | Am I doing

Re: tom4 session and loadbalancing / Distributed Session Management

2002-01-09 Thread Tom Drake

Michael:

I've been focusing on finding paid work, however, the Tomcat side
of things is pretty much done. What remains is:

- Completion of Valve (that notifies session manager when a request
  is complete). Craig tells me the code for this needs a little work, and
  I'm waiting for him to provide some more details about this.
- Session ID mangling.
- Apache Connector changes - No action has occurred on this,
  I'm dependant on someone else making these changes. I'm hoping
  that Costin will do this when he's done with the 4.02 release work
- Final integration and testing

Note. The 'session' locking feature that I added is probably not necessary
as long as server / session affinity is in place. This should either be
disabled
or made 'optional'.

Lastly, I got to thinking that it should be possible to have a Tomcat only
load balancing / fail-over solution. What's needed is a Tomcat front-end
on which is deployed a new servlet that would do a simple round-robin
load-balancing, but when jsessionid's are present, route them to the
session host only, unless the session host doesn't respond, in which case
it should be re-routed to another available instance.

So, I started writing some code to do this, and then got side-tracked
looking
for work again. Nasty things, bills.

I'm still plugging away, however,

Tom


- Original Message -
From: Michael Remme [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Wednesday, January 09, 2002 12:04 AM
Subject: AW: tom4 session and loadbalancing / Distributed Session Management


| Hi Tom,
|
| anything new about this theme?
|
| Best, Michael
|
|  -Ursprüngliche Nachricht-
|  Von: Tom Drake [mailto:[EMAIL PROTECTED]]
|  Gesendet: Sonntag, 16. Dezember 2001 17:02
|  An: Tomcat Users List
|  Cc: Tomcat Dev List
|  Betreff: Re: tom4 session and loadbalancing / Distributed Session
|  Management
| 
| 
|  Michael:
| 
|  As it happens, I am currently working on a solution to this problem.
|  Look for messages in the archive with 'Distributed Session
|  Management' in the subject.
| 
|  In a nutshell, all tomcat instances in a 'cluster' will be able to share
|  session data.
| 
|  I've already completed a multicast-style RMI registry that allows
|  all instances in the cluster to easily discover each other. I'm
currently
|  working the kinks out of the distributed session/object management
|  bits. When this is done (should be done in a day or two), all that's
|  left is to integrate it into Tomcat.
| 
|  In short, the distributed session management feature is nearing
|  completion.
| 
|  I'm creating pretty comprehensive JUnit tests along with this code, so
my
|  confidence level will be high that this feature really does work when I
|  hand it off.
| 
|  Tom Drake
| 
|  P.S. I'm cross-posting to the dev list because I think that the
developers
|  will
|  probably be interested in this as well.
| 
| 
|  - Original Message -
|  From: Michael Remme [EMAIL PROTECTED]
|  To: Tomcat Users List [EMAIL PROTECTED]
|  Sent: Saturday, December 15, 2001 5:46 PM
|  Subject: tom4 session and loadbalancing
| 
| 
|  | mod_jk is running here now with tomcat 4, but i have the problem, that
|  | running sessions are not recognized. The loadbalancer is sending the
|  | requests to different servers and not, like described, back to the
|  | session-host. Is there anything know, what to do?
|  |
|  | Best, Michael
|  |
|  | Virengepruft vom G DATA AntiVirenKit
|  |
|  |
|  | --
|  | 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]
| 
| 
|
| Virengeprüft vom G DATA AntiVirenKit
|
|
| --
| 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: Error using Tomcat 4.01 and Oraclie 8i 8.1.6 when using manager/reload

2002-01-09 Thread Tom Drake


- Original Message -
From: Craig R. McClanahan [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Wednesday, January 09, 2002 8:47 AM
Subject: Re: Error using Tomcat 4.01 and Oraclie 8i 8.1.6 when using
manager/reload


|
| An easier choice for Oracle users is to use the Type 4 (pure Java)
| instead.  Then, you never have to worry about native code, and the driver
| itself is portable across platforms.

At the cost of reduced performance. The OCI driver is noticeably faster than
the 'thin' driver. Tradeoffs everywhere you go.

Tom

|
|  Thanks for help
| 
|  Frederic
| 
|
| Craig McClanahan
|
|
| --
| 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: help is needed -- question on page redirect

2002-01-09 Thread Tom Drake

Follow the standard servlet spec / api:

request.sendRedirect(http://www.yahoo.com;);

Keep in mind that this will fail if the response has already
been 'committed' (e.g. some data has been sent to the client).
The reason is that a 'redirect' requires that certain HTTP header
values be returned to the caller. If the headers have already been
sent, then the protocol prevents you from redirecting.

Good Luck

Tom Drake

- Original Message - 
From: Xin Li [EMAIL PROTECTED]
To: 'Tomcat Users List' [EMAIL PROTECTED]
Sent: Wednesday, January 09, 2002 1:25 PM
Subject: help is needed -- question on page redirect


| I have a question on Page Redirect in Tomcat4.
| 
| In enhydra the page redirecting is accomplished by using throw new
| ClientPageRedirectException (NextPage); May I know what's the equivalent
| method of redirecting in tomcat?
| 
| Thanks
| 
| 
| --
| 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: Tomcat Performance

2002-01-09 Thread Tom Drake

RMI is used to store the sessions in 'other' tomcat instances in the
cluster.
They auto-discover each other using UDP multicasting (via a
UDP-multicast based RMI registry)

Tom
- Original Message -
From: Frank Morton [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Wednesday, January 09, 2002 5:40 PM
Subject: Re: Tomcat Performance


|  Tom Drake and myself are working on a real cluster solution for tomcat,
| but
|  we haven't released code so far, it will rather take some months before
it
|  could be recommended to use it.
|
| That is cool. What will be used to store the session data?
|
|
|
| --
| 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: Problem with file URL

2002-01-07 Thread Tom Drake

Jim:

Your file url is not valid for any filesystem of which i'm aware,
unless you happen to have a directory under root called
intranet.xxx.com:8080. file:// url's should be followed by a
filesystem pathname to an actual file.

Regards,

Tom Drake
- Original Message -
From: Jim Dempsey [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, January 06, 2002 6:51 PM
Subject: Problem with file URL


| How come I can access this URL:
| http://intranet.xxx.com:8080/reportsArchive/par/ProductDD.xls
|
| But cannot access this URL:
| file://intranet.xxx.com:8080/reportsArchive/par/ProductDD.xls
|
| I get an error message that it cannot find the file.  The error message
says
| make sure the path and filename are correct.
| I am using Tomcat 4.0.1  Is there some configuration setup that I am
| missing?
|
| Thanks
|
|
|
| --
| 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: Problem with file URL

2002-01-07 Thread Tom Drake

There appears to be confusion about the 'file://' protocol.

The file:// protocol is really not a protocol at all, since there 
are no client-server communications involved. 
This 'false' protocol identifier is simply a 'nice' little feature
that web-browsers implement (URL/URLConnection also
implements this), that provides the means of displaying a
file stored on the client system (or on a drive that is
mounted on the client system).

The key here is 'client-system'. When you type a file://
URL into your browser, your browser goes straight to
your filesystem to get the file. It does not contact a web-server
for this. 

If you want to retrieve a 'file' from a web server, you must 
provide a URL that starts with 'http://' (or https://).

Hope this is helpful.

Tom Drake.

- Original Message - 
From: Michael Wentzel [EMAIL PROTECTED]
To: 'Tomcat Users List' [EMAIL PROTECTED]
Sent: Monday, January 07, 2002 9:44 AM
Subject: RE: Problem with file URL


| BTW, is there a reason this is that important to you?  How many users 
| try to access a url using the file protocol instead of http?
| 
| ---
| Michael Wentzel
| Software Developer
| Software As We Think - http://www.aswethink.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]




Re: Problem with file URL

2002-01-07 Thread Tom Drake

Pae:

The term protocol implies that there is a there is a network based
exchange of information.

In the case of  'file://' URLs, your client software ends up making
system calls (e.g. open(), read(), close()), no exchange of
information across a network.

Ah, but what about files on your network drives? you may ask.
Same thing goes here. Your client software simply makes open,
read, and close system calls. However, your O/S, under the covers,
turns these into network exchanges (e.g. NETBIOS, NFS, SMB, Netware, ...)
However, your client has no knowledge that these files are hosted
elsewhere. As far as it can tell these 'remote' filesystems are hosted
locally. Your client is blissfully unaware of any network activity,
and of the actual protocol used to retrieve the file. The protocol
used, in this case is determined by the O/S.

Furthermore, consider that:

The http protocol is defined by RFC 2616.
The ftp protocol (ftp://) is defined by RFC 0959 / STD009

Can anyone tell me where the file:// protocol is defined?

The 'file://' protocol specifier, doesn't actually relate to a known
protocol.
It is merely a shorthand way of treating local files as URL's.

Hope this is helpful.

Regards,

Tom Drake



- Original Message -
From: Pae Choi [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]; Tom Drake
[EMAIL PROTECTED]
Sent: Monday, January 07, 2002 11:18 AM
Subject: Re: Problem with file URL


| Hmm.. the communication between the browser(client) and
| the file system(server) is not considered in the client-server
| communication? An interesting comment.
|
|
| Pae
|
|
|
|  There appears to be confusion about the 'file://' protocol.
| 
|  The file:// protocol is really not a protocol at all, since there
|  are no client-server communications involved.
|  This 'false' protocol identifier is simply a 'nice' little feature
|  that web-browsers implement (URL/URLConnection also
|  implements this), that provides the means of displaying a
|  file stored on the client system (or on a drive that is
|  mounted on the client system).
| 
|  The key here is 'client-system'. When you type a file://
|  URL into your browser, your browser goes straight to
|  your filesystem to get the file. It does not contact a web-server
|  for this.
| 
|  If you want to retrieve a 'file' from a web server, you must
|  provide a URL that starts with 'http://' (or https://).
| 
|  Hope this is helpful.
| 
|  Tom Drake.
| 
|  - Original Message -
|  From: Michael Wentzel [EMAIL PROTECTED]
|  To: 'Tomcat Users List' [EMAIL PROTECTED]
|  Sent: Monday, January 07, 2002 9:44 AM
|  Subject: RE: Problem with file URL
| 
| 
|  | BTW, is there a reason this is that important to you?  How many users
|  | try to access a url using the file protocol instead of http?
|  |
|  | ---
|  | Michael Wentzel
|  | Software Developer
|  | Software As We Think - http://www.aswethink.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]
|
|
|


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




Re: dynamic content not mapping correctly

2002-01-07 Thread Tom Drake

Try href=MyServlet/style.css (drop the leading slash)

- Original Message - 
From: Etienne Deleflie [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Monday, January 07, 2002 4:08 PM
Subject: dynamic content not mapping correctly


| Hello list,
| 
| I just want to describe my problem better..I have an XML 
| application.
| 
| Via a web-app (in Tomcat 4.0.1) a URL is mapped to a servlet
| The servlet reads an XML file which defines the retrieval of other XML 
| data and what XSL files to render that retrieved XML data with.
| 
| The XML and XSL is rendered together using JAXP 1.1 before the servlet 
| outputs the result back to the browser.
| 
|  all this works.
| 
| 
| BUT, the HTML stylesheets ( that are in written in the XSL files), and 
| images, have absolute links . that is, absolute to the web-app. 
| eg. the XSL file contains this line:
| 
| link rel=stylesheet href=/MyServlet/style.css type=text/css/


| 
| When the page eventually hits the browser, the HTTP request that this 
| causes is
| 
| http://localhost:8080/MyServlet/style.css , instead of
| http://localhost:8080/myWeb-appName/MyServlet/style.css
| 
|  the page that contains this stylesheet link is 
| http://localhost:8080/myWeb-appName/MyServlet/index.html
| 
| shouldn't Tomcat always prepend the name of the web-app to any request 
| that comes FROM a page in the web-app ?
| (or am I doing something wrong?)
| 
| etienne
| 
| 
| 
| --
| 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: dynamic content not mapping correctly

2002-01-07 Thread Tom Drake

The standard, and by extension, Tomcat, is designed such that there are
no dependancies between contexts. Attempting to create such dependancies
is really just asking for headaches.

I think your best bet is to setup your deployment process to make a copy of
this file to each context that you create. That way, there's only one copy
to keep track of in your source management system, each context simply
refers to it's own copy, no dependancies between contexts. This comes
at the cost of bloating your deployment process, and increasing (minimally)
your disk space requirements.

Perhaps this is not the most ideal solution. It is the one that will be
guaranteed
to work with all servlet containers, however.

Good luck,

Tom Drake.

- Original Message -
From: Etienne Deleflie [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Monday, January 07, 2002 4:27 PM
Subject: Re: dynamic content not mapping correctly


| 
| 
| Try href=MyServlet/style.css (drop the leading slash)
| 
| no can do . that misses the point.
|
| the XSL file that contains that link is used to write files in all sorts
| of sub-directories
|
| ... so it has to be relative to the web-app root
|
| etienne
|
| 
| 
| - Original Message -
| From: Etienne Deleflie [EMAIL PROTECTED]
| To: Tomcat Users List [EMAIL PROTECTED]
| Sent: Monday, January 07, 2002 4:08 PM
| Subject: dynamic content not mapping correctly
| 
| 
| | Hello list,
| |
| | I just want to describe my problem better..I have an XML
| | application.
| |
| | Via a web-app (in Tomcat 4.0.1) a URL is mapped to a servlet
| | The servlet reads an XML file which defines the retrieval of other XML
| | data and what XSL files to render that retrieved XML data with.
| |
| | The XML and XSL is rendered together using JAXP 1.1 before the servlet
| | outputs the result back to the browser.
| |
| |  all this works.
| |
| |
| | BUT, the HTML stylesheets ( that are in written in the XSL files), and
| | images, have absolute links . that is, absolute to the web-app.
| | eg. the XSL file contains this line:
| |
| | link rel=stylesheet href=/MyServlet/style.css type=text/css/
| 
| 
| |
| | When the page eventually hits the browser, the HTTP request that this
| | causes is
| |
| | http://localhost:8080/MyServlet/style.css , instead of
| | http://localhost:8080/myWeb-appName/MyServlet/style.css
| |
| |  the page that contains this stylesheet link is
| | http://localhost:8080/myWeb-appName/MyServlet/index.html
| |
| | shouldn't Tomcat always prepend the name of the web-app to any request
| | that comes FROM a page in the web-app ?
| | (or am I doing something wrong?)
| |
| | etienne
| |
| |
| |
| | --
| | 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]




Re: Programmatic login with Tomcat 4.0.1

2002-01-04 Thread Tom Drake

Sergei:

Do you need to programmatically log in as a 'client' (e.g.
from a different JVM)?

If so, you will need to open an HttpUrlConnection with a url
that points to an appropriate page on your tomcat server.

Apache SOAP provides a nicelittle Http Tunneling tool that will
help you discover the details of what you need to send to Tomcat
(over an HTTP connection). Download Apache SOAP from
xml.apache.org. You don't need to 'install' it. The following
link explains how to use this tool:
   http://xml.apache.org/soap/docs/index.html

Start the tunnel gui, point your brower at it, and 'login' to your
web site. The tunnel gui will display all request and response
data. All that's left is to write code that sends the same
data that your browser did, and that knows how to deal with
the responses coming from tomcat.

Regards,

Tom Drake


- Original Message -
From: Sergei Batiuk [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Friday, January 04, 2002 5:48 AM
Subject: RE: Programmatic login with Tomcat 4.0.1


| Well, but what about programmatic login, i. e. something like
|
|   Context ctx = new InitialContext();
|   UserManager um = ( UserManager )ctx.lookup( java:comp/UserManager );
|   um.login( login, password );
|
| Does Tomcat have an API similar to this? The thing is I have a login form
on
| my first page, where a user should login to access protected functions
(they
| are not displayed by default, and become available only after a user has
| logged in).
|
| -Original Message-
| From: Ing. Gabriel Gajdos [mailto:[EMAIL PROTECTED]]
| Sent: Friday, January 04, 2002 3:24 PM
| To: [EMAIL PROTECTED]
| Subject: RE: Programmatic login with Tomcat 4.0.1
|
|
| If you use BASIC authentication, user/password are contained in the
| Authorization HTTP 1.1 Header (in Base64 encoded form).
| Never tried, but should work when supplying correct data into your HTTP
| request (including headers).
|
| | How do I programmatically login into TC 4.0.1?
| |
| | Sincirely,
| | Sergei Batiuk.
|
|
| --
| 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: Tomcat, the JRE, and a CD-ROM

2002-01-03 Thread Tom Drake

Paul:

Tomcat only needs tools.jar (from jdk) for compiling JSP's. If you
pre-compile
your JSP's (using JSPC), you can deploy them as servlets (with servlet
mappings
in web.xml). Your run-time will then be able to run everything with only
the JRE.

Tom Drake


- Original Message -
From: Paul Gross [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, January 03, 2002 4:28 PM
Subject: Tomcat, the JRE, and a CD-ROM


| Here is a strange question for anyone who thinks that they can help
| me...
|
| I am trying to send a runnable version of my web application on a CD,
| so that it can run entirely from the CD, without installing anything on
| the user's machine.
|
| I plan to do this by having a copy of the JRE plus my web app (JSP
| files, Servlet claass files etc) on the CD, and pointing both JAVA_HOME
| and TOMCAT_HOME to the appropriate direcories on the CD.
|
| I have tried an experiment on my hard disk by setting JAVA_HOME to my
| JRE version 1.3.1, and my Tomcat 3.2.1 seems OK with this.
|
| When Tomcat starts, my pages still work - it does not seem to need the
| Java compiler, and so it seems reasonable that a CD would work as well.
|
| What I don't want top do is to burn a set of CDs, mail them out, and
| then find that there is some other limitation built-in to Tomcat that
| requires the use of the JDK instead of the JRE.
|
| Has anybody had any experience with this, or can anybody think of any
| likely pitfalls?
|
| Also, would it be possible to leave out the JSP files from the CD, and
| just use the compiled servlet code?
|
| Thanks in anticipation,
|
| Paul
|
|
| 
| Powered by telstra.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]




Re: Tomcat, threads and garbagecleaner: A question

2002-01-02 Thread Tom Drake

Duarte:

Your inactive threads, or any other unreferenced objects will be,
eventually, garbage collected.

Are you sure that your thread actually completes (e.g. falls out the
end of 'run()') ?

Are you certain that you have no hidden references to your objects -
perhaps stored in your session?

Are your objects hanging on to constrained resources too long?
(eg. database connections, input streams, ...)

If every page hit launches a new thread, you are building in a platform
specific limit to the number of concurrent requests your server can handle.
Perhaps you should 'pool' these threads, or simply 'schedule' the code your
thread to be run by some sort of thread scheduler.

Here's a couple of things that you can do to narrow down  the problem:

- add some simple logging in the finalize method of each 'suspect' class.
  This will tell you when your objects are garbage collected.

- add logging to the end of your 'run' methods. This will show you when your
  threads actually 'stop'.

- Write a servlet that lists all ThreadGroups and Threads starting at the
'top'
ThreadGroup (null parent). This will show you what threads are active at the
time your servlet is run.

- 'Debug' your webapp, setting break points in appropriate places.

Good luck

Tom Drake

- Original Message -
From: Duarte Loreto [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, January 01, 2002 5:45 PM
Subject: Tomcat, threads and garbagecleaner: A question


|Hello!
|
| I have a JSP page that instantiates an object. This instantiates another
| one, as a thread. The thread is created and started on the same inline,
and
| I have no pointer to the thread.
|
| My question is: when this thread finishes it's run(), does it get
| garbagecleaned? The object that referenced it was created by a JSP page
that
| was already delivered to the client, so it should be, right?
|
| I'm asking this as I have a server that, after some usage, starts to get
| slow and then completly freezes, needing a restart. I suspect that there
is
| a memory leak somewhere, and this seems the most probable place.
|
| If your answer is the thread gets garbagecleaned, so look elsewhere for
| your problem, I would appreciate help on how to analyse memory usage. I'm
| clueless on this.
|
| I'm using tomcat 3.2.3 and I run it on UNIX, with JDK1.3. If needed be, I
| can put it to run on a Windows, if you tell me that THE tool to check for
| the problem is windows-based
|
| I appreciate your help. If you think that this question shouldn't be
posted
| here but rather on the devel list, please notify me.
|
| Duarte HappyGuy Loreto
|
| Don't worry, be happy!
|
|
| _
| Send and receive Hotmail on your mobile device: http://mobile.msn.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]




Re: problem with multiple application on Tomcat

2002-01-02 Thread Tom Drake

Puneet:

All you need to do is to package each set of classes (and other resources)
as a seperate web application. The tomcat docs provide plenty of information
about how to do this.

The 'simplest' way to create a web-application is to construct a directory
structure (under the jakarta-tomcat-4.0/webapps directory) that contains
all of your context's files (html, jsp, gif, jpg, etc...). Either place your
classes
in context/WEB-INF/classes or place your 'jar' file in context/WEB-INF/lib.

You can then jar up the whole mess into a WAR file. Read the tomcat docs
about deploying web-applications in the form of WAR files.

No other configuration should be required unless your application has the
need for it.

Tomcat 4 allows you to add new web-applications at any time. It also lets
you re-deploy (update) existing web-applications.

I think you'll find all the details you need in the tomcat documentation.

Good Luck.

Tom Drake

- Original Message -
From: puneet sachar [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]; Tom Drake
[EMAIL PROTECTED]
Sent: Tuesday, January 01, 2002 11:53 AM
Subject: problem with multiple application on Tomcat


| i got your answers
|
| but sir tell me onr simple thing
| u have one server running ok
|
| and 3 classes A.java placed some where and thoes files
| correspond to different clients
|
| is it possible at runtime i change the classpath
| acording to my liking with suit the particular client
|
| is it possible
|
| i'm also sending u a word attachment where i had 3
| sloutions for them
| now go through them all and mail me and tell me whatz
| exactly be done to get solutions
|
| regards
| Puneet
|
| __
| Do You Yahoo!?
| Send your FREE holiday greetings online!
| http://greetings.yahoo.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]




Re: How to rebuild Catalina ?

2001-12-21 Thread Tom Drake

You are missing jmx.

Read BUILDING.txt. It tells you what you need and where
to get it. You may have to grab some of the 'optional' libraries
as well.

Tom Drake

- Original Message -
From: Diego Novati [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Friday, December 21, 2001 9:51 AM
Subject: How to rebuild Catalina ?


| Hi,
| building Catalina I get the following error:
|
| NamingService.java: Error #: 302 : cannot access class
| javax.management.NotificationBroadcasterSupport; neither class nor source
| found for javax.management.NotificationBroadcasterSupport at line 67,
column
| 25
|
| What Jakarta component do I have to download ?
|
| Thanks
|
| Diego
|
|
| --
| 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: Configuring Multiple Tomcat JVMs with Apache - Load Balancing

2001-12-18 Thread Tom Drake

Hemant:

I'm working with tc 4, which is 'different', however, this link
may contain the information that you're looking for.

http://java.apache.org/jserv/howto.load-balancing.html

Tom.

P.S. Let me know how things work out, and what you had to do
to get it working.

- Original Message -
From: Hemant Singh [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]; Tom Drake
[EMAIL PROTECTED]
Sent: Monday, December 17, 2001 7:55 PM
Subject: Re: Configuring Multiple Tomcat JVMs with Apache - Load Balancing


| Hi Tom
|
| in my application i want two servers(tomcat 3.2.3) residing on two
different
| machines to cater to requests coming another different machinewhich keeps
| forwarding the requests to either of the servers.Pls guide how can i
achieve
| the same.I have added two workers in in my workers.properties on the
| dispatcher machine , but it keeps sending the request to only the first
| machine.
|
| --Hemant
|
| - Original Message -
| From: Tom Drake [EMAIL PROTECTED]
| To: Tomcat Users List [EMAIL PROTECTED]
| Sent: Monday, December 17, 2001 9:17 PM
| Subject: Re: Configuring Multiple Tomcat JVMs with Apache - Load Balancing
|
|
|  When my work is done, Session Affinity will not be required in order to
|  acheive load balancing. However, we should still want to use session
|  affinity in our load balancing solution(s) for the simple reason that
|  it will perform better.
| 
|  However, the session affinity between Apache and Tomcat 3 locks
|  a user (based on her JSESSIONID) to a single Tomcat instance. Once
|  the distributed session management solution is in place, Apache should
|  'prefer' NOT 'force' tomcat instance routing. This gives us a real
| fail-over
|  story. Administrators will be able to bring down Tomcat instances
without
|  blowing away 'logged in' users.
| 
|  Tom
| 
|  - Original Message -
|  From: GOMEZ Henri [EMAIL PROTECTED]
|  To: Tomcat Developers List [EMAIL PROTECTED]
|  Cc: Tomcat Users List (E-Mail) [EMAIL PROTECTED]
|  Sent: Monday, December 17, 2001 12:54 AM
|  Subject: RE: Configuring Multiple Tomcat JVMs with Apache - Load
Balancing
| 
| 
|  | there hasn't been done anything on that topic yet ?  What's
|  | the status of
|  | loadbalacing, either mod_jk or mod_webapp ?
|  | Is that political due to if loadbalacing is working properly
|  | there won't be
|  | any reason to take (buy) anything else than TC ?
|  |
|  | State of the art is that today only mod_jk could
|  | handle load-balancing and only when connected
|  | to Tomcat 3.2.x or 3.3.
|  |
|  | Tomcat 4.0.x support ajp13 protocol, used in mod_jk
|  | but still miss a subtil feature (jvmroute) to be
|  | able to keep the route to the good JVM in
|  | session mode (SessionAfinity).
|  |
|  | But the current refactory of ajp protocol,
|  | under ajp14 in jakarta-tomcat-connectors, will
|  | fix somedays thanks to Costin and Kevin works :)))
|  |
|  | --
|  | 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]




Re: What's the word on a Servlet/JSP including itself in recursion?

2001-12-18 Thread Tom Drake

This will never work!

The include statement will get a new connection to the database and execute
an entirely new
query, while the first query / result set is active. You will quickly run
out of connections.

Secondly, at the risk of parroting earlier responses, I would heartily
suggest that you move this
logic to a bean and/or a custom taglib. Your life will quickly become a
living hell if you try to
place too much java code in your JSP's. JSP's are great at formatting
output, they are a
terrible place for anything but the most straightforward Java code.

I think that you'd be better off thinking about how to build up the nested
data structure
you need, then feed this nested data structure to your JSP, which simply
needs to format
it as HTML.

Tom Drake

- Original Message -
From: Nikola Milutinovic [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Monday, December 17, 2001 11:08 PM
Subject: Re: What's the word on a Servlet/JSP including itself in recursion?


|  How are you passing the resultSet back and forth between the JSP's?
|
| I'm not. This is the scatch of the code:
|
| JSP: OUDisplay.jsp
| 
| DriverManager.getConnection()
| Connection.createStatement()
| Statement.executeQuery()
| while( ResultSet.next() ) {
|   ...
|   if( recurse ) {
| jsp:include page=%= \OUDisplay.jsp?partial=trueid=\ + id % /
|   }
|   ...
| }
| ResultSet.close()
| Statement.close()
| Connection.close()
| ---
|
| Now, I have tried putting a breakpoint in my JSP (throw
ServletException). Wherever I put it, the JSP page runs into it, but the
NullPointerException doesn't occur. I've tried putting it on the last line
of JSP, still no NullPointer.
|
| This lead me to believe that the error is occuring AFTER my JSP emerges
from a recursion. So, it goes into the loop, calls itself once (there was
only one level of sub-tree in that test example), the called JSP finishes
it's job, resturns to upper itslef and then inside that while(
ResultSet.next() ) I get the error. Like the JSP page that was called in
the recursion closed not just it's own JDBC objects, but also it's parents.
|
| Any comment?
|
| Nix.
|


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




Re: Configuring Multiple Tomcat JVMs with Apache - Load Balancing

2001-12-18 Thread Tom Drake

This might be more helpful.

http://jakarta.apache.org/tomcat/tomcat-3.3-doc/mod_jk-howto.html

Tom

- Original Message -
From: Hemant Singh [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]; Tom Drake
[EMAIL PROTECTED]
Sent: Monday, December 17, 2001 7:55 PM
Subject: Re: Configuring Multiple Tomcat JVMs with Apache - Load Balancing


| Hi Tom
|
| in my application i want two servers(tomcat 3.2.3) residing on two
different
| machines to cater to requests coming another different machinewhich keeps
| forwarding the requests to either of the servers.Pls guide how can i
achieve
| the same.I have added two workers in in my workers.properties on the
| dispatcher machine , but it keeps sending the request to only the first
| machine.
|
| --Hemant
|
| - Original Message -
| From: Tom Drake [EMAIL PROTECTED]
| To: Tomcat Users List [EMAIL PROTECTED]
| Sent: Monday, December 17, 2001 9:17 PM
| Subject: Re: Configuring Multiple Tomcat JVMs with Apache - Load Balancing
|
|
|  When my work is done, Session Affinity will not be required in order to
|  acheive load balancing. However, we should still want to use session
|  affinity in our load balancing solution(s) for the simple reason that
|  it will perform better.
| 
|  However, the session affinity between Apache and Tomcat 3 locks
|  a user (based on her JSESSIONID) to a single Tomcat instance. Once
|  the distributed session management solution is in place, Apache should
|  'prefer' NOT 'force' tomcat instance routing. This gives us a real
| fail-over
|  story. Administrators will be able to bring down Tomcat instances
without
|  blowing away 'logged in' users.
| 
|  Tom
| 
|  - Original Message -
|  From: GOMEZ Henri [EMAIL PROTECTED]
|  To: Tomcat Developers List [EMAIL PROTECTED]
|  Cc: Tomcat Users List (E-Mail) [EMAIL PROTECTED]
|  Sent: Monday, December 17, 2001 12:54 AM
|  Subject: RE: Configuring Multiple Tomcat JVMs with Apache - Load
Balancing
| 
| 
|  | there hasn't been done anything on that topic yet ?  What's
|  | the status of
|  | loadbalacing, either mod_jk or mod_webapp ?
|  | Is that political due to if loadbalacing is working properly
|  | there won't be
|  | any reason to take (buy) anything else than TC ?
|  |
|  | State of the art is that today only mod_jk could
|  | handle load-balancing and only when connected
|  | to Tomcat 3.2.x or 3.3.
|  |
|  | Tomcat 4.0.x support ajp13 protocol, used in mod_jk
|  | but still miss a subtil feature (jvmroute) to be
|  | able to keep the route to the good JVM in
|  | session mode (SessionAfinity).
|  |
|  | But the current refactory of ajp protocol,
|  | under ajp14 in jakarta-tomcat-connectors, will
|  | fix somedays thanks to Costin and Kevin works :)))
|  |
|  | --
|  | 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]




Re: Configuring Multiple Tomcat JVMs with Apache - Load Balancing

2001-12-17 Thread Tom Drake

When my work is done, Session Affinity will not be required in order to
acheive load balancing. However, we should still want to use session
affinity in our load balancing solution(s) for the simple reason that
it will perform better.

However, the session affinity between Apache and Tomcat 3 locks
a user (based on her JSESSIONID) to a single Tomcat instance. Once
the distributed session management solution is in place, Apache should
'prefer' NOT 'force' tomcat instance routing. This gives us a real fail-over
story. Administrators will be able to bring down Tomcat instances without
blowing away 'logged in' users.

Tom

- Original Message -
From: GOMEZ Henri [EMAIL PROTECTED]
To: Tomcat Developers List [EMAIL PROTECTED]
Cc: Tomcat Users List (E-Mail) [EMAIL PROTECTED]
Sent: Monday, December 17, 2001 12:54 AM
Subject: RE: Configuring Multiple Tomcat JVMs with Apache - Load Balancing


| there hasn't been done anything on that topic yet ?  What's
| the status of
| loadbalacing, either mod_jk or mod_webapp ?
| Is that political due to if loadbalacing is working properly
| there won't be
| any reason to take (buy) anything else than TC ?
|
| State of the art is that today only mod_jk could
| handle load-balancing and only when connected
| to Tomcat 3.2.x or 3.3.
|
| Tomcat 4.0.x support ajp13 protocol, used in mod_jk
| but still miss a subtil feature (jvmroute) to be
| able to keep the route to the good JVM in
| session mode (SessionAfinity).
|
| But the current refactory of ajp protocol,
| under ajp14 in jakarta-tomcat-connectors, will
| fix somedays thanks to Costin and Kevin works :)))
|
| --
| 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: Ordering of parameters in HTTPRequest Object

2001-12-17 Thread Tom Drake

This may be a dumb question, but do you really care about the
order of the form parameters?

It seems to me that making your servlet / jsp dependant on the
order of the parameters is a huge mistake, even if this order
is guaranteed by all browsers and by Tomcat and all other
servlet containers.

The problem is that your servlet that processes the request will
be tied to the gui layout of the form. If the gui designer decides
to lay the form out in a different way next week, your code
will break.

IMHO, your solution would be far more robust if it relied on the
names of the parameters, and not the order in which they're
received.

Tom Drake


- Original Message - 
From: Christopher K. St. John [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Monday, December 17, 2001 4:33 PM
Subject: Re: Ordering of parameters in HTTPRequest Object


| Craig R. McClanahan wrote:
|  
|  There are no guarantees that a browser will send the
|  request parameters in the order they appear on the form
| 
| 
|  http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.1
| 
|  application/x-www-form-urlencoded  
| 
|This is the default content type. Forms submitted with
|this content type must be encoded as follows:
| 
|1. Control names and values are escaped ...
| 
|2. The control names/values are listed in the order they
|   appear in the document. ...
| 
|  That's just for urlencoded forms, but then again that's
| the only content-type the servlet spec makes any
| promises about.
| 
|  It seems reasonable that a servlet container should
| return the params in order for content-types where 
| the ordering is guaranteed. 
| 
| -- 
| Christopher St. John [EMAIL PROTECTED]
| DistribuTopia http://www.distributopia.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]




Re: tom4 session and loadbalancing / Distributed Session Management

2001-12-16 Thread Tom Drake

Michael:

As it happens, I am currently working on a solution to this problem.
Look for messages in the archive with 'Distributed Session
Management' in the subject.

In a nutshell, all tomcat instances in a 'cluster' will be able to share
session data.

I've already completed a multicast-style RMI registry that allows
all instances in the cluster to easily discover each other. I'm currently
working the kinks out of the distributed session/object management
bits. When this is done (should be done in a day or two), all that's
left is to integrate it into Tomcat.

In short, the distributed session management feature is nearing completion.

I'm creating pretty comprehensive JUnit tests along with this code, so my
confidence level will be high that this feature really does work when I
hand it off.

Tom Drake

P.S. I'm cross-posting to the dev list because I think that the developers
will
probably be interested in this as well.


- Original Message -
From: Michael Remme [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Saturday, December 15, 2001 5:46 PM
Subject: tom4 session and loadbalancing


| mod_jk is running here now with tomcat 4, but i have the problem, that
| running sessions are not recognized. The loadbalancer is sending the
| requests to different servers and not, like described, back to the
| session-host. Is there anything know, what to do?
|
| Best, Michael
|
| Virengepruft vom G DATA AntiVirenKit
|
|
| --
| 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: mutipart/x-mixed-replace and HttpURLConnection

2001-11-29 Thread Tom Drake

Steve:

An HTTP response may only have one content type. If you wish to send
multiple documents of different types to the client in a single HTTP
response. One way to do this is to set the content type to multipart/mixed,
and encode your messages as follows:

Content-type: multipart/mixed; boundary=END-OF-SECTION

--END-OF-SECTION
Content-type: text/html

htmlhead
titleDownloading to Disk/title
/head
body
h1Downloading to Disk/h1
The files foobar.test and foobar2.test are being downloaded to
your system.  Please read the license agreement carefully.

--END-OF-SECTION
Content-type: application/octet-stream
Content-disposition: filename=foobar.test

...The contents of foobar.test goes here...
--END-OF-SECTION
Content-type: application/octet-stream
Content-disposition: filename=foobar2.test

...The contents of foobar2.test goes here...
--END-OF-SECTION--


Your application will will need to deal with break apart the individual mime
documents.
There are some classes that will help you with this in javax.mail.* and
javax.mail.internet.*;
I think you'll find this in the Java mail api (which you can download from
sun).

I hope this helps.

Tom Drake

- Original Message -
From: Ball, Steve [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED];
[EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, November 29, 2001 6:45 AM
Subject: mutipart/x-mixed-replace and HttpURLConnection


| I am working on Server Push from a Servlet to a Java client using
| HttpURLConnection.  I am attempting to set the boundaries and set the
other
| mime types in my servlet, but my client seems to only understand the first
| call using .setContentType();  Is what I am doing even feasible?  Any
tips
| would be much appreciated.
|
| 
| client
| 
| URLConnection con = url.openConnection();
| con.setDoOutput(true);
| con.setDoInput(true);
| con.setUseCaches(false);
| ((HttpURLConnection)con).setRequestMethod(POST);
| ((HttpURLConnection)con).setRequestProperty(Connection,
| Keep-Alive);
| ((HttpURLConnection)con).setRequestProperty(Content-type,
| multipart/x-mixed-replace; boundary=End);
|
| .
| .
| .
| .
|
| String header = con.getContentType();
| System.out.println(Header: + header);
| if (header.equals(text/start))
|{
|  start = con.getContent();
|   System.out.println(Actual Content: + (String)start);
|}
| else if (header.equals(text/file))
|{
|   file = con.getContent();
|System.out.println((String)file);
|}
| else if (header.equals(text/file-progress))
|{
|   fileprogress = con.getContent();
| System.out.println((String)fileprogress);
|}
| else if (header.equals(text/end))
|{
|  end = con.getContent();
|  System.out.println((String)end);
|  keep_reading = false;
|  }
| else
| {
|  System.out.println(Unknown Content Type:  + header);
|  Object obj = con.getContent();
|  if (obj != null)
|   System.out.println(Something is there);
| else
|System.out.println(Nothing is in there);
|
|
| 
| server
| 
|
|
| ServletOutputStream out = res.getOutputStream();
| res.setContentType(multipart/x-mixed-replace; boundary=End);
| out.println();
| out.println(--End);
|
| out.println(Content-Type:  + text/start);
| out.println();
| StringBuffer startCommand = new StringBuffer();
| startCommand.append(Start Data);
|
| //res.setContentType(text/start);
| res.setContentLength(startCommand.toString().getBytes().length + 55);
| out.print(startCommand.toString());
| out.println();
| out.println(--End);
| out.flush();
|
|
|
| Basically, the current behavior of the client is that it is looping around
| and gets from the server only the mime type set using setContentType();
| which in this case is only multipart/x-mixed-replace type.  The content
| types set using the out.println(Content-Type:  + text/start); are
| ignored.  By the way, I am supporting my own mime types and that appears
to
| work okay.  The content type which does seem to appear rather than
| x-mixed-replace is a class called sun.net.www.MeteredStream.  As I said
| earlier, any help would be much appreciated.
|
| Thanks,
| Steve
|
| --
| 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: Create JSP file or a Servlet file for web browser.

2001-11-26 Thread Tom Drake

Please provide some more details. Your description is really
too vague to respond to.

However, If you are attempting to generate a 'complicated'
html document, a JSP or set of JSP (with JSP or HTML
includes) provides ample means for generating highly
complicated HTML. You may want to consider using
CSS as well. This may simplify your html somewhat.

You're right about using 'out.println(...);'. This technique is
extremely clumsy, and difficult to maintain. JSP's give you
the ability to write plain-vanilla HTML, which you can intersperse
with java code that can do the fancy stuff. When you add
taglibs to the mix, then you can do some very powerful things
with some fairly simple HTML / XML.

Regards,

Tom Drake

- Original Message - 
From: renyu teng [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Monday, November 26, 2001 6:09 PM
Subject: Create JSP file or a Servlet file for web browser.


| 
| As a new guy to use tomcat, I have the following
| question:
| 
| if I want to dump the response to a web browser, then
| I need to format this into html or xml. However, it is
| really complicate html file, I should have tools to do
| it, right? I feel it is too clumsy to write all the
| html text through out.println. How the complicated web
| pages are created in the really project? could anyone
| please shed some light to it? I have gone throught
| some jsp  servlet books, and the projects inside the
| books are really too simple. 
| 
| how could a complicated web pages are created through
| println statement? And if so, how could you control
| the layout? I feel it is impossible, but I may be
| wrong.
| 
| thanks.
| teng
| 
| __
| Do You Yahoo!?
| Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
| http://geocities.yahoo.com/ps/info1
| 
| --
| 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: Precompile JSP

2001-11-15 Thread Tom Drake

Try bin/jspc.bat or jspc.sh


- Original Message -
From: KL OOI [EMAIL PROTECTED]
To: TOMCAT-USER [EMAIL PROTECTED]
Sent: Wednesday, November 14, 2001 11:25 PM
Subject: Precompile JSP


Hi all,

Do anyone here know how to compile all the JSP pages before I roll out for
production??

Thanks..

Regards,
KL OOI



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




Re: Apache-Soap and Tomcat 3.3

2001-11-15 Thread Tom Drake

Dave:

I don't know anything about Toplink, so I can't really help you there.

I do know, from my own experience with Apache Soap, that you call
classes in jar files stored in your webapps WEB-INF/lib directory.

What sorts of error messages are you getting when attempting this?


- Original Message -
From: David Brunkow [EMAIL PROTECTED]
To: 'Tomcat Users List' [EMAIL PROTECTED]
Sent: Thursday, November 15, 2001 9:21 AM
Subject: RE: Apache-Soap and Tomcat 3.3


| Thanks for the response.
|
| I only want my web application to respond to SOAP requests.  The soap
files
| are in my web app.  The problem is, they still have to be in the Server
| classpath.  My Toplink classes won't work if they are in the Server
| classpath, so says experience and the Toplink vendor.  That means, I can't
| use soap and toplink together. Why in the world the Soap people have
allowed
| this restriction is beyond me.  The Tomcat path is only for the running of
| the server, why you need to add classes to it, to run my application is
just
| plain wrong.
|
| Dave
|
|
|
| -Original Message-
| From: Tom Drake [mailto:[EMAIL PROTECTED]]
| Sent: Tuesday, November 13, 2001 4:25 PM
| To: Tomcat Users List
| Subject: Re: Apache-Soap and Tomcat 3.3
|
|
| David:
|
| Another solution is to simply deploy the apache web-application into the
| same context as your own. This means that you have to merge web.xml
| files, but it's otherwise pretty straightforward.
|
| This means that only your web-application will be able to respond to
| SOAP requests, however.
|
| I've implemented Apache SOAP both ways.
|
| - Original Message -
| From: David Brunkow [EMAIL PROTECTED]
| To: 'Tomcat Users List' [EMAIL PROTECTED]
| Sent: Tuesday, November 13, 2001 3:35 PM
| Subject: Apache-Soap and Tomcat 3.3
|
|
| |
| |
| | Does anyone have Apache-Soap working with Tomcat 3.3? Unless you jar
your
| | app and put it in %TOMCAT_HOME%\lib\common\ I don't think it should
work.
| | I'm having all kinds or problems with classes could not be found on just
| the
| | samples.
| |
| | Thanks,
| |
| | Dave
|
|
| --
| 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: Precompile JSP

2001-11-15 Thread Tom Drake

Tom:

I'm not aware of any such option. I have always just lived with this
recompiled all JSP's. You could create an Ant Task for this.
It could be a very nice addition Ant's optional taskdefs.

Tom Drake

- Original Message -
From: Tom Parker [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]; Tom Drake
[EMAIL PROTECTED]
Sent: Thursday, November 15, 2001 11:54 AM
Subject: RE: Precompile JSP


|  Try bin/jspc.bat or jspc.sh
|
| I would like to compile my jsp's as a test before I deploy it and see if
it
| works. I spend quite a lot of time changing stuff, deploying, loading in a
| web browser and seeing jsp compiliation problems.
|
| It would be nice to have jspc compile my jsp's during the deployment
| process. I tried this and it seems to recompile everything, rather than
only
| those files that have changed.
|
| Is there a depends option to jspc?
|
| The obvious solution is to use ant to only compile those files that have
| changed, but there doesn't seem to be an equivelent of make's .c.o option
in
| ant. Is there a dependset creator anywhere, if there isn't a generic .c.o
| type task?
|
|
| --
| 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: Precompile JSP

2001-11-15 Thread Tom Drake

Not true. You can deploy your pre-compiled jsp's in the
form of java classes. There is no need to deploy jsp source
code. You'll need to make corresponding mapping
entries in your web.xml, however.

- Original Message -
From: pero [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Thursday, November 15, 2001 12:07 PM
Subject: RE: Precompile JSP


| Note: Jspc doesn't compile your jsps as the webserver would do. That means
| that when you call jspc and start the server afterwards then the webserver
| will compile the jsps itselft again (at least this is my experience). I
| think the main purpose of jspc is to get rid of your jsp-files since it
| simply converts them to servlet (and generates the correct servlet-config
| for your web.xml). Another solution to simply compile a jsp is to call it
| (from a browser) with the jsp_precompile=true parameter (example:
| http://localhost:8080/my.jsp?jsp_precompile=true) Then the jsp will be
| compiled but NOT executed.
| I simply wrote a servlet that goes through the whole web-app and calls all
| jsps this way.
| The Java-Code to call one jsp would be:
|
| URL url = new URL (http://localhost:8080/my.jsp?jsp_precompile=true;);
| URLConnection con = url.openConnection();
| con.getInputStream();
|
| Hope this helps (or at least adds another point of view to the discussion)
|
| pero
|
|  -Original Message-
|  From: Tom Parker [mailto:[EMAIL PROTECTED]]
|  Sent: Thursday, November 15, 2001 8:54 PM
|  To: Tomcat Users List; Tom Drake
|  Subject: RE: Precompile JSP
| 
| 
|   Try bin/jspc.bat or jspc.sh
| 
|  I would like to compile my jsp's as a test before I deploy it and
|  see if it
|  works. I spend quite a lot of time changing stuff, deploying, loading in
a
|  web browser and seeing jsp compiliation problems.
| 
|  It would be nice to have jspc compile my jsp's during the deployment
|  process. I tried this and it seems to recompile everything,
|  rather than only
|  those files that have changed.
| 
|  Is there a depends option to jspc?
| 
|  The obvious solution is to use ant to only compile those files that have
|  changed, but there doesn't seem to be an equivelent of make's
|  .c.o option in
|  ant. Is there a dependset creator anywhere, if there isn't a generic
.c.o
|  type task?
| 
| 
|  --
|  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: resp.sendRedirect(./Join2?Email_Address= + EmailAddress);

2001-11-14 Thread Tom Drake

You're @ is likely the problem. You must url-encoude the redirect address.

- Original Message -
From: Carl Boudreau [EMAIL PROTECTED]
To: 'Tomcat Users List' [EMAIL PROTECTED]
Sent: Wednesday, November 14, 2001 7:32 AM
Subject: resp.sendRedirect(./Join2?Email_Address= + EmailAddress);


| Good Morning Fellow Coders,
|
| I have a very interesting question for all of you.  Below is a small
| snippet of code which basically validates a database Insert operation.
The
| operation writes to the database then turns around and read the email
| address and compares it to what was passed to the Servlets.  For example
| within the 20 params sent, [EMAIL PROTECTED] would be sent as an
email
| address.  It would then be written and then it would re-query the database
| and compare the results.  This snippet makes the comparison between what
was
| passed and what was read out of the database, in turn uses the Redirect to
| either move on to the next Servlets Join2 if successful, or display
| joinerror.html if un-successful.  But an exception is caught and ends the
| Servlets.  During debug I have reduce the error to the redirect line
| [resp.sendRedirect(./Join2?Email_Address= + EmailAddress);].
|
| Now I have been monitoring the email forum and had seen there was a
problem
| with the redirect.  And in the mean time I had manually started these
| Servlets by using IE and entering the
| [./Join2?[EMAIL PROTECTED])]  and it works fine.  I
| think, I found out, that if I manually do this first, then run it normally
| by hitting it from a index.html page it works.  But my results have been
| very erratic and I don't trust myself.
|
| I have tried to use out.flush( ); alone and then followed up by a
| out.close( ); by this doesn't seem to change anything.
|
| DOES ANYONE HAVE ANY SUGGESTIONS, OR A WORK AROUND?
|
| Source Code Snippet;
|
| if(TxtCheck1.equals(MemberMail))
|{
| // User join1 data has been added to Database
|resp.sendRedirect(./Join2?Email_Address= +
| EmailAddress);
| }
| else {
|
| resp.sendRedirect(./htmlpage/joinerror.html);
|}
|
|
| System Config;
|
| Win2000pro.
| Tomcat 4.0 standalone.
| MySQL 7.0
|
|
| --
| 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: cannot execute binary file

2001-11-14 Thread Tom Drake

I think that this may have to do with the security policy not allowing you
to load classes or jars from 'other' directories.

Look in conf/catalina.policy or conf/tomcat.policy (depending on the version
of tomcat you are using).
You will probably need to add an entry that looks like this:

grant codeBase file:/usr/local/- {
permission java.security.AllPermission;
};

Or for greater security:

grant codeBase file:/usr/local/classes12.jar {
permission java.security.AllPermission;
};

- Original Message -
From: James Chuang [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Wednesday, November 14, 2001 8:52 AM
Subject: Re: cannot execute binary file


| You can set TOMCAT_OPTS in your environment, and tomcat will use them as
| part of it's startup env. When I added the classes12.zip to my TC
| environment, I just added it directly to the tomcat.sh as well, and it
works
| fine.
|
| Why don't you put together a small test program that loads the driver, and
| just run it in Java and see if it works?  If it works, then you know it's
| not the driver.
|
| jchuang
|
| - Original Message -
| From: Noble Long [EMAIL PROTECTED]
| To: Tomcat Users List [EMAIL PROTECTED]
| Sent: Wednesday, November 14, 2001 7:58 AM
| Subject: Re: cannot execute binary file
|
|
|  I actually added it to the tomcat.sh (dirty I know) but I wanted to make
|  sure it was definitely loaded. But even when I add it to /etc/profile or
|  /root/.bashrc, /root/.cshrc I get the same messages, the files must have
|  been getting corrupted in transfer.
| 
|  Where is TOMCAT_OPTS?
| 
|  Noble
|  - Original Message -
|  From: James Chuang [EMAIL PROTECTED]
|  To: Tomcat Users List [EMAIL PROTECTED]
|  Sent: Tuesday, November 13, 2001 7:58 PM
|  Subject: Re: cannot execute binary file
| 
| 
|   Oracle JDBC thin drivers are supposed to be used as .zip.  I've never
| had
|  to
|   uncompress them, neither on NT, Solaris, or Linux.
|  
|   The question is, why is tomcat trying to execute that file?  It sounds
|  like
|   there is something wrong with the startup command.  How did you add it
| to
|   your classpath?  in TOMCAT_OPTS?
|  
|   jchuang
|  
|   - Original Message -
|   From: Eric Strain [EMAIL PROTECTED]
|   To: [EMAIL PROTECTED]
|   Sent: Tuesday, November 13, 2001 5:36 PM
|   Subject: Re: cannot execute binary file
|  
|  
|Hi:
|I hate to be simplistic, but, is your classes12.zip file still
|  compressed?
|If so just unzip it to a safe location and alter your classpath
|   
|   
|From: Noble Long [EMAIL PROTECTED]
|Reply-To: Tomcat Users List [EMAIL PROTECTED]
|To: [EMAIL PROTECTED]
|Subject: cannot execute binary file
|Date: Tue, 13 Nov 2001 14:41:47 -0600
|
|I am using the Oracle jdbc thin client in my application. I added
it
| to
|   my
|classpath /usr/local/classes12.zip , but when I start Tomcat I am
|   getting -
|
|bin/tomcat.sh: /usr/local/classes12.zip: cannot execute binary file
|
|I tried other jar, files, etc. and everyone I transefered either in
|   binary
|mode or ascii via FTP, XMODEM or ZMODEM gives me the same message.
|
|Is my file being corrupted between windows and linux. I am working
| with
|  a
|remote telnet session so I can't exactly download from Oracle's
| website
|   to
|that machine. Funny thing is ... I have the same Red Hat 6.2
|  environment
|here except I'm using tomcat 3.2.3 instead of 3.2.1 (would it make
a
|difference?)
|
|Noble
|   
|   
|_
|Get your FREE download of MSN Explorer at
|  http://explorer.msn.com/intl.asp
|   
|   
|--
|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]
|
|
|


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




Re: STARTUP.SH DOESN'T WORKS FINE

2001-11-14 Thread Tom Drake

This has nothing to do with tomcat. It is standard unix behavior. 
When a user logs out, all processes created by that user are killed.

Unix provides simple way to around this feature.
Simply type the following command:

nohup tomcat.sh run 

In this case all 'console output produced by tomcat will 
appear in a file called 'nohup.out'.

The name nohup comes from the days of flaky dialup connections 
and is short for 'no hang-up'. It is used to 
prevent a spurious loss of connection (or hang-up) from stopping
a process.

- Original Message - 
From: Nancy Crisostomo Martinez [EMAIL PROTECTED]
To: Tomcat_Users [EMAIL PROTECTED]
Sent: Monday, October 22, 2001 7:54 AM
Subject: STARTUP.SH DOESN'T WORKS FINE


| Hello everybody!
| I hope you could help me, please..
| 
| Actually, I'm begining to use Tomcat, and I have a succeded start
| because it still works PERFECT to me...
| But muy problem is very strange :
| I installed Tomcat to Solaris 8, and when I start it (startup.sh |
| tomcat.sh start ) it starts, but when I close the terminal window Tomcat
| shuts down!!! and now I'm using Tomcat with a terminal window opened
| with the caution message :DON'T CLOSE, PLEASE...
| 
| I hope you could help me to fix it.
| Nancy.
| 
| 
| 
| --
| 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: Request Dispatcher

2001-11-14 Thread Tom Drake

JSP provides an easier way to do what you are attempting.
However, the 'hot' include mechanism, is very much like a
function call. the output from the included jsp/servlet simply
appears in the middle of your output stream. It does not replace
the entire page.

If you need a completely different response, you may need
to use the 'forward' mechanism instead. If you do, you must
forward to the other page prior to producing any output
at all.

Tom
- Original Message - 
From: Scott Walter [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, November 14, 2001 10:16 AM
Subject: Request Dispatcher


| I am trying to use a RequestDispatcher include with a
| JSP page, it seems to be including the content above
| the location where I have coded the include.  Any 
| clues???
| 
| Below is my code
| %
| RequestDispatcher rd =
| request.getRequestDispatcher(pageName);
|  
| rd.include(request,response);
| %
| 
| =
| ~~~
| Scott
| 
| __
| Do You Yahoo!?
| Find the one for you at Yahoo! Personals
| http://personals.yahoo.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]




Re: STARTUP.SH DOESN'T WORKS FINE

2001-11-14 Thread Tom Drake


- Original Message -
From: Nikola Milutinovic [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Wednesday, November 14, 2001 11:07 AM
Subject: Re: STARTUP.SH DOESN'T WORKS FINE


| Tom Drake wrote:
|
|  This has nothing to do with tomcat. It is standard unix behavior.
|  When a user logs out, all processes created by that user are killed.
|
|
| No, when a user logs out all processes that are children to that shell
instance
| are sent a HUP signal (Hang UP). A process may choose to ignore that
signal.
| Every well written daemon and server process SHOULD do that (among other
things).

Effectively the process is killed. I think we are saying the same thing.
As far as I know, there's no way to receive SIGHUP (or any other Unix
signal)
in your java code anyway.

|
|
|  Unix provides simple way to around this feature.
|  Simply type the following command:
| 
|  nohup tomcat.sh run 
|
|
| I use tomcat.sh start instead of tomcat.sh run and so should Nancy.
The
| problem is in Tomcat getting HUP signal, but in loosing a console, I
think.

I think that run is actually more appropriate since it will not spawn the
jvm
in background. We are doing that ourselves with the '' at the end of the
command above.

|
|
|  In this case all 'console output produced by tomcat will
|  appear in a file called 'nohup.out'.
| 
|  The name nohup comes from the days of flaky dialup connections
|  and is short for 'no hang-up'. It is used to
|  prevent a spurious loss of connection (or hang-up) from stopping
|  a process.
|
| Or for instance, I connect to my company, locate a file for download,
place it
| in script, run the script with nohup and disconnect. The download will go
on.
|
| Nix.
|
|
| --
| 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: resp.sendRedirect(./Join2?Email_Address= + EmailAddress);

2001-11-14 Thread Tom Drake

Carl:

encodeURL() and encodeRedirectURL() do not do what you think they do.
These methods may add a 'jsessioniid=...' entry to url. They will not URL
encode
the url string itself.

However, I think that I was wrong about the '@' anyway. You could still have
a problem with
invalid characters in your URL. Everyone should be urlencoding everything
after the '?' in their url's.
There is some code on the jakarta site that will do this. I think it's in a
class called something
like HttpUtils.java. I think you can find it in taglibs or struts.

I don't know what would cause an illegal state exception.

Tom
- Original Message -
From: Carl Boudreau [EMAIL PROTECTED]
To: 'Tomcat Users List' [EMAIL PROTECTED]; 'Tom Drake'
[EMAIL PROTECTED]
Sent: Wednesday, November 14, 2001 9:54 AM
Subject: RE: resp.sendRedirect(./Join2?Email_Address= + EmailAddress);


| Well Tom,
|
| I have changed the following code to read;
| if(TxtCheck1.equals(User_Name)) {
| // User join1 data has been added to Database
| String Redirect_String = ./ValidUser?firstname=
+
| User_Name;
| //resp.sendRedirect(./ValidUser?firstname= +
| User_Name);
| //resp.encodeRedirectURL(./ValidUser?firstname=
+
| User_Name);
| out.println(Redirect_String + br);
| //resp.sendRedirect(Redirect_String.trim());
|  Error  
| resp.sendRedirect(resp.encodeRedirectURL(Redirect_String.trim()));
| //out.close();
| out.println(Found User_Name  + User_Name +  on
| Row  + result.getRow() + br);
|
| //out.println(resp.encodeRedirectUrl(./ValidUser?firstname= + User_Name)
+
| p);
| out.flush();
| }
| else {
| out.println(User_Name +  User_Name Not Found
on
| Row  + result.getRow() + p);
|
| //resp.sendRedirect(./htmlpage/joinerror.html);
| out.flush();
| //out.close();
| }
|
| And this is returning  java.lang.IllegalStateException  exception, and
| still crashing if the  If  is true.
|
| Any ideas?  Carl
|
|
| -Original Message-
| From: Tom Drake [mailto:[EMAIL PROTECTED]]
| Sent: Wednesday, November 14, 2001 9:57 AM
| To: Tomcat Users List; [EMAIL PROTECTED]
| Subject: Re: resp.sendRedirect(./Join2?Email_Address= + EmailAddress);
|
|
| You're @ is likely the problem. You must url-encoude the redirect address.
|
| - Original Message -
| From: Carl Boudreau [EMAIL PROTECTED]
| To: 'Tomcat Users List' [EMAIL PROTECTED]
| Sent: Wednesday, November 14, 2001 7:32 AM
| Subject: resp.sendRedirect(./Join2?Email_Address= + EmailAddress);
|
|
| | Good Morning Fellow Coders,
| |
| | I have a very interesting question for all of you.  Below is a small
| | snippet of code which basically validates a database Insert operation.
| The
| | operation writes to the database then turns around and read the email
| | address and compares it to what was passed to the Servlets.  For example
| | within the 20 params sent, [EMAIL PROTECTED] would be sent as an
| email
| | address.  It would then be written and then it would re-query the
database
| | and compare the results.  This snippet makes the comparison between what
| was
| | passed and what was read out of the database, in turn uses the Redirect
to
| | either move on to the next Servlets Join2 if successful, or display
| | joinerror.html if un-successful.  But an exception is caught and ends
the
| | Servlets.  During debug I have reduce the error to the redirect line
| | [resp.sendRedirect(./Join2?Email_Address= + EmailAddress);].
| |
| | Now I have been monitoring the email forum and had seen there was a
| problem
| | with the redirect.  And in the mean time I had manually started these
| | Servlets by using IE and entering the
| | [./Join2?[EMAIL PROTECTED])]  and it works fine.  I
| | think, I found out, that if I manually do this first, then run it
normally
| | by hitting it from a index.html page it works.  But my results have been
| | very erratic and I don't trust myself.
| |
| | I have tried to use out.flush( ); alone and then followed up by a
| | out.close( ); by this doesn't seem to change anything.
| |
| | DOES ANYONE HAVE ANY SUGGESTIONS, OR A WORK AROUND?
| |
| | Source Code Snippet;
| |
| | if(TxtCheck1.equals(MemberMail))
| |{
| | // User join1 data has been added to Database
| |resp.sendRedirect(./Join2?Email_Address= +
| | EmailAddress);
| | }
| | else {
| |
| | resp.sendRedirect(./htmlpage/joinerror.html);
| |}
| |
| |
| | System Config;
| |
| | Win2000pro.
| | Tomcat 4.0 standalone.
| | MySQL 7.0
| |
| |
| | --
| | To unsubscribe:   mailto

Re: Logout with basic autorization

2001-11-14 Thread Tom Drake

I think your servlet or jsp can simply call session.invalidate().


- Original Message -
From: kevin ritter [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, November 14, 2001 4:41 PM
Subject: Re: Logout with basic autorization


| Can anyone one verify if this is really the case, that is, to logout with
| BASIC authentication you have to close the browser window? This seems to
be
| a little goofy. Are there any work arounds?
|
| Thank you in advance. Peace
| Kevin Ritter
|
| - Original Message -
| From: Jonathan Eric Miller [EMAIL PROTECTED]
| To: [EMAIL PROTECTED]
| Sent: Wednesday, September 19, 2001 8:58 PM
| Subject: Re: Logout with basic autorization
|
|
|  The only way to logout with basic authentication is to close the Web
|  browser. Otherwise, you may want to do form-based authentication.
| 
|  Jon
| 
|  - Original Message -
|  From: Oleksandr Fedorenko [EMAIL PROTECTED]
|  To: [EMAIL PROTECTED]
|  Sent: Wednesday, September 19, 2001 8:43 AM
|  Subject: Re: Logout with basic autorization
| 
| 
|  
|  
|   P.Miller wrote:
|  
|Hi Oleksandr,
|   
|you can 'logout' with session.invalidate().
|You have to login again afterwards.
|   
|  
|   I do it exactly.
|  
|   But Browser already contains information for authentication, and when
I
|  want
|   to access
|   protected page ( I want to get auth prompt ) , it pass it by.
|  
|   
|Hth
|Peter
|   
|Oleksandr Fedorenko wrote:
|
| Hi.
|
| How to do really logout using basic authorization ?
|
| I mean to get authorization prompt again by using tomcat engine ?
,
|  i.e.
|
| tomcat should care about it . To send smth. in response ?
| If yes, so what to send ?
|
| Thanks.
|
| Alex.
|  
|
|
| --
| 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: non-serializable objects in sessions

2001-11-13 Thread Tom Drake

Glad to help

- Original Message - 
From: Marko Asplund [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Tuesday, November 13, 2001 3:40 AM
Subject: Re: non-serializable objects in sessions


| 
| thanks for pointing out the database resource consumption problem!
| 
| i'll probably define an upper limit for result rows shown to the user in
| my application. then i'll use one query to get all the object ids of the
| result objects, store them (instead of the ResultSet) in the user's
| session. then the object data can be fetched from the database
| page-by-page as the user browses through the list of result objects.
| 
| best regards,
| -- 
| aspa
| 
| 
| 
| --
| 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: upgrade b6 to 4.0.1

2001-11-13 Thread Tom Drake

Did you copy your .tld and web.xml files as well?


- Original Message -
From: Brian K. Buckley [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, November 13, 2001 9:46 AM
Subject: upgrade b6 to 4.0.1


| Hello, I have a webapp with custom taglibs that was running fine with
| Tomcat4 b6.
|
| I installed Tomcat 4.0.1 and copied over my application to a subdirectory
| under webapps but when I attempt to run it my JSPs now won't compile,
giving
| me lots of taglib-related error messages such as 'Undefined variable or
| class name: BodyTag, Tag, etc.
|
| I've got servlet.jar (the servlet API 2.3 75K one) in my common/lib and I
| also tried adding it to my webapp lib but the problem remains.
|
| When I look at the servlet java file that Tomcat creates from the JSP, it
| appears there is a missing import line, such as import
| javax.servlet.jsp.tagext.* causing the compiler to not recognize BodyTag
| and Tag from the javax.servlet.jsp.tagext package.
|
| Does anyone know what's wrong?
|
| -Brian
|
|
| --
| 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: Apache-Soap and Tomcat 3.3

2001-11-13 Thread Tom Drake

David:

Another solution is to simply deploy the apache web-application into the
same context as your own. This means that you have to merge web.xml
files, but it's otherwise pretty straightforward.

This means that only your web-application will be able to respond to
SOAP requests, however.

I've implemented Apache SOAP both ways.

- Original Message -
From: David Brunkow [EMAIL PROTECTED]
To: 'Tomcat Users List' [EMAIL PROTECTED]
Sent: Tuesday, November 13, 2001 3:35 PM
Subject: Apache-Soap and Tomcat 3.3


|
|
| Does anyone have Apache-Soap working with Tomcat 3.3? Unless you jar your
| app and put it in %TOMCAT_HOME%\lib\common\ I don't think it should work.
| I'm having all kinds or problems with classes could not be found on just
the
| samples.
|
| Thanks,
|
| Dave
|
| --
| 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: proxy server time outs

2001-11-13 Thread Tom Drake

Depending on the proxy server, there may be a configurable
time-out.

Your web-application should spit back the HTTP header and
the beginning of your HTML document before you start the query.
Make sure to flush the output stream.

If this is not enough, and you are producing an HTML response,
you could launch a thread in your servlet that 
kicks out a space ' ' to the servlet output stream every so often.
When your query finally completes, do whatever is necessary
to stop the thread, then close the output stream and return.


- Original Message - 
From: Evan Swanson [EMAIL PROTECTED]
To: 'Tomcat Users List' [EMAIL PROTECTED]
Sent: Tuesday, November 13, 2001 5:30 PM
Subject: proxy server time outs


| I have an application that queries a very large database. 
| It takes a long time but there does not seem to be anyway around that.
| This all works fine until I use it with a proxy server. 
| 
| The proxy server times out because there is such a slow response.
| 
| Is there any way to tell the proxy server Hold on, its comming?
| 
| 
| --
| 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: cannot execute binary file

2001-11-13 Thread Tom Drake

You should not have to unzip your classes12.zip file. This file is, for
all intents and purposes, a jar file.

Looking at your error message, I'm willing to bet that the problem is
in your security.policy file that tomcat is using. Most likely, it is not
allowing you to load classes that are in some other path. The quick
fix is to copy the classes12.zip into your tomcat/lib directory.

- Original Message -
From: Eric Strain [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, November 13, 2001 5:36 PM
Subject: Re: cannot execute binary file


| Hi:
| I hate to be simplistic, but, is your classes12.zip file still compressed?
| If so just unzip it to a safe location and alter your classpath
|
|
| From: Noble Long [EMAIL PROTECTED]
| Reply-To: Tomcat Users List [EMAIL PROTECTED]
| To: [EMAIL PROTECTED]
| Subject: cannot execute binary file
| Date: Tue, 13 Nov 2001 14:41:47 -0600
| 
| I am using the Oracle jdbc thin client in my application. I added it to
my
| classpath /usr/local/classes12.zip , but when I start Tomcat I am
getting -
| 
| bin/tomcat.sh: /usr/local/classes12.zip: cannot execute binary file
| 
| I tried other jar, files, etc. and everyone I transefered either in
binary
| mode or ascii via FTP, XMODEM or ZMODEM gives me the same message.
| 
| Is my file being corrupted between windows and linux. I am working with a
| remote telnet session so I can't exactly download from Oracle's website
to
| that machine. Funny thing is ... I have the same Red Hat 6.2 environment
| here except I'm using tomcat 3.2.3 instead of 3.2.1 (would it make a
| difference?)
| 
| Noble



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




Re: non-serializable objects in sessions

2001-11-12 Thread Tom Drake

Doing what you're attempting is extremely dangerous. You are very likely
to start 'leaking' database connections this way. Suppose 10 users were to
each perform one of these queries, but never ask to see the '2nd page'
of results. Let's say that the session timeout is 30 minutes. That means
all ten database connections will be unavailable for anyone to use for at
least 30 minutes. This assumes that you are using connection pooling or
are careful to 'clean-up' these connections in your object finalization.

There is a limit to the number of database connections that your database
supports. Sometimes there is a hard-limit, sometimes the limit is
configurable
(e.g. Oracle), sometimes the limit is simply dependant on system resources.

BTW, Oracle imposes a connection limit of 50 by default. You can change
this.

Using the method of 'hanging' onto these partially completed queries you
will
certainly burn database connections.

You have, at least two other options:

1) Write your bean in such a way that it fetches the result set data into a
local
  collection. If your result sets tend to be quite large, then you may need
  to do the fetching in a separate thread. When your bean figures out that
  there is a 'page' of data, or that fetching is complete, it can return the
1st
  available page of data to the client.

  The disadvantage of this approach is for really 'huge' queries (e.g.
thousands
  of rows). Of course, you can easily alter your UI to allow the users to
  constrain their own queries (e.g. 1st 10, 50, 100, 200, 500, 1000
results).
  If your users typically return many hundreds or thousands of 'matches',
You
  may need to rethink your design anyway, since the usefulness of such a
large
  amount of data is dubious at best.

  This is arguably the easier of these two methods to write. However, it
  may result in more database activity, than is necessary, if your users
  don't typically page thru all of the results.

2) Have each 'page' of results result in a separate query to the database.
Each
  query would have to be constrained or filtered in such a way as to produce
the
  'next' page of data. If your results are sorted in any way, You may be
able to
  constrain the query by some combination of the sorted columns. (e.g. if
the
  last Product ID displayed on the 1st page was 'abc123', the query for the
  second page might be
  'select * from product where productid  'abc123' order by productid').



Good Luck

Tom Drake

- Original Message -
From: Marko Asplund [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Monday, November 12, 2001 10:49 AM
Subject: Re: non-serializable objects in sessions


| On Sun, 11 Nov 2001, Craig R. McClanahan wrote:
|
|  ...
|  There is no way in Java to persist a non-Serializable object like a
|  database statement.  In fact, you cannot even use such a thing if you're
|  using a connection pool (completely separate from session persistance
|  issues) unless the connection pool itself implements support for this.
|
| what i'd like to do is store Statement and ResultSet objects in a user
| session so, that the data fetched from the database can be paginated more
| easily for the user. these objects don't have to be persistent, but when
| Tomcat is shut down it automatically tries to serialize the contents of
| user sessions. when this happens i get warnings about the non-serializable
| objects. i'd like to make these warnings go away. should i just put these
| objects inside another class designed to store query state and implement
| the Serializable interface (no serialization, just close handles) in this
| class? are there any additional issues to take into consideration when
| storing Statement and ResultSet objects inside sessions?
|
| --
| aspa
|
|
| --
| 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: Bringing up tomcat, reliably.

2001-11-11 Thread Tom Drake

 When I wrote a servlet for TC3.2.3, before Connection conn=bla..., I had
 Class.forName(org.postgresql.driver);
 As far as the location of postgresql.jar, I had it in JDK_HOME/lib and in
 TOMCAT_HOME/lib at least (maybe in WEB-INF/lib as well - I can't remember)

Thanks. I have postgresql.jar in a proper location, it seams. Looks like it is either 
not getting loaded or not registered as a JDBC driver.

QUESTION 1: How can I check if a particular jar/class has been accepted by the 
classloader?
QUESTION 2: Again, what is the proper way of specifying a system-wide JDBC driver in 
Tomcat 4.0?

Nix.



smime.p7s
Description: application/pkcs7-signature