Re: a servlet-related Java question

2010-04-22 Thread Bill Barker



Christopher Schultz ch...@christopherschultz.net wrote in message 
news:4bcf5f41.6060...@christopherschultz.net...

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

André,

On 4/21/2010 3:46 PM, André Warnier wrote:

Mark Thomas wrote:

On 21/04/2010 20:24, André Warnier wrote:

Mark Thomas wrote:
...


I'd just use JAD and decompile it.


Thanks.  But although my intentions are not obnoxious nor illegal nor
anything of the kind, I would not want to even come under suspicion of
reverse-engineering.  So is there something that just lists the 
standard

calls/methods used in it ?


No. You can see the methods it exposes, but not the methods it uses.
Time to add some  debug code to your wrapper to see what is being 
called?



Mmmm. :-(
How do I do that, assuming I do not know in advance which methods it
calls ?
Do I need to define all the methods of HttpServletRequest in my wrapper,
just to make them trace their call ?
Or does there exist some more dummy-user-friendly methodology ?


It's pretty inaccessible for novice Java programmers, but you could use
the proxy API which is jsut about the coolest thing available in Java 
IMO.


This is how you do the wrapping of the request:

import java.lang.reflect.Proxy;
import java.lang.reflect.InvocationHandler;

public class RequestMethodCallLogger
 implements InvocationHandler, Filter
{
 public void doFilter(...) {
   HttpServletRequest wrappedRequest
= Proxy.newProxyInstance(HttpServletRequest.class.getClassLoader(),
 new Class[] { HttpServletRequest.class },
 this);

   chain.doFilter(wrappedRequest, response);
 }

 public Object invoke(Object proxy, Method method, Object[] args)
 {
   // Log to your favorite logger here

   return method.invoke(proxy, args);
 }
}

Basically, the Proxy class allows you to intercept the calls to
interface methods. The implementation of the invoke method is just a
pass-through to the real method after logging (an exercise left for
the reader).

This can be optimized a bit if you need to use it long-term, but the
above is about as compact as it gets.



If it does a forward or include done the line, this won't work with any 
remotely recent version of Tomcat.  These versions enforce the spec 
requirement that the Request has to be a subclass of HttpServletWrapper 
wrapping the original request, or the original request.



I'd still recommend the use of jad, honestly.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvPX0EACgkQ9CaO5/Lv0PCKVQCdG5SMXiySnsFEowVF7/44KM8s
b7kAoIAGSzxOIWmKt4+z6ATkqslTl5uW
=ykwF
-END PGP SIGNATURE-  




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



Re: standardize the URL

2010-04-22 Thread banto



Gregor Schneider wrote:
 
 On Tue, Apr 20, 2010 at 12:54 PM, banto banto...@gmail.com wrote:

 Hi,

 i know this can be a silly question but i have the following issue:

 i want to call my web app with a standard URL as
 http://host:port/myString

 
 how does the url look like when you call your webb-app currently?
 
 how would you like the url to look like?
 
 rgds
 
 gregor
 -- 
 just because you're paranoid, don't mean they're not after you...
 gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
 gpgp-key available
 @ http://pgpkeys.pca.dfn.de:11371
 @ http://pgp.mit.edu:11371/
 skype:rc46fi
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 


I explain better my problem,

my webapp is in the folder:

C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\istanceVar

and i call it with

http://localhost:8080/instanceVar/instance

what i would like to do (also for others webapps) is to call it/them as

http://localhost:8080/instance
http://localhost:8080/webapp_2
http://localhost:8080/webapp_3
...

or better

http://localhost/instance
http://localhost/webapp_2
http://localhost/webapp_3
...

how can i get the 2 modes?

i hope it is clearer now

thanks.
-- 
View this message in context: 
http://old.nabble.com/standardize-the-URL-tp28287836p28324762.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



Re: Can't login to Tomcat manager pages

2010-04-22 Thread Pid
On 21/04/2010 18:45, Propes, Barry L wrote:
 I started having a similar problem yesterday and discovered that somehow my 
 web.xml file had been deleted (not sure how), so I replaced it.
 
 Make sure you have that in your manager folder in WEB-INF.

Barry probably meant: make sure you have a web.xml in WEB-INF, in
webapps/manager - because a web.xml in a manager directory in (any)
WEB-INF isn't going to be discovered by Tomcat.


p



 -Original Message-
 From: Luís de Sousa [mailto:luis.a.de.so...@gmail.com] 
 Sent: Wednesday, April 21, 2010 12:15 PM
 To: users@tomcat.apache.org
 Subject: Can't login to Tomcat manager pages
 
 Dear all,
 
 Tomcat 6.0.20 on Ubuntu 9.10. I can't login to the manager pages 
 (http://localhost:8080/manager/html). I set a new user and a few roles in the 
 /etc/tomcat6/tomcat-users.xml file, restarted Tomcat but can't possibly login.
 
 I browsed through a number of threads with similar issues but couldn't solve 
 it so far. Note that I uncommented the users section in the file, it is 
 reproduced below.
 
 Thanks for you time,
 
 Luís
 
 --
 
 ?xml version='1.0' encoding='utf-8'?
 
 tomcat-users
 
   role rolename=admin/
   role rolename=manager/
   role rolename=standard/
   user username=admin password=admin roles=admin,standard,manager/
 
 /tomcat-users
 
 -
 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: OpenPGP digital signature


Re: a servlet-related Java question

2010-04-22 Thread Pid
On 21/04/2010 19:52, André Warnier wrote:
 Hi.
 A while ago, I wrote a servlet filter which has served me well since, to
 wrap a servlet for which I do not have nor can obtain the source code,
 and of which I only generally know what it does.
 Now it seems that with a new version of this servlet, the servlet itself
 crashes when wrapped by my filter, with a
 java.lang.StringIndexOutOfBoundsException.

Where crash is defined as a condition which produces a stacktrace, or
just an error message with the above explanation?


p

 My servlet filter, under certain conditions, creates a
 HttpRequestWrapper derived object, which it passes to the servlet
 instead of the original HttpServletRequest object.
 I have a suspicion that the ultimate reason for the servlet crash, is
 that it now calls a method which I have not re-defined in my wrapper,
 which method the previous servlet version did not call (and that it is
 not very defensive about the result it expects to get, but nothing I can
 do about that).
 
 All this to ask the following : is there some generic java tool which
 allows to examine a compiled .class file, and determine which methods of
 HttpServletRequest it calls ?
 I do not need nor want to decompile the class, just to know what it calls.
 
 Thanks.
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 




signature.asc
Description: OpenPGP digital signature


Re: standardize the URL

2010-04-22 Thread Pid
On 22/04/2010 07:45, banto wrote:
 
 
 
 Gregor Schneider wrote:

 On Tue, Apr 20, 2010 at 12:54 PM, banto banto...@gmail.com wrote:

 Hi,

 i know this can be a silly question but i have the following issue:

 i want to call my web app with a standard URL as
 http://host:port/myString


 how does the url look like when you call your webb-app currently?

 how would you like the url to look like?

 rgds

 gregor
 -- 
 just because you're paranoid, don't mean they're not after you...
 gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
 gpgp-key available
 @ http://pgpkeys.pca.dfn.de:11371
 @ http://pgp.mit.edu:11371/
 skype:rc46fi

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



 
 
 I explain better my problem,
 
 my webapp is in the folder:
 
 C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\istanceVar
 
 and i call it with
 
 http://localhost:8080/instanceVar/instance
 
 what i would like to do (also for others webapps) is to call it/them as
 
 http://localhost:8080/instance
 http://localhost:8080/webapp_2
 http://localhost:8080/webapp_3

Rename the webapp, from instanceVar to ROOT.

 or better
 
 http://localhost/instance
 http://localhost/webapp_2
 http://localhost/webapp_3

Change the port in the Connector from 8080 to 80.

 how can i get the 2 modes?

Then add multiple mappings for each instance of the URL.


OR

Create the servlet and map it to a value also present in the
welcome-file list of file names.

 http://localhost/instanceVar
 http://localhost/webapp_2


p











signature.asc
Description: OpenPGP digital signature


Re: standardize the URL

2010-04-22 Thread banto



Pid * wrote:
 
 On 22/04/2010 07:45, banto wrote:
 
 
 
 Gregor Schneider wrote:

 On Tue, Apr 20, 2010 at 12:54 PM, banto banto...@gmail.com wrote:

 Hi,

 i know this can be a silly question but i have the following issue:

 i want to call my web app with a standard URL as
 http://host:port/myString


 how does the url look like when you call your webb-app currently?

 how would you like the url to look like?

 rgds

 gregor
 -- 
 just because you're paranoid, don't mean they're not after you...
 gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
 gpgp-key available
 @ http://pgpkeys.pca.dfn.de:11371
 @ http://pgp.mit.edu:11371/
 skype:rc46fi

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



 
 
 I explain better my problem,
 
 my webapp is in the folder:
 
 C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\istanceVar
 
 and i call it with
 
 http://localhost:8080/instanceVar/instance
 
 what i would like to do (also for others webapps) is to call it/them as
 
 http://localhost:8080/instance
 http://localhost:8080/webapp_2
 http://localhost:8080/webapp_3
 
 Rename the webapp, from instanceVar to ROOT.
 
 or better
 
 http://localhost/instance
 http://localhost/webapp_2
 http://localhost/webapp_3
 
 Change the port in the Connector from 8080 to 80.
 
 how can i get the 2 modes?
 
 Then add multiple mappings for each instance of the URL.
 
 
 OR
 
 Create the servlet and map it to a value also present in the
 welcome-file list of file names.
 
  http://localhost/instanceVar
  http://localhost/webapp_2
 
 
 p
 
 
 
 
 
 
 
 
 
 
  
 


thank you g now it works.

However i understand the only way to do that is putting the webapps in the
ROOT folder,right?
-- 
View this message in context: 
http://old.nabble.com/standardize-the-URL-tp28287836p28326093.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



Re: Can't login to Tomcat manager pages

2010-04-22 Thread Luís de Sousa
Hello everyone, thank you for the answers.

I started by looking for the web.xml file, it is together with
tomcat-users.xml in the CATALINA_HOME/conf directory (/etc/tomcat6). I
don't have a manager directory under /var/lib/tomcat6/webapps so I
checked if the tomcat6-admin package is installed:

$ dpkg -l '*tomcat*'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name  Version   Description
+++-=-=-==
ii  libtomcat6-java   6.0.20-2ubuntu2.1 Servlet and JSP engine -- core libraries
ii  tomcat6   6.0.20-2ubuntu2.1 Servlet and JSP engine
ii  tomcat6-admin 6.0.20-2ubuntu2.1 Servlet and JSP engine --
admin web applications
ii  tomcat6-common6.0.20-2ubuntu2.1 Servlet and JSP engine -- common files
ii  tomcat6-docs  6.0.20-2ubuntu2.1 Servlet and JSP engine --
example web applications
ii  tomcat6-examples  6.0.20-2ubuntu2.1 Servlet and JSP engine --
example web applications
ii  tomcat6-user  6.0.20-2ubuntu2.1 Servlet and JSP engine --
tools to create user ins

It seems to be.

I then performed a shutdown and startup. Unlike yesterday, today I'm
getting a Connection refused exception when shutting down, but the
startup goes ok. The command line log is below, in attach go the
Tomcat logs for today.

Thank you,

Luís

-

$ cd /usr/share/tomcat6/bin
$ sudo ./shutdown.sh
Using CATALINA_BASE:   /usr/share/tomcat6
Using CATALINA_HOME:   /usr/share/tomcat6
Using CATALINA_TMPDIR: /usr/share/tomcat6/temp
Using JRE_HOME:   /usr
22-Apr-2010 10:51:39 org.apache.catalina.startup.Catalina stopServer
SEVERE: Catalina.stop:
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at 
java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:310)
at 
java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:176)
at 
java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:163)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:384)
at java.net.Socket.connect(Socket.java:546)
at java.net.Socket.connect(Socket.java:495)
at java.net.Socket.init(Socket.java:392)
at java.net.Socket.init(Socket.java:206)
at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:422)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:337)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:415)
$ sudo ./startup.sh
Using CATALINA_BASE:   /usr/share/tomcat6
Using CATALINA_HOME:   /usr/share/tomcat6
Using CATALINA_TMPDIR: /usr/share/tomcat6/temp
Using JRE_HOME:   /usr
22-Apr-2010 10:51:46 org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
22-Apr-2010 10:51:46 org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
22-Apr-2010 10:51:51 org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
22-Apr-2010 10:51:46 org.apache.coyote.http11.Http11Protocol init
SEVERE: Error initializing endpoint
java.net.BindException: Address already in usenull:8080
	at org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:509)
	at org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:176)
	at org.apache.catalina.connector.Connector.initialize(Connector.java:1058)
	at org.apache.catalina.core.StandardService.initialize(StandardService.java:677)
	at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:795)
	at org.apache.catalina.startup.Catalina.load(Catalina.java:535)
	at org.apache.catalina.startup.Catalina.load(Catalina.java:555)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:616)
	at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:260)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:412)
