Re: tools.jar location ??

2001-08-06 Thread Nils O. Selåsdal

On Sunday 05 August 2001 21:30, Shahed Ali wrote:
> Hi,
>
> I am having problems with tools.jar on Solaris Sparc 8
> with JDK 1.3.1
>
> I have tools.jar set in my CLASSPATH
> in my /etc/profile, and I start tomcat in  rc2.d.
>
> This does not allow me to recompile jsp pages.
> I get a sun/tools/Main class not found exception when jsp pages
> need to be recompiled.
>
> When I tired a symlink under WEB-INF/lib to point to my jdk1.3.1 tools.jar,
> it seems to work only if I restart tomcat manually and not on reboot from
> rc2.d.
>
> So my questions are :-
>
> 1. Where should I place tools.jar ??
>
> 2. Is thre some problem with JDK 1.3.1 tools.jar and Tomcat 3.2.1 ? I used
> tools.jar from JDK 1.3.0 and I think that works fine. I suspect some
> problems
> with the jdk1.3.1 tools.jar under Solaris 8 Sparc JDK 1.3.1 from Sun.
Where do you set the CLASSPATH ? Because you have tools.jar in the classpath, 
doesnt mean tomcat has it when its run at startup time.

Also, setting the JAVA_HOME enviroment variable should be enough for tomcat 
to figure out where the tools.jar is. When run from one of the rc.d dirs, you 
are better off definig such variables at the beginning of 'tomcat.sh'

-- 
Nils O. Selåsdal




RE: How to increase HTTP timeout?

2001-08-01 Thread Nils O. Selåsdal

On Wednesday 01 August 2001 04:10 am, Andrew Jarman wrote:
> Sorry, I should have been more clear.
>
> I am not having problem with my *session* timing out, I am having problems
> with the actual connection timing out.
>
> Here's the scenario:
>
> 1.  Client does a POST, sending in an XML document (using the MSXML3 DOM on
> a MS client).
> 2.  Server parses the XML, writes some data to a database, then calls an
> Oracle Report server to generate a PDF file based on the information.
> 3.  The thread waits for the report to be completed, then it retrieves the
> PDF file and stores it on a NFS volume.
> 4.  The servlet thread then returns an XML response that contains a
> reference to where the PDF file can be picked up.
> 5.  The client then retrieves the file using a HTTP GET method, going
> through the normal Apache server, which can access the NFS volume.
>
> This architecture works fairly well, and most reports return fairly quickly
> (30 - 120 sec).  Also, having the client retrieve the report using an HTTP
> GET gets around a bunch of issues with the Acrobat reader and IE5 (did you
> know that IE+Acrobat+SSL != good_experience?)
>
> The problem is that a long running report can make step (3) wait for more
> than 5 minutes, at which time TomCat gives up and closes the connection
> with an error.  This means that any report that takes longer than 5 min
> will not work.

Seems like the excact same proble I had.

> I fully understand the deficiencies of this design, and while I don't like
> it, it was possible to implement very quickly and in time for our next
> production release.  We will further address the problem in a future build
> when we have a few other infrastructure pieces in place, like an "inbox"
> queue so users can see when reports have completed.
>
> So, my question remains - how can I increase this timeout from 5 min to
> something longer?
I did it by doing the following,
in my doGet/Post method, response is the HttpServletResponse object
response.addHeader("Connection:","Keep-Alive");//not quite sure if I had the
colon after "Connection"

afaik this is a HTTP 1.1 feature, and Tomcat 3.x supports only 1.0
Well anyway it works fine with IExplorer 5.x clients, it happily waits an 
hour or two now.(havent tested any other browsers...)

It didnt work with using Apache as a http proxy betwen IExplorer clients and 
the tomcat server though.
 
-- 
Nils O. Selåsdal



Re: How to send a XML Document with a request "POST" ?

2001-08-01 Thread Nils O. Selåsdal

On Wednesday 01 August 2001 03:05 pm, zze-messager FTM balr002 wrote:
> How to send a XML Document with a request "POST" ?
If you use Xerces, you can use the org.apache.xml.serialize.Serializer class
and simply serialize it to the outputstream you get.
(e.g. request.getOutputStream() in a servlet)
-- 
Nils O. Selåsdal



Re: How to ensure Tomcat to load multiple instances of a servlet, to handle simultaneously multiple request ?

2001-07-31 Thread Nils O. Selåsdal

On Tuesday 31 July 2001 10:41 am, you wrote:

> Here is a short description of the configuration used :
> - tomcat-v3.2.2, apache-v1.3
> - the Servlet implements SinglethreadModel,
Font implement the singlethread model, then you can take as many concurrent 
requests as the machine can handle..
Just be aware of all the common 'problems' with multithreading.
e.g. if you have member variables in your servlet class (dont), that can 
cause trouble with concurrent access, you  must synchronize on access to the 
variabel, or find a better way on doing it.
(remember that each thread gets its own copy of local variables, so you dont 
have to worry about concurrent access to variables you declae inside the body 
of a method)
 

-- 
Nils O. Selåsdal



Re: Preventing System.exit(0)

2001-07-30 Thread Nils O. Selåsdal

