RE: Apache tomcat (7.0.27) is not loading the user and role class for JAASRealm

2012-06-19 Thread javed Ansari
Hi,

But how to call the logout on my LoginModule? That is my actual question. I
do not have a LoginModule object with me. LoginModule is called by tomcat
himself when we use Form Based Authentication.

=
Javed

Just call Session.invalidate() or HttpServletRequest.logout(). The JAASRealm
will do the rest, and call logout() on your LoginModule. Note that you can't
assume it is the same instance of your login module, that's what all the
shared state is for.

EJP


Re: Apache tomcat (7.0.27) is not loading the user and role class for JAASRealm

2012-06-19 Thread Casper Wandahl Schmidt


Den 19-06-2012 08:41, javed Ansari skrev:

Hi,

But how to call the logout on my LoginModule? That is my actual question. I
do not have a LoginModule object with me. LoginModule is called by tomcat
himself when we use Form Based Authentication.
Read what EJP said again. When you call Session.invalidate() or 
HttpServletRequest.logout() it should call logout on LoginModule for you!


Med venlig hilsen/Kind regards
Casper W. Schmidt



=
Javed

Just call Session.invalidate() or HttpServletRequest.logout(). The JAASRealm
will do the rest, and call logout() on your LoginModule. Note that you can't
assume it is the same instance of your login module, that's what all the
shared state is for.

EJP



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



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

2012-06-19 Thread Sharon Prober (sprober)
You could always position your jsp's inside the WEB-INF dir
This will enable you to access them only through server redirects rather
than absolute url's

Sharon

-Original Message-
From: Kiran Badi [mailto:ki...@poonam.org] 
Sent: Tuesday, June 19, 2012 3:10 AM
To: Tomcat Users List
Subject: Protect JSP from Direct Access in Tomcat 7.0.xx

Hi All,

I need your guidance again.I have bunch of JSP's close to 100+ which I
need to protect it from direct access.

I have this mapping in web xml and this is not working,It seems that
probably i need to define a role first and then use below settings.But
unfortunately my app is open internet application which does not use
realm at all.

security-constraint
display-nameDenyAccesstoDirectJSP/display-name
web-resource-collection
web-resource-namesample.jsp/web-resource-name
descriptionSample confirmation JSP/description
url-pattern*.jsp/url-pattern http-methodGET/http-method
http-methodPOST/http-method /web-resource-collection
/security-constraint

All my jsp's are residing in the webpages folder of project directory.I
know this is incorrect and probably gives direct access to jsp's.

So I have some clarification to ask,

1. is their a way to tell tomcat to not to serve direct jsp's probably
via web xml

2. Is their any extra setting that is required if I move my JSP's inside
web-inf.I created a folder under web-inf and create sample hello
world.jsp and then tried to invoke that jsp but got 404 message.

- Kiran

-
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: Apache tomcat (7.0.27) is not loading the user and role class for JAASRealm

2012-06-19 Thread javed Ansari
Hmmm,

By Session I assume you mean HttpSession.  I have below code in the doPost
of the Login click.

HttpSession session = req.getSession();

session.invalidate();
And then I am redirecting to Login page.

Next when I try to login in the same browser session, it shows an error
(error code 408) page saying..
 

HTTP Status 408 - The time allowed for the login process has been exceeded.
If you wish to continue you must either click back twice and re-click the
link you requested or close and re-open your browser
--

*type* Status report

*message* *The time allowed for the login process has been exceeded. If you
wish to continue you must either click back twice and re-click the link you
requested or close and re-open your browser*

*description* *The client did not produce a request within the time that
the server was prepared to wait (The time allowed for the login process has
been exceeded. If you wish to continue you must either click back twice and
re-click the link you requested or close and re-open your browser).*
 --
 Apache Tomcat/7.0.27
===

Ideally I should be able to login once I click on the logout in the same
browser session. I am also able to go back to the page by clicking on the
back button of the browser twice as suggested by the error message.

Although on opening a new browser session it is logging in correctly.
I also put some log in the LoginModule.logout() and found that logout() is
not getting callled at all..
On Tue, Jun 19, 2012 at 1:13 PM, Casper Wandahl Schmidt 
kalle.pri...@gmail.com wrote:


 Den 19-06-2012 08:41, javed Ansari skrev:

 Hi,

 But how to call the logout on my LoginModule? That is my actual question.
 I
 do not have a LoginModule object with me. LoginModule is called by tomcat
 himself when we use Form Based Authentication.

 Read what EJP said again. When you call Session.invalidate() or
 HttpServletRequest.logout() it should call logout on LoginModule for you!

 Med venlig hilsen/Kind regards
 Casper W. Schmidt



 ==**==**=
 Javed

 Just call Session.invalidate() or HttpServletRequest.logout(). The
 JAASRealm
 will do the rest, and call logout() on your LoginModule. Note that you
 can't
 assume it is the same instance of your login module, that's what all the
 shared state is for.

 EJP


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




Re: Abtract methods in DelegatingResultSet

2012-06-19 Thread Mark Thomas
On 19/06/2012 06:07, Olivier Lefevre wrote:
 I just noticed that the DelegatingResultSet object handed by Tomcat
 sports a slew of abstract methods even though the class itself is
 not declared abstract. In Tomcat 7.0.x there are only 2 such methods:
 the two getObject methods taking a Class as second argument, which are
 also the only two methods marked as 1.7 level in the Javadocs, but for
 Tomcat 6.0.x there are lots of them, including the isClosed method, all
 of them marked 1.6 level AFAICT.
 
 This seems very wrong, esp. the fact the DelegatingResultSet class is
 not marked as abstract. I have attached a test servlet that demonstrates
 the behaviour: install it and call http://localhost:8080/test1/get
 (or whatever is your Tomcat server location). I tested against 6.0.30
 and 7.0.27. Can somebody comment?

Compare the definition of the ResultSet interface in the version of the
JDK the class was compiled with with the definition in the version of
the JDK you are running with.

Mark

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



[ANN] Apache Tomcat 7.0.28 released

2012-06-19 Thread Mark Thomas
The Apache Tomcat team announces the immediate availability of Apache
Tomcat 7.0.28.

Apache Tomcat is an open source software implementation of the Java
Servlet and JavaServer Pages technologies.

This release is includes may improvements as well as a number of bug
fixes compared to version 7.0.27. The notable changes include:
* The minimum required APR/native library version required if the
  APR/native connector is used is now 1.1.24.
* Various fixes and improvements to WebSocket support including the use
  of infinite time outs by default for WebSocket connections.
* Various fixes and improvements to annotation scanning.

Please refer to the change log for the complete list of changes:
http://tomcat.apache.org/tomcat-7.0-doc/changelog.html

Note: This version has 4 zip binaries: a generic one and three
  bundled with Tomcat native binaries for Windows operating systems
  running on different CPU architectures.

Note: If you use the APR/native AJP or HTTP connector you *must* upgrade
  to version 1.1.24 or later of the AJP/native library

Downloads:
http://tomcat.apache.org/download-70.cgi

Migration guides from Apache Tomcat 5.5.x and 6.0.x:
http://tomcat.apache.org/migration.html

Thank you,

-- The Apache Tomcat Team

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



Re: apache-tomcat-7.0.27 start up errors on Mac OX Lion