22-Apr-2010 10:51:46 org.apache.catalina.startup.Catalina load
SEVERE: Catalina.start
LifecycleException:  Protocol handler initialization failed: java.net.BindException: Address already in usenull:8080
	at org.apache.catalina.connector.Connector.initialize(Connector.java:1060)
	at org.apache.catalina.core.StandardService.initialize(StandardService.java:677)
	at 

Re: standardize the URL

2010-04-22 Thread Pid
On 22/04/2010 10:10, banto wrote:
 
 
 
 Pid * wrote:

 On 22/04/2010 07:45, banto wrote:



 Gregor Schneider wrote:

 On Tue, Apr 20, 2010 at 12:54 PM, banto banto...@gmail.com wrote:

 Hi,

 i know this can be a silly question but i have the following issue:

 i want to call my web app with a standard URL as
 http://host:port/myString


 how does the url look like when you call your webb-app currently?

 how would you like the url to look like?

 rgds

 gregor
 -- 
 just because you're paranoid, don't mean they're not after you...
 gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
 gpgp-key available
 @ http://pgpkeys.pca.dfn.de:11371
 @ http://pgp.mit.edu:11371/
 skype:rc46fi

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





 I explain better my problem,

 my webapp is in the folder:

 C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\istanceVar

 and i call it with

 http://localhost:8080/instanceVar/instance

 what i would like to do (also for others webapps) is to call it/them as

 http://localhost:8080/instance
 http://localhost:8080/webapp_2
 http://localhost:8080/webapp_3

 Rename the webapp, from instanceVar to ROOT.

 or better

 http://localhost/instance
 http://localhost/webapp_2
 http://localhost/webapp_3

 Change the port in the Connector from 8080 to 80.

 how can i get the 2 modes?

 Then add multiple mappings for each instance of the URL.


 OR

 Create the servlet and map it to a value also present in the
 welcome-file list of file names.

  http://localhost/instanceVar
  http://localhost/webapp_2


 p
 
 thank you g now it works.
 
 However i understand the only way to do that is putting the webapps in the
 ROOT folder,right?

If by webapp, you mean Servlet.

ROOT is a webapp in it's own right, it is not the same as the root
directory of an HTTPD server.

any .war file or directory (effectively an exploded .war file) you put
in tomcat/webapps will be treated as an application.


p




signature.asc
Description: OpenPGP digital signature


How to configure ProxyPassReverse for SSL redirect

2010-04-22 Thread Timo Meinen
Hi,

our configuration is a Apache 2.2 web server, acting as a reverse
proxy for Tomcat 6. This is the configuration:
ServerNameit.localhost.de
ProxyPass   /   ajp://127.0.0.1:8009/spike/
ProxyPassReverse/   ajp://127.0.0.1:8009/spike/
ProxyPassReverseCookiePath  /spike  /

As you can see, the webapp is hosted under ContextPath /spike but
available through the proxy via /. Everything works fine, until the
webapp sends an redirect to HTTPS. This is done via SpringSecurity.
The problem is, that the ProxyPassReverse directive doesn't catch the
ContextPath and converts it, if it includes the complete address.
These are the logs from the web browser:

GET http://it.localhost.de/users/65 = 302 =
https://it.localhost.de/spike/users/65

1) Why does the ProxyPassReverse doesn't convert the /spike back to /
in https://it.localhost.de/spike/users/65? Is it because the Header
isn't relative? The protocol is still AJP and so the Proxy should know
how to convert it, right?
1a) If so, how could the webapp switch from http to https and vice
versa, when not able to send the absolute address with a new protocol?

After this, I tried to set additional ProxyPassReverse directives:

ProxyPassReverse/https://it.localhost.de/spike/
ProxyPassReverse/http://it.localhost.de/spike/

This time, the /spike/ is converted to /, but the two directives leads
to an infintive loop of redirects to
http://it.localhost.de/REQUEST-URI.

2) How can I stop this loop? or better
3) How can I configure the ProxyPassReverse correctly?

As a workaround I have a RewriteRule added like this one

RewriteRule ^/spike/(.*)$   /$1 [R=301,L]

but this doesn't feel correct and it leads to 3 GET-Requests and
redirects each time the webapps wants it user to switch the protocol.


Thank you very much
Timo Meinen

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



Re: standardize the URL

2010-04-22 Thread banto



Pid * wrote:
 
 On 22/04/2010 10:10, banto wrote:
 
 
 
 Pid * wrote:

 On 22/04/2010 07:45, banto wrote:



 Gregor Schneider wrote:

 On Tue, Apr 20, 2010 at 12:54 PM, banto banto...@gmail.com wrote:

 Hi,

 i know this can be a silly question but i have the following issue:

 i want to call my web app with a standard URL as
 http://host:port/myString


 how does the url look like when you call your webb-app currently?

 how would you like the url to look like?

 rgds

 gregor
 -- 
 just because you're paranoid, don't mean they're not after you...
 gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
 gpgp-key available
 @ http://pgpkeys.pca.dfn.de:11371
 @ http://pgp.mit.edu:11371/
 skype:rc46fi

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





 I explain better my problem,

 my webapp is in the folder:

 C:\Program Files\Apache Software Foundation\Tomcat
 5.5\webapps\istanceVar

 and i call it with

 http://localhost:8080/instanceVar/instance

 what i would like to do (also for others webapps) is to call it/them as

 http://localhost:8080/instance
 http://localhost:8080/webapp_2
 http://localhost:8080/webapp_3

 Rename the webapp, from instanceVar to ROOT.

 or better

 http://localhost/instance
 http://localhost/webapp_2
 http://localhost/webapp_3

 Change the port in the Connector from 8080 to 80.

 how can i get the 2 modes?

 Then add multiple mappings for each instance of the URL.


 OR

 Create the servlet and map it to a value also present in the
 welcome-file list of file names.

  http://localhost/instanceVar
  http://localhost/webapp_2


 p
 
 thank you g now it works.
 
 However i understand the only way to do that is putting the webapps in
 the
 ROOT folder,right?
 
 If by webapp, you mean Servlet.
 
 ROOT is a webapp in it's own right, it is not the same as the root
 directory of an HTTPD server.
 
 any .war file or directory (effectively an exploded .war file) you put
 in tomcat/webapps will be treated as an application.
 
 
 p
 
 
 
  
 


Just to understand you:

i have copied the class files of my webapp and modified the relative web.xml
to the folder

C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\ROOT

i hope you mean the same ROOT?

thanks
-- 
View this message in context: 
http://old.nabble.com/standardize-the-URL-tp28287836p28326999.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



Re: [Tomcat 7-RC1] JNDI Startup Issue

2010-04-22 Thread alvins

Full stack-trace - 

javax.naming.NameNotFoundException: Name comp is not bound in this Context
at org.apache.naming.NamingContext.lookup(NamingContext.java:774)
at org.apache.naming.NamingContext.lookup(NamingContext.java:157)
at org.apache.naming.SelectorContext.lookup(SelectorContext.java:156)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at
au.com.test.web.MyServletContextListener.contextInitialized(MyServletContextListener.java:21)
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4221)
at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4700)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:128)
at
org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:986)
at
org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:857)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:128)
at
org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:986)
at
org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:452)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:128)
at
org.apache.catalina.core.StandardService.startInternal(StandardService.java:456)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:128)
at
org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:662)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:128)
at org.apache.catalina.startup.Catalina.startInternal(Catalina.java:564)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:128)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)

I have updated the bug with a sample war file + code.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49132


Konstantin Kolinko wrote:
 
 2010/4/22 alvins alvins1...@hotmail.com:

 Any thoughts on this?

 
 I would like to see the Tomcat part of the exception that you are
 observing.
 That is, at what point in application lifecycle the initialization is
 performed.
 
 If you can attach a sample application to
 https://issues.apache.org/bugzilla/show_bug.cgi?id=49132
 that would be nice. It would be a bit easier if it would be a simple one.
 
 Best regards,
 Konstantin Kolinko
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 

-- 
View this message in context: 
http://old.nabble.com/-Tomcat-7-RC1--JNDI-Startup-Issue-tp28279732p28327054.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



Re: standardize the URL

