Tomcat on Windows Server 2003 : What Windows User Account?

2006-01-13 Thread Tom Burke
I wonder if recipients can advise me what Windows user account would be used by 
an external process triggered by a JSP app running on Tomcat?

We have an JSP application, served up by Tomcat, with a MySQL back-end 
database. At intervals it is necessary to do a bulk update of the database. We 
intend eventually to do this via the app through the JDBC interface but for the 
time being we have taken a short cut. Calling this shortcut from within the app 
closes down Tomcat on the server and launches a batch file, which in turn calls 
.sql script files which load data files into the database. The the batch file 
restarts the Tomcat service. The user (who is is on a remote PC, not the 
server) is advised to close their browser, leave it a couple of minutes, then 
restart. Messy, I know, but within the time it's the best we've been able to do.

Tested on a Windows XP  Pro 'server' this all works fine, but in situ at the 
customer's site we are getting errors that suggest that there may be 
permissions issues arising. So the question is: when we shutdown the Tomcat 
service and launch the batch files, under which Windows account would this be 
running? The customer has a Windows 2003 server, and has a Windows 2003 AD 
environment, though I believe the accounts we are using on the server are 
machine accounts.

In fact, under what Windows account does Tomcat execute anyway? Does it create 
its own machine account when it is installed, or does it take the permissions 
of whoever first installed it?

Tom Burke

Re: Question reg. setting the environment variable

2006-01-13 Thread vineesh kumar
which windows version u r using?
  Usually u can right click on start-controlpanel- system
select the ADVANCED tab then click the environmental variables at the
bottom and enter ur calsspath and all

On 1/13/06, gupta vidhi [EMAIL PROTECTED] wrote:
 hello,

   i'd installed jdk-1_5_0_02-windows-i586-p-iftw and jakarta-tomcat-4.1.31 on 
 desktop.but unable to set its required path.i request u to kindly help me out 
 for the same and starting my Tomcat.

   Regards,
   Vidhi


 -
 Yahoo! Photos
  Got holiday prints? See all the ways to get quality prints in your hands 
 ASAP.


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



RE: Image Scaling Code

2006-01-13 Thread Wouter Boers
That was the old way to fix a bug in the JVM I believe. Anyways nowadays you
can pass the following option to the server when starting:
-Djava.awt.headless=true 

That will prevent the errors mentioned below when you don't have a graphical
shell running on your system. 

Regards, Wouter

-Original Message-
From: Ben Kim [mailto:[EMAIL PROTECTED] 
Sent: Friday, January 13, 2006 7:54 AM
To: Tomcat Users List
Subject: Re: Image Scaling Code


This may or may not be the case with you.

I had a similar error (X11, DISPLAY) with an earlier version of tomcat
included in a 3rd party package, on linux. 

After I installed Xvfb (x virtual frame buffer) server rpm, the error went
away. (http://www.xfree86.org/4.0.1/Xvfb.1.html) I think there was a clue in
the error log.

If you're on Fedora, you can just do yum install xorg-x11-Xvfb or do yum
search Xvfb. I don't think I had to run it actually. 

Don't know if it will help you, but just in case. 


Regards,

Ben Kim
Developer
http://benix.tamu.edu

On 1/12/06, Justin Jaynes [EMAIL PROTECTED] wrote:

 Hello all,

 I've written a java class to scale jpeg images.  But I can't seem to 
 get it to work.  Can anyone point me in the right direction?

 Here is my code:


 package com.everybuddystree;

 import java.awt.*;
 import java.awt.image.*;
 import java.io.*;
 import javax.imageio.*;

 public class ImageScaler {

 public ImageScaler() {
 }

 public boolean scaleImageByWidth(String fileName, int newWidth) {

   File originalImage = new File(fileName);
   try {
BufferedImage workingBufferedImage = ImageIO.read(originalImage);
int width = workingBufferedImage.getWidth();
int height = workingBufferedImage.getHeight();
Image workingImage = workingBufferedImage;
workingImage = (Image)workingImage.getScaledInstance(newWidth,-1,1);
BufferedImage finalImage = (BufferedImage)workingImage;
ImageIO.write(finalImage, jpg, originalImage);

return true;

   } catch (IOException ex){

return false;

   }

 }

 }

 When I run the pass an image to the class using a jsp I get the 
 following errors from Tomcat:


 HTTP Status 500 -
 -
 type Exception report
 message
 description The server encountered an internal error () that prevented 
 it from fulfilling this request.
 exception
 javax.servlet.ServletException: Can't connect to X11 window server 
 using ':0.0' as the value of the DISPLAY variable.
 org.apache.jasper.runtime.PageContextImpl.doHandlePageException(
 PageContextImpl.java:848)
 org.apache.jasper.runtime.PageContextImpl.handlePageException(
 PageContextImpl.java:781)  org.apache.jsp.image_jsp._jspService(
 org.apache.jsp.image_jsp:158)
 org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
 org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.
 java
 :322)  
 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java
 :314)  
 org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:802) root 
 cause
 java.lang.InternalError: Can't connect to X11 window server using ':0.0'
 as the value of the DISPLAY variable.
 sun.awt.X11GraphicsEnvironment.initDisplay(Native Method) 
 sun.awt.X11GraphicsEnvironment.access$000(X11GraphicsEnvironment.java
 :53)  sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java
 :142)  java.security.AccessController.doPrivileged(Native Method)
 sun.awt.X11GraphicsEnvironment.clinit(X11GraphicsEnvironment.java:13
 1) java.lang.Class.forName0(Native Method)  java.lang.Class.forName(
 Class.java:164)  
 java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(
 GraphicsEnvironment.java:68)  
 sun.awt.X11.XToolkit.clinit(XToolkit.java
 :96)  java.lang.Class.forName0(Native Method)  
 java.lang.Class.forName(
 Class.java:164)  java.awt.Toolkit$2.run(Toolkit.java:821)
 java.security.AccessController.doPrivileged(Native Method)
 java.awt.Toolkit.getDefaultToolkit(Toolkit.java:804)
 java.awt.Image.getScaledInstance(Image.java:158)
 com.everybuddystree.ImageScaler.scaleImageByWidth(ImageScaler.java:21)
 org.apache.jsp.image_jsp._jspService(org.apache.jsp.image_jsp:114)
 org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
 org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.
 java
 :322)  
 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java
 :314)  
 org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:802) note The 
 full stack trace of the root cause is available in the Apache
Tomcat/5.5.12 logs.

 -
 Apache Tomcat/5.5.12






 -
 Yahoo! Photos ?Showcase holiday pictures in hardcover Photo Books. You 
 design it and we'll bind it!




--
You can lead a horse to water 

Tomcat 5.5. APR Standalone Page not loading without compression ...

2006-01-13 Thread M A
Hi All,

My config ..

tomcat 5.5
jdk1.5._06
apr 1.2.2
tomcat-jni 1.1.0

server.xml
 Connector port=80 maxHttpHeaderSize=8192
   maxThreads=150 minSpareThreads=25 maxSpareThreads=75
   enableLookups=false redirectPort=8443 acceptCount=100
   compression=on
   compressionMinSize=2048
   noCompressionUserAgents=gozilla, traviata
   compressableMimeType=text/html,text/xml
   protocol=org.apache.coyote.http11.Http11AprProtocol
   connectionTimeout=2 disableUploadTimeout=true /

The problem is this, I have a jsp page with will result in about 14KB worth
of HTML..

with compression off .. this page doesnt not load, i keep getting a could
not load page .. if i create a html file representing the output of the jsp
... this is what i get when using wget ..

FOR THE HTML FILE ---
wget www.mydomain.com/foo.html
--22:32:38--  
http://www.mydomain.com:80/foo.htmlhttp://www.mydomain.com/foo.html
Connecting to www.mydomain.com:80 http://www.mydomain.com/... connected!
HTTP request sent, awaiting response... 200 OK
Length: 13,202 [text/html]
0K - .. ..  [ 97%]
22:32:59 ( 641.20 B/s) - Read error at byte 12824/13202 (No such file or
directory). Retrying.

--22:32:59--  
http://www.mydomain.com:80/foo.htmlhttp://www.mydomain.com/foo.html
  (try: 2) =
Connecting to www.mydomain.com:80 http://www.mydomain.com/... connected!
HTTP request sent, awaiting response... 206 Partial Content
Length: 13,202 (378 to go) [text/html]

0K - ,, ,,  [100%]