2012-06-19 Thread Daniel Mikusa
- Original Message -
 I followed directions for install and config here:
 http://wolfpaulus.com/journal/mac/tomcat7
 
 and here:
 
 http://www.janhellevik.no/blog/?p=323
 
 When attempting to start Tomcat I get the following error…. ( I've
 googled the _ _ it out of this error and can't find a fix.
 
 sudo $CATALINA_HOME/bin/catalina.sh run
 Password:
 Using CATALINA_BASE:   /Library/Tomcat
 Using CATALINA_HOME:   /Library/Tomcat
 Using CATALINA_TMPDIR: /Library/Tomcat/temp
 Using JRE_HOME:
/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home
 Using CLASSPATH:
   /Library/Tomcat/bin/bootstrap.jar:/Library/Tomcat/bin/tomcat-juli.jar
 Exception in thread main java.lang.NoClassDefFoundError:
 org/apache/catalina/startup/Bootstrap
 Caused by: java.lang.ClassNotFoundException:
 org.apache.catalina.startup.Bootstrap
   at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

Don't do this.  Use bin/startup.sh to start Tomcat and bin/shutdown.sh to 
stop it.  Life will be much simpler this way.


 
 When I attempt start this way:
 
 sudo /Library/Tomcat/bin/startup.sh
 Password:
 Using CATALINA_BASE:   /Library/Tomcat
 Using CATALINA_HOME:   /Library/Tomcat
 Using CATALINA_TMPDIR: /Library/Tomcat/temp
 Using JRE_HOME:
/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home
 Using CLASSPATH:
   /Library/Tomcat/bin/bootstrap.jar:/Library/Tomcat/bin/tomcat-juli.jar
 
 I get no errors, but http://localhost:8080 does not connect.

This could be a number of things.  What do you see in your log file after 
Tomcat starts?  Any errors or stack traces?

Also, do you have any applications deployed to Tomcat?  

Dan



 
 Thanks for any help!
 
 Samuel.
 -
 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: apache-tomcat-7.0.27 start up errors on Mac OX Lion

2012-06-19 Thread Oguz Kologlu
You are likely getting the same error in both cases. Just that in the first 
case you can see the error on the console. 
In the second case it's just going to a log file.

It could be a bad download/unzip/permission error. 

Make sure you have JAVA_HOME defined (maybe in your ~/.profile )

Oz

On 19/06/2012, at 10:55 PM, Daniel Mikusa wrote:

 - Original Message -
 I followed directions for install and config here:
 http://wolfpaulus.com/journal/mac/tomcat7
 
 and here:
 
 http://www.janhellevik.no/blog/?p=323
 
 When attempting to start Tomcat I get the following error…. ( I've
 googled the _ _ it out of this error and can't find a fix.
 
 sudo $CATALINA_HOME/bin/catalina.sh run
 Password:
 Using CATALINA_BASE:   /Library/Tomcat
 Using CATALINA_HOME:   /Library/Tomcat
 Using CATALINA_TMPDIR: /Library/Tomcat/temp
 Using JRE_HOME:
   /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home
 Using CLASSPATH:
  /Library/Tomcat/bin/bootstrap.jar:/Library/Tomcat/bin/tomcat-juli.jar
 Exception in thread main java.lang.NoClassDefFoundError:
 org/apache/catalina/startup/Bootstrap
 Caused by: java.lang.ClassNotFoundException:
 org.apache.catalina.startup.Bootstrap
  at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
 
 Don't do this.  Use bin/startup.sh to start Tomcat and bin/shutdown.sh to 
 stop it.  Life will be much simpler this way.

startup.sh and shutdown.sh are useful in a development environment.
You'll likely need to learn how to use catalina.sh in a production environment.


 
 
 When I attempt start this way:
 
 sudo /Library/Tomcat/bin/startup.sh
 Password:
 Using CATALINA_BASE:   /Library/Tomcat
 Using CATALINA_HOME:   /Library/Tomcat
 Using CATALINA_TMPDIR: /Library/Tomcat/temp
 Using JRE_HOME:
   /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home
 Using CLASSPATH:
  /Library/Tomcat/bin/bootstrap.jar:/Library/Tomcat/bin/tomcat-juli.jar
 
 I get no errors, but http://localhost:8080 does not connect.
 
 This could be a number of things.  What do you see in your log file after 
 Tomcat starts?  Any errors or stack traces?
 
 Also, do you have any applications deployed to Tomcat?  
 
 Dan
 
 
 
 
 Thanks for any help!
 
 Samuel.
 -
 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: Modify HTTP status returned by stopped context

2012-06-19 Thread kharper2
Chris,

First, thanks again for your help.  I appreciate it.

To answer your questions:

Where did you configure this? Which webapp's web.xml?
In the ROOT context (/).  I'm on Ubuntu 10.04 with defaults,
so /var/lib/tomcat6/webapps/ROOT/WEB-INF/web.xml

Yes, the longest match should win.
We keep saying the longest match should win, but looking at the
configuration it seems illogical.  If I configure the following:
ROOT context:  /foo/*  (My special servlet)
foo context:  /  (DefaultServlet)

It would  seem like the ROOT context would always try to respond first,
since it has the longest matching URL pattern.  Even if you extrapolate
from the context name you're left comparing these two things:
ROOT context:  /foo/*
foo context:  /foo/

Based on my testing this isn't the case.  So is it accurate to say tomcat's
logic is (or we expect it to be):
1.  Look for a context that matches the URL base pattern.
2.  If not found, search all contexts for servlets with URL patterns that
can service the request and select the one with the longest match.


As for testing on 6.0.35 and 7.0.28, yea I can do that.  I'll set all that
up and submit a bug report if I can't get the intended behavior to work.
But this bring up another point:  wouldn't it be more accurate for tomcat
return HTTP Status Code 503 for a context that has been deployed but is in
the stopped/errored state?  Strictly speaking, it isn't not found but
rather unavailable.  If there is a better forum/group to have this
discussion with let me know.

I'll report back with my test results.  Thanks!

Kyle Harper




From:   Christopher Schultz ch...@christopherschultz.net
To: Tomcat Users List users@tomcat.apache.org
Date:   06/18/2012 07:49 PM
Subject:Re: Modify HTTP status returned by stopped context



-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Kyle,

On 6/18/12 3:52 PM, kharp...@oreillyauto.com wrote:
 Thank you for the direction.  I created my own servlet which loads
 without error.  Here is how I've configured it:

Where did you configure this? Which webapp's web.xml?

 servlet servlet-nameHttpResponseAdjuster/servlet-name
 servlet-classbla.bla.tomcat.ReturnNotAvailableServlet/servlet-class


load-on-startup1/load-on-startup

You don't need to load this on startup if you don't want to: the
servlet will be initialized when necessary.

 /servlet

 servlet-mapping
 servlet-nameHttpResponseAdjuster/servlet-name
 url-pattern/foo/*/url-pattern /servlet-mapping

 servlet-mapping
 servlet-nameHttpResponseAdjuster/servlet-name
 url-pattern/Testing/*/url-pattern /servlet-mapping

 Unfortunately, when I stop the foo context, tomcat is still
 returning the default HTTP 404 page.  It doesn't appear to give any
 consideration to the servlet mapping in my ROOT context.  Unless
 I've configured something wrong, it appears the desired behavior
 (to look for /Context first, then a ROOT servlet with mapping of
 /Context/*) isn't happening.

Yes, the longest match should win.

 You'll notice I setup another servlet-mapping called /Testing/*.
 Testing is NOT a context.  When I go to myserver:8080/Testing my
 servlet handles the request and does what I desire (HTTP 503).  To
 reiterate, my version of tomcat is 6.0.24.  Perhaps the logic we're
 relying on wasn't introduced until later?  Or maybe I'm missing a
 configuration option at a higher level to send failed requests to
 search the ROOT context for mappings?

Assuming you have everything configured as described, then your
expected behavior is also what I'd expect.  Please test with latest
6.0 which is 6.0.35. If that doesn't work, please also test with
7.0.28 (freshly minted this weekend) and let us know if you have more
success.

If it does not work with 6.0.35 or it does not work with 7.0.28, can
you create a simple test case (ROOT.war + some other WAR w/overlapping
URI spaces) and create a Bugzilla ticket for it (or 2, if the bug
exists in both versions)?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk/fyvkACgkQ9CaO5/Lv0PBkvwCgiZ9fDieTRdPSJTkrphxRn7Yi
CoUAoJy5RTwqSwSLCJe5hrnpmw747k4O
=5ESc
-END PGP SIGNATURE-

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


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



This communication and any attachments are confidential, protected by 
Communications Privacy Act 18 USCS § 2510, solely for the use of the intended 
recipient, and may contain legally privileged material. If you are not the 
intended recipient, please return or destroy it immediately. Thank you.

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

Re: Javamail exception in tomcat 7.0.11

2012-06-19 Thread Kiran Badi

On 6/19/2012 11:23 AM, Tim Watts wrote:

I have send mail servlet, which looks something like below,
  
  protected void doPost(HttpServletRequest request, HttpServletResponse

  response) throws ServletException, IOException {
   String emailRecipient = request.getParameter(name);
//   String emailRecipient = xxx;
try {
Message msg = new MimeMessage(this.session);

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


This was the real issue.Caught the exception now and could see the root 
cause now and fixed it.Eureka you guys are genius and eye  for detail.


One more suggestion I need, I had mail.jar/mailapi.jar/pop3.jar/smtp.jar 
all over, they were in project library, tomcat lib and I remove all 
those reference and had just mail.jar in tomcat lib,bounced the server 
many times and only after that I managed to make this work.


How do you remove safely all reference without impacting the server or 
your build script ? Do you just comment out the reference of jars or 
your physically remove them from the folder ?
Now a days quite often my build fails if I remove or other jars,so want 
to learn this trick as well.



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



Re: apache-tomcat-7.0.27 start up errors on Mac OX Lion

2012-06-19 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Samuel,

On 6/18/12 11:34 PM, Samuel V Green III wrote:
 I followed directions for install and config here: 
 http://wolfpaulus.com/journal/mac/tomcat7

I use Tomcat 7.0.27 on my Mac every day. I'm not sure why you needed
an installation guide when the instructions are so darned simple:

1. Download tarball
2. Un-tar tarball

Done.

Oh, you want to actually /run/ it? That's easy:

$ bin/startup.sh

You don't need any sudo access or anything like that.

 and here:
 
 http://www.janhellevik.no/blog/?p=323
 
 When attempting to start Tomcat I get the following error…. ( I've
 googled the _ _ it out of this error and can't find a fix.
 
 sudo $CATALINA_HOME/bin/catalina.sh run

You really shouldn't run Tomcat as root.

 Password: Using CATALINA_BASE:   /Library/Tomcat Using
 CATALINA_HOME:   /Library/Tomcat Using CATALINA_TMPDIR:
 /Library/Tomcat/temp Using JRE_HOME:
 /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home

 
Using CLASSPATH:
/Library/Tomcat/bin/bootstrap.jar:/Library/Tomcat/bin/tomcat-juli.jar
 Exception in thread main java.lang.NoClassDefFoundError:
 org/apache/catalina/startup/Bootstrap Caused by:
 java.lang.ClassNotFoundException:
 org.apache.catalina.startup.Bootstrap at
 java.net.URLClassLoader$1.run(URLClassLoader.java:202) at
 java.security.AccessController.doPrivileged(Native Method) at
 java.net.URLClassLoader.findClass(URLClassLoader.java:190) at
 java.lang.ClassLoader.loadClass(ClassLoader.java:306) at
 sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at
 java.lang.ClassLoader.loadClass(ClassLoader.java:247)
 
 When I attempt start this way:
 
 sudo /Library/Tomcat/bin/startup.sh Password: Using CATALINA_BASE:
 /Library/Tomcat Using CATALINA_HOME:   /Library/Tomcat Using
 CATALINA_TMPDIR: /Library/Tomcat/temp Using JRE_HOME:
 /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home

 
Using CLASSPATH:
/Library/Tomcat/bin/bootstrap.jar:/Library/Tomcat/bin/tomcat-juli.jar
 
 I get no errors, but http://localhost:8080 does not connect.

That's odd that explicitly-specifying the path to Tomcat instead of
using the CATALINA_HOME environment variable changes anything.

Do this:

1. Stop Tomcat (use 'ps' or 'Activity Monitor' to make sure it's dead)
2. Remove all log files from $CATALINA_HOME/logs/*
3. Start Tomcat using startup.sh
4. Post-back the entire contents of $CATALINA_HOME/logs/catalina.out
5. Also post the non-comment portions of your conf/server.xml file

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk/gnYQACgkQ9CaO5/Lv0PC6IwCgmAkO/IZaejjEx8Rg4CdG8557
zt8AoITGZrnbIp/+KMMOyKnR2dosiS+C
=m/X+
-END PGP SIGNATURE-

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



Re: Modify HTTP status returned by stopped context

2012-06-19 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Kyle,

On 6/19/12 9:26 AM, kharp...@oreillyauto.com wrote:
 Where did you configure this? Which webapp's web.xml? In the ROOT
 context (/).  I'm on Ubuntu 10.04 with defaults, so
 /var/lib/tomcat6/webapps/ROOT/WEB-INF/web.xml

Ok.

 Yes, the longest match should win. We keep saying the longest
 match should win, but looking at the configuration it seems
 illogical.  If I configure the following: ROOT context:  /foo/*
 (My special servlet) foo context:  /  (DefaultServlet)

Sorry, longest match wins for URI matching once the webapp has been
selected. The webapp is selected using the left-most part of the path,
with ROOT being the fall-through case: if you have /foo deployed and
/foo in ROOT, I would expect your /foo webapp to receive the request.
It's clear that's happening even from your failure cases.

 Based on my testing this isn't the case.  So is it accurate to say
 tomcat's logic is (or we expect it to be): 1.  Look for a context
 that matches the URL base pattern. 2.  If not found, search all
 contexts for servlets with URL patterns that can service the
 request and select the one with the longest match.

No, the webapp is selected first, then the path is trimmed (if
necessary) and then the longest-match wins when matching against
url-patterns configured in that webapp's web.xml.

 As for testing on 6.0.35 and 7.0.28, yea I can do that.  I'll set
 all that up and submit a bug report if I can't get the intended
 behavior to work. But this bring up another point:  wouldn't it be
 more accurate for tomcat return HTTP Status Code 503 for a context
 that has been deployed but is in the stopped/errored state?
 Strictly speaking, it isn't not found but rather unavailable.

It's not really clear to me from the spec what to do about a stopped
webapp that is still technically deployed. I'm not sure if Tomcat
differentiates between a stopped webapp deployed to /foo and no webapp
at all for /foo. There was a recent bugfix to TC 7[1] to fix something
related, but that was during redeployment and I suspect that if the
webapp is stopped you'd get some other behavior. I tend not to stop
webapps so I've never bothered to play around with it.

 If there is a better forum/group to have this discussion with let
 me know.

No, this is definitely the place to have this discussion.

Thanks,
- -chris

[1] http://issues.apache.org/bugzilla/show_bug.cgi?id=53024
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk/gnvgACgkQ9CaO5/Lv0PBVDACgmH/cm8k2zOagH7Qprh7Mxd0Q
LNIAoKTiBBFQDrpktd0THnwNo3t6t+Bk
=QpwI
-END PGP SIGNATURE-

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



Re: Javamail exception in tomcat 7.0.11

2012-06-19 Thread Pid *
On 19 Jun 2012, at 06:24, Kiran Badi ki...@poonam.org wrote:

 Hi All,

 I have send mail servlet, which looks something like below,

 protected void doPost(HttpServletRequest request, HttpServletResponse 
 response) throws ServletException, IOException {
   String emailRecipient = request.getParameter(name);
//   String emailRecipient = xxx;
try {
Message msg = new MimeMessage(this.session);

Unfortunately you've completely omitted the code for setting the
session object, so we can only guess why it's not working.


p


msg.setFrom(new InternetAddress(xxx));
System.out.println( remoteAddr is  + emailRecipient + ');
for (int i = 0; i  10; i++) {
msg.setRecipients(Message.RecipientType.TO, 
 InternetAddress.parse(emailRecipient, false));
}

msg.setSubject(Test email);
msg.setText(Hello This is test mail);
msg.setSentDate(new Date());
Transport.send(msg); *(This is line number 60)*
System.out.println(Message sent OK.);
} catch (Exception ex) {
 
 Logger.getLogger(MailSendingServlet.class.getName()).log(Level.SEVERE, null, 
 ex);
}
}
 }

 and I have javamail reference declared in context.xml something like this one,

 Resource name=mail/ourstorymailsession
auth=Container
type=javax.mail.Session
mail.smtp.host=smtp.gmail.com
mail.smtp.port=465
mail.smtp.auth=true
mail.smtp.user=sender userid
password=
mail.smtp.starttls.enable=true

 mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory
mail.debug=true /

 and web.xml something like
 resource-ref
 description
   My site mail server
 /description
 res-ref-namemail/mysitemailsession/res-ref-name
 res-typejavax.mail.Session/res-type
 res-authContainer/res-auth
 res-sharing-scopeShareable/res-sharing-scope
 /resource-ref

 With this setting now I am getting below exception,

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

Re: heap memory issues

2012-06-19 Thread Miguel González Castaños

On 19/06/2012 06:04, Terence M. Bandoian wrote:

 On 1:59 PM, Miguel González Castaños wrote:
I know, but how do I know how much ram to assign in a 64 bits jdk? We 
are planning to move to a bigger server (hopefully 16 or 32 gb).


Miguel


16 or 32 GB?  Is this a medical image processing system?  A control 
system for a space flight?  Sorry for the sarcasm but that just seems 
like an enormous amount of memory.
It depends on how many concurrent users you have. If you have plans of 
having more than 1000 people accessing at the same time your server you 
have to be ready and I'm not talking about short sessions, but long 
sessions and intense database access.


Anyway, before we move to a bigger server, we need to get a stable 
webapp and check which load can handle the current server.


Miguel


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



Re: tomcat maven plugin deploy to multiple tomcat instances...

2012-06-19 Thread Jeff
Finally  getting back to this.

This does not work.  If I include the executions section, then the url
reverts back to the default http://localhost:8080 suggesting that it is not
even using the configurations embedded in the executions section.

It only seems to work if I create separate profiles and run them one at a
time.

Any other thoughts?  What are others doing to deploy to multiple servers?
On Thu, Apr 19, 2012 at 4:38 PM, Olivier Lamy ol...@apache.org wrote:

 Do that work adding in the execution section:

 goals
  goaldeploy/goal
 /goals

 ?

 2012/4/19 Jeff predato...@gmail.com:
  (Didn't see a specific mailing list for the tomcat-maven-plugin...)
 
  I finally got the 2.0-SNAPSHOT version of the tomcat6-maven-plugin
 working
  against a single server, but wondered how I could configure it to push to
  multiple tomcat instances based on the environment.  For example, our
  staging environment for this application has 2 load balance servers.
 
  I tried using the executions/ structure like I do when running
 ws-import
  but it doesn't seem to support that.
 
  Is there another way to easily handle deployments to multiple servers
 with
  this plugin?  If not, what would it take to support executions?  Here is
  what I tried.
 
 
   profile
   iddeploy-stage/id
   activation
 activeByDefaultfalse/activeByDefault
   /activation
   build
 plugins
   plugin
 groupIdorg.apache.tomcat.maven/groupId
 artifactIdtomcat6-maven-plugin/artifactId
 version2.0-SNAPSHOT/version
 executions
   execution
 idstage01/id
 configuration
   modewar/mode
   urlhttp://10.12.4.1/manager/url
   failOnErrortrue/failOnError
   charsetUTF-8/charset
   uriEncodingUTF-8/uriEncoding
   protocolHTTP/1.1/protocol
   updatetrue/update
   serverstage01/server
 /configuration
   /execution
   execution
 idstage06/id
 configuration
   modewar/mode
   urlhttp://10.12.4.6/manager/url
   failOnErrortrue/failOnError
   charsetUTF-8/charset
   uriEncodingUTF-8/uriEncoding
   protocolHTTP/1.1/protocol
   updatetrue/update
   serverstage06/server
 /configuration
   /execution
 /executions
   /plugin
  --
  Jeff Vincent
  predato...@gmail.com
  See my LinkedIn profile at:
  http://www.linkedin.com/in/rjeffreyvincent
  I ♥ DropBox http://db.tt/9O6LfBX !!



 --
 Olivier Lamy
 Talend: http://coders.talend.com
 http://twitter.com/olamy | http://linkedin.com/in/olamy




-- 
Jeff Vincent
predato...@gmail.com
See my LinkedIn profile at:
http://www.linkedin.com/in/rjeffreyvincent
I ♥ DropBox http://db.tt/9O6LfBX !!


Re: heap memory issues

2012-06-19 Thread Miguel González Castaños

On 19/06/2012 02:47, Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Miguel,

On 6/18/12 6:34 PM, Miguel González Castaños wrote:

[H]ow do I know how much ram to assign in a 64 bits jdk? We are
planning to move to a bigger server (hopefully 16 or 32 gb).

Nobody can tell you how big your heap needs to be: it all depends upon
the needs of your app and its users. We ran for 5 years with a 64 MiB
heap and never had any problems. We started getting OOMEs because we
started supporting more users and their (small) sessions were piling
up and busting our heap, so we had to increase the heap size.

Now that you have your email issue handled, you might even decide that
bigger hardware isn't necessary.
You are completely right. I won't move to a bigger server until I make 
sure the webapp is stable and we can measure the load it can handle.


I just wanted to know how I could measure how much heap size I need. 
Your approach seems reasonable to me


Miguel

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



Re: Modify HTTP status returned by stopped context

2012-06-19 Thread kharper2
Hello Chris,

 No, the webapp is selected first, then the path is trimmed (if
 necessary) and then the longest-match wins when matching against
 url-patterns configured in that webapp's web.xml.
...
 Sorry, longest match wins for URI matching once the webapp has been
selected.

Makes sense.  I wanted to make sure I was following the logic correctly.


 There was a recent bugfix to TC 7[1] to fix something
 related, but that was during redeployment and I suspect that if the
 webapp is stopped you'd get some other behavior.

I think I read about that bug fix in TC7.  I believe it changed threads to
paused when a context was reload/restarting or something like that;
instead of sending a 404 immediately, if I recall correctly.

 I tend not to stop
 webapps so I've never bothered to play around with it.

The two scenarios that lead me to all of this in the first place were dead
applications (crashed web apps) and situations where a WAR is experiencing
problems and must be stopped for some period of time (possibly because
back-end resources are unavailable or whatever).  The former is, sadly,
more frequent than the latter.


 No, this is definitely the place to have this discussion.

Here's a little back-story to help understand my approach:
I have a few web servers (apache httpd) sitting in front of a handful of
application servers.  The web servers are currently configured to use a
single Proxy Balancer with a few Balancer Members for each cluster of
tomcat servers.  Tomcat has, of course, been configured to replicate all
sessions in each cluster.  I can drop app nodes left and right and as long
as 1 is still up, requests still get serviced.  The problem here, is that
if a single server has an application crash Apache will continue to send
requests through that Balancer Member resulting in intermittent 404s for
people.

Here's where the magic I am attempting to setup comes in...  Assuming
Tomcat will return HTTP 503 for a crashed/stopped application, I can tell
Apache to failonstatus 503, which will put the worker thread for the
Balancer Member into the error state for a while, thereby preventing that
server from being used.  The problem this causes is, if even 1 application
crashes or needs to be stopped on all servers, then all servers in the
cluster will be marked unavailable by the BalancerMember thread and no
other apps in the cluster will serve requests.  To fix this, I take it one
step further, by creating an entire Proxy Balancer for *each* web
application and the Balancer Members are now on a per-context basis, so to
speak.  So when /foo crashes on tomcat1 the BalancerMember entering the
error state only affects requests to the foo context on the tomcat1
server.

I haven't seen anyone set it up like this exactly, but it sure seems like a
really, really good way to achieve High Availability on a granular level.
And as I read through the apache httpd docs and learned about Tomcat's
clustering, I figured this was all an intentional design philosophy for
others to follow.  So I was certainly confused when I saw Tomcat returning
404 for things it could find, but were unavailable.  I had one person
report that WebSphere returns 503 for applications turned off, and I read
an old article that JBoss does the same; I have no direct proof of either.
So I'm wondering if they've tried to do with their packages what I'm trying
to accomplish with Apache httpd and tomcat.

Thoughts?

Kyle Harper

This communication and any attachments are confidential, protected by 
Communications Privacy Act 18 USCS § 2510, solely for the use of the intended 
recipient, and may contain legally privileged material. If you are not the 
intended recipient, please return or destroy it immediately. Thank you.

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



Re: Javamail exception in tomcat 7.0.11

2012-06-19 Thread Kiran Badi

On 6/19/2012 9:55 PM, Pid * wrote:

Unfortunately you've completely omitted the code for setting the
session object, so we can only guess why it's not working.
Yup Pid, I realized it later on when Tim highlighted it.Its fixed 
now.Thanks I am able to send mail comfortably.


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



RE: Need assistance for 2048 Extended EV SSL certificate installation

2012-06-19 Thread Martin Gainty

if you followed the instructions provided by your CA who would've provided a 
package containing all necessary components
what are the components available in the CA provided package?

did you install *each* component as suggested by CA?

did you verify the ldap credentials have not changed after the change?

which provider are you implementing?

which algorithm are you implementing?

why are you not using command line URL tool such as CURL to test each SSL 
component BEFORE attempting a live deploy with TC?

Nota Bene: do NOT use BT as your CA..Browsers especially IE are finicky and 
will NOT accept arbitrary CA except for 'known trusted root authority'
Martin Gainty 
__ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.


From: sudhakarrao.satul...@bt.com
To: users@tomcat.apache.org
Date: Tue, 19 Jun 2012 17:26:04 +0100
Subject: Need assistance for 2048 Extended EV SSL certificate installation

Hi All, I am using following tomcat version  root@REFERRAL-SERVER1# 
./version.shUsing CATALINA_BASE:   /usr/local/apache-tomcat-6.0.24/Using 
CATALINA_HOME:   /usr/local/apache-tomcat-6.0.24/Using CATALINA_TMPDIR: 
/usr/local/apache-tomcat-6.0.24//tempUsing JRE_HOME:
/usr/local/jdk/jdk1.6.0_17/Using CLASSPATH:   
/usr/local/apache-tomcat-6.0.24//bin/bootstrap.jarServer version: Apache 
Tomcat/6.0.24Server built:   January 19 2010 1439Server number:  6.0.0.0OS 
Name:SunOSOS Version: 5.8Architecture:   sparcJVM Version:
1.6.0_17-b04JVM Vendor: Sun Microsystems Inc.  After instllating the new 
2048 Bit Extanded EV SSL .  I am not able to open webpage. And I am attaching 
the sample wireshark out put before installing new one and after installing new 
one. Need  help……….. Many Thanks,Sudhakara Rao Satuluri | ASG | BT Openzone 
Platform | BT Wi-Fi | Service Infrastructure | BT Operate | )07405303455 |1 
sudhakarrao.satul...@bt.com | Red Phone team ) : +44 (0) 117 304 5148, +44 (0) 
117 304 5149 |http://operate.intra.bt.com/operate This email contains BT 
information, which may be privileged or confidential. It's meant only for the 
individual(s) or entity named above. If you're not the intended recipient, note 
that disclosing, copying, distributing or using this information is prohibited. 
If you've received this mail in error, please let me know immediately on the 
email address above. Thank you. We monitor our email system, and may record 
your emails.British Telecommunications plc. Registered office: 81 Newgate 
Street London EC1A 7AJ Registered in England no: 180 
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org   
  

Re: Modify HTTP status returned by stopped context

2012-06-19 Thread kharper2

*resending this to group, as it has been about 3 hours and isn't showing up
yet on list*


Hello Chris,

 No, the webapp is selected first, then the path is trimmed (if
 necessary) and then the longest-match wins when matching against
 url-patterns configured in that webapp's web.xml.
...
 Sorry, longest match wins for URI matching once the webapp has been
selected.

Makes sense.  I wanted to make sure I was following the logic correctly.


 There was a recent bugfix to TC 7[1] to fix something
 related, but that was during redeployment and I suspect that if the
 webapp is stopped you'd get some other behavior.

I think I read about that bug fix in TC7.  I believe it changed threads to
paused when a context was reload/restarting or something like that;
instead of sending a 404 immediately, if I recall correctly.

 I tend not to stop
 webapps so I've never bothered to play around with it.

The two scenarios that lead me to all of this in the first place were dead
applications (crashed web apps) and situations where a WAR is experiencing
problems and must be stopped for some period of time (possibly because
back-end resources are unavailable or whatever).  The former is, sadly,
more frequent than the latter.


 No, this is definitely the place to have this discussion.

Here's a little back-story to help understand my approach:
I have a few web servers (apache httpd) sitting in front of a handful of
application servers.  The web servers are currently configured to use a
single Proxy Balancer with a few Balancer Members for each cluster of
tomcat servers.  Tomcat has, of course, been configured to replicate all
sessions in each cluster.  I can drop app nodes left and right and as long
as 1 is still up, requests still get serviced.  The problem here, is that
if a single server has an application crash Apache will continue to send
requests through that Balancer Member resulting in intermittent 404s for
people.

Here's where the magic I am attempting to setup comes in...  Assuming
Tomcat will return HTTP 503 for a crashed/stopped application, I can tell
Apache to failonstatus 503, which will put the worker thread for the
Balancer Member into the error state for a while, thereby preventing that
server from being used.  The problem this causes is, if even 1 application
crashes or needs to be stopped on all servers, then all servers in the
cluster will be marked unavailable by the BalancerMember thread and no
other apps in the cluster will serve requests.  To fix this, I take it one
step further, by creating an entire Proxy Balancer for *each* web
application and the Balancer Members are now on a per-context basis, so to
speak.  So when /foo crashes on tomcat1 the BalancerMember entering the
error state only affects requests to the foo context on the tomcat1
server.

I haven't seen anyone set it up like this exactly, but it sure seems like a
really, really good way to achieve High Availability on a granular level.
And as I read through the apache httpd docs and learned about Tomcat's
clustering, I figured this was all an intentional design philosophy for
others to follow.  So I was certainly confused when I saw Tomcat returning
404 for things it could find, but were unavailable.  I had one person
report that WebSphere returns 503 for applications turned off, and I read
an old article that JBoss does the same; I have no direct proof of either.
So I'm wondering if they've tried to do with their packages what I'm trying
to accomplish with Apache httpd and tomcat.

Thoughts?

Kyle Harper



-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Kyle,

On 6/19/12 9:26 AM, kharp...@oreillyauto.com wrote:
 Where did you configure this? Which webapp's web.xml? In the ROOT
 context (/).  I'm on Ubuntu 10.04 with defaults, so
 /var/lib/tomcat6/webapps/ROOT/WEB-INF/web.xml

Ok.

 Yes, the longest match should win. We keep saying the longest
 match should win, but looking at the configuration it seems
 illogical.  If I configure the following: ROOT context:  /foo/*
 (My special servlet) foo context:  /  (DefaultServlet)

Sorry, longest match wins for URI matching once the webapp has been
selected. The webapp is selected using the left-most part of the path,
with ROOT being the fall-through case: if you have /foo deployed and
/foo in ROOT, I would expect your /foo webapp to receive the request.
It's clear that's happening even from your failure cases.

 Based on my testing this isn't the case.  So is it accurate to say
 tomcat's logic is (or we expect it to be): 1.  Look for a context
 that matches the URL base pattern. 2.  If not found, search all
 contexts for servlets with URL patterns that can service the
 request and select the one with the longest match.

No, the webapp is selected first, then the path is trimmed (if
necessary) and then the longest-match wins when matching against
url-patterns configured in that webapp's web.xml.

 As for testing on 6.0.35 and 7.0.28, yea I can do that.  I'll set
 all that up and submit a bug 

Re: Javamail exception in tomcat 7.0.11

2012-06-19 Thread Mark Eggers
- Original Message -

 From: Kiran Badi ki...@poonam.org
 To: users@tomcat.apache.org
 Cc: 
 Sent: Tuesday, June 19, 2012 7:40 AM
 Subject: Re: Javamail exception in tomcat 7.0.11
 
 On 6/19/2012 11:23 AM, Tim Watts wrote:
  I have send mail servlet, which looks something like below,
      protected void doPost(HttpServletRequest request, 
 HttpServletResponse
    response) throws ServletException, IOException {
             String emailRecipient = 
 request.getParameter(name);
          //   String emailRecipient = xxx;
              try {
                  Message msg = new MimeMessage(this.session);
  Looks like your mail session isn't getting initialized properly and you
  left out that piece of the puzzle.  How  where does 
 'this.session' get
  set?
 
 
 This was the real issue.Caught the exception now and could see the root cause 
 now and fixed it.Eureka you guys are genius and eye  for detail.
 
 One more suggestion I need, I had mail.jar/mailapi.jar/pop3.jar/smtp.jar all 
 over, they were in project library, tomcat lib and I remove all those 
 reference 
 and had just mail.jar in tomcat lib,bounced the server many times and only 
 after 
 that I managed to make this work.
 
 How do you remove safely all reference without impacting the server or your 
 build script ? Do you just comment out the reference of jars or your 
 physically 
 remove them from the folder ?
 Now a days quite often my build fails if I remove or other jars,so want to 
 learn 
 this trick as well.


If I remember correctly, you're using NetBeans. There are at least two ways of 
removing the JAR from the packaging without impacting your project.

If you're using the NetBeans standard build mechanism:

1. Go to Project-Properties-Libraries
2. Uncheck the 'Package' checkbox next to the JAR that should not be included

If you're using Maven with NetBeans:

1. Go into pom.xml
2. Add a scopeprovided/scope to each dependency that is provided

Note that if you associate a Tomcat server with your project on your 
development system and that Tomcat server has the JAR files, they should 
already show up in your build path. I've not extensively tested this, but just 
looking at a project they seem to be there (for me, some JDBC drivers).

. . . . just my two cents.
/mde/

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



Re: source for jdbc pool?

2012-06-19 Thread Mark Thomas
On 19/06/2012 18:55, S Ahmed wrote:
 Where is the source for the jdbc pool? Can't seem to find it here:
 https://github.com/apache/tomcat70

http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/

The canonical version of the source code for an ASF project will always
be on ASF hardware. i.e. it will be on a server with an apache.org address.

github does host some read-only mirrors for some ASF projects

Mark



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



shutdown.sh troubleshooting on AS/400

2012-06-19 Thread James Lampert
In my experience, shutdown.sh has never worked reliably on AS/400, and 
I don't know why, or even understand enough about how it works (or 
enough about shell scripts) to troubleshoot it.


Can somebody shed some light on it?

--
JHHL

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



Tomcat shutdown.sh troubleshooting on AS/400

2012-06-19 Thread James Lampert
In my experience, Tomcat's shutdown.sh has never worked reliably on 
AS/400, and I don't know why, or even understand enough about how it 
works (or enough about shell scripts) to troubleshoot it.


Here's the script. I can tell that it eventually transfers control to 
catalina.sh (which is also what launches Tomcat), but that's about all I 
can make out without help.


#!/bin/sh  
   
# Licensed to the Apache Software Foundation (ASF) under one or more   
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.  
# The ASF licenses this file to You under the Apache License, Version 2.0  
# (the License); you may not use this file except in compliance with 
# the License.  You may obtain a copy of the License at
#  
# http://www.apache.org/licenses/LICENSE-2.0   
#  
# Unless required by applicable law or agreed to in writing, software  
# distributed under the License is distributed on an AS IS BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
# See the License for the specific language governing permissions and  
# limitations under the License.   
   
# -
# Stop script for the CATALINA Server  
#  
# $Id: shutdown.sh 1202062 2011-11-15 06:50:02Z mturk $
# -

# Better OS/400 detection: see Bugzilla 31132
os400=false  
case `uname` in
OS400*) os400=true;; 
esac 
 
# resolve links - $0 may be a softlink   
PRG=$0 
 
while [ -h $PRG ] ; do 
  ls=`ls -ld $PRG` 
  link=`expr $ls : '.*- \(.*\)$'` 
  if expr $link : '/.*'  /dev/null; then  
PRG=$link   
  else
PRG=`dirname $PRG`/$link  
  fi  
done  
  
PRGDIR=`dirname $PRG`   
EXECUTABLE=catalina.sh
  
# Check that target executable exists 
if $os400; then   
  # -x will Only work on the os400 if the files are:  
  # 1. owned by the user  
  # 2. owned by the PRIMARY group of the user 
  # this will not work if the user belongs in secondary groups
  eval
else  
  if [ ! -x $PRGDIR/$EXECUTABLE ]; then   
echo Cannot find $PRGDIR/$EXECUTABLE   
echo The file is absent or does not have execute permission
echo This file is needed to run this program   
exit 1   
  fi 
fi   
 
exec $PRGDIR/$EXECUTABLE stop $@   



Can somebody shed some light on it?

--
JHHL


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



Re: Tomcat shutdown.sh troubleshooting on AS/400

2012-06-19 Thread André Warnier

James Lampert wrote:
In my experience, Tomcat's shutdown.sh has never worked reliably on 
AS/400, and I don't know why, or even understand enough about how it 
works (or enough about shell scripts) to troubleshoot it.


Here's the script. I can tell that it eventually transfers control to 
catalina.sh (which is also what launches Tomcat), but that's about all I 
can make out without help.




Without looking at the Tomcat Java code itself, this is my take on it :

- shutdown.sh's main purpose is to locate and execute catalina.sh with the single argument 
stop.


- catalina.sh, when called with a stop argument (and without the -force 
option) :
  - starts another instance of the JVM, to run another instance of Tomcat, with the 
argument stop. Let'scall this the shutdowner Tomcat.


- this other shutdowner instance of Tomcat parses the same conf/server.xml as the main 
tomcat instance, and in particular the tag :

Server port=8005 shutdown=SHUTDOWN (default values shown)
From there, it picks up the shutdown port which the main Tomcat should have opened in 
LISTEN mode (iow a listening, server socket), and the string in the shutdown attribute.
Then this shutdowner Tomcat instance attempts to open a client connection to this port 
on localhost, and if succesful sends the picked-up shutdown string over that connection.


Back to the running Tomcat, which is listening on that server port.
It receives the connection request from the shutdowner Tomcat. If the connection is made 
from the same host (localhost, 127.0.0.1), it accepts it.
If so, it next receives over that connection, the string sent by the shutdowner Tomcat, 
compares that with the string in its own Server tag, and if they match, it starts 
shutting itself down.


Back to the shutdowner Tomcat : when it has been succesful opening the connection to 
localhost:shutdown-port and sending the shutdown string over it, it closes the connection 
and terminates. This also causes its own catalina.sh stop script to terminate.


And everyone is happy.
Of course, if anything in the sequence above misfires, someone will be unhappy.

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



Re: Tomcat shutdown.sh troubleshooting on AS/400

2012-06-19 Thread James Lampert
. . . and when I looked back at the box I was testing, Tomcat *had* 
finally shut down. And when I ran both the start and stop scripts this 
time, the stop script worked perfectly (and promptly).


Weird. Why would the shutdown take so long as to give the impression it 
had failed entirely, then eventually work, then later work promptly?


--
JHHL

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



RE: Apache tomcat (7.0.27) is not loading the user and role class for JAASRealm

2012-06-19 Thread Esmond Pitt
Javed

I don't know why you are invalidating the session when you log *in.* I said
to invalidate it to log *out*.

EJP


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



Re: Tomcat shutdown.sh troubleshooting on AS/400

2012-06-19 Thread André Warnier

James Lampert wrote:
. . . and when I looked back at the box I was testing, Tomcat *had* 
finally shut down. And when I ran both the start and stop scripts this 
time, the stop script worked perfectly (and promptly).


Weird. Why would the shutdown take so long as to give the impression it 
had failed entirely, then eventually work, then later work promptly?




1) Gremlins. You need to exorcise your datacenter.
or
2) because the first time, Tomcat had been running for a while, so it had a lot of things 
to shut down nicely and cleanup; while the second time, it had only be running for a much 
shorter time, and had less to clean up ?


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



Re: apache-tomcat-7.0.27 start up errors on Mac OX Lion

2012-06-19 Thread Samuel V Green III
I backup and installed the 7.0.28 of Tomcat.
I used the setup as follows:

sudo ln -s /usr/local/apache-tomcat-7.0.28/ /Library/Tomcat
sudo chown -R myusername /Library/Tomcat
issued command export Catalina_HOME=/Library/Tomcat

upon issue of : /Library/Tomcat/bin/startup.sh
get the following output:

Using CATALINA_BASE:   /Library/Tomcat
Using CATALINA_HOME:   /Library/Tomcat
Using CATALINA_TMPDIR: /Library/Tomcat/temp
Using JRE_HOME:
/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home
Using CLASSPATH:   
/Library/Tomcat/bin/bootstrap.jar:/Library/Tomcat/bin/tomcat-juli.jar

OutPut of Catalina.out:

Exception in thread main java.lang.NoClassDefFoundError: 
org/apache/catalina/startup/Bootstrap
Caused by: java.lang.ClassNotFoundException: 
org.apache.catalina.startup.Bootstrap
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

Non comment server.xml :

server.xml :

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

Server port=8005 shutdown=SHUTDOWN
  
  Listener className=org.apache.catalina.core.AprLifecycleListener 
SSLEngine=on /
  Listener className=org.apache.catalina.core.JasperListener /
  Listener 
className=org.apache.catalina.core.JreMemoryLeakPreventionListener /
  Listener 
className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener /
  Listener 
className=org.apache.catalina.core.ThreadLocalLeakPreventionListener /

  GlobalNamingResources

Resource name=UserDatabase auth=Container
  type=org.apache.catalina.UserDatabase
  description=User database that can be updated and saved
  factory=org.apache.catalina.users.MemoryUserDatabaseFactory
  pathname=conf/tomcat-users.xml /
  /GlobalNamingResources

  
  Service name=Catalina


Connector port=8080 protocol=HTTP/1.1
   connectionTimeout=2
   redirectPort=8443 /

Connector port=8009 protocol=AJP/1.3 redirectPort=8443 /

Engine name=Catalina defaultHost=localhost

  Realm className=org.apache.catalina.realm.LockOutRealm

Realm className=org.apache.catalina.realm.UserDatabaseRealm
   resourceName=UserDatabase/
  /Realm

  Host name=localhost  appBase=webapps
unpackWARs=true autoDeploy=true

   
Valve className=org.apache.catalina.valves.AccessLogValve 
directory=logs
   prefix=localhost_access_log. suffix=.txt
   pattern=%h %l %u %t quot;%rquot; %s %b /

  /Host
/Engine
  /Service
/Server

So I'm still unable to access http://localhost:8080

Question:

Are there main set environment variables that I can set within
my .bash_profile once I get Tomcat started that will fulfill environment needs 
in the future?

I've set up Tomcat years ago on older OSX versions and had no problems.
So it may be easy to you, but there is something I'm missing.

Thank you,

Samuel.


On Jun 19, 2012, at 8:40 AM, Christopher Schultz wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Samuel,
 
 On 6/18/12 11:34 PM, Samuel V Green III wrote:
 I followed directions for install and config here: 
 http://wolfpaulus.com/journal/mac/tomcat7
 
 I use Tomcat 7.0.27 on my Mac every day. I'm not sure why you needed
 an installation guide when the instructions are so darned simple:
 
 1. Download tarball
 2. Un-tar tarball
 
 Done.
 
 Oh, you want to actually /run/ it? That's easy:
 
 $ bin/startup.sh
 
 You don't need any sudo access or anything like that.
 
 and here:
 
 http://www.janhellevik.no/blog/?p=323
 
 When attempting to start Tomcat I get the following error…. ( I've
 googled the _ _ it out of this error and can't find a fix.
 
 sudo $CATALINA_HOME/bin/catalina.sh run
 
 You really shouldn't run Tomcat as root.
 
 Password: Using CATALINA_BASE:   /Library/Tomcat Using
 CATALINA_HOME:   /Library/Tomcat Using CATALINA_TMPDIR:
 /Library/Tomcat/temp Using JRE_HOME:
 /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home
 
 
 Using CLASSPATH:
 /Library/Tomcat/bin/bootstrap.jar:/Library/Tomcat/bin/tomcat-juli.jar
 Exception in thread main java.lang.NoClassDefFoundError:
 org/apache/catalina/startup/Bootstrap Caused by:
 java.lang.ClassNotFoundException:
 org.apache.catalina.startup.Bootstrap at
 java.net.URLClassLoader$1.run(URLClassLoader.java:202) at
 java.security.AccessController.doPrivileged(Native Method) at
 java.net.URLClassLoader.findClass(URLClassLoader.java:190) at
 java.lang.ClassLoader.loadClass(ClassLoader.java:306) at
 sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at
 java.lang.ClassLoader.loadClass(ClassLoader.java:247)
 
 When I attempt start 

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

2012-06-19 Thread Kiran Badi

Yup done this Sharon.Thanks
On 6/19/2012 2:03 PM, Sharon Prober (sprober) wrote:

You could always position your jsp's inside the WEB-INF dir
This will enable you to access them only through server redirects rather
than absolute url's

Sharon

-Original Message-
From: Kiran Badi [mailto:ki...@poonam.org]
Sent: Tuesday, June 19, 2012 3:10 AM
To: Tomcat Users List
Subject: Protect JSP from Direct Access in Tomcat 7.0.xx

Hi All,

I need your guidance again.I have bunch of JSP's close to 100+ which I
need to protect it from direct access.

I have this mapping in web xml and this is not working,It seems that
probably i need to define a role first and then use below settings.But
unfortunately my app is open internet application which does not use
realm at all.

security-constraint
display-nameDenyAccesstoDirectJSP/display-name
web-resource-collection
web-resource-namesample.jsp/web-resource-name
descriptionSample confirmation JSP/description
url-pattern*.jsp/url-pattern  http-methodGET/http-method
http-methodPOST/http-method  /web-resource-collection
/security-constraint

All my jsp's are residing in the webpages folder of project directory.I
know this is incorrect and probably gives direct access to jsp's.

So I have some clarification to ask,

1. is their a way to tell tomcat to not to serve direct jsp's probably
via web xml

2. Is their any extra setting that is required if I move my JSP's inside
web-inf.I created a folder under web-inf and create sample hello
world.jsp and then tried to invoke that jsp but got 404 message.

- Kiran

-
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: Javamail exception in tomcat 7.0.11

2012-06-19 Thread Kiran Badi

On 6/19/2012 11:09 PM, Mark Eggers wrote:

If I remember correctly, you're using NetBeans. There are at least two ways of 
removing the JAR from the packaging without impacting your project.

If you're using the NetBeans standard build mechanism:

1. Go to Project-Properties-Libraries
2. Uncheck the 'Package' checkbox next to the JAR that should not be included
Yes Mark, done this as well,but still get reference error for those 
jars.There is no checkbox, you just add it and then remove it thats only 
2 options I see.


I will fix this sometime later as now I am ignoring those errors as I no 
longer need those jars.


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



RE: apache-tomcat-7.0.27 start up errors on Mac OX Lion

2012-06-19 Thread Caldarale, Charles R
 From: Samuel V Green III [mailto:macun...@gmail.com] 
 Subject: Re: apache-tomcat-7.0.27 start up errors on Mac OX Lion

 issued command export Catalina_HOME=/Library/Tomcat

That's not useful (or necessary).  The variable name is CATALINA_HOME, not 
Catalina_HOME (case matters).

 Using JRE_HOME:
 /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home

That looks suspicious, but I don't have a Mac at hand to compare with.  Exactly 
what JVM version do you have installed?  Can it run other Java programs?

 Exception in thread main java.lang.NoClassDefFoundError: 
 org/apache/catalina/startup/Bootstrap

It's looking like your JVM installation might not be quite right...

 - Chuck


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


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



Re: apache-tomcat-7.0.27 start up errors on Mac OX Lion

2012-06-19 Thread Samuel V Green III
java -version
java version 1.6.0_33
Java(TM) SE Runtime Environment (build 1.6.0_33-b03-424-11M3720)
Java HotSpot(TM) 64-Bit Server VM (build 20.8-b03-424, mixed mode)

Thanks Charles !

Samuel.
On Jun 19, 2012, at 6:09 PM, Caldarale, Charles R wrote:

 From: Samuel V Green III [mailto:macun...@gmail.com] 
 Subject: Re: apache-tomcat-7.0.27 start up errors on Mac OX Lion
 
 issued command export Catalina_HOME=/Library/Tomcat
 
 That's not useful (or necessary).  The variable name is CATALINA_HOME, not 
 Catalina_HOME (case matters).
 
 Using JRE_HOME:
 /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home
 
 That looks suspicious, but I don't have a Mac at hand to compare with.  
 Exactly what JVM version do you have installed?  Can it run other Java 
 programs?
 
 Exception in thread main java.lang.NoClassDefFoundError: 
 org/apache/catalina/startup/Bootstrap
 
 It's looking like your JVM installation might not be quite right...
 
 - Chuck
 
 
 THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
 MATERIAL and is thus for use only by the intended recipient. If you received 
 this in error, please contact the sender and delete the e-mail and its 
 attachments from all computers.
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 


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



RE: apache-tomcat-7.0.27 start up errors on Mac OX Lion

2012-06-19 Thread Caldarale, Charles R
 From: Samuel V Green III [mailto:macun...@gmail.com] 
 Subject: Re: apache-tomcat-7.0.27 start up errors on Mac OX Lion

 Java(TM) SE Runtime Environment (build 1.6.0_33-b03-424-11M3720)
 Java HotSpot(TM) 64-Bit Server VM (build 20.8-b03-424, mixed mode)

That looks quite reasonable.  Can you tell if that's really what's installed at:
/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home

(Wouldn't normally happen on a Mac, but on Linux it's not uncommon to have 
several JVMs installed, and you can end up using a different one than you 
expect.)

Is there possibly a permissions problem - trying to run Tomcat under a 
different userid than what the installation was done with?

 - Chuck


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


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



Re: apache-tomcat-7.0.27 start up errors on Mac OX Lion

2012-06-19 Thread Samuel V Green III
 /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home
Not sure?
I have sub directories:

bin bundle  lib man

the install of tomcat  at /usr/local is listed user root and owner wheel

The permissions at the symbolic link of /Library/Tomcat are user myusr name 
and owner wheel.

So I have to either change permission to match at the symbolic link to the 
/usr/local install or vise versa ?

Thanks,

Samuel.



On Jun 19, 2012, at 6:57 PM, Caldarale, Charles R wrote:

 From: Samuel V Green III [mailto:macun...@gmail.com] 
 Subject: Re: apache-tomcat-7.0.27 start up errors on Mac OX Lion
 
 Java(TM) SE Runtime Environment (build 1.6.0_33-b03-424-11M3720)
 Java HotSpot(TM) 64-Bit Server VM (build 20.8-b03-424, mixed mode)
 
 That looks quite reasonable.  Can you tell if that's really what's installed 
 at:
 /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home
 
 (Wouldn't normally happen on a Mac, but on Linux it's not uncommon to have 
 several JVMs installed, and you can end up using a different one than you 
 expect.)
 
 Is there possibly a permissions problem - trying to run Tomcat under a 
 different userid than what the installation was done with?
 
 - Chuck
 
 
 THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
 MATERIAL and is thus for use only by the intended recipient. If you received 
 this in error, please contact the sender and delete the e-mail and its 
 attachments from all computers.
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 


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



Re: apache-tomcat-7.0.27 start up errors on Mac OX Lion

2012-06-19 Thread Samuel V Green III
I was trying to follow the instructions here:  
http://wolfpaulus.com/journal/mac/tomcat7
where it mentions Change ownership of the /Libaray/Tomcat folder hierarchy:

sudo chown -R your_username /Library/Tomcat

So I'm wondering if I need to change chown the /usr/local/tomcatversion 
directory to match my user id instead of root ?



On Jun 19, 2012, at 6:57 PM, Caldarale, Charles R wrote:

 From: Samuel V Green III [mailto:macun...@gmail.com] 
 Subject: Re: apache-tomcat-7.0.27 start up errors on Mac OX Lion
 
 Java(TM) SE Runtime Environment (build 1.6.0_33-b03-424-11M3720)
 Java HotSpot(TM) 64-Bit Server VM (build 20.8-b03-424, mixed mode)
 
 That looks quite reasonable.  Can you tell if that's really what's installed 
 at:
 /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home
 
 (Wouldn't normally happen on a Mac, but on Linux it's not uncommon to have 
 several JVMs installed, and you can end up using a different one than you 
 expect.)
 
 Is there possibly a permissions problem - trying to run Tomcat under a 
 different userid than what the installation was done with?
 
 - Chuck
 
 
 THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
 MATERIAL and is thus for use only by the intended recipient. If you received 
 this in error, please contact the sender and delete the e-mail and its 
 attachments from all computers.
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 


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



RE: apache-tomcat-7.0.27 start up errors on Mac OX Lion

2012-06-19 Thread Caldarale, Charles R
 From: Samuel V Green III [mailto:macun...@gmail.com] 
 Subject: Re: apache-tomcat-7.0.27 start up errors on Mac OX Lion

 I was trying to follow the instructions here:  
 http://wolfpaulus.com/journal/mac/tomcat7

I would strongly recommend (as did Chris) that you _not_ follow someone else's 
questionable installation instructions, but instead just use the ones from  the 
Tomcat website.  Don't make your life more complicated than it needs to be.

Remove whatever you've done to install Tomcat, download a fresh .tar.gz file 
(7.0.28 is now available), and just do what Chris said:

1. Download tarball
2. Un-tar tarball

$ bin/startup.sh

 - Chuck


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


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



Re: Apache tomcat (7.0.27) is not loading the user and role class for JAASRealm

2012-06-19 Thread javed Ansari
Ooops, I could not explain.  Sorry for mess...

I am invalidating in logout only **not** in login.
Once I click on logout, I invalidate. Then I redirect to login page. Then
if I try to login again the foresaid error comes (error code 408).
On Wed, Jun 20, 2012 at 5:22 AM, Esmond Pitt esmond.p...@bigpond.comwrote:

 Javed

 I don't know why you are invalidating the session when you log *in.* I said
 to invalidate it to log *out*.

 EJP




Re: Apache tomcat (7.0.27) is not loading the user and role class for JAASRealm

2012-06-19 Thread javed Ansari
Ok let me try this.  But in any case once I call invalidate the JAASRealm
should automatically call the LoginModule.logout(). But my log suggest that
this is not happening.

On Wed, Jun 20, 2012 at 10:07 AM, Esmond Pitt esmond.p...@bigpond.comwrote:

 **
 You must never redirect to the login page: see the Servlet Spec. You
 should redirect to a page that *requires* a login, i.e. a role, e.g. in my
 system it is /mypage

 EJP

  --
 *From:* javed Ansari [mailto:javid@gmail.com]
 *Sent:* Wednesday, 20 June 2012 2:30 PM
 *To:* Esmond Pitt
 *Cc:* Tomcat Users List
 *Subject:* Re: Apache tomcat (7.0.27) is not loading the user and role
 class for JAASRealm

   Ooops, I could not explain.  Sorry for mess...

 I am invalidating in logout only **not** in login.
 Once I click on logout, I invalidate. Then I redirect to login page. Then
 if I try to login again the foresaid error comes (error code 408).
 On Wed, Jun 20, 2012 at 5:22 AM, Esmond Pitt esmond.p...@bigpond.comwrote:

 Javed

 I don't know why you are invalidating the session when you log *in.* I
 said
 to invalidate it to log *out*.

 EJP





Re: heap memory issues

2012-06-19 Thread Terence M. Bandoian

 On 1:59 PM, Miguel González Castaños wrote:

On 19/06/2012 06:04, Terence M. Bandoian wrote:

 On 1:59 PM, Miguel González Castaños wrote:
I know, but how do I know how much ram to assign in a 64 bits jdk? 
We are planning to move to a bigger server (hopefully 16 or 32 gb).


Miguel


16 or 32 GB?  Is this a medical image processing system?  A control 
system for a space flight?  Sorry for the sarcasm but that just seems 
like an enormous amount of memory.
It depends on how many concurrent users you have. If you have plans of 
having more than 1000 people accessing at the same time your server 
you have to be ready and I'm not talking about short sessions, but 
long sessions and intense database access.


Anyway, before we move to a bigger server, we need to get a stable 
webapp and check which load can handle the current server.


Miguel


Hi, Miguel-

Your comment about how mail is handled made the application suspect in 
my mind.  Beyond making sure it's stable, I would check that the 
application is at least reasonably efficient.


-Terence Bandoian


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