2010-04-22 Thread Pid
On 22/04/2010 11:27, banto wrote:
 
 
 
 Pid * wrote:

 On 22/04/2010 10:10, banto wrote:



 Pid * wrote:

 On 22/04/2010 07:45, banto wrote:



 Gregor Schneider wrote:

 On Tue, Apr 20, 2010 at 12:54 PM, banto banto...@gmail.com wrote:

 Hi,

 i know this can be a silly question but i have the following issue:

 i want to call my web app with a standard URL as
 http://host:port/myString


 how does the url look like when you call your webb-app currently?

 how would you like the url to look like?

 rgds

 gregor
 -- 
 just because you're paranoid, don't mean they're not after you...
 gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
 gpgp-key available
 @ http://pgpkeys.pca.dfn.de:11371
 @ http://pgp.mit.edu:11371/
 skype:rc46fi

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





 I explain better my problem,

 my webapp is in the folder:

 C:\Program Files\Apache Software Foundation\Tomcat
 5.5\webapps\istanceVar

 and i call it with

 http://localhost:8080/instanceVar/instance

 what i would like to do (also for others webapps) is to call it/them as

 http://localhost:8080/instance
 http://localhost:8080/webapp_2
 http://localhost:8080/webapp_3

 Rename the webapp, from instanceVar to ROOT.

 or better

 http://localhost/instance
 http://localhost/webapp_2
 http://localhost/webapp_3

 Change the port in the Connector from 8080 to 80.

 how can i get the 2 modes?

 Then add multiple mappings for each instance of the URL.


 OR

 Create the servlet and map it to a value also present in the
 welcome-file list of file names.

  http://localhost/instanceVar
  http://localhost/webapp_2


 p

 thank you g now it works.

 However i understand the only way to do that is putting the webapps in
 the
 ROOT folder,right?

 If by webapp, you mean Servlet.

 ROOT is a webapp in it's own right, it is not the same as the root
 directory of an HTTPD server.

 any .war file or directory (effectively an exploded .war file) you put
 in tomcat/webapps will be treated as an application.


 p
 Just to understand you:
 
 i have copied the class files of my webapp and modified the relative web.xml
 to the folder
 
 C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\ROOT
 
 i hope you mean the same ROOT?


Yes, this is correct.


p



signature.asc
Description: OpenPGP digital signature


Re: standardize the URL

2010-04-22 Thread banto



Pid * wrote:
 
 On 22/04/2010 11:27, banto wrote:
 
 
 
 Pid * wrote:

 On 22/04/2010 10:10, banto wrote:



 Pid * wrote:

 On 22/04/2010 07:45, banto wrote:



 Gregor Schneider wrote:

 On Tue, Apr 20, 2010 at 12:54 PM, banto banto...@gmail.com wrote:

 Hi,

 i know this can be a silly question but i have the following issue:

 i want to call my web app with a standard URL as
 http://host:port/myString


 how does the url look like when you call your webb-app currently?

 how would you like the url to look like?

 rgds

 gregor
 -- 
 just because you're paranoid, don't mean they're not after you...
 gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
 gpgp-key available
 @ http://pgpkeys.pca.dfn.de:11371
 @ http://pgp.mit.edu:11371/
 skype:rc46fi

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





 I explain better my problem,

 my webapp is in the folder:

 C:\Program Files\Apache Software Foundation\Tomcat
 5.5\webapps\istanceVar

 and i call it with

 http://localhost:8080/instanceVar/instance

 what i would like to do (also for others webapps) is to call it/them
 as

 http://localhost:8080/instance
 http://localhost:8080/webapp_2
 http://localhost:8080/webapp_3

 Rename the webapp, from instanceVar to ROOT.

 or better

 http://localhost/instance
 http://localhost/webapp_2
 http://localhost/webapp_3

 Change the port in the Connector from 8080 to 80.

 how can i get the 2 modes?

 Then add multiple mappings for each instance of the URL.


 OR

 Create the servlet and map it to a value also present in the
 welcome-file list of file names.

  http://localhost/instanceVar
  http://localhost/webapp_2


 p

 thank you g now it works.

 However i understand the only way to do that is putting the webapps in
 the
 ROOT folder,right?

 If by webapp, you mean Servlet.

 ROOT is a webapp in it's own right, it is not the same as the root
 directory of an HTTPD server.

 any .war file or directory (effectively an exploded .war file) you put
 in tomcat/webapps will be treated as an application.


 p
 Just to understand you:
 
 i have copied the class files of my webapp and modified the relative
 web.xml
 to the folder
 
 C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\ROOT
 
 i hope you mean the same ROOT?
 
 
 Yes, this is correct.
 
 
 p
 
 
  
 


thank you!!
-- 
View this message in context: 
http://old.nabble.com/standardize-the-URL-tp28287836p28327291.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



Re: How to run second instance of Tomcat 6.0.20 on separate port

2010-04-22 Thread Kapil Godara
Hi,
Thanks a lot to all. I achieved the Goal :)
But still not able to install the second tomcat instance as Windows Service.
Where do i need to make changes?

What I did next is
Step 1 - Copied the contents of C:\tomcat1 into C:\tomcat2

Step 2 - Changed the Http, shutdown and ajp connecter port in server.xml at
C:\tomcat2\conf to 8180, 8105 and 8109

Step 3 - Edited the startup.bat at C:\tomcat2\bin. Deleted all the contents
of it and added
set CATALINA_BASE=C:\tomcat2
C:\tomcat1\bin\startup.bat

Step 4 - Edited the shutdown.bat at C:\tomcat2\bin. Deleted all the contents
of it and added
set CATALINA_BASE=C:\tomcat2
C:\tomcat1\bin\shutdown.bat

Step - 5 Double clicked startup.bat in C:\tomcat2 and in browser used
http://localhost:8180/ to access the new port

Step - 6 Double clicked startup.bat in C:\tomcat1 and in browser used
http://localhost:8080/ to access the default port.

regards
kapil

On Wed, Apr 21, 2010 at 8:08 PM, Kapil Godara kapil.god...@gmail.comwrote:

 Hi Andre,

 I did as suggested. Tomcat is running fine as service Tomcat1.

 I have set CATALINA_HOME=C:\tomcat1 and CATALINA_BASE=C:\tomcat1
 (I set the env var from Control Panel - System Properties -Advanced -
 Environment Variables - System variables)

 What is the next step for additional instance on different port?

 thanks and regards
 kapil


 On Wed, Apr 21, 2010 at 6:09 PM, André Warnier a...@ice-sa.com wrote:

 Kapil Godara wrote:

 Hi

 I copied the entire folder Tomcat 6.0 at C:\Program Files\Apache Software
 Foundation (where tomcat is installed) to Tomcat_instance2 .

 ...

 Let's start again, from the beginning.

 This has been discussed many times on this forum, but I believe it is
 worth repeating it, because it is probably the source of the confusion.

 In the Tomcat website download page, there are several versions :

 - one is for Unix/Linux. That is a complete version, with all the files
 packed together in one .tar.gz file.  To install it, you unpack these files
 under one new directory for Tomcat, and it creates a set of subdirectories
 conf, bin, etc..

 But for Windows, there are *two* versions :
 - one is a simple version, named installer, which is destined for the
 quick and simple installation of a single Tomcat under Windows, to run as a
 Windows Service. This is apparently the one you downloaded and installed.
 This version does not contain /all/ the same files as the one for Unix/Linux
 above, only a subset of them.

 - the other one is a zip version, which does contain all the same files
 as the Unix/Linux version, and even some additional ones.
 This version /also/ allows you to install Tomcat as a Windows Service, but
 this requires a bit more work.  It also provides all the files necessary to
 install a second instance of Tomcat and run it as a second Windows Service.
 This is the one you should download now.

 My recommendation is :
 - remove the first version of Tomcat that you downloaded and installed
 (the .exe version).
 - download the zip version
 - decide on a main and second directories where you will run your two
 instances of Tomcat.
 I suggest that you pick directory paths that are simple, without spaces in
 the name.  Like c:\tomcat1 and c:\tomcat2.  That will save you time and
 problems later.
 - unzip the downloaded Tomcat zip version in the first directory.
 Note for the future that this is now your CATALINA_HOME directory.
 - in the directory c:\tomcat1\bin, run the service.bat script, to
 install this Tomcat instance as the first Windows Service.  Give it the name
 Tomcat1.
 For this Tomcat, the CATALINA_BASE is also c:\tomcat1.

 When all the above is done and you have a running first Tomcat instance,
 then come back here for additional information on how to run an additional
 instance, using the same CATALINA_HOME, but a separate CATALINA_BASE.







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





Re: Can't login to Tomcat manager pages

