Re: Invoke methods in EL?

2017-04-10 Thread Tim Watts
Thanks Mark.  That does help.

On Mon, 2017-04-10 at 23:24 +0100, Mark Thomas wrote:
> On 10/04/17 16:35, Tim Watts wrote:
> > Environment: Tomcat 7.0.59; JRE 1.8.0_72
> > 
> > I suspect the answer to my problem is "You can't do that" but here goes:
> > 
> > A simple JSP that tries to get a Calendar instance and outputs the year:
> > 
> > <%@ page language="java" 
> > contentType="text/html; 
> > charset=UTF-8" pageEncoding="UTF-8"%>
> > <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"; %>
> > 
> > 
> > 
> > 
> > 
> > The year is ${ Y }
> > 
> > 
> > 
> > This presents a page that just says "The year is" but no year value.  Is
> > there some syntactical mojo I'm missing or is my best alternative to
> > resort to a scriptlet?  
> > 
> > (And for context, I actually want to do something along these lines in a
> > tag file.)
> 
> You can do something like that but...
> 
> You'll need EL 3.0 which means Tomcat 8 minimum. I recommend 8.5.x in
> preference to 8.0.x.
> 
> EL doesn't let you specify the package in the expression. You have to
> explicitly import. With Tomcat, if you import the class into the JSP
> page that automatically imports it into the EL expression. (Whether
> Tomcat should do this or not is an open question with the EL Expert Group.)
> 
> Then factor in that EL only lets you reference static methods and fields
> on concrete classes (which means you can't use Calendar since it is
> abstract) and you get:
> 
> 
> <%@ page language="java"
> import="java.util.Calendar,java.util.GregorianCalendar"
> contentType="text/html;charset=UTF-8"
> pageEncoding="UTF-8"%>
> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"; %>
> 
> 
> 
> 
> 
> The year is ${ Y }
> 
> 
> 
> 
> Drop the above test into a JSP page in the examples web application in
> Tomcat 8 onwards and you'll get the output you are looking for.
> 
> Note I tested this with 9.0.x but 8.x should behave the same way.
> 
> HTH,
> 
> Mark
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Invoke methods in EL?

2017-04-10 Thread Tim Watts
Environment: Tomcat 7.0.59; JRE 1.8.0_72

I suspect the answer to my problem is "You can't do that" but here goes:

A simple JSP that tries to get a Calendar instance and outputs the year:

<%@ page language="java" 
contentType="text/html; 
charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"; %>





The year is ${ Y }



This presents a page that just says "The year is" but no year value.  Is
there some syntactical mojo I'm missing or is my best alternative to
resort to a scriptlet?  

(And for context, I actually want to do something along these lines in a
tag file.)



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Connection reset while trying to access a web service running under Tomcat

2017-02-23 Thread Tim Watts
On Fri, 2017-02-24 at 01:08 +0100, André Warnier (tomcat) wrote:
> On 24.02.2017 00:57, James H. H. Lampert wrote:
> > On 2/23/17, 3:13 PM, André Warnier (tomcat) wrote:
> >> It seems to say right up here what the problem is : the customer system
> >> cannot establish a HTTPS connection with your server. The connection
> >> attempt starts, but then your server rejects it and closes the connection.
> >> Maybe they cannot agree on a common SSL protocol ?
> > . . .
> >
> > Is there a diagnostic setting I can apply to the Tomcat server, that would 
> > shed any light
> > on what's happening?
> >
> 
> Probably, if you set the log level high enough. Unfortunately, the tomcat 
> logging 
> configuration is also not really my thing.
> One expert in these matters on this list is Christopher, but he seems to get 
> list emails 
> after some delay. So have a little patience, and you'll probably be helped.
> In the meantime, there is always the helpful on-line tomcat documentation 
> which you could try.
> http://tomcat.apache.org/tomcat-8.0-doc/logging.html
> 

In addition, you might want to indicate what HTTP Connector and SSL
stack you're using. Pure Java/JSSE? Native/OpenSSL?  I believe the
logging tweaks will be different for these.

> 
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Error 404 - The requested resource is not available

2017-01-11 Thread Tim Watts
On Wed, 2017-01-11 at 15:49 -0600, fonsin2008 . wrote:
> Hi all!
> 
> First, I need to say that I'm new(ignorant) with Tomcat. One of our
> systems is written with tomcat, but today something went wrong and the
> following error appears on the webpage:
> 
> --Estado HTTP 404 - /evaluacion/WEB-INF/pages/login/forma_login.jsp
> --__
> --type Informe de estado
> --mensaje /evaluacion/WEB-INF/pages/login/forma_login.jsp
> --descripción El recurso requerido no está disponible.
> --
> --Apache Tomcat/6.0.37
> 
> The file exists on the virtualserver, at
> 
> home/desarrollo/produccioncbi/virtualhost/cbi_desarrollo/evaluacion/WEB-INF/pages/login
> 
> And:
> ls -l
> -rw-r--r-- 1  desarrollo 3744 feb 11  2015 forma_login.jsp
> 
> the evaluacion.war file lives at
> /home/desarrollo/produccioncbi/virtualhost/cbi_desarrollo
> 
> And in /WEB-INF/classes/struts.xm I found:
> ./WEB-INF/classes/struts.xml:   name="forma_login">/WEB-INF/pages/login/forma_login.jsp
> 
> So, I can't figure out why this error appears. May be I'm missing
> something obvious. I also googled it, but I only found permission
> errors and wrong paths.
> 
> If you need some additional information, feel free to ask.
> 

What URL was used to produce the error message?

Since you're unfamiliar with Tomcat, and presumably Servlet based web
applications, you need to know that /WEB-INF and anything below it is
inaccessible outside the web app; it's only accessible from within the
web app.  So if you issued a URL like:

http://some-host/evaluacion/WEB-INF/pages/login/forma_login.jsp

You will unsurprisingly get the 404 error.

If this is the case then your task is to learn more about the specifics
of your application and what the proper login URL is.  Looks like it's
built with Struts so you may need to learn about that -- starting with
what version was used.

-- Tim.


> Thank you guys for your time!
> 
> Jesus Mager
> [www.h1n1-al.blogspot.com]
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: tomcat8 unable to load the Resource/property file from jar

2016-09-14 Thread Tim Watts
On Wed, 2016-09-14 at 11:54 +, Venkata Reddy P wrote:
> Thanks Chris for replying. 
> 
> I have tried placing all the jars into webapps/auth/web-inf/lib
> folder but still getting the null value.
> 
You mean WEB-INF/lib not web-inf/lib, right?  Case matters.