22:32:59 (369.14 KB/s) - `foo.html.3' saved [13202/13202]

FOR THE JSP FILE


C:\wgetwget www.mydomain.com/p.jsp?id=4
--22:36:28--  
http://www.mydomain.com:80/p.jsp?id=4http://www.mydomain.com/p.jsp?id=4
   = [EMAIL PROTECTED]' [EMAIL PROTECTED]'
Connecting to www.mydomain.com:80 http://www.mydomain.com/... connected!
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]

0K - .. ..

22:36:48 (639.90 B/s) - Read error at byte 12798 (No such file or
directory).Ret
rying.

--22:36:48--  
http://www.mydomain.com:80/p.jsp?id=4http://www.mydomain.com/p.jsp?id=4
  (try: 2) = [EMAIL PROTECTED]' [EMAIL PROTECTED]'
Connecting to www.mydomain.com:80 http://www.mydomain.com/... connected!
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]

0K - .. ..

22:37:09 (639.90 B/s) - Read error at byte 12798 (No such file or
directory).Ret
rying.

--22:37:09--  
http://www.mydomain.com:80/p.jsp?id=4http://www.mydomain.com/postanswer.jsp?id=4
  (try: 3) = [EMAIL PROTECTED]' [EMAIL PROTECTED]'
Connecting to www.mydomain.com:80 http://www.mydomain.com/... connected!
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]

0K - .. ..

22:37:29 (639.90 B/s) - Read error at byte 12798 (No such file or
directory).Ret
rying.

--22:37:29--  
http://www.mydomain.com:80/p.jsp?id=4http://www.mydomain.com/postanswer.jsp?id=4
  (try: 4) = [EMAIL PROTECTED]' [EMAIL PROTECTED]'
Connecting to www.mydomain.com:80 http://www.mydomain.com/... connected!
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]

JSP WGET END

For the JSP file it keeps looping ..

I have set no-cache for the jsp page and the page buffer is 32 kb ...

Any ideas on what could be going wrong .. like i said .. it works fine with
compression on ...

Cheers

Mo


RE: Small connection problems with JK 1.2.15 and IIS 5

2006-01-13 Thread br1
Mladen,

Thank you very much for your reply.
I didn't catch cachesize relates to concurrent users, in this case I will have 
to change a lot of workers.

So I assume that there are (currently) no recommendations regarding a maximum 
total worker.cachesize for a single IIS5 server, correct?

Also, a little comment: it would be useful to have a default higher than 10 for 
cachesize, or maybe a global setting in the isapi_redirect.properties file.

Thanks again,
br1.

- Original Message - 
From: Mladen Turk [EMAIL PROTECTED]
To: Tomcat Users List users@tomcat.apache.org
Sent: Wednesday, January 11, 2006 5:29 PM
Subject: Re: Small connection problems with JK 1.2.15 and IIS 5


 br1 wrote:
  Hello,
 
  I am new to the list but I must say I used it a lot to find things in the 
  past years.
  This time I am facing a problem or two but not finding a solution.. small 
  problems luckily.
 
  (2)
  [Fri Jan 06 15:17:20 2006] [warn]  jk_ajp_common.c (2138): Unable to get 
  the free endpoint for worker MYWORKER from 20 slots
  [Fri Jan 06 15:17:20 2006] [info]  jk_ajp_common.c (2152): can't find free 
  endpoint
 

 Increase the cachesize for the worker.
 The value should reflect the number of concurrent users on the system.
 The above messages means that you have more then 20 concurrent users
 connected.

  According to a few posts I found I added connectionTimeout=0 to some 
  tomcats and raised the cachesize of some workers that
were
  giving problems (worker.MYWORKER.cachesize=20)
 

  Now I still get the error (1) a couple of times a second and the error (2) 
  a few times the day.
 
  My questions at this point would be:
  1- Are the above entries caused by the new JK 1.2.15 or I did have the same 
  problems and I didn't notice? (the log level was set
to
  emerg)

 See above comments.

  2- I applied connectionTimeout=0 to Tomcats 5.5.x. Is this also needed 
  for older Tomcat versions 5.0/4.1.7/4.0.6 - though in
the
  docs the parameter was not documented for the AJP connector?

 You don't need this for 5.x (by default connectionTimeout is disabled),
 but you need that for 4.x (connectionTimeout defaults to 1 minute).

  4- In the AJP documentation the min and maxProcessors are deprecated. What 
  should one use instead? They saved my life with
Tomcat 4.

 maxThreads.

 
  6- Too many questions? :-)
 

 No :)

 Regards,
 Mladen.







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



Re: Small connection problems with JK 1.2.15 and IIS 5

2006-01-13 Thread Mladen Turk

br1 wrote:

Mladen,

Thank you very much for your reply.
I didn't catch cachesize relates to concurrent users, in this case I will have 
to change a lot of workers.

So I assume that there are (currently) no recommendations regarding a maximum 
total worker.cachesize for a single IIS5 server, correct?

Also, a little comment: it would be useful to have a default higher than 10 for 
cachesize, or maybe a global setting in the isapi_redirect.properties file.



No, because XP (Workstation) versions of IIS are limited
to 10 concurrent connections.
You will need a Server version of Windows for higher number.
That's probably a Microsoft trick to sell the Servers :)

Regards,
Mladen.

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



Re: concurrency of users on tomcat

2006-01-13 Thread Tim Funk
Tomcat should be able to handle this. The real question is can your 
application handle it?


Bandwidth is application dependent. You'll need to examine the average file 
size being returned. Whether the file can be compressed (via gzip). How many 
database queries need to be done. Can the database handle this many queries 
per second. Can a caching solution be put in place? (This can be done at the 
data lookup layer and possible at the http response layer)


If your using sessions - what is the min/max/average session size. Can you 
hold 300K sessions with that amount of memory? (With that many users - I'd 
personally avoid HttpSession and roll my own solution)


There are many google links for scaling java based servers. Many might be 
server specific but in general - the principles they talk about are pretty 
generic.


-Tim

vishwas kharajge wrote:

Hi we are running tomcat5.0 on sun V20z server
 Backed is mysql
Our requirement is to provide 200 concurrent hits per second
There are 300K users registration on the server
For this what is the requirement?
How much bandwidht it require for giving above concurrency?
How to configure the server?



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



Re: help for error javax.servlet.ServletException

2006-01-13 Thread Tim Funk
A servlet threw a Throwwable during its service method which was not caught 
by any number of exceptions. There should be something in the logs 
(catalina.out of localhost_log_{date}.txt which should tell you the nested 
part of the exception. Otherwise - start looking for timestamps and trace 
that back to the access log. From there you might be able to find the culprit.


-Tim

Qaiser Mehmood wrote:


Does anyone know why I am getting this error :
 
 
javax.servlet.ServletException: Servlet execution threw an exception

at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:275)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)



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



Re: Unable to override doPut(), etc, from Tomcat's JSPServlet (response 403)

2006-01-13 Thread Tim Funk
You cannot add a doPut() to your servlet and excpect it to work. But in your 
JSP, you can do this:


// The following worked fine with tomcat 5.0.28 (plus unrelated patches)
if(PUT.equals(request.getMethod()) {
  /*put code*/
} else {
  /*not put code*/
}

JSP's declare Servlet.service() as final. Then they call _jspService() (which 
is created during JSP compilation). So doYYY() is never called.


-Tim

Ken Johanson wrote:


Hi all,

I'm wondering if there is another configuration needed to set which HTTP 
methods that JSPServlet accepts.. I'm attempting overriding doPut() in a 
JSP but I get a 403. Same if I don't override it and just try with 
'request.getMethod().equalsIgnoreCase(PUT)' in the JSP generated 
service() body..


%!
public void doPut(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException
{
//do something
}
%
Currently PUT always generates 403, even though I am authenticated okay 
(indicated by the remote-user field in access logs). But GET and POST 
are fine..


Thanks in advance,
-Ken

PS - Here's my web.xml excerpt:

security-constraint
display-nameExample Security Constraint/display-name
web-resource-collection
web-resource-nameProtected Area/web-resource-name
!-- Define the context-relative URL(s) to be protected --
url-pattern/*/url-pattern
!-- If you list http methods, only those methods are 
protected --

http-methodHEAD/http-method
http-methodGET/http-method
http-methodPOST/http-method
http-methodPUT/http-method
http-methodDELETE/http-method
http-methodTRACE/http-method
http-methodOPTIONS/http-method
http-methodHEAD/http-method
/web-resource-collection
auth-constraint
!-- Anyone with one of the listed roles may access this 
area --

role-nametomcat/role-name
role-namerole1/role-name
role-nameken/role-name
/auth-constraint
/security-constraint

login-config
auth-methodFORM/auth-method
form-login-config
form-login-page/login.jsp/form-login-page
form-error-page/login.jsp?fail=true/form-error-page
/form-login-config
/login-config

!-- Security roles referenced by this web application --
security-role
role-namerole1/role-name
/security-role
security-role
role-nametomcat/role-name
/security-role



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



Tomcat 5.5 will not reload exploded applications when a class is recompiled

2006-01-13 Thread Julien Martin
Hello,
I have the following problem: Tomcat 5.5 will not reload exploded
applications when a class is recompiled. Is there any modification to be
applied to Tomcat. Note that my autodeploy attribute is set to true(host)
and that my reloadable attribute is also set to true(context).
Any clue very welcome,
Julien.


Re: forwarding JDOM-Objects

2006-01-13 Thread Christian Stalp
So I wrote this servlet, it gets a JDOM-object from another servlet and 
returns with a another attribute.


Document mydoc = (Document) 
this.getServletContext().getAttribute(jdom_object);


   TXMLObject tobj = TXMLObject.newInstance ( mydoc);
   ServletContext sercon = this.getServletContext();
   String giveback = Tamino_returnvalue;
   try {
   TConnection connection = 
TConnectionFactory.getInstance().newConnection( 
http://localhost/tamino/chris; );
   TXMLObjectAccessor xmlObjectAccessor = 
connection.newXMLObjectAccessor(

   TAccessLocation.newInstance( test1 ),
   TJDOMObjectModel.getInstance() );
   TResponse myret = xmlObjectAccessor.insert( tobj );
   connection.close();
   sercon.setAttribute( giveback , myret );
   } catch ( TConnectionException te ) { te.getCause(); } 
 catch ( TInsertException ie ) { ie.toString(); };


But something doesn't fit. Because I got this dump:

javax.servlet.ServletException: Error instantiating servlet class 
DatenbankEingabe

org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)

org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)

org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)

org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)

org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)

org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)

org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)

java.lang.Thread.run(Unknown Source)


*root cause*

java.lang.NoClassDefFoundError: 
com/softwareag/tamino/db/api/accessor/TInsertException
java.lang.Class.getDeclaredConstructors0(Native Method)
java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
java.lang.Class.getConstructor0(Unknown Source)
java.lang.Class.newInstance0(Unknown Source)
java.lang.Class.newInstance(Unknown Source)

org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)

org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)

org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)

org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)

org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)

org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)

org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)

Is this caused by the single thread? I wortk with Eclipse, and this has no 
problem finding a class. Hmmm but maybe tomcat.
Anyway I send this mail away.

Gruss Christian



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



Re: Tomcat 5.5 will not reload exploded applications when a class is recompiled

2006-01-13 Thread Jarrar Hussain

Hello Julien,

What about the unpackWARs attribute (in server.xml)? I think its also 
need to be true.


Regards,
Jarrar.

Julien Martin wrote:


Hello,
I have the following problem: Tomcat 5.5 will not reload exploded
applications when a class is recompiled. Is there any modification to be
applied to Tomcat. Note that my autodeploy attribute is set to true(host)
and that my reloadable attribute is also set to true(context).
Any clue very welcome,
Julien.

 




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



Re: forwarding JDOM-Objects

2006-01-13 Thread David Delbecq
Your class in not available for your servlet.
Check in you war that com/softwareag/tamino/db/api/accessor/TInsertException 
is either in WEB-INF/classes, either in a .jar in WEB-INF/lib 


Le Vendredi 13 Janvier 2006 15:44, Christian Stalp a écrit :
 So I wrote this servlet, it gets a JDOM-object from another servlet and 
 returns with a another attribute.
 
 Document mydoc = (Document) 
 this.getServletContext().getAttribute(jdom_object);
 
 TXMLObject tobj = TXMLObject.newInstance ( mydoc);
 ServletContext sercon = this.getServletContext();
 String giveback = Tamino_returnvalue;
 try {
 TConnection connection = 
 TConnectionFactory.getInstance().newConnection( 
 http://localhost/tamino/chris; );
 TXMLObjectAccessor xmlObjectAccessor = 
 connection.newXMLObjectAccessor(
 TAccessLocation.newInstance( test1 ),
 TJDOMObjectModel.getInstance() );
 TResponse myret = xmlObjectAccessor.insert( tobj );
 connection.close();
 sercon.setAttribute( giveback , myret );
 } catch ( TConnectionException te ) { te.getCause(); } 
   catch ( TInsertException ie ) { ie.toString(); };
 
 But something doesn't fit. Because I got this dump:
 
 javax.servlet.ServletException: Error instantiating servlet class 
DatenbankEingabe
   
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
   
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
   
 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
   
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
   
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
   
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
   
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
 
   java.lang.Thread.run(Unknown Source)
 
 
 *root cause*
 
 java.lang.NoClassDefFoundError: 
com/softwareag/tamino/db/api/accessor/TInsertException
   java.lang.Class.getDeclaredConstructors0(Native Method)
   java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
   java.lang.Class.getConstructor0(Unknown Source)
   java.lang.Class.newInstance0(Unknown Source)
   java.lang.Class.newInstance(Unknown Source)
   
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
   
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
   
 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
   
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
   
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
   
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
   
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
 
 Is this caused by the single thread? I wortk with Eclipse, and this has no 
problem finding a class. Hmmm but maybe tomcat.
 Anyway I send this mail away.
 
 Gruss Christian
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

-- 
David Delbecq
Royal Meteorological Institute of Belgium

-
Pingouins dans les champs, hiver méchant

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



Re: Image Scaling Code

2006-01-13 Thread Jarrar Hussain

Hallo Wouter,

Yes I had the same problem and I add:

-Djava.awt.headless=true

option in

/usr/local/tomcat5/bin/catalina.sh

file like this:

CATALINA_OPTS=-Djava.awt.headless=true

and than everything works as expected.

Regards,
Jarrar.


Wouter Boers wrote:


That was the old way to fix a bug in the JVM I believe. Anyways nowadays you
can pass the following option to the server when starting:
-Djava.awt.headless=true 


That will prevent the errors mentioned below when you don't have a graphical
shell running on your system. 


Regards, Wouter

-Original Message-
From: Ben Kim [mailto:[EMAIL PROTECTED] 
Sent: Friday, January 13, 2006 7:54 AM

To: Tomcat Users List
Subject: Re: Image Scaling Code


This may or may not be the case with you.

I had a similar error (X11, DISPLAY) with an earlier version of tomcat
included in a 3rd party package, on linux. 


After I installed Xvfb (x virtual frame buffer) server rpm, the error went
away. (http://www.xfree86.org/4.0.1/Xvfb.1.html) I think there was a clue in
the error log.

If you're on Fedora, you can just do yum install xorg-x11-Xvfb or do yum
search Xvfb. I don't think I had to run it actually. 

Don't know if it will help you, but just in case. 



Regards,

Ben Kim
Developer
http://benix.tamu.edu

On 1/12/06, Justin Jaynes [EMAIL PROTECTED] wrote:
 


Hello all,

I've written a java class to scale jpeg images.  But I can't seem to 
get it to work.  Can anyone point me in the right direction?


Here is my code:


package com.everybuddystree;

import java.awt.*;
import java.awt.image.*;
import java.io.*;
import javax.imageio.*;

public class ImageScaler {

public ImageScaler() {
}

public boolean scaleImageByWidth(String fileName, int newWidth) {

 File originalImage = new File(fileName);
 try {
  BufferedImage workingBufferedImage = ImageIO.read(originalImage);
  int width = workingBufferedImage.getWidth();
  int height = workingBufferedImage.getHeight();
  Image workingImage = workingBufferedImage;
  workingImage = (Image)workingImage.getScaledInstance(newWidth,-1,1);
  BufferedImage finalImage = (BufferedImage)workingImage;
  ImageIO.write(finalImage, jpg, originalImage);

  return true;

 } catch (IOException ex){

  return false;

 }

}

}

When I run the pass an image to the class using a jsp I get the 
following errors from Tomcat:



HTTP Status 500 -
-
type Exception report
message
description The server encountered an internal error () that prevented 
it from fulfilling this request.

exception
javax.servlet.ServletException: Can't connect to X11 window server 
using ':0.0' as the value of the DISPLAY variable.

org.apache.jasper.runtime.PageContextImpl.doHandlePageException(
PageContextImpl.java:848)
org.apache.jasper.runtime.PageContextImpl.handlePageException(
PageContextImpl.java:781)  org.apache.jsp.image_jsp._jspService(
org.apache.jsp.image_jsp:158)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.
java
:322)  
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java
:314)  
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802) root 
cause

java.lang.InternalError: Can't connect to X11 window server using ':0.0'
as the value of the DISPLAY variable.
sun.awt.X11GraphicsEnvironment.initDisplay(Native Method) 
sun.awt.X11GraphicsEnvironment.access$000(X11GraphicsEnvironment.java

:53)  sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java
:142)  java.security.AccessController.doPrivileged(Native Method)
sun.awt.X11GraphicsEnvironment.clinit(X11GraphicsEnvironment.java:13
1) java.lang.Class.forName0(Native Method)  java.lang.Class.forName(
Class.java:164)  
java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(
GraphicsEnvironment.java:68)  
sun.awt.X11.XToolkit.clinit(XToolkit.java
:96)  java.lang.Class.forName0(Native Method)  
java.lang.Class.forName(

Class.java:164)  java.awt.Toolkit$2.run(Toolkit.java:821)
java.security.AccessController.doPrivileged(Native Method)
java.awt.Toolkit.getDefaultToolkit(Toolkit.java:804)
java.awt.Image.getScaledInstance(Image.java:158)
com.everybuddystree.ImageScaler.scaleImageByWidth(ImageScaler.java:21)
org.apache.jsp.image_jsp._jspService(org.apache.jsp.image_jsp:114)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.
java
:322)  
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java
:314)  
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802) note The 
full stack trace of the root cause is available in the Apache
   


Tomcat/5.5.12 logs.
 


-
Apache 

Re: Question reg. setting the environment variable

2006-01-13 Thread Seak, Teng-Fong

gupta vidhi wrote:


hello,
  
 i'd installed jdk-1_5_0_02-windows-i586-p-iftw and jakarta-tomcat-4.1.31 on desktop.but unable to set its required path.i request u to kindly help me out for the same and starting my Tomcat.


   You might find my answer irrelevant, but why are you still using 
Tomcat4?  Tomcat 5.5 is a lot easier to setup and run.



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



Re: Recommended way to selectively RequestDispatch.include/forward to form based login?

2006-01-13 Thread Ken Johanson

Bill Barker wrote:

.
The above seems like it should work; however I happen to get a 
StringIndexOutOfBounds* (with tomcat 5.0.30), probably caused by RD not 
being able to resolve the path of a protected URI (a guess) - so I'm 
looking for another way..





No, it's actually because it's including a welcome-page.  TC 5.5.x handles 
this case fine.




Well, I did try making the include() call the JSP directly 
(/login/index.jsp) and had the same problem.. or is this literally 
because the requested file *is* listed in the welcome files list?




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



Re: Image Scaling Code

2006-01-13 Thread Dakota Jack
headless I think the command is.

On 1/12/06, Dakota Jack [EMAIL PROTECTED] wrote:

 You need to set a java command option so that your code won't search for a
 display.  Apparently you are using this with a server that has no monitor?
 I forget the option but look them up under the java command and it will be
 obviously.  It ends in less as I recall.

 On 1/12/06, Justin Jaynes [EMAIL PROTECTED] wrote:
 
  Hello all,
 
  I've written a java class to scale jpeg images.  But I can't seem to get
  it to work.  Can anyone point me in the right direction?
 
  Here is my code:
 
 
  package com.everybuddystree;
 
  import java.awt.*;
  import java.awt.image.*;
  import java.io.*;
  import javax.imageio.*;
 
  public class ImageScaler {
 
  public ImageScaler() {
  }
 
  public boolean scaleImageByWidth(String fileName, int newWidth) {
 
File originalImage = new File(fileName);
try {
 BufferedImage workingBufferedImage = ImageIO.read(originalImage);
 int width = workingBufferedImage.getWidth();
 int height = workingBufferedImage.getHeight();
 Image workingImage = workingBufferedImage;
 workingImage = (Image)workingImage.getScaledInstance(newWidth,-1,1);
 BufferedImage finalImage = (BufferedImage)workingImage;
 ImageIO.write(finalImage, jpg, originalImage);
 
 return true;
 
} catch (IOException ex){
 
 return false;
 
}
 
  }
 
  }
 
  When I run the pass an image to the class using a jsp I get the
  following errors from Tomcat:
 
 
  HTTP Status 500 -
  -
  type Exception report
  message
  description The server encountered an internal error () that prevented
  it from fulfilling this request.
  exception
  javax.servlet.ServletException: Can't connect to X11 window server using
  ':0.0' as the value of the DISPLAY variable.
  org.apache.jasper.runtime.PageContextImpl.doHandlePageException(
  PageContextImpl.java:848)
  org.apache.jasper.runtime.PageContextImpl.handlePageException(
  PageContextImpl.java:781)  org.apache.jsp.image_jsp._jspService (
  org.apache.jsp.image_jsp:158)
  org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
  org.apache.jasper.servlet.JspServletWrapper.service(
  JspServletWrapper.java :322)
  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java
  :314)  org.apache.jasper.servlet.JspServlet.service(JspServlet.java
  :264)  javax.servlet.http.HttpServlet.service(HttpServlet.java:802) root
  cause
  java.lang.InternalError: Can't connect to X11 window server using ':0.0'
  as the value of the DISPLAY variable.
  sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
  sun.awt.X11GraphicsEnvironment.access$000(X11GraphicsEnvironment.java
  :53)  sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java
  :142)  java.security.AccessController.doPrivileged (Native Method)
  sun.awt.X11GraphicsEnvironment.clinit(X11GraphicsEnvironment.java
  :131)  java.lang.Class.forName0(Native Method)  java.lang.Class.forName(
  Class.java:164)
  java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(
  GraphicsEnvironment.java:68)  sun.awt.X11.XToolkit.clinit(
  XToolkit.java:96)  java.lang.Class.forName0(Native Method)
  java.lang.Class.forName(Class.java:164)  java.awt.Toolkit$2.run(
  Toolkit.java:821)  java.security.AccessController.doPrivileged(Native
  Method)  java.awt.Toolkit.getDefaultToolkit(Toolkit.java:804)
  java.awt.Image.getScaledInstance (Image.java:158)
  com.everybuddystree.ImageScaler.scaleImageByWidth(ImageScaler.java:21)
  org.apache.jsp.image_jsp._jspService(org.apache.jsp.image_jsp:114)
  org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java :97)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
  org.apache.jasper.servlet.JspServletWrapper.service(
  JspServletWrapper.java:322)
  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
  org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:802) note The
  full stack trace of the root cause is available in the Apache Tomcat/5.5.12
  logs.
 
  -
  Apache Tomcat/5.5.12
 
 
 
 
 
 
  -
  Yahoo! Photos – Showcase holiday pictures in hardcover
  Photo Books. You design it and we'll bind it!
 



 --
 You can lead a horse to water but you cannot make it float on its back.
 ~Dakota Jack~




--
You can lead a horse to water but you cannot make it float on its back.
~Dakota Jack~


Re: Unable to override doPut(), etc, from Tomcat's JSPServlet (response 403)

2006-01-13 Thread Ken Johanson

Tim Funk wrote:
You cannot add a doPut() to your servlet and excpect it to work. But in 
your JSP, you can do this:


// The following worked fine with tomcat 5.0.28 (plus unrelated patches)
if(PUT.equals(request.getMethod()) {
  /*put code*/
} else {
  /*not put code*/
}

JSP's declare Servlet.service() as final. Then they call _jspService() 
(which is created during JSP compilation). So doYYY() is never called.


-Tim

Ken Johanson wrote:



Serendipity! I guess the couple time I'd done this before made me overly 
confident that it should work the way I *remembered* doing it (which was 
implement doPut *and* add the dispatch code which I'm not doing now).


Of course you are right - if the JSP overrides service (even indirectly 
as final), than super cant dispatch it to the per-method handler.


Thanks!!!

ps _ I think above you may have meant You *can* add a doPut() to your 
servlet and expect it to work (only if service isn't overridden or is 
but calls super.service()).




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



Forwarding to contexts in other hosts

2006-01-13 Thread Marco Poehler

Hello,

is it possible to forward a request to a context in another host-section ?

for example from server.xml:
---%---
...
Engine name=Catalina defaultHost=www.host-a.com
   Host name=www.host-a.com
   Context path=/context-a1 /
   /Host
   Host name=www.host-b.com
   Context path=/context-b1 /
   Context path=/context-b2 /
   /Host
/Engine
...
---%---

To forward from context-b1 to context-b2 I can use a RequestDispatcher 
like this:


getServletContext().getRequestDispatcher(/context-b2).forward(request,response);

But what can I do to forward from context-b1 to context-a1 ?

Thanks in advance

Marco

---
http://www.kontaktlinsen-preisvergleich.de
http://www.faq-kontaktlinsen.de
http://www.parfuem-faq.de



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



Re: Tomcat 5.5 will not reload exploded applications when a class is recompiled

2006-01-13 Thread Julien Martin
Hello and thanks for the reply,
The unpackwar is already set at true...
Any other idea?
Julien.

2006/1/13, Jarrar Hussain [EMAIL PROTECTED]:

 Hello Julien,

 What about the unpackWARs attribute (in server.xml)? I think its also
 need to be true.

 Regards,
 Jarrar.

 Julien Martin wrote:

 Hello,
 I have the following problem: Tomcat 5.5 will not reload exploded
 applications when a class is recompiled. Is there any modification to be
 applied to Tomcat. Note that my autodeploy attribute is set to true(host)
 and that my reloadable attribute is also set to true(context).
 Any clue very welcome,
 Julien.
 
 
 


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




Re: forwarding JDOM-Objects

2006-01-13 Thread Christian Stalp

David Delbecq schrieb:


Your class in not available for your servlet.
Check in you war that com/softwareag/tamino/db/api/accessor/TInsertException 
is either in WEB-INF/classes, either in a .jar in WEB-INF/lib 



 

Mercy, this was really the problem. After I copied all .jar-files I need 
into the lib-folder I only get this error:


java.lang.NullPointerException

com.softwareag.tamino.db.api.objectModel.TXMLObjectFactory.newXMLObject(Unknown 
Source)
com.softwareag.tamino.db.api.objectModel.TXMLObject.newInstance(Unknown 
Source)
DatenbankEingabe.doGet(DatenbankEingabe.java:29)
javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)


But why, a NullPointerException ? The servlet gets now all it need and 
the XMLObject is part of TaminoAPI4J.jar! I have no clue, what is the 
cause of this exception.


Gruss Christian


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



RE: concurrency of users on tomcat

2006-01-13 Thread Peter Crowther
 From: vishwas kharajge [mailto:[EMAIL PROTECTED] 
 Our requirement is to provide 200 concurrent hits per second
 There are 300K users registration on the server
 For this what is the requirement?

Hiring someone who can do the calculations.

 How much bandwidht it require for giving above concurrency?

If you are serving (eg) the old homepage to www.purple.com, around 200 x
1kbyte/sec - call it 2Mbit/s.

If you are serving (eg) large PDFs or images, very much more than that.

It is *impossible* for anyone on this list to answer that question
without detailed knowledge of your application.  If you're not
comfortable doing the calculation yourselves, hire someone who is.

- Peter

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



RE: PreparedStatement w/ Connection Pooling

2006-01-13 Thread George Sexton
Let me just ask one simple question:

Have you benchmarked your queries with prepared and unprepared statements to
see if there is really a performance difference?

Many people blindly follow common knowledge about performance, and this
common knowledge is often wrong. People waste time and energy creating
optimized solutions to issues that weren't broken.

If you were my employee, I would first tell you to prove to me that there is
a genuine difference, and that the difference was large enough to justify
the additional maintainability/stability issues that might arise out of any
solution.

Lord Kelvin said:

If you can not measure it, you can not improve it.


George Sexton
MH Software, Inc.
http://www.mhsoftware.com/
Voice: 303 438 9585
  

 -Original Message-
 From: Khawaja Shams [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, January 12, 2006 11:12 PM
 To: Tomcat Users List
 Subject: Re: PreparedStatement w/ Connection Pooling
 
 I am guessing the main attribute to change is the following:
   poolPreparedStatements=true
 
 Suppose that this is set to true, how do I access these 
 pooled statement? My
 setup is exactly as you described, so this modification seems 
 minor, but I
 would appreciate guidance on how to get a hold of these 
 pooled prepared
 statement.  Thanks for your help.
 
 Sincerely,
 Khawaja Shams
 
 On 1/12/06, Marc Richards [EMAIL PROTECTED] wrote:
 
  If you're already using pooling then I imagine you
  already have a resource defined for the pool in either
  server.xml or in the context xml file.  To pool
  prepared statements, which is desireable, you should
  configure it to look something like this in Tomcat
  5.5:
 
 
  Resource
  type=javax.sql.DataSource
  auth=container
  name=jdbc/cPool
  username=user
  password=pwd
 
  driverClassName=com.ibm.as400.access.AS400JDBCDriver
  url=jdbc:as400://serverName;extended
  dynamic=true;package
  library=pkgLib;package=pkgName;package
  add=true;package cache=true
  initialSize=5
  removeAbandoned=true
  removeAbandonedTimeout=600
  maxActive=0
  maxIdle=10
  minIdle=2
  maxWait=10
  poolPreparedStatements=true
  logAbandoned=false
  /
 
  Note that in this example I'm using an IBM iSeries DB2
  database driver, not my sql, but the rest of the
  config should be close to the same with the exception
  that on a production machine you'll want to have your
  initialSize, maxIdle and minIdle set much higher
  depending on the number of concurrent connections that
  you expect to make.
  Also note the url parameter - DB2's jdbc driver and
  database support dynamic package support with prepared
  statements, which can sometimes offer huge sql
  performance gains due to the system's ability to offer
  better optimization for prepared statements and cache
  the optimization so that the SQL optimizer need not be
  initialized for every subsequent statement.  I don't
  know if my sql supports this or not, but you would
  definitely want to look into it.
  Lastly, note that this configuration is only
  applicable to Tomcat 5.5 and possibly later versions.
  Tomcat 5.0 and previous require a different syntax,
  using a more structured xml format, which can be
  reviewed here:
 
  
 http://tomcat.apache.org/tomcat-5.0-doc/jndi-datasource-exampl
 es-howto.html
  The best possible database configuration is as
  described above - using connection pooling with
  prepared statements and SQL package support - in cases
  where stored procedures are more difficult to manage.
  Stored procedures work great when you have several
  queries that are required to run in sequence (and
  usually offer better performance in such cases), but
  may end up a tad overkill from a maintenance
  perspective when you have a few isolated queries here
  and there.
 
  -marc
 
 
 
 
  --- George Sexton [EMAIL PROTECTED] wrote:
 
   Generally speaking, if you were using most SQL
   databases the approach would
   be to use a stored procedure. The stored procedure
   compilation saves the
   various query plans as part of the data of the
   stored procedure. I doubt
   MySQL does it, but you could ask on their
   development list.
  
   George Sexton
   MH Software, Inc.
   http://www.mhsoftware.com/
   Voice: 303 438 9585
  
  
-Original Message-
From: Khawaja Shams [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 12, 2006 2:19 PM
To: Tomcat Users List
Subject: PreparedStatement w/ Connection Pooling
   
Hello all,
I am working on a web application that will
   manage
assignments/students/classes for the teachers at a
   school.
Most of my pages
in the application need to access our mysql
   database very
frequently.  For
this and for other security reason, I would like
   to use
preparedStatements.
However, from what I understand, preparedStatement
   are
prepared on 

help for OutOfMemoryError

2006-01-13 Thread Qaiser Mehmood
Hi everyone,
 
Can anyone help me that why I am getting this error :
 
2006-01-13 09:50:11 StandardWrapperValve[action]: Servlet.service() for servlet 
action threw exception
java.lang.OutOfMemoryError: Java heap space


Qaiser

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



Re: help for OutOfMemoryError

2006-01-13 Thread Tim Funk

http://tomcat.apache.org/faq/memory.html#why

-Tim

Qaiser Mehmood wrote:


Hi everyone,
 
Can anyone help me that why I am getting this error :
 
2006-01-13 09:50:11 StandardWrapperValve[action]: Servlet.service() for servlet action threw exception

java.lang.OutOfMemoryError: Java heap space



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



Re: Small connection problems with JK 1.2.15 and IIS 5

2006-01-13 Thread Mladen Turk

myrealbruno wrote:

 Sorry - the message was cut for some reason.
 I was also saying that one that decides to use XP Pro for a 
production machine should be shot (and you could reply that everyone

 that decides to use Windows should be shot :-)
 In the end I was only suggesting a global setting for the JK 
redirector, I had to add cachesize=something to every one of my workers

 (30).


Why do you have 30 workers?
The worker should reflect a physical connection to the backend server.
It would only make sense if you'd have 30 Tomcats behing.

 And also wondering what the maximum would be for an average 
(production) server, I now have around 30*30 connections.



It depends on your client load, but I would say that 200 is more
then enough for a single box and an average application.
See:
http://people.apache.org/~mturk/docs/article/ftwai.html


Regards,
Mladen.


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



Realms

2006-01-13 Thread Vinny
Hello,
I decided to give 5.5.15 a try and I am not able to get any
Realm implementation to work except for MemoryRealm.
This is the same issue that I have been having in 5.5.14.
I can confirm that Datasource/JDBC/JaasRealm all do not
work in 5.5.15. Any one else having Realm issues since 5.5.10
or am I just a crazy voice in the dark?

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



RE: Image Scaling Code

2006-01-13 Thread Ben Kim

On Fri, 13 Jan 2006, Wouter Boers wrote:

That was the old way to fix a bug in the JVM I believe. Anyways nowadays you
can pass the following option to the server when starting:
-Djava.awt.headless=true 

This page seems to summarize it all ...

http://tomcat.apache.org/faq/unix.html
snip
  How do I run without an X server and still get graphics?

You either need to run headless or run an alternate X-server. Some more
information can be found here , here , or here .

Or if your are using a JVM 1.4 or better, you can use the system property
java.awt.headless=true
/snip

That will prevent the errors mentioned below when you don't have a graphical
shell running on your system. 

Regards, Wouter

-Original Message-
From: Ben Kim [mailto:[EMAIL PROTECTED] 
Sent: Friday, January 13, 2006 7:54 AM
To: Tomcat Users List
Subject: Re: Image Scaling Code


This may or may not be the case with you.

I had a similar error (X11, DISPLAY) with an earlier version of tomcat
included in a 3rd party package, on linux. 

After I installed Xvfb (x virtual frame buffer) server rpm, the error went
away. (http://www.xfree86.org/4.0.1/Xvfb.1.html) I think there was a clue in
the error log.

If you're on Fedora, you can just do yum install xorg-x11-Xvfb or do yum
search Xvfb. I don't think I had to run it actually. 

Don't know if it will help you, but just in case. 


Regards,

Ben Kim
Developer
http://benix.tamu.edu

On 1/12/06, Justin Jaynes [EMAIL PROTECTED] wrote:

 Hello all,

 I've written a java class to scale jpeg images.  But I can't seem to 
 get it to work.  Can anyone point me in the right direction?

 Here is my code:


 package com.everybuddystree;

 import java.awt.*;
 import java.awt.image.*;
 import java.io.*;
 import javax.imageio.*;

 public class ImageScaler {

 public ImageScaler() {
 }

 public boolean scaleImageByWidth(String fileName, int newWidth) {

   File originalImage = new File(fileName);
   try {
BufferedImage workingBufferedImage = ImageIO.read(originalImage);
int width = workingBufferedImage.getWidth();
int height = workingBufferedImage.getHeight();
Image workingImage = workingBufferedImage;
workingImage = (Image)workingImage.getScaledInstance(newWidth,-1,1);
BufferedImage finalImage = (BufferedImage)workingImage;
ImageIO.write(finalImage, jpg, originalImage);

return true;

   } catch (IOException ex){

return false;

   }

 }

 }

 When I run the pass an image to the class using a jsp I get the 
 following errors from Tomcat:


 HTTP Status 500 -
 -
 type Exception report
 message
 description The server encountered an internal error () that prevented 
 it from fulfilling this request.
 exception
 javax.servlet.ServletException: Can't connect to X11 window server 
 using ':0.0' as the value of the DISPLAY variable.
 org.apache.jasper.runtime.PageContextImpl.doHandlePageException(
 PageContextImpl.java:848)
 org.apache.jasper.runtime.PageContextImpl.handlePageException(
 PageContextImpl.java:781)  org.apache.jsp.image_jsp._jspService(
 org.apache.jsp.image_jsp:158)
 org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
 org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.
 java
 :322)  
 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java
 :314)  
 org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:802) root 
 cause
 java.lang.InternalError: Can't connect to X11 window server using ':0.0'
 as the value of the DISPLAY variable.
 sun.awt.X11GraphicsEnvironment.initDisplay(Native Method) 
 sun.awt.X11GraphicsEnvironment.access$000(X11GraphicsEnvironment.java
 :53)  sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java
 :142)  java.security.AccessController.doPrivileged(Native Method)
 sun.awt.X11GraphicsEnvironment.clinit(X11GraphicsEnvironment.java:13
 1) java.lang.Class.forName0(Native Method)  java.lang.Class.forName(
 Class.java:164)  
 java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(
 GraphicsEnvironment.java:68)  
 sun.awt.X11.XToolkit.clinit(XToolkit.java
 :96)  java.lang.Class.forName0(Native Method)  
 java.lang.Class.forName(
 Class.java:164)  java.awt.Toolkit$2.run(Toolkit.java:821)
 java.security.AccessController.doPrivileged(Native Method)
 java.awt.Toolkit.getDefaultToolkit(Toolkit.java:804)
 java.awt.Image.getScaledInstance(Image.java:158)
 com.everybuddystree.ImageScaler.scaleImageByWidth(ImageScaler.java:21)
 org.apache.jsp.image_jsp._jspService(org.apache.jsp.image_jsp:114)
 org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
 org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.
 java
 :322)  
 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java
 :314)  
 

Cannot find servlet

2006-01-13 Thread Thom Hehl
Sigh, I don't know why I keep having problems like this. I have the 
following servlet:


package rex;
/*
* Copyright 2006, Heavyweight Software. All rights reserved.
*/

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.RequestDispatcher;

import rex.IdxFileConverter;

/**
* servlet to simply launch the rex conversion process
*/
public final class LaunchRex extends HttpServlet
{
   Boring stuff here...
}

Here is my web.xml file:

?xml version=1.0 encoding=ISO-8859-1?
web-app xmlns=http://java.sun.com/xml/ns/j2ee;
   xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
   xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee 
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;

   version=2.4

   display-nameLaunches the REX converter/display-name
   description
   Launches the REX converter
   /description

   servlet
   servlet-nameLaunchRex/servlet-name
   servlet-class
   rex.LaunchRex
   /servlet-class
   /servlet

   servlet-mapping
   servlet-nameLaunchRex/servlet-name
   url-pattern/LaunchRex/url-pattern
   /servlet-mapping

/web-app

I have stored LaunchRex.class in rex.jar file in the lib directory of my 
webapp.  When I access http://localhost:81/rex/LaunchRex I get this error:


javax.servlet.ServletException: Wrapper cannot find servlet class rex.LaunchRex 
or a class it depends on

org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)

org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)

org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)

org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:667)

org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)

org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)

org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
java.lang.Thread.run(Unknown Source)

I'm not sure where to look next. Help?

Thanks.

Thom Hehl
Heavyweight Software for Heavyweight Needs
www.heavyweightsoftware.com
--
In every revolution, there is one man with a vision.--Jerome Bixby



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



Re: Cannot find servlet

2006-01-13 Thread Wade Chandler
--- Thom Hehl [EMAIL PROTECTED] wrote:

 Sigh, I don't know why I keep having problems like
 this. I have the 
 following servlet:
 
 package rex;
 /*
  * Copyright 2006, Heavyweight Software. All rights
 reserved.
  */
 
 import java.io.IOException;
 
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.RequestDispatcher;
 
 import rex.IdxFileConverter;
 
 /**
  * servlet to simply launch the rex conversion
 process
  */
 public final class LaunchRex extends HttpServlet
 {
 Boring stuff here...
 }
 
 Here is my web.xml file:
 
 ?xml version=1.0 encoding=ISO-8859-1?
 web-app xmlns=http://java.sun.com/xml/ns/j2ee;


xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;

 xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee 
 http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;
 version=2.4
 
 display-nameLaunches the REX
 converter/display-name
 description
 Launches the REX converter
 /description
 
 servlet
 servlet-nameLaunchRex/servlet-name
 servlet-class
 rex.LaunchRex
 /servlet-class
 /servlet
 
 servlet-mapping
 servlet-nameLaunchRex/servlet-name
 url-pattern/LaunchRex/url-pattern
 /servlet-mapping
 
 /web-app
 
 I have stored LaunchRex.class in rex.jar file in the
 lib directory of my 
 webapp.  When I access
 http://localhost:81/rex/LaunchRex I get this error:
 
 javax.servlet.ServletException: Wrapper cannot find
 servlet class rex.LaunchRex or a class it depends on
 

org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
 

org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
 

org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
 

org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:667)
 

org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
 

org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
 

org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
   java.lang.Thread.run(Unknown Source)
 
 I'm not sure where to look next. Help?
 
 Thanks.
 
 Thom Hehl
 Heavyweight Software for Heavyweight Needs
 www.heavyweightsoftware.com

Well, there isn't really a lot to go on here.  My
guess would be that you have put the class file in the
jar, but didn't put the package and class in the jar. 
Meaning: If you extract your jar using a zip utility
the top level would have simply LaunchRex.class when
it should have rex/LaunchRex.class.

Wade

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



Re: Cannot find servlet

2006-01-13 Thread Thom Hehl
I verified this and the class is correctly stored in the jar. I'm really 
stumped on this one.


Wade Chandler wrote:


--- Thom Hehl [EMAIL PROTECTED] wrote:

 


Sigh, I don't know why I keep having problems like
this. I have the 
following servlet:


package rex;
/*
* Copyright 2006, Heavyweight Software. All rights
reserved.
*/

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.RequestDispatcher;

import rex.IdxFileConverter;

/**
* servlet to simply launch the rex conversion
process
*/
public final class LaunchRex extends HttpServlet
{
   Boring stuff here...
}

Here is my web.xml file:

?xml version=1.0 encoding=ISO-8859-1?
web-app xmlns=http://java.sun.com/xml/ns/j2ee;
  

   


xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 

  
xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee 
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;

   version=2.4

   display-nameLaunches the REX
converter/display-name
   description
   Launches the REX converter
   /description

   servlet
   servlet-nameLaunchRex/servlet-name
   servlet-class
   rex.LaunchRex
   /servlet-class
   /servlet

   servlet-mapping
   servlet-nameLaunchRex/servlet-name
   url-pattern/LaunchRex/url-pattern
   /servlet-mapping

/web-app

I have stored LaunchRex.class in rex.jar file in the
lib directory of my 
webapp.  When I access

http://localhost:81/rex/LaunchRex I get this error:

javax.servlet.ServletException: Wrapper cannot find
servlet class rex.LaunchRex or a class it depends on


   


org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
 

   


org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
 

   


org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
 

   


org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:667)
 

   


org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
 

   


org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
 

   


org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
 


java.lang.Thread.run(Unknown Source)

I'm not sure where to look next. Help?

Thanks.

Thom Hehl
Heavyweight Software for Heavyweight Needs
www.heavyweightsoftware.com
   



Well, there isn't really a lot to go on here.  My
guess would be that you have put the class file in the
jar, but didn't put the package and class in the jar. 
Meaning: If you extract your jar using a zip utility

the top level would have simply LaunchRex.class when
it should have rex/LaunchRex.class.

Wade

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


 




Thom Hehl
Heavyweight Software for Heavyweight Needs
www.heavyweightsoftware.com
--
In every revolution, there is one man with a vision.--Jerome Bixby



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



Re: PreparedStatement w/ Connection Pooling

2006-01-13 Thread Khawaja Shams
Hello,
 Benchmarking is precisely what I am trying to do.  However, if I
prepare a statement every time I need to execute the statement, it would not
be an accurate measurement of optimizations that preparedStatements can
offer.  In fact, this would probably be worse than just executing the
statement once and for all.  This is why I am wondering if this is possible
so I can test for performance before integrating this with our solution.
PreparedStatement can POTENTIALLY offer a great deal of optimizations, if
used PROPERLY.
 Also, from what I have read so far, pre compiled statements do a very
nice job of preventing SQL Injections.  I am certainly open to hearing
better suggestions from you.  Although you sound like a manager, kindly note
that I am not your employee.

Sincerely,
Khawaja Shams


On 1/13/06, George Sexton [EMAIL PROTECTED] wrote:

 Let me just ask one simple question:

 Have you benchmarked your queries with prepared and unprepared statements
 to
 see if there is really a performance difference?

 Many people blindly follow common knowledge about performance, and this
 common knowledge is often wrong. People waste time and energy creating
 optimized solutions to issues that weren't broken.

 If you were my employee, I would first tell you to prove to me that there
 is
 a genuine difference, and that the difference was large enough to justify
 the additional maintainability/stability issues that might arise out of
 any
 solution.

 Lord Kelvin said:

 If you can not measure it, you can not improve it.


 George Sexton
 MH Software, Inc.
 http://www.mhsoftware.com/
 Voice: 303 438 9585


  -Original Message-
  From: Khawaja Shams [mailto:[EMAIL PROTECTED]
  Sent: Thursday, January 12, 2006 11:12 PM
  To: Tomcat Users List
  Subject: Re: PreparedStatement w/ Connection Pooling
 
  I am guessing the main attribute to change is the following:
poolPreparedStatements=true
 
  Suppose that this is set to true, how do I access these
  pooled statement? My
  setup is exactly as you described, so this modification seems
  minor, but I
  would appreciate guidance on how to get a hold of these
  pooled prepared
  statement.  Thanks for your help.
 
  Sincerely,
  Khawaja Shams
 
  On 1/12/06, Marc Richards [EMAIL PROTECTED] wrote:
  
   If you're already using pooling then I imagine you
   already have a resource defined for the pool in either
   server.xml or in the context xml file.  To pool
   prepared statements, which is desireable, you should
   configure it to look something like this in Tomcat
   5.5:
  
  
   Resource
   type=javax.sql.DataSource
   auth=container
   name=jdbc/cPool
   username=user
   password=pwd
  
   driverClassName=com.ibm.as400.access.AS400JDBCDriver
   url=jdbc:as400://serverName;extended
   dynamic=true;package
   library=pkgLib;package=pkgName;package
   add=true;package cache=true
   initialSize=5
   removeAbandoned=true
   removeAbandonedTimeout=600
   maxActive=0
   maxIdle=10
   minIdle=2
   maxWait=10
   poolPreparedStatements=true
   logAbandoned=false
   /
  
   Note that in this example I'm using an IBM iSeries DB2
   database driver, not my sql, but the rest of the
   config should be close to the same with the exception
   that on a production machine you'll want to have your
   initialSize, maxIdle and minIdle set much higher
   depending on the number of concurrent connections that
   you expect to make.
   Also note the url parameter - DB2's jdbc driver and
   database support dynamic package support with prepared
   statements, which can sometimes offer huge sql
   performance gains due to the system's ability to offer
   better optimization for prepared statements and cache
   the optimization so that the SQL optimizer need not be
   initialized for every subsequent statement.  I don't
   know if my sql supports this or not, but you would
   definitely want to look into it.
   Lastly, note that this configuration is only
   applicable to Tomcat 5.5 and possibly later versions.
   Tomcat 5.0 and previous require a different syntax,
   using a more structured xml format, which can be
   reviewed here:
  
  
  http://tomcat.apache.org/tomcat-5.0-doc/jndi-datasource-exampl
  es-howto.html
   The best possible database configuration is as
   described above - using connection pooling with
   prepared statements and SQL package support - in cases
   where stored procedures are more difficult to manage.
   Stored procedures work great when you have several
   queries that are required to run in sequence (and
   usually offer better performance in such cases), but
   may end up a tad overkill from a maintenance
   perspective when you have a few isolated queries here
   and there.
  
   -marc
  
  
  
  
   --- George Sexton [EMAIL PROTECTED] wrote:
  
Generally speaking, if you were using most SQL

Re: Changing default web apps

2006-01-13 Thread Khawaja Shams
Hello,
   this suggestion is a great short cut.  However, I have a datasource
defined in conf/Catalina/localhost/MyApp.xml.  Is there any way to access
this datasource without declaring it here? I tried declaring a global
datasource in server.xml, but the only way I figured out how to use it was
by putting a local reference to the resource in my local context. I would
aprpeciate any help.

Best Regards,
Khawaja Shams


On 1/12/06, Dennis Leary [EMAIL PROTECTED] wrote:

 The simplist way is to rename your app to ROOT. If read about creating a
 ROOT.xml in conf/Catalina/localhost and pointing the docbase to your
 webapp
 by I didn't have much luck with it.
 - Original Message -
 From: Marco Rossi [EMAIL PROTECTED]
 To: Tomcat Users List users@tomcat.apache.org
 Sent: Thursday, January 12, 2006 11:27 AM
 Subject: Re: Changing default web apps


  Ok for list archive
 
 http://wiki.apache.org/tomcat/HowTo#head-e82228c43a0ce77f71ebe64fc99ced33c9506ffe
 
 
 
  Marco Rossi [EMAIL PROTECTED] wrote: Hi all,
 
  I'm trying to deploy a single web app to serve a whole web site on port
  80. I'm able (finally:-) to use jsv to redirect port 80 to 8080, but I'm
  wish to chanche the default application that listen on port 8080.
 
  I noticed that the files to be server are coming from webapps/ROOT, how
  can I set as default webappas/MyApp/index.jsp in tomcat 5.5.12 ?
 
  Thanks
 
 
 
 
  -
  Yahoo! Photos
  Got holiday prints? See all the ways to get quality prints in your hands
  ASAP.
 
 
 
  -
  Yahoo! Photos
  Got holiday prints? See all the ways to get quality prints in your hands
  ASAP.


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




[Fwd: Re: Cannot find servlet]

2006-01-13 Thread Thom Hehl
I tried uncompressing the jar file into the classes directory, but it 
didn't change anything. Anyone have any ideas for me to look at? I don't 
know what's up.


Thom Hehl
Heavyweight Software for Heavyweight Needs
www.heavyweightsoftware.com
--
In every revolution, there is one man with a vision.--Jerome Bixby


---BeginMessage---
I verified this and the class is correctly stored in the jar. I'm really 
stumped on this one.


Wade Chandler wrote:


--- Thom Hehl [EMAIL PROTECTED] wrote:

 


Sigh, I don't know why I keep having problems like
this. I have the 
following servlet:


package rex;
/*
* Copyright 2006, Heavyweight Software. All rights
reserved.
*/

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.RequestDispatcher;

import rex.IdxFileConverter;

/**
* servlet to simply launch the rex conversion
process
*/
public final class LaunchRex extends HttpServlet
{
   Boring stuff here...
}

Here is my web.xml file:

?xml version=1.0 encoding=ISO-8859-1?
web-app xmlns=http://java.sun.com/xml/ns/j2ee;
  

   


xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 

  
xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee 
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;

   version=2.4

   display-nameLaunches the REX
converter/display-name
   description
   Launches the REX converter
   /description

   servlet
   servlet-nameLaunchRex/servlet-name
   servlet-class
   rex.LaunchRex
   /servlet-class
   /servlet

   servlet-mapping
   servlet-nameLaunchRex/servlet-name
   url-pattern/LaunchRex/url-pattern
   /servlet-mapping

/web-app

I have stored LaunchRex.class in rex.jar file in the
lib directory of my 
webapp.  When I access

http://localhost:81/rex/LaunchRex I get this error:

javax.servlet.ServletException: Wrapper cannot find
servlet class rex.LaunchRex or a class it depends on


   


org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
 

   


org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
 

   


org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
 

   


org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:667)
 

   


org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
 

   


org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
 

   


org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
 


java.lang.Thread.run(Unknown Source)

I'm not sure where to look next. Help?

Thanks.

Thom Hehl
Heavyweight Software for Heavyweight Needs
www.heavyweightsoftware.com
   



Well, there isn't really a lot to go on here.  My
guess would be that you have put the class file in the
jar, but didn't put the package and class in the jar. 
Meaning: If you extract your jar using a zip utility

the top level would have simply LaunchRex.class when
it should have rex/LaunchRex.class.

Wade

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


 




Thom Hehl
Heavyweight Software for Heavyweight Needs
www.heavyweightsoftware.com
--
In every revolution, there is one man with a vision.--Jerome Bixby




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

RE: Changing default web apps

2006-01-13 Thread Caldarale, Charles R
 From: Khawaja Shams [mailto:[EMAIL PROTECTED] 
 Subject: Re: Changing default web apps
 
 However, I have a datasource defined in
 conf/Catalina/localhost/MyApp.xml.
 Is there any way to access this datasource without 
 declaring it here?

Put your Context tag and everything inside it in
webapps/ROOT/META-INF/context.xml instead.

See near the end of:
http://tomcat.apache.org/tomcat-5.5-doc/config/context.html
for details.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

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



JK Apache2 Tomcat 5.0.28 Truncated Response

2006-01-13 Thread Ian Shafer

Hello,

I'm having trouble with my Apache2/Tomcat 5 via JK setup. Most  
requests are completed fine, but large requests (large is over 64K)  
are truncated. I get a variable amount of data back. I'm testing this  
using wget (a simple command line http client). When I go directly to  
Tomcat, I get all 128K of data back every time. When I go through  
Apache, I get a different amount of data back every time (I've seen  
between 68K and 105K).


I also have a stock version of Apache 1.3 on my OS X server, so I  
tested this out with that and everything worked fine. This leads me  
to believe that this is some issue with Apache2. (I'm not sure about  
all the versions that I was using in this test as I didn't install  
them.)


At first I thought this was a JkShmSize issue. So I jacked this way  
up. But that didn't fix the problem. (I also noticed that there were  
a number of examples on the web that tried to configure this  
directive using a string like '10M'. This doesn't work. Or should it?  
When I looked at the code, I saw that it reads the value using atoi,  
then multiplies by 1024.)


Here's what I've got:

Mac OS X 10.4.3
Apache 2.0.52 MPM
JK 2.0.14 (downloaded from http://www.apache.org/dist/tomcat/tomcat- 
connectors/jk/binaries/macosx/jk-1.2.14/jakarta-tomcat-connectors- 
jk-1.2.14-macosx-apache-2.0.54.so)


Tomcat config:

Connector port=8009 enableLookups=false
redirectPort=8443 debug=0 protocol=AJP/1.3/


Apache config:

JkWorkersFile /sw/etc/apache2/workers.properties
JkLogFile /sw/var/apache2/logs/jk.log
JkLogLevel info
JkLogStampFormat [%a %b %d %H:%M:%S %Y] 
JkShmFile /sw/var/apache2/run/jk.shm
JkShmSize 32768
JkMount /karta/* tomcat
JkMount /kartaadmin/* tomcat


Thanks for any help. I've been trying to figure tis one out for a few  
days now.


Ian


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



Environmental Variables set

2006-01-13 Thread Zach Moazeni

Hello,

In a Spring application that is being deployed to Tomcat I need to be able to load a file. The file 
resides in the /WEB-INF folder of the webapp. Is there any environmental variables I can be sure 
will be set so I can open a file relative to Tomcat? Things like catalina.home or 
catalina.base, or is there a better alternative?

Thanks for any and all input
-Zach


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



Re: [Fwd: Re: Cannot find servlet]

2006-01-13 Thread Thom Hehl
As we all suspected, I was, in fact, being an idiot. My lib directory 
was under the rex directory, not under rex/WEB-INF. I've been looking at 
this for hours and it just never sunk in.


Must be tired. Been a long week. Thanks!

Thom Hehl wrote:

I tried uncompressing the jar file into the classes directory, but it 
didn't change anything. Anyone have any ideas for me to look at? I 
don't know what's up.


Thom Hehl
Heavyweight Software for Heavyweight Needs
www.heavyweightsoftware.com



Subject:
Re: Cannot find servlet
From:
Thom Hehl [EMAIL PROTECTED]
Date:
Fri, 13 Jan 2006 14:44:13 -0500
To:
Tomcat Users List users@tomcat.apache.org

To:
Tomcat Users List users@tomcat.apache.org


I verified this and the class is correctly stored in the jar. I'm 
really stumped on this one.


Wade Chandler wrote:


--- Thom Hehl [EMAIL PROTECTED] wrote:

 


Sigh, I don't know why I keep having problems like
this. I have the following servlet:

package rex;
/*
* Copyright 2006, Heavyweight Software. All rights
reserved.
*/

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.RequestDispatcher;

import rex.IdxFileConverter;

/**
* servlet to simply launch the rex conversion
process
*/
public final class LaunchRex extends HttpServlet
{
   Boring stuff here...
}

Here is my web.xml file:

?xml version=1.0 encoding=ISO-8859-1?
web-app xmlns=http://java.sun.com/xml/ns/j2ee;
 
  


xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 

  xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee 
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;

   version=2.4

   display-nameLaunches the REX
converter/display-name
   description
   Launches the REX converter
   /description

   servlet
   servlet-nameLaunchRex/servlet-name
   servlet-class
   rex.LaunchRex
   /servlet-class
   /servlet

   servlet-mapping
   servlet-nameLaunchRex/servlet-name
   url-pattern/LaunchRex/url-pattern
   /servlet-mapping

/web-app

I have stored LaunchRex.class in rex.jar file in the
lib directory of my webapp.  When I access
http://localhost:81/rex/LaunchRex I get this error:

javax.servlet.ServletException: Wrapper cannot find
servlet class rex.LaunchRex or a class it depends on


  


org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) 

 

  


org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) 

 

  


org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) 

 

  


org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:667) 

 

  


org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) 

 

  


org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) 

 

  


org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) 

 


java.lang.Thread.run(Unknown Source)

I'm not sure where to look next. Help?

Thanks.

Thom Hehl
Heavyweight Software for Heavyweight Needs
www.heavyweightsoftware.com
  



Well, there isn't really a lot to go on here.  My
guess would be that you have put the class file in the
jar, but didn't put the package and class in the jar. Meaning: If you 
extract your jar using a zip utility

the top level would have simply LaunchRex.class when
it should have rex/LaunchRex.class.

Wade

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


 




Thom Hehl
Heavyweight Software for Heavyweight Needs
www.heavyweightsoftware.com



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




Thom Hehl
Heavyweight Software for Heavyweight Needs
www.heavyweightsoftware.com
--
In every revolution, there is one man with a vision.--Jerome Bixby



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



RE: PreparedStatement w/ Connection Pooling

2006-01-13 Thread GB Developer
I've looked at the CVS HEAD for PoolingConnection...
http://cvs.apache.org/viewcvs.cgi/jakarta-commons/dbcp/src/java/org/apache/c
ommons/dbcp/PoolingConnection.java?view=markup

public synchronized PreparedStatement prepareStatement(String sql) throws
SQLException {
try {
 
return(PreparedStatement)(_pstmtPool.borrowObject(createKey(sql)));


From this code, I surmise the following: 

When you do multiple calls to prepareStatement(foo), where 'foo' contains
the same SQL string, then the PoolingConnection object will automatically
give you back a previously pooled preparedstatement.  So the answer to you
question: how do I access these pooled statement? might be as simple as
don't worry about it, just use the prepareStatement() API and DBCP handles
it for you. 

I don't know for sure and you'll probably get more traction asking this
specific question on the commons-user email list. And uh.. I probably coulda
just started there...

http://marc.theaimsgroup.com/?l=jakarta-commons-userm=112975440702682w=2

 
 
   -Original Message-
   From: Khawaja Shams [mailto:[EMAIL PROTECTED]
   Sent: Thursday, January 12, 2006 11:12 PM
   To: Tomcat Users List
   Subject: Re: PreparedStatement w/ Connection Pooling
  
   I am guessing the main attribute to change is the following:
 poolPreparedStatements=true
  
   Suppose that this is set to true, how do I access these pooled 
   statement? My setup is exactly as you described, so this 
   modification seems minor, but I
   would appreciate guidance on how to get a hold of these
   pooled prepared
   statement.  Thanks for your help.
  
   Sincerely,
   Khawaja Shams
  


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



Secure Tomcat replication for WAN

2006-01-13 Thread Gmail User
Has anyone implemented some replication strategy for Tomcat on WAN. It
is my understanding that the regular replication mechanism that
broadcasts invitations over UDP is not very suitable for this as it
would broadcast to too many listeners as well as create a security
risks. Also, to the best of my knowledge a static list of listeners has
not been implemented yet.

I attempted to test replication via a SSH tunnel and setting the
replication address 127.0.0.1 yet different ports before, but somehow
could not make it work.

Has anyone implemented any workable solutions for this they are willing
to share? Or am I missing any recent development in Tomcat replication?
I am currently using 5.5.12 and soon will be using 5.5.15. Any ideas or
references would be greatly appreciated.


TIA,

Ed


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



RE: Small connection problems with JK 1.2.15 and IIS 5

2006-01-13 Thread br1
 Why do you have 30 workers?
 The worker should reflect a physical connection to the backend server.
 It would only make sense if you'd have 30 Tomcats behing.

Yes, I do, that's why I was asking.. :-)


 It depends on your client load, but I would say that 200 is more
 then enough for a single box and an average application.
 See: 
 http://people.apache.org/~mturk/docs/article/ftwai.html

Thanks a lot, 
br1.



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



Re: Unable to override doPut(), etc, from Tomcat's JSPServlet (response 403)

2006-01-13 Thread Ken Johanson

Tim Funk wrote:
You cannot add a doPut() to your servlet and excpect it to work. But in 
your JSP, you can do this:


// The following worked fine with tomcat 5.0.28 (plus unrelated patches)
if(PUT.equals(request.getMethod()) {
  /*put code*/
} else {
  /*not put code*/
}

JSP's declare Servlet.service() as final. Then they call _jspService() 
(which is created during JSP compilation). So doYYY() is never called.


-Tim



Well, I still agree about the method override... but as I test it now, I 
still get a 403 response, even if I intercept and dispatch PUT from 
inside the _jspService method... and it stands to reason that the 
request isn't even making it to the JSP's service method, if a 403 is 
being returned.. So something else is causing this behavior it seems. 
Perhaps tomcat 5 outright prohibits PUT and other methods from even 
getting to _jspService (or JspServlet in general)?? This wasn't the case 
in tomcat 4; it did allow me to do this..


Ken



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



Deploying New Context Descriptor from Within Webapp

2006-01-13 Thread Brandon Philips
Hello-

I am creating a first-run configuration wizard for a webapp; it would be
something similiar to OpenCMS' installer.

When first deployed the application has a minimal web.xml and
context.xml but after a user uses the setup form to enter their database
user name and passwords the web.xml and context.xml are updated.

The WEB-INF/web.xml seems to be reloaded by Tomcat just fine.  However
the META-INF/context.xml doesn't get re-read.  Thus the application is
unusable since my Realm and JNDI Datasource are missing.

To work around the issue I could write the context.xml directly to
Catalina/localhost/ however this solution seems like it would be brittle
since I am assuming the host and engine.

Is there a recommended way to reload or redeploy the context on a
running Tomcat instance?  Or a better solution to creating a setup
wizard that must setup Realm based auth?

Thanks,

Brandon

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



Re: PreparedStatement w/ Connection Pooling

2006-01-13 Thread Marc Richards
The primary performance benefit to be gained from
prepared statements is from the SQL package that some
DB systems support.  Your first step would be to
investigate this with your DB and find out if package
support is offered - if not, prepared statements will
probably offer you some organizational and security
benefit but little more.  
SQL package support works like so:  When a prepared
statement is passed to the DB the sql optimizer kicks
in and figures out the best way to run the query.  If
the query is a prepared statement rather then just an
SQL string, the optimizer takes a bit more time on
this procss to ensure that it's done it right.  Then
it writes the prepared statement and the optimization
results to a cache file where it will remain until the
optimizer decides that it requires updating.  On every
call afterward with the same prepared statement, the
optimizer doesn't need to kick in, it just uses the
optimization from the cache.  You definitely see a
performance gain when this happens, especially under
heavy load because that is the condition under which
memory and processing power are taxed and less
available for the optimizer.
Again, I use DB2 on iSeries and it supports SQL
packages but I don't know what other platforms (if
any) also support them.

To answer your original question, using the connection
pool once it is set up in Tomcat is as simple as
accessing the JNDI datasource within your code - dbcp
handles the rest for you automatically.  You will know
that you've done it correctly if you display network
resources and see only the number of connections to
the DB as you have configured for the pool.  However,
at Tomcat's startup you may see some additional
connections that Tomcat used to authenticate to the DB
if you have security set up and you may also see
another spare connection in there if you're using
session persistance to the same db.

So for example, if everything is working correctly, on
a Windows box you could do a netstat -a from cmd
prompt and see a list of open tcp connections (you can
do this on other platforms too, but I don't know the
exact syntax on any other then windows).  You should
see the name or IP address of your db in there several
times.  If you configured your pool to use 5 db
connections to start with, you should see 5
ESTABLISHED connections to the db.  If security is set
up you may also see several connections to the db on
TIME-WAIT (or some variant syntax).  These will go
away in a short time.
Now if you open a browser and click around your webapp
a few times, ensuring that you have caused some db
accesses you should be able to do netstat -a again and
still see only the same 5 connections as before.  If
there are more TIME-WAIT connections than there were
previously, something is wrong and connection pooling
is not being used properly.

-marc






--- Khawaja Shams [EMAIL PROTECTED] wrote:

 Hello,
  Benchmarking is precisely what I am trying to
 do.  However, if I
 prepare a statement every time I need to execute the
 statement, it would not
 be an accurate measurement of optimizations that
 preparedStatements can
 offer.  In fact, this would probably be worse than
 just executing the
 statement once and for all.  This is why I am
 wondering if this is possible
 so I can test for performance before integrating
 this with our solution.
 PreparedStatement can POTENTIALLY offer a great deal
 of optimizations, if
 used PROPERLY.
  Also, from what I have read so far, pre
 compiled statements do a very
 nice job of preventing SQL Injections.  I am
 certainly open to hearing
 better suggestions from you.  Although you sound
 like a manager, kindly note
 that I am not your employee.
 
 Sincerely,
 Khawaja Shams
 
 
 On 1/13/06, George Sexton [EMAIL PROTECTED]
 wrote:
 
  Let me just ask one simple question:
 
  Have you benchmarked your queries with prepared
 and unprepared statements
  to
  see if there is really a performance difference?
 
  Many people blindly follow common knowledge
 about performance, and this
  common knowledge is often wrong. People waste
 time and energy creating
  optimized solutions to issues that weren't
 broken.
 
  If you were my employee, I would first tell you to
 prove to me that there
  is
  a genuine difference, and that the difference was
 large enough to justify
  the additional maintainability/stability issues
 that might arise out of
  any
  solution.
 
  Lord Kelvin said:
 
  If you can not measure it, you can not improve
 it.
 
 
  George Sexton
  MH Software, Inc.
  http://www.mhsoftware.com/
  Voice: 303 438 9585
 
 
   -Original Message-
   From: Khawaja Shams [mailto:[EMAIL PROTECTED]
   Sent: Thursday, January 12, 2006 11:12 PM
   To: Tomcat Users List
   Subject: Re: PreparedStatement w/ Connection
 Pooling
  
   I am guessing the main attribute to change is
 the following:
 poolPreparedStatements=true
  
   Suppose that this is set to true, how do I
 access these
   pooled statement? My
   

RE: connection pooling mysql (Pool Exhausted exception)

2006-01-13 Thread Daniel Blumenthal
I received a similar (identical?) error when I was first starting up, and
the solution was to be very careful to ALWAYS close ResultSets.

ResultSet rset = stmt.executeQuery(select foo from bar where ID=7);
int foo = rset.getInt(1);
rset.close();

 -Original Message-
 From: Khawaja Shams [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, January 12, 2006 4:14 PM
 To: Tomcat Users List
 Subject: connection pooling mysql (Pool Exhausted exception)
 
 Hello,
I am consistently getting exceptions about my connection 
 pool being exhausted in my application.  I am curious where I 
 can configure the number of connections tomcat should 
 maintain in the connection pool.  Lastly, am I right in 
 assuming that the only thing I need to do in order to return 
 a connection to the pool is to return to close the 
 connection? Do I have to do anything about the statements I 
 have created using that connection? Thanks in advance.  for your help.
 
 
 Best Regards,
 Khawaja Shams
 



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



Re: Question reg. setting the environment variable

2006-01-13 Thread gupta vidhi
thanks for the great help.finally, i'd installed n currently running it 
successfully.
  i've one more query:
  previously i'd installed Tomcat 5.5 with jdk-1_5_0_02-windows-i586-p-iftw,but 
was facing many problems as everytime i run it on the localhost, everytime the 
page cannot be displayed problem was coming?kindly tell me why such kind of 
problem was arising and which version of jdk should be installed for it?
   
  Regards,
  Vidhi
vineesh kumar [EMAIL PROTECTED] wrote:
  which windows version u r using?
Usually u can right click on start-controlpanel- system
select the ADVANCED tab then click the environmental variables at the
bottom and enter ur calsspath and all

On 1/13/06, gupta vidhi wrote:
 hello,

 i'd installed jdk-1_5_0_02-windows-i586-p-iftw and jakarta-tomcat-4.1.31 on 
 desktop.but unable to set its required path.i request u to kindly help me out 
 for the same and starting my Tomcat.

 Regards,
 Vidhi


 -
 Yahoo! Photos
 Got holiday prints? See all the ways to get quality prints in your hands ASAP.


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

  



-
Yahoo! Photos
 Ring in the New Year with Photo Calendars. Add photos, events, holidays, 
whatever.

Re: Question reg. setting the environment variable

2006-01-13 Thread gupta vidhi
  thanks for the great help.finally, i'd installed n currently running it 
successfully.
  i've one more query:
  previously i'd installed Tomcat 5.5 with jdk-1_5_0_02-windows-i586-p-iftw,but 
was facing many problems as everytime i run it on the localhost, everytime the 
page cannot be displayed problem was coming?kindly tell me why such kind of 
problem was arising and which version of jdk should be installed for it?
   
  Regards,
  Vidhi
vineesh kumar [EMAIL PROTECTED] wrote:
  which windows version u r using?
Usually u can right click on start-controlpanel- system
select the ADVANCED tab then click the environmental variables at the
bottom and enter ur calsspath and all

On 1/13/06, gupta vidhi wrote:
 hello,

 i'd installed jdk-1_5_0_02-windows-i586-p-iftw and jakarta-tomcat-4.1.31 on 
 desktop.but unable to set its required path.i request u to kindly help me out 
 for the same and starting my Tomcat.

 Regards,
 Vidhi


 -
 Yahoo! Photos
 Got holiday prints? See all the ways to get quality prints in your hands ASAP.


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

  




-
Yahoo! Photos – Showcase holiday pictures in hardcover
 Photo Books. You design it and we’ll bind it!

Easiest Open Source Shopping Cart Fnctnlty to plug into Tomcat

2006-01-13 Thread Kyle

Hello folks

I was wondering whether someone can point me in the direction of some 
Open Source Shopping Cart type functionality I can easily plug-in to 
Tomcat and integrate into a site please?


I found a few on Google, but have no idea which does what and how 
complex , etc.


Can you offer guidance please?
--

Kind Regards

Kyle


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



Re: Unable to override doPut(), etc, from Tomcat's JSPServlet (response 403)

2006-01-13 Thread Ken Johanson





There's a comment in the web.xml settings for the default servlet:

!-- readonly  Is this context read only, so HTTP --
!--   commands like PUT and DELETE are --
!--   rejected?  [true]--

Is there any possibility that you're actually getting into the default
servlet rather than your own?

 - Chuck



Yes Sir, that was the answer!! It works in write-mode now.

Apparently that setting must be made on the DefaultServlet. I didn't 
think it would be required since I'm not 'defaulting'  per se to that 
servlet, and based on its description (below) - I'd figured that 
declaring that readonly=false init param should work as an init config 
to JspServlet, though it did not. I'd misjudged the role of the 
DefaultServlet..


I guess the part that threw me (and may deserve some clarification / 
emphasis since there's a security context controlled by it) was the part 
where it says:


The default servlet for all web applications, that serves static 
resources.  It processes all requests that are not mapped to other 
servlets with servlet mappings (defined either here or in your own 
web.xml file


The possibly misleading parts are serves static resources (should be 
static and dynamic?) and processes requests not mapped to another 
servlet with servlet mappings (but JspServlet is handling jsps, yet 
depends on this).. Should these observations be forwarded on to some 
particular tomcat developer?


Again, thank you _very_ much for the pointer to DefaultServlet!!

Best,
Ken



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



How do you debug Authentication Problems

2006-01-13 Thread Alan Chandler
I have tomcat4 fronted by apache2 and linked via mod_jk.

I am running well with basic applications, but up until now I have been 
manually loading applications.

I tried to use the manager application, and it is asking me to authenticate 
myself.  I have added myself into the manager role in the tomcat-users, but I 
get into a loop of authentication failures.

As a TEMPORARY measure, I have added the authentication into the Apache 
configuration (inside a Location directive and removed it from the web.xml 
of the manager application.

And that works.

 There is nothing in any of my standardly configured logs to indicate what is 
happening.   But, given this effect of getting it to work when I delegate 
security control to Apache,  I suspect that the front ending of tomcat with 
apache is playing some effect on the failures. It also explains why I could 
never get my application with user login to work and had to give up trying to 
build authentication into a web app. 

But what is the problem? and how do I debug this to get a clear picture of 
what is happening? 

Surely others have had the same issues  - front ending Tomcat with apache must 
be a relatively frequent configuration - and have overcome them.
-- 
Alan Chandler
http://www.chandlerfamily.org.uk
Open Source. It's the difference between trust and antitrust.

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