2010-04-22 Thread David Smith
On 4/21/2010 1:14 PM, Luís de Sousa wrote:
 Dear all,

 Tomcat 6.0.20 on Ubuntu 9.10. I can't login to the manager pages
 (http://localhost:8080/manager/html). I set a new user and a few roles
 in the /etc/tomcat6/tomcat-users.xml file, restarted Tomcat but can't
 possibly login.

 I browsed through a number of threads with similar issues but couldn't
 solve it so far. Note that I uncommented the users section in the
 file, it is reproduced below.

 Thanks for you time,

 Luís

 --

 ?xml version='1.0' encoding='utf-8'?

 tomcat-users

   role rolename=admin/
   role rolename=manager/
   role rolename=standard/
   user username=admin password=admin roles=admin,standard,manager/

 /tomcat-users

   

I have a Ubuntu 9.10 system and did exactly what you've posted above. 
It works like a charm.  Have you altered anything else?  Change
permission inadvertently on tomcat-users.xml?  Mine is read/write by
root, read-only by tomcat6.

--David

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



Re: Can't login to Tomcat manager pages

2010-04-22 Thread Konstantin Kolinko
2010/4/22 Luís de Sousa luis.a.de.so...@gmail.com:
 I then performed a shutdown and startup. Unlike yesterday, today I'm
 getting a Connection refused exception when shutting down,

Connection refused means Tomcat was not running, or failed to stop.

If it is still running, you can use kill utility to stop it.


From your logs:

 java.net.BindException: Address already in usenull:8080

means that Tomcat failed to start, because another instance of Tomcat
is still running and using those port numbers.


By the way: The attachments to this list are usually stripped by mailing list
software, but yours somehow reached me.
.

Best regards,
Konstantin Kolinko

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



Re: Can't login to Tomcat manager pages

2010-04-22 Thread Luís de Sousa
On Thu, Apr 22, 2010 at 1:29 PM, David Smith david.sm...@cornell.edu
 I have a Ubuntu 9.10 system and did exactly what you've posted above.
 It works like a charm.  Have you altered anything else?  Change
 permission inadvertently on tomcat-users.xml?  Mine is read/write by
 root, read-only by tomcat6.

Well David you figured it. By some reason the tomcat-users.xml had
blank permissions for the 'all' group. I have no idea how it ended up
that way, and doubt I'd do such thing out of my own will. Go figure.

I think I'll run a test install on another machine to see if this is
set by default.

Thanks to all for your help,

Luís

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



Re: Can't login to Tomcat manager pages

2010-04-22 Thread David Smith
Here's my system's tomcat-user.xml as listed w/ ls -l:

-rw-r-  1  root  tomcat6  1202  2010-04-22  08:15 
/etc/tomcat6/tomcat-users.xml

As you can see, user and group permissions are set, but the other
permissions are all blank.  This is the way it should be since it
contains password information.

--David

On 4/22/2010 9:07 AM, Luís de Sousa wrote:
 On Thu, Apr 22, 2010 at 1:29 PM, David Smith david.sm...@cornell.edu
   
 I have a Ubuntu 9.10 system and did exactly what you've posted above.
 It works like a charm.  Have you altered anything else?  Change
 permission inadvertently on tomcat-users.xml?  Mine is read/write by
 root, read-only by tomcat6.
 
 Well David you figured it. By some reason the tomcat-users.xml had
 blank permissions for the 'all' group. I have no idea how it ended up
 that way, and doubt I'd do such thing out of my own will. Go figure.

 I think I'll run a test install on another machine to see if this is
 set by default.

 Thanks to all for your help,

 Luís

 -
 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



myeclipse and tomcat

2010-04-22 Thread Christoph Kukulies
I'm playing a bit with myeclipse and I'm wondering whether anyone on 
this list here is using it with Tomcat
as application server running other apps, rather than using tomcat from 
within  the built into myeclipse Tomcat server.


Any experiences with that setup?

--
Christoph Kukulies


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



Re: Can't login to Tomcat manager pages

2010-04-22 Thread Luís de Sousa
On Thu, Apr 22, 2010 at 2:18 PM, David Smith david.sm...@cornell.edu wrote:
 Here's my system's tomcat-user.xml as listed w/ ls -l:

 -rw-r-  1  root  tomcat6  1202  2010-04-22  08:15
 /etc/tomcat6/tomcat-users.xml

 As you can see, user and group permissions are set, but the other
 permissions are all blank.  This is the way it should be since it
 contains password information.

 --David

That way I can't access the manager pages. Only when I added the read
permissions to all Tomcat was able to validate the password.

What's wrong?

Luís

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



Re: myeclipse and tomcat

2010-04-22 Thread Ken Bowen

I'm not sure I understand your question.
But first,  are you using plain Eclipse, or MyEclipse?  (I use the  
latter)


Do you mean:  Using MyEclipse configured so that it is using an  
external Tomcat server, NOT the included myEclipse Tomcat server?


I've never used the included myEclipse server, only external servers.

--Ken

On Apr 22, 2010, at 9:17 AM, Christoph Kukulies wrote:

I'm playing a bit with myeclipse and I'm wondering whether anyone on  
this list here is using it with Tomcat
as application server running other apps, rather than using tomcat  
from within  the built into myeclipse Tomcat server.


Any experiences with that setup?

--
Christoph Kukulies


-
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: a servlet-related Java question

2010-04-22 Thread Kris Schneider
On Thu, Apr 22, 2010 at 2:37 AM, Bill Barker billwbar...@verizon.net wrote:


 Christopher Schultz ch...@christopherschultz.net wrote in message
 news:4bcf5f41.6060...@christopherschultz.net...

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 André,

 On 4/21/2010 3:46 PM, André Warnier wrote:

 Mark Thomas wrote:

 On 21/04/2010 20:24, André Warnier wrote:

 Mark Thomas wrote:
 ...

 I'd just use JAD and decompile it.

 Thanks.  But although my intentions are not obnoxious nor illegal nor
 anything of the kind, I would not want to even come under suspicion of
 reverse-engineering.  So is there something that just lists the
 standard
 calls/methods used in it ?

 No. You can see the methods it exposes, but not the methods it uses.
 Time to add some  debug code to your wrapper to see what is being
 called?

 Mmmm. :-(
 How do I do that, assuming I do not know in advance which methods it
 calls ?
 Do I need to define all the methods of HttpServletRequest in my wrapper,
 just to make them trace their call ?
 Or does there exist some more dummy-user-friendly methodology ?

 It's pretty inaccessible for novice Java programmers, but you could use
 the proxy API which is jsut about the coolest thing available in Java
 IMO.

 This is how you do the wrapping of the request:

 import java.lang.reflect.Proxy;
 import java.lang.reflect.InvocationHandler;

 public class RequestMethodCallLogger
  implements InvocationHandler, Filter
 {
  public void doFilter(...) {
   HttpServletRequest wrappedRequest
    = Proxy.newProxyInstance(HttpServletRequest.class.getClassLoader(),
                             new Class[] { HttpServletRequest.class },
                             this);

   chain.doFilter(wrappedRequest, response);
  }

  public Object invoke(Object proxy, Method method, Object[] args)
  {
   // Log to your favorite logger here

   return method.invoke(proxy, args);
  }
 }

 Basically, the Proxy class allows you to intercept the calls to
 interface methods. The implementation of the invoke method is just a
 pass-through to the real method after logging (an exercise left for
 the reader).

 This can be optimized a bit if you need to use it long-term, but the
 above is about as compact as it gets.


 If it does a forward or include done the line, this won't work with any
 remotely recent version of Tomcat.  These versions enforce the spec
 requirement that the Request has to be a subclass of HttpServletWrapper
 wrapping the original request, or the original request.

Good point - which really kills the proxy approach as a
general-purpose solution in this context...

 I'd still recommend the use of jad, honestly.

 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.10 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

 iEYEARECAAYFAkvPX0EACgkQ9CaO5/Lv0PCKVQCdG5SMXiySnsFEowVF7/44KM8s
 b7kAoIAGSzxOIWmKt4+z6ATkqslTl5uW
 =ykwF
 -END PGP SIGNATURE-

-- 
Kris Schneider

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



Re: Can't login to Tomcat manager pages

2010-04-22 Thread André Warnier

Luís de Sousa wrote:

On Thu, Apr 22, 2010 at 2:18 PM, David Smith david.sm...@cornell.edu wrote:

Here's my system's tomcat-user.xml as listed w/ ls -l:

-rw-r-  1  root  tomcat6  1202  2010-04-22  08:15
/etc/tomcat6/tomcat-users.xml

As you can see, user and group permissions are set, but the other
permissions are all blank.  This is the way it should be since it
contains password information.

--David


That way I can't access the manager pages. Only when I added the read
permissions to all Tomcat was able to validate the password.

What's wrong?

Probably that your Tomcat is not running under a user-id which has read 
access to that file.

What do you see when running ps -ef | grep tomcat ?

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



Re: Can't login to Tomcat manager pages

2010-04-22 Thread Luís de Sousa
On Thu, Apr 22, 2010 at 2:49 PM, André Warnier a...@ice-sa.com wrote:
 What do you see when running ps -ef | grep tomcat ?

Hi André,

I see loadsa stuff I don't understand :)

Luís

$ ps -ef | grep tomcat
root  2129 1  0 08:07 ?00:00:00 /usr/bin/jsvc -user
tomcat6 -cp 
/usr/share/java/commons-daemon.jar:/usr/share/tomcat6/bin/bootstrap.jar
-outfile SYSLOG -errfile SYSLOG -pidfile /var/run/tomcat6.pid
-Djava.awt.headless=true -Xmx128M
-Djava.endorsed.dirs=/usr/share/tomcat6/endorsed
-Dcatalina.base=/var/lib/tomcat6 -Dcatalina.home=/usr/share/tomcat6
-Djava.io.tmpdir=/tmp/tomcat6-temp -Djava.security.manager
-Djava.security.policy=/var/lib/tomcat6/work/catalina.policy
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.util.logging.config.file=/var/lib/tomcat6/conf/logging.properties
org.apache.catalina.startup.Bootstrap
root  2131  2129  0 08:07 ?00:00:00 /usr/bin/jsvc -user
tomcat6 -cp 
/usr/share/java/commons-daemon.jar:/usr/share/tomcat6/bin/bootstrap.jar
-outfile SYSLOG -errfile SYSLOG -pidfile /var/run/tomcat6.pid
-Djava.awt.headless=true -Xmx128M
-Djava.endorsed.dirs=/usr/share/tomcat6/endorsed
-Dcatalina.base=/var/lib/tomcat6 -Dcatalina.home=/usr/share/tomcat6
-Djava.io.tmpdir=/tmp/tomcat6-temp -Djava.security.manager
-Djava.security.policy=/var/lib/tomcat6/work/catalina.policy
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.util.logging.config.file=/var/lib/tomcat6/conf/logging.properties
org.apache.catalina.startup.Bootstrap
tomcat6   2132  2129  0 08:07 ?00:00:12 /usr/bin/jsvc -user
tomcat6 -cp 
/usr/share/java/commons-daemon.jar:/usr/share/tomcat6/bin/bootstrap.jar
-outfile SYSLOG -errfile SYSLOG -pidfile /var/run/tomcat6.pid
-Djava.awt.headless=true -Xmx128M
-Djava.endorsed.dirs=/usr/share/tomcat6/endorsed
-Dcatalina.base=/var/lib/tomcat6 -Dcatalina.home=/usr/share/tomcat6
-Djava.io.tmpdir=/tmp/tomcat6-temp -Djava.security.manager
-Djava.security.policy=/var/lib/tomcat6/work/catalina.policy
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.util.logging.config.file=/var/lib/tomcat6/conf/logging.properties
org.apache.catalina.startup.Bootstrap
root  8600 1  0 14:01 pts/100:00:13 /usr/bin/java
-Djava.util.logging.config.file=/usr/share/tomcat6/conf/logging.properties
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.endorsed.dirs=/usr/share/tomcat6/endorsed -classpath
:/usr/share/tomcat6/bin/bootstrap.jar
-Dcatalina.base=/usr/share/tomcat6 -Dcatalina.home=/usr/share/tomcat6
-Djava.io.tmpdir=/usr/share/tomcat6/temp
org.apache.catalina.startup.Bootstrap start
lads  9328  3055  0 14:52 pts/100:00:00 grep tomcat

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



RE: Can't login to Tomcat manager pages

2010-04-22 Thread Propes, Barry L
Sorry, yes, Pid, that's what I meant.

Sorry for confusion there.

 

-Original Message-
From: Pid [mailto:p...@pidster.com] 
Sent: Thursday, April 22, 2010 2:57 AM
To: Tomcat Users List
Subject: Re: Can't login to Tomcat manager pages

On 21/04/2010 18:45, Propes, Barry L wrote:
 I started having a similar problem yesterday and discovered that somehow my 
 web.xml file had been deleted (not sure how), so I replaced it.
 
 Make sure you have that in your manager folder in WEB-INF.

Barry probably meant: make sure you have a web.xml in WEB-INF, in 
webapps/manager - because a web.xml in a manager directory in (any) WEB-INF 
isn't going to be discovered by Tomcat.


p



 -Original Message-
 From: Luís de Sousa [mailto:luis.a.de.so...@gmail.com]
 Sent: Wednesday, April 21, 2010 12:15 PM
 To: users@tomcat.apache.org
 Subject: Can't login to Tomcat manager pages
 
 Dear all,
 
 Tomcat 6.0.20 on Ubuntu 9.10. I can't login to the manager pages 
 (http://localhost:8080/manager/html). I set a new user and a few roles in the 
 /etc/tomcat6/tomcat-users.xml file, restarted Tomcat but can't possibly login.
 
 I browsed through a number of threads with similar issues but couldn't solve 
 it so far. Note that I uncommented the users section in the file, it is 
 reproduced below.
 
 Thanks for you time,
 
 Luís
 
 --
 
 ?xml version='1.0' encoding='utf-8'?
 
 tomcat-users
 
   role rolename=admin/
   role rolename=manager/
   role rolename=standard/
   user username=admin password=admin 
 roles=admin,standard,manager/
 
 /tomcat-users
 
 -
 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 configure ProxyPassReverse for SSL redirect

2010-04-22 Thread Hassan Schroeder
On Thu, Apr 22, 2010 at 3:25 AM, Timo Meinen timomei...@googlemail.com wrote:

 our configuration is a Apache 2.2 web server, acting as a reverse
 proxy for Tomcat 6. This is the configuration:
 ServerName    it.localhost.de
 ProxyPass               /       ajp://127.0.0.1:8009/spike/
 ProxyPassReverse        /       ajp://127.0.0.1:8009/spike/
 ProxyPassReverseCookiePath      /spike  /

That's *one* configuration -- do you have this for both the standard
port 80 and SSL port 443?

In a default 2.2.x install there are separate extra/httpd-vhosts.conf and
extra/httpd-ssl.conf files.

-- 
Hassan Schroeder  hassan.schroe...@gmail.com
twitter: @hassan

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



Re: How to configure ProxyPassReverse for SSL redirect

2010-04-22 Thread Timo Meinen
Hi Hassan,

yes, there are two VirtualHost entries. One for port 80 and one for
port 443 with SSL engine enabled. Both have the same proxy
configuration.

Timo

2010/4/22 Hassan Schroeder hassan.schroe...@gmail.com:
 On Thu, Apr 22, 2010 at 3:25 AM, Timo Meinen timomei...@googlemail.com 
 wrote:

 our configuration is a Apache 2.2 web server, acting as a reverse
 proxy for Tomcat 6. This is the configuration:
 ServerName    it.localhost.de
 ProxyPass               /       ajp://127.0.0.1:8009/spike/
 ProxyPassReverse        /       ajp://127.0.0.1:8009/spike/
 ProxyPassReverseCookiePath      /spike  /

 That's *one* configuration -- do you have this for both the standard
 port 80 and SSL port 443?

 In a default 2.2.x install there are separate extra/httpd-vhosts.conf and
 extra/httpd-ssl.conf files.

 --
 Hassan Schroeder  hassan.schroe...@gmail.com
 twitter: @hassan

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





-- 
Glück Auf
Timo

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



Where is this class?

2010-04-22 Thread laredotornado

Hi, 

Im running Tomcat 6.0.26.  In my app, I'm getting a
java.lang.ClassNotFoundException: javax.validation.ValidatorFactory
exception.  Does anyone know where to find the ValidatorFactory class?  More
generally, is there a web site taht will tell me what JAR a particular class
belongs to?

Thanks, - Dave

-- 
View this message in context: 
http://old.nabble.com/Where-is-this-class--tp28332023p28332023.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



RE: Where is this class?

2010-04-22 Thread Joseph Morgan
http://jcp.org/en/jsr/detail?id=303


-Original Message-
From: laredotornado [mailto:laredotorn...@gmail.com] 
Sent: Thursday, April 22, 2010 12:22 PM
To: users@tomcat.apache.org
Subject: Where is this class?


Hi, 

Im running Tomcat 6.0.26.  In my app, I'm getting a
java.lang.ClassNotFoundException: javax.validation.ValidatorFactory
exception.  Does anyone know where to find the ValidatorFactory class?
More
generally, is there a web site taht will tell me what JAR a particular
class
belongs to?

Thanks, - Dave

-- 
View this message in context:
http://old.nabble.com/Where-is-this-class--tp28332023p28332023.html
Sent from the Tomcat - User mailing list archive at Nabble.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: Where is this class?

2010-04-22 Thread laredotornado

Is this just the documentation ?  I'm not able to find the JAR file to
download from this page.

Thanks, - Dave


Joseph Morgan-2 wrote:
 
 http://jcp.org/en/jsr/detail?id=303
 
 
 -Original Message-
 From: laredotornado [mailto:laredotorn...@gmail.com] 
 Sent: Thursday, April 22, 2010 12:22 PM
 To: users@tomcat.apache.org
 Subject: Where is this class?
 
 
 Hi, 
 
 Im running Tomcat 6.0.26.  In my app, I'm getting a
 java.lang.ClassNotFoundException: javax.validation.ValidatorFactory
 exception.  Does anyone know where to find the ValidatorFactory class?
 More
 generally, is there a web site taht will tell me what JAR a particular
 class
 belongs to?
 
 Thanks, - Dave
 
 -- 
 View this message in context:
 http://old.nabble.com/Where-is-this-class--tp28332023p28332023.html
 Sent from the Tomcat - User mailing list archive at Nabble.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
 
 
 

-- 
View this message in context: 
http://old.nabble.com/Where-is-this-class--tp28332023p28332333.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



Re: Session Timeout - Filter Not Called

2010-04-22 Thread Paul Carroll
I guess what I really need to be able to do is determine when a user creates a 
new session.  This could either be done by the user opening the browser and 
browse to our application where the user logs in and the new session is 
created.  Or the user's session times out and the user is presented with our 
login page and the user will login and a new session is created.

--- rfha...@yahoo.com wrote:

From: Bob Hall rfha...@yahoo.com
To: Tomcat Users List users@tomcat.apache.org
Subject: Re: Session Timeout - Filter Not Called
Date: Mon, 12 Apr 2010 23:58:45 -0700 (PDT)

Paul,

--- On Mon, 4/12/10 at 7:21 AM, Paul Carroll pcarr...@nfmail.net wrote:

 That works in that my filter is
 called when the session times out and the user is redirected
 to the login page.  However, the Referer header makes
 no indication that the user is logging in.

What does the referrer header contain?

 If the request URI is not null, then I can redirect them to the requested
 URI if it has been determined that it is a safe area that
 does not need any session variables established.  Is
 there a way to determine if the user's session has timed out
 and the user is logging in once again?

Check for the session variables that would have been set?

- Bob




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





RE: Where is this class?

2010-04-22 Thread Joseph Morgan
Sorry.  Go to this page:

http://jcp.org/aboutJava/communityprocess/final/jsr303/index.html

And then click on the Reference Implementation link to download it
from there.

Unzip the file and in the lib directory you'll find a
validation-api-1.0.0.GA.jar which will have the class in it



-Original Message-
From: laredotornado [mailto:laredotorn...@gmail.com] 
Sent: Thursday, April 22, 2010 12:45 PM
To: users@tomcat.apache.org
Subject: RE: Where is this class?


Is this just the documentation ?  I'm not able to find the JAR file to
download from this page.

Thanks, - Dave


Joseph Morgan-2 wrote:
 
 http://jcp.org/en/jsr/detail?id=303
 
 
 -Original Message-
 From: laredotornado [mailto:laredotorn...@gmail.com] 
 Sent: Thursday, April 22, 2010 12:22 PM
 To: users@tomcat.apache.org
 Subject: Where is this class?
 
 
 Hi, 
 
 Im running Tomcat 6.0.26.  In my app, I'm getting a
 java.lang.ClassNotFoundException: javax.validation.ValidatorFactory
 exception.  Does anyone know where to find the ValidatorFactory class?
 More
 generally, is there a web site taht will tell me what JAR a particular
 class
 belongs to?
 
 Thanks, - Dave
 
 -- 
 View this message in context:
 http://old.nabble.com/Where-is-this-class--tp28332023p28332023.html
 Sent from the Tomcat - User mailing list archive at Nabble.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
 
 
 

-- 
View this message in context:
http://old.nabble.com/Where-is-this-class--tp28332023p28332333.html
Sent from the Tomcat - User mailing list archive at Nabble.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: Client cert authentication

2010-04-22 Thread acastanheira2001

Thanks Mark,

I use mod_proxy (ProxyPass and ProxyReverse) to connect Apache (2.2.3) to
Tomcat(5.5)/Jboss (4.2). Can mod_proxy pass client cert to Tomcat?

I use the following code to get the client cert, but certs object is null:

public void verificaCertCliente(HttpServletRequest req) throws
ServletException
  {
  String[] mensagem = null;
  
  X509Certificate[] certs = (X509Certificate[])
req.getAttribute(javax.servlet.request.X509Certificate);
  if (certs != null) {
for (int i = 0; i  certs.length; i++) {
mensagem[i] = (Client Certificate [ + i + ] =  +
certs[i].toString());
log.info(mensagem[i]);
}
  } else {
  if (https.equals(req.getScheme())) {
log.info(This was an HTTPS request,  + but no client certificate is
available);
  } else {
log.info(This was not an HTTPS request,  + so no client certificate
is available);
  }
  }
}


Thanks in advance for your attention.


markt-2 wrote:
 
 On 19/04/2010 13:05, acastanheira2001 wrote:
 
 Hi,
 
 I have an apache server in front of Tomcat/Jboss, the former receives the
 client cert and does revocation list and trust validation.
 
 I need to pass the client cert to Tomcat only to check the
 SubjectAltNames.
 
 As far as trust accreditation is done by apache, does Tomcat need to have
 a
 keystore and https set?
 
 No.
 
 Mark
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 

-- 
View this message in context: 
http://old.nabble.com/Client-cert-authentication-tp28287654p28333274.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



Re: Client cert authentication

2010-04-22 Thread Mark Thomas
On 22/04/2010 20:00, acastanheira2001 wrote:
 
 Thanks Mark,
 
 I use mod_proxy (ProxyPass and ProxyReverse) to connect Apache (2.2.3) to
 Tomcat(5.5)/Jboss (4.2). Can mod_proxy pass client cert to Tomcat?

With 5.5.x, not with out some custom code. With 6.0.x, yes.

You'd need to port this to Tomcat 5:
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/valves/SSLValve.java?view=annotate

Mark



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



Running tomcat/6.0.26 with security manager generates ORACLE jdbc error

2010-04-22 Thread suresht

hi Users,
when I run TOMCAT using -security option on Java 1.6 jdk, I get following
error. I added policy definitions for all properities, oraclejars and
JNDIpermission for the context.

org.apache.jasper.JasperException: java.lang.ArrayIndexOutOfBoundsException:
-1

org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:491)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:269)
java.security.AccessController.doPrivileged(Native Method)
javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:301)