> Is there any way to confirm the property file in tomcat classpath?
> 
> Many Thanks.
> -Original Message-
> From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
> Sent: Monday, September 12, 2016 2:39 AM
> To: Tomcat Users List
> Subject: Re: tomcat8 unable to load the Resource/property file from jar
> 
> Venkata,
> 
> On 9/9/16 2:48 PM, Venkata Reddy P wrote:
> > These jars are deployed in common folder to make use of my two web 
> > applications. I have modified the catalina.properties file to load 
> > these jars by tomcat server.
> 
> What happens if you put those JAR files separately into each web application?
> 
> I would expect the code as presented to work, but it's worth trying.
> And much easier to deal with than a complicated deployment where you need to 
> stash things in Tomcat's common classloader.
> 
> -chris
> 
> > -Original Message- From: Christopher Schultz 
> > [mailto:ch...@christopherschultz.net] Sent: 10 September 2016
> > 00:08 To: Tomcat Users List Subject: Re: tomcat8 unable to load the 
> > Resource/property file from jar
> > 
> > Venkata,
> > 
> > On 9/9/16 5:18 AM, Venkata Reddy P wrote:
> >> I have tried it and still getting the null value. URL url = 
> >> Auth.class.getClassLoader().getResource("/com/trianz/auth/auth.proper
> t
> >
> >> 
> ies");
> > 
> >> The Auth.java is part of other jar called tools.jar
> > 
> >> My jars: 1)auth.jar com/trianz/auth/*.java 
> >> com/trianz/auth/auth.properties
> > 
> >> 2)tools.jar com/trianz/tools /Auth.java com/trianz/tools/*.properties
> > 
> >> Many thanks for the response.
> > 
> > And where are those .jar files located?
> > 
> > -chris
> > 
> >> -Original Message- From: Christopher Schultz 
> >> [mailto:ch...@christopherschultz.net] Sent: Thursday, September 08, 
> >> 2016 8:33 PM To: Tomcat Users List Subject: Re: tomcat8 unable to 
> >> load the Resource/property file from jar
> > 
> >> Venkata,
> > 
> >> On 9/7/16 4:49 AM, Venkata Reddy P wrote:
> >>> Recently we have upgraded the one of application from tomcat6.x to 
> >>> tomcat8.0.36 version. In tomcat6, i was able to read the 
> >>> property/resource file from the jar file but certain reasons after 
> >>> upgrading to the tomca8.0.36 its failing to load.
> > 
> >>> My jar: auth.jar com/trianz/auth/*.java 
> >>> com/trianz/auth/auth.properties
> > 
> >>> //failing code, here url always getting null value. URL  url =
> >>>  
> >>> Auth.class.getClassLoader().getResource("com/trianz/auth/auth.proper
> t
> >
> >>> 
> i
> > 
> >>> 
> > es");
> > 
> >>> I am sure by looking at the tomcat catalina.startup logs the 
> >>> auth.jar is loading properly Is there any way to confirm the file in 
> >>> classpath "com/trianz/auth/auth.properties"? How do I fix this?
> > 
> >>> Many Thanks in advance.
> > 
> >> Can you try reading the file like this:
> > 
> >> URL url =
> >> Auth.class.getClassLoader().getResource("/com/trianz/auth/auth.proper
> t
> >
> >> 
> ie
> > 
> > 
> > s")
> > 
> >> ? (note the leading "/")
> > 
> >> Also, from where is the Auth class being loaded? Where is auth.jar 
> >> located?
> > 
> >> -chris
> > 
> >> -
> >
> >> 
> > 
> > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> >> For additional commands, e-mail: users-h...@tomcat.apache.org
> > 
> > 
> >> -
> >
> >> 
> > 
> > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> >> For additional commands, e-mail: users-h...@tomcat.apache.org
> > 
> > 
> > -
> >
> > 
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> > For additional commands, e-mail: users-h...@tomcat.apache.org
> > 
> > 
> > -
> >
> > 
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> > For additional commands, e-mail: users-h...@tomcat.apache.org
> > 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: How to write a correct HTTP request to Tomcat 8.5.4 instance?

2016-09-05 Thread Tim Watts
On Mon, 2016-09-05 at 14:11 +0200, Klemens Muthmann wrote:
> Hi,
> 
> I currently need to implement an HTTP data transmission from an Arduino
> with WiFi module to a PC running a Tomcat 8.5.4 instance. The Tomcat is
> running under Ubuntu 16.04.
> 
> The problem is that, since there are no HTTP libraries on Arduino, I
> need to write the correct HTTP request myself and I got stuck. It would
> be great if someone on the list with a deeper understanding of the HTTP
> protocol would be willing to support me.
> The transmitted (possibly erroneous ) request looks like:
> 
> 
> GET /push?VIN=testrun HTTP/1.1
> User-Agent: Freematics
> Connection: keep-alive
> Host:
> 
> 
> The server runs under a local access point IP (10.42.0.1) and receives
> that request correctly but throws me an EOFException from the following
> code fragment:
> 
>  nRead = channel.read(socketBufferHandler.getReadBuffer());
> if (nRead == -1) {
> throw new EOFException();
> }
> 
> So it seems to me that an end of file is reached before it is expected.
> Can somebody provide me with hints on how to solve that issue and
> formulate a correct HTTP request to my Tomcat instance?
> 
> The following is th log trace I receive from the server:
> 
> 2016-09-05 13:32:50.238 DEBUG 13143 --- [nio-8080-exec-1]
> o.a.coyote.http11.Http11InputBuffer  : Received [GET
> /push?VIN=testrun HTTP/1.1
> User-Agent: Freematics
> Connection: keep-alive
> Host:
> 
> ]

Until a real expert comes along with a better answer let me just toss
this out:  Are the lines in the HTTP request that the Arduino submits
terminated with \r\n (and not just \n)?  Because it looks like the
entire request may have been read when reading the request line.  Then
when it goes to read the headers it gets an EOF.  Not 100% sure of this
but it's possible.


> 2016-09-05 13:32:50.238 DEBUG 13143 --- [nio-8080-exec-1]
> o.a.c.authenticator.AuthenticatorBase: Security checking request GET
> /push
> 2016-09-05 13:32:50.238 DEBUG 13143 --- [nio-8080-exec-1]
> org.apache.catalina.realm.RealmBase  :   No applicable constraints
> defined
> 2016-09-05 13:32:50.238 DEBUG 13143 --- [nio-8080-exec-1]
> o.a.c.authenticator.AuthenticatorBase:  Not subject to any constraint
> 2016-09-05 13:32:50.238 DEBUG 13143 --- [nio-8080-exec-1]
> org.apache.tomcat.util.http.Parameters   : Set encoding to UTF-8
> 2016-09-05 13:32:50.238 DEBUG 13143 --- [nio-8080-exec-1]
> org.apache.tomcat.util.http.Parameters   : Decoding query null UTF-8
> 2016-09-05 13:32:50.238 DEBUG 13143 --- [nio-8080-exec-1]
> org.apache.tomcat.util.http.Parameters   : Start processing with input
> [VIN=testrun]
> 2016-09-05 13:32:50.238 DEBUG 13143 --- [nio-8080-exec-1]
> o.s.b.w.f.OrderedRequestContextFilter: Bound request context to
> thread: org.apache.catalina.connector.RequestFacade@75c83bc4
> 2016-09-05 13:32:50.238 DEBUG 13143 --- [nio-8080-exec-1]
> o.s.web.servlet.DispatcherServlet: DispatcherServlet with name
> 'dispatcherServlet' processing GET request for [/push]
> 2016-09-05 13:32:50.238 DEBUG 13143 --- [nio-8080-exec-1]
> s.w.s.m.m.a.RequestMappingHandlerMapping : Looking up handler method for
> path /push
> 2016-09-05 13:32:50.238 DEBUG 13143 --- [nio-8080-exec-1]
> s.w.s.m.m.a.RequestMappingHandlerMapping : Returning handler method
> [public void de.cyface.obd2.controller.Obd2Controller.push()]
> 2016-09-05 13:32:50.238 DEBUG 13143 --- [nio-8080-exec-1]
> o.s.b.f.s.DefaultListableBeanFactory : Returning cached instance of
> singleton bean 'obd2Controller'
> 2016-09-05 13:32:50.238 DEBUG 13143 --- [nio-8080-exec-1]
> o.s.web.servlet.DispatcherServlet: Last-Modified value for
> [/push] is: -1
> push
> 2016-09-05 13:32:50.239 DEBUG 13143 --- [nio-8080-exec-1]
> o.s.web.servlet.DispatcherServlet: Null ModelAndView returned to
> DispatcherServlet with name 'dispatcherServlet': assuming HandlerAdapter
> completed request handling
> 2016-09-05 13:32:50.239 DEBUG 13143 --- [nio-8080-exec-1]
> o.s.web.servlet.DispatcherServlet: Successfully completed request
> 2016-09-05 13:32:50.239 DEBUG 13143 --- [nio-8080-exec-1]
> o.s.b.w.f.OrderedRequestContextFilter: Cleared thread-bound request
> context: org.apache.catalina.connector.RequestFacade@75c83bc4
> 2016-09-05 13:32:50.239 DEBUG 13143 --- [nio-8080-exec-1]
> o.apache.coyote.http11.Http11Processor   : Socket:
> [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@2940dec1:org.apache.tomcat.util.net.NioChannel@34a92297:java.nio.channels.SocketChannel[connected
> local=/10.42.0.1:8080 remote=/10.42.0.72:46701]], Status in:
> [OPEN_READ], State out: [OPEN]
> 2016-09-05 13:32:55.280 DEBUG 13143 --- [nio-8080-exec-2]
> o.apache.coyote.http11.Http11Processor   : Error parsing HTTP request header
> 
> java.io.EOFException: null
> at
> org.apache.tomcat.util.net.NioEndpoint$NioSocketWrappe

Re: OT if/else or not if/else

2016-04-22 Thread Tim Watts
On Fri, 2016-04-22 at 17:34 +0100, Mark Thomas wrote:
> On 22/04/2016 17:24, Leon Rosenberg wrote:
> > Lets say I have three possible conditions, A, B and C, which are exclusive.
> > My native approach would be:
> > if (A){...}
> > if (B){...}
> > if (C){...}
> > 
> > now some people would 'optimize' it as
> > if (A){ ...} else if (B) {} else if (C) { }
> > and I think in the world of single-cpu computers this optimization could
> > work.
> > 

> As an aside, why can't the compile optimize to test the three conditions
> in parallel with the "else if"?

Actually, I would think the compiler could do a parallel optimization
for "if else" but more likely could NOT for a series of "if"s as often
only the programmer knows whether the "if" series is mutually exclusive.

> 
> Mark
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Multiple domian names one web site different content

2016-03-04 Thread Tim Watts
On Fri, 2016-03-04 at 21:46 +0100, Jose María Zaragoza wrote:
> Maybe my question does't have to do with current thread ( an probably
> doesn't have any sense at all) but :
> 
> would be possible to define "VirtualHost" according the destination port ?
> I know that VirtualHost diferent domain name, but i want to keep the
> same domain name
> and to define
> 2 connectors , listening on 8080 and 8081
> Requests to 8080 go to /webapps-app1 and requests to 8081 go to /webapps-app2
> 

Is there an implied requirement that host:8080/webapp1 should be
serviced ONLY on 8080 and likewise for 8081/webapp2?  If so I think a
config along these lines would work:

















where ${app-base1} and ${app-base2} are distinct non-nested directories
and webapp1 and webapp2 are located within the respective app-bases.

But read the Configuration reference for details.

http://tomcat.apache.org/tomcat-8.0-doc/config/ Depending on which
version of Tomcat you're using.


> is it possible in a only one Tomcat instance ? or  I need to configure
> 2 tomcat instances ?
> 
> Thanks and regards
> 
> 
> 
> 
> 
> 
> 2016-03-04 19:11 GMT+01:00 Christopher Schultz :
> > -BEGIN PGP SIGNED MESSAGE-
> > Hash: SHA1
> >
> > Andrew,
> >
> > On 3/4/16 7:44 AM, Andrew Hardy wrote:
> >> New to web servers.
> >
> > Welcome.
> >
> >> This may be a spring MVC question rather than tomcat, I'm not
> >> sure.
> >>
> >> I understand I can map multiple domains to a single ip address
> >> using DNS.  I have read some stuff on how to set up multiple
> >> virtual hosts on the same host (ip address) on tomcat which
> >> requests can be diverted to depending on which domain name was used
> >> to make the request.
> >>
> >> Alternatively I am wondering about not having multiple virtual
> >> hosts (which I am guessing would be more useful if there was
> >> significant difference between between the sites) but have a single
> >> site which has a single layout structure etc but serves up
> >> specifically tailored content from a selected content store BASED
> >> on the domain used to make the request.
> >>
> >> Is this anything to do with tomcat or do I have to some how tell
> >> which domain was used when the http session is begun and set which
> >> content at that point using spring MVC.  Perhaps the (first)
> >> request / session includes the domain used and I so need to access
> >> that programatically?
> >
> > You mean one single instance of the application that handles the
> > hostname of the request to make decisions? Sounds good, and doesn't
> > really involve Tomcat.
> >
> > If you have a session contained in a single web application, you could
> > either store the initial server hostname in the session and use that
> > until the session ends, or you could always pull the hostname from
> > each incoming request. Presumably, it won't be changing. Or, you could
> > cross-check those hostnames and maybe change configuration or complain
> > and log the user out in that event.
> >
> > Again, not much to do with Tomcat, which will just route all
> > appropriate requests to your application.
> >
> >> Is there a reason for this situation that I should not do things
> >> the way I suggest? but should use multiple "identical duplicate"
> >> web sites (virtual hosts) apart from each of which being hard coded
> >> to access a specific content store?
> >
> > For me, it always comes down to complexity. If you know you can do
> > this with a webapp-per-domain, then that's certainly a possibility but
> > you'll need more heap space for multiple web applications, and so you
> > might not scale as well.
> >
> > On the other hand, you may have to significantly re-work your web
> > application to be able to handle one-single-webapp that can
> > auto-switch configuration based upon the client's server-hostname. If
> > that's the case, then running a single-application represents more
> > risk -- at least for now.
> >
> > If I were designing things from scratch and I knew I'd be supporting
> > marge numbers of configurations, I'd go with the
> > single-webapp-instance approach because it's more scalable.
> >
> > - -chris
> > -BEGIN PGP SIGNATURE-
> > Comment: GPGTools - http://gpgtools.org
> > Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
> >
> > iEYEARECAAYFAlbZz9oACgkQ9CaO5/Lv0PD0mQCfShH1CZqKimD+mwBpOJimFMvt
> > qpgAni7S3D76ekXUrChiIfHZKRisUOsK
> > =jNpf
> > -END PGP SIGNATURE-
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> > For additional commands, e-mail: users-h...@tomcat.apache.org
> >
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail

Re: Is there a way for code running on Tomcat 7+ to determine the URL of the Web App it's running under?

2016-02-16 Thread Tim Watts
On Tue, 2016-02-16 at 14:31 -0500, Christopher Schultz wrote:

> On 2/16/16 11:50 AM, Dougherty, Gregory T., M.S. wrote:
> > I completely and totally trust my servlet with my data.  I do not 
> > in the least bit trust any other servlet running on that Tomcat 
> > instance.
> 
> Then those servlets shouldn't be deployed into the same application.
> Possibly not even within the same JVM. But okay, let's ignore that
> lack of safety for the time being. We're ignoring all kinds of other
> things as well, so one more doesn't matter.
> 

If I may interject: I think part of the problem here is the OP is using
"servlet" and "webapp" interchangably.  He originally used the term
webapp but then switched to servlet around the time he laid out this
authentication solution.



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Is there a way for code running on Tomcat 7+ to determine the URL of the Web App it's running under?

2016-02-12 Thread Tim Watts
On Fri, 2016-02-12 at 20:35 +, Dougherty, Gregory T., M.S. wrote:
> You are correct, I¹m trying to authorize the web app, not the user.
> 
> Goal: I am trying to come up with a way for a Tomcat app to securely store
> and retrieve the password it needs to access a DB.
> 
> My definition of ³secure² includes ³there exist no files with an
> unencrypted copy of the password².  IIUC, JNDI fails this test.
> 
> My requirements include that all web app components are checked in to a
> source control system that malicious users can have read access to.
> 
> Solution:
> 1: Trusted user creates public:private key pair (1), distributes public key
> 2: Web app developer creates pubic:private key pair (2), distributes
> public key
> 3: Web app developer encrypted password with private key 2, then public
> key 1, stores with web app
> 4: Web app calls decryption jar that¹s in tomcat/lib, passing in the
> encrypted password from step 3
> 5: Decryption code determines which app called it, pulls the public key
> (3) saved for that app
> 6: Decryption code decrypts with private key 1, public key 3, and returns
> the unencrypted password.
> 
> So long as 1: Trusted user can store private key where it¹s secure, but
> accessible to decryption code

Since the webapps all run in the same tomcat and therefore under the
same OS user account, how do you ensure that *only* the decryption code
can access the private key?  Otherwise, any webapp could decrypt any
other webapp's password.


> , and 2: Can correctly determine the calling
> app, I believe this setup is secure.
> 
> We log who uploads the web apps, so if user X uploads a bogus ³User Y
> App², we can deal with that.



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: the session tracking of tomcat 6 and tomcat 7 behaves strangely

2015-06-24 Thread Tim Watts
On Wed, 2015-06-24 at 11:55 +0200, André Warnier wrote:
> Hi.
> 
> Hi.
> 
> The recommendation on this forum is to not use "top posting", but to keep the 
> flow of 
> conversation natural, and respond below the question to which your question 
> refers.
> See http://tomcat.apache.org/lists.html, "Important", 6)
> I have modified you latest post accordingly below.
> 
> chedana jayasinghe wrote:
> > On Tue, Jun 23, 2015 at 2:46 PM, André Warnier  wrote:
> > 
> >> chedana jayasinghe wrote:
> >>
> >>> In my web application, in a jsp there is a javascript which sends request
> >>> to a servlet every twenty seconds, so it kills my  applications user idle
> >>> time tracking by resetting the  lastAccessed time in session. the funny
> >>> thing is lastAccessed time doesn't get updated in tomcat  6 and my
> >>> applications idle time tracking works fine in it, but in 7 it gets updated
> >>> and kills that functionality of the application . so I'm little bit
> >>> confused about the changes in the session tracking of tomcat 6 and tomcat
> >>> 7.
> >>>
> >>>
> >> I don't know what happened in Tomcat 6 as compared to what happens in
> >> other versions.
> >> But from a purely logical point of view, I would tend to think that, from
> >> the server point of view, whether a request comes from the user pressing a
> >> button or from a javascript module in a page sending a request, does not
> >> make a difference : the application has been accessed, so the "last
> >> accessed time" should be updated.
> >> That is probably the point even, of many such javascript snippets out
> >> there in the wild.
> >>
> >> So again from a purely logical point of view, if Tomcat 6 then did not
> >> update the last access time, that would sound more like a bug, that was
> >> corrected later.
> >>
> >> Maybe the fact that it updates this or not, depends on whether the
> >> application that is called retrieves the session or not, and if so you may
> >> have control over it, by making sure that whatever your javascript calls,
> >> it does /not/ retrieve the session.
> >>
> >> Caveat : I do not really /know/ how it works, so there is a lot of
> >> speculation here.
> >>
> 
>  > I just put a debug point an checked. In tomcat 6,the request comes to the
>  > servlet with a null session,but in  tomcat 7 and later versions  the  valid
>  > session is there in the request
>  >
> 
> Yes, but the /call/ that contains this jsession-id, comes from the javascript 
> that is in 
> the HTML page currently shown in the browser.
> So the question is : why does that /call/, now, contain this jsessionid 
> parameter, when 
> under Tomcat 6 it did not ?
> 
> Or to put this another way : how does the local javascript in the browser 
> *know* this 
> jsession-id ?
> 
> Or in yet another way : the javascript in the browser does not /know/ if it 
> is talking to 
> a Tomcat 6 or a Tomcat 7 or a Tomcat 8 server, right ? So how comes that in 
> one case, it 
> sends a request /without/ a jsessionid, and in the other cases /with/ a 
> jsessionid ?
> 
Haven't been following this thread too closely, so ignore this if it's a
total non sequitur,  but perhaps TC6 does NOT mark the cookie as
HttpOnly while later versions do?

> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: ClassNotFoundException - Involving a class implementing Filter and two projects depending on another one

2015-03-29 Thread Tim Watts
On Sun, 2015-03-29 at 12:56 -0400, Tim Watts wrote:
> On Sun, 2015-03-29 at 18:06 +0200, Lmhelp1 wrote:
> > On 3/29/2015 5:36 PM, André Warnier [via Tomcat] wrote:
> > > Lmhelp1 wrote:
> > >
> > > > Hello,
> > > >
> > > > Thank you for reading my post.
> > > >
> > > > I am getting a "ClassNotFoundException".
> > > >
> > > > Below is the situation.
> > > > - I'm working with "Eclipse" ("Luna"), "Tomcat 8" and "Java 8".
> > > > - I have three projects "project1", "project2" and "project3".
> > > > - "project1" and "project2" depend on the third project "project3".
> > > >   In "Project -> Properties -> Java Build Path -> Projects", I added
> > > > "project3" for both projects "project1" and "project2".
> > > > - "project3" is a "Java project".
> > > > - "project1" and "project2" are "Dynamic Web Projects".
> > > > - "project3" defines the class "MyFilter" which implements "Filter" and
> > > > which I put in the package "my.package".
> > > > - "project1" contains a "web.xml" file which contains the following
> > > > elements:
> > > >   [...]
> > > >   
> > > > MyFilter
> > > > my.package.MyFilter
> > > > 
> > > >   requestEncoding
> > > >   UTF-8
> > > > 
> > > >   
> > > >   
> > > > MyFilter
> > > > /*
> > > >   
> > > >   [...]
> > > > - "project2" contains a "web.xml" file which contains the following
> > > > elements (same as in "project 1"):
> > > >   [...]
> > > >   
> > > > MyFilter
> > > > my.package.MyFilter
> > > > 
> > > >   requestEncoding
> > > >   UTF-8
> > > > 
> > > >   
> > > >   
> > > > MyFilter
> > > > /*
> > > >   
> > > >   [...]
> > > >
> > > > When running a JSP of "project1" on the "Tomcat" server, I get the 
> > > error:
> > > > SEVERE: Exception starting filter MyFilter
> > > > java.lang.ClassNotFoundException: my.package.MyFilter
> > > >
> > > > There are no errors at build time.
> > > >
> > > > I just would like to mention that I'm working with "Tomcat 8" for the
> > > > first time.
> > > > It used to work with "Tomcat 7" but I might have done something more to
> > > > make it work... I don't remember what...
> > > >
> > > > What can I do to solve that problem?
> > > > Please let me know if you need additional information or if I'm not
> > > > clear enough.
> > > >
> > >
> > > I do not really know how to translate this for Eclipse but if this was 
> > > a stand-alone
> > > Tomcat, the way you describe it above, project1 and project2 (when 
> > > deployed) should also
> > > have the class available under their respective
> > > (catalina_base)/webapps/projectX/WEB-INF/classes/ directory (or 
> > > /WEB-INF/classes/lib/, if
> > > in a jar). Is it the case ?
> > 
> > Thank you for your answer.
> > 
> > No, it is not the case.
> > - There are no ".class" files from "project3" under "classes" 
> > directories for the two projects "project1" and "project2".
> > - I didn't make a ".jar" file out of "project3" because I don't want to 
> > have to do it every time I change the code of the classes in "project3"...
> > 
> > Note - If I do not add "project3" via "Project -> Properties -> Java 
> > Build Path -> Projects" for both projects "project1" and "project2" I 
> > get hundreds of errors. So clearly this is a required setting...
> > I don't know what is missing...
> > 
> > Thank you for helping me.
> > Best regards.
> > --
> > Léa
> 
> In Eclipse, try Project / Properties / Deployment Assembly.  Add project
> 'project3'.  It should add project3's resulting jar file to WEB-INF/lib
> or resulting classes to WEB-INF/classes depending on how project3 is
> configured.

UPDATE: The 2nd part of that sentence is not true; it will always add
the resulting jar file of project3.  However, it will create jar file on
the fly when the webapp is re/deployed OR when project3 is modified.

Keep in mind that this is simply a quick & dirty way of testing the app
from within Eclipse and NOT suitable for building a deployable war file.
You should use Maven or Ant or etc. for that.

> 
> Note that I'm using the Maven plug-in so this may be a consequent
> feature of the plug-in, I'm not sure.

This feature does not appear to require the Maven plug-in.

> 
> > 
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> > For additional commands, e-mail: users-h...@tomcat.apache.org
> > 
> 
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: ClassNotFoundException - Involving a class implementing Filter and two projects depending on another one

2015-03-29 Thread Tim Watts
On Sun, 2015-03-29 at 18:06 +0200, Lmhelp1 wrote:
> On 3/29/2015 5:36 PM, André Warnier [via Tomcat] wrote:
> > Lmhelp1 wrote:
> >
> > > Hello,
> > >
> > > Thank you for reading my post.
> > >
> > > I am getting a "ClassNotFoundException".
> > >
> > > Below is the situation.
> > > - I'm working with "Eclipse" ("Luna"), "Tomcat 8" and "Java 8".
> > > - I have three projects "project1", "project2" and "project3".
> > > - "project1" and "project2" depend on the third project "project3".
> > >   In "Project -> Properties -> Java Build Path -> Projects", I added
> > > "project3" for both projects "project1" and "project2".
> > > - "project3" is a "Java project".
> > > - "project1" and "project2" are "Dynamic Web Projects".
> > > - "project3" defines the class "MyFilter" which implements "Filter" and
> > > which I put in the package "my.package".
> > > - "project1" contains a "web.xml" file which contains the following
> > > elements:
> > >   [...]
> > >   
> > > MyFilter
> > > my.package.MyFilter
> > > 
> > >   requestEncoding
> > >   UTF-8
> > > 
> > >   
> > >   
> > > MyFilter
> > > /*
> > >   
> > >   [...]
> > > - "project2" contains a "web.xml" file which contains the following
> > > elements (same as in "project 1"):
> > >   [...]
> > >   
> > > MyFilter
> > > my.package.MyFilter
> > > 
> > >   requestEncoding
> > >   UTF-8
> > > 
> > >   
> > >   
> > > MyFilter
> > > /*
> > >   
> > >   [...]
> > >
> > > When running a JSP of "project1" on the "Tomcat" server, I get the 
> > error:
> > > SEVERE: Exception starting filter MyFilter
> > > java.lang.ClassNotFoundException: my.package.MyFilter
> > >
> > > There are no errors at build time.
> > >
> > > I just would like to mention that I'm working with "Tomcat 8" for the
> > > first time.
> > > It used to work with "Tomcat 7" but I might have done something more to
> > > make it work... I don't remember what...
> > >
> > > What can I do to solve that problem?
> > > Please let me know if you need additional information or if I'm not
> > > clear enough.
> > >
> >
> > I do not really know how to translate this for Eclipse but if this was 
> > a stand-alone
> > Tomcat, the way you describe it above, project1 and project2 (when 
> > deployed) should also
> > have the class available under their respective
> > (catalina_base)/webapps/projectX/WEB-INF/classes/ directory (or 
> > /WEB-INF/classes/lib/, if
> > in a jar). Is it the case ?
> 
> Thank you for your answer.
> 
> No, it is not the case.
> - There are no ".class" files from "project3" under "classes" 
> directories for the two projects "project1" and "project2".
> - I didn't make a ".jar" file out of "project3" because I don't want to 
> have to do it every time I change the code of the classes in "project3"...
> 
> Note - If I do not add "project3" via "Project -> Properties -> Java 
> Build Path -> Projects" for both projects "project1" and "project2" I 
> get hundreds of errors. So clearly this is a required setting...
> I don't know what is missing...
> 
> Thank you for helping me.
> Best regards.
> --
> Léa

In Eclipse, try Project / Properties / Deployment Assembly.  Add project
'project3'.  It should add project3's resulting jar file to WEB-INF/lib
or resulting classes to WEB-INF/classes depending on how project3 is
configured.

Note that I'm using the Maven plug-in so this may be a consequent
feature of the plug-in, I'm not sure.

> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: File getting created in bin folder instead of project folder

2015-02-08 Thread Tim Watts
On Mon, 2015-02-09 at 09:58 +0530, Hyder Hashmi wrote:
> Hi All,
> 
> When I execute the following code in my project folder, it creates the file
> in my current folder(project folder).
> 
> import java.io.File;
> public class CreateFile{
>   File f = null;
>   try{
>  f = new File("test.txt");
>  bool = f.createNewFile();
>  System.out.println("File created: "+bool);
>  }catch(Exception e){
>  e.printStackTrace();
>   }
> }
> 
First, there's no way that compiles.  Perhaps that block is supposed to
be wrapped in a method?

> I am now calling this class in my servlet.
> The servlet is executing perfectly on the tomcat, however, the file is
> getting created in the tomcat's bin folder instead of my project folder
> placed in the webapps.
> 
> If I specify the path, then it creates the file on that location , however,
> that will be hardcoding and will not work on the other computer.
> 

Second, you asked this question last week and you got several replies
offering guidance.  What advice, if any, did you follow and how did it
turn out?  (Hint: it's annoying when people take time to help and you
don't listen to them but want more help.)

As one of the replies suggested, probably the best approach is to set an
absolute path in either a system or context property.  Then obtain that
value during servlet init and pass it to the CreateFile class somehow
(via a constructor or a set method, or as a param to the create method
etc.).

--- Tim

> Please help.
> Thanks in advance
> Hyder!



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Need Help!

2015-01-28 Thread Tim Watts
On Thu, 2015-01-29 at 00:33 +0530, Hyder Hashmi wrote:
> Hi,
> 
> I am working on a small project and need your help in this.
> 
> I have a java program in which I read and write in a file that is
> located in the current folder.
> 
> Now I have written a few servlets and trying to use the previous code
> along with servlets.
> 
> Tomcat is searching for the file in its bin folder and giving
> FileNotFoundException. 
> 
> If I use my java code without the servlet it is checking for the file
> in current folder (which is my requirment).
> 
> I want to ensure that when I use my java code along with servlets, it
> should read and write in the file from current folder(Project folder
> in tomcat's webapps).

It sounds like you're trying to force your notion of what a web app's
"current folder" should be onto Tomcat.  It simply doesn't work that
way.  The Servlet Spec makes no guarantee as to what the "current
folder" is (a file system notion) in a Servlet container or web app.

Suggest you modify your file processing class to accept a hint as to the
"current folder" and set that value in the servlet using
ServletContext.getRealPath("/") and/or via an init parameter or via
injection.  But note that if the web app is deployed as an unexploded
war file getRealPath() may return null.

--- Tim

> I am not using any IDE, the  code is written in Notepad and being
> executed from CommandLine.
> 
> I have spent long time on Internet to find the resolution but in vain.
> 
> Request to help me with this situation .
> 
> Hoping for a positive reply.
> 
> Thanks for in advance for all the help.
> 
> Regards,
> Hyder.
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: How to access Sessions outside of class

2014-10-29 Thread Tim Watts
On Wed, 2014-10-29 at 08:28 -0400, Jason Ricles wrote:
> foo is not a webapp, it is a separate program running on the computer as a
> daemon. It has to do this stuff for it needed to be ran like this. bar is
> basically the gui to the daemon, providing what is happening on the machine
> to someone at another computer, since the machine is headless these
> programs are being ran on. So I am curious as to how having my foo program
> running outside of bar how it can interact using websockets? So far I have
> seen that they are disconnected and have no clue about each other outside
> of using RMI.
> 

A java program can be a websocket client with out being a webapp.
Perhaps this example will help:

http://stackoverflow.com/questions/26452903/javax-websocket-client-simple-example

You would need the JEE 7 websocket jar which presumably is included in
Tomcat 8 -- or use the appropriate Maven dependencies.  And as Chris
pointed out, JSON is fairly ubiquitous and easy to deal with.

RMI could work and is simple enough.  There are a few downsides worth
considering: 1) it's strictly java-to-java IPC, so no other technologies
(e.g. .NET) can participate down the road; 2) it's not firewall friendly
-- but that would only matter if there was a fw between foo and bar; 3)
it's not hip and cool -- not sure how widely used it is anymore outside
of EJB (do people still write EJBs?).

Did you say earlier that foo would need to send unsolicited alerts at
some point -- i.e. send alerts even when there's no client listening?
That could possibly complicate the design in that I believe the ws
server endpoint's life begins only in response to a client connection.
(I'm thinking of the server endpoint for the browser here.)  Thus such
alerts would need to go somewhere until a client shows up wanting to see
them (e.g. a database).  And if that's the case why not send all of them
there.

Sounds like you may have some design issues to work out and we don't
have enough details to be of much help.

--tim.


> On Tue, Oct 28, 2014 at 6:55 PM, Christopher Schultz <
> ch...@christopherschultz.net> wrote:
> 
> > -BEGIN PGP SIGNED MESSAGE-
> > Hash: SHA256
> >
> > Jason,
> >
> > On 10/28/14 3:06 PM, Jason Ricles wrote:
> > > Chris, foo has to run as a daemon outside of tomcat. It will be
> > > interacting with low level drivers through jni.
> >
> > While interesting, it's not terribly relevant.
> >
> > > I was looking at trying to do that with making a client endpoint
> > > in my daemon but i was having trouble getting it to connect to the
> > > websocket server.
> >
> > Maybe you should start there: get your foo daemon talking to your web
> > application via Websocket and I think you'll learn a lot about
> > Websocket in general and probably end up with a better webapp to boot.
> >
> > Thanks,
> > - -chris
> >
> > > On Tue, Oct 28, 2014 at 12:21 PM, Christopher Schultz <
> > > ch...@christopherschultz.net> wrote:
> > >
> > > Jason,
> > >
> > > On 10/28/14 9:06 AM, Jason Ricles wrote:
> >  Ok so here is the problem I have been spinning my wheels on
> >  for day let me just lay it out.
> > 
> >  I have a daemon written in java running lets call it foo for
> >  simpleness on a linux machine that has the tomcat server
> >  running. On the tomcat server is a WAR file for a webapp
> >  called bar. In that webapp is a webpage with JavaScript
> >  websocket communication that connects to a websocket server
> >  that is also a part of the WAR file. So I have a webpage and
> >  a websocket server communicating with each other.
> > 
> >  I want the foo daemon and the websocket server on bar (web
> >  application) to be able to communicate with each other. Is
> >  there any way outside of sockets to have foo and the
> >  websocket server on bar do this?
> > >
> > > Dumb question: why can't foo just be a Websocket client? Make a
> > > ws:// connection to your web application in Tomcat and then
> > > two-way communication is possible. Take whatever values from either
> > > side and push them over the wire.
> > >
> > > Use JSON or something dirt-simple as your data encapsulation
> > > language: it's standard, well-understood, and has parsers and
> > > serializers readily available for many different languages. It's
> > > also pretty much backward- and forward-compatible since everything
> > > is pretty much a named value map, so you can add/subtract fields at
> > > will without having to rewrite the communication protocol or do a
> > > lot of extra work in either the client or the server.
> > >
> > > -chris
> > >
> >  On Tue, Oct 28, 2014 at 8:59 AM, Martin Grigorov
> >   wrote:
> > 
> > > On Tue, Oct 28, 2014 at 2:51 PM, Jose María Zaragoza
> > >  > >>
> > > wrote:
> > >
> > >> 2014-10-28 13:44 GMT+01:00 Jason Ricles
> > >> :
> > >>>
> > >>> Martin,
> > >>>
> > >>> I can not use hazelcast due to regulations I have to
> > >>> abi

Re: How to access Sessions outside of class

2014-10-28 Thread Tim Watts
Any IPC that you have to write from scratch is going have a not
insignificant level of complexity whether it's raw sockets, pipes, http,
whatever.  Since it sounds like you can't introduce any additional
software packages, you might want to consider using RMI (see the
java.rmi package).  At least then, you're coding to an API instead of
having to invent message formats and protocols.


On Tue, 2014-10-28 at 10:16 -0400, Jason Ricles wrote:
> Yes we are trying to portable, well the socket is the last resort. We are
> trying to avoid it until now but will go that way if we have to if there is
> no other way. Mostly due to the data coming in and out writing our own
> socket will be complex but doable. As far as messaging broker, they are not
> approved for use on our system so thus can not be used.
> 
> On Tue, Oct 28, 2014 at 10:13 AM, Tim Watts  wrote:
> 
> > On Linux/Unix you could use a FIFO (aka named pipe) and have each side
> > connect to it with a stream.  But that's non-portable and probably not
> > too elegant/robust.  What's the problem with using a socket?  Or better
> > yet, a message broker like ActiveMQ like someone else has already
> > suggested?
> >
> >
> > On Tue, 2014-10-28 at 09:46 -0400, Jason Ricles wrote:
> > > Communicate means something happens that the daemon is monitoring, so
> > thus
> > > the daemon sends a message to the websocket server running on the webapp,
> > > so that message can get relayed to the webpage from the server and the
> > > daemon will also need to get messages from the webapp. It will then be
> > two
> > > way and just regular messages.
> > >
> > > On Tue, Oct 28, 2014 at 9:42 AM, chris derham 
> > wrote:
> > >
> > > > On 28 October 2014 11:06, Jason Ricles  wrote:
> > > > > Ok so here is the problem I have been spinning my wheels on for day
> > let
> > > > me
> > > > > just lay it out.
> > > > >
> > > > > I have a daemon written in java running lets call it foo for
> > simpleness
> > > > on
> > > > > a linux machine that has the tomcat server running. On the tomcat
> > server
> > > > is
> > > > > a WAR file for a webapp called bar. In that webapp is a webpage with
> > > > > JavaScript websocket communication that connects to a websocket
> > server
> > > > that
> > > > > is also a part of the WAR file. So I have a webpage and a websocket
> > > > server
> > > > > communicating with each other.
> > > > >
> > > > > I want the foo daemon and the websocket server on bar (web
> > application)
> > > > to
> > > > > be able to communicate with each other. Is there any way outside of
> > > > sockets
> > > > > to have foo and the websocket server on bar do this?
> > > >
> > > > Define communicate - what kind? One way, two way, what kind of data,
> > > > frequency, size, type?
> > > >
> > > > Chris
> > > >
> > > > -
> > > > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> > > > For additional commands, e-mail: users-h...@tomcat.apache.org
> > > >
> > > >
> >
> >
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> > For additional commands, e-mail: users-h...@tomcat.apache.org
> >
> >



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: How to access Sessions outside of class

2014-10-28 Thread Tim Watts
On Linux/Unix you could use a FIFO (aka named pipe) and have each side
connect to it with a stream.  But that's non-portable and probably not
too elegant/robust.  What's the problem with using a socket?  Or better
yet, a message broker like ActiveMQ like someone else has already
suggested?


On Tue, 2014-10-28 at 09:46 -0400, Jason Ricles wrote:
> Communicate means something happens that the daemon is monitoring, so thus
> the daemon sends a message to the websocket server running on the webapp,
> so that message can get relayed to the webpage from the server and the
> daemon will also need to get messages from the webapp. It will then be two
> way and just regular messages.
> 
> On Tue, Oct 28, 2014 at 9:42 AM, chris derham  wrote:
> 
> > On 28 October 2014 11:06, Jason Ricles  wrote:
> > > Ok so here is the problem I have been spinning my wheels on for day let
> > me
> > > just lay it out.
> > >
> > > I have a daemon written in java running lets call it foo for simpleness
> > on
> > > a linux machine that has the tomcat server running. On the tomcat server
> > is
> > > a WAR file for a webapp called bar. In that webapp is a webpage with
> > > JavaScript websocket communication that connects to a websocket server
> > that
> > > is also a part of the WAR file. So I have a webpage and a websocket
> > server
> > > communicating with each other.
> > >
> > > I want the foo daemon and the websocket server on bar (web application)
> > to
> > > be able to communicate with each other. Is there any way outside of
> > sockets
> > > to have foo and the websocket server on bar do this?
> >
> > Define communicate - what kind? One way, two way, what kind of data,
> > frequency, size, type?
> >
> > Chris
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> > For additional commands, e-mail: users-h...@tomcat.apache.org
> >
> >



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: can only access tomcat (running on centos) locally not from machine on same subnet

2014-09-14 Thread Tim Watts
On Sun, 2014-09-14 at 13:43 +0100, AndyE wrote:
> the tomcat is installed with the application and i have installed this prob 
> 100+ times on windows .. this is a newer version in centos
> 
Maybe you should contact the app vendor?

> new log file on restarting tomcat attached - no warnings or errors ?
> 
The list strips attachments.  If you would paste it inline maybe we can
get a better idea what's happening.

> cheers.
> 
> 
> -Original Message- 
> From: Tim Watts
> Sent: Sunday, September 14, 2014 12:22 PM
> To: Tomcat Users List
> Subject: Re: can only access tomcat (running on centos) locally not from 
> machine on same subnet
> 
> On Sun, 2014-09-14 at 08:02 +0100, AndyE wrote:
> > I have an app installed (one that i have installed several times) on
> > centos 6.5 it runs a version of tomcat (7.0.54) that is currently
> > configured on port  .. i cannot access this page from any other
> > machine on the same subnet .. the browser (chrome) gives the
> > following :
> >
> > This webpage is not available Google Chrome could not load the webpage
> > because 192.168.1.11 took too long to respond. The website may be
> > down, or you may be experiencing issues with your Internet connection.
> > Error code: ERR_CONNECTION_TIMED_OUT
> >
> > I have tried the following :
> >
> > Changed tomcat ports in server.xml restarted = same
> >
> > there is no localhost only config in server.xml
> >
> > disabled firewalls on everything (selinux disabled and turned off FW
> > in windows)
> >
> > netstat doesn't show it listening on ports  or 8080 which ive also
> > tried.
> 
> This is likely the proximate cause.
> 
> 
> > disabled ipv6
> >
> > I can ping/resolve ip and hostname of tomcat server from other
> > machines
> >
> > Bit lost as to why this isn't working - netstat is giving me a clue
> > but why isnt it listening ?
> 
> For more clues look for errors/warnings in the tomcat log under
> {TOMCAT}/logs (assuming you're working with a standard Tomcat distro and
> not a Centos package).  May want to stop/start Tomcat first.
> 
> --tim
> 
> > server.xml :
> >
> >
> >
> >
> > 
> > 
> >  > maxThreads="150" minSpareThreads="25" enableLookups="true"
> > redirectPort="8443" acceptCount="100" connectionTimeout="2"
> > disableUploadTimeout="true" />
> > 
> > 
> > 
> >
> > 
> > 
> >   
> >> autoDeploy="false">
> >
> > 
> >  > directory="logs" prefix="localhost_access_log." suffix=".txt"
> > pattern="%l %u %t %r %s %b %D" resolveHosts="false" />
> >   
> >
> > 
> 
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: can only access tomcat (running on centos) locally not from machine on same subnet

2014-09-14 Thread Tim Watts
On Sun, 2014-09-14 at 08:02 +0100, AndyE wrote:
> I have an app installed (one that i have installed several times) on
> centos 6.5 it runs a version of tomcat (7.0.54) that is currently
> configured on port  .. i cannot access this page from any other
> machine on the same subnet .. the browser (chrome) gives the
> following :
> 
> This webpage is not available Google Chrome could not load the webpage
> because 192.168.1.11 took too long to respond. The website may be
> down, or you may be experiencing issues with your Internet connection.
> Error code: ERR_CONNECTION_TIMED_OUT
> 
> I have tried the following :
> 
> Changed tomcat ports in server.xml restarted = same
> 
> there is no localhost only config in server.xml
> 
> disabled firewalls on everything (selinux disabled and turned off FW
> in windows)
> 
> netstat doesn't show it listening on ports  or 8080 which ive also
> tried.

This is likely the proximate cause.


> disabled ipv6
> 
> I can ping/resolve ip and hostname of tomcat server from other
> machines
> 
> Bit lost as to why this isn't working - netstat is giving me a clue
> but why isnt it listening ?

For more clues look for errors/warnings in the tomcat log under
{TOMCAT}/logs (assuming you're working with a standard Tomcat distro and
not a Centos package).  May want to stop/start Tomcat first.

--tim

> server.xml :
> 
> 
> 
> 
> 
> 
>  maxThreads="150" minSpareThreads="25" enableLookups="true"
> redirectPort="8443" acceptCount="100" connectionTimeout="2"
> disableUploadTimeout="true" />
> 
> 
> 
> 
> 
> 
>   
>autoDeploy="false">
> 
> 
>  directory="logs" prefix="localhost_access_log." suffix=".txt"
> pattern="%l %u %t %r %s %b %D" resolveHosts="false" />
>   
> 
> 



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



No activity on tomcat.users since Tues?

2014-05-11 Thread Tim Watts
Markmail seems to confirm this but kind of remarkable, huh?  I think the
user community should get a promotion in recognition of our quantum leap
in tomcat problem-solving skills!  (Or perhaps everyone's just busy
reading the manual?)



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Should validationQuery commit ?

2014-04-18 Thread Tim Watts
On Fri, 2014-04-18 at 11:05 +0200, Franck Routier wrote:
> 

Is is possible the select just needs to be terminated with a semi-colon?




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Please help diagnosing a random production Tomcat 7.0.53 Internal Server Error!

2014-04-15 Thread Tim Watts
On Tue, 2014-04-15 at 17:12 -0400, Ian Long wrote:
> >  
> > Ian Long wrote:
> I have tomcat configured to log via log4j, and then there is my
> application log, those are the only two logs, and neither contains
> anything.

They're empty?  Are you sure the logs are writable?  How much free space
is available on the file system where the logs reside?


> It’s not about believing, I have monitoring software that gives me
> precise information about memory use and there is no indication of a
> problem there.
> 
> Thanks,
> Ian
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: filter question

2014-03-13 Thread Tim Watts
On Thu, 2014-03-13 at 23:16 -0400, Tim Watts wrote:
> On Thu, 2014-03-13 at 19:11 -0700, Brendan Miller wrote:
> > To be clear, I'm trying to modify the response that comes back from the
> > service. I have a header that I may or may not need to set based on the
> > response code. I believe the service sets the response code?
> 
> That's true.  
Actually, let me correct myself: that may not be strictly true.  I don't
think there's anything in the spec that says the response code will be
set when service() returns UNLESS the request results in an error.

-- Tim.

> Unfortunately, by the time your filter gets control again,
> the response will very likely be committed thus shutting out any
> possibility of setting any headers.
> 
> Doing this in a Filter, while intuitively sensible, will always be a
> highly fragile solution.  You would have to set a buffer large enough to
> accommodate the largest conceivable response size.  Once a response is
> committed you can't set the response code or headers -- they're already
> on their way to the client.  There's no getting around this.
> 
> I think the best approach is to conditionally set the header before any
> response is generated.  If your application has an MVC structure you
> could do this just before the Controller invokes the View.  You should
> know the response code by then.
> 
> HTH
> 
> -- Tim
> 
> > 
> > 
> > On Thu, Mar 13, 2014 at 6:20 PM, Martin Gainty  wrote:
> > 
> > > you'll need to pass your modified response to service method of servlet
> > > which is *in* the filterChain
> > >
> > >
> > > ApplicationFilterChain::internalDoFilter(ServletRequest request,
> > > ServletResponse response)
> > > throws IOException, ServletException
> > >
> > > {
> > > 
> > > servlet.service(request, response);
> > >
> > > ...
> > >
> > > }
> > >
> > > Martin
> > >
> > >
> > >
> > >
> > >
> > >
> > > > Date: Thu, 13 Mar 2014 17:51:59 -0700
> > > > Subject: filter question
> > > > From: catph...@catphive.net
> > > > To: users@tomcat.apache.org
> > > >
> > > > I have a filter with doFilter method like this:
> > > >
> > > > public void doFilter(ServletRequest request,
> > > > ServletResponse response,
> > > > FilterChain chain)
> > > > throws IOException, ServletException {
> > > > HttpServletRequest req = (HttpServletRequest) request;
> > > > HttpServletResponse resp = (HttpServletResponse) response;
> > > >
> > > > resp.setHeader("Cache-Control",
> > > > "must-revalidate, max-age=0, post-check=0,
> > > > pre-check=0");
> > > >
> > > > chain.doFilter(request, response);
> > > > }
> > > >
> > > > This sets the header. However, if I set the header *after*
> > > chain.doFilter,
> > > > the header is not set. Why is this?
> > > >
> > > > public void doFilter(ServletRequest request,
> > > > ServletResponse response,
> > > > FilterChain chain)
> > > > throws IOException, ServletException {
> > > > HttpServletRequest req = (HttpServletRequest) request;
> > > > HttpServletResponse resp = (HttpServletResponse) response;
> > > >
> > > > chain.doFilter(request, response);
> > > >
> > > > resp.setHeader("Cache-Control",
> > > > "must-revalidate, max-age=0, post-check=0,
> > > > pre-check=0");
> > > > }
> > > >
> > > > Programmatically I can see the header is null.
> > > >
> > > > Has the content already been sent to the web browser after
> > > chain.doFilter?
> > > > If so, is there a way to delay sending data to the browser? I need to
> > > > inspect the status code in the response before setting my header (to
> > > > prevent 404's from being cached).
> > > >
> > > > Thanks,
> > > > Brendan Miller
> > >
> > >
> 
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: filter question

2014-03-13 Thread Tim Watts
On Thu, 2014-03-13 at 19:11 -0700, Brendan Miller wrote:
> I'm confused by what you mean by that. Are you saying I need to somehow
> rewrite the class of the FilterChain object passed to my filter?
> 
I think you're somewhat new to the list.  Mr. Gainty is notorious here
and seems to pride himself on concocting the most off-the-wall red
herrings imaginable.  I'll admit some of them are truly breathtaking.  I
guess it's some sort of quest to build a global reputation as the
world's most incompetent developer.  I dunno.

> To be clear, I'm trying to modify the response that comes back from the
> service. I have a header that I may or may not need to set based on the
> response code. I believe the service sets the response code?

That's true.  Unfortunately, by the time your filter gets control again,
the response will very likely be committed thus shutting out any
possibility of setting any headers.

Doing this in a Filter, while intuitively sensible, will always be a
highly fragile solution.  You would have to set a buffer large enough to
accommodate the largest conceivable response size.  Once a response is
committed you can't set the response code or headers -- they're already
on their way to the client.  There's no getting around this.

I think the best approach is to conditionally set the header before any
response is generated.  If your application has an MVC structure you
could do this just before the Controller invokes the View.  You should
know the response code by then.

HTH

-- Tim

> 
> 
> On Thu, Mar 13, 2014 at 6:20 PM, Martin Gainty  wrote:
> 
> > you'll need to pass your modified response to service method of servlet
> > which is *in* the filterChain
> >
> >
> > ApplicationFilterChain::internalDoFilter(ServletRequest request,
> > ServletResponse response)
> > throws IOException, ServletException
> >
> > {
> > 
> > servlet.service(request, response);
> >
> > ...
> >
> > }
> >
> > Martin
> >
> >
> >
> >
> >
> >
> > > Date: Thu, 13 Mar 2014 17:51:59 -0700
> > > Subject: filter question
> > > From: catph...@catphive.net
> > > To: users@tomcat.apache.org
> > >
> > > I have a filter with doFilter method like this:
> > >
> > > public void doFilter(ServletRequest request,
> > > ServletResponse response,
> > > FilterChain chain)
> > > throws IOException, ServletException {
> > > HttpServletRequest req = (HttpServletRequest) request;
> > > HttpServletResponse resp = (HttpServletResponse) response;
> > >
> > > resp.setHeader("Cache-Control",
> > > "must-revalidate, max-age=0, post-check=0,
> > > pre-check=0");
> > >
> > > chain.doFilter(request, response);
> > > }
> > >
> > > This sets the header. However, if I set the header *after*
> > chain.doFilter,
> > > the header is not set. Why is this?
> > >
> > > public void doFilter(ServletRequest request,
> > > ServletResponse response,
> > > FilterChain chain)
> > > throws IOException, ServletException {
> > > HttpServletRequest req = (HttpServletRequest) request;
> > > HttpServletResponse resp = (HttpServletResponse) response;
> > >
> > > chain.doFilter(request, response);
> > >
> > > resp.setHeader("Cache-Control",
> > > "must-revalidate, max-age=0, post-check=0,
> > > pre-check=0");
> > > }
> > >
> > > Programmatically I can see the header is null.
> > >
> > > Has the content already been sent to the web browser after
> > chain.doFilter?
> > > If so, is there a way to delay sending data to the browser? I need to
> > > inspect the status code in the response before setting my header (to
> > > prevent 404's from being cached).
> > >
> > > Thanks,
> > > Brendan Miller
> >
> >



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: filter question

2014-03-13 Thread Tim Watts
On Thu, 2014-03-13 at 21:20 -0400, Martin Gainty wrote:
> you'll need to pass your modified response to service method of
> servlet which is *in* the filterChain

Utter nonsense.

> ApplicationFilterChain::internalDoFilter(ServletRequest request,
> ServletResponse response)
> throws IOException, ServletException 
> 
> {
> 
> servlet.service(request, response);
> 
> ...
> 
> }
> 
> Martin 
> 
> 
>   
> 
> 
> 
> > Date: Thu, 13 Mar 2014 17:51:59 -0700
> > Subject: filter question
> > From: catph...@catphive.net
> > To: users@tomcat.apache.org
> > 
> > I have a filter with doFilter method like this:
> > 
> > public void doFilter(ServletRequest request,
> > ServletResponse response,
> > FilterChain chain)
> > throws IOException, ServletException {
> > HttpServletRequest req = (HttpServletRequest) request;
> > HttpServletResponse resp = (HttpServletResponse) response;
> > 
> > resp.setHeader("Cache-Control",
> > "must-revalidate, max-age=0, post-check=0,
> > pre-check=0");
> > 
> > chain.doFilter(request, response);
> > }
> > 
> > This sets the header. However, if I set the header *after* chain.doFilter,
> > the header is not set. Why is this?
> > 
> > public void doFilter(ServletRequest request,
> > ServletResponse response,
> > FilterChain chain)
> > throws IOException, ServletException {
> > HttpServletRequest req = (HttpServletRequest) request;
> > HttpServletResponse resp = (HttpServletResponse) response;
> > 
> > chain.doFilter(request, response);
> > 
> > resp.setHeader("Cache-Control",
> > "must-revalidate, max-age=0, post-check=0,
> > pre-check=0");
> > }
> > 
> > Programmatically I can see the header is null.
> > 
> > Has the content already been sent to the web browser after chain.doFilter?
> > If so, is there a way to delay sending data to the browser? I need to
> > inspect the status code in the response before setting my header (to
> > prevent 404's from being cached).
> > 
> > Thanks,
> > Brendan Miller
> 



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: filter question

2014-03-13 Thread Tim Watts
On Thu, 2014-03-13 at 17:51 -0700, Brendan Miller wrote:
> I have a filter with doFilter method like this:
> 
> public void doFilter(ServletRequest request,
>  ServletResponse response,
>  FilterChain chain)
> throws IOException, ServletException {
> HttpServletRequest req = (HttpServletRequest) request;
> HttpServletResponse resp = (HttpServletResponse) response;
> 
> resp.setHeader("Cache-Control",
>"must-revalidate, max-age=0, post-check=0,
> pre-check=0");
> 
> chain.doFilter(request, response);
> }
> 
> This sets the header. However, if I set the header *after* chain.doFilter,
> the header is not set. Why is this?
> 
A similar question came up last week.  Basically, it's because the
response has already been committed.  A response becomes committed once
the 1st byte is sent back to the client -- e.g. if flush() is called or
the buffer becomes full while more response data is written.

You can search the archive for how it was resolved.  Don't recall the
subject line.  Sorry.

-- Tim

> public void doFilter(ServletRequest request,
>  ServletResponse response,
>  FilterChain chain)
> throws IOException, ServletException {
> HttpServletRequest req = (HttpServletRequest) request;
> HttpServletResponse resp = (HttpServletResponse) response;
> 
> chain.doFilter(request, response);
> 
> resp.setHeader("Cache-Control",
>"must-revalidate, max-age=0, post-check=0,
> pre-check=0");
> }
> 
> Programmatically I can see the header is null.
> 
> Has the content already been sent to the web browser after chain.doFilter?
> If so, is there a way to delay sending data to the browser? I need to
> inspect the status code in the response before setting my header (to
> prevent 404's from being cached).
> 
> Thanks,
> Brendan Miller



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Http Status 404

2014-02-06 Thread Tim Watts
On Thu, 2014-02-06 at 23:07 +0530, Shivam Mishra wrote:
> Now my browser is showing this error as below:
> 
> Exception report
> 
> *message* *Error instantiating servlet class TestServlet*
> 
> *description* *The server encountered an internal error that prevented it
> from fulfilling this request.*
> 
> *exception*
> 
> javax.servlet.ServletException: Error instantiating servlet class TestServlet
>   
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503)
>   
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:74)
>   
> org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
>   
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:509)
>   
> org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1015)
>   
> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:651)
>   
> org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222)
>   
> org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1575)
>   
> org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1533)
>   java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
>   java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
>   java.lang.Thread.run(Unknown Source)
> 
> *root cause*
> 
> java.lang.IllegalAccessException: Class
> org.apache.catalina.core.DefaultInstanceManager can not access a
> member of class TestServlet with modifiers ""

You probably didn't declare it as 'public class ...'.  If that's not the
case perhaps you could post the source.

(Just a gentle pre-emptive reminder: This list is run by volunteers to
help folks with their Tomcat problems, not to teach basic Java or
Servlet coding.)


>   sun.reflect.Reflection.ensureMemberAccess(Unknown Source)
>   java.lang.Class.newInstance(Unknown Source)
>   
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503)
>   
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:74)
>   
> org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
>   
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:509)
>   
> org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1015)
>   
> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:651)
>   
> org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222)
>   
> org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1575)
>   
> org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1533)
>   java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
>   java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
>   java.lang.Thread.run(Unknown Source)
> 
> 
> 
> On Thu, Feb 6, 2014 at 11:04 PM, Shivam Mishra wrote:
> 
> > My url is http://localhost:8080/name/TestServlet
> >
> >
> > On Thu, Feb 6, 2014 at 10:55 PM, Tim Watts  wrote:
> >
> >> On Thu, 2014-02-06 at 21:32 +0530, Shivam Mishra wrote:
> >> > My directory structure is C:\Program Files\Apache Software
> >> > Foundation\Tomcat 8.0\webapps\name\WEB-INF\Classes for .class file of
> >> > Servlet
> >>
> >> That last part should be ...\WEB-INF\classes (lower case 'c').  If that
> >> doesn't fix it then, again I ask, what URL are you using to access the
> >> app?
> >>
> >>
> >> > Description of my logs is below
> >> > 06-Feb-2014 14:50:22.684 INFO [Thread-9]
> >> > org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler
> >> > ["http-nio-8080"]
> >> > 06-Feb-2014 14:50:22.742 INFO [Thread-9]
> >> > org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler
> >> > ["ajp-nio-8009"]
> >> > 06-Feb-2014 14:50:22.793 INFO [Thread-9]
> >> > org.apache.catalina.core.StandardService.stopInternal Stopping service
> >> > Catalina
> >> > 06-Feb-2014 14:50:22.912 INFO [Thread-9]
> >> > org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler
> >> > ["http-nio-8080"]
> >> > 06-Feb-2014 14:50:22.916 INFO [Thread-9]
> >> > org.apache.coyote.AbstractPr

Re: Http Status 404

2014-02-06 Thread Tim Watts
 INFO [localhost-startStop-1]
> org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
> application directory C:\Program Files\Apache Software Foundation\Tomcat
> 8.0\webapps\manager
> 06-Feb-2014 15:08:09.066 INFO [localhost-startStop-1]
> org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
> application directory C:\Program Files\Apache Software Foundation\Tomcat
> 8.0\webapps\name
> 06-Feb-2014 15:08:09.126 INFO [localhost-startStop-1]
> org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
> application directory C:\Program Files\Apache Software Foundation\Tomcat
> 8.0\webapps\ROOT
> 06-Feb-2014 15:08:09.166 INFO [main]
> org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler
> ["http-nio-8080"]
> 06-Feb-2014 15:08:09.174 INFO [main]
> org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler
> ["ajp-nio-8009"]
> 06-Feb-2014 15:08:09.177 INFO [main]
> org.apache.catalina.startup.Catalina.start Server startup in 1504 ms
> 
> 
> 
> On Thu, Feb 6, 2014 at 9:12 PM, Tim Watts  wrote:
> 
> > On Thu, 2014-02-06 at 10:32 -0500, Neven Cvetkovic wrote:
> > > On Feb 6, 2014 4:21 PM, "Shivam Mishra"  wrote:
> > > >
> > > > My tomcat and its example application is running but I got an error
> > with
> > > my
> > > > own application .My port number is 8080 .I compile my servlet
> > programme in
> > > > jdk 7 .and my web.xml file is below
> > > > 
> > > >  > > > PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
> > > > "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd";>
> > > >
> > > > 
> > > >   
> > > > MyServlet
> > > > TestServlet
> > > >
> > > >   
> > > > 
> > > > MyServlet
> > > > /TestServlet
> > > > 
> > > > 
> > > > My servlet class name is TestServlet
> > > >
> > > >
> > >
> > > Ok, great.
> > >
> > > Now tell us about directory structure of your application, what files,
> > > where did you put the servlet class file, etc.
> > >
> > > Also what do logs say once you deploy your app?
> >
> > And just as importantly: What URL are you using to access your app?
> >
> >
> >
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> > For additional commands, e-mail: users-h...@tomcat.apache.org
> >
> >



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Http Status 404

2014-02-06 Thread Tim Watts
On Thu, 2014-02-06 at 10:32 -0500, Neven Cvetkovic wrote:
> On Feb 6, 2014 4:21 PM, "Shivam Mishra"  wrote:
> >
> > My tomcat and its example application is running but I got an error with
> my
> > own application .My port number is 8080 .I compile my servlet programme in
> > jdk 7 .and my web.xml file is below
> > 
> >  > PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
> > "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd";>
> >
> > 
> >   
> > MyServlet
> > TestServlet
> >
> >   
> > 
> > MyServlet
> > /TestServlet
> > 
> > 
> > My servlet class name is TestServlet
> >
> >
> 
> Ok, great.
> 
> Now tell us about directory structure of your application, what files,
> where did you put the servlet class file, etc.
> 
> Also what do logs say once you deploy your app?

And just as importantly: What URL are you using to access your app?




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: On one particular box, Tomcat 7.0.25 runs just fine, but 7.0.47 crashes on takeoff -- some authority problem

2013-12-09 Thread Tim Watts
On Mon, 2013-12-09 at 11:00 -0800, James H. H. Lampert wrote:
> On 12/6/13 6:56 PM, CRPence (on the Midrange Java List) wrote:
> >The T-AF audit entry should log the object to which there
> > was insufficient authority, then the chmod can be requested against that
> > object to grant the necessary authority bits.
> 
> The T-AF audit entry shows (and I'm no longer bothering to "change names 
> to protect the innocent"):
> 
> > 1  'A*N*N*STMFQP0ZSPWP  WTADMIN   '
> > 00051  '280199WTADMIN '
> > 00101  '000   '
> > 00151  '  '
> > 00201  '  '
> > 00251  ' nP8  ry  '
> . . .
> > 00801  '   nP8  ry QASP011USENU  Y'
> > 00851  '  /wintouch/tomcat/bin/startup.sh '
> 
> Which would seem to indicate that it's the startup shell script itself 
> that has the authority problem.
> 
> So looking at the paths using the QShell "ls" command, I get:
> 
> > cd /wintouch/tomcat/bin
> > $
> > ls -l startup.sh
> > -rw-rw-rw-  1 WTADMIN  0  1961 Oct 18 13:19 startup.sh
> for the 7.0.47 version, which has the authority failure, and
> > cd /wintouch/tomcat.bak/bin
> > $
> > ls -l startup.sh
> > -rw-rw-rw-  1 WINTOUCH  0  1961 Jun 15  2012 startup.sh
> for the 7.0.25, which looks exactly the same, except for the owner and 
> the date, and yet it works.
> 
> The bin directory shows:
> > drwxrwsrwx  2 WTADMIN  0 32768 Oct 18 13:19 bin
> for 7.0.47 (fails), and
> > drwxrwsrwx  2 WINTOUCH  0 32768 Jun 15  2012 bin
> for 7.0.25 (works)
> 
> The tomcat (7.0.47) and tomcat.bak (7.0.25) directories show:
> > drwxrwsrwx  9 WTADMIN   0 12288 Dec  6 14:21 tomcat
> > drwxrwsrwx  9 WINTOUCH  0 12288 Jun 15  2012 tomcat.bak
> 

What about execute permissions on /wintouch.  As Chris pointed out
earlier, WTADMIN must have execute permission to the top of the tree.
You seem to have investigated every corner except that one.

(I'm no AS400 expert but there doesn't seem to be on on the Tomcat list
other than you.)

> Finally, for comparison, here are the corresponding results on our own 
> box, where there are no problems at all:
> 
> > drwxrwsrwx   9 RABBIT0  8192 Nov 29 16:48 tomcat
> > drwxrwsrwx  2 RABBIT  0 28672 Oct 18 13:19 bin
> > -rw-rw-rw-  1 RABBIT  0  1961 Oct 18 13:19 startup.sh
> and
> > drwxrwsrwx   9 RABBIT0 24576 Nov  5 17:14 tomcat.bak
> > drwxrwsrwx  2 RABBIT  0 28672 Jun 18  2012 bin
> > -rw-rw-rw-  1 RABBIT  0  1961 Feb 14  2012 startup.sh
> 
> I don't see any difference
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 



signature.asc
Description: This is a digitally signed message part


Re: [OT] [Fwd: TomEE Professional Support]

2013-11-13 Thread Tim Watts
On Wed, 2013-11-13 at 06:53 -0800, Gurkan Erdogdu wrote:
> Hello all,
> 
> >>>When an Apache project founder[1] starts spamming the Apache community,
> Sorry but how could you say "spamming the Apache Community"? without
> knowing me and how I have been contributing to the Apache community
> and projects? 
> 
spam: n. Unsolicited email sent in bulk for commercial purposes.

That I don't know you only makes it more spammy.

> 
> >>>>there can and ought to be consequences.
> What do you mean?
> 
> >>>>Doesn't Apache have some minimu standards for this?  He seems to
> be a project committer, but hasn't contributed any code in about a
> year.
> I am PMC Chair of OpenWebBeans project. I think you don't know the
> roles of PMC Chair, please learn from here before talking. 

You mean that role comes with spamming privileges?  News to me.

> Lastly, 
> 
> 
> I get everyday huge amount of such marketing emails from all big known
> software vendors. I am sure you also receive such emails. If I am not
> interested, I simply unsubscribe from the list, this is not a really
> big problem to discuss! 
> 
> If you received such email from my email address, and not interested
> please unsubscribe from the list and you will never get a such email
> again.
> 
'Everyone else does it' is a pretty shaky ethical foundation.  Yes, it's
easy enough to unsubscribe.  But before I do that I need to check around
and make sure I can trust the link so I'm not just feeding a spammer.  I
get enough 'opt-out' crap already without having trusted sources like
ASF hopping on the bandwagon.  If this is going to be the new norm for
ASF I may have to rethink my list subscriptions.

Dude, you're not helping your mission here.  Take your wrist slap and
find a better channel to drum up business.

> Best 
> 
> Gurkan
> 
> 
> 
> 
> On Wednesday, November 13, 2013 4:24 PM, Tim Watts  
> wrote:
>  
> On Wed, 2013-11-13 at 14:56 +0100, Leon Rosenberg wrote:
> > I got it too. I think its easier to delete and forget it, as to debate
> > about it. ;-)
> 
> When an Apache project founder[1] starts spamming the Apache community,
> there can and ought to be consequences.
> 
> ___
> [1] At least that's his claim in the email. Their website doesn't post
> any PMC member list that I could find.  Doesn't Apache have some minimum
> standards for this?  He seems to be a project committer, but hasn't
> contributed any code in about a year.
> 
> 
> 
> > regards
> > Leon
> > 
> > 
> > On Wed, Nov 13, 2013 at 2:15 PM, André
>  Warnier  wrote:
> > 
> > > Hi.
> > >
> > > I got the following email in my personal email inbox.
> > >
> > > Isn't there some rule, or at least some matter of self-control, in not
> > > using email addresses collected on this list for commercial promotion ?
> > >
> > >  Original Message 
> > > From: - Wed Nov 13 13:48:37 2013
> > > X-Mozilla-Status: 0001
> > > X-Mozilla-Status2: 
> > > Return-Path:  > >
>  us4.mcsv.net>
> > > X-Original-To: a...@ice-sa.com
> > > Delivered-To: andre.warn...@ice-sa.com
> > > Received-SPF: Pass (sender SPF authorized) identity=mailfrom;
> > > client-ip=205.201.128.173; helo=mail173.us4.mcsv.net;
> > > envelope-from=bounce-mc.us3_22715643.227889-aw=ice-sa.com@
> > > mail173.us4.mcsv.net; receiver=a...@ice-sa.com
> > > Received: from mail173.us4.mcsv.net 
> > > (mail173.us4.mcsv.net[205.201.128.173])by
> > > tor.combios.es (Postfix) with ESMTP id DCFAB3C0AD2   for 
> > > ;
> > > Wed, 13 Nov 2013 13:48:25 +0100 (CET)
> > > DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; s=k1; d=
> > > mail173.us4.mcsv.net; h=Subject:From:Reply-To:To:Date:Message-ID:List-
> > > Unsubscribe:Sender:Content-Type:MIME-Version; i=gurkanerdogdu=3Dyahoo.com@
> > > mail173.us4.mcsv.net; bh=Mxp5nGTBAhJ4tiDlAEgNxpJYWwM=;
> > > b=Ocyx3ymgzmK11vA3/+524g885jWe0hlVlLQwFLGw052EepxX/u3JqrGTIZv6+afps8yWKhHqpMRz
> > > DR1JqSg9JPIfmn6xVzPvr5X/5Ve5g78ZKmZm5BmxmCRNyqB4fIc5+iLuIas31KKRImjm5cpEh8P5
> > > RAauIo5RquVVHcBgVbU=
> > > DomainKey-Signature: a=rsa-sha1; c=nofws; q=dns; s=k1; d=
> > > mail173.us4.mcsv.net; b=BmLvRK7R5zl2/VRFdLZ09BJy50nOQFBXLcUoHLPQqfO
> >
>  > o7DkgQbmi8Ug7bwNHNpotAwBLuXBIp2sW w8nzt6XeIcHys59itcvcLBKCt6zoR1
> > > vBv1RFw1OMSwlwuilV8u0zcNtNcav+LdWoW8zAnksyWOWL /knOPWkSMr9PbtPhtB4=;
> > > Received: from (127.0.0.1) by mail173.us4.mcsv.net id hgdqg017

Re: [OT] [Fwd: TomEE Professional Support]

2013-11-13 Thread Tim Watts
On Wed, 2013-11-13 at 14:56 +0100, Leon Rosenberg wrote:
> I got it too. I think its easier to delete and forget it, as to debate
> about it. ;-)

When an Apache project founder[1] starts spamming the Apache community,
there can and ought to be consequences.

___
[1] At least that's his claim in the email. Their website doesn't post
any PMC member list that I could find.  Doesn't Apache have some minimum
standards for this?  He seems to be a project committer, but hasn't
contributed any code in about a year.


> regards
> Leon
> 
> 
> On Wed, Nov 13, 2013 at 2:15 PM, André Warnier  wrote:
> 
> > Hi.
> >
> > I got the following email in my personal email inbox.
> >
> > Isn't there some rule, or at least some matter of self-control, in not
> > using email addresses collected on this list for commercial promotion ?
> >
> >  Original Message 
> > From: - Wed Nov 13 13:48:37 2013
> > X-Mozilla-Status: 0001
> > X-Mozilla-Status2: 
> > Return-Path:  > us4.mcsv.net>
> > X-Original-To: a...@ice-sa.com
> > Delivered-To: andre.warn...@ice-sa.com
> > Received-SPF: Pass (sender SPF authorized) identity=mailfrom;
> > client-ip=205.201.128.173; helo=mail173.us4.mcsv.net;
> > envelope-from=bounce-mc.us3_22715643.227889-aw=ice-sa.com@
> > mail173.us4.mcsv.net; receiver=a...@ice-sa.com
> > Received: from mail173.us4.mcsv.net (mail173.us4.mcsv.net[205.201.128.173]) 
> >by
> > tor.combios.es (Postfix) with ESMTP id DCFAB3C0AD2   for ;
> > Wed, 13 Nov 2013 13:48:25 +0100 (CET)
> > DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; s=k1; d=
> > mail173.us4.mcsv.net; h=Subject:From:Reply-To:To:Date:Message-ID:List-
> > Unsubscribe:Sender:Content-Type:MIME-Version; i=gurkanerdogdu=3Dyahoo.com@
> > mail173.us4.mcsv.net; bh=Mxp5nGTBAhJ4tiDlAEgNxpJYWwM=;
> > b=Ocyx3ymgzmK11vA3/+524g885jWe0hlVlLQwFLGw052EepxX/u3JqrGTIZv6+afps8yWKhHqpMRz
> > DR1JqSg9JPIfmn6xVzPvr5X/5Ve5g78ZKmZm5BmxmCRNyqB4fIc5+iLuIas31KKRImjm5cpEh8P5
> > RAauIo5RquVVHcBgVbU=
> > DomainKey-Signature: a=rsa-sha1; c=nofws; q=dns; s=k1; d=
> > mail173.us4.mcsv.net; b=BmLvRK7R5zl2/VRFdLZ09BJy50nOQFBXLcUoHLPQqfO
> > o7DkgQbmi8Ug7bwNHNpotAwBLuXBIp2sW w8nzt6XeIcHys59itcvcLBKCt6zoR1
> > vBv1RFw1OMSwlwuilV8u0zcNtNcav+LdWoW8zAnksyWOWL /knOPWkSMr9PbtPhtB4=;
> > Received: from (127.0.0.1) by mail173.us4.mcsv.net id hgdqg0174lg1 for <
> > a...@ice-sa.com>; Wed, 13 Nov 2013 12:47:58 + (envelope-from
> > )
> > Subject: TomEE Professional Support
> > From: Apache TomEE Support 
> > Reply-To: Apache TomEE Support 
> > To:  
> > Date: Wed, 13 Nov 2013 12:47:58 +
> > Message-ID: <9781cf0ccdac7604f1f7fd52ea052bfdbb3.20131113124746@mail173.
> > us4.mcsv.net>
> > X-Mailer: MailChimp Mailer - **CID105b909b64a052bfdbb3**
> > X-Campaign: mailchimp9781cf0ccdac7604f1f7fd52e.105b909b64
> > X-campaignid: mailchimp9781cf0ccdac7604f1f7fd52e.105b909b64
> > X-Report-Abuse: Please report abuse for this campaign here:
> > http://www.mailchimp.com/abuse/abuse.phtml?u=9781cf0ccdac7604f1f7fd52e&id=
> > 105b909b64&e=a052bfdbb3
> > X-MC-User: 9781cf0ccdac7604f1f7fd52e
> > x-accounttype: ff
> > List-Unsubscribe:  > 105b909b64-a052bfd...@mailin1.us2.mcsv.net?subject=unsubscribe>, <
> > http://blogspot.us3.list-manage.com/unsubscribe?u=
> > 9781cf0ccdac7604f1f7fd52e&id=b75a8245a1&e=a052bfdbb3&c=105b909b64>
> > Sender: "Apache TomEE Support"  > mail173.us4.mcsv.net>
> > x-mcda: FALSE
> > Content-Type: multipart/alternative; boundary="_--=_MCPart_
> > 1458955636"
> > MIME-Version: 1.0
> >
> > 20% off TomEE Support from Java EE Guru Gurkan Erdogdu. He really knows
> > Apache Tomcat, TomEE and related Java EE projects in source code level!
> >
> > 
> > Email not displaying correctly?
> > View it in your browser (http://us3.campaign-archive1.com/?u=
> > 9781cf0ccdac7604f1f7fd52e&id=105b909b64&e=a052bfdbb3) .
> >
> >
> > ** Support for Apache TomEE (http://blogspot.us3.list-
> > manage1.com/track/click?u=9781cf0ccdac7604f1f7fd52e&id=
> > bceee0c9ba&e=a052bfdbb3) Funs
> > 
> > BUY NOW (http://blogspot.us3.list-manage.com/track/click?u=
> > 9781cf0ccdac7604f1f7fd52e&id=6a24f4ee0e&e=a052bfdbb3)
> >
> >
> > ** TomEE Support : 20% Off
> > 
> >
> >
> > ** professional TomEE Support with NO HIDDEN COST!
> >
> > 
> > http://blogspot.us3.list-manage.com/qr/coupon?e=
> > a052bfdbb3&data=eyJjaWQiOiIxMDViOTA5YjY0IiwidW
> > lkIjoiOTc4MWNmMGNjZGFjNzYwNGYxZjdmZDUyZSIsImNvZGUiOiIzYzE0OT
> > g3NDIxIiwidGV4dCI6IjIwJSBvZmYgMSBUb21FRSBTdXBwb3J0IiwidGlkIj
> > oiOTcxMDJlZDgyNiIsInVzZXMiOjF9&s=2" alt="20% off 1 TomEE Support"
> > title="20% off 1 TomEE Support">http://9781cf0ccdac7604f1f7fd52e.
> > 105b909b64.list-manage.com/3c14987421" alt="" style="display:none;margin-
> > left:-px;">
> > http://blogspot.us

Re: Remote jconsole access (again)

2013-07-26 Thread Tim Watts
On Fri, 2013-07-26 at 12:57 -0400, Christopher Schultz wrote:
> All,
> 
> I have the JmxRemoteLifecycleListener enabled with the following
> configuration:
> 
> System properties (confirmed effective):
> -Dcom.sun.management.jmxremote.password.file=app/conf/jmxremote.password
> -Dcom.sun.management.jmxremote.access.file=app/conf/jmxremote.access
> -Dcom.sun.management.jmxremote.ssl=false
> 
> Also these files:
> $ cat app/conf/jmxremote.password
> admin letmein
> $ cat app/conf/jmxremote.access
> admin readwrite
> 
> ...and server.xml:
> 
>className="org.apache.catalina.mbeans.JmxRemoteLifecycleListener"
> rmiRegistryPortPlatform="18215"
> rmiServerPortPlatform="18217"
> useLocalPorts="true" />
> 
> I can confirm that my (remote) Java process is listening on these ports:
> 
> $ netstat -plan | grep 1821
> tcp6   0  0 :::18215:::*
> LISTEN  24991/java
> tcp6   0  0 :::18217:::*
> LISTEN  24991/java
> 
> I can also confirm that my local machine is forwarding these ports via
> SSH:
> 
> $ netstat -an | grep 1821
> tcp4   0  0  127.0.0.1.18217*.*
> LISTEN
> tcp6   0  0  ::1.18217  *.*
> LISTEN
> tcp4   0  0  127.0.0.1.18215*.*
> LISTEN
> tcp6   0  0  ::1.18215  *.*
> LISTEN
> 
Presumably sshd is the listener here.

Any chance the remote only accepts tcp6 connections and your local is
trying to connect via the tcp4 address?  I'm pretty sure the jvm default
now is to "prefer IPv6" but maybe you've got some funky setting
somewhere.

Is there any message conveying *how* it failed, e.g. "connection
refused", "invalid handshake" etc?

Could there be missing classes that it's trying to resolve via rmi?

No answers here but hopefully some useful questions.

-tim

> When attempting to connect via jconsole (as per Tomcat documentation[1]):
> 
> $ jconsole
> service:jmx:rmi://localhost:18217/jndi/rmi://localhost:18215/jmxrmi
> 
> This command doesn't ask for username and password, and fails. So I
> use jconsole's GUI interface to connect to a "Remote Process" and
> enter these values:
> 
> Remote Process:
> service:jmx:rmi://localhost:18217/jndi/rmi://localhost:18215/jmxrmi
> Username: admin
> Password: letmein
> 
> jconsole tells me that it can't connect via SSL and I say "okay,
> connect insecurely" and the connection fails immediately.
> 
> Am I missing a step somewhere? Am I doing it wrong?
> 
> Running Oraacle Java 1.7.0_25-b15 on both the client and the server.
> 
> Thanks!
> -chris
> 
> [1]
> http://tomcat.apache.org/tomcat-7.0-doc/config/listeners.html#JMX_Remote_Lifecycle_Listener_-_org.apache.catalina.mbeans.JmxRemoteLifecycleListener
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 



signature.asc
Description: This is a digitally signed message part


Re: JSP in Static Resources

2013-07-14 Thread Tim Watts
On Sun, 2013-07-14 at 16:27 -0700, Hassan Schroeder wrote:
> On Sun, Jul 14, 2013 at 3:53 PM, Tim Watts  wrote:
> 
> > If you don't take steps to make them cacheable, they'll be fetched
> > every time on every page adding extra load on your server and the
> > network.
> 
> Which would be *the whole point* of having dynamically generated
> style files, eh?  :-)
> 
Well yes, but I think that misses the point.  The OP needs to deliver
exactly 1 of 2 CSS's to the user.  And I would imagine that in the vast
majority of cases each user wants the same one each time.  So giving up
cacheability adds no value to the system.



signature.asc
Description: This is a digitally signed message part


Re: JSP in Static Resources

2013-07-14 Thread Tim Watts
On Sun, 2013-07-14 at 23:28 +0200, André Warnier wrote:
> Alireza Fattahi wrote:
> > Well,
> >  
> > If we want to follow up that post , then we should belive that:
> 
> Tomcat is an inclusive church, and you can believe what you want.
> Konstantin is one of the Tomcat developers however, so you should
> probably consider what he wrote and try to understand it correctly.
> 
> > Setting the mime type is not working for css
> 
> That is not what he wrote.
> 
> Setting the MIME type in (tomcat)/conf/web.xml /does/ work, for the
> default servlet which is used by default in all webapps to serve
> static documents. But in the case of the logic which you want to
> implement, the CSS is not a static document, so it is not relevant to
> your specific case.
> 
> He gave you the proper syntax for Tomcat 7, because previously you did
> not mention the Tomcat version that you were using.
> 
> For Tomcat 6, that syntax doesn't work.

> > So
> > we should use other ways to solve it.
> 
> Yes. The first option would be to use Tomcat 7 instead of Tomcat 6.
> Then the syntax shown by Konstantin would work.
> 
> Otherwise, he gave you one hint of how to try to solve it.
> 
> Another possibility would be to wrap your webapp with a servlet
> filter, and set the content-type header there, before the content is
> written to the response object.
> 
> Another possibility would be to re-think your logic, and leave you CSS
> files be static documents, and just pick the one you need to include.
> 
> That you want or don't want to use a certain logic is your choice; but
> if you pick a logic which is difficult to implement in the version of
> the software that you are using, then the problem to implement it is
> ultimately yours.

Another drawback to generating the CSS files dynamically is that you'll
have to do extra work to make them cacheable.  But when served as static
resources, the default servlet does a good job of this for you.  If you
don't take steps to make them cacheable, they'll be fetched every time
on every page adding extra load on your server and the network.

> 
> 
> >  
> > Is that true?!  
> > ~Regards,
> > ~~Alireza Fattahi
> > 
> > 
> > 
> > From: André Warnier 
> > To: Tomcat Users List  
> > Sent: Sunday, 14 July 2013, 12:00
> > Subject: Re: JSP in Static Resources
> > 
> > 
> > Alireza Fattahi wrote:
> >> Guys please concentrate on the main issue !!
> > 
> > I believe that "the main issue" was already answered thoroughly by 
> > Konstantin earlier.
> > Did you not read it ?
> > 
> >> I ask again:
> >>
> >> When you set jsp servlet to process the css files by adding:
> >> 
> >> jsp
> >> *.css
> >> 
> >>
> >>
> >> The tomcat does not set the CSS file extension mime type to text/css. 
> >> Although below line is set in localhost-config/web.xml
> >>
> >> 
> >> css
> >> text/css
> >> 
> >>
> >>
> >> When you manually set the content mime type <%@page contentType="text/css" 
> >> %> every thing will work fine
> >>
> >>
> >> ~Regards,
> >> ~~Alireza Fattahi
> > 
> > 
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> > For additional commands, e-mail: users-h...@tomcat.apache.org
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 



signature.asc
Description: This is a digitally signed message part


Re: [OT] WEB-INF

2013-07-10 Thread Tim Watts
On Wed, 2013-07-10 at 15:08 -0700, Leo Donahue - RDSA IT wrote:
> When did it start that developers decided to place jsps in the WEB-INF
> directory?  Was that intended from the beginning, or was it stumbled
> upon?

My guess is that it was a side effect of MVC adoption -- making views
accessible only via a controller.

> Leo
> 



signature.asc
Description: This is a digitally signed message part


Re: Error deploying web application

2013-06-25 Thread Tim Watts
On Tue, 2013-06-25 at 10:01 -0400, Nickalaus A Painter wrote:

> Jun 25, 2013 9:49:53 AM org.apache.catalina.startup.HostConfig 
> deployDescriptor
> SEVERE: Error deploying configuration descriptor 
> /usr/local/tomcat/apache-tomcat-7.0.37/conf/Catalina/localhost/MyApp.xml
> java.lang.NullPointerException
> at 



> So does this mean that I have to reconfigure MyApp.xml in that directory? 
> Shouldn't Tomcat look in the directory of MyApp once it explodes the .war 
> file?  Also, for completeness, here is MyApp.xml:
> 

Relative to the root of your .war file, Tomcat will look for
META-INF/context.xml.  It copies this
to .../Catalina/localhost/MyApp.xml.  You shouldn't have a MyApp.xml
anywhere in your .war file.

HTH
-Tim.


> 
> 
> http://java.sun.com/xml/ns/j2ee";
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> xsi:schemaLocation="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd 
> http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd";
> version="2.5">
> 
> 
> 
>  crossContext="true">
> 
> 
>  type="javax.sql.DataSource" 
> driverClassName="com.mysql.jdbc.Driver"
>   url="jdbc:mysql://localhost:3306/mydatabase"
>   username="root" password="root" maxActive="50" 
> maxIdle="15" maxWait="-1"/>
> 
> 
> 
> 
> Do you need anything else?  Thank you very much for your time!
> 
> Regards,
> Nick
> 
> 
> Nickalaus A. Painter
> IBM Smarter Water Co-op Developer
> Clarkson University 2014
> B.S. Mathematics and Computer Science
> +18454353546
> 
> 
> 
> From:   Mark Thomas 
> To: Tomcat Users List , 
> Date:   06/25/2013 09:52 AM
> Subject:Re: Error deploying web application
> 
> 
> 
> On 25/06/2013 14:43, Nickalaus A Painter wrote:
> > While attempting to deploy my web application to our production server I 
> 
> > encountered an issue, and after looking in the catalina.out log file, 
> the 
> > following shows up:
> 
> 
> 
> > Caused by: org.apache.catalina.LifecycleException: Failed to process 
> > either the global, per-host or context-specific context.xml file 
> therefore 
> > the [/MyApp] Context cannot be started.
> > at 
> > 
> org.apache.catalina.startup.FailedContext.startInternal(FailedContext.java:155)
> > at 
> > org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
> > ... 11 more
> 
> Before this message, a message will have been logged along the lines of:
> SEVERE: ... Error deploying configuration descriptor 
> 
> You need to find that log message. It will tell you which context.xml
> file could not be processed and why. My guess would be malformed XML.
> 
> Mark
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
> 



signature.asc
Description: This is a digitally signed message part


Re: [tomcat 6.0.35]- propert loadin

2013-02-10 Thread Tim Watts
On Sun, 2013-02-10 at 18:51 +0800, vicky wrote:
>  
> Hi All,
>  
>  
> My application need a "resource/properties" file to exist in the
> CLASSPATH, for this i placed my resource file in /bin
> folder & it was working fine.
>  
> But since yesterday my application reporting the error that properties
> file doesnt exist in classpath/path
>  
> In order to fix then i created the lib folder in my  &
> placed my "properties/resourc"e file over there, which eventually
> fixed my application CLASSPATH issue.
>  
> But the thing which makes me wonder that how my application was able
> to access the properties file earlier when i placed it
> /bin  location
> & what makes it to stop now.
>  
> Kindly suggest what all can be the scenarios/prossible use case for
> this, 
>  
> TOmcat version - 6.0.35 
>  
> Thanks

The only reasonable explanation is that you angered the Supreme Tomcat
God by putting your resource in {CATALINA_BASE}/bin.  Being indisposed
to suffer fools for long, she removed it and made you do penance by
putting it in a Sanctioned location such as {CATALINA_BASE}/lib.  Be
Glad O Sister!  The Tomcat God is Merciful and Smiles down upon you!




signature.asc
Description: This is a digitally signed message part


Re: unwanted tcp6 protocol in tribes listener socket;

2013-02-03 Thread Tim Watts
On Mon, 2013-02-04 at 17:51 +1300, Vince Stewart wrote:
> Hi Tim,
> thanks so much for your reply
> netstat -t -l  yields that includes:
> Active Internet connections (only servers)
> Proto Recv-Q  Send-QLocal Address   Foreign
> Address State
> tcp6   0  0  myComputerName:4000
> [::]:*LISTEN
> netstat -atn | grep -P ":4000\W"  yields (without any headings line)
> tcp6   0  0  127.0.1.1:4000
> :::*  LISTEN
> 
> re But why would you want that limitation?
> My first aim was to send a single message from home to my VPS or vice
> versa. When I did not succeed I have been fishing for reasons and the first
> thing that struck me was that Ubuntu was reporting tpc6 but NioReceiver
> object "clusterReceiver" had a "bind" property of type Inet4Address and an
> address of 2130706689 (127.0.0.1).
> 
> Possibly though, this is a normal IPv6 connection and I should treat it
> accordingly. I'll give that ago tomorrow morning and keep CATALINA_OPTS in
> mind as well.
> 

Yes, I believe this is normal.  Looks like your system is using
"IPv4-mapped addresses" which allows interoperability between IPv4&6
hosts without needing two IP stacks on the IPv6 host.

> Many thanks for your help.
> 
> 
> 
> 
> On Mon, Feb 4, 2013 at 4:06 PM, Tim Watts  wrote:
> 
> > On Mon, 2013-02-04 at 14:39 +1300, Vince Stewart wrote:
> > > Using Tomcat 7.0.35 embedded in Java standalone application. Java SE
> > 1.7.0.
> > > Ubuntu 12.04
> > >
> > > Hi All,
> > >
> > > I have an experimental class below. The aim is just to open a listening
> > > port on port 4000 in the "localhost" address.
> > > When this has run, the address for the listener is "127.0.0.1" in other
> > > words an IPv4 address.
> > > However the SocksSocketImpl object representing the real socket continues
> > > to display the* useV4* property as *false*
> > > and my Ubuntu system displays the listening socket as "tpc6".
> > >
> > Listening only for tcp6?  What does
> > netstat -atn | grep -P ":4000\W"
> > show?
> >
> > Perhaps what you want is to set the java.net.preferIPv4Stack system
> > property in CATALINA_OPTS?  Description here:
> >
> > http://docs.oracle.com/javase/7/docs/technotes/guides/net/properties.html
> >
> > But why would you want that limitation?
> >
> >
> > > I suspect there is some configuration issue somewhere and if anyone can
> > > help with this, I would be most grateful.
> > >
> > > I have also noted that the java.nio.channels.spi.SelectorProvider cannot
> > > return a Provider from loadProviderFromProperty() or
> > loadProviderAsService()
> > > so therefore issues *provider =
> > > sun.nio.ch.DefaultSelectorProvider.create()*resulting in a
> > > ServerSocketChannel that is of type
> > > *sun.nio.ch.ServerSocketChannelImpl*
> > > and a ServerSocket of type *sun.nio.ch.ServerSocketAdapter*. I'm not sure
> > > that these are intended and may be I need a system property named
> > > "java.nio.channels.spi.SelectorProvider" to ensure some other
> > > SelectorProvider and therefore different ServerSocketChannel and
> > > ServerSocket types.
> > >
> > > public class TribalAfiliations{
> > >  Channel myChannel;
> > >  private static class MyMemberListener implements MembershipListener{...}
> > >  private static class MyMessageListener implements ChannelListener{...}
> > >
> > >  TribalAfiliations() throws SocketException{
> > >  this.myChannel=new GroupChannel();
> > >  ChannelListener msgListener = new TribalAfiliations.MyMessageListener();
> > >  MembershipListener mbrListener = new
> > TribalAfiliations.MyMemberListener();
> > >  myChannel.addMembershipListener(mbrListener);
> > >  myChannel.addChannelListener(msgListener);
> > >try{
> > >
> > >
> > myChannel.start(Channel.MBR_TX_SEQ|Channel.MBR_RX_SEQ|Channel.SND_TX_SEQ|Channel.SND_RX_SEQ);
> > >/// same problem, withmyChannel.start(Channel.DEFAULT);
> > >}
> > >catch(ChannelException e){
> > >System.out.println(e.getMessage());
> > >}
> > >  }
> > >
> > >
> > >
> > >
> > >
> > >
> >
> >
> 
> 



signature.asc
Description: This is a digitally signed message part


Re: unwanted tcp6 protocol in tribes listener socket;

2013-02-03 Thread Tim Watts
On Mon, 2013-02-04 at 14:39 +1300, Vince Stewart wrote:
> Using Tomcat 7.0.35 embedded in Java standalone application. Java SE 1.7.0.
> Ubuntu 12.04
> 
> Hi All,
> 
> I have an experimental class below. The aim is just to open a listening
> port on port 4000 in the "localhost" address.
> When this has run, the address for the listener is "127.0.0.1" in other
> words an IPv4 address.
> However the SocksSocketImpl object representing the real socket continues
> to display the* useV4* property as *false*
> and my Ubuntu system displays the listening socket as "tpc6".
> 
Listening only for tcp6?  What does
netstat -atn | grep -P ":4000\W"
show?

Perhaps what you want is to set the java.net.preferIPv4Stack system
property in CATALINA_OPTS?  Description here:

http://docs.oracle.com/javase/7/docs/technotes/guides/net/properties.html

But why would you want that limitation?


> I suspect there is some configuration issue somewhere and if anyone can
> help with this, I would be most grateful.
> 
> I have also noted that the java.nio.channels.spi.SelectorProvider cannot
> return a Provider from loadProviderFromProperty() or loadProviderAsService()
> so therefore issues *provider =
> sun.nio.ch.DefaultSelectorProvider.create()*resulting in a
> ServerSocketChannel that is of type
> *sun.nio.ch.ServerSocketChannelImpl*
> and a ServerSocket of type *sun.nio.ch.ServerSocketAdapter*. I'm not sure
> that these are intended and may be I need a system property named
> "java.nio.channels.spi.SelectorProvider" to ensure some other
> SelectorProvider and therefore different ServerSocketChannel and
> ServerSocket types.
> 
> public class TribalAfiliations{
>  Channel myChannel;
>  private static class MyMemberListener implements MembershipListener{...}
>  private static class MyMessageListener implements ChannelListener{...}
> 
>  TribalAfiliations() throws SocketException{
>  this.myChannel=new GroupChannel();
>  ChannelListener msgListener = new TribalAfiliations.MyMessageListener();
>  MembershipListener mbrListener = new TribalAfiliations.MyMemberListener();
>  myChannel.addMembershipListener(mbrListener);
>  myChannel.addChannelListener(msgListener);
>try{
> 
> myChannel.start(Channel.MBR_TX_SEQ|Channel.MBR_RX_SEQ|Channel.SND_TX_SEQ|Channel.SND_RX_SEQ);
>/// same problem, withmyChannel.start(Channel.DEFAULT);
>}
>catch(ChannelException e){
>System.out.println(e.getMessage());
>}
>  }
> 
> 
> 
> 
> 
> 



signature.asc
Description: This is a digitally signed message part


Re: tomcat 6 j_security_check, Apache ProxyPass and the Origin: header

2013-01-18 Thread Tim Watts

On 18/01/13 11:45, Mark Thomas wrote:

On 18/01/2013 11:07, Tim Watts wrote:

Anyone?




Hi Mark,


Tomcat doesn't give two hoots about the origin header.


Curious - I wonder how me editing it helped? Unless it caused some 
knockon somewhere.



It does care
about the Host header.


That would make more sense...


It is hard to tell exactly what is going wrong from your post but you
may need one or more of the following:

http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypreservehost


Hmm - that would be worth a shot - I went down this road when trying to 
stop Wordpress whining about being on the end of a proxy. Didn;t work 
there, but it might here.



Set this to on

Set proxyName="A" anf proxyPort="80" on the connector in server.xml


"A" being the host that is proxying to the tomcat server. Cool - that is 
the sort of thing I was looking for - though I expected to find it in 
the web.xml so maybe I was looking for the wrong thing...



HTH,

Mark



Thank you for your suggestions - I will try them shortly in conjunction 
with Andre's. Lucky - I seemed to have bumped my mail just at the time 
all the experts are around :->>>


Cheers :)

Tim

--
Tim Watts   Tel (VOIP): +44 (0)1580 848360
Systems Manager  Digital Humanities, King's College London

Systems Messages and Notifications: https://systemsblog.cch.kcl.ac.uk/
Personal Blog: http://squiddy.blog.dionic.net/

"A fanatic is one who can't change his mind and won't change the subject."


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: tomcat 6 j_security_check, Apache ProxyPass and the Origin: header

2013-01-18 Thread Tim Watts

On 18/01/13 11:27, André Warnier wrote:


I don't know if this really helps or improves things, but the standard way of 
handling the
Location in redirects is via the ProxyPassReverse directive (which is probably 
more
efficient here - and more easily understood - than the Header-edit).
The ProxyPassReverse directive should work whether you use ProxyPass or not.


Hi Andre,

Yes - I agree about ProxyPassReverse - that likely would fix the 
redirect incorrectness.



I do not really understand the problem with the "Origin" header though.
Proxying from httpd to Tomcat (even with a differenr hostname) is a widely-used 
thing, and
I have never heard of this kind of issue before.
May be something specific to j_security_check, I just don't know.
If you stop editing the request headers, and forward the requests via 
ProxyPass, do you
get this problem also ?


I will try -

A RewriteRule .. .. [P] should be equivalent to a ProxyPass, but just in 
case there is a subtle difference I will give it a try.


I prefer the rewrite rules as there are a bunch of them for other 
reasons and not mixing RewriteRule with ProxyPass makes it very clear 
what order they are being actioned (which is important).


Re: j_security_check: I have see a load of issues reported that match 
this problem - usually the person reports a 408 error and everyone piles 
in and tries to "solve" that with increasing timeout settings.


the 408 is clearly erroneous - and having "fixed" it myself by editing 
the Origin header, that's clearly the causal factor.


Oddly enough, I did my usual trick of downloading the source code (for 
tomcat 6) and doing a recursive grep for any mention of the Origin: 
header. I found nothing! Which makes me wonder if the problem originates 
in a generic Java library???


The whole damn thing is so poorly documented (or at least all I could 
find was a document on who to enable auth checking) that I'm not able to 
tell if there are some options that I *could* be setting in the web.xml 
or somewhere.



It seems reasonable that it might whine about a cross-site auth effort, 
but equally there should be a way to explicitly permit that, at least 
for a named VHOST. As you say, proxying is very common - for load 
balancing if nothing else.


I'll go and try your suggestions -

Thanks :)

Tim



Maybe you should also look at ProxypassReverseCookieDomain ?



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org






--
Tim Watts   Tel (VOIP): +44 (0)1580 848360
Systems Manager  Digital Humanities, King's College London

Systems Messages and Notifications: https://systemsblog.cch.kcl.ac.uk/
Personal Blog: http://squiddy.blog.dionic.net/

"She got her looks from her father. He's a plastic surgeon."


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: tomcat 6 j_security_check, Apache ProxyPass and the Origin: header

2013-01-18 Thread Tim Watts

Anyone?

On 14/01/13 17:24, Watts, Timothy wrote:

Hi,



Is there a way to *tell* j_security_check that an Origin: header set
(during the login POST request) to a remote server is permitted (and is
not an XSS attack)?




We have a tomcat server T running a tomcat webapp that uses
j_security_check to auth users

(Excuse me - I am not the tomcat programmer, I'm the sysadmin trying to
help the programmer, so my terminology might be bad).

Basically,

http://T/webapp/jsp/login works OK

On Server A running apache, we have a config:

RewriteRule ^/jsp/(.*)$ http://T/webapp/jsp/$1 [P]

(which is a ProxyPass - we have many rewrite rules so prefer to use
RewriteRule for consistency)


If we try to login to the tomcat webapp from

http://A/jsp/login

the POST request sends an Origin: header containing http:://A/...

Tomcat seems not to like this as it realises that server A is not where
it is running.

I made it work with a disgraceful hack in the apache config:

RequestHeader edit Origin http:\/\/A\/ http:\/\/T\/ early

But now Tomcat can log us in but sends the wrong URI host in the
Location: header when it replies with the 302 redirect. So I "fix" this
with:

Header edit Location http:\/\/T\/webapp\/jsp\/ http://A/jsp/


It works, but it is horrible and basically leaving a booby trap for the
unwary.


Many thanks,

Tim




--
Tim Watts   Tel (VOIP): +44 (0)1580 848360
Systems Manager  Digital Humanities, King's College London

Systems Messages and Notifications: https://systemsblog.cch.kcl.ac.uk/
Personal Blog: http://squiddy.blog.dionic.net/

"A fanatic is one who can't change his mind and won't change the subject."


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



tomcat 6 j_security_check, Apache ProxyPass and the Origin: header

2013-01-14 Thread Tim Watts

Hi,



Is there a way to *tell* j_security_check that an Origin: header set 
(during the login POST request) to a remote server is permitted (and is 
not an XSS attack)?





We have a tomcat server T running a tomcat webapp that uses 
j_security_check to auth users


(Excuse me - I am not the tomcat programmer, I'm the sysadmin trying to 
help the programmer, so my terminology might be bad).


Basically,

http://T/webapp/jsp/login works OK

On Server A running apache, we have a config:

RewriteRule ^/jsp/(.*)$ http://T/webapp/jsp/$1 [P]

(which is a ProxyPass - we have many rewrite rules so prefer to use 
RewriteRule for consistency)



If we try to login to the tomcat webapp from

http://A/jsp/login

the POST request sends an Origin: header containing http:://A/...

Tomcat seems not to like this as it realises that server A is not where 
it is running.


I made it work with a disgraceful hack in the apache config:

RequestHeader edit Origin http:\/\/A\/ http:\/\/T\/ early

But now Tomcat can log us in but sends the wrong URI host in the 
Location: header when it replies with the 302 redirect. So I "fix" this 
with:


Header edit Location http:\/\/T\/webapp\/jsp\/ http://A/jsp/


It works, but it is horrible and basically leaving a booby trap for the 
unwary.



Many thanks,

Tim

--
Tim Watts


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Tomcat doesn't process error messages

2013-01-03 Thread Tim Watts
On Thu, 2013-01-03 at 12:42 +, Husarik, Branko wrote:
> Hello, 
> 
> I will try to clarify the process as I see it:
> 
> Request message sending process  from Oracle to Web Service
> Oracle --> HTTP --> Tomcat --> Input/Output stream --> webapp -->
> Input/Output stream --> Tomcat --> HTTPS --> Web Service
> 
> Response message receiving process from Web Service to Oracle
> Web Service--> HTTPS --> Tomcat --> Input/Output stream --> webapp -->
> Input/Output stream --> Tomcat --> HTTP --> Oracle
> 
It's also important to note that in the WebService-->webapp path the
webapp is acting as an HTTP client.  If I'm understanding you correctly
then, if the webapp calls request.getInputStream() that stream would be
connected to the Oracle client NOT the WebService.  Since the request
has already been completely read (and presumably closed?) it's
understandable that you would get an IOException trying to read from it.


> The problem occures during the receiving stage (Tomcat -->
> Input/Output stream --> webapp) when the response from Web service
> cointains "HTTP/1.1 500 Internal Server Error"
> 
> Webapp modifies the message (for example it adds basic
> authentication). I hope I don't miss something Big.
> 
> Braňko
> 
> -Original Message-
> From: André Warnier [mailto:a...@ice-sa.com] 
> Sent: 3. ledna 2013 11:23
> To: Tomcat Users List
> Subject: Re: Tomcat doesn't process error messages
> 
> Husarik, Branko wrote:
> > SOAP service logic should manipulate the message, but there is need to 
> > receive message from Tomcat by reading it's input stream. Problem is, there 
> > is only error stream cointaining tomcat error coming from Tomcat. I think 
> > it is caused by message from web service, which cointains " HTTP/1.1 500 
> > Internal Server Error " in HTTP protocol and SOAP message is not forwarded. 
> > It seems to me like common logic, but i don't know, how to set Tomcat to 
> > forward these messages to input stream.
> > 
> Hi.
> Personally, I do not understand what you are trying to say.  I believe that 
> there is some incorrect understanding on your part of how this is supposed to 
> work.
> 
> In the scenario as you describe it,
> - Oracle is the HTTP client for Tomcat (just like any browser could be a 
> client)
> - inside Tomcat, runs some webapp which happens to be a SOAP proxy. What this 
> webapp does, is unknown to Tomcat.  As far as Tomcat is concerned, this 
> webapp is supposed to process some HTTP requests (depending on the URL of the 
> request), and generate a HTTP response.
> Schematically, we have this :
> 
> request :
> Oracle client --> HTTP --> Tomcat --> webapp (-->  (unknown to Tomcat))
> 
> response :
> (  (unknown to Tomcat) --> ) webapp --> Tomcat --> HTTP --> Oracle client
> 
> Repeat : what the webapp does inside is unknown and of (almost) no interest 
> to Tomcat.
> (For example, if the webapp uses HTTPS to communicate with something else, 
> Tomcat never knows this, and never plays any role in that part) So in this 
> case, if the webapp generates a response which happens to be a 500 error, 
> Tomcat will forward this to the (Oracle client).  Tomcat will never read any 
> "input stream coming back from the webapp" or anything like this.
> It is the webapp which is responsible for that kind of thing.
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org



signature.asc
Description: This is a digitally signed message part


RE: Tomcat doesn't process error messages

2013-01-03 Thread Tim Watts
On Thu, 2013-01-03 at 12:42 +, Husarik, Branko wrote:
> Hello, 
> 
> I will try to clarify the process as I see it:
> 
> Request message sending process  from Oracle to Web Service
> Oracle --> HTTP --> Tomcat --> Input/Output stream --> webapp -->
> Input/Output stream --> Tomcat --> HTTPS --> Web Service
> 
> Response message receiving process from Web Service to Oracle
> Web Service--> HTTPS --> Tomcat --> Input/Output stream --> webapp -->
> Input/Output stream --> Tomcat --> HTTP --> Oracle
> 
> The problem occures during the receiving stage (Tomcat -->
> Input/Output stream --> webapp) when the response from Web service
> cointains "HTTP/1.1 500 Internal Server Error"
> 
I just re-read your original email and I may have missed something.  Are
you saying that you get an IOException when you call
request.getInputStream() during a 500 response?  If so can you please
post the stack trace.


> Webapp modifies the message (for example it adds basic
> authentication). I hope I don't miss something Big.
> 
> Braňko
> 
> -Original Message-
> From: André Warnier [mailto:a...@ice-sa.com] 
> Sent: 3. ledna 2013 11:23
> To: Tomcat Users List
> Subject: Re: Tomcat doesn't process error messages
> 
> Husarik, Branko wrote:
> > SOAP service logic should manipulate the message, but there is need to 
> > receive message from Tomcat by reading it's input stream. Problem is, there 
> > is only error stream cointaining tomcat error coming from Tomcat. I think 
> > it is caused by message from web service, which cointains " HTTP/1.1 500 
> > Internal Server Error " in HTTP protocol and SOAP message is not forwarded. 
> > It seems to me like common logic, but i don't know, how to set Tomcat to 
> > forward these messages to input stream.
> > 
> Hi.
> Personally, I do not understand what you are trying to say.  I believe that 
> there is some incorrect understanding on your part of how this is supposed to 
> work.
> 
> In the scenario as you describe it,
> - Oracle is the HTTP client for Tomcat (just like any browser could be a 
> client)
> - inside Tomcat, runs some webapp which happens to be a SOAP proxy. What this 
> webapp does, is unknown to Tomcat.  As far as Tomcat is concerned, this 
> webapp is supposed to process some HTTP requests (depending on the URL of the 
> request), and generate a HTTP response.
> Schematically, we have this :
> 
> request :
> Oracle client --> HTTP --> Tomcat --> webapp (-->  (unknown to Tomcat))
> 
> response :
> (  (unknown to Tomcat) --> ) webapp --> Tomcat --> HTTP --> Oracle client
> 
> Repeat : what the webapp does inside is unknown and of (almost) no interest 
> to Tomcat.
> (For example, if the webapp uses HTTPS to communicate with something else, 
> Tomcat never knows this, and never plays any role in that part) So in this 
> case, if the webapp generates a response which happens to be a 500 error, 
> Tomcat will forward this to the (Oracle client).  Tomcat will never read any 
> "input stream coming back from the webapp" or anything like this.
> It is the webapp which is responsible for that kind of thing.
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org



signature.asc
Description: This is a digitally signed message part


RE: Tomcat doesn't process error messages

2013-01-03 Thread Tim Watts
On Thu, 2013-01-03 at 12:42 +, Husarik, Branko wrote:
> Hello, 
> 
> I will try to clarify the process as I see it:
> 
> Request message sending process  from Oracle to Web Service
> Oracle --> HTTP --> Tomcat --> Input/Output stream --> webapp -->
> Input/Output stream --> Tomcat --> HTTPS --> Web Service
> 
> Response message receiving process from Web Service to Oracle
> Web Service--> HTTPS --> Tomcat --> Input/Output stream --> webapp -->
> Input/Output stream --> Tomcat --> HTTP --> Oracle
> 
> The problem occures during the receiving stage (Tomcat -->
> Input/Output stream --> webapp) when the response from Web service
> cointains "HTTP/1.1 500 Internal Server Error"
> 
> Webapp modifies the message (for example it adds basic
> authentication). I hope I don't miss something Big.
> 

Sounds like 'webapp' is what you referred to as the 'Proxy' in your
original message?  And it sounds like it's the 'webapp' that's
discarding the SOAP response.  Perhaps when it sees the 500 HTTP
response code it simply discards the body of the response and sends that
generic error message instead -- e.g. by calling sendError() and letting
Tomcat generate it's default error response or the webapp's error page
(if one is defined)?

Depending on which component you have control over you can either:
 1. Modify the 'webapp' to unconditionally send back the response
body (perhaps by modifying it's error page if one is defined)
-- OR --
 2. Modify the Web Service to reply with a 200 HTTP response code
even if the service request fails.

#2 seems the more reasonable approach to me since the failure is on the
service level not the HTTP level.

But in either case there's no tweaking in Tomcat itself that will fix
this.


> Braňko
> 
> -Original Message-
> From: André Warnier [mailto:a...@ice-sa.com] 
> Sent: 3. ledna 2013 11:23
> To: Tomcat Users List
> Subject: Re: Tomcat doesn't process error messages
> 
> Husarik, Branko wrote:
> > SOAP service logic should manipulate the message, but there is need to 
> > receive message from Tomcat by reading it's input stream. Problem is, there 
> > is only error stream cointaining tomcat error coming from Tomcat. I think 
> > it is caused by message from web service, which cointains " HTTP/1.1 500 
> > Internal Server Error " in HTTP protocol and SOAP message is not forwarded. 
> > It seems to me like common logic, but i don't know, how to set Tomcat to 
> > forward these messages to input stream.
> > 
> Hi.
> Personally, I do not understand what you are trying to say.  I believe that 
> there is some incorrect understanding on your part of how this is supposed to 
> work.
> 
> In the scenario as you describe it,
> - Oracle is the HTTP client for Tomcat (just like any browser could be a 
> client)
> - inside Tomcat, runs some webapp which happens to be a SOAP proxy. What this 
> webapp does, is unknown to Tomcat.  As far as Tomcat is concerned, this 
> webapp is supposed to process some HTTP requests (depending on the URL of the 
> request), and generate a HTTP response.
> Schematically, we have this :
> 
> request :
> Oracle client --> HTTP --> Tomcat --> webapp (-->  (unknown to Tomcat))
> 
> response :
> (  (unknown to Tomcat) --> ) webapp --> Tomcat --> HTTP --> Oracle client
> 
> Repeat : what the webapp does inside is unknown and of (almost) no interest 
> to Tomcat.
> (For example, if the webapp uses HTTPS to communicate with something else, 
> Tomcat never knows this, and never plays any role in that part) So in this 
> case, if the webapp generates a response which happens to be a 500 error, 
> Tomcat will forward this to the (Oracle client).  Tomcat will never read any 
> "input stream coming back from the webapp" or anything like this.
> It is the webapp which is responsible for that kind of thing.
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org



signature.asc
Description: This is a digitally signed message part


RE: rotation of catalina.out on restart but no truncation

2012-11-09 Thread Tim Watts
On Fri, 2012-11-09 at 08:11 -0600, Caldarale, Charles R wrote:
> > From: Meik Suchlich [mailto:meik.suchl...@brandad-systems.de] 
> > Subject: AW: rotation of catalina.out on restart but no truncation
> 
> > catalina.out is rotated by restart to catalina.-mm-dd.log, but 
> > catalina.out 
> > itself contains the entries of the rotated log.
> 
> > I only want to know, how we can prevent this
> 
> To reiterate: whatever script is doing the rotation is *not* part of
> the standard Tomcat distribution.  It likely is part of the Debian
> mangling of Tomcat into Debian-specific packages.  You'll need to find
> the script and adjust it to meet your needs.
> 

Most likely: 'man logrotate'  will help.


>  - 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: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 



signature.asc
Description: This is a digitally signed message part


Re: Tomcat 6.0.24 SSL Setup issue

2012-10-24 Thread Tim Watts
On Wed, 2012-10-24 at 11:38 +0100, KumareshGopalsamy wrote:
>  
> 
>  
>maxThreads="150" scheme="https" secure="true"
> 
>clientAuth="false" sslProtocol="TLS"
> keystorePass="changeit" keystoreFile="
> C:\apache-tomcat-6.0.24-windows-x64\key \.keystore"/>
> 
The only thing that looks weird is that space after '\key'.  And perhaps
the newline after 'keystoreFile="'?  But maybe I'm reading this too
literally.

Also, it looks like something is already bound to a port you want to
use.

--tim
>  
> 
> 
> 
> 
> 
> I have got the below error message when I restart the Tomcat server
> 
>  
> 
> Could you please help me on this?
> 
>  
> 
> 
> 
> 22-Oct-2012 11:21:43 org.apache.catalina.core.AprLifecycleListener init
> 
> INFO: Loaded APR based Apache Tomcat Native library 1.1.19.
> 
> 22-Oct-2012 11:21:43 org.apache.catalina.core.AprLifecycleListener init
> 
> INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters
> [false], ra
> 
> ndom [true].
> 
> 22-Oct-2012 11:21:43 org.apache.catalina.startup.SetAllPropertiesRule
> begin
> 
> WARNING: [SetAllPropertiesRule]{Server/Service/Connector} Setting
> property 'clie
> 
> ntAuth' to 'false' did not find a matching property.
> 
> 22-Oct-2012 11:21:43 org.apache.catalina.startup.SetAllPropertiesRule
> begin
> 
> WARNING: [SetAllPropertiesRule]{Server/Service/Connector} Setting
> property 'keys
> 
> torePass' to 'changeit' did not find a matching property.
> 
> 22-Oct-2012 11:21:43 org.apache.catalina.startup.SetAllPropertiesRule
> begin
> 
> WARNING: [SetAllPropertiesRule]{Server/Service/Connector} Setting
> property 'keys
> 
> toreFile' to 'C:\.keystore' did not find a matching property.
> 
> 22-Oct-2012 11:21:44 org.apache.coyote.http11.Http11AprProtocol init
> 
> INFO: Initializing Coyote HTTP/1.1 on http-8080
> 
> 22-Oct-2012 11:21:44 org.apache.coyote.http11.Http11AprProtocol init
> 
> SEVERE: Error initializing endpoint
> 
> java.lang.Exception: No Certificate file specified or invalid file
> format
> 
> at org.apache.tomcat.jni.SSLContext.setCertificate(Native
> Method)
> 
> at
> org.apache.tomcat.util.net.AprEndpoint.init(AprEndpoint.java:720)
> 
> at
> org.apache.coyote.http11.Http11AprProtocol.init(Http11AprProtocol.jav
> 
> a:107)
> 
> at
> org.apache.catalina.connector.Connector.initialize(Connector.java:100
> 
> 7)
> 
> at
> org.apache.catalina.core.StandardService.initialize(StandardService.j
> 
> ava:677)
> 
> at
> org.apache.catalina.core.StandardServer.initialize(StandardServer.jav
> 
> a:795)
> 
> at org.apache.catalina.startup.Catalina.load(Catalina.java:540)
> 
> at org.apache.catalina.startup.Catalina.load(Catalina.java:560)
> 
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> 
> java:39)
> 
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> 
> sorImpl.java:25)
> 
> at java.lang.reflect.Method.invoke(Method.java:597)
> 
> at
> org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:261)
> 
> at
> org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
> 
> 22-Oct-2012 11:21:44 org.apache.catalina.startup.Catalina load
> 
> SEVERE: Catalina.start
> 
> LifecycleException:  Protocol handler initialization failed:
> java.lang.Exception
> 
> : No Certificate file specified or invalid file format
> 
> at
> org.apache.catalina.connector.Connector.initialize(Connector.java:100
> 
> 9)
> 
> at
> org.apache.catalina.core.StandardService.initialize(StandardService.j
> 
> ava:677)
> 
> at
> org.apache.catalina.core.StandardServer.initialize(StandardServer.jav
> 
> a:795)
> 
> at org.apache.catalina.startup.Catalina.load(Catalina.java:540)
> 
> at org.apache.catalina.startup.Catalina.load(Catalina.java:560)
> 
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> 
> java:39)
> 
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> 
> sorImpl.java:25)
> 
> at java.lang.reflect.Method.invoke(Method.java:597)
> 
> at
> org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:261)
> 
> at
> org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
> 
> 22-Oct-2012 11:21:44 org.apache.catalina.startup.Catalina load
> 
> INFO: Initialization processed in 1836 ms
> 
> 22-Oct-2012 11:21:44 org.apache.catalina.core.StandardService start
> 
> INFO: Starting service Catalina
> 
> 22-Oct-2012 11:21:44 org.apache.catalina.core.StandardEngine start
> 
> INFO: Starting Servlet Engine: Apache Tomcat/6.0.24
> 
> 22-Oct-2012 11:21:44 org.apache.catalina.startup.HostConfig
> deployDescriptor
> 
> INFO: Deploying configuration descriptor host-manager.xml
> 
> 22-Oct-2012 11:21:44 org.apa

Re: tomcat manager login

2012-09-22 Thread Tim Watts
On Sat, 2012-09-22 at 14:31 +0330, Mohsen Jamali wrote:
> Hi guys,
> After searching the web about how to deploy a war file on Tomcat. 

The simplest way is to just copy the war file to webapps/ under your
Tomcat base.  By default Tomcat will automatically deploy it from there.

> i came to
> the conclusion that i should change the /etc/tomcat6/tomcat-users.xml file
> and add sth like this :
> 
> 
>1. 
>2.   "standard, manager-gui"/>
> 
Did you restart Tomcat?

> but after after adding this two lines ang going to
> localhost:8080/manager/html and entering admin as user and pass it doesn't
> accept it.

That's pretty vague.  What DOES it do?

> what's wrong me.
> thanks



signature.asc
Description: This is a digitally signed message part


RE: Facing Memory leak - 64 bit Tomcat 6.0.35 with windows 2008 R2(64 bit JVM 1.6.0_33)

2012-09-05 Thread Tim Watts
On Wed, 2012-09-05 at 12:16 -0400, PJ Delsh wrote:
> Shailendra,  I'm not an expert, but when we had this same issue, we
> increased the Initial Memory Pool and Maximum Memory pool (XMS and
> XMX) in the Tomcat Monitor in Windows 2008.We also had a leak in some
> of our JSP files that was causing Tomcat to hang several times during
> business hours.  We configured Tomcat so that VisualVM (which comes
> with the Java JDK) could monitor Tomcat memory usage.  Then we took
> heap dumps, and analyzed them for leaks (Shallow Heap vs Retained
> Heap) using Eclipse Memory Analyzer.  Once we fixed the leaks, Tomcat
> was stable.In the interim, if you have Tomcat running as a service in
> Windows, under the Recovery tab set the Tomcat service to restart
> automatically if it does stop.  But if you have memory leaks, the
> Tomcat service probably will still be running but it won't be
> responding.You can also install more than one Tomcat on the same
> server, so if one goes down, the other will still be running.  You
> would also have to configure Apache (or whatever) to work with more
> than one Tomcat.We also had issues with the Tomcat service crashing
> (eg Terminated Unsuccessfully) on Windows.  After months of searching,
> we think the issue was having system.exit(0) in our code.

System.exit(0) is the very definition of successful termination although
it certainly doesn't belong in your webapp's code.

> The truth is that Tomcat is not written well enough to run on
> Windows.  

What rot.  All the problems you mention above you traced back to your
application.  Yet your conclusion is that Tomcat doesn't run well on
Windows.  Really?

> See what you can do to move your app to Linux.  You will find many
> more Tomcat experts on Linux than on Windows.  

I myself have a strong preference for Linux but for reasons unrelated to
Tomcat.  In reality, you'll find that most Tomcat experts don't give a
rat's hiney which OS it runs under.  But they may care which JVM you're
using.

> Tomcat is not like IIS. 
True.

> Developing for Tomcat on Windows is fine, but running production apps
> in Tomcat on Windows is a bad idea.  I wish this was more widely known
> and publicized.-PJ

Total BS.

> > Date: Wed, 5 Sep 2012 11:13:09 -0400
> > From: ch...@christopherschultz.net
> > To: users@tomcat.apache.org
> > Subject: Re: Facing Memory leak - 64 bit Tomcat 6.0.35 with windows 2008 
> > R2(64 bit JVM 1.6.0_33)
> > 
> > -BEGIN PGP SIGNED MESSAGE-
> > Hash: SHA1
> > 
> > Shailendra,
> > 
> > On 9/5/12 2:50 AM, Shailendra Singh wrote:
> > > We are using 64 bit Tomcat 6.0.35 with windows 2008 R2 (64 bit JVM 
> > > 1.6.0_33) and facing memory leak issues(OutOfMemoryError ) after a 
> > > short interval of time( ~30 minutes).
> > > 
> > > We deploy a web application on this version of tomcat and while 
> > > working with the GUI part of the application we face memory leak,
> > > but same application works fine on this windows server for 32 bit
> > > JVM.
> > > 
> > > Please help us if this is an issue with 64 bit Tomcat version or
> > > with 64bit JVM or with its combination. kindly let us know a
> > > solution or any work around or for this.
> > 
> > You've asked this question three times now and have apparently been
> > ignoring every reply you get. Please stop asking if you are going to
> > ignore our questions and advice.
> > 
> > - -chris
> > -BEGIN PGP SIGNATURE-
> > Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
> > Comment: GPGTools - http://gpgtools.org
> > Comment: Using GnuPG with Mozilla - http://www.enigmail.net/
> > 
> > iEYEARECAAYFAlBHbAUACgkQ9CaO5/Lv0PCknACeIwxou02m0hz1Y9HtZTAmzMot
> > A/YAniXDFbzzs+ApHFFXBxL9vtIoXuoN
> > =NjrU
> > -END PGP SIGNATURE-
> > 
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> > For additional commands, e-mail: users-h...@tomcat.apache.org
> > 
> 



signature.asc
Description: This is a digitally signed message part


Re: Problems upgrading to Tomcat 7

2012-07-31 Thread Tim Watts
On Tue, 2012-07-31 at 09:20 -0300, Alejandro Mehring wrote:
> First of all, thank you very much for your quick response! I'm too having a
> hard time believing that tomcat would do something like that... I even
> tried on a new web project and it didn't remove the parent directory
> reference! I'm very confused right now...
> 
> The base url of the application is of the form
> 
> http://host/app/servlets/FrontController
> 
> So when in Tomcat 4 the page fetches the stylesheet (using the
> href="../lightStyle.css" form), it resolves to
> http://host/app/lightStyle.css, whereas in Tomcat 7 it goes to
> http://host/app/servlets/lightStyle.css.
> 

In your 4->7 migration process have you made any source code changes
(e.g. using  tags)?


> Here's the output of the JSP (the header part) for both 4 and 7 version.
> 
> TOMCAT 4
> 
> 
> 
> 
> @import URL("../lightStyle.css")
> 
> 
> 
> 
> 
> 
> 
> Consulta de usuarios
> 
> ...
> 
> ...
> 
> 
> 
> TOMCAT 7
> 
> 
> 
> @import URL("lightStyle.css")
> 
> 
> Error
> 
> 
> 
> 
> 
> ...
> 
> ...
> 
> 
> Thanks again for anything you can think of!
> Cheers!
> Ale
> 
> 
> On Tue, Jul 31, 2012 at 5:10 AM, André Warnier  wrote:
> 
> > Christopher Schultz wrote:
> >
> >> -BEGIN PGP SIGNED MESSAGE-
> >> Hash: SHA1
> >>
> >> Alejandro,
> >>
> >> On 7/30/12 5:48 PM, Alejandro Mehring wrote:
> >>
> >>> I'm migrating to Tomcat 7 a web system that used to run on Tomcat
> >>> 4...
> >>>
> >>
> >> Been there (though I went through 5.5 and 6.0 to get there in a
> >> relatively short amount of time).
> >>
> >>  So far, I've been able to sort out all of the issues I've faced,
> >>> but I'm stuck at one point. When a page loads in Tomcat 4, it goes
> >>> and fetches the stylesheet from the server with a link of the form
> >>>
> >>> 
> >>>
> >>
> >> Although this should work, I always recommend using context-relative
> >> URLs like this:
> >>
> >> " />
> >>
> >> This will ensure that your URLs resolve properly no matter how the
> >> .jsp is being evaluated (for instance, in an include or after a
> >> forward, where the client's URL may not match what your JSP expects).
> >>
> >>  But on Tomcat 7, the parent directory indirection is removed, and I
> >>> can't seem to find the way to prevent this from happening!
> >>>
> >>
> >> That doesn't seem right.
> >>
> >>  What confuses me more, is that when Tomcat generates the *_jsp.java
> >>> files, both 4 and 7 versions generate a line of code like this
> >>> one:
> >>>
> >>> out.write(" >>> type=\"text/css\">\r\n\r\n");
> >>>
> >>> So i can't figure out why the rendering process is removing the
> >>> '../' bit of the link!
> >>>
> >>
> >> I have a hard time believing that Tomcat is modifying anything: in the
> >> case above, Tomcat does not interpret anything at all. As far as
> >> Tomcat is concerned, the above is just a string of characters like
> >> "Hello, World" and has no URL context or anything like that.
> >>
> >> Are you sure this isn't being included by another JSP or forwarded
> >> from another URL?
> >>
> >>  Has anyone faced this problem before? I haven't found any parent
> >>> directory restriction configuration or something that would point
> >>> me in that direction.
> >>>
> >>
> >> What does the output of the JSP look like? That is, what is the actual
> >> content of the page as seen by the client?
> >>
> >>
> > +1
> >
> > And, what does that request for the stylesheet actually look like, when it
> > is sent by the client (the browser) to the server ?
> > You can find that out by using one of the browser plugins like Fiddler2
> > (for IE), HttpFox (for Firefox) or similar.
> > The point is : this "href" is interpreted *by the client* and converted to
> > a full HTTP request URL (with hostname, path and all), before being sent to
> > the server.
> > The server always receives an absolute URL, starting at the root.
> >
> >
> > --**--**-
> > To unsubscribe, e-mail: 
> > users-unsubscribe@tomcat.**apache.org
> > For additional commands, e-mail: users-h...@tomcat.apache.org
> >
> >



signature.asc
Description: This is a digitally signed message part


Re: Tomcat 7.0.25 on an AS/400, V5R4, Another try. Help?

2012-07-30 Thread Tim Watts
On Mon, 2012-07-30 at 09:26 -0700, James Lampert wrote:
> I have just wiped the Tomcat installation on the V5R4 box in question, 
> and done a clean install of 7.0.25.
> 
> No change in its behavior.
> 
> I tried a modified version of our standard Tomcat-launch CL program, 
> that adds a CATALINA_OPTS environment variable, with a value of 
> "-verbose:class" (excerpt from CL program below):
> 
> > ADDENVVAR  ENVVAR(CATALINA_HOME) + 
> >  VALUE('/wintouch/tomcat') REPLACE(*YES)   
> > ADDENVVAR  ENVVAR(CATALINA_OPTS) + 
> >  VALUE('-verbose:class') REPLACE(*YES) 

Did this have any effect?  catalina.out should have a lot of messages
like "[Loaded  from ]"

> > ADDENVVAR  ENVVAR(JAVA_OPTS) + 
> >  VALUE('-Dos400.awt.native=true +  
> >  -Djava.awt.headless=true +
> >  -Djava.version=1.6 -Xms256m -Xmx512m') +  
> >  REPLACE(*YES) 
> >
> > SBMJOB CMD(QSH +   
> >  CMD('/wintouch/tomcat/bin/startup.sh')) + 
> >  JOB(CATALINA) JOBD(WINTOUCH/WTSRVC) + 
> >  INLLIBL(QGPL QTEMP) CPYENVVAR(*YES) + 
> >  ALWMLTTHD(*YES)   
> 
> (ADDENVVAR being the CL command to set an environment variable, SBMJOB 
> to submit a batch job, and QSH to launch QShell, and the CPYENVVAR 
> parameter telling SBMJOB to pass the environment variables from the 
> submitting job to the submitted job. Placing the environment variables 
> in the CL program that launches Tomcat, rather than in catalina.sh or 
> setenv.sh, allows us to avoid having to either roll our own version of 
> the Tomcat ZIP file, or manually install the environment variables, 
> every time we install (or update) Tomcat.)
> 

Bear with me, I'm not proficient in AS/400:  Is it possible to open an
interactive QShell and try to start Tomcat that way?

> The STDOUT spool file:
> >  /wintouch/tomcat/bin/catalina.sh: 001-0019 Error found searching for 
> > command tty. No such path or directory.
> >  Using CATALINA_BASE:   /wintouch/tomcat
> >  
> >  Using CATALINA_HOME:   /wintouch/tomcat
> >  
> >  Using CATALINA_TMPDIR: /wintouch/tomcat/temp   
> >  
> >  Using JRE_HOME:/QOpenSys/QIBM/ProdData/JavaVM/jdk60/32bit  
> >  
> >  Using CLASSPATH:   
> > /wintouch/tomcat/bin/bootstrap.jar:/wintouch/tomcat/bin/tomcat-juli.jar 
> >  
> tells me that it's at least getting to the point in catalina.sh where it 
> spits out selected environment variables, 

There's never been any doubt about that right?  You wouldn't be getting
the ClassNotFoundException otherwise.

> and that it's getting the 
> environment variables we set in the CL program.

Maybe.  But that's neither here nor there.

> 
> --
> JHHL
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 



signature.asc
Description: This is a digitally signed message part


Re: Tomcat 7.0.25 on an AS/400, V5R4, Another try. Help?

2012-07-27 Thread Tim Watts
On Thu, 2012-07-26 at 13:34 -0700, James Lampert wrote:
> Tim Watts wrote:
> 
> > import java.io.File;
> > import java.net.URL;
> > import java.net.URLClassLoader;
> > 
> > public class FindClass {
> > public static void main(String[] args) {
> > try {
> > URLClassLoader loader = new URLClassLoader(
> > new URL[] {new 
> > File("/wintouch/tomcat/lib/catalina.jar").toURI().toURL()});
> > loader.loadClass(args[0]);
> > System.out.println("URLClassLoader found class '" 
> > +args[0] +"'");
> > }
> > catch (Exception e) {
> > e.printStackTrace();
> > }
> > }
> > } 
> 
> I tried it. I'm surprised I was able to get it to compile and run on 
> only the second try (the first try, I had left the stream file editor in 
> the default EBCDIC codepage when I pasted in your source, which JAVAC, 
> not surprisingly, didn't like at all).
> 
> At any rate, I get:
> 
> > java FindClass org.apache.catalina.startup.Catalina  
> > URLClassLoader found class 'org.apache.catalina.startup.Catalina'
> 
OK, so the JVM classloader seems to work.  This is basically identical
to the one used by the bootstrapper.  Which suggests that some/all of
the Tomcat config files are messed up.  Again, are these in EBCDIC or
ASCII?  I presume the unix environment on AS/400 wants ASCII files
generally -- or at least the java stuff does?  And you're sure that's
what you're providing?  You can take a hex dump of, say,
conf/catalina.properties and confirm that?  This would be important to
know.

> 
> And so far as I can determine without doing a clean install of Tomcat, 
> nothing is customized at all, at this point, other than maybe setting 
> port numbers (which it isn't even getting to, yet), and adding your 
> diagnostic lines in logging.properties.
> 
> Paul Holm, on the Midrange.com Java list, suggested turning on verbose 
> mode on Java; I'm not entirely sure how I would even do that for Tomcat.
> 
He probably means -verbose:class .  You could add this to CATALINA_OPTS
or JAVA_OPTS in a bin/setenv.sh script: 

export CATALINA_OPTS="-verbose:class"

It will spit out a lot of data but I don't think that will tell us
anything new at this point.

> What would be the next step?
> 
Don't know how feasible Chris' suggestion would be for you but if you
can boot up a virtual OS such as Linux under AS/400 that might be the
easiest thing to get something working.  Of course, it could also just
be the opening of the next can of worms...

Otherwise, I would go with a clean install.  If you have to let someone
else do the install, download your own copy of the same Tomcat version
and do diffs on bin/*.sh and conf/.  It's hard to offer any useful help
if we don't know what environment we're dealing with.  Also, make sure
no text file conversions occur when unpacking the zip file (e.g. don't
use unzip's -a  option) -- assuming my presumption about the unix env is
correct. 


> --
> JHHL
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 



signature.asc
Description: This is a digitally signed message part


Re: Tomcat 7.0.25 on an AS/400, V5R4, Another try. Help?

2012-07-26 Thread Tim Watts
On Thu, 2012-07-26 at 08:57 -0700, James Lampert wrote:
> Tim Watts wrote:
> 
> > http://tomcat.10.n6.nabble.com/Tomcat-7-0-25-on-an-AS-400-V5R4-Another-try-Help-td4984199.html#a4984215
> 
> >> - Add these lines to the end of conf/logging.properties:
> >> 
> >> org.apache.catalina.startup.Bootstrap.level = ALL
> >> org.apache.catalina.startup.ClassLoaderFactory.level = ALL 
> 
> No effect whatsoever. The catalina.out log and the spool file produced 
> by STDOUT are exactly the same as before.
> 
Well, hopefully not EXACTLY the same -- different timestamps right?
Right? :-)

Looks like it may be using a customized logging configuration.  Find
that and update the above according to the config file location and/or
the logging framework in use.  (Sorry, can't be more specific; you're
leaving us in the dark as to your set up.)  Look in bin/setenv.sh if you
have one.  Or if you've modified any of the distribution scripts (which
generally you shouldn't do) then do a diff against the distribution
versions for 7.0.25.  Please post these so we're not flying so blind.

Also, could this be another ASCII/EBCDIC issue?  I seem to recall that
was a possibility a long time ago but don't recall if that ever panned
out.


> --
> JHHL
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 



signature.asc
Description: This is a digitally signed message part


RE: Project will not build

2012-07-24 Thread Tim Watts
On Tue, 2012-07-24 at 16:00 -0400, Cotton, Joseph B wrote:
> Actually, no.  But a little more poking around fixed it. 

Glad you worked it out.

> By the way, is there any really good reference for Tomcat?  I have
> three O'reiley books and they don’t seem to help much. I can read the
> How-To pages all day and nothing seems to stick.  I am looking for
> somehting that decribes what happens when  And what  each of the
> xml files are for.  Is there a component list?  
> 

Well, as far as an actual *Reference* it's hard to get more
authoritative than the online docs.  Based on some of the traffic here,
there seem to be a number of dubious "tutorials" floating around the
'net but I'm sure there are quality ones as well.  Perhaps you would
find the wiki helpful:

http://wiki.apache.org/tomcat/FrontPage

It has a link for suggested books although some look pretty outdated.

HTH


> -Original Message-
> From: Tim Watts [mailto:t...@cliftonfarm.org] 
> Sent: Tuesday, July 24, 2012 3:36 PM
> To: Tomcat Users List
> Subject: Re: Project will not build
> 
>  Are you asking here because you got no answers on the NetBeans list?  
> Nor the Ant list? 
> 
> 
> On Tue, 2012-07-24 at 15:11 -0400, Cotton, Joseph B wrote:
> > This question concerns a Project that used to work nicely.  Now it 
> > will not build.
> > I am using NetBeans IDE 7.1.1 with Apache Tomcat 7.0.22 I left this 
> > project alone for a few months.
> > 
> > Now when I come back and try to build or run, it errors with this
> > message:
> > Copying 1 file to D:\Documents and Settings\cottonjb\My 
> > Documents\NetBeansProjects\MAFSS2\build\web\WEB-INF\lib
> > D:\Documents and Settings\cottonjb\My
> > Documents\NetBeansProjects\MAFSS2\nbproject\build-impl.xml:687: Warning:
> > Could not find file D:\Documents and Settings\cottonjb\My 
> > Documents\Downloads\javax.servlet.jsp.jstl-api-1.2.1-javadoc.jar to 
> > copy.
> > BUILD FAILED (total time: 0 seconds)
> > 
> > It refers to this in build-impl.xml:
> >  > unless="dist.ear.dir">
> >  > todir="${build.web.dir}/WEB-INF/lib"/>
> >  > files="${file.reference.javax.servlet.jsp.jstl-api-1.2.1-javadoc.jar}"
> > todir="${build.web.dir}/WEB-INF/lib"/>
> >  > files="${file.reference.javax.servlet.jsp.jstl-api-1.2.1-sources.jar}"
> > todir="${build.web.dir}/WEB-INF/lib"/>
> >  > files="${file.reference.javax.servlet.jsp.jstl-api-1.2.1.jar}"
> > todir="${build.web.dir}/WEB-INF/lib"/>
> >  > todir="${build.web.dir}/WEB-INF/lib"/>
> >  > todir="${build.web.dir}/WEB-INF/lib"/>
> > 
> > 
> > 
> > I manually added the javax.servlet.jsp.jstl-api-1.2.1-javadoc.jar to 
> > the NetBeans library and the Project library.
> > 
> > The winzip jar is found.  The jsp jars are not found.  Am I reading 
> > this correctly?
> > 
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> > For additional commands, e-mail: users-h...@tomcat.apache.org
> > 
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org



signature.asc
Description: This is a digitally signed message part


RE: Project will not build

2012-07-24 Thread Tim Watts
On Tue, 2012-07-24 at 15:46 -0400, Martin Gainty wrote:
> http://grepcode.com/snapshot/repo1.maven.org/maven2/javax.servlet.jsp.jstl/javax.servlet.jsp.jstl-api/1.2.1
> 
> This is what youre looking for ..if the ant guy is looking the other
> way you can easily integrate this depdency with maven3 and insert this
> dependency into your depdendency list:
> 
>  
>   javax.servlet.jsp.jstl
>   javax.servlet.jsp.jstl-api
>   1.2.1
>  
> ...other dependencies..
> 
> 
1. I don't think he's using Maven.

> if the ant guy is on top of you or has sufficient power to stop the
> project then copy the jar from the liunk above to the location pointed
> by 
> ${file.reference.winzipaes-20100321.jar} 

2. Red Herring.  That could be an entirely different location.

> (you should see the exact location from the reference of
> file.reference.winzipaes-20100321.jar located somewhere at the top of
> the build.xml)
> then rerun the ant script and make sure the init target is executed
> e.g.
> ant init
> 
> Martin Gainty 
> __ 
> "I know a little about Orson's childhood and seriously doubt if he
> ever was a child..." - Joseph Cotton
> 
3. That's Joseph Cotten

> 
> > Subject: Project will not build
> > Date: Tue, 24 Jul 2012 15:11:40 -0400
> > From: bcot...@dpscs.state.md.us
> > To: users@tomcat.apache.org
> > 
> > This question concerns a Project that used to work nicely.  Now it will
> > not build.  
> > I am using NetBeans IDE 7.1.1 with Apache Tomcat 7.0.22
> > I left this project alone for a few months.  
> > 
> > Now when I come back and try to build or run, it errors with this
> > message:
> > Copying 1 file to D:\Documents and Settings\cottonjb\My
> > Documents\NetBeansProjects\MAFSS2\build\web\WEB-INF\lib
> > D:\Documents and Settings\cottonjb\My
> > Documents\NetBeansProjects\MAFSS2\nbproject\build-impl.xml:687: Warning:
> > Could not find file D:\Documents and Settings\cottonjb\My
> > Documents\Downloads\javax.servlet.jsp.jstl-api-1.2.1-javadoc.jar to
> > copy.
> > BUILD FAILED (total time: 0 seconds)
> > 
> > It refers to this in build-impl.xml:
> >  > unless="dist.ear.dir">
> >  > todir="${build.web.dir}/WEB-INF/lib"/>
> >  > files="${file.reference.javax.servlet.jsp.jstl-api-1.2.1-javadoc.jar}"
> > todir="${build.web.dir}/WEB-INF/lib"/>
> >  > files="${file.reference.javax.servlet.jsp.jstl-api-1.2.1-sources.jar}"
> > todir="${build.web.dir}/WEB-INF/lib"/>
> >  > files="${file.reference.javax.servlet.jsp.jstl-api-1.2.1.jar}"
> > todir="${build.web.dir}/WEB-INF/lib"/>
> >  > todir="${build.web.dir}/WEB-INF/lib"/>
> >  > todir="${build.web.dir}/WEB-INF/lib"/>
> > 
> > 
> > 
> > I manually added the javax.servlet.jsp.jstl-api-1.2.1-javadoc.jar to the
> > NetBeans library and the Project library. 
> > 
> > The winzip jar is found.  The jsp jars are not found.  Am I reading this
> > correctly?
> > 
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> > For additional commands, e-mail: users-h...@tomcat.apache.org
> > 
> 



signature.asc
Description: This is a digitally signed message part


Re: Project will not build

2012-07-24 Thread Tim Watts
 Are you asking here because you got no answers on the NetBeans
list?  Nor the Ant list? 


On Tue, 2012-07-24 at 15:11 -0400, Cotton, Joseph B wrote:
> This question concerns a Project that used to work nicely.  Now it will
> not build.  
> I am using NetBeans IDE 7.1.1 with Apache Tomcat 7.0.22
> I left this project alone for a few months.  
> 
> Now when I come back and try to build or run, it errors with this
> message:
> Copying 1 file to D:\Documents and Settings\cottonjb\My
> Documents\NetBeansProjects\MAFSS2\build\web\WEB-INF\lib
> D:\Documents and Settings\cottonjb\My
> Documents\NetBeansProjects\MAFSS2\nbproject\build-impl.xml:687: Warning:
> Could not find file D:\Documents and Settings\cottonjb\My
> Documents\Downloads\javax.servlet.jsp.jstl-api-1.2.1-javadoc.jar to
> copy.
> BUILD FAILED (total time: 0 seconds)
> 
> It refers to this in build-impl.xml:
>  unless="dist.ear.dir">
>  todir="${build.web.dir}/WEB-INF/lib"/>
>  files="${file.reference.javax.servlet.jsp.jstl-api-1.2.1-javadoc.jar}"
> todir="${build.web.dir}/WEB-INF/lib"/>
>  files="${file.reference.javax.servlet.jsp.jstl-api-1.2.1-sources.jar}"
> todir="${build.web.dir}/WEB-INF/lib"/>
>  files="${file.reference.javax.servlet.jsp.jstl-api-1.2.1.jar}"
> todir="${build.web.dir}/WEB-INF/lib"/>
>  todir="${build.web.dir}/WEB-INF/lib"/>
>  todir="${build.web.dir}/WEB-INF/lib"/>
> 
> 
> 
> I manually added the javax.servlet.jsp.jstl-api-1.2.1-javadoc.jar to the
> NetBeans library and the Project library. 
> 
> The winzip jar is found.  The jsp jars are not found.  Am I reading this
> correctly?
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 



signature.asc
Description: This is a digitally signed message part


Re: Tomcat 7.0.25 on an AS/400, V5R4, Another try. Help?

2012-07-24 Thread Tim Watts
On Tue, 2012-07-24 at 09:17 -0700, James Lampert wrote:
> To recap, I've got a situation where Tomcat is crashing on takeoff, on a 
> V5R4 AS/400, with what appears to be the same setup that works fine on a 
> V6 box, and showing correct environment variables in the STDOUT spool 
> file, and leaving this in Catalina.out.
> >>> java.lang.ClassNotFoundException: org.apache.catalina.startup.Catalina
> >>>   at java.net.URLClassLoader.findClass(URLClassLoader.java:432)
> >>>   at java.lang.ClassLoader.loadClass(ClassLoader.java:642)
> >>>   at java.lang.ClassLoader.loadClass(ClassLoader.java:608)
> >>>   at org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:236)
> >>>   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)
> 
> 
> to which Rainer Jung replied:
> . . .
> > All this works by default in an untampered Tomcat installation. It can 
> > break:
> > 
> > - if catalina.jar is not in /wintouch/tomcat/lib or it is not readable
> > 
> > - if catalina.properties is not in /wintouch/tomcat/conf, or it is not 
> > readable, or the entries for the server.loader or common.loader are broken
> > 
> > - the start scripts do not set -Dcatalina.base=/wintouch/tomcat/ and 
> > -Dcatalina.home=/wintouch/tomcat/ when starting the JVM
> > 
> > - you are changing the place of the used properties file by giving a 
> > non-default value in the system property -Dcatalina.config during startup.
> 
> I can find, so far, no evidence to indicate any of these possibilities. 
> But is there some diagnostic I could enable, that would allow me to find 
> out more detail about the problem? Or maybe something I could try from a 
> QShell command line in a terminal session?
> 
I made some suggestions to this effect the other day:

http://tomcat.10.n6.nabble.com/Tomcat-7-0-25-on-an-AS-400-V5R4-Another-try-Help-td4984199.html#a4984215

Maybe you already tried them or didn't get the email.


> --
> James H. H. Lampert
> Touchtone Corporation
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 



signature.asc
Description: This is a digitally signed message part


Re: problems installing app on tomcat v.7.0.26

2012-07-23 Thread Tim Watts
On Mon, 2012-07-23 at 14:39 -0700, Jim Proctor wrote:
> Greetings — I'm running into errors installing a Java app called
> GeoServer (latest stable v2.1.4) on my Tomcat server at
> sge.lclark.edu:8080 (Tomcat v.7.0.26, JVM v.1.6.0_20-b20). I
> downloaded the .war.zip file, expanded it, and uploaded the .war file
> into a root-level directory (/geoserver) in Tomcat's webapps folder.
> Then, using the Tomcat manager, I tried both clicking "Start" for this
> directory, and used the Deploy menu below. The Deploy option results
> in Tomcat error "Application already exists at path," and the "Start"
> option results in Tomcat error "Application at context path /geoserver
> could not be started." 

Huh?  Are you saying you uploaded geoserver.war to the directory
/webapps/geoserver/ and tried to deploy it from there using the
Manager?  If so, don't do that.  Stop Tomcat, move the .war file to
webapps/, remove the webapps/geoserver/ directory and restart.  Unless
autodeploy is disabled it should deploy automatically.




signature.asc
Description: This is a digitally signed message part


Re: Tomcat 7.0.27 listens only @IPv6 localhost, ignores 'use IPv4' JAVA_OPTS in tomcat.conf. How to correctly force IPv4?

2012-07-22 Thread Tim Watts
On Sun, 2012-07-22 at 11:21 -0700, k9...@operamail.com wrote:
> On Sun, Jul 22, 2012, at 02:08 PM, Tim Watts wrote:
> > By default, Tomcat will listen on port 8080 on all available addresses
> > (IPv6 and 4, barring configuration settings at the OS level).  The key
> > "word" in those java.net properties is "prefer" (i.e. not "require").
> > So the door is still open to IPv6 even with these properties.
> 
> 
> I still would presume that, given the specification of "prefer", when
> localhost is referenced, given the choice of either IPv4 or IPv6 in a
> functional dual-stack, that it *would* prefer and select IPv4, i.e.,
> 127.0.0.1.
> 
But doing so would close the door on ::1, turning "prefer" into
"require".  Whereas binding on ::* allows both IPv6 & 4 in.  I guess
what's confusing in all this is that the "preferences" just deal with
"outbound" addresses and connections (e.g. preferIPv4Stack means the JVM
will send out IPv4 packets etc.).

It's worth noting that, even if it did behave this way, you would still
have needed to specify the loopback address.  Otherwise Tomcat would
have been accessible on any IPv4 address configured on the node.  Just
setting those properties would never have been sufficient for what you
were really after.

> apparently, not the case.
> 
> clarification noted.
> 
> cheers.
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 



signature.asc
Description: This is a digitally signed message part


Re: Tomcat 7.0.27 listens only @IPv6 localhost, ignores 'use IPv4' JAVA_OPTS in tomcat.conf. How to correctly force IPv4?

2012-07-22 Thread Tim Watts
On Sun, 2012-07-22 at 10:32 -0700, k9...@operamail.com wrote:
> Hi,
> 
> On Sun, Jul 22, 2012, at 01:24 PM, Tim Watts wrote:
> > On Sun, 2012-07-22 at 08:03 -0700, k9...@operamail.com wrote:
> > >   Linux svr 3.1.10-1.16-desktop #1 SMP PREEMPT Wed Jun 27
> > >   05:21:40 UTC 2012 (d016078) x86_64 x86_64 x86_64
> > >   GNU/Linux
> > > 
> > > IPv4 is enabled on the server.  The IPv6 stack is also enabled, and
> > > necessarily configured as,
> > > 
> > >   grep bindv6only /etc/sysctl.conf
> > >   net.ipv6.bindv6only = 1
> > > 
> > > I want Tomcat listening on the IPv4 localhost @ 127.0.0.1.
> > 
> > So you want Tomcat to listen on all IPv6 addresses plus the IPv4
> > loopback address but no other IPv4 addresses?
> 
> No.  I want Tomcat7 to listen ONLY on one address: the IPv4 loopback @
> 127.0.0.1.  No other IPv4 addresses, and no IPv6 addresses at all.
> 
Oh, that's easy: specify address="127.0.0.1" on your .  

By default, Tomcat will listen on port 8080 on all available addresses
(IPv6 and 4, barring configuration settings at the OS level).  The key
"word" in those java.net properties is "prefer" (i.e. not "require").
So the door is still open to IPv6 even with these properties.

BTW, not that it will impact you, but it's java.net.preferIPv6Addreses
(defaults to false):
> -Djava.net.preferIPv4Addresses=true

> Specifying a listener proptocol, address & port should be a fairly
> commonplace undertaking ...
> 
> > Since you've told the OS to not allow IPv4 connections on IPv6 sockets,
> > I believe you would need to configure a separate  on the same
> > port for the IPv4 loopback address.
> 
> Not sure if this, then, still holds.
> 
Sounds like you don't need an additional .  Just modify the
existing one.

> I'd understaood that those 'use IPv4' -D options should do exactly what
> I intend to here.   Apparently not, though ...
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 



signature.asc
Description: This is a digitally signed message part


Re: Tomcat 7.0.27 listens only @IPv6 localhost, ignores 'use IPv4' JAVA_OPTS in tomcat.conf. How to correctly force IPv4?

2012-07-22 Thread Tim Watts
On Sun, 2012-07-22 at 08:03 -0700, k9...@operamail.com wrote:
>   Linux svr 3.1.10-1.16-desktop #1 SMP PREEMPT Wed Jun 27
>   05:21:40 UTC 2012 (d016078) x86_64 x86_64 x86_64
>   GNU/Linux
> 
> IPv4 is enabled on the server.  The IPv6 stack is also enabled, and
> necessarily configured as,
> 
>   grep bindv6only /etc/sysctl.conf
>   net.ipv6.bindv6only = 1
> 
> I want Tomcat listening on the IPv4 localhost @ 127.0.0.1.

So you want Tomcat to listen on all IPv6 addresses plus the IPv4
loopback address but no other IPv4 addresses?

Since you've told the OS to not allow IPv4 connections on IPv6 sockets,
I believe you would need to configure a separate  on the same
port for the IPv4 loopback address.


> 
> So, reading here -
> http://tomcat.10.n6.nabble.com/Tomcat-uses-IPv6-td2164369.html#a2164371
> - and elsewhere, I set
> 
>   vi /etc/tomcat/tomcat.conf
>   ...
>   JAVA_OPTS="Djava.net.preferIPv4Stack=true
>   -Djava.net.preferIPv4Addresses=true"
>   CATALINA_OPTS="Djava.net.preferIPv4Stack=true
>   -Djava.net.preferIPv4Addresses=true"
>   ...
> 
> now, @ tomcat start,
> 
>   ps ax | grep tomcat
>6530 ?Sl 0:03 /etc/alternatives/jre/bin/java
>-Djava.net.preferIPv4Stack=true
>-Djava.net.preferIPv4Addresses=true
>-Djava.net.preferIPv4Stack=true
>-Djava.net.preferIPv4Addresses=true -classpath
>
> :/usr/share/tomcat/bin/bootstrap.jar:/usr/share/tomcat/bin/tomcat-juli.jar:/usr/share/java/commons-daemon.jar
>-Dcatalina.base=/usr/share/tomcat
>-Dcatalina.home=/usr/share/tomcat -Djava.endorsed.dirs=
>-Djava.io.tmpdir=/var/cache/tomcat/temp
>
> -Djava.util.logging.config.file=/usr/share/tomcat/conf/logging.properties
>-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
>org.apache.catalina.startup.Bootstrap start
> 
> but, Tomcat still listens only on IPv6
> 
>   netstat -pan --tcp | grep 8080
>   tcp0  0 :::8080 :::*
>  LISTEN  6530/java
> 
> and is unavailable/unreachable @ 127.0.0.1
> 
>   telnet 127.0.0.1 8080
>   Trying 127.0.0.1...
>   telnet: connect to address 127.0.0.1: Connection refused
> 
>   telnet ::1 8080
>   Trying ::1...
>   Connected to ::1.
>   Escape character is '^]'.
>   telnet>
> 
> has the method for getting Tomcat to listen only @ IPv4 changed for v7?
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 



signature.asc
Description: This is a digitally signed message part


Re: Tomcat 7.0.25 on an AS/400, V5R4, Another try. Help?

2012-07-20 Thread Tim Watts
On Thu, 2012-07-19 at 17:25 -0700, James Lampert wrote:
> Tim:
> > This is normally in /lib/catalina.jar.
> >  A. Does it exist there?
> >  B. Does the user the process is running as have permission to
> read
> > that file and directory?
> >  C. If yes to A & B, is the file corrupt?
> 
> /wintouch/tomcat/lib/catalina.jar exists. I had to FTP it elsewhere
> to 
> check its validity, but it seems valid. And the authorities for it
> look 
> exactly the same as those for /wintouch/tomcat/bin/bootstrap.jar.
> 
> Rainer:
> 
> > - if catalina.jar is not in /wintouch/tomcat/lib or it is not
> readable
> > 
> > - if catalina.properties is not in /wintouch/tomcat/conf, or it is
> not readable, or the entries for the server.loader or common.loader
> are broken
> > 
> > - the start scripts do not set -Dcatalina.base=/wintouch/tomcat/ and
> -Dcatalina.home=/wintouch/tomcat/ when starting the JVM
> > 
> > - you are changing the place of the used properties file by giving a
> non-default value in the system property -Dcatalina.config during
> startup.
> 
> Everything looks like it's in the right place, undamaged, and without 
> authority issues.
> 
Perhaps the IBM JDK6 has some bugs running on V5R4?

Some other things you might do to shed more light on this:

- Add these lines to the end of conf/logging.properties:

org.apache.catalina.startup.Bootstrap.level = ALL
org.apache.catalina.startup.ClassLoaderFactory.level = ALL

Then stop/start Tomcat.  You should see a log entry like:
  location X is file:/wintouch/tomcat/lib/catalina.jar


- If you do see an entry as above try compiling and running the
following from /wintouch/tomcat which tests finding a class:

>BEGIN
import java.io.File;
import java.net.URL;
import java.net.URLClassLoader;

public class FindClass {
public static void main(String[] args) {
try {
URLClassLoader loader = new URLClassLoader(
new URL[] {new 
File("/wintouch/tomcat/lib/catalina.jar").toURI().toURL()});
loader.loadClass(args[0]);
System.out.println("URLClassLoader found class '" 
+args[0] +"'");
}
catch (Exception e) {
e.printStackTrace();
}
}
}
 --
> JHHL
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 



signature.asc
Description: This is a digitally signed message part


Re: Tomcat 7.0.25 on an AS/400, V5R4, Another try. Help?

2012-07-19 Thread Tim Watts
On Thu, 2012-07-19 at 15:10 -0700, James Lampert wrote:
> Theoretically, I've ironed out the bugs concerning which JVMs Tomcat 
> will run under, but it still isn't coming up.
> 
> The STDOUT from attempting to start Tomcat is as follows:
> 
> > /wintouch/tomcat/bin/catalina.sh: 001-0019 Error found searching for 
> > command tty. No such path or directory.
> > Using CATALINA_BASE:   /wintouch/tomcat 
> > 
> > Using CATALINA_HOME:   /wintouch/tomcat 
> > 
> > Using CATALINA_TMPDIR: /wintouch/tomcat/temp
> > 
> > Using JRE_HOME:/QOpenSys/QIBM/ProdData/JavaVM/jdk60/32bit   
> > 
> > Using CLASSPATH:   
> > /wintouch/tomcat/bin/bootstrap.jar:/wintouch/tomcat/bin/tomcat-juli.jar 
> >  
> 
> 
> Which is to say, /QOpenSys/QIBM/ProdData/JavaVM/jdk60/32bit/jre is a JVM 
> that, so far as I'm aware, doesn't have any problems with Tomcat. 
> Everything above is exactly the same as in a successful launch on our 
> V6R1 box.
> 
> And Catalina.out is mercifully short this time:
> 
> > java.lang.ClassNotFoundException: org.apache.catalina.startup.Catalina
> > at java.net.URLClassLoader.findClass(URLClassLoader.java:432)
> > at java.lang.ClassLoader.loadClass(ClassLoader.java:642) 
> > at java.lang.ClassLoader.loadClass(ClassLoader.java:608) 
> > at org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:236)
> > at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)
> 
> 
> It's obviously trying to tell me SOMETHING, but I can't determine WHAT 
> it's trying to tell me.
> 
It's trying to tell you it can't find the class o.a.c.startup.Catalina.
This is normally in /lib/catalina.jar.
 A. Does it exist there?
 B. Does the user the process is running as have permission to read
that file and directory?
 C. If yes to A & B, is the file corrupt?

> Any ideas? I don't see the class it's complaining about in either of the 
> two JARs listed on the classpath dumped to STDOUT, but if that were the 
> problem, it wouldn't work here, either.
> 
> --
> JHHL
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 



signature.asc
Description: This is a digitally signed message part


Re: service() failed with http error 413 - error log message from isapi_redirect.log file

2012-07-16 Thread Tim Watts
Hi Ann,

On Mon, 2012-07-16 at 19:18 -0700, ann ramos wrote:
> Hi, 
> 
> 
> 
> We are using HP Service Manager 9.2 system.  The web client tier was
> set up using Windows 2008 R2 64-bit, IIS 7.5, Tomcat 6 and Isapi
> Redirector 1.2.30.
> The client is accessing the site by https because we had created a
> certificate and binded it to the IIS.  Here are the steps that I used:
> 
>  1. Go to IIS.
>  2. Go to Server Certificate.
>  3. Choose complete certificate request.
>  4. Upload the certificate file with the cer extension.
>  5. Go to Default Website.
>  6. Bind it to HTTPS and point it to the certificate that you just
> uploaded in #4.
> Everything is working fine.  User can access the system through web.
> I noticed the following messages (attached fle ) from the
> isapi_redirect.log file.
> 
> 
> Would appreciate it if someone can provide additional information
> about the message and some ways/ideas on stopping them from occurring.
> 
As the log message suggests, 413 is a standard HTTP error code.  Quote
from http://www.faqs.org/rfcs/rfc2616.html:

>
10.4.14 413 Request Entity Too Large

   The server is refusing to process a request because the request
   entity is larger than the server is willing or able to process. The
   server MAY close the connection to prevent the client from continuing
   the request.

   If the condition is temporary, the server SHOULD include a Retry-
   After header field to indicate that it is temporary and after what
   time the client MAY try again.
<

Based on messages like this from the log you attached:

ajp_marshal_into_msgb::jk_ajp_common.c (469): failed appending the 
header value

it sounds like you might need to bump 'max_packet_size' in your
workers.properties.  See 

http://tomcat.apache.org/connectors-doc/reference/workers.html

for details.

HOWEVER, did you notice this in the log?

[Mon Jul 16 15:19:37.365 2012] [3420:6708] [emerg]
HttpFilterProc::jk_isapi_plugin.c (1921):
[/sm9/dv/META-INF/services/javax.xml.transform.TransformerFactory] 
points to the web-inf or meta-inf directory. Somebody tries to hack into the 
site!!!

Someone may be trying to exploit buffer overruns on your site.


> 
> My apologies if the information that I have provided is not complete.
> Let me know so I can add some more details.
> 
> 
> 
> Thanks and regards!
> 
> 
> Ann
> 
> 
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org




signature.asc
Description: This is a digitally signed message part


Re: Logging framework for Tomcat -Exceptions

2012-07-11 Thread Tim Watts
On Thu, 2012-07-12 at 06:35 +0530, Kiran Badi wrote:
> Hi,
> 
> I have below code for catching DAO exceptions,

No, it's not.  It's code that defines an interface and a poorly
implemented exception type.  There's no catching.  Anywhere.

> but I feel its not correct 
> way to do this,Can some one point me to some library which will capture 
> all exceptions which my code will throw and works with tomcat. I 
> implementing Model2 mvc pattern and to my surprise I am able to show 
> values to the view but database is not getting inserted.I am lost given 
> that no exception is also being thrown anywhere.All logs looks clean but 
> DB is not updated.
> 
> import java.sql.Connection;
> 
> public interface DAO {
> 
>  Connection getConnection() throws DAOException;
> 
> }
> 
> public class DAOException extends Exception {
>  private static final long serialVersionUID = 19192L;
> 
>  public DAOException() {
>  }
>  public DAOException(String message) {
>  this.message = message;
>  }
>  @Override
>  public String getMessage() {
>  return message;
>  }
>  public void setMessage(String message) {
>  this.message = message;
>  }
>  private String message;
> 
>  @Override
>  public String toString() {
>  return message;
>  }
> }
> 
Other than including Tomcat in the subject, this has nothing to do with
Tomcat.  No offense, but this really isn't a list for teaching Java.
But what the hell, I'll make one "exception":

public class DAOException extends Exception {
public DAOException(String msg) {
super();
}

public DAOException(String msg) {
super(msg);
}

public DAOException(String msg, Throwable cause) {
super(msg, cause);
}

public DAOException(Throwable cause) {
super(cause);
}
}

That's all I'll say on this thread.


> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 



signature.asc
Description: This is a digitally signed message part


RE: soap location address

2012-07-10 Thread Tim Watts
On Tue, 2012-07-10 at 08:17 -0400, Toman, Chuck [Stock] wrote:
> I wish it was so
> 
:-(

Whatever WebServices/SOAP/WSDL library you're using (if any) should
provide support for setting the target address at runtime.  You can get
help on one of their support forums.  If not (wtf!) make friends with
one of these:

http://axis.apache.org/
http://cxf.apache.org/


> 
> Thanks,
>  
> Charles G. Toman
> Trend DBA
> T: +1 (919) 431 1792 · M: +1 (919) 524 8652
>  
> Customer Focused, Associate Driven.
>  
> -----Original Message-
> From: Tim Watts [mailto:t...@cliftonfarm.org] 
> Sent: Monday, July 09, 2012 12:30 PM
> To: Tomcat Users List
> Subject: RE: soap location address
> 
> On Mon, 2012-07-09 at 10:14 -0400, Toman, Chuck [Stock] wrote:
> > Yes, I believe so
> > Somehow in Apache Tomcat the hostname can be dynamically change for 
> > soap location address.
> > 
> Are you asserting this as fact or do you just wish it were so?  Tomcat
> is a web application container.  What leads you to believe Tomcat and
> the Servlet spec are intrinsically tied to SOAP and/or WSDL?
> 
> 
> > Thanks,
> >  
> > Charles G. Toman
> > Trend DBA
> > T: +1 (919) 431 1792 * M: +1 (919) 524 8652
> >  
> > Customer Focused, Associate Driven.
> >  
> > -Original Message-
> > From: Pid [mailto:p...@pidster.com]
> > Sent: Friday, July 06, 2012 4:44 PM
> > To: Tomcat Users List
> > Subject: Re: soap location address
> > 
> > On 06/07/2012 20:00, Toman, Chuck [Stock] wrote:
> > > How do you dynamically change soap location for WSDL files?
> > 
> > Are you asking this question on the right mailing list?
> > This list is for questions about Apache Tomcat.
> > 
> > 
> > p
> > 
> > 
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org



signature.asc
Description: This is a digitally signed message part


RE: soap location address

2012-07-09 Thread Tim Watts
On Mon, 2012-07-09 at 10:14 -0400, Toman, Chuck [Stock] wrote:
> Yes, I believe so
> Somehow in Apache Tomcat the hostname can be dynamically change for soap
> location address.
> 
Are you asserting this as fact or do you just wish it were so?  Tomcat
is a web application container.  What leads you to believe Tomcat and
the Servlet spec are intrinsically tied to SOAP and/or WSDL?


> Thanks,
>  
> Charles G. Toman
> Trend DBA
> T: +1 (919) 431 1792 * M: +1 (919) 524 8652
>  
> Customer Focused, Associate Driven.
>  
> -Original Message-
> From: Pid [mailto:p...@pidster.com] 
> Sent: Friday, July 06, 2012 4:44 PM
> To: Tomcat Users List
> Subject: Re: soap location address
> 
> On 06/07/2012 20:00, Toman, Chuck [Stock] wrote:
> > How do you dynamically change soap location for WSDL files?
> 
> Are you asking this question on the right mailing list?
> This list is for questions about Apache Tomcat.
> 
> 
> p
> 
> 



signature.asc
Description: This is a digitally signed message part


Re: Error Starting webapp. FAIL - Application at context path /cyclos could not be started.

2012-07-05 Thread Tim Watts
Hi Rick,

On Thu, 2012-07-05 at 13:15 -0400, Rick Bragg wrote:
> Hi,
> 
> After upgrading one of my web applications (cyclos) I can no longer start up 
> the
> web application.  I get the following error:
> 
> FAIL - Application at context path /cyclos could not be started.
> 
> I tried undoing my upgrade, but I still get errors.  Has anybody run into 
> this? 
> What would be the best way to find a solution?
> 
Based on the logs you included the root problem is that the Hibernate
class org.hibernate.type.StandardBasicTypes is missing.  If it were me
administering this system I'd start by contacting the vendor with this
log output and ask them to help me get it fixed.

Hibernate is a commonly used framework for accessing objects in a
database.


> The following is in my catalina log:
> 
> -
> Jul 5, 2012 1:03:22 PM org.apache.catalina.core.StandardContext start
> SEVERE: Error listenerStart
> Jul 5, 2012 1:03:22 PM org.apache.catalina.core.StandardContext start
> SEVERE: Context [/cyclos] startup failed due to previous errors
> Jul 5, 2012 1:03:23 PM org.apache.catalina.loader.WebappClassLoader
> clearReferencesJdbc
> SEVERE: A web application registered the JBDC driver [com.mysql.jdbc.Driver] 
> but
> failed to unregister it when the web application was stopped. To prevent a 
> memory
> leak, the JDBC Driver has been forcibly unregistered.
> Jul 5, 2012 1:03:23 PM org.apache.catalina.loader.WebappClassLoader
> clearReferencesThreads
> SEVERE: A web application appears to have started a thread named [MySQL 
> Statement
> Cancellation Timer] but has failed to stop it. This is very likely to create a
> memory leak.
> Jul 5, 2012 1:03:23 PM org.apache.catalina.loader.WebappClassLoader
> clearThreadLocalMap
> SEVERE: A web application created a ThreadLocal with key of type
> [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@50ba0dfc]) and a value 
> of
> type [org.apache.cxf.bus.CXFBusImpl] (value
> [org.apache.cxf.bus.CXFBusImpl@66ec44cb]) but failed to remove it when the web
> application was stopped. To prevent a memory leak, the ThreadLocal has been
> forcibly removed.
> 
> -
> 
> Also, the following is in my localhost log:
> 
> -
> 
> Jul 5, 2012 1:03:10 PM org.apache.catalina.core.ApplicationContext log
> INFO: HTMLManager: start: Starting web application at '/cyclos'
> Jul 5, 2012 1:03:11 PM org.apache.catalina.core.ApplicationContext log
> INFO: Initializing Spring root WebApplicationContext
> Jul 5, 2012 1:03:22 PM org.apache.catalina.core.StandardContext listenerStart
> SEVERE: Exception sending context initialized event to listener instance of 
> class
> org.springframework.web.context.ContextLoaderListener
> org.springframework.beans.factory.BeanCreationException: Error creating bean 
> with
> name 'sessionFactory' defined in class path resource
> [nl/strohalm/cyclos/spring/persistence.xml]: Invocation of init method failed;
> nested exception is java.lang.NoClassDefFoundError:
> org/hibernate/type/StandardBasicTypes
> Caused by: java.lang.NoClassDefFoundError: 
> org/hibernate/type/StandardBasicTypes
>   at 
> nl.strohalm.cyclos.utils.hibernate.PeriodType.(PeriodType.java:35)
>   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>   at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
>   at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
>   at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
>   at java.lang.Class.newInstance0(Class.java:355)
>   at java.lang.Class.newInstance(Class.java:308)
>   at 
> org.hibernate.type.CompositeCustomType.(CompositeCustomType.java:69)
>   at org.hibernate.type.TypeFactory.heuristicType(TypeFactory.java:265)
>   at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:283)
>   at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:276)
>   at org.hibernate.mapping.Property.isValid(Property.java:207)
>   at 
> org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:458)
>   at org.hibernate.mapping.RootClass.validate(RootClass.java:215)
>   at org.hibernate.cfg.Configuration.validate(Configuration.java:1149)
>   at 
> org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1334)
>   at
> org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:805)
>   at
> nl.strohalm.cyclos.spring.CustomSessionFactoryBean.newSessionFactory(CustomSessionFactoryBean.java:61)
>   at
> org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:745)
>   at
> org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:134)
>   at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.jav

Re: Tomcat shutdown.sh troubleshooting on AS/400

2012-06-20 Thread Tim Watts
On Wed, 2012-06-20 at 19:19 -0400, David Kerber wrote:
> On 6/19/2012 8:07 PM, André Warnier wrote:
> > James Lampert wrote:
> >> . . . and when I looked back at the box I was testing, Tomcat *had* 
> >> finally shut down. And when I ran both the start and stop scripts 
> >> this time, the stop script worked perfectly (and promptly).
> >>
> >> Weird. Why would the shutdown take so long as to give the impression 
> >> it had failed entirely, then eventually work, then later work promptly?
> >>
> >
> > 1) Gremlins. You need to exorcise your datacenter.
> > or
> > 2) because the first time, Tomcat had been running for a while, so it 
> > had a lot of things to shut down nicely and cleanup; while the second 
> > time, it had only be running for a much shorter time, and had less to 
> > clean up ?
> 
> It's not gremlins, it's magic.  I see this all the time on windows: it 
> shuts down in the time I'm willing to wait for it ~50% of the time.  The 
> other 50% I end up killing the task.
> 
Any time I've seen this it's because some app or library has carelessly
started non-daemon threads that are still spinning.  Everything Tomcat
can shutdown has shutdown.  You could always try 'catalina.sh stop
-force'.

> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 



signature.asc
Description: This is a digitally signed message part


Re: Javamail exception in tomcat 7.0.11

2012-06-18 Thread Tim Watts
On Tue, 2012-06-19 at 10:54 +0530, Kiran Badi wrote:
> Hi All,
> 
> I have send mail servlet, which looks something like below,
> 
> protected void doPost(HttpServletRequest request, HttpServletResponse 
> response) throws ServletException, IOException {
> String emailRecipient = request.getParameter("name");
>  //   String emailRecipient = "xxx";
>  try {
>  Message msg = new MimeMessage(this.session);

Looks like your mail session isn't getting initialized properly and you
left out that piece of the puzzle.  How & where does 'this.session' get
set?


>  msg.setFrom(new InternetAddress("xxx"));
>  System.out.println(" remoteAddr is " + emailRecipient + "'");
>  for (int i = 0; i < 10; i++) {
>  msg.setRecipients(Message.RecipientType.TO, 
> InternetAddress.parse(emailRecipient, false));
>  }
> 
>  msg.setSubject("Test email");
>  msg.setText("Hello This is test mail");
>  msg.setSentDate(new Date());
>  Transport.send(msg); *(This is line number 60)*
>  System.out.println("Message sent OK.");
>  } catch (Exception ex) {
>   
> Logger.getLogger(MailSendingServlet.class.getName()).log(Level.SEVERE, 
> null, ex);
>  }
>  }
> }
> 
> and I have javamail reference declared in context.xml something like 
> this one,
> 
>   auth="Container"
>  type="javax.mail.Session"
>  mail.smtp.host="smtp.gmail.com"
>  mail.smtp.port="465"
>  mail.smtp.auth="true"
>  mail.smtp.user="sender userid"
>  password=""
>  mail.smtp.starttls.enable="true"
>  
> mail.smtp.socketFactory.class="javax.net.ssl.SSLSocketFactory"
>  mail.debug="true" />
> 
> and web.xml something like
> 
> 
> My site mail server
> 
> mail/mysitemailsession

Doesn't match your Resource definition name.

--tim

> javax.mail.Session
> Container
> Shareable
> 
> 
> With this setting now I am getting below exception,
> 
> avax.mail.MessagingException: Could not connect to SMTP host: localhost, 
> port: 25;
>nested exception is:
>  java.net.ConnectException: Connection refused: connect
>  at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1934)
>  at 
> com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:638)
>  at javax.mail.Service.connect(Service.java:295)
>  at javax.mail.Service.connect(Service.java:176)
>  at javax.mail.Service.connect(Service.java:125)
>  at javax.mail.Transport.send0(Transport.java:194)
>  at javax.mail.Transport.send(Transport.java:124)
>  at indianads.MailSendingServlet.doPost(MailSendingServlet.java:60)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
>  at 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
>  at 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
>  at 
> org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
>  at 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
>  at 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
>  at 
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
>  at 
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
>  at 
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:498)
>  at 
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
>  at 
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
>  at 
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)
>  at 
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
>  at 
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:394)
>  at 
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243)
>  at 
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
>  at 
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:166)
>  at 
> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
>  at 
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>  at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>  at java.lang.Thread.run(Thread.java:662)
> Caused by: java.net.ConnectException: Connection refused: 

Re: Protect JSP from Direct Access in Tomcat 7.0.xx

2012-06-18 Thread Tim Watts
On Tue, 2012-06-19 at 08:48 +0530, Kiran Badi wrote:
> No its not returning source code.I have couple of jsps where in I use EL 
> in those to access session objects and directly accessing those jsps is 
> not something I want.

Good move.



> >> 2. Is their any extra setting that is required if I move my JSP's inside
> >> web-inf.I created a folder under web-inf and create sample hello
> >> world.jsp and then tried to invoke that jsp but got 404 message.
> >>
> > First of all, it's WEB-INF. Case matters.
> Ok got it.
> >
> >
> > No, there's no special "setting" that will directly expose anything
> > under WEB-INF via a URL.  That's the part of the Servlet Spec.  It's a
> > Good Thing®.  However, if you're trying to make your JSPs inaccessible
> > via URLs, then you can move them there and have them indirectly accessed
> > using a servlet which forwards the request to them.  See
> > ServletContext.getRequestDispatcher() and RequestDispatcher.forward().

> Yup I have lot many of request dispatchers in servlets.Almost all my 
> JSP's are using data which is forwarded by servlets.I pull data from db 
> via servlet, store it in session scope,forward it to jsp and in jsp 
> access it via el.On logoff I remove attributes from the session.
> >

So then those JSPs which are forwarded to by servlets (typical
"controllers" in MVC) could be moved to WEB-INF/whatever and then the
servlets would use a dispatcher to forward to
"/WEB-INF/whatever/sample.jsp" instead of "/webpages/sample.jsp" or
whatever they're using now.  You'd need to physically move those JSPs
then update the servlets to use the JSPs' new location.

> >
> > Hopefully, you're trying to use or move toward the MVC (Model, View,
> > Controller) pattern.  If not, you should.  Google "MVC design pattern".
> > There are many, many frameworks that will make this easier for you (once
> > you learn them): Struts, Spring MVC...
> >
> > If you're well into your project and don't want to add a framework to it
> > you could write a simple servlet that uses an algorithm to map URI paths
> > to JSPs then forwards to the JSP using a dispatcher.  For instance, you
> > could put your JSPs in myapp/WEB-INF/jsps.  Then have the servlet map a
> > URI such as /sample to /WEB-INF/jsps/sample.jsp (all relative
> > to /myapp).
> http://localhost:8080/mysite/WEB-INF/jsp/newjsp.jsp
> 
> I just created folder jsp under WEB-INF and then added newjsp.jsp(this 
> is hello world jsp) and then ran the file.I get 404 error. I am trying 
> all this with netbeans.

Well I hope by now you understand why or we're just going in circles.
Of course, that URL gives a 404: it's trying to access WEB-INF which is
never accessible via HTTP.  But it is accessible via
RequestDispatcher.forward() -- e.g.:


servletCtx.getRequestDispatcher("/WEB-INF/jsp/newjsp.jsp").forward(request, 
response);

This is kind of like what you said earlier that your servlets are
essentially doing, right?


> > This isn't a great approach because you really aren't separating the
> > model from the view (all the app logic and display logic are housed in
> > the JSP -- a maintenance nightmare).  But if you don't have time to
> > re-architect the app now, it will hide the .jsp's from "direct access".
> > And it will put you in a slightly better position if/WHEN you do
> > re-architect it.
> I think I am using kind of MVC pattern of course the one used around 6 
> to 8 years back.I am using jsp as view, servlet as kind controller and 
> then some beans/jstl and el to make my life easy somewhat. I would love 
> to work with frameworks like spring or struts someday.
> 
They're free you know. :-)  But of course, free software doesn't add
hours to the day.  You're basically rolling your own MVC and that will
probably help you understand better what these frameworks do.  But move
away from this as soon as you can.  They've solved a lot of problems you
probably haven't even considered and they can make your applications
much less brittle if you take the time to learn them well.

> Ok  let me explain as what I need again,
> 
> I have form A with say about 10 fields, lets call this as jsp A. So in 
> browser bar it looks like http://localhost:8080/mysite/A.jsp
> 
Ah, so you do want SOME of your JSPs to be URL accessible!  Well, if
A.jsp doesn't and never ever will have any dependencies on the
application's state then fine.  Maybe it's true today but I doubt it
will stay that way.  So it's probably better to be consistent and hide
this as well.

> User fills this A.jsp and then clicks Submit button. It posts the form 
> to Servlet B which does insert in the database and then forwards the 
> request via request dispatcher to  C.jsp which has some confirmation 
> details in it.(Unique reference ids pulled out from DB).
> 
So on submit, an HTTP POST is sent to http://localhost:8080/mysite/B.
Then servlet B does its work and essentially invokes:

ctx.getRequestDispatcher("/C.jsp").forward(request, response);

then C.jsp 

Re: Protect JSP from Direct Access in Tomcat 7.0.xx

2012-06-18 Thread Tim Watts
Hi Kiran,

On Tue, 2012-06-19 at 05:40 +0530, Kiran Badi wrote:
> Hi All,
> 
> I need your guidance again.I have bunch of JSP's close to 100+ which I 
> need to protect it from direct access.
> 
By "direct access" do you mean that http://host/myapp/sample.jsp is
returning the JSP source code rather than executing it?  Or do you mean
that you don't want any .jsp URLs to be accessible to users?

> I have this mapping in web xml and this is not working,It seems that 
> probably i need to define a role first and then use below settings.But 
> unfortunately my app is open internet application which does not use 
> realm at all.
> 
> 
> DenyAccesstoDirectJSP
> 
> sample.jsp
> Sample confirmation JSP
> *.jsp
> GET
> POST
> 
> 
> 
This isn't going to help you. Dump it.

> All my jsp's are residing in the webpages folder of project directory.I 
> know this is incorrect and probably gives direct access to jsp's.
> 
> So I have some clarification to ask,
> 
> 1. is their a way to tell tomcat to not to serve direct jsp's probably 
> via web xml
> 
If by "serve direct jsp's" you mean "don't return source code" then,
yes.  Put them under your web app's directory.  For example, if your web
app's context is 'myapp' then in tomcat it will be deployed under
/webapps/myapp.  You could put them directly in this directory
or group them under a separate directory; 'jsps' for instance.  Then
sample.jsp would be addressed as http://host/myapp/sample.jsp (or
http://host/myapp/jsps/sample.jsp )

> 2. Is their any extra setting that is required if I move my JSP's inside 
> web-inf.I created a folder under web-inf and create sample hello 
> world.jsp and then tried to invoke that jsp but got 404 message.
> 
First of all, it's WEB-INF. Case matters.  

No, there's no special "setting" that will directly expose anything
under WEB-INF via a URL.  That's the part of the Servlet Spec.  It's a
Good Thing®.  However, if you're trying to make your JSPs inaccessible
via URLs, then you can move them there and have them indirectly accessed
using a servlet which forwards the request to them.  See
ServletContext.getRequestDispatcher() and RequestDispatcher.forward().  

Hopefully, you're trying to use or move toward the MVC (Model, View,
Controller) pattern.  If not, you should.  Google "MVC design pattern".
There are many, many frameworks that will make this easier for you (once
you learn them): Struts, Spring MVC...

If you're well into your project and don't want to add a framework to it
you could write a simple servlet that uses an algorithm to map URI paths
to JSPs then forwards to the JSP using a dispatcher.  For instance, you
could put your JSPs in myapp/WEB-INF/jsps.  Then have the servlet map a
URI such as /sample to /WEB-INF/jsps/sample.jsp (all relative
to /myapp). 

This isn't a great approach because you really aren't separating the
model from the view (all the app logic and display logic are housed in
the JSP -- a maintenance nightmare).  But if you don't have time to
re-architect the app now, it will hide the .jsp's from "direct access".
And it will put you in a slightly better position if/WHEN you do
re-architect it.


> - Kiran
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 



signature.asc
Description: This is a digitally signed message part


Re: Threads in Tomcat

2012-05-18 Thread Tim Watts
On Fri, 2012-05-18 at 12:14 -0400, Vance - wrote:
> I'm maintaining a Web application for searching multiple wikis, this app
> runs under Tomcat 6. I need to modify a servlet so it instantiates a
> 'Thread' subclass to perform a wiki availability check every so often, say
> every 30 minutes. Given that I'm no expert on the use of threads, a
> co-worker suggested the following questions to look into:
> 
Might want to study the classes & interfaces in java.util.concurrent
instead of using a raw Thread.  Concurrency often ends up being trickier
than it first appears and the classes & interfaces in this package were
designed to handle a lot of these subtle details for you.  The Executors
class in particular has some pre-built common configurations ready to
instantiate.

> · Does the spawned thread have a time limit imposed by Tomcat?
> 
> · Does it take up worker thread space from other Tomcat threads?
> 
I believe the simple answer to these is No.  Which is to say I don't
believe Tomcat per se enforces such limits.  However, it may be possible
that an active SecurityManager could impose them.  Would be unusual
though -- especially the 1st question.

> 
> I'd appreciate any help anyone could give w.r.t. these questions.



signature.asc
Description: This is a digitally signed message part


Re: how

2012-05-09 Thread Tim Watts
On Wed, 2012-05-09 at 20:29 -0500, Reissner Pabón wrote:
> how can i conect apache toncat 7 to oracle 10 g or oracle 11 g an adobe
> flex? to make a ria?
> tnaks
> 

Your question is too broad, as is your subject line.  Please read this:

http://catb.org/~esr/faqs/smart-questions.html

Also, if you're trying to write an RIA you'll probably get better help
on the Adobe forums.



signature.asc
Description: This is a digitally signed message part


Re: Tomcat advantages

2012-03-14 Thread Tim Watts
I've been trying to get Tomcat to chase my mouse for year with no luck.

On Wed, 2012-03-14 at 10:29 -0400, Mark H. Wood wrote:
> But does it also walk dogs?
> 



signature.asc
Description: This is a digitally signed message part


Re: Inconsistency in AjpMessage.java

2012-02-28 Thread Tim Watts
On Wed, 2012-02-29 at 00:40 +0800, Ken Cheung wrote:
> I observed some code clones in Tomcat and found inconsistent code.
> Could anyone explain why this is not a bug?
> 
If you think it's a bug can you explain why you think so?  You may get
more value out of the homework assignment by pondering this.

> /tomcat/trunk/java/org/apache/coyote/ajp/AjpMessage.java
> 
> 195if (cc == null) {
> 196log.error(sm.getString("ajpmessage.null"),
> 197new NullPointerException());
> 198appendInt(0);
> 199appendByte(0);
> 200return;
> 201}
> 202int start = cc.getStart();
> 203int end = cc.getEnd();
> 204appendInt(end - start);
> 205char[] cbuf = cc.getBuffer();
> 206for (int i = start; i < end; i++) {
> 207char c = cbuf[i];
> 208// Note:  This is clearly incorrect for many strings,
> 209// but is the only consistent approach within the current
> 210// servlet framework.  It must suffice until servlet output
> 211// streams properly encode their output.
> 212if (((c <= 31) && (c != 9)) || c == 127 || c > 255) {
> 213c = ' ';
> 214}
> 215appendByte(c);
> 216}
> 217appendByte(0);
> 
> /tomcat/trunk/java/org/apache/coyote/ajp/AjpMessage.java
> 
> 230if (str == null) {
> 231log.error(sm.getString("ajpmessage.null"),
> 232new NullPointerException());
> 233appendInt(0);
> 234appendByte(0);
> 235return;
> 236}
> 237int len = str.length();
> 238appendInt(len);
> 239for (int i = 0; i < len; i++) {
> 240char c = str.charAt (i);
> 241// Note:  This is clearly incorrect for many strings,
> 242// but is the only consistent approach within the current
> 243// servlet framework.  It must suffice until servlet output
> 244// streams properly encode their output.
> 245if (((c <= 31) && (c != 9)) || c == 127 || c > 255) {
> 246c = ' ';
> 247}
> 248appendByte(c);
> 249}
> 250appendByte(0);
> 
> Quick description of the inconsistency
> Two code snippets are very similar code, but as you see, both codes
> use different ways to compute the condition of for loop.
> 



signature.asc
Description: This is a digitally signed message part


Re: Problem running my webapp with Tomcat 7.0.22.0 Security Manager enabled (Windows Vista)

2012-01-11 Thread Tim Watts
On Tue, 2012-01-10 at 22:06 +, ja...@mobilewebexpert.co.uk wrote:
> Basically, I've created a webapp which runs fine on my development machine, 
> but our actual hosting is shared (and uses a Security Manager) and some new 
> libraries we're using throws up loads of exceptions which we need to 
> replicate locally, hence the need for me to activate the Security Manager.
> 
> If it makes things any simpler, the webapp runs as the root context. Any 
> chance you could help me out with the code I need for catalina.policy?
> 

Sounds like your host provider is prescribing the security constraints
and you want to replicate that to see what adjustments need to be made
to the app and/or the policy file.  Why not grab the policy file on your
target host and start with that?


> - Original Message - 
> From: "Pid" 
> To: "Tomcat Users List" 
> Sent: Tuesday, January 10, 2012 7:47 PM
> Subject: Re: Problem running my webapp with Tomcat 7.0.22.0 Security Manager 
> enabled (Windows Vista)
> 
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 



signature.asc
Description: This is a digitally signed message part


Re: Tomcat 7 SSL activation on AS/400? (Cross-posted to JAVA400)

2012-01-10 Thread Tim Watts
On Tue, 2012-01-10 at 09:35 -0800, James Lampert wrote:
> Tim Watts wrote:
> > That's a possibility if it's padding the passwords as well.   I'm not an
> > AS/400 expert by any means.  Is /foo a preallocated file and if so could
> > the problem be with the way it was allocated?
> 
> The Java-400 list over at Midrange.com is also in on this (albeit not 
> this specific message).
> 
> I tried putting the password, and some of the values, in single quotes, 
> and others in double quotes. No change in behavior: the confirmation 
> message fields were padded, and the quote marks were shown in them.
> 
> Hmm. THIS is INTERESTING!
> 
> If I FTP a keystore created on my WinDoze box onto the 400, then KEYTOOL 
> there can read it. FASCINATING.
> 
Ha!  Presumably you FTP-ed in binary mode?  Maybe that solves your
original problem too.

I know the big mainframe OSes can run Unix VMs which is what the bank
where I used to work ran all their Java servers in.  Perhaps AS/400 has
something similar and would make your app easier to manage.  Hope
there's an AS/400 expert lurking on the list; I don't think I can offer
much further help.

If you do work it out on midrange.com maybe you could post your solution
here too for others to learn from.

Good Luck.

> --
> JHHL
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 



signature.asc
Description: This is a digitally signed message part


Re: Tomcat 7 SSL activation on AS/400? (Cross-posted to JAVA400)

2012-01-09 Thread Tim Watts
On Mon, 2012-01-09 at 15:55 -0800, James Lampert wrote:
> Tim Watts (from the Tomcat Users List) wrote:
> > Can you successfully run this command:
> > 
> > keytool -list -keystore {path/to/your/keystore/file} -storepass 
> > {passwd-in-server.xml}
> 
> It gives the same error message. And yes, EBCDIC is the default encoding 
> for AS/400s. The attributes on /foo show that it has a CCSID of 819, 
> though, which (if my memory and the IBM docs are correct) is ASCII.
> 
> Here's a QShell transcript from a test I ran specifically so that I 
> could post everything without betraying any passwords:
> 
> >> keytool -genkey -alias foo -keyalg RSA -keystore /foo
> >   Enter keystore password: 
> >> bar  
> >   What is your first and last name?
> > [Unknown]: 
> >> James Lampert
> >   What is the name of your organizational unit?
> > [Unknown]: 
> >> Development Lab  
> >   What is the name of your organization?   
> > [Unknown]: 
> >> Touchtone Corporation
> >   What is the name of your City or Locality?   
> > [Unknown]: 
> >> Costa Mesa   
> >   What is the name of your State or Province?  
> > [Unknown]: 
> >> California  
> >   What is the two-letter country code for this unit?  
> > [Unknown]:
> >> US  
> >   Is CN="James Lampert
> >   
> >   
> >   
> >   ", OU="Development Lab  
> >   
> >   
> >   
> >   ", O="Touchtone Corporation 
> > ", L="Costa Mesa 
> >  
> >  
> >  
> >", ST="California 
> >  
> >  
> >  
> >", C="US  
> >  
> >  
> >  
> >   " correct? (type "yes" or "no")
> > [no]:
> >> yes   
> > 
> >   Enter key password for : 
> >   (RETURN if same as keystore password):
> >> bar   
> >   $ 
> >   
> >> keytool -list  -keystore /foo -storepass bar   
> >>  
> >   keytool error (likely untranslated): java.io.IOException: Keystore was 
> > tampered with, or password was incorrect 
> >   $ 
> >   
> 
> Another thought occurred to me: Could the trailing blanks shown in the 
> confirmation message have anything to do with the problem?
> 
That's a possibility if it's padding the passwords as well.   I'm not an
AS/400 expert by any means.  Is /foo a preallocated file and if so could
the problem be with the way it was allocated?

Perhaps what's encrypted in the file was ASCII but the keystrokes in
your shell (and chars in server.xml file) are EBCDIC?

> --
> JHHL
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 



signature.asc
Description: This is a digitally signed message part


Re: Tomcat 7 SSL activation on AS/400?

2012-01-09 Thread Tim Watts
Can you successfully run this command:

keytool -list -keystore {path/to/your/keystore/file} -storepass 
{passwd-in-server.xml}

If so, perhaps it's a character encoding issue?  Don't remember if
AS/400 uses EBCDIC as its default character set.


On Mon, 2012-01-09 at 14:42 -0800, James Lampert wrote:
> I'm attempting to bring up SSL support in Tomcat 7, on an AS/400 (V6R1).
> 
> Tomcat itself runs nicely, but following the instructions on
>  http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html
> I am consistently getting:
> > SEVERE: Failed to initialize connector [Connector[HTTP/1.1-8443]]   
> >   
> > Throwable occurred: org.apache.catalina.LifecycleException: Failed to 
> > initialize component [Connector[HTTP/1.1-8443]] 
> > at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106) 
> >   
> > at 
> > org.apache.catalina.core.StandardService.initInternal(StandardService.java:559)
> >
> > at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102) 
> >   
> > at 
> > org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:781)
> >  
> > at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102) 
> >   
> > at org.apache.catalina.startup.Catalina.load(Catalina.java:573)
> >   
> > at org.apache.catalina.startup.Catalina.load(Catalina.java:598)
> >   
> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
> >   
> > at 
> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
> >  
> > at 
> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
> >  
> > at java.lang.reflect.Method.invoke(Method.java:611)
> >   
> > at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:281)  
> >   
> > at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:449)  
> >   
> > Caused by: org.apache.catalina.LifecycleException: Protocol handler 
> > initialization failed 
> > at 
> > org.apache.catalina.connector.Connector.initInternal(Connector.java:939)
> >   
> > at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102) 
> >   
> > ... 12 more
> >   
> > Caused by: java.io.IOException: Keystore was tampered with, or password was 
> > incorrect 
> > at com.ibm.crypto.provider.JavaKeyStore.engineLoad(Unknown Source) 
> >   
> > at java.security.KeyStore.load(KeyStore.java:414)  
> >   
> > at 
> > org.apache.tomcat.util.net.jsse.JSSESocketFactory.getStore(JSSESocketFactory.java:407)
> > 
> > at 
> > org.apache.tomcat.util.net.jsse.JSSESocketFactory.getKeystore(JSSESocketFactory.java:306)
> >  
> > at 
> > org.apache.tomcat.util.net.jsse.JSSESocketFactory.getKeyManagers(JSSESocketFactory.java:565)
> >   
> > at 
> > org.apache.tomcat.util.net.jsse.JSSESocketFactory.getKeyManagers(JSSESocketFactory.java:505)
> >   
> > at 
> > org.apache.tomcat.util.net.jsse.JSSESocketFactory.init(JSSESocketFactory.java:449)
> > 
> > at 
> > org.apache.tomcat.util.net.jsse.JSSESocketFactory.createSocket(JSSESocketFactory.java:158)
> > 
> > at org.apache.tomcat.util.net.JIoEndpoint.bind(JIoEndpoint.java:369)   
> >   
> > at 
> > org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:553) 
> >   
> > at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:369)  
> >   
> > at 
> > org.apache.coyote.http11.AbstractHttp11JsseProtocol.init(AbstractHttp11JsseProtocol.java:119)
> >  
> > at 
> > org.apache.catalina.connector.Connector.initInternal(Connector.java:937)
> >   
> > ... 13 more
> >   
> > Caused by: java.security.UnrecoverableKeyException: Password verification 
> > failed  
> > ... 26 more
> >   
> 
> I've tried it with the default keystore name, location, and passwords; 
> I've tried it with an explicit name, location, 

Re: Different session id per page

2011-12-30 Thread Tim Watts
On Sat, 2011-12-31 at 00:33 -0600, Jerry Malcolm wrote:
> I have a web app that's worked for years.  I had to go in and do some
> renovations on it due to a few new requirements.  Now for some reason, I'm
> getting a new/different session id for each page.  It's easy to see that's
> what happening since I use the sessionid for a log file name.  Where I used
> to get one log file when clicking through a series of pages, I now get a
> bunch of logging files.  This is a problem since I store data in the
> session object between pages. And now the pages cannot find the data.  This
> is on TC 7.
> 
> The only major thing I'm doing differently now that I can figure might
> affect it is I'm using mod_rewrite in apache httpd.  But I'm grasping at
> straws.  I really don't see how mod_rewrite would be preventing session
> data from passing through.  Or could it?
> 
> The way I understand it, it's simply a session key that's passed back and
> forth as a cookie, right?
> 

The session ID could also be embedded in the URL and perhaps mod_rewrite
is dropping it.  You could compare the access logs in httpd vs tomcat
(enable them in tomcat if necessary).


> Any ideas why I'm losing my sessions on each page?
> 
> Thx
> 
> Jerry



signature.asc
Description: This is a digitally signed message part


Re: Odd NIO connector behavior

2011-12-29 Thread Tim Watts
On Thu, 2011-12-29 at 11:22 -0800, Matthew Tyson wrote:



> How an empty 200 response could be generated
> without executing the logging statement here is a mystery.
> 

Do you still have that MonitoringFilter configured in the web app?
Perhaps it is short circuiting the chain.


> protected void service(HttpServletRequest request, HttpServletResponse
> response) throws ServletException, IOException
> {
> logger.info("REQUEST: " + request.getRemoteAddr() + "  " +
> request.getMethod() + "  " + request.getQueryString() + " | TRACE: ", new
> Throwable());
> 
> if ("OPTIONS".equals(request.getMethod()))
> {
> serviceOptions(request, response);
> return;
> }
> 
> HttpTransport transport = null;
> List allowedTransports = _bayeux.getAllowedTransports();
> for (String transportName : allowedTransports)
> {
> ServerTransport serverTransport =
> _bayeux.getTransport(transportName);
> if (serverTransport instanceof HttpTransport)
> {
> HttpTransport t = (HttpTransport)serverTransport;
> if (t.accept(request))
> {
> transport = t;
> logger.info("ACCEPTED: " + request.getRemoteAddr() + "
>  " + t.getClass().getName());
> break;
> } else {
> logger.info("NOT ACCEPTED: " + request.getRemoteAddr() + "
>  " + t.getClass().getName());
> }
> }
> }
> 
> if (transport == null)
> {
> if (!response.isCommitted()) {
> response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Unknown
> Bayeux Transport");
> } else {
> logger.info("NULL TRANSPORT: " + request.getRemoteAddr());
> }
> }
> else
> {
> try
> {
> _bayeux.setCurrentTransport(transport);
> transport.setCurrentRequest(request);
> transport.handle(request, response);
> }
> finally
> {
> transport.setCurrentRequest(null);
> BayeuxServerImpl bayeux = _bayeux;
> if (bayeux != null)
> bayeux.setCurrentTransport(null);
> }
> }
> }
> 
> Best,
> 
> Matt Tyson



signature.asc
Description: This is a digitally signed message part


Re: using htop, i see many tomcat processes?

2011-12-23 Thread Tim Watts
You may have the "thread view" active.  Each thread gets its own PID.  I
don't know about htop, but in top H (i.e. capital H) toggles this.

And it's CATALINA_OPTS not CATALINA_OPT.


On Fri, 2011-12-23 at 17:23 -0500, S Ahmed wrote:
> In my catalina.sh and set CATALINA_OPT, and I have Xmx around 2GB of ram.
> 
> When I run htop, I see many instances of the tomcat process.
> 
> I'm on a quad core server (xeon 3450), and I am seeing more than 15 tomcat
> processes, and one of the columns shows how the process was started with
> the java executable, and it shows Xmx 128m.
> 
> Can someone make sense of this to me? :)



signature.asc
Description: This is a digitally signed message part


Re: [OT] truststore and keystore SSL

2011-12-19 Thread Tim Watts
On Mon, 2011-12-19 at 18:06 -0500, Christopher Schultz wrote:
> On 12/17/11 2:34 AM, Lau Eng Huat wrote:
> > The question that I have now is how to get it to work with apache 
> > httpclient components.
> 
> Have you tried the apache-commons mailing list?
> 

Actually Http Components has been a top level project for sometime and
they have their own list:

http://hc.apache.org/





signature.asc
Description: This is a digitally signed message part


Re: AJP 1.3 Connector

2011-12-19 Thread Tim Watts
I'm having doubts that mod_jk is actually loading.  You say httpd.conf
contains this line:

LoadModule jk_module modules/mod_jk.so

Unless you have a 'modules' directory under your ServerRoot that line
should probably be  /usr/local/lib/apache/mod_jk.so  or something
similar.

Try this command and see what it turns up:

find /usr -name mod_jk.so

Use the full path in the LoadModule directive and force httpd to reload
its config.



On Mon, 2011-12-19 at 22:26 +0100, André Warnier wrote:
> I'll continue to top-post, since you do.
> (Note that this is not the most logical way to have a conversation; it is 
> easier when 
> questions and responses follow a logical top-down order).
> 
> Summary :
> - your Apache httpd configuration looks OK
> - your Tomcat AJP Connector looks OK
> - you can connect with a browser to the HTTP port of Tomcat, and with the URI 
> "/", you get 
> the Tomcat homepage
> - you can ping the Tomcat server from the Apache httpd server
> - from the Apache httpd server, you can telnet to port 8009 of the Tomcat 
> server
> - if you remove the "JkMount" directive from the Apache httpd configuration, 
> you get the 
> expected Apache httpd page
> - if you insert the JkMount directive, you get a message saying that Tomcat 
> cannot be reached
> ...
> Obviously, something is wrong in the above list.  If, from the command-line 
> on the Apache 
> httpd host, you can establish a TCP connection to the Tomcat host on port 
> 8009 using 
> telnet, then there is no immediate reason why mod_jk should not be able to do 
> the same.
> 
> Unless mod_jk is trying to connect to some other host than the one running 
> Tomcat.
> 
> The thing which causes a bit of doubt there, is that in your 
> workers.properties file, you 
> use the hostname "server2.ourlab.com" for Tomcat, while in all your other 
> checks and 
> messages, you use the hostname "tomcatappserver".
> Is this just a matter of typing and censoring, or are these really two 
> different names ?
> Or are they really two different hosts ?
> That they /should/ be the same host, does not necessarily mean that they 
> /are/.
> 
> Can you confirm that using the /same/ hostname in your workers.properties 
> file and in your 
> ping and telnet tests, everything goes as you have described it so far ?
> 
> Note that you can also use the JkLogFile and JkLogLevel directives, to get 
> more explicit 
> error messages from mod_jk. But seen the above, it would probably just tell 
> you that it 
> cannot connect to "server2".
> 
> 
> Troy-McKoy, Vickie wrote:
> > Yes.  From the apache host, I pinged and telneted the tomcat host.  
> > 
> >  # ping tomcatappserver 
> > PING tomcatappserver (nn.n.nn.nnn) 56(84) bytes of data. 
> > 64 bytes from tomcatappserver (nn.n.nn.nnn): icmp_seq=1 ttl=64 time=0.140 
> > ms 
> >   
> >   
> > # telnet tomcatappserver 8009 
> > Trying nn.n.nn.nnn... 
> > Connected to tomcatappserver (nn.n.nn.nnn). 
> > Escape character is '^]'. 
> > Connection closed by foreign host.
> > 
> > When I attempt to connect to the tomcatappserver via the
> apachewebserver, in firefox browser I get:  "Unable to connect".
> "Firefox can't establish a connection to the serer at
> tomcatappserver:8009."
> > 
> > I just noticed if I put in the browser, the tomcatappserver url with
> the default port, I get the Apache Tomcat/7.0.14 page.  But, if I put
> in the apachewebserver url with the default port, I get this
> message: 
> > 
> > Service Temporarily Unavailable 
> > The server is temporarily unable to service your request due to
> maintenance downtime or capacity problems. Please try again later. 
> >
> 
>  
> > Apache/2.0.64 (Unix) mod_jk/1.2.32 Server at x Port 80
> > 
> > 
> > When I remove the JkMount and JkWorkersFile from httpd.conf, I get
> the default Apache web server page.
> > 
> > 
> > 
> > 
> > -Original Message-
> > From: Tim Watts [mailto:t...@cliftonfarm.org] 
> > Sent: Monday, December 19, 2011 2:20 PM
> > To: Tomcat Users List
> > Subject: RE: AJP 1.3 Connector
> > 
> > On Mon, 2011-12-19 at 13:42 -0500, Troy-McKoy, Vickie wrote:
> >> Thanks for your response.
> >>
> >> When I ping server2, I get valid responses coming back.  When I
> telnet 
> >> to server2 on port 8009, I am also able to connect.
> >>
> > 
> > Did you do the telnet test from a shell on the apache h

RE: AJP 1.3 Connector

2011-12-19 Thread Tim Watts
On Mon, 2011-12-19 at 13:42 -0500, Troy-McKoy, Vickie wrote:
> Thanks for your response.
> 
> When I ping server2, I get valid responses coming back.  When I telnet
> to server2 on port 8009, I am also able to connect.
> 

Did you do the telnet test from a shell on the apache host?  Did you use
the exact name *as configured* (i.e. server2.ourlab.com)?

What's the exact error message you're getting and which component
(browser, apache) is reporting it?


> 
> -Original Message-
> From: André Warnier [mailto:a...@ice-sa.com] 
> Sent: Saturday, December 17, 2011 7:14 AM
> To: Tomcat Users List
> Subject: Re: AJP 1.3 Connector
> 
> Vickie Troy-McKoy wrote:
> > Hi,
> >  
> > I'm in need of a little help.  I'm trying to get my tomcat and
> apache web server instances communicating; they are running on two
> different physical servers.  When I attempt a test of the application
> url, it basically says that a connection cannot be established.  I am
> running the following:  
> >  
> > RHEL Release 5.6 (x86_64)
> > Apache Tomcat 7.0.14
> > Apache/2.0.64
> > mod_jk/1.2.32
> >  
> > On the 1st physical server, the apache webserver instance resides:
> >  
> > httpd.conf contains the following:  
> >  
> > LoadModule jk_module modules/mod_jk.so # JkWorkersFile 
> > conf/workers.properties JkMount /* server2
> >  
> > workers.properties contain the following:
> >  
> > worker.list=server2
> > worker.server2.port=8009
> > worker.server2.host=server2.ourlab.com
> > worker.server2.type=ajp13
> > worker.server2.lbfactor=1
> > worker.server2.socket_keepalive=1
> >  
> >  
> >  
> > On the 2nd physical server, the apache-tomcat instance resides:
> >  
> > server.xml contains the following:
> >  
> > 
> >  > redirectPort="8443" />
> >  
> >  SSLEnabled="true"
> >  [and various other settings]
> > 
> >  
> >  
> > I am missing something.  Can someone please provide help?  Thank
> you...
> > 
> > 
> 
> Hi.
> Your configuration looks fine.
> The problem then should be with the network.
> Try the following :
>  From the Apache httpd server (command-line),
> 
> 1) enter :
> ping server2.ourlab.com
> 
> If you get regular messages showing that the ping packets are being answered, 
> it's fine. 
> If you get error messages, then you have a basic network problem accessing 
> server2.ourlab.com from your Apache host.
> 
> (faked) example of a "good" answer :
> PING server2.ourlab.com (192.168.20.1) 56(84) bytes of data.
> 64 bytes from server2.ourlab.com (192.168.20.1): icmp_seq=1 ttl=64 time=0.326 
> ms
> 64 bytes from server2.ourlab.com (192.168.20.1): icmp_seq=2 ttl=64 time=0.158 
> ms
> 64 bytes from server2.ourlab.com (192.168.20.1): icmp_seq=3 ttl=64 time=0.156 
> ms
> 
> Example of a bad answer :
> - unknown host
> - network is not reachable
> etc..
> 
> 2) If the above is fine, then :
> enter :
> telnet server2.ourlab.com 8009
> 
> It should at least connect (and may drop the connection right away),
> but the point is : is it connecting ? If it is, you will get an answer
> similar to this :
> Trying 192.168.20.1...
> Connected to colin-int.
> Escape character is '^]'.
> 
> xxx
> Connection closed by foreign host.
> 
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
> -
> Email messages cannot be guaranteed to be secure or error-free as
> transmitted information can be intercepted, corrupted, lost,
> destroyed, arrive late or incomplete, or contain viruses. The
> Centers for Medicare & Medicaid Services therefore does not accept
> liability for any error or omissions in the contents of this
> message, which arise as a result of email transmission.
> 
> CONFIDENTIALITY NOTICE: This communication, including any
> attachments, may contain confidential information and is intended
> only for the individual or entity to which it is addressed. Any
> review, dissemination, or copying of this communication by anyone
> other than the intended recipient is strictly prohibited. If you
> are not the intended recipient, please contact the sender by reply
> email and delete and destroy all copies of the original message.
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 



signature.asc
Description: This is a digitally signed message part


Re: Tomcat 6.0 configuration with Adobe LiveCycle DS ES 3.0 Server

2011-12-17 Thread Tim Watts
On Sun, 2011-12-18 at 01:11 +0530, Anshul Asthana wrote:
> 
> 
> 
> 
> 
> From: André Warnier 
> To: Tomcat Users List  
> Sent: Saturday, 17 December 2011 6:03 PM
> Subject: Re: Tomcat 6.0 configuration with Adobe LiveCycle DS ES 3.0
> Server
> 
> 
> I have written a simple web application to accept Name using Flex
> SDK 3.2 HttpService and send it to my web application running on
> Tomcat 6.0 WebServer. We are Using Flex with LiveCycle DS ES 3.0  to
> communicate Web Server(Tomcat 6.0). Am able to accept input in flex
> code but the problem is when trying to send data from Flex client to
> Tomcat WebServer application, it does not work.
> 
> Both LifeCycle DS ES 3.0 and WebServer Tomcat 6.0 are running on same
> machine.
> 
> LiveCycle DS ES 3.0  uses port no - 8400
> WebServer Tomcat 6.0 uses port no - 8000
> 
> LiveCycle DS ES 3.0 uses two configuration files :- 
> a. services-config.xml
> b. proxy-config.xml
> 
> WebServer Tommcat 6.0 uses one configuration files :-
> a. web.xml
> 
> 
> I have worked with Adobe and they have helped me configure LiveCycle
> DS ES 3.0.
> 
> I have Installed Flex Debugger and it gives follwoing error message
> when trying to communicate with Tomcat 6.0 WebServer:-
> 
> [RPC Fault faultString="Send failed"
> faultCode="Client.Error.MessageSend"
> faultDetail="Channel.Connect.Failed error NetConnection.Call.Failed:
> HTTP: Status 404: url:
> 'http://localhost:8400/JLCAPP/messagebroker/amf'"]

I'm no flex expert but, it looks to me like your flex app is getting a
404 (not found) trying to connect to a LifeCycle server service.  I
noticed your web.xml has the messagebroker configured in Tomcat.
Perhaps that belongs in LifeCycle instead?  

To be honest, you're going to get precious little help here.  It looks
to me like your basic problem, at this point, is in understanding how
LifeCycle RPC works not Tomcat.  I suggest you engage the support forums
there.  And/Or go through the tutorials (again).


>  at
> mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:220]
>  at mx.rpc::Responder/fault()[C:\autobuild\3.2.0\frameworks\projects
> \rpc\src\mx\rpc\Responder.as:53]
>  at mx.rpc::AsyncRequest/fault()[C:\autobuild\3.2.0\frameworks
> \projects\rpc\src\mx\rpc\AsyncRequest.as:103]
>  at mx.messaging::ChannelSet/faultPendingSends()[C:\autobuild\3.2.0
> \frameworks\projects\rpc\src\mx\messaging\ChannelSet.as:1482]
>  at mx.messaging::ChannelSet/channelFaultHandler()[C:\autobuild\3.2.0
> \frameworks\projects\rpc\src\mx\messaging\ChannelSet.as:975]
>  at flash.events::EventDispatcher/dispatchEventFunction()
>  at flash.events::EventDispatcher/dispatchEvent()
>  at mx.messaging::Channel/connectFailed()[C:\autobuild\3.2.0
> \frameworks\projects\rpc\src\mx\messaging\Channel.as:997]
>  at mx.messaging.channels::PollingChannel/connectFailed()[C:\autobuild
> \3.2.0\frameworks\projects\rpc\src\mx\messaging\channels
> \PollingChannel.as:354]
>  at mx.messaging.channels::AMFChannel/statusHandler()[C:\autobuild
> \3.2.0\frameworks\projects\rpc\src\mx\messaging\channels
> \AMFChannel.as:390]
>  
> Am providing you with the configuration file that am using at Tomcat
> Webserver namely web.xml.
> 
> web.xml
> ---
> 
> 
> http://java.sun.com/xml/ns/javaee";
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; version="2.5"
> xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
> http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd";>
>  
>
>
>
> 
> 
> flex.messaging.HttpFlexSession
> 
>
> action
> 
> org.apache.struts.action.ActionServlet
> 
>   config
>   /WEB-INF/struts-config.xml
> 
>  
>
>   debug
>   3
>
>
>   detail
>   3
> 
> 1
>   
>   
>
>   MessageBrokerServlet
>   flex.messaging.MessageBrokerServlet
>   
>
> services.configuration.file
> /WEB-INF/flex/services-config.xml
>
>   1
> 
>   
>   
> action
> *.do
>   
>   
>   
> MessageBrokerServlet
> /messagebroker/*
>   
>   
>   
> hello.html
>   
> 
> 
> The problem is that connection is not getting established between
> LiveCycle DS ES 3.0 and Tomcat 6.0 WebServer. Am not able to figure
> out what configuration settings are wrong at my Tomcat 6.0 WebServer
> that is denying the connection between the two servers.
> 
> Hope this explains the problem am facing. In case you need any more
> information please let me know. 
> 
> Regards,
> Anshul.
> 
> Anshul Asthana wrote:
> ...
> 
> > Subject: Re: Tomcat 6.0 configuration with Adobe LiveCycle DS ES 3.0
> Server
> > 
> > I want to configure Tomcat 6.0  with Adobe LiveCycle DS ES 3.0
> Server so that both can communicate with each other. What are the
> steps and settings I need to configure and How to configure them in
> Tomcat 6.0.
> > 
> > Tomcat 6.0 uses port no - 8000.
> > Adobe LiveCycle DS ES 3.0 Server uses port n

[sidebar] Re: Tomcat 6.0 configuration with Adobe LiveCycle DS ES 3.0 Server

2011-12-10 Thread Tim Watts
On Sat, 2011-12-10 at 22:45 +, Pid wrote:
> Yeah...
> 
> Please also just reply to the mailing list.
> 
Are you referring to this (cough, cough):

http://catb.org/~esr/faqs/smart-questions.html#easyreply

(your Reply-To points to your email not the list).

> 
> p
> 
> 
> 
> 
> 
> 
> 



signature.asc
Description: This is a digitally signed message part


Re: Having different apps (contexts) on different ports

2011-11-15 Thread Tim Watts
On Tue, 2011-11-15 at 10:16 -0500, Tim Watts wrote:
> On Tue, 2011-11-15 at 11:38 +, Pid wrote:
> > On 15/11/2011 08:01, Mario Splivalo wrote:
> > > Can I have several Tomcat contexts on different ports?
> > > 
> > > I need to have manager app listening only on 8080, and all the other
> > > apps on 80. Is something like that possible, within one Tomcat Service?
> > 
> > You can have more than one Connector.
> > You can't assign individual apps to specific Connectors.
> > 
> > > Or, if I fire up two services (under same server), each with its own set
> > > of connectors, is manager app from one service able to manage apps in
> > > another?
> > 
> > The Manager application can only manage applications in the same Host.
> > Unfortunately, separate Services will have separate Hosts.
> > 
> Perhaps an alternative that may work "good enough" would be to bind 8080
> to localhost and 80 to a "public" IP address.  Or, similarly, if the
> machined is multi-homed bind each port to different addresses.
> Presumably, you'd want the 8080 address to be on an address that doesn't
> have a route to the Internet.
> 
> See 'address' on /docs/config/http.html .
> 
> All the apps will still be available on both ports but if you're
> concerned about the public accessing 'manager' then putting it on an
> address they can't reach would give you some measure of isolation.
> 
> Of course, this also means *you* can't reach 'manager' from "outside"
> either -- unless you tunnel in via ssh or something.
> 

And of course, no need to use different ports if you're using different
addresses.  But I'm sure that light would have come on soon enough  :-)

> > 
> > p
> > 
> 
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Having different apps (contexts) on different ports

2011-11-15 Thread Tim Watts
On Tue, 2011-11-15 at 11:38 +, Pid wrote:
> On 15/11/2011 08:01, Mario Splivalo wrote:
> > Can I have several Tomcat contexts on different ports?
> > 
> > I need to have manager app listening only on 8080, and all the other
> > apps on 80. Is something like that possible, within one Tomcat Service?
> 
> You can have more than one Connector.
> You can't assign individual apps to specific Connectors.
> 
> > Or, if I fire up two services (under same server), each with its own set
> > of connectors, is manager app from one service able to manage apps in
> > another?
> 
> The Manager application can only manage applications in the same Host.
> Unfortunately, separate Services will have separate Hosts.
> 
Perhaps an alternative that may work "good enough" would be to bind 8080
to localhost and 80 to a "public" IP address.  Or, similarly, if the
machined is multi-homed bind each port to different addresses.
Presumably, you'd want the 8080 address to be on an address that doesn't
have a route to the Internet.

See 'address' on /docs/config/http.html .

All the apps will still be available on both ports but if you're
concerned about the public accessing 'manager' then putting it on an
address they can't reach would give you some measure of isolation.

Of course, this also means *you* can't reach 'manager' from "outside"
either -- unless you tunnel in via ssh or something.

> 
> p
> 



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: 403 error starting tomcat 7.0.22 application on windows 7

2011-11-14 Thread Tim Watts
On Mon, 2011-11-14 at 09:56 +0400, bas...@obninsk.com wrote:
> 
> -Исходное сообщение- 
> From: Tim Watts
> Sent: Monday, November 14, 2011 9:09 AM
> To: Tomcat Users List
> Subject: Re: 403 error starting tomcat 7.0.22 application on windows 7
> 
> On Mon, 2011-11-14 at 08:17 +0400, bas...@obninsk.com wrote:
> > > Can you paste the application web.xml file (inline) into your reply?
> > >
> > > 
> > > http://www.w3.org/2001/XMLSchema-instance";
> > > xmlns="http://java.sun.com/xml/ns/javaee";
> > > xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd";
> > > xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
> > > http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd";
> > > version="2.5">
> > >  WEB query
> > >  
> > >  
> > >404
> > >/includes/error404.jsp
> > >  
> > >  
> > >500
> > >/includes/error500.jsp
> > >  
> > >  
> > >
> > >reportcmnt
> > >reportcmnt
> > >/jsp/reportcmnt.jsp
> > >  
> > >  
> > >reportcmnt
> > >/reportcmnt
> > >  
> > > 
> > >
> 
> > Do you have an access log configured, if so, what does it show?
> >
> > 0:0:0:0:0:0:0:1 - - [13/Nov/2011:09:50:32 +0300] "GET /query HTTP/1.1" 302
> > 125 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.2 (KHTML, 
> > like
> > Gecko) Chrome/15.0.874.120 Safari/535.2"
> > 0:0:0:0:0:0:0:1 - - [13/Nov/2011:09:50:32 +0300] "GET /query/ HTTP/1.1" 
> > 403
> > 964 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.2 (KHTML, 
> > like
> > Gecko) Chrome/15.0.874.120 Safari/535.2"
> > 0:0:0:0:0:0:0:1 - - [13/Nov/2011:11:40:54 +0300] "GET /query HTTP/1.1" 302
> > 125
> > "http://localhost:8082/manager/html;jsessionid=4D76EA53493CA915B556DB02D1D9932E?org.apache.catalina.filters.CSRF_NONCE=95AB554C225507BE146FBA41E2BF3A97";
> > "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.2 (KHTML, like Gecko)
> > Chrome/15.0.874.120 Safari/535.2"
> > 0:0:0:0:0:0:0:1 - - [13/Nov/2011:11:40:54 +0300] "GET /query/ HTTP/1.1" 
> > 403
> > 964
> > "http://localhost:8082/manager/html;jsessionid=4D76EA53493CA915B556DB02D1D9932E?org.apache.catalina.filters.CSRF_NONCE=95AB554C225507BE146FBA41E2BF3A97";
> > "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.2 (KHTML, like Gecko)
> > Chrome/15.0.874.120 Safari/535.2"
> > What user account is Tomcat running under?
> 
> A: local system account. It has full access to the application's folders and 
> files.
> >
> >
> 
> OK, you're getting a 403 on http://localhost:8082/query/ but your
> web.xml only shows a mapping for /reportcmnt and no welcome file
> declarations.  What happens if you use /query/reportcmnt instead?
> 
> A: 403 error again.
> 
> Is there perhaps an index.html that would have redirected
> to /query/reportcmnt?
> 
> A: My index.html contains
> 
> 
>   
>   
> WEB query
>   
>   
> location="jsp/app.jsp"
>   
> 
> 
> Q: What version of Tomcat were you using prior to the win7 migration?
> 
> A: Tomcat 7.0.22.
> I've just installed Tomcat 7.0.22 on WinXP,
> then copied my app from Win7 to the WinXp webapps folder and run my app.
> It works fine.
> 
So (xp,tc7)=OK but (win7,tc7)=403 for 'query' but not 'manager'.
Presumably on XP you're also running Tomcat as a service under the local
system account?  Just for grins, have you tried stopping the service
then running Tomcat from a command shell (e.g. {tc-home}\bin
\startup.bat) on win7 under your user account and see if you still get
the 403?

Just guessing here but is it possible your web app files have security
constraints attached to them that aren't being resolved on win7 but are
on xp?

Are there any conditions in your app logic that would return a 403?
Perhaps it can't access a service from win7 but can from xp? Licensing?

Also, looks like you've done some tweaking on server.xml (e.g. different
server port).  Can you paste in this file as well?




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: 403 error starting tomcat 7.0.22 application on windows 7

2011-11-13 Thread Tim Watts
On Mon, 2011-11-14 at 08:17 +0400, bas...@obninsk.com wrote:
> > Can you paste the application web.xml file (inline) into your reply?
> >
> > 
> > http://www.w3.org/2001/XMLSchema-instance";
> > xmlns="http://java.sun.com/xml/ns/javaee";
> > xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd";
> > xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
> > http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd";
> > version="2.5">
> >  WEB query
> >  
> >  
> >404
> >/includes/error404.jsp
> >  
> >  
> >500
> >/includes/error500.jsp
> >  
> >  
> >
> >reportcmnt
> >reportcmnt
> >/jsp/reportcmnt.jsp
> >  
> >  
> >reportcmnt
> >/reportcmnt
> >  
> > 
> >

> Do you have an access log configured, if so, what does it show?
> 
> 0:0:0:0:0:0:0:1 - - [13/Nov/2011:09:50:32 +0300] "GET /query HTTP/1.1" 302 
> 125 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.2 (KHTML, like 
> Gecko) Chrome/15.0.874.120 Safari/535.2"
> 0:0:0:0:0:0:0:1 - - [13/Nov/2011:09:50:32 +0300] "GET /query/ HTTP/1.1" 403 
> 964 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.2 (KHTML, like 
> Gecko) Chrome/15.0.874.120 Safari/535.2"
> 0:0:0:0:0:0:0:1 - - [13/Nov/2011:11:40:54 +0300] "GET /query HTTP/1.1" 302 
> 125 
> "http://localhost:8082/manager/html;jsessionid=4D76EA53493CA915B556DB02D1D9932E?org.apache.catalina.filters.CSRF_NONCE=95AB554C225507BE146FBA41E2BF3A97";
>  
> "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.2 (KHTML, like Gecko) 
> Chrome/15.0.874.120 Safari/535.2"
> 0:0:0:0:0:0:0:1 - - [13/Nov/2011:11:40:54 +0300] "GET /query/ HTTP/1.1" 403 
> 964 
> "http://localhost:8082/manager/html;jsessionid=4D76EA53493CA915B556DB02D1D9932E?org.apache.catalina.filters.CSRF_NONCE=95AB554C225507BE146FBA41E2BF3A97";
>  
> "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.2 (KHTML, like Gecko) 
> Chrome/15.0.874.120 Safari/535.2"
> What user account is Tomcat running under?
> 
> 

OK, you're getting a 403 on http://localhost:8082/query/ but your
web.xml only shows a mapping for /reportcmnt and no welcome file
declarations.  What happens if you use /query/reportcmnt instead?  Is
there perhaps an index.html that would have redirected
to /query/reportcmnt?

Q: What version of Tomcat were you using prior to the win7 migration?

If you were using a pre-Tomcat7 version you may be butting up against
7's stricter servlet compliance.  You should explicitly declare a
welcome file in web.xml.


> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: JVM config for tomcat7.0.19

2011-11-11 Thread Tim Watts
On Fri, 2011-11-11 at 08:40 -0800, celtic man wrote:
> Is this JAVA setting below OK ?
> 
> cat /proc/meminfo
> MemTotal:  4149124 kB
> MemFree:457884 kB
> 
> 4Gb total memory on the linux box and have 0.4GB free memory and

I think MemFree misleading.  Don't quote me but I think you have to add
Buffers as well.  Or if you can run gnome apps try running
gnome-system-monitor and click the Resources tab.  Gives a more
realistic picture I think.

> tomcat(6.0.18) running with below :
> 
> JAVA_OPTS=-Xmx2000M so that i.e 1.9GB ??
> 
> or please suggest me the best settings that i add and not have any memory
> leak issues on the application..
> 
No setting will fix a memory leak.  Eventually you'll get
OutOfMemoryExceptions.  It becomes a question of when and how often do
you want to restart.  

You haven't actually indicated in this thread whether you're getting
OOMs.  Is that the problem you're trying to address?


> 
> 
> Pid * wrote:
> > 
> > On 10/11/2011 22:45, Igor Cicimov wrote:
> >>>
> >>> JAVA_OPTS=-Xms2048M -Xmx2048M -XX:Permsize=512m -XX:MaxPermsize=512m
> >>>
> >> 
> >> You are allocating here 2.5GB of memory to tomcat ... how do you expect
> >> it
> >> to start on a box with 2GB in total of which only 500MB are available?
> > 
> > +1  It's the perfect way to achieve shockingly bad performance.
> > 
> > 
> > p
> > 
> > 
> >> On Fri, Nov 11, 2011 at 8:25 AM, Christopher Schultz <
> >> ch...@christopherschultz.net> wrote:
> >> 
> >> Celtic,
> >> 
> >> On 11/10/11 12:02 PM, celtic man wrote:
> > So i have updated the setenv.sh with   -Xms2048M -Xmx2048M
> > -XX:Permsize=512m -XX:MaxPermsize=512m  and  restarted tomcat..
> >> 
> >> Where is setenv.sh located? Can you give us the full contents of that
> >> file?
> >> 
> > but when i grep for tomcat process i don't see it ..
> >
> > ps -ef | grep tomcat root 10959 1 19 14:57 pts/4
> > 00:00:29 /appl/java/bin/java -Dnop
> > -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
> > -Djava.endorsed.dirs=/appl/tomcat/endorsed -classpath
> > /appl/tomcat/bin/bootstrap.jar:/appl/tomcat/bin/tomcat-juli.jar
> > -Dcatalina.base=/appl/tomcat -Dcatalina.home=/appl/tomcat
> > -Djava.io.tmpdir=/appl/tomcat/temp
> > org.apache.catalina.startup.Bootstrap start
> >> 
> >> How are you starting Tomcat? Give us the exact command you are running.
> >> 
> >> -chris
> >>>
> >>> -
> >>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> >>> For additional commands, e-mail: users-h...@tomcat.apache.org
> >>>
> >>>
> >> 
> > 
> > -- 
> > 
> > [key:62590808]
> > 
> > 
> >  
> > 
> 



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: JVM config for tomcat7.0.19

2011-11-11 Thread Tim Watts
On Thu, 2011-11-10 at 12:02 -0800, celtic man wrote:
> Thanks a lot for the quick response..
> 
> So i have updated the setenv.sh with   -Xms2048M -Xmx2048M -XX:Permsize=512m
> -XX:MaxPermsize=512m  and  restarted tomcat..
> 
> but when i grep for tomcat process i don't see it ..
> 
> ps -ef | grep tomcat
> root 10959 1 19 14:57 pts/400:00:29 /appl/java/bin/java -Dnop
> -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
> -Djava.endorsed.dirs=/appl/tomcat/endorsed -classpath
> /appl/tomcat/bin/bootstrap.jar:/appl/tomcat/bin/tomcat-juli.jar
> -Dcatalina.base=/appl/tomcat -Dcatalina.home=/appl/tomcat
> -Djava.io.tmpdir=/appl/tomcat/temp org.apache.catalina.startup.Bootstrap
> start
> 

If that's the output of grep after starting tomcat then you are in fact
seeing it.  Tomcat is a *java* application.  Hence it runs under java.

> do you know why ??
> 
> 
> Christopher Schultz-2 wrote:
> > 
> > -BEGIN PGP SIGNED MESSAGE-
> > Hash: SHA1
> > 
> > Celtic,
> > 
> > On 11/10/11 8:01 AM, celtic man wrote:
> >> Can i set the below parameters on the setenv.sh?
> > 
> > Sure.
> > 
> >> application running on tomcat7.0.19 on linux 64 bit with 2GB total
> >> memory and 0.5 GB available memory on the machine.
> >> 
> >> JAVA_OPTS=-Xms2048M -Xmx2048M -XX:Permsize=512m
> >> -XX:MaxPermsize=512m
> > 
> > If you only have 0.5GiB available, perhaps requesting a 2GiB heap
> > isn't wise.
> > 
> >> The current setting on the setenv.sh file is :
> >> CATALINA_OPTS=-Xmx4000M
> > 
> > Well, lowering it from 4GiB to 2 GiB will certainly help free up some
> > of your RAM.
> > 
> > If you only have a 2GiB machine, why bother running 64-bit?
> > 
> > - -chris
> > -BEGIN PGP SIGNATURE-
> > Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
> > Comment: GPGTools - http://gpgtools.org
> > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> > 
> > iEYEARECAAYFAk68AJEACgkQ9CaO5/Lv0PBL6wCfR7KU0u5uYtX57GBJOZd6oI49
> > hzYAoLOjPtnLyZjQ7bSoOVI/ti+LO9rC
> > =qUbu
> > -END PGP SIGNATURE-
> > 
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> > For additional commands, e-mail: users-h...@tomcat.apache.org
> > 
> > 
> > 
> 



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Session expiration - browser -Web application

2011-11-04 Thread Tim Watts
Léa,

Life needn't be this difficult. :-)  You're reinventing wheels here
instead of understanding how the wheels you already have work.  Again,
read the spec.  Pretty please.  So many questions will be answered.


On Fri, 2011-11-04 at 11:55 -0700, Léa Massiot wrote:
> @Christopher :
> Thank you for your answer.
> 
> Christopher wrote:
> > 
> > The new session created is completely empty. It has nothing to do with the
> > user going back in the history, etc.
> > No, you are right.
> What I meant is that I was/am managing session expiration inside the Webapp
> (for instance if the user clicks a button which is inside the Webapp and if
> the session has expired, I redirect him to the log in page).
> 
> Christopher wrote:
> > 
> > I always try to have enough information in the page (form) so that
> > resuming a workflow after a session timeout is a possibility.
> > 
> I'm sorry but I do not understand what you are explaining me here...
> 
> 
> A SOLUTION... I THINK.
> I have found a solution, here it is:
> for all the JSPs which require a user to be identified (*), I add the
> following code:
> 
Better solution is to check whether the user principle is set.  The spec
will explain this.

> <%
> ASessionAttribute aSessionAttribute = null;
> HttpSession   httpSession   = null; 
>   
> httpSession   = request.getSession();
>   aSessionAttribute = (ASessionAttribute)
> httpSession.getAttribute("aSessionAttribute");
>   
>   if(aSessionAttribute  == null)
>   {
>   response.sendRedirect("the-log-in-page.jsp");
> }
> %>
> 
> Then if a user presses the F5 key and if the session has expired, he is
> properly redirected to the log in page.
> 
> Best regards,
> --
> Léa
> 
> (*) That is to say, in my example, the "aSessionAttribute" object musn't be
> null.



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Session expiration - browser -Web application

2011-11-04 Thread Tim Watts
On Fri, 2011-11-04 at 13:07 -0400, Christopher Schultz wrote:
> On 11/4/11 12:04 PM, Léa Massiot wrote:



I would basically echo what Chris said.

> >> [Tim wrote:] I'm assuming (perhaps incorrectly) you've already
> >> got some declaration in there for form authentication?
> > What are you thinking about? Can you be more precise?
> 
"Form authentication" is part of the servlet spec.  The spec is quite
precise and fairly accessible reading.  As Chris said, read the sections
on authentication and authorization.  Trust me, you'll be glad you read
it.  The servlet 2.5 spec is here:

http://download.oracle.com/otn-pub/jcp/servlet-2.5-mrel2-eval-oth-JSpec/servlet-2_5-mrel2-spec.pdf


> If users are logging-into your webapp, presumably they are providing a
> username and password (or other credentials): where do you have that
> configured?
> 
> - -chris
> -BEGIN PGP SIGNATURE-
> Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> 
> iEYEARECAAYFAk60G7QACgkQ9CaO5/Lv0PDIlACgoqsUbBg77GjOYVIbSfkAMbQW
> I7AAoIXZVd5nMgT4v8fUeXnQTqcpJLmA
> =IxaF
> -END PGP SIGNATURE-
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Session expiration - browser -Web application

2011-11-04 Thread Tim Watts
On Fri, 2011-11-04 at 07:16 -0700, Léa Massiot wrote:
> Hello,
> 
> Thank you for reading my post.
> 
> Maybe my question is not purely related to "Tomcat" but here is my problem:
> - a user logs into my Webapp;
> - his session expires;
> - if he:
>   - presses the F5 key (browser refresh functionality),

This creates a new session for the user with _none_ of the objects from
the old session in it (because it expired).

>   - goes back to the previous screen using the browser "go back one
> page" button...
>   all that was stored in the session is lost and the Webapp behaviour is
> uncertain.

"Uncertain" is a bit vague.  This could be a design problem in the app,
e.g. if some objects are simply assuming that the session contains
certain other objects then you should expect unexpected behaviour.  My
guess is the behaviours you see are quite certain, just not well
understood.

>   Instead, I wish I go direct him to the Webapp log in page.

If every page in the web app is supposed to require authentication you
need to declare that in web.xml.  I'm assuming (perhaps incorrectly)
you've already got some declaration in there for form authentication?

> 
> My Webapp "itself" behaves properly.
> My problem occurs only if the user uses browser functionalities or buttons.
> 
> I don't know how to deal with that issue.
> Can you help me?
> 
> Best regards,
> --
> Léa



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



  1   2   >