On Monday 30 July 2001 04:33 pm, you wrote:
> At 06:24 AM 7/30/2001, you wrote:
> >Is it possible to configure Tomcat to avoid shutdown
> >in case the jsp page contains the code:
> >
> ><% System.exit(0); %>
>
> Java SERVER pages are server-side code. Why is having
> a system object issue an exit method an issue for you?
> Do you plan on having your server run black box code?
Say he invites his friends, the school, whatever, to put servlets/jsp pages
on his server. Its nice to have some security there , to prevent the next 
ass to put in a System.exit(...) and thereby stopping the entire server.
Or it might be that other software needs to be used, and someone put in a 
system.exit there in a try/catch block ( I experienced that..).
You can install a security manager to prevent this, I dont remember excactly 
how i did that, but its pretty easy, and can be found in the book
'Core Java 2 - Advanced Features' I think sun also have some tutorials on 
this. http://java.sun.com
-- 
Nils O. Selåsdal



Re: jdbc odbc bridge on linux

2001-07-29 Thread Nils O. Selåsdal

On Sunday 29 July 2001 01:12 am, you wrote:

> I'm not aware of any free jdbc drivers that will work
> with SQL Server, but there are a number of commercial
> solutions.  I use the OPTA 2000 driver from
> www.inetsoftware.de.
Take a look at www.freetds.org


-- 
Nils O. Selåsdal



Re: Dynamically Generate PDF

2001-07-25 Thread Nils O. Selåsdal

On Wednesday 25 July 2001 08:47, you wrote:
>Hello everyone,
>
>I wonder if anyone there has once generate PDF File from a servlet or
> JSP. And could give me some tips.
Yes, I've done it using FOP, found at xml.apache.org.

-- 
Nils O. Selåsdal



Re: Why so many processes?

2001-07-24 Thread Nils O. Selåsdal

On Tuesday 24 July 2001 21:08, you wrote:
> I recently upgraded to RH7 and downloaded jdk1.3.1.
> After starting Tomcat I find about a half dozen native thread processes
> running.  Is this normal?  Or, is there a fix?
its normal. And it is as you say threads, tomcat creates just as many threads 
on other platforms. Its just that threads are implemented much like processes 
on linux, atleast from the kernels view. Dont worry about it, and dont worry 
about memory usage, all threads/'processes' share the same memory.
 
-- 
Nils O. Selåsdal



Run tomcat as root ?

2001-07-20 Thread Nils O. Selåsdal

Currently we are running Tomcat as root on a  linux machine , are there any 
know security risks by doing so? SHould i rather run tomcat as another, 
restricted user ?

-- 
Nils O. Selåsdal



Re: Too many process?

2001-07-20 Thread Nils O. Selåsdal

On Friday 20 July 2001 09:04, Sumith Ail wrote:
> Hi Friends,
>
> Please excuse me if this question has been asked on this list a number of
> times.I am trying to install Tomcat 3.2.2 from RPM on RH Linux 6.2 using
> j2sdk 1.2.2 FCS from blackdown.org. I am able to start tomcat but it starts
> a lot of java process immediately without even anybody accessing the Tomcat
> server.
>
> [root@leo /root]#pstree | grep java
>
>  |-java---java---39*[java]
>
> Is this how it should behave or am I missing something.
Yes, assuming you use native threads. What you see is threads, which the 
linux kernel view as an ordinaery process. Thoug , they all share the same 
memory space.
Java it self uses a few threads on startup, one for the garbage collector, 
finalizer e.t.c. And tomcat start a number of threads, some go into a thread 
pool for faster response.

-- 
Nils O. Selåsdal



Re: Need workaround for Tomcat security.

2001-07-16 Thread Nils O. Selåsdal

On Monday 16 July 2001 21:39, you wrote:
> Jeff,
>TC 3.2.1 on linux.
>Apache and mod_jk
> It seems to me (without having had a chance to check)
> that this must be a misconfig at the apache
> and apache/tomcat end of things rather than a tomcat bug as such.
>
> Any thoughts? It would be a pretty big hole if it was a genuine
> bug.
I did not have apache or mod_jk, plain Tomcat 3.2.2 installation.
The hole is there. And is big ;(



Need workaround for Tomcat security.

2001-07-15 Thread Nils O. Selåsdal

Ok, i needed to put some security constraints to a dircetory, so I added this 
to my web.xml:
 
  UQoS Amin Area
  
 UQoS Amin Area
   /admin/*
  
I use BASIC authentication using the memory realm.
Works like it supposed to when someone goes to my http://xxx/webapp/Admin/ or 
something below, HOWEVER, if they type http://xxx/webapp//Admin/ (or even 
more slashes), all security checkings are bypassed, anyone arr let right in !
(same things happens always, try it with the 'security' example shipped with 
Tomcat.
Sever bug!, I have posted it to BugZilla. This applies to atleast Tomcat 
3.2.1 and 3.2.2. 
And I need it fixedas soon as possible. Does anyone know a workaround to 
thisone.(I'd rather not upgrade to Tomcat 4 yet,seems like its fixed here.)
-- 
Nils O. Selåsdal