org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)


root cause 

java.lang.ArrayIndexOutOfBoundsException: -1

oracle.jdbc.driver.T4CTTIoauthenticate.setSessionFields(T4CTTIoauthenticate.java:942)

oracle.jdbc.driver.T4CTTIoauthenticate.init(T4CTTIoauthenticate.java:221)
oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:358)

oracle.jdbc.driver.PhysicalConnection.init(PhysicalConnection.java:508)
oracle.jdbc.driver.T4CConnection.init(T4CConnection.java:203)

oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:33)
oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:510)

oracle.jdbc.pool.OracleDataSource.getPhysicalConnection(OracleDataSource.java:275)

oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:206)
xxx.yyy.CPC.data.DAOUtil.getConnection(Unknown Source)
xxx.yyy.CPC.logging.LogDAO.createLog(Unknown Source)
xxx.yyy.CPC.logging.DBLogger.db(Unknown Source)
org.apache.jsp.CPC.Default_jsp._jspService(Default_jsp.java:90)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:269)
java.security.AccessController.doPrivileged(Native Method)
javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:301)

org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)



when I run the similar program outside tomcat with -security it runs
fine. any thoughts

-suresh
-- 
View this message in context: 
http://old.nabble.com/Running-tomcat-6.0.26-with-security-manager-generates-ORACLE-jdbc-error-tp28333480p28333480.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



Re: Where is this class? - Check out http://findjar.com

2010-04-22 Thread Simon Husin

Dave,

Yes, there is, http://findjar.com


On Thu, 22 Apr 2010 11:22:05 -0600, laredotornado  
laredotorn...@gmail.com wrote:




Hi,

Im running Tomcat 6.0.26.  In my app, I'm getting a
java.lang.ClassNotFoundException: javax.validation.ValidatorFactory
exception.  Does anyone know where to find the ValidatorFactory class?   
More
generally, is there a web site taht will tell me what JAR a particular  
class

belongs to?

Thanks, - Dave




--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

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



Re: a servlet-related Java question

2010-04-22 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Bill,

On 4/22/2010 2:37 AM, Bill Barker wrote:
 It's pretty inaccessible for novice Java programmers, but you could use
 the proxy API which is [just] about the coolest thing available in
 Java IMO.

 If it does a forward or include done the line, this won't work with any
 remotely recent version of Tomcat.  These versions enforce the spec
 requirement that the Request has to be a subclass of HttpServletWrapper
 wrapping the original request, or the original request.

How does Tomcat enforce that? HttpServletRequestWrapper doesn't expose
the underlying request.

I must admit that I didn't try it. I should.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvQpjMACgkQ9CaO5/Lv0PDioACfXvCsWsL6dPHDsegCEqCx0ISZ
oF8Anj+PpzWrSWN9I6BWru0urmdLaWLg
=qt08
-END PGP SIGNATURE-

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



Re: a servlet-related Java question

2010-04-22 Thread Kris Schneider
On Thu, Apr 22, 2010 at 3:40 PM, Christopher Schultz
ch...@christopherschultz.net wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Bill,

 On 4/22/2010 2:37 AM, Bill Barker wrote:
 It's pretty inaccessible for novice Java programmers, but you could use
 the proxy API which is [just] about the coolest thing available in
 Java IMO.

 If it does a forward or include done the line, this won't work with any
 remotely recent version of Tomcat.  These versions enforce the spec
 requirement that the Request has to be a subclass of HttpServletWrapper
 wrapping the original request, or the original request.

 How does Tomcat enforce that? HttpServletRequestWrapper doesn't expose
 the underlying request.

...but ServletRequestWrapper does

 I must admit that I didn't try it. I should.

 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.10 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

 iEYEARECAAYFAkvQpjMACgkQ9CaO5/Lv0PDioACfXvCsWsL6dPHDsegCEqCx0ISZ
 oF8Anj+PpzWrSWN9I6BWru0urmdLaWLg
 =qt08
 -END PGP SIGNATURE-

-- 
Kris Schneider

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



Re: a servlet-related Java question

2010-04-22 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Bill,

On 4/22/2010 2:37 AM, Bill Barker wrote:
 If [the request/filter] does a forward or include done the line, this
 won't work with any remotely recent version of Tomcat.  These
 versions enforce the spec requirement that the Request has to be a
 subclass of HttpServletWrapper wrapping the original request, or the
 original request.

The following filter works as expected on Tomcat 6.0.26 (some changes
were required to make it actually work... my off-the-cuff implementation
was lacking a few details).

I can confirm that this filter operates properly across a forward()
call: I have a struts action handles by the Struts servlet that forwards
to a Velocity template handled by the Velocity servlet. All calls are
logged to stdout. (Wow, lots of calls to Request.getAttribute!)

import java.io.IOException;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class RequestMethodCallLogger
  implements Filter
{
public void doFilter(ServletRequest request,
 ServletResponse response,
 FilterChain chain)
throws ServletException, IOException
{
if(request instanceof HttpServletRequest)
request = (ServletRequest)Proxy

.newProxyInstance(HttpServletRequest.class.getClassLoader(),
new Class[] {
HttpServletRequest.class },
new Wrapper(request));

chain.doFilter(request, response);
}

public void init(FilterConfig config) { }
public void destroy() { }

static class Wrapper
implements InvocationHandler
{
private Object _target;

Wrapper(Object target)
{
_target = target;
}

public Object invoke(Object proxy, Method method, Object[] args)
throws Throwable
{
System.out.print(Intercepted: );
System.out.println(method);

return method.invoke(_target, args);
}
}
}
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvQsjUACgkQ9CaO5/Lv0PA65ACgiR4tiSji6MElZr9/Z0ibXdtX
WJQAnRoB/GZbrSwdfPjcf50IpHFmW4L9
=Stkm
-END PGP SIGNATURE-

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



Re: Running tomcat/6.0.26 with security manager generates ORACLE jdbc error

2010-04-22 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Suresh,

On 4/22/2010 3:19 PM, suresht wrote:
 when I run TOMCAT using -security option on Java 1.6 jdk, I get following
 error. I added policy definitions for all properities, oraclejars and
 JNDIpermission for the context.

Care to share those policy definitions?

 java.lang.ArrayIndexOutOfBoundsException: -1
 
 oracle.jdbc.driver.T4CTTIoauthenticate.setSessionFields(T4CTTIoauthenticate.java:942)

Are you running the latest version of Oracle's JDBC driver?

 when I run the similar program outside tomcat with -security it runs
 fine. any thoughts

Tomcat + your webapp + Oracle JDBC Driver + SecurityManager = Exception
Some other app + Oracle JDBC Driver = no exception

There are very few common terms in those two equations. Are you sure
they have any relation to one another?

For instance, are you running your similar program with the same
policy file? Are you running through the same code that your webapp does?

You never said whether your webapp works properly without the
SecurityManager installed.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvQtFcACgkQ9CaO5/Lv0PDm2QCbBZChSL7huRcZS18GvFBFCTza
1BUAn1WGlfBSYbboiHeZNbC/GqxcNzDP
=zOZB
-END PGP SIGNATURE-

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



Re: Session Timeout - Filter Not Called

2010-04-22 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Paul,

On 4/22/2010 2:44 PM, Paul Carroll wrote:
 I guess what I really need to be able to do is determine when a user creates 
 a new session.  This could either be done by the user opening the browser and 
 browse to our application where the user logs in and the new session is 
 created.  Or the user's session times out and the user is presented with our 
 login page and the user will login and a new session is created.

I think Bob's suggestion that you use a session marker variable will
take care of this for you, no?

 
 --- rfha...@yahoo.com wrote:
 
 From: Bob Hall rfha...@yahoo.com
 To: Tomcat Users List users@tomcat.apache.org
 Subject: Re: Session Timeout - Filter Not Called
 Date: Mon, 12 Apr 2010 23:58:45 -0700 (PDT)
 
 Paul,
 
 --- On Mon, 4/12/10 at 7:21 AM, Paul Carroll pcarr...@nfmail.net wrote:
 
 That works in that my filter is
 called when the session times out and the user is redirected
 to the login page.  However, the Referer header makes
 no indication that the user is logging in.
 
 What does the referrer header contain?
 
 If the request URI is not null, then I can redirect them to the requested
 URI if it has been determined that it is a safe area that
 does not need any session variables established.  Is
 there a way to determine if the user's session has timed out
 and the user is logging in once again?
 
 Check for the session variables that would have been set?
 
 - Bob
 
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvQtVYACgkQ9CaO5/Lv0PB3lQCfZVO1HEaBGdeIQpsKb3ebkLp5
eUIAn1DndzYGedUzYnapHgKi5DOasGpz
=NbBJ
-END PGP SIGNATURE-

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



Re: a servlet-related Java question

2010-04-22 Thread Kris Schneider
On Thu, Apr 22, 2010 at 4:31 PM, Christopher Schultz
ch...@christopherschultz.net wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Bill,

 On 4/22/2010 2:37 AM, Bill Barker wrote:
 If [the request/filter] does a forward or include done the line, this
 won't work with any remotely recent version of Tomcat.  These
 versions enforce the spec requirement that the Request has to be a
 subclass of HttpServletWrapper wrapping the original request, or the
 original request.

 The following filter works as expected on Tomcat 6.0.26 (some changes
 were required to make it actually work... my off-the-cuff implementation
 was lacking a few details).

 I can confirm that this filter operates properly across a forward()
 call: I have a struts action handles by the Struts servlet that forwards
 to a Velocity template handled by the Velocity servlet. All calls are
 logged to stdout. (Wow, lots of calls to Request.getAttribute!)

For reference, here's the snippet from the Servlet 2.5 Spec:

SRV.8.2 Using a Request Dispatcher

To use a request dispatcher, a servlet calls either the include method
or forward method of the RequestDispatcher interface. The parameters
to these methods can be either the request and response arguments that
were passed in via the service method of the javax.servlet interface,
or instances of subclasses of the request and response wrapper classes
that were introduced for version 2.3 of the specification. In the
latter case, the wrapper instances must wrap the request or response
objects that the container passed into the service method.

But...the proxy is created prior to entering a servlet's service
method, so it may well appear to be the original request for the
purposes of creating and validating a dispatcher and its parameters...

 import java.io.IOException;

 import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.Method;
 import java.lang.reflect.Proxy;

 import javax.servlet.Filter;
 import javax.servlet.FilterChain;
 import javax.servlet.FilterConfig;
 import javax.servlet.ServletException;
 import javax.servlet.ServletRequest;
 import javax.servlet.ServletResponse;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;

 public class RequestMethodCallLogger
  implements Filter
 {
    public void doFilter(ServletRequest request,
                         ServletResponse response,
                         FilterChain chain)
        throws ServletException, IOException
    {
        if(request instanceof HttpServletRequest)
            request = (ServletRequest)Proxy

 .newProxyInstance(HttpServletRequest.class.getClassLoader(),
                                    new Class[] {
 HttpServletRequest.class },
                                    new Wrapper(request));

        chain.doFilter(request, response);
    }

    public void init(FilterConfig config) { }
    public void destroy() { }

    static class Wrapper
        implements InvocationHandler
    {
        private Object _target;

        Wrapper(Object target)
        {
            _target = target;
        }

        public Object invoke(Object proxy, Method method, Object[] args)
            throws Throwable
        {
            System.out.print(Intercepted: );
            System.out.println(method);

            return method.invoke(_target, args);
        }
    }
 }
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.10 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

 iEYEARECAAYFAkvQsjUACgkQ9CaO5/Lv0PA65ACgiR4tiSji6MElZr9/Z0ibXdtX
 WJQAnRoB/GZbrSwdfPjcf50IpHFmW4L9
 =Stkm
 -END PGP SIGNATURE-

-- 
Kris Schneider

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



Re: Could not get dir listing

2010-04-22 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Christoph,

On 4/21/2010 8:59 AM, Christoph Kukulies wrote:
 Strange. Don't know whether this has happened since I upgraded to Tomcat
 6.0.26, anyway, my application doesn't start anymore.

:(

 21.04.2010 14:49:36 org.apache.naming.resources.FileDirContext list
 WARNUNG: Could not get dir listing for
 C:\Programme\Apache_Group\Tomcat_6.0\webapps\ROOT\WEB-INF\lib
 21.04.2010 14:49:36 org.apache.naming.resources.FileDirContext list
 WARNUNG: Could not get dir listing for
 C:\Programme\Apache_Group\Tomcat_6.0\webapps\ROOT\WEB-INF
 
 The directories are there. I compared the entry with a backup I have and
 I couldn't see any
 differences.

Sounds like a permissions issue. Check all the permissions for the
directories in that path to make sure the Tomcat user has access to
them. Remember that if you're running Tomcat as a service, it runs with
virtually no access privileges.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvQtjgACgkQ9CaO5/Lv0PCbnACfYlfSTp327QATuozOlWR0dCzQ
JWQAoIAMHdt93nJHFoldWNfDk5/b/k2s
=q4Ie
-END PGP SIGNATURE-

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



Re: Running tomcat/6.0.26 with security manager generates ORACLE jdbc error

2010-04-22 Thread suresht

hi Christopher
   i have attached a copy of the policy file.
 

   yes that is true but the command line application includes the security
manager with equivalent policy,

Tomcat + your webapp + Oracle JDBC Driver + SecurityManager = Exception
Some other app + Oracle JDBC Driver  = no exception

   I am running oracle jdbc thin driver ConnectionPool
http://old.nabble.com/file/p28334465/catalina.policy.2 catalina.policy.2  
11.1.0.7.0-Produ


  The web application works fine without the security manager.


Christopher Schultz-2 wrote:
 
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Suresh,
 
 On 4/22/2010 3:19 PM, suresht wrote:
 when I run TOMCAT using -security option on Java 1.6 jdk, I get following
 error. I added policy definitions for all properities, oraclejars and
 JNDIpermission for the context.
 
 Care to share those policy definitions?
 
 java.lang.ArrayIndexOutOfBoundsException: -1
 
 oracle.jdbc.driver.T4CTTIoauthenticate.setSessionFields(T4CTTIoauthenticate.java:942)
 
 Are you running the latest version of Oracle's JDBC driver?
 
 when I run the similar program outside tomcat with -security it runs
 fine. any thoughts
 
 Tomcat + your webapp + Oracle JDBC Driver + SecurityManager = Exception
 Some other app + Oracle JDBC Driver = no exception
 
 There are very few common terms in those two equations. Are you sure
 they have any relation to one another?
 
 For instance, are you running your similar program with the same
 policy file? Are you running through the same code that your webapp does?
 
 You never said whether your webapp works properly without the
 SecurityManager installed.
 
 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.10 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
 
 iEYEARECAAYFAkvQtFcACgkQ9CaO5/Lv0PDm2QCbBZChSL7huRcZS18GvFBFCTza
 1BUAn1WGlfBSYbboiHeZNbC/GqxcNzDP
 =zOZB
 -END PGP SIGNATURE-
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 

-- 
View this message in context: 
http://old.nabble.com/Running-tomcat-6.0.26-with-security-manager-generates-ORACLE-jdbc-error-tp28333480p28334465.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



Re: separating content from the application

2010-04-22 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Milko,

On 4/21/2010 4:54 AM, M.H.G. Emmerig wrote:
 webapps\Root\applicationfiles
 webapps\Root\content\publications
 webapps\Root\content\images

Make sure that's ROOT, not Root, unless your webapp really is called Root.

 the application comes as a war file and the content is placed via another
 process.
 
 the folder structure is placed on a windows share.

Yikes. I've seen clusters using NFS to share a deployment like this...
it doesn't work well.

 Our current problem:
 
 Whenever there is a problem with the share, the application crashes,
 because tomcat can't find the application files anymore.

Yup.

 When the share comes back online, tomcat does not recover from the failure
 and a restart is the only option.

Yup.

 Now I have the following questions:
 
 I think separating the application from the content and placing the
 application local to tomcat (basically on the same machine)
 will solve the recovery issue.

Yes, but the content will seem to disappear and reappear. I'm not an
expert with Tomcat's DefaultServlet, but it does some caching of data
and might actually cache a 404/500 so any interruption of data access
might result in the content disappearing for longer than the share's
disappearance.

 I know placing everything local to the tomcat will be the best way and
 gives the best performance, but at the moment that is not an option.

That's too bad.

 The questions
 
 - Will placing the app local to the tomcat solve the recovery issue?

Tomcat will not have to recover, so, presumably, yes.

 - Is there an easy way to separate the app and the content, ie. some sort
 of pathsetting ?

That depends on how you use your content.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvQtzwACgkQ9CaO5/Lv0PAaDACeKQHuefJiiZcmbBBv7u1fH40T
qhkAoLf4cYu3hpnVT14/CN6ZgJruxFX9
=LKQW
-END PGP SIGNATURE-

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



Re: a servlet-related Java question

2010-04-22 Thread Konstantin Kolinko
2010/4/23 Kris Schneider kschnei...@gmail.com:
 On Thu, Apr 22, 2010 at 4:31 PM, Christopher Schultz
 ch...@christopherschultz.net wrote:
 -BEGIN PGP SIGNED MESSAGE-
 On 4/22/2010 2:37 AM, Bill Barker wrote:
 If [the request/filter] does a forward or include done the line, this
 won't work with any remotely recent version of Tomcat.  These
 versions enforce the spec requirement that the Request has to be a
 subclass of HttpServletWrapper wrapping the original request, or the
 original request.

SRV.8.2 is enforced when STRICT_SERVLET_COMPLIANCE property is set to true.

http://tomcat.apache.org/tomcat-6.0-doc/config/systemprops.html#Specification

Best regards,
Konstantin Kolinko

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



Re: a servlet-related Java question

2010-04-22 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Kris,

On 4/22/2010 4:48 PM, Kris Schneider wrote:
 On Thu, Apr 22, 2010 at 4:31 PM, Christopher Schultz
 ch...@christopherschultz.net wrote:

 The following filter works as expected on Tomcat 6.0.26 (some changes
 were required to make it actually work... my off-the-cuff implementation
 was lacking a few details).

 For reference, here's the snippet from the Servlet 2.5 Spec:
 
 SRV.8.2 Using a Request Dispatcher
 
 To use a request dispatcher, a servlet calls either the include method
 or forward method of the RequestDispatcher interface. The parameters
 to these methods can be either the request and response arguments that
 were passed in via the service method of the javax.servlet interface,
 or instances of subclasses of the request and response wrapper classes
 that were introduced for version 2.3 of the specification. In the
 latter case, the wrapper instances must wrap the request or response
 objects that the container passed into the service method.
 
 But...the proxy is created prior to entering a servlet's service
 method

Yes, but there's nothing stopping me from placing the filter so that it
only wraps FORWARD requests and violating the specification. I'll try
that: I'm sure it'll still work.

 so it may well appear to be the original request for the
 purposes of creating and validating a dispatcher and its parameters...

It probably doesn't matter: there's no real value in enforcing this
particular requirement of the specification, so I'd be surprised if
anyone has bothered to do so.

Yup: adding dispatcherFORWARD/dispatcher to my filter still
intercepts the calls without complaint. With a Servlet 2.3 DOCTYPE to boot.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvQuwwACgkQ9CaO5/Lv0PAH+ACdHvyK0sJoaDQ1qIbnWA5eD9c8
sccAoL4TyPUWAcvzXTE06vha3QFYUK4s
=EehI
-END PGP SIGNATURE-

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



Re: a servlet-related Java question

2010-04-22 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Konstantin,

On 4/22/2010 4:53 PM, Konstantin Kolinko wrote:
 2010/4/23 Kris Schneider kschnei...@gmail.com:
 On Thu, Apr 22, 2010 at 4:31 PM, Christopher Schultz
 ch...@christopherschultz.net wrote:
 -BEGIN PGP SIGNED MESSAGE-
 On 4/22/2010 2:37 AM, Bill Barker wrote:
 If [the request/filter] does a forward or include done the line, this
 won't work with any remotely recent version of Tomcat.  These
 versions enforce the spec requirement that the Request has to be a
 subclass of HttpServletWrapper wrapping the original request, or the
 original request.
 
 SRV.8.2 is enforced when STRICT_SERVLET_COMPLIANCE property is set to true.
 
 http://tomcat.apache.org/tomcat-6.0-doc/config/systemprops.html#Specification

$ export CATALINA_OPTS=-Dorg.apache.catalina.STRICT_SERVLET_COMPLIANCE=true
$ ant tomcat-start
Buildfile: build.xml

check-local-properties:

build-local-properties:

init:

check-tomcat-config:

prepare-local-tomcat:

tomcat-start:
 [echo] ===
 [echo] Starting Tomcat
 [echo] ===
 [echo] JAVA_HOME is /usr
 [echo] JAVA_OPTS is -Xmx64M
 [echo] CATALINA_HOME is /usr/local/apache-tomcat-6.0.26
 [echo] CATALINA_BASE is /xxx
 [echo] CATALINA_OPTS is
- -Dorg.apache.catalina.STRICT_SERVLET_COMPLIANCE=true
- -Djava.library.path=/usr/local/apache-tomcat-6.0.26/server/lib
 [echo] security-option is

BUILD SUCCESSFUL
Total time: 0 seconds
$

Still runs. :p

I double-checked that the system property
org.apache.catalina.STRICT_SERVLET_COMPLIANCE = true in the running
VM. It is.

I'd love to see the code that enforces this: it shouldn't be that hard
to do, as Tomcat gets to specify the implementation of the original
request and can unwrap any wrapped request to determine if it's legit.

Kris and Bill are right: this shouldn't work, but it does.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvQvIEACgkQ9CaO5/Lv0PCmBQCfYmmspo4D8/Dvh0G7/QrF5dI7
eQYAoKLfh7XbI6wphEMyxuikqDORthlk
=l+5A
-END PGP SIGNATURE-

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



Re: Running tomcat/6.0.26 with security manager generates ORACLE jdbc error

2010-04-22 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Suresh,

On 4/22/2010 4:51 PM, suresht wrote:
 i have attached a copy of the policy file.

It was stripped by the list.

 yes that is true but the command line application includes the security
 manager with equivalent policy

Ok.

 The web application works fine without the security manager.

Since the error occurs in the JDBC driver, I would imagine that the
problem is there: the driver is not properly checking array bounds when
accessing a String.

Now, more than likely it's some String that is no longer available due
to the presence of the SecurityManager, but we'll never know what the
real problem is until we can get a report of what String the driver
can't read properly.

Do you have the source code of the JDBC driver? Can you decompile it to
find out what is blowing up?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvQvccACgkQ9CaO5/Lv0PDqXQCfT5BcPuXT2qaKp4ZCChMsBrKy
Ex4AnikHuVhogRnOM8HW0y3cx9TjqRWu
=4vR2
-END PGP SIGNATURE-

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



Re: Session Timeout - Filter Not Called

2010-04-22 Thread Paul Carroll
Yes.  I put the session marker in my filter and I perform a simple check each 
time through the filter to determine if the marker exists and to check if it 
equals the current session id.

Thanks.

--- ch...@christopherschultz.net wrote:

From: Christopher Schultz ch...@christopherschultz.net
To: Tomcat Users List users@tomcat.apache.org
Subject: Re: Session Timeout - Filter Not Called
Date: Thu, 22 Apr 2010 16:45:10 -0400

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Paul,

On 4/22/2010 2:44 PM, Paul Carroll wrote:
 I guess what I really need to be able to do is determine when a user creates 
 a new session.  This could either be done by the user opening the browser and 
 browse to our application where the user logs in and the new session is 
 created.  Or the user's session times out and the user is presented with our 
 login page and the user will login and a new session is created.

I think Bob's suggestion that you use a session marker variable will
take care of this for you, no?

 
 --- rfha...@yahoo.com wrote:
 
 From: Bob Hall rfha...@yahoo.com
 To: Tomcat Users List users@tomcat.apache.org
 Subject: Re: Session Timeout - Filter Not Called
 Date: Mon, 12 Apr 2010 23:58:45 -0700 (PDT)
 
 Paul,
 
 --- On Mon, 4/12/10 at 7:21 AM, Paul Carroll pcarr...@nfmail.net wrote:
 
 That works in that my filter is
 called when the session times out and the user is redirected
 to the login page.  However, the Referer header makes
 no indication that the user is logging in.
 
 What does the referrer header contain?
 
 If the request URI is not null, then I can redirect them to the requested
 URI if it has been determined that it is a safe area that
 does not need any session variables established.  Is
 there a way to determine if the user's session has timed out
 and the user is logging in once again?
 
 Check for the session variables that would have been set?
 
 - Bob
 
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvQtVYACgkQ9CaO5/Lv0PB3lQCfZVO1HEaBGdeIQpsKb3ebkLp5
eUIAn1DndzYGedUzYnapHgKi5DOasGpz
=NbBJ
-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: a servlet-related Java question

2010-04-22 Thread Konstantin Kolinko
2010/4/23 Christopher Schultz ch...@christopherschultz.net:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Konstantin,

 On 4/22/2010 4:53 PM, Konstantin Kolinko wrote:
 2010/4/23 Kris Schneider kschnei...@gmail.com:
 On Thu, Apr 22, 2010 at 4:31 PM, Christopher Schultz
 ch...@christopherschultz.net wrote:
 -BEGIN PGP SIGNED MESSAGE-
 On 4/22/2010 2:37 AM, Bill Barker wrote:
 If [the request/filter] does a forward or include done the line, this
 won't work with any remotely recent version of Tomcat.  These
 versions enforce the spec requirement that the Request has to be a
 subclass of HttpServletWrapper wrapping the original request, or the
 original request.

 SRV.8.2 is enforced when STRICT_SERVLET_COMPLIANCE property is set to true.

 http://tomcat.apache.org/tomcat-6.0-doc/config/systemprops.html#Specification

 $ export CATALINA_OPTS=-Dorg.apache.catalina.STRICT_SERVLET_COMPLIANCE=true

 I'd love to see the code that enforces this:


Search for applicationDispatcher.specViolation.request and
applicationDispatcher.specViolation.response or for SRV.8.2 in the
code.

Best regards,
Konstantin Kolinko

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



Re: virtual host configuration

2010-04-22 Thread Leon Kolchinsky
Try here http://myunster.com/blog/10.html

http://myunster.com/blog/10.htmlBest Regards,
Leon Kolchinsky

On Thu, Apr 22, 2010 at 12:00, daulat khan daulat@gmail.com wrote:

 Hi,

 I am planning to setup virtual hosting in apache-tomcat integrated
 setup. Please share useful links or docs which will help me in
 accomplishing this.



 also  using,

 httpd v2.2.14
 tomcat v6.0.20
 tomcat connector v1.2.28


 Thanks,
 Daulatkhan

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




Re: Running tomcat/6.0.26 with security manager generates ORACLE jdbc error

2010-04-22 Thread suresht

hi Christopher,
  I see a char array being set to a number.
charstring1[charstring1-1] = 0;



Christopher Schultz-2 wrote:
 
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Suresh,
 
 On 4/22/2010 4:51 PM, suresht wrote:
 i have attached a copy of the policy file.
 
 It was stripped by the list.
 
 yes that is true but the command line application includes the security
 manager with equivalent policy
 
 Ok.
 
 The web application works fine without the security manager.
 
 Since the error occurs in the JDBC driver, I would imagine that the
 problem is there: the driver is not properly checking array bounds when
 accessing a String.
 
 Now, more than likely it's some String that is no longer available due
 to the presence of the SecurityManager, but we'll never know what the
 real problem is until we can get a report of what String the driver
 can't read properly.
 
 Do you have the source code of the JDBC driver? Can you decompile it to
 find out what is blowing up?
 
 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.10 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
 
 iEYEARECAAYFAkvQvccACgkQ9CaO5/Lv0PDqXQCfT5BcPuXT2qaKp4ZCChMsBrKy
 Ex4AnikHuVhogRnOM8HW0y3cx9TjqRWu
 =4vR2
 -END PGP SIGNATURE-
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 

-- 
View this message in context: 
http://old.nabble.com/Running-tomcat-6.0.26-with-security-manager-generates-ORACLE-jdbc-error-tp28333480p28336163.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



Re: Q: how to obtain notification when a WebApp is unloaded/reloaded?

2010-04-22 Thread Godmar Back
Following up on an earlier conversation about how to obtain notification
when a WebApp is unloaded/reloaded [1], I was told that registering a
ServletContextListener is the only possibility (that is, there is no runtime
API.)

However, registering a ServletContextListener doesn't work and leads to me
being unable to start the web application.

To recap: I have an application with context reloadable=true. I continuously
recompile this application during development. The application starts a
worker thread I need to shut down when a newly compiled version of the
application is loaded (that is, when new versions of the .class files show
up in the WEB-INF/classes directory.

Right now, I'm getting messages that the listener class is missing (it isn't
- it's just a new .class file after recompilation.)

Apr 22, 2010 10:31:25 PM org.apache.catalina.loader.WebappClassLoader
modified
SEVERE: Resource
'/WEB-INF/classes/org/libx/editionbuilder/GCHelper$ShutdownListener.class'
is missing
Apr 22, 2010 10:31:25 PM org.apache.catalina.core.StandardContext reload
INFO: Reloading this Context has started
Apr 22, 2010 10:31:25 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Apr 22, 2010 10:31:25 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/gbed] startup failed due to previous errors

My web.xml contains:
listener

listener-classorg.libx.editionbuilder.GCHelper$ShutdownListener/listener-class
/listener

So - what is the correct way to register a listener that is executed when an
application is reloaded due to a recompilation?

Does Tomcat get confused when the listener class itself is part of the
to-be-reloaded web application?

Thanks.

 - Godmar


[1] See
http://mail-archives.apache.org/mod_mbox/tomcat-users/201004.mbox/%3cu2s719dced31004132122oc656c456ya25e1a4ba4d4a...@mail.gmail.com%3e
and the messages in that thread.

-- Forwarded message --
From: Godmar Back god...@gmail.com
Date: Wed, Apr 14, 2010 at 10:20 AM
Subject: Re: Q: how to obtain notification when a WebApp is
unloaded/reloaded?
To: Tomcat Users List users@tomcat.apache.org


On Wed, Apr 14, 2010 at 10:12 AM, Pid p...@pidster.com wrote:

  For instance, if you look at
 
 http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/ServletContextListener.html
  it says:
 
  To recieve (sic) notification events, the implementation class must be
  configured in the deployment descriptor for the web application.

 Web applications are largely configured by the web.xml file in
 app/WEB-INF.  Servlets, listeners etc are all configured in it.


Thank you for your confirmation.  I thought I was going nuts, after having
waded through various *Facade classes, hoping to find an API method I could
call at runtime.

I have added a ServletContextListener, but it is very much a solution I
strongly dislike. The reason is that my application is layered on top of
another application (ZK), and I don't really want to touch web.xml.
'web.xml' describes how ZK is configured to run inside Tomcat or another
J2EE server. My applications runs on top of ZK, and having to go and made
changes to the underlying deployment descriptor violates basic principles of
layering.

It also creates a maintenance problem (unless an application can have
multiple .xml files that are combined to form a deployment descriptor).
Whenever ZK is updated, a new version of web.xml will be installed, and I
would then have to merge my listener declaration into the new file.

Just out of curiosity, what is the rationale for the (apparently deliberate)
lack of an runtime API?

 - Godmar