Re: [ANN] Apache Tomcat 8.5.3 available

2016-06-29 Thread Christian

On 29.06.2016 18:34, Christian wrote:

On 29.06.2016 17:54, Mark Thomas wrote:

Those just wrap java.util.logging so follow the instructions (from
log4j2) to redirect that to log4j2.

Mark


Thank you for your quick reply.
That's what I did already[1], but it still results in an exception:
Exception in thread "main" java.lang.NoClassDefFoundError: 
org/apache/juli/logging/LogFactory


This message results from the attempt to load the logger into 
org.apache.catalina.startup.ContextConfig's static log field.


Just to prevent misunderstandings: I'm using tomcat-embed-core 8.5.3.

Regards
Christian

[1] add log4j-jul to classpath and add 
java.util.logging.manager=org.apache.logging.log4j.jul.LogManager to 
the system properties




I found my mistake: I just needed  to add org.apache.tomcat:tomcat-juli...

Regards
Christian

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



Re: [ANN] Apache Tomcat 8.5.3 available

2016-06-29 Thread Christian

On 29.06.2016 17:54, Mark Thomas wrote:

Those just wrap java.util.logging so follow the instructions (from
log4j2) to redirect that to log4j2.

Mark


Thank you for your quick reply.
That's what I did already[1], but it still results in an exception:
Exception in thread "main" java.lang.NoClassDefFoundError: 
org/apache/juli/logging/LogFactory


This message results from the attempt to load the logger into 
org.apache.catalina.startup.ContextConfig's static log field.


Just to prevent misunderstandings: I'm using tomcat-embed-core 8.5.3.

Regards
Christian

[1] add log4j-jul to classpath and add 
java.util.logging.manager=org.apache.logging.log4j.jul.LogManager to the 
system properties


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



Re: [ANN] Apache Tomcat 8.5.3 available

2016-06-29 Thread Christian

Hi all,


On 14.06.2016 14:23, Mark Thomas wrote:

On 14/06/2016 13:18, Sergio Fernández wrote:

May I ask what happened with tomcat-embed-logging-* artifacts in 8.5.3? I
still see them at 8.0.x, included the recent 8.0.36, but they disappeared
after 8.5.2:

[...]

Those modules have been removed. They are only useful with log4j 1.x
which is no longer supported by the log4j community. With log4j 2.x, you
can achieve the same result with no extra Tomcat libraries.

Mark


I might be blind, but couldn't figure out how to achieve proper logging 
with log4j 2.x.
Is there a special module implementing org.apache.juli.logging.Log and 
org.apache.juli.logging.LogFactory?


Regards
Christian

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



Re: Tomcat8 startup service exit (return value 143)

2016-01-30 Thread Christian
Hello all,

On 30.07.2015 18:59, Mark Eggers wrote:
> Here's my current working theory.
>
> As Chris has stated, lots of VM restarts mean that you're probably
> short on entropy. If you're short on entropy, you'll need to wait
> longer for Tomcat to start up.
>
> By default, systemd has a 90 second timeout for starting a unit. If a
> unit doesn't signal a start-up within that time, systemd will shut
> down that service.
>
> You can configure a per-unit start-up time. Do a man 5 systemd.service
> to see how.

I was encountering the same issue as Robert and your working theory sounds 
quite reasonable. I'm in a virtualized
environment, too. In my case it is XenServer and the problem occurs only 
directly after booting. When I manually execute
systemctl start tomcat
everything is fine. That fits to the entropy thing.

In my case it wasn't systemd killing tomcat but jsvc. By default jsvc waits 
only 10 seconds. After configuring
SERVICE_START_WAIT_TIME=90
in setenv.sh, everything is fine now.

Thanks for your heads up.

Regards
Christian

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



Re: Double call to requestInitialized when forwarding for FORM auth

2015-07-16 Thread Christian Kaltepoth
Hey all,

I'm the guy who wrote the DeltaSpike code that is causing the trouble here.
So maybe I should ask a very concrete question here:

Basically the DeltaSpike code assumed that
ServletRequestListener.requestInitialized() is called exactly once for each
physical request. But it looks like it is called more than once if the
user gets forwarded to a login page (login-config, corresponding constraints).
Maybe even if requests get forwarded? I didn't check this.

Actually I was very surprised about that behavior. The javadocs of
ServletRequestListener.requestInitialized() say that the method is invoked
when the request *is about to enter the first servlet or filter of the web
application.*

In my understanding this means that it gets invoked only once even if the
request is forwarded. I didn't find anything in the Servlet spec about that
specific topic.

Any thoughts about that?

Thanks

Christian


2015-07-16 15:28 GMT+02:00 Christopher Schultz ch...@christopherschultz.net
:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256

 Ludovic,

 On 7/16/15 2:29 AM, l.pe...@senat.fr wrote:
  On 15/07/2015 23:36, Christopher Schultz wrote:
  -BEGIN PGP SIGNED MESSAGE- Hash: SHA256
 
  Ludovic,
 
  On 7/15/15 3:29 AM, l.pe...@senat.fr wrote:
  On 13/07/2015 15:13, Christopher Schultz wrote: It looks like
  you or DeltaSpike are not cleaning-up as the request
  transitions from one state to another. Ok, thank you.
 
  What kind of notification should we process to detect this
  transition ?
  I'm not sure, since it's DeltaSpike which is objecting to the
  current state of the request.
 
  I think you'll have better luck with asking the DeltaSpike folks.
  They are welcome to come here to ask about why something may have
  changed. Was there ever a reply to your initial question?
 
  Yes, and a patch allowing this double initialization.

 Hmm. I'm surprised that it wasn't possible before then.

  But as I suspect that there is something cleaner to do, I try to
  scratch the subject.
 
  In your post to their list, you mentioned that there are
  sometimes
 
  Pretty much the same than in this case, if I sum it up.
 
  A typical example : years ago, I wrote a web filter, had to perform
  some locking in it (because of legacy libs) and was quite surprised
  to see the request going through the filter twice when serving a
  login page on FORM auth.
 
  I am no JEE Guru, so strange does not mean bad but
  surprising.

 A request can be forwarded to another resource during request
 processing. According to the servlet spec, forwarding a request should
 send it back through the Filter chain for the (new) target resource as
 long as the Filter was declared to be run for that type of dispatch.

 See section 6.2.5 of the Servlet Spec version 3.0, which explains what
 is going on.

 - -chris
 -BEGIN PGP SIGNATURE-
 Comment: GPGTools - http://gpgtools.org

 iQIcBAEBCAAGBQJVp7GVAAoJEBzwKT+lPKRYVXMP/36fuxmrIIbB4VgRWU92VyjD
 jgteXXoWHHV8WtCpVZzbhUrUKDG9XE914RK8DfyZyqR+DMQ8ucl4nkygTQP64siP
 WIylWTlsk+HCvm7u3NKzJgIH6QoyBNlaPbgVdZq+PcvqcXy2evNE1HSIuvy/n7J6
 ZDvUsKAcmjj65MC9K+fXwLHI5os3n4R5eVZr9nzG6mMZkIYLCzRGU57QtnMHgtq6
 IeaJ4uSjBe8L5E8qN3Y2wlrye0v1LKLYrQn1PTrWYY0r2LhcAJev2HVvozG1L3rw
 jfpt+5JnJDwyhP15Bo3zRDTvoUkIeHIyUVEcy3sGXtGmCMXQ4MMfu3N4mMkIJPga
 P5+fCheGoFVZwCwnrfYcjgY/T1sjFISMN90Tb8xQUlew0/iKnBLTQ6HjTUu7zswM
 rlkuMeqBTE4JZxsU8zhEhBTHhWmHvhfvZVdanxSvUmWWFuBwoHp67ur2CPpoJWh1
 FU7HE0+AYgSZPg9ZOXKPTivT6OJi70n5YcpQCYPH2/XreQViBsTNTz3g5u66rEhv
 P89ohTKOYWmGGqUaOVvXXRIBfMzkGfURZFG6Oi+hQy+LdC2XszlB0EcANSn6ThiG
 wYKfAp8m87KjDesmATlaRJm9/RzJDO/sFo8rrGyTRpFvapwkvZmgRLmlaeDuhZ2f
 6HrvOa7Vijuk93PhqnCd
 =JjcA
 -END PGP SIGNATURE-

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




-- 
Christian Kaltepoth
Blog: http://blog.kaltepoth.de/
Twitter: http://twitter.com/chkal
GitHub: https://github.com/chkal


Re: Distinct servlets for different domains in one web application

2015-07-03 Thread Christian

Chris,

thanks for your brief description of the different options.

On 30.06.2015 19:38, Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Christian,

On 6/28/15 12:01 PM, Christian wrote:

is it somehow possible to create a web application with multiple
servlets that are registered to different domains for the same url
paths using tomcat 8?

Yes, but it has nothing to do with Tomcat: you have to do the work
yourself.


I already crawled through the catalina code that is responsible
for the servlet selection and didn't find anything that would allow
this. But this doesn't mean that it isn't possible at all.

Right: this isn't something that the spec requires, and it's usually
not something that the server would get involved with. But, as I said,
you can do it yourself; you have all the tools you need.


As far as I know, java configuration for servlet registration
doesn't allow passing domain names. But maybe there is an option
within context.xml.

Nope.


I want to create a web application that has different domains for
the application itself and its management site. Both parts should
run at the context root, at different domains. The application
needs a shared (spring-)context in which the application's beans
are stored.

If you want to support more than one (DNS) domain, you'll need to make
sure that your application is deployed into a Host that is either
the default Host, or one that matches all of the domains you want to
use. Fortunately, Tomcat comes pre-configured with a single, default
Host that does just that. You have nothing to do but drop your WAR
file into webapps/ and let it auto-deploy.

That's where Tomcat pretty much stops being involved, and you get to
do the rest of the work.

You mentioned that you had two servlets, and you want one to handle
everything to one domain, and the other servlet handles the other
stuff. For the sake of argument, I'll call those domains
management.app.com and everythingelse.app.com.

Let's assume you have these two servlets defined in web.xml:

   servlet
 servlet-nameApplicationServlet/servlet-name
 servlet-classcom.app.ApplicationServlet/servlet-class
   /servlet
   servlet
 servlet-nameManagementServlet/servlet-name
 servlet-classcom.app.ManagementServlet/servlet-class
   /servlet

... and you have them mapped:

   servlet-mapping
 servlet-nameApplicationServlet/servlet-name
 url-pattern/app/url-pattern
   /servlet-mapping

   servlet-mapping
 servlet-nameManagementServlet/servlet-name
 url-pattern/manage/url-pattern
   /servlet-mapping

If you want, I suppose you could map the ApplicationServlet to /. It
doesn't really matter.

At this point, anyone visiting your application could hit either of
the two mapped URL patterns to get to either servlet.

Let's assume that all you want to do is make sure that the management
servlet is only available when you use the management.app.com domain
name. Write a Filter that detects the domain name and throws you out
if it's not management.app.com. Map this filter to /manage and you
are done.


That's something I already do (with little variation). The missing step 
is just to beautify the URLs.



Or, if you'd like for any request to any URL to go to either /app or
/manage, then you'll want to write a Filter that does something like thi
s:

   public void doFilter(...)
   {
   String domain = // ...
   if(.equals(domain))
 application.getNamedDispatcher(ManagementServlet)
.forward(request, response);
   else
 application.getNamedDispatcher(ApplicationServlet)
.forward(request, response);
   }

Map this Filter to / and let it handle everything. Make sure you
don't map it to FORWARD requests, or you'll end up with infinite
recursion.

You'll need to grab the ServletContext in the Filter's init() method
and keep it around (as application).

At this point, you can even remove the servlet-mapping elements from
your web.xml: users will have to access the application through your
Filter no matter what.


I already tried an approach with a filter using getRequestDispatcher but 
ran into issues with spring-security. One needs to hook up 
forward-requests for the security filter. My conclusion of this approach 
was, that it works, but a second roundtrip through tomcat is an 
overkill, especially with the ugly configuration issues that arise 
within spring-security.

I need to find out if it behaves the same way with getNamedDispatcher.


Hope that helps,


Yes it does - at least because you confirmed my assumption that there is 
no way to map a servlet to a domain name and tomcat doesn't provide a 
proprietary way to do so.


Thankful regards,

Christian



- -chris
-BEGIN PGP SIGNATURE-
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJVktP7AAoJEBzwKT+lPKRYEtAP/0PlUEpG+4A7d7LzDkHsFi/N
6Hsqayn8aBL6pSXMuCBhDgmzj6JnxZ2ZrzevhksYxLLtlyhJjrhTE0VdwtASz4nH
mepVKvbaRJZ3KCeupDlTLI

Re: Distinct servlets for different domains in one web application

2015-06-29 Thread Christian

André,

On 29.06.2015 12:15, André Warnier wrote:

Christian wrote:

André,

On 28.06.2015 23:11, André Warnier wrote:

Christian wrote:

Mark,

On 28.06.2015 19:58, Mark Eggers wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Christian,

On 6/28/2015 9:01 AM, Christian wrote:

Hello all,

is it somehow possible to create a web application with multiple
servlets that are registered to different domains for the same url
paths using tomcat 8? I already crawled through the catalina code
that is responsible for the servlet selection and didn't find
anything that would allow this. But this doesn't mean that it
isn't possible at all. As far as I know, java configuration for
servlet registration doesn't allow passing domain names. But maybe
there is an option within context.xml.

I want to create a web application that has different domains for
the application itself and its management site. Both parts should
run at the context root, at different domains. The application
needs a shared (spring-)context in which the application's beans
are stored.

Regards, Christian

I'm not quite sure what your after. Sharing Spring beans across
contexts and domains sounds like there's an underlying requirement I
don't understand.


ok, I'll try to explain, as aliases won't do what I need.
It's an application that can be configured via an admin interface. 
The admin interface is one part of the webapp.
The main application is accessible via www.example.com. The admin 
interface needs access to the beans within the main application (e. 
g. to create tenants that live in context scope), that's why I 
created just one webapp with two dispatcher servlets.
One dispatcher servlet is responsible for the admin interface and 
one for the main application. Until now I make tomcat select them 
by using a context path for the admin interface.
But this is redundant, because the admin interface needs to be 
accessed via admin.example.com/admin instead of just 
admin.example.com. I would like to map admin.example.com to the 
admin servlet and www.example.com to the main applications 
dispatcher servlet.
At a later stage, www.example.com/admin might be used for other 
admin tasks that must be accessible by users registered on the main 
site. But /admin is already shadowed.


Hopefully I could explain my problem a little better.


Yes, that is much clearer.
Honestly without having really figured out the details of your 
explanation, I would nevertheless point you in 2 directions for that 
kind of thing :
a) use an Apache httpd front-end proxy, and use the httpd proxying 
and/or URL rewriting capabilities to do what you want


thanks for your suggestion! The application anyway needs a reverse 
proxy / ssl gateway, because tomcat isn't capable of doing TLS with 
SNI. Your proposed solution seems appropriate, although I have to 
figure out how to cleanly generate the correct urls within the 
application.


VirtualHost *:80
  ServerName admin.mydomain.com
..
  ProxyPass / ajp://mytomcat.local/admin/
  ProxyPassReverse / ajp://mytomcat.local/admin/
  ProxyPassReverseCookieDomain /admin /
/VirtualHost

VirtualHost *:80
  ServerName www.mydomain.com
..
  ProxyPass / ajp://mytomcat.local/
  ProxyPassReverse / ajp://mytomcat.local/
/VirtualHost



thank you for the configuration excerpt!


The ProxyPassReverse* take care of re-directs and cookies.
But in your admin application pages, you should make sure that your 
are returning only relative URLs.

E.g. if the admin application would normally return a page with
img src=/admin/images/logo.jpg /
it should instead return
img src=images/logo.jpg /
and the browser and the proxy should then do the right thing.

Or else, you could add an output filter at the httpd level, and 
rewrite all the URLs on the fly.
That is a bit resource-instensive, but I would imagine that your admin 
application is not one with very high traffic.


I believe relative urls are most elegant. My second choice would be a 
configuration within the application itself when generating the links 
(it's using spring and version 4.2 gets support for base uris). A 
content filter at httpd level seems a bit brittle to me.


Note also : in the schema above, there is nothing which prevents a 
user on www.mydomain.com to request a URL like /admin, which could 
lead to accidents..
You may want to add a RewriteCond/RewriteRule in that VirtualHost 
which prevents them doing that.


Thank you for the hint - I already prevent malicious access at the 
application level. The setup is a bit more complex than I described 
here, because it is a multi tenant and multi domain application. Tenants 
get recognized by the domain within a servlet filter, that's why they 
play a big role already. At a spring security layer authorization gets 
checked for every request.


Regards,
Christian



Regards,
Christian


or
b) use the built-in Rewrite Valve of Tomcat 8 
(http://tomcat.apache.org/tomcat-8.0-doc/rewrite.html), or if you 
are at a lower Tomcat

Distinct servlets for different domains in one web application

2015-06-28 Thread Christian
Hello all,

is it somehow possible to create a web application with multiple servlets that 
are registered to different domains for
the same url paths using tomcat 8?
I already crawled through the catalina code that is responsible for the servlet 
selection and didn't find anything that
would allow this. But this doesn't mean that it isn't possible at all.
As far as I know, java configuration for servlet registration doesn't allow 
passing domain names. But maybe there is an
option within context.xml.

I want to create a web application that has different domains for the 
application itself and its management site. Both
parts should run at the context root, at different domains. The application 
needs a shared (spring-)context in which the
application's beans are stored.

Regards,
Christian

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



Re: Distinct servlets for different domains in one web application

2015-06-28 Thread Christian

Mark,

On 28.06.2015 19:58, Mark Eggers wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Christian,

On 6/28/2015 9:01 AM, Christian wrote:

Hello all,

is it somehow possible to create a web application with multiple
servlets that are registered to different domains for the same url
paths using tomcat 8? I already crawled through the catalina code
that is responsible for the servlet selection and didn't find
anything that would allow this. But this doesn't mean that it
isn't possible at all. As far as I know, java configuration for
servlet registration doesn't allow passing domain names. But maybe
there is an option within context.xml.

I want to create a web application that has different domains for
the application itself and its management site. Both parts should
run at the context root, at different domains. The application
needs a shared (spring-)context in which the application's beans
are stored.

Regards, Christian

I'm not quite sure what your after. Sharing Spring beans across
contexts and domains sounds like there's an underlying requirement I
don't understand.


ok, I'll try to explain, as aliases won't do what I need.
It's an application that can be configured via an admin interface. The 
admin interface is one part of the webapp.
The main application is accessible via www.example.com. The admin 
interface needs access to the beans within the main application (e. g. 
to create tenants that live in context scope), that's why I created just 
one webapp with two dispatcher servlets.
One dispatcher servlet is responsible for the admin interface and one 
for the main application. Until now I make tomcat select them by using a 
context path for the admin interface.
But this is redundant, because the admin interface needs to be accessed 
via admin.example.com/admin instead of just admin.example.com. I would 
like to map admin.example.com to the admin servlet and www.example.com 
to the main applications dispatcher servlet.
At a later stage, www.example.com/admin might be used for other admin 
tasks that must be accessible by users registered on the main site. But 
/admin is already shadowed.


Hopefully I could explain my problem a little better.

Regards,
Christian


Anyway, how about using aliases?

Host name=first.host.name
Aliassecond.host.name/Alias
/Host

. . . just my two cents
/mde/
-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQEcBAEBAgAGBQJVkDWnAAoJEEFGbsYNeTwtXUsIAKFQ2UitPMWeI8PGPrDIrrIQ
czJu0kCmE2J/cBQx28ghvvMZEBJ7EI7926Q7/a4e4TASXT3J3gka/2RYkeGy0w/0
P0PLTCpAGIJi+v4PyZ9lNj7f/gAcU60g4EiaNz/10HTbBcFwy1W/vLg2wl54+aNt
C6Z+3YWtaCNCDjon1PcqMTOKqDkkDjcf+ePXQiUdEIqI6wquBY0xIKkwPZtbjV+G
hkq2tAFqzdvW4fGk16Cv6FfZJrYDVqEYCK/TyO08FEbgXtIhflIWYU+pmJ9b8Jdr
xppp26doG3MeZMw4t9uijkRhe22PdXI73tvHiptc92V03p+Fmej8SrJZoKPPj78=
=6QWg
-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: Distinct servlets for different domains in one web application

2015-06-28 Thread Christian
Chuck,

On 28.06.2015 18:40, Caldarale, Charles R wrote:
 It sounds like you want virtual hosts:

somehow, but I want to deploy *one* war with two servlets and shared objects. 
Using virtual hosts allows to deploy the
application twice, but then the spring context isn't shared.

Regards,
Christian

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



Re: Distinct servlets for different domains in one web application

2015-06-28 Thread Christian

André,

On 28.06.2015 23:11, André Warnier wrote:

Christian wrote:

Mark,

On 28.06.2015 19:58, Mark Eggers wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Christian,

On 6/28/2015 9:01 AM, Christian wrote:

Hello all,

is it somehow possible to create a web application with multiple
servlets that are registered to different domains for the same url
paths using tomcat 8? I already crawled through the catalina code
that is responsible for the servlet selection and didn't find
anything that would allow this. But this doesn't mean that it
isn't possible at all. As far as I know, java configuration for
servlet registration doesn't allow passing domain names. But maybe
there is an option within context.xml.

I want to create a web application that has different domains for
the application itself and its management site. Both parts should
run at the context root, at different domains. The application
needs a shared (spring-)context in which the application's beans
are stored.

Regards, Christian

I'm not quite sure what your after. Sharing Spring beans across
contexts and domains sounds like there's an underlying requirement I
don't understand.


ok, I'll try to explain, as aliases won't do what I need.
It's an application that can be configured via an admin interface. 
The admin interface is one part of the webapp.
The main application is accessible via www.example.com. The admin 
interface needs access to the beans within the main application (e. 
g. to create tenants that live in context scope), that's why I 
created just one webapp with two dispatcher servlets.
One dispatcher servlet is responsible for the admin interface and one 
for the main application. Until now I make tomcat select them by 
using a context path for the admin interface.
But this is redundant, because the admin interface needs to be 
accessed via admin.example.com/admin instead of just 
admin.example.com. I would like to map admin.example.com to the admin 
servlet and www.example.com to the main applications dispatcher servlet.
At a later stage, www.example.com/admin might be used for other admin 
tasks that must be accessible by users registered on the main site. 
But /admin is already shadowed.


Hopefully I could explain my problem a little better.


Yes, that is much clearer.
Honestly without having really figured out the details of your 
explanation, I would nevertheless point you in 2 directions for that 
kind of thing :
a) use an Apache httpd front-end proxy, and use the httpd proxying 
and/or URL rewriting capabilities to do what you want


thanks for your suggestion! The application anyway needs a reverse proxy 
/ ssl gateway, because tomcat isn't capable of doing TLS with SNI. Your 
proposed solution seems appropriate, although I have to figure out how 
to cleanly generate the correct urls within the application.


Regards,
Christian


or
b) use the built-in Rewrite Valve of Tomcat 8 
(http://tomcat.apache.org/tomcat-8.0-doc/rewrite.html), or if you are 
at a lower Tomcat version, use the add-on URLRewrite Filter 
(www.tuckey.org)


A Valve is a Tomcat-specific component, so that solution is generally 
non-portable to another servlet container.  The others (httpd 
front-end or the URLRewriteFilter (a servlet filter)) are portable.


Personally, in this case, and considering that you want to do 
different things depending on the hostname used to access Tomcat, I 
would go the httpd front-end route, with 2 VirtualHosts at the httpd 
level, proxying to a single Host at the Tomcat level (but in one case, 
after modifying the URL).
That's because I think that trying to do this at the Tomcat level only 
may give you headaches in terms of self-referential URLs returned by 
your application.



-
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



tomcat-jdbc vs. tomcat-dbcp

2014-11-28 Thread Christian
Hi,

reading tomcat 8.x documentation, I don't find anything about tomcat-dbcp. The 
use of tomcat-jdbc is described at [1].
Some of the disadvantages just apply for DBCP 1.x.
Is the use of tomcat-jdbc still recommended compared to the repackaged DBCP 2.x 
in tomcat-dbcp package?

Regards,
Christian

[1] https://tomcat.apache.org/tomcat-8.0-doc/jdbc-pool.html

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



Re: JNDI initialization since Tomcat 8.0.1

2014-04-16 Thread Christian
There is already a hibernate issue on this bug 
(https://hibernate.atlassian.net/browse/HHH-8818).


Regards,
Christian

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



JNDI initialization since Tomcat 8.0.1

2014-04-13 Thread Christian
Hi,

I'm experimenting with java 8, spring data JPA, hibernate and tomcat 8.
Spring Data JPA initializes hibernate on deployment.

On tomcat 8.0.0-RC10 everything is fine. Using Tomcat 8.0.1 or newer, an
exception is thrown when hibernate tries to fetch the datasource from JNDI:

javax.naming.NameNotFoundException: Name [java:comp/env/jdbc/myDB] is
not bound in this Context. Unable to find [java:comp].
at org.apache.naming.NamingContext.lookup(NamingContext.java:818)
at org.apache.naming.NamingContext.lookup(NamingContext.java:152)
at javax.naming.InitialContext.lookup(InitialContext.java:421)
at
org.hibernate.engine.jndi.internal.JndiServiceImpl.locate(JndiServiceImpl.java:114)
...

The part of the thread dump concerning tomcat:
...
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4737)
at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5159)
- locked 0x1aea (a org.apache.catalina.core.StandardContext)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:726)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:702)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:697)
at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1646)
...


When I disable hibernate and use the following snippet in a controller,
the DataSource is returned correctly:
Context initCtx = new InitialContext();
DataSource dataSource = (DataSource)
initCtx.lookup(java:comp/env/jdbc/myDB);

I have configured the datasource in META-INF/context.xml:
?xml version=1.0 encoding=UTF-8?
Context path=/
Resource name=jdbc/myDB
  auth=Container
  type=javax.sql.DataSource
  driverClassName=com.mysql.jdbc.Driver
  url=jdbc:mysql://localhost:3306/test/
/Context

And referenced it in web.xml:
?xml version=1.0 encoding=UTF-8?
web-app xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 xmlns=http://xmlns.jcp.org/xml/ns/javaee;
 xsi:schemaLocation=http://xmlns.jcp.org/xml/ns/javaee
 http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd;
 version=3.1
resource-ref
res-ref-namejdbc/myDB/res-ref-name
res-typejavax.sql.DataSource/res-type
res-authContainer/res-auth
/resource-ref
/web-app

Of course the mysql driver is copied into $CATALINA_BASE/lib.

Has the JNDI initialization changed between tomcat 8.0.0-RC10 and 8.0.1?

Regards,

Christian

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



Re: JNDI initialization since Tomcat 8.0.1

2014-04-13 Thread Christian
)
  at 
javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:828)
  at 
sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:-1)
  at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:483)
  at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:323)
  at sun.rmi.transport.Transport$1.run(Transport.java:178)
  at sun.rmi.transport.Transport$1.run(Transport.java:175)
  at 
java.security.AccessController.doPrivileged(AccessController.java:-1)
  at sun.rmi.transport.Transport.serviceCall(Transport.java:174)
  at 
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:557)
  at 
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:812)
  at 
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:671)
  at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
  at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
  at java.lang.Thread.run(Thread.java:744)




 Maybe you can try debugging, with a breakpoint in org.apache.naming.* classes?

I don't know where I should look. I started looking at the failing lookup() 
statement.
org.apache.naming.java.javaURLContextFactory#getObjectInstance() calls 
ContextBindings.isThreadBound() and
ContextBindings.isClassLoaderBound() - both return false.
In tomcat 8.0.0-RC10 ContextBindings.isThreadBound() returns true and the name 
resolution succeeds.

Maybe this directs to the cause of the problem.

Regards,
Christian

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



Re: JNDI initialization since Tomcat 8.0.1

2014-04-13 Thread Christian
On 13.04.2014 22:02, Konstantin Kolinko wrote:
 I do not know, what version of hibernate you are using, but if I look
 at 4.3.x sources [1], the following method mentioned in your
 stacktrace changes TCCL and thus breaks JNDI:
 
 org.hibernate.boot.registry.
 classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:397)

Great pointer! You're right, I use hibernate 4.3.
I followed your suggestion an asked at hibernate forums.

https://forum.hibernate.org/viewtopic.php?f=1t=1032307

Regards,
Christian

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



Are these CVEs fixed in tomcat 7 ?

2014-02-27 Thread Christian Rustøen
Hi

Based on the apache security reports i dont see any mention of these CVEs b=
eing fixed in tomcat, and as they have a very high score i would like to kn=
ow if they have been fixed.
These are almost 3-4 years old but as i dont see any mention on them in the=
 security reports i would still like to know as im planning to use this con=
tainer in an environment where security is very important.

CVE-2011-1571
CVE-2010-0557


--
BR,
chris


RE: Are these CVEs fixed in tomcat 7 ?

2014-02-27 Thread Christian Rustøen
Ok, thanks for your quick reply.



--
BR,
chris

From: Mark Thomas ma...@apache.org
Sent: Thursday, February 27, 2014 1:53 PM
To: Tomcat Users List
Subject: Re: Are these CVEs fixed in tomcat 7 ?

On 27/02/2014 12:49, Christian Rustøen wrote:
 Hi

 Based on the apache security reports i dont see any mention of these CVEs b=
 eing fixed in tomcat, and as they have a very high score i would like to kn=
 ow if they have been fixed.
 These are almost 3-4 years old but as i dont see any mention on them in the=
  security reports i would still like to know as im planning to use this con=
 tainer in an environment where security is very important.

 CVE-2011-1571

The above issue is a Liferay vulnerability, not an Apache Tomcat
vulnerability.

 CVE-2010-0557

The above issue is a IBM Cognos Express vulnerability, not an Apache
Tomcat vulnerability.

Since neither of the above issues is a vulnerability in Apache Tomcat
you won't find any information on these vulnerabilities at the ASF.

Mark


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


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



Re: Using the bin/daemon.sh script on ubuntu.

2013-08-01 Thread Christian Schneider
Thanks for the great responses.

@Ognjen: Yes, currently we also use the setenv.sh (because it will not be
touched by an update).
The *ln -s* Tipp is not bad.
But the problem is, it stores the files in the folder (/opt/tomcat/logs).

On our (AWS) installation we have limited space on /opt, therefore we
attached an EBS volume  to /var/, - otherwise we would get problems with
the log files. Now it can grow above some GB.

But because the log dirs are defined in the logging.properties (what get
shipped and overridden by updates) we put this hack into our setenv.sh:

sed -i 's/${catalina.base}\/logs/\/var\/log\/tomcat\//g'
\/opt\/tomcat\/conf\/logging.properties

This will replace the sting *${catalina.base}\/logs* with */var\/log\/tomcat
* everytime setenv.sh is executed.

Now we will never forget to touch the logging.properties after an update.
But i still think it is not that elegant...

Best Regards,
Christian.


2013/7/30 Ognjen Blagojevic ognjen.d.blagoje...@gmail.com

 Christian,


 On 30.7.2013 11:58, Christian Schneider wrote:

 But what about:
 * set env. variables (maybe: catalina.sh?, /etc/profiles?)


 /etc/profiles is executed when you enter bash shell, so if Tomcat starts
 at boot time, it won't be able to access environment variables defined in
 /etc/profile.

 I set JAVA_HOME, CATALINA_BASE and CATALINA_HOME environment variables in
 /etc/init.d/tomcat (which is a copy of daemon.sh), but I guess there may be
 a better place to do that.

 This link [1] recommends to put environment variables in
 /etc/default/tomcat, and then to source them from /etc/init.d/tomcat.



  * adjust the heap size


 Create file $CATALINA_BASE/bin/setenv.sh:

 
 export CATALINA_OPTS='-Xms...m -Xmx...m'
 



  * logging to the right directory (like: /var/log/tomcat/...)


 Maybe something like:

 ln -s /var/log/tomcat $CATALINA_BASE/logs



  * specifying the User: tomcat


 User 'tomcat' is already specified in daemon.sh, though you may override
 that with $TOMCAT_USER environment variable.

 -Ognjen

 [1] http://unix.stackexchange.com/**questions/44370/how-to-make-**
 unix-service-see-environment-**variableshttp://unix.stackexchange.com/questions/44370/how-to-make-unix-service-see-environment-variables


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




Using the bin/daemon.sh script on ubuntu.

2013-07-30 Thread Christian Schneider
Hi,
could someone point me to a good source how to use that (with ubuntu and
Tomcat 7)?

The internet is full of selfmade /etc/init.d/ scripts, but mostly it isn't
used it as a real service (jsvc). Keyword: bin/*daemon.sh*
Even the books Apache Tomcat 7 and Tomcat 7 Essentials are not talking
about it.

On the docs I've found this [0]:

cd $CATALINA_HOME/bin
tar xvfz commons-daemon-native.tar.gz
cd commons-daemon-1.0.x-native-src/unix
./configure
make
cp jsvc ../..
cd ../..

But what about:
* set env. variables (maybe: catalina.sh?, /etc/profiles?)
* adjust the heap size
* logging to the right directory (like: /var/log/tomcat/...)
* specifying the User: tomcat


Best Regards,
Christian.


[0]: http://tomcat.apache.org/tomcat-7.0-doc/setup.html#Unix_daemon


Re: Tomcat hangs every day

2013-05-17 Thread Christian Kaltepoth
Seems like you have a class called SearchClientRemoteClient which uses
HTTPClient. Many threads seems to wait for remote responses. I guess you
don't set any timeouts for the HTTPClient and therefore many threads hang
in HttpClient.executeMethod() forever. You should ALWAYS set timeouts when
using HTTPClient. :)

I hope this helps :)

Christian


2013/5/17 Sascha Troll sascha.tr...@geberit.com

 Hi !

 I have problem with our Tomcat 7.0.40 (upgrade already done from 7.0.39
 and 7.0.37 and still the same issue).

 Its still running, but not longer accepting any connection on port 8080.

 Attached are the thread dumps which were created this morning when the
 server was not longer available.
 I cannot find any deadlocks and need some help to find the cause.



 Thanks
 Sascha



 --
 Disclaimer:
 The content of this e-mail (including attachments) is confidential and
 intended for the use of the addressee only. If you are not the intended
 recipient please delete the e-mail; dissemination or disclosure of its
 content to anyone is strictly prohibited!
 Before opening an attachment please check it for viruses. We accept no
 liability for any damage caused by viruses.

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




-- 
Christian Kaltepoth
Blog: http://blog.kaltepoth.de/
Twitter: http://twitter.com/chkal
GitHub: https://github.com/chkal


Re: Tomcat hangs every day

2013-05-17 Thread Christian Kaltepoth
Hey,

I'm also not an expert for HttpClient, but when creating connections to
remote services it is usually a good idea to set connection timeouts and
socket timeouts so that the client doesn't block forever if there are
problems with the connection. Exactly this seems to be the problem in your
case.

Best regards

Christian Kaltepoth




2013/5/17 Sascha Troll sascha.tr...@geberit.com

 Christian,

 thanks for this.

 Can you give me a hint. I am just the server guy, so I can tell the
 developer.

 Thanks a lot !

 Sascha



 From:   Christian Kaltepoth christ...@kaltepoth.de
 To: Tomcat Users List users@tomcat.apache.org
 Date:   17.05.2013 11:24
 Subject:Re: Tomcat hangs every day
 Sent by:chk...@gmail.com



 Seems like you have a class called SearchClientRemoteClient which uses
 HTTPClient. Many threads seems to wait for remote responses. I guess you
 don't set any timeouts for the HTTPClient and therefore many threads hang
 in HttpClient.executeMethod() forever. You should ALWAYS set timeouts when
 using HTTPClient. :)

 I hope this helps :)

 Christian


 2013/5/17 Sascha Troll sascha.tr...@geberit.com

  Hi !
 
  I have problem with our Tomcat 7.0.40 (upgrade already done from 7.0.39
  and 7.0.37 and still the same issue).
 
  Its still running, but not longer accepting any connection on port 8080.
 
  Attached are the thread dumps which were created this morning when the
  server was not longer available.
  I cannot find any deadlocks and need some help to find the cause.
 
 
 
  Thanks
  Sascha
 
 
 
 

 --
  Disclaimer:
  The content of this e-mail (including attachments) is confidential and
  intended for the use of the addressee only. If you are not the intended
  recipient please delete the e-mail; dissemination or disclosure of its
  content to anyone is strictly prohibited!
  Before opening an attachment please check it for viruses. We accept no
  liability for any damage caused by viruses.
 
  -
  To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
  For additional commands, e-mail: users-h...@tomcat.apache.org
 



 --
 Christian Kaltepoth
 Blog: http://blog.kaltepoth.de/
 Twitter: http://twitter.com/chkal
 GitHub: https://github.com/chkal






 --
 Disclaimer:
 The content of this e-mail (including attachments) is confidential and
 intended for the use of the addressee only. If you are not the intended
 recipient please delete the e-mail; dissemination or disclosure of its
 content to anyone is strictly prohibited!
 Before opening an attachment please check it for viruses. We accept no
 liability for any damage caused by viruses.




-- 
Christian Kaltepoth
Blog: http://blog.kaltepoth.de/
Twitter: http://twitter.com/chkal
GitHub: https://github.com/chkal


Policy files

2013-04-24 Thread Christian Beikov

Hello there!

I am using tomcat as an embedded container for a while now, it is really 
amazing, but now I got stuck on a topic.
I am implementing a testsuite for automatic testing of uploaded 
solutions by students. The deployment works like a charm, I also found 
your StuckThreadDetectionValve very useful to kill threads of the 
students applications.
The next assignment will involve some areas where I would like to 
specify a policy file so that the students can't do anything they aren't 
supposed to. Now to my problem.


One thing is that I want a policy file to be in the students projects, 
so that they actually get the exceptions when they are doing something 
wrong. What do I have to configure in these student web projects so that 
they can e.g. deploy the project directly from netbeans to tomcat and 
have the policy applied?


The other thing is that I want the policy file to be in my testsuite 
project and configure it on demand when deploying the student solutions. 
Currently I create an instance of StandardContext for each student web 
application, then I configure the context and finally add it to the host 
of the server. What do I need to configure, to apply the policy in this 
case?


I hope someone can help me with that, thanks in advance!
--

Mit freundlichen Grüßen,

*Christian Beikov*


Fwd: Re: Policy files

2013-04-24 Thread Christian Beikov

Accidently mailed on tomee-list before 

Thanks for the quick answer but it seems I didn't explain my situation 
completely.
We use Maven for all assignments, I can control what base project they 
have to use for a specific assignment. Also in my testsuite I 
automatically build these projects and deploy the artifacts to my 
embedded tomcat.


The problem is when it comes to the policy files. Where do I need to add 
the path to the policy file for the base maven projects of the students? 
Is there any option in context.xml or so that I can use?


The second problem is that I want to configure the policy for each 
student project when deploying on embedded tomcat(since the students 
could change the file in their projects). Where do I have to configure 
the policy when instantiating the StandardContext myself? I saw that the 
Loader of the context is of the type WebappLoader and the ClassLoader is 
a WebappClassLoader. I also found a method addPermission in 
WebappClassLoader, but I don't want to parse the policy file myself and 
add the permissions one by one. Isn't there an attribute to set the 
policy for that class loader?


So to summarize it a bit, I want to know what to configure in e.g. 
context.xml(if that is the place where to configure the policy) to have 
a specific policy applied.


Mit freundlichen Grüßen,

*Christian Beikov*
Am 24.04.2013 12:48, schrieb Martin Gainty:
Sooner or later your students will need to stop playing with IDEs and 
get serious about creating a real war


Maven provides maven-war-plugin for creating deployable web archives

as far as applying differing policies (or configurations) you can use
archetypes for initial creation of the war
http://www.sonatype.com/books/mvnex-book/reference/web-sect-creating-project.html

properties for deployment configuration changes can be manipulated by 
passing attributes to MANIFEST.MF


bashmvn Dmaven.war.containerConfigXML=MYContextXML.xml
org.apache.maven.plugins:maven-war-plugin:2.3:manifest

http://maven.apache.org/plugins/maven-war-plugin/manifest-mojo.html#containerConfigXML

bashmvn org.apache.maven.plugins:maven-war-plugin:2.3:war

the first command copies to META-INF your customised MYContextXML.xml 
(context)

the second command builds out the war in \target folder

http://maven.apache.org/plugins/maven-war-plugin/war-mojo.html

*Viel Gluck*
Martin

__
Thank the general and tell him I have no desire to drink with him or 
any other Russian *** ** * *

General George Patton



 Date: Wed, 24 Apr 2013 08:29:27 +0200
 From: christian.bei...@gmail.com
 To: users@tomcat.apache.org
 Subject: Policy files

 Hello there!

 I am using tomcat as an embedded container for a while now, it is 
really

 amazing, but now I got stuck on a topic.
 I am implementing a testsuite for automatic testing of uploaded
 solutions by students. The deployment works like a charm, I also found
 your StuckThreadDetectionValve very useful to kill threads of the
 students applications.
 The next assignment will involve some areas where I would like to
 specify a policy file so that the students can't do anything they 
aren't

 supposed to. Now to my problem.

 One thing is that I want a policy file to be in the students projects,
 so that they actually get the exceptions when they are doing something
 wrong. What do I have to configure in these student web projects so 
that

 they can e.g. deploy the project directly from netbeans to tomcat and
 have the policy applied?

 The other thing is that I want the policy file to be in my testsuite
 project and configure it on demand when deploying the student 
solutions.

 Currently I create an instance of StandardContext for each student web
 application, then I configure the context and finally add it to the 
host

 of the server. What do I need to configure, to apply the policy in this
 case?

 I hope someone can help me with that, thanks in advance!
 --

 Mit freundlichen Grüßen,
 
 *Christian Beikov*






Re: Policy files

2013-04-24 Thread Christian Beikov

Yes we are talking about security manager policies.

So there is no possibility to just push the policy file to the 
WebappClassLoader? As stated in the reply to Matrin Gainty there do 
exist methods to restrict the webapp, but unfortunately no method for 
supplying a policy file.


So this means I have to parse the policy file myself and add the 
permissions manually to the classloader?
Are there any options in the context.xml I could set for specifying a 
webapp local policy so that I don't have to fiddle around with how 
tomcat is called? I know how to apply a policy at runtime, but don't 
know how this affects tomcat when I apply it e.g. in a 
ServletContextListener. Would be cool if there was an option to do that 
kind of stuff.


Mit freundlichen Grüßen,

*Christian Beikov*
Am 24.04.2013 19:13, schrieb Christopher Schultz:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Christian,

On 4/24/13 2:29 AM, Christian Beikov wrote:

I am using tomcat as an embedded container for a while now, it is
really amazing, but now I got stuck on a topic. I am implementing a
testsuite for automatic testing of uploaded solutions by students.
The deployment works like a charm, I also found your
StuckThreadDetectionValve very useful to kill threads of the
students applications. The next assignment will involve some areas
where I would like to specify a policy file so that the students
can't do anything they aren't supposed to. Now to my problem.

Cool.


One thing is that I want a policy file to be in the students
projects, so that they actually get the exceptions when they are
doing something wrong. What do I have to configure in these student
web projects so that they can e.g. deploy the project directly from
netbeans to tomcat and have the policy applied?

I assume you are talking about SecurityManager policies.

Unfortunately, the SecurityManager applies to the entire JVM, so you
can't do something cool like allow one ClassLoader to run amok while
classes loaded from another one are constrained. Instead, you can
place limits on the entire JVM (e.g. no System.exit) and then poke
holes in those protections for trusted content -- usually a specific
JAR file, etc.

If you are going to do that, you need to attempt privileged actions
everywhere your driver code is going to do something that requires
such privileges. If the student code tries to do something forbidden
(e.g. System.exit), they'll get a SecurityException. If you try to do
it without a privileged action, you'll also get an exception.


The other thing is that I want the policy file to be in my
testsuite project and configure it on demand when deploying the
student solutions. Currently I create an instance of
StandardContext for each student web application, then I configure
the context and finally add it to the host of the server. What do I
need to configure, to apply the policy in this case?

You have to apply the policy when you launch the JVM via system
properties on the command-line. Fortunately, all of your privileged
code should be known in advance, so you shouldn't have to adjust
anything for student-submitted code: all their stuff is limited by
your policy.

Remember that you have to give Tomcat all the privileges *it* needs as
well as your own code. Check the catalina.policy file to see what
privileges are necessary to properly run Tomcat under a SecurityManager.

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

iQIcBAEBCAAGBQJReBLUAAoJEBzwKT+lPKRYzOAP/iEB1IPyKjSSY/74IjYqR31G
wzF6/HuEzwauYgdCxugxFhiogskUsHGnbgKtd4I0hGRtXwfLQf02c5foR6pV04F3
dy4ViYvXTvTLgM6YqcqDEClFigfJdRZdqb26bRUvbrSacTAgp6ifm2Tc7yBpkcR2
rWo0/zdCQTATHlryKnAtfpx0jngoXmyMxrNVH1efw36zN/C50zq26ri9VMG9vEcE
TOy8w8lscj8PaCKj5e0skgvwKWjGrH4gplLOW07STK0Mtpb4rfSL5iua73CoaPsD
PvnzlfgJsYWhlzWF6mExKlTDP+9UmC1195VSfVb3yPdSREf+Lk+PcpAIRnqj4Zma
ZAQys1LcM5CUPzq4y6T4dokGDIXpwsBaphN7S4MKDp+vgb2W0Z6UbidjkUHiZ25r
1dPbt67f3Ro6gYRO/ggorc9y5/0yYs6xjaA9SuM7xvm4uGG4lEn092f6FBnd0+OZ
7t/6IylDSP5+CxCmXrPBu9TeJppq42biVz8VJaM+BJjlDKU6BIn+P2qPR/N1C2QK
wR8aSbcxzKWekSkLv5VCnErCDbx+YekMWVfVfuQobQkMIha977cBHlqc+jhioG2g
QIHaMAPA6JQMEQdSHrob98QirBI9FfZSDDdWQ/w9BuaAT3+bXXPKvUvgbLz14vN+
CLya7aynTMumUFHBnnv2
=MeqU
-END PGP SIGNATURE-

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





Re: Policy files

2013-04-24 Thread Christian Beikov
Well I understand that there is only one SecurityManager per JVM, but as 
you mentioned I can restrict actions for specific CodeBases. This is 
what I am actually trying to do. I want the student web applications to 
have only a hand full of permissions defined in a policy file. I think I 
explained my self wrong earlier. The policy file I am speaking of, the 
one I want to apply to student projects, is more like a set of 
permissions that I want to give the web applications. I mainly want my 
testsuite and everything packaged with it to have all permissions.  
Generally the student projects should have no permissions. I want to 
give these applications only a minimal set of permissions, only the ones 
they actually would need to fullfil their tasks.


The WebappClassLoader supports the method addPermission(Permission) 
which is nice somehow, but I don't want to hard code the permissions but 
rather have them in a policy file or so. The reason for having the 
permissions in a policy file is mainly because I thought I can configure 
something in context.xml so that the policy file gets picked up by tomcat.


I just don't want to have these applications running on my computer not 
knowing what they actually do. To be honest I couldn't think of any 
permission I would give a student application. The libraries that can be 
used are predefined, so I give these jar files the permissions for 
reflection or whatever they need to work properly.


Am I simplifying the whole thing and is what I want much harder to 
achive than I think?



Am 24.04.2013 22:20, schrieb Christopher Schultz:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Christian,

On 4/24/13 1:51 PM, Christian Beikov wrote:

Yes we are talking about security manager policies.

Good :)

There's a lot about Spring that I don't know about, so I was just
checking that you weren't talking about some crazy IoC thing or
annotation-driven magic that no mere mortal can follow.


So there is no possibility to just push the policy file to the
WebappClassLoader?

Nope: the SecurityManager applies to the whole JVM. But, the policy
can bless certain JARs, etc. as being privileged. So, you make Tomcat
and whatever code you wrote privileged and then leave all the student
code to run under the heavy-handed security policy.


As stated in the reply to Matrin Gainty there do exist methods to
restrict the webapp, but unfortunately no method for supplying a
policy file.

Right: you can control the deployment descriptor(s) but not really
much else.


So this means I have to parse the policy file myself and add the
permissions manually to the classloader?

Uh... I don't think that's possible. I must admit I'm no ClassLoader
ninja, but I don't think there's a way to tell a ClassLoader anything
about security policies.

What kinds of operations are you trying to restrict?


Are there any options in the context.xml I could set for specifying
a webapp local policy so that I don't have to fiddle around with
how tomcat is called? I know how to apply a policy at runtime, but
don't know how this affects tomcat when I apply it e.g. in a
ServletContextListener.

I think I'd have to understand more about what you are trying to do in
order to be helpful. The SecurityManager applies its policies globally
and you can't customize anything on a per-ClassLoader basis. You can
do it on a per-codebase basis, but you have to know the URL(s) of the
codebase(s) in advance.


Would be cool if there was an option to do that kind of stuff.

Yes, I rather think it would be cool to specify a security policy on a
per-ClassLoader basis, but there are definitely some thorny issues
there otherwise I think Sun/Oracle would have implemented that
capability by now.

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

iQIcBAEBCAAGBQJReD6oAAoJEBzwKT+lPKRYDGAP/R9SjzcX0ENxQ5A7/N+S26M8
Jd5sNOisQ9mdVowygJAwppYDqtUalmMZ5qZTtsyYZYWKn3QpiML10Qr36elFZsA5
zoCA1JRB+hwC/vhNgJGdhhNxDOEQo66mfiJlfQ0rHpOGwVrGppAuSV4kVfX5aZCQ
9Ssq2HZvfLE7tL0pg+qnBT1AA9/HU+hAmk4GkCETSMR16jB8NrwI10ejU7gt1F4F
BaUCULZvYtLRelbsAQTfz4ZOQL0FZq2zD85BeZ+hey0koinpr+nY1aRGy4ASbmrM
Eke8ruYKW5xbVmSyQ0A4JmaYmMrYFfc7SgdR7UOkD21wbHA87fSHF9oNhhom2Tqd
Qsdn89swuBwp6XkS1akbfRc6RJ4WPCxNfxBWceGWlJewtgY8XRD8lPYOsHCSiVN/
SOSVnmCaa8Fs6ygk75wo6IKI+VlLRJqFSK5pr1iGK9hVC+xgBGB5APrhMhvSCUmO
SuP6IxFMSRDhghlxUbDhd7hW7KZnpXGQCJZjSoEsW/ysjhwy0hfhLbkEGTyYV8Az
wCap5r3eHc5KsHP0FK9F283DbiUhV8oHoLK0ddzKd9KrHbxap4Vekk2tqbUA52Vn
gpcRk5vodI88w0mvtdc9b57luHPedmY87bqmayjqzh6VHixlT/O8+CQhmJLRrln3
Wf6YgQg1Li6p//YLwHpo
=TJPJ
-END PGP SIGNATURE-

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




Mit freundlichen Grüßen,

*Christian

[SOLVED] tomcat 6.0.32 stops expiring sessions

2012-11-12 Thread Altmeier, Christian
Many Thanks
There was really a dead lock in our system.
Regards
CA

-Ursprüngliche Nachricht-
Von: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com]
Gesendet: Dienstag, 6. November 2012 07:53
An: Tomcat Users List
Betreff: RE: AW: AW: AW: AW: AW: tomcat 6.0.32 stops expiring sessions

 From: Altmeier, Christian [mailto:christian.altme...@softwareag.com]
 Subject: AW: AW: AW: AW: AW: AW: tomcat 6.0.32 stops expiring sessions

 do you have a guideline how to get the thread dump?

It's in the FAQ:

http://wiki.apache.org/tomcat/HowTo#How_do_I_obtain_a_thread_dump_of_my_running_webapp_.3F

 - 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

IDS Scheer Consulting GmbH
Geschäftsführer/Managing Directors: Michael Rehm, Ivo Totev
Sitz/Registered office: Altenkesseler Straße 17, 66115 Saarbrücken, Germany - 
Registergericht/Commercial register: Saarbrücken HRB 19681
http://www.ids-scheer-consulting.com


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



AW: tomcat 6.0.32 stops expiring sessions

2012-11-05 Thread Altmeier, Christian
No that's OK, I don't mean the time a user stays inactive for some minutes.
The session timeout is set to 66 minutes.
I have sessions which are inactive for 70 hours ...

-Ursprüngliche Nachricht-
Von: Igor Cicimov [mailto:icici...@gmail.com]
Gesendet: Montag, 5. November 2012 10:26
An: Tomcat Users List
Betreff: Re: tomcat 6.0.32 stops expiring sessions

On 05/11/2012 6:50 PM, Altmeier, Christian  
christian.altme...@softwareag.com wrote:

 Hi,
 I have a big problem. After some time, tomcat stops expiring sessions.
 We have enabled logging for org.apache.catalina.session.ManagerBase.
 So
we see that at first everything works fine and suddenly sessions didn't expire 
anymore.
 Before tomcat stops expiring sessions, it is noticeable that some
sessions need a lot of time to expire (10 - 30 minutes). In this time, other 
session expire as expected.

Isnt that what you would expect if some users stay active for longer? Have you 
confirmed that the long lasting sessions are idle? I think default session 
timeout in tomcat is 30 minutes so are you saying you have changed that to a 
lower value but its not working?

 I hope someone has an idea.

 Tomcat runs  on a 64bit Linux server.

 Greeting
 IDS Scheer Consulting GmbH
 Gesch?ftsf?hrer/Managing Directors: Michael Rehm, Ivo Totev
 Sitz/Registered office: Altenkesseler Stra?e 17, 66115 Saarbr?cken,
Germany - Registergericht/Commercial register: Saarbr?cken HRB 19681
 http://www.ids-scheer-consulting.com

IDS Scheer Consulting GmbH
Geschäftsführer/Managing Directors: Michael Rehm, Ivo Totev
Sitz/Registered office: Altenkesseler Straße 17, 66115 Saarbrücken, Germany - 
Registergericht/Commercial register: Saarbrücken HRB 19681
http://www.ids-scheer-consulting.com


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



AW: AW: tomcat 6.0.32 stops expiring sessions

2012-11-05 Thread Altmeier, Christian
Yes we are using SSL.
Tomcat 6.0.32
Our connector config:
Connector port=8080 protocol=HTTP/1.1 connectionTimeout=2 
redirectPort=8443 scheme=https secure=true proxyName=..xx 
proxyPort=443/

-Ursprüngliche Nachricht-
Von: Igor Cicimov [mailto:icici...@gmail.com]
Gesendet: Montag, 5. November 2012 10:56
An: Tomcat Users List
Betreff: Re: AW: tomcat 6.0.32 stops expiring sessions

On 05/11/2012 8:41 PM, Altmeier, Christian 
christian.altme...@softwareag.com wrote:

 No that's OK, I don't mean the time a user stays inactive for some
minutes.
 The session timeout is set to 66 minutes.
 I have sessions which are inactive for 70 hours ...

Which tomcat version? Are they SSL sessions by some chance? Actually can
you post here your Connector config please?

 -Ursprüngliche Nachricht-
 Von: Igor Cicimov [mailto:icici...@gmail.com]
 Gesendet: Montag, 5. November 2012 10:26
 An: Tomcat Users List
 Betreff: Re: tomcat 6.0.32 stops expiring sessions

 On 05/11/2012 6:50 PM, Altmeier, Christian 
christian.altme...@softwareag.com wrote:
 
  Hi,
  I have a big problem. After some time, tomcat stops expiring sessions.
  We have enabled logging for org.apache.catalina.session.ManagerBase.
  So
 we see that at first everything works fine and suddenly sessions didn't
expire anymore.
  Before tomcat stops expiring sessions, it is noticeable that some
 sessions need a lot of time to expire (10 - 30 minutes). In this time,
other session expire as expected.

 Isnt that what you would expect if some users stay active for longer?
Have you confirmed that the long lasting sessions are idle? I think default
session timeout in tomcat is 30 minutes so are you saying you have changed
that to a lower value but its not working?

  I hope someone has an idea.
 
  Tomcat runs  on a 64bit Linux server.
 
  Greeting
  IDS Scheer Consulting GmbH
  Gesch?ftsf?hrer/Managing Directors: Michael Rehm, Ivo Totev
  Sitz/Registered office: Altenkesseler Stra?e 17, 66115 Saarbr?cken,
 Germany - Registergericht/Commercial register: Saarbr?cken HRB 19681
  http://www.ids-scheer-consulting.com
 
 IDS Scheer Consulting GmbH
 Geschäftsführer/Managing Directors: Michael Rehm, Ivo Totev
 Sitz/Registered office: Altenkesseler Straße 17, 66115 Saarbrücken,
Germany - Registergericht/Commercial register: Saarbrücken HRB 19681
 http://www.ids-scheer-consulting.com


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

IDS Scheer Consulting GmbH
Geschäftsführer/Managing Directors: Michael Rehm, Ivo Totev
Sitz/Registered office: Altenkesseler Straße 17, 66115 Saarbrücken, Germany - 
Registergericht/Commercial register: Saarbrücken HRB 19681
http://www.ids-scheer-consulting.com


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



AW: AW: AW: tomcat 6.0.32 stops expiring sessions

2012-11-05 Thread Altmeier, Christian
No, sorry. Default should be 30 Minutes
We set it to 66 Minutes
But the sessions didn't even expire after 75 hours inactive time.

-Ursprüngliche Nachricht-
Von: Igor Cicimov [mailto:icici...@gmail.com]
Gesendet: Montag, 5. November 2012 14:01
An: Tomcat Users List
Betreff: Re: AW: AW: tomcat 6.0.32 stops expiring sessions

On 05/11/2012 10:01 PM, Altmeier, Christian  
christian.altme...@softwareag.com wrote:

 Yes we are using SSL.

The default session timeout for ssl in tomcat6 is 24 hours, maybe that explains 
why.

 Tomcat 6.0.32
 Our connector config:
 Connector port=8080 protocol=HTTP/1.1 connectionTimeout=2
redirectPort=8443 scheme=https secure=true proxyName=..xx
proxyPort=443/

 -Ursprüngliche Nachricht-
 Von: Igor Cicimov [mailto:icici...@gmail.com]
 Gesendet: Montag, 5. November 2012 10:56
 An: Tomcat Users List
 Betreff: Re: AW: tomcat 6.0.32 stops expiring sessions

 On 05/11/2012 8:41 PM, Altmeier, Christian 
 christian.altme...@softwareag.com wrote:
 
  No that's OK, I don't mean the time a user stays inactive for some
 minutes.
  The session timeout is set to 66 minutes.
  I have sessions which are inactive for 70 hours ...

 Which tomcat version? Are they SSL sessions by some chance? Actually
 can you post here your Connector config please?
 
  -Ursprüngliche Nachricht-
  Von: Igor Cicimov [mailto:icici...@gmail.com]
  Gesendet: Montag, 5. November 2012 10:26
  An: Tomcat Users List
  Betreff: Re: tomcat 6.0.32 stops expiring sessions
 
  On 05/11/2012 6:50 PM, Altmeier, Christian 
 christian.altme...@softwareag.com wrote:
  
   Hi,
   I have a big problem. After some time, tomcat stops expiring sessions.
   We have enabled logging for org.apache.catalina.session.ManagerBase.
   So
  we see that at first everything works fine and suddenly sessions
  didn't
 expire anymore.
   Before tomcat stops expiring sessions, it is noticeable that some
  sessions need a lot of time to expire (10 - 30 minutes). In this
  time,
 other session expire as expected.
 
  Isnt that what you would expect if some users stay active for longer?
 Have you confirmed that the long lasting sessions are idle? I think
default
 session timeout in tomcat is 30 minutes so are you saying you have
 changed that to a lower value but its not working?
 
   I hope someone has an idea.
  
   Tomcat runs  on a 64bit Linux server.
  
   Greeting
   IDS Scheer Consulting GmbH
   Gesch?ftsf?hrer/Managing Directors: Michael Rehm, Ivo Totev
   Sitz/Registered office: Altenkesseler Stra?e 17, 66115
   Saarbr?cken,
  Germany - Registergericht/Commercial register: Saarbr?cken HRB 19681
   http://www.ids-scheer-consulting.com
  
  IDS Scheer Consulting GmbH
  Geschäftsführer/Managing Directors: Michael Rehm, Ivo Totev
  Sitz/Registered office: Altenkesseler Straße 17, 66115 Saarbrücken,
 Germany - Registergericht/Commercial register: Saarbrücken HRB 19681
  http://www.ids-scheer-consulting.com
 
 
  
  - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
  For additional commands, e-mail: users-h...@tomcat.apache.org
 
 IDS Scheer Consulting GmbH
 Geschäftsführer/Managing Directors: Michael Rehm, Ivo Totev
 Sitz/Registered office: Altenkesseler Straße 17, 66115 Saarbrücken,
Germany - Registergericht/Commercial register: Saarbrücken HRB 19681
 http://www.ids-scheer-consulting.com


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

IDS Scheer Consulting GmbH
Geschäftsführer/Managing Directors: Michael Rehm, Ivo Totev
Sitz/Registered office: Altenkesseler Straße 17, 66115 Saarbrücken, Germany - 
Registergericht/Commercial register: Saarbrücken HRB 19681
http://www.ids-scheer-consulting.com


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



AW: AW: AW: AW: tomcat 6.0.32 stops expiring sessions

2012-11-05 Thread Altmeier, Christian
Yes I think so:

Session Id  Guessed Locale  Guessed User name   Creation Time   Last 
Accessed Time  Used Time   Inactive Time   TTL
9B33CA0CA59049557CEA6B4938FA98DB2012-11-02 12:42:38 
2012-11-02 12:42:38 00:00:0075:44:05-74:38:05
D4E1E89D5758A7695A39D404C42290772012-11-02 12:39:36 
2012-11-02 12:44:41 00:05:0575:42:01-74:36:01
2ECEF959105BC59118EC462A37FA62AA2012-11-05 01:10:58 
2012-11-05 01:54:09 00:43:1014:32:34-13:26:34
...

-Ursprüngliche Nachricht-
Von: David kerber [mailto:dcker...@verizon.net]
Gesendet: Montag, 5. November 2012 16:20
An: Tomcat Users List
Betreff: Re: AW: AW: AW: tomcat 6.0.32 stops expiring sessions

On 11/5/2012 10:07 AM, Altmeier, Christian wrote:
 No, sorry. Default should be 30 Minutes We set it to 66 Minutes But
 the sessions didn't even expire after 75 hours inactive time.

Are you sure they're really inactive that entire time, and don't have some kind 
of keepalive going on?



 -Ursprüngliche Nachricht-
 Von: Igor Cicimov [mailto:icici...@gmail.com]
 Gesendet: Montag, 5. November 2012 14:01
 An: Tomcat Users List
 Betreff: Re: AW: AW: tomcat 6.0.32 stops expiring sessions

 On 05/11/2012 10:01 PM, Altmeier, Christian  
 christian.altme...@softwareag.com  wrote:

 Yes we are using SSL.

 The default session timeout for ssl in tomcat6 is 24 hours, maybe that 
 explains why.

 Tomcat 6.0.32
 Our connector config:
 Connector port=8080 protocol=HTTP/1.1 connectionTimeout=2
 redirectPort=8443 scheme=https secure=true proxyName=..xx
 proxyPort=443/

 -Ursprüngliche Nachricht-
 Von: Igor Cicimov [mailto:icici...@gmail.com]
 Gesendet: Montag, 5. November 2012 10:56
 An: Tomcat Users List
 Betreff: Re: AW: tomcat 6.0.32 stops expiring sessions

 On 05/11/2012 8:41 PM, Altmeier, Christian
 christian.altme...@softwareag.com  wrote:

 No that's OK, I don't mean the time a user stays inactive for some
 minutes.
 The session timeout is set to 66 minutes.
 I have sessions which are inactive for 70 hours ...

 Which tomcat version? Are they SSL sessions by some chance? Actually
 can you post here your Connector config please?

 -Ursprüngliche Nachricht-
 Von: Igor Cicimov [mailto:icici...@gmail.com]
 Gesendet: Montag, 5. November 2012 10:26
 An: Tomcat Users List
 Betreff: Re: tomcat 6.0.32 stops expiring sessions

 On 05/11/2012 6:50 PM, Altmeier, Christian
 christian.altme...@softwareag.com  wrote:

 Hi,
 I have a big problem. After some time, tomcat stops expiring sessions.
 We have enabled logging for org.apache.catalina.session.ManagerBase.
 So
 we see that at first everything works fine and suddenly sessions
 didn't
 expire anymore.
 Before tomcat stops expiring sessions, it is noticeable that some
 sessions need a lot of time to expire (10 - 30 minutes). In this
 time,
 other session expire as expected.

 Isnt that what you would expect if some users stay active for longer?
 Have you confirmed that the long lasting sessions are idle? I think
 default
 session timeout in tomcat is 30 minutes so are you saying you have
 changed that to a lower value but its not working?

 I hope someone has an idea.

 Tomcat runs  on a 64bit Linux server.

 Greeting
 IDS Scheer Consulting GmbH
 Gesch?ftsf?hrer/Managing Directors: Michael Rehm, Ivo Totev
 Sitz/Registered office: Altenkesseler Stra?e 17, 66115
 Saarbr?cken,
 Germany - Registergericht/Commercial register: Saarbr?cken HRB 19681
 http://www.ids-scheer-consulting.com

 IDS Scheer Consulting GmbH
 Geschäftsführer/Managing Directors: Michael Rehm, Ivo Totev
 Sitz/Registered office: Altenkesseler Straße 17, 66115 Saarbrücken,
 Germany - Registergericht/Commercial register: Saarbrücken HRB 19681
 http://www.ids-scheer-consulting.com


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

 IDS Scheer Consulting GmbH
 Geschäftsführer/Managing Directors: Michael Rehm, Ivo Totev
 Sitz/Registered office: Altenkesseler Straße 17, 66115 Saarbrücken,
 Germany - Registergericht/Commercial register: Saarbrücken HRB 19681
 http://www.ids-scheer-consulting.com


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

 IDS Scheer Consulting GmbH
 Geschäftsführer/Managing Directors: Michael Rehm, Ivo Totev
 Sitz/Registered office: Altenkesseler Straße 17, 66115 Saarbrücken, Germany - 
 Registergericht/Commercial register: Saarbrücken HRB 19681
 http://www.ids-scheer-consulting.com


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

AW: AW: AW: AW: AW: tomcat 6.0.32 stops expiring sessions

2012-11-05 Thread Altmeier, Christian
I don't think so ... but I can't exclude it.
The problem is, that everything works fine and then suddenly all session, which 
are not closes by the browser, stay open.
Have you an idea how I can see, if there are any references?


-Ursprüngliche Nachricht-
Von: Pid [mailto:p...@pidster.com]
Gesendet: Montag, 5. November 2012 16:43
An: Tomcat Users List
Betreff: Re: AW: AW: AW: AW: tomcat 6.0.32 stops expiring sessions

* PGP Signed: 05.11.2012 at 16:42:54

On 05/11/2012 15:27, Altmeier, Christian wrote:
 Yes I think so:

 Session Id  Guessed Locale  Guessed User name   Creation Time   Last 
 Accessed Time  Used Time   Inactive Time   TTL
 9B33CA0CA59049557CEA6B4938FA98DB2012-11-02 12:42:38   
   2012-11-02 12:42:38 00:00:0075:44:05-74:38:05
 D4E1E89D5758A7695A39D404C42290772012-11-02 12:39:36   
   2012-11-02 12:44:41 00:05:0575:42:01-74:36:01
 2ECEF959105BC59118EC462A37FA62AA2012-11-05 01:10:58   
   2012-11-05 01:54:09 00:43:1014:32:34-13:26:34
 ...

Are you holding a reference to the session object anywhere?


p


 -Ursprüngliche Nachricht-
 Von: David kerber [mailto:dcker...@verizon.net]
 Gesendet: Montag, 5. November 2012 16:20
 An: Tomcat Users List
 Betreff: Re: AW: AW: AW: tomcat 6.0.32 stops expiring sessions

 On 11/5/2012 10:07 AM, Altmeier, Christian wrote:
 No, sorry. Default should be 30 Minutes We set it to 66 Minutes But
 the sessions didn't even expire after 75 hours inactive time.

 Are you sure they're really inactive that entire time, and don't have some 
 kind of keepalive going on?



 -Ursprüngliche Nachricht-
 Von: Igor Cicimov [mailto:icici...@gmail.com]
 Gesendet: Montag, 5. November 2012 14:01
 An: Tomcat Users List
 Betreff: Re: AW: AW: tomcat 6.0.32 stops expiring sessions

 On 05/11/2012 10:01 PM, Altmeier, Christian  
 christian.altme...@softwareag.com  wrote:

 Yes we are using SSL.

 The default session timeout for ssl in tomcat6 is 24 hours, maybe that 
 explains why.

 Tomcat 6.0.32
 Our connector config:
 Connector port=8080 protocol=HTTP/1.1 connectionTimeout=2
 redirectPort=8443 scheme=https secure=true proxyName=..xx
 proxyPort=443/

 -Ursprüngliche Nachricht-
 Von: Igor Cicimov [mailto:icici...@gmail.com]
 Gesendet: Montag, 5. November 2012 10:56
 An: Tomcat Users List
 Betreff: Re: AW: tomcat 6.0.32 stops expiring sessions

 On 05/11/2012 8:41 PM, Altmeier, Christian
 christian.altme...@softwareag.com  wrote:

 No that's OK, I don't mean the time a user stays inactive for some
 minutes.
 The session timeout is set to 66 minutes.
 I have sessions which are inactive for 70 hours ...

 Which tomcat version? Are they SSL sessions by some chance? Actually
 can you post here your Connector config please?

 -Ursprüngliche Nachricht-
 Von: Igor Cicimov [mailto:icici...@gmail.com]
 Gesendet: Montag, 5. November 2012 10:26
 An: Tomcat Users List
 Betreff: Re: tomcat 6.0.32 stops expiring sessions

 On 05/11/2012 6:50 PM, Altmeier, Christian
 christian.altme...@softwareag.com  wrote:

 Hi,
 I have a big problem. After some time, tomcat stops expiring sessions.
 We have enabled logging for org.apache.catalina.session.ManagerBase.
 So
 we see that at first everything works fine and suddenly sessions
 didn't
 expire anymore.
 Before tomcat stops expiring sessions, it is noticeable that some
 sessions need a lot of time to expire (10 - 30 minutes). In this
 time,
 other session expire as expected.

 Isnt that what you would expect if some users stay active for longer?
 Have you confirmed that the long lasting sessions are idle? I think
 default
 session timeout in tomcat is 30 minutes so are you saying you have
 changed that to a lower value but its not working?

 I hope someone has an idea.

 Tomcat runs  on a 64bit Linux server.

 Greeting
 IDS Scheer Consulting GmbH
 Gesch?ftsf?hrer/Managing Directors: Michael Rehm, Ivo Totev
 Sitz/Registered office: Altenkesseler Stra?e 17, 66115
 Saarbr?cken,
 Germany - Registergericht/Commercial register: Saarbr?cken HRB
 19681
 http://www.ids-scheer-consulting.com

 IDS Scheer Consulting GmbH
 Geschäftsführer/Managing Directors: Michael Rehm, Ivo Totev
 Sitz/Registered office: Altenkesseler Straße 17, 66115 Saarbrücken,
 Germany - Registergericht/Commercial register: Saarbrücken HRB 19681
 http://www.ids-scheer-consulting.com


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

 IDS Scheer Consulting GmbH
 Geschäftsführer/Managing Directors: Michael Rehm, Ivo Totev
 Sitz/Registered office: Altenkesseler Straße 17, 66115 Saarbrücken,
 Germany - Registergericht/Commercial register: Saarbrücken HRB 19681
 http://www.ids-scheer-consulting.com

AW: AW: AW: AW: AW: AW: tomcat 6.0.32 stops expiring sessions

2012-11-05 Thread Altmeier, Christian
Hey chris,
do you have a guideline how to get the thread dump?
We don't host tomcat by our self. It's a customer system.

Yes I use the manager app to see the sessions.

-Ursprüngliche Nachricht-
Von: Christopher Schultz [mailto:ch...@christopherschultz.net]
Gesendet: Montag, 5. November 2012 20:51
An: Tomcat Users List
Betreff: Re: AW: AW: AW: AW: AW: tomcat 6.0.32 stops expiring sessions

* PGP Signed by an unknown key

Christian,

On 11/5/12 10:48 AM, Altmeier, Christian wrote:
 I don't think so ... but I can't exclude it. The problem is, that
 everything works fine and then suddenly all session, which are not
 closes by the browser, stay open. Have you an idea how I can see, if
 there are any references?

Are you obtaining the list of sessions from Tomcat's manager app or some other 
way?

Did you take markt's advice to take a thread dump to see if the background 
thread is stuck on something? Just post the current stack trace of the 
background thread (it's called ContainerBackgroundProcessor with some other 
stuff tacked onto the end).

What happens if you request explicit expiration of sessions?

-chris

* Unknown Key
* 0xF2EFD0F0(L)

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

IDS Scheer Consulting GmbH
Geschäftsführer/Managing Directors: Michael Rehm, Ivo Totev
Sitz/Registered office: Altenkesseler Straße 17, 66115 Saarbrücken, Germany - 
Registergericht/Commercial register: Saarbrücken HRB 19681
http://www.ids-scheer-consulting.com



Re: memory leak in tomcat

2012-06-05 Thread Christian Kaufhold
Hi Warren,

thanks for the help. I found that the application
creates lots of SessionFactoryImpl objects
even though one is enough

I changed this part of webapp. Now it has only one
SessionFactoryImpl and the memory leak is gone.

bye

2012/5/24 Warren Bell warrenbe...@gmail.com

 Is this the same server with the Wicket app you posted about earlier ?
 If so, you have a Wicket app that is storing the
 SessionFactoryObjectFactory on a page as a class member. Wicket stores
 each page a user has been to in the user's session. If the page has
 class members, then it serializes them and stores them too. I have seen
 this kind of thing happen many times before causing big memory usage.

 Remove the Wicket app and run the Eclipse Memory Analyzer.

 Thanks,

 Warren Bell

 On 5/24/12 5:42 AM, Konstantin Kolinko wrote:
  2012/5/24 Christian Kaufhold kaufhol...@googlemail.com:
  Hi,
 
  I have a leaking Tomcat App
  I checked the heap with the Eclipse Memory Analyser
  and it says
 
  The classloader/component
 *org.apache.catalina.loader.WebappClassLoader @
  0x94532f50*
  occupies *376.421.152 (79,51%)* bytes. The memory is accumulated in one
  instance of
  *java.util.HashMap$Entry[]* loaded by *system class loader*.
 
 
  So the memory is used for something useful? That is not a memory
  leak. It is just a web application requiring a lot of memory.
 
  WebappClassLoader is the classloader that is used to load the classes
  of your webapp.  Of course, it remembers every class that it loaded
  (to satisfy repeated class.forName() calls) and every class that it
  loads has a reference it it (via getClass().getClassLoader()).
 
  There may be many classes, but I do not think that the classloader
  itself is responsible for 300 Mb of memory.
 
  and the data that is in the entries of the gigantic Map is
  org.hibernate.impl.SessionFactoryObjectFactory
 
 
  That would be a hibernate question. I have no clue what that class is
 about.
 
  Best regards,
  Konstantin Kolinko
 
  -
  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: getting frustrated with web sockets

2012-06-05 Thread Christian Finckler

Hello Ravi,
I do not use Requests or sessions.
Since I have the Message-Inbound object I can directly store in it for 
example with private fields any session attributes I want.
I do it this way, that the message Inbound implements my 
GameSessionParticipant-interface which has access to a gameSession 
Manager which is created by the servlet.
I need my own session handling because not just everybody talks to 
everybody. Instead the users form groups and these are handled by the 
session manager.


Bye,
Chris

Am 05.06.2012 21:37, schrieb Ravi:


Because

1. This article says tomcat websockets were implemented as servlets so 
that users have access to request and session parameters. So I am 
trying to find out what the mechanism is. If it is not possible, maybe 
the author of that article is confused.


http://www.tomcatexpert.com/blog/2012/05/01/how-apache-tomcat-implemented-websocket 




2. Most webapps do need sessions for any useful functionality. I am 
trying to find if something is built in so I do not try to do my own 
session management and reinvent the wheel.



regards



On 6/5/2012 3:26 PM, Mark Thomas wrote:

On 05/06/2012 20:18, Ravi wrote:


Thanks a lot Chris. It took a lot of work for me to get websockets to
work. I wonder if you can help me little further. Here is my issue:

1. I need to get access to request and session. However when I get a
message in MyMessageInboundImpl class, I do not have access to 
either of

them.


Why? Those are HTTP concepts and you are using WebSocket.

Mark



2. I tried to override doGet and save request/session, however after
saving request/session when I call super.doGet, I get unauthorized
request.

How can I get access to request and/or session when a message arrives?

thanks


On 6/2/2012 3:32 AM, Christian Finckler wrote:

Hello,
I had the same problem some time ago.
I could get jwesocket to work either.
But I then used autobahn:
http://autobahn.ws/developers/autobahnandroid/installation
That worked great for me.

I couldn't find out if the different client libraries do something 
wrong

or tomcat but I was a bit disapointet, too.
Perhaps that gets better when the draft is finished.

Btw. for normal java I use asynch http with netty.

Bye,
Chris

Am 02.06.2012 04:38, schrieb Ravi:


I am trying to build an android app that connects to tomcat web 
sockets.


I need a few java classes that can interact with tomcat websockets. I
have tried 3 different implementations
(strumsoft, jwebsockets and something else also) but neither one can
talk to tomcat correctly.

The issue seems to be protocol incompatibility between tomcat as
server and any existing java websockets client.

I even compiled jwebsockets swing based test client and that also
cannot talk to tomcat. Surprisingly all javascript based clients can
talk to tomcat, only java based cannot.


So having done all that research, I wonder if somebody can help me
identify java classes that will work with tomcat. Does tomcat have a
client jar I can use?

Help!


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




-



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





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




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





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




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



Re: non blocking Websockets?

2012-06-04 Thread Christian Finckler

thank you mark. that was a great answer.

Am 03.06.2012 22:49, schrieb Mark Thomas:

On 03/06/2012 21:26, Christian Finckler wrote:

Am 03.06.2012 19:50, schrieb Mark Thomas:

On 31/05/2012 18:45, Christian Finckler wrote:

Am 31.05.2012 11:09, schrieb Mark Thomas:

On 31/05/2012 10:02, Christian Finckler wrote:

Hello,
as far I understood, the websocket implementation of tomcat is
using one
thread per client.
Is there also a possibility to configure it to use non blocking IO?

No. That has not yet been implemented. It shouldn't be too hard
provided
that non-blocking is used between messages and blocking is used during
messages. Obviously, the BIO connector will always use blocking.

Whoops. My bad. I implemented this already. NIO and APR/native will be
non-blocking between messages and have been since the first Tomcat
release to include WebSocket support. Note that all connectors will
block between the point the upgrade is started and the first message is
sent.

This was on my to-do list for a while and I simply forgot I had actually
implemented. Had I looked at the code first (like I just did) it would
have been clear that this was implemented.

Sorry for the mis-information.

Mark

Hello Mark,
you have confused me a bit. So there isn't one thread for each websocket
client used?

For the BIO connector it is always one thread==  one connection. You
cannot do non-blocking IO with the blocking IO connector.

For NIO and APR/native is:
  - as many connections as you like up to maxConnections
  - one thread==  WebSocket frame

The threads are taken from the connector's connection pool and are
returned once the WebSocket frame has been read.

Reads are non-blocking between frames but blocking during a frame (to
save having track detailed state between reads)

Writes are always blocking.

In short, if the client isn't sending any data, Tomcat doesn't allocate
a thread to read it. The poller monitors the connection and passes it to
a thread when there is a message to read.


If not. What are the configuration possibilities for that?

maxThreads, maxConnections on the connector just like HTTP.


And how to do it?

Use the NIO or APR/native connector and it just works.


Perhaps you can describe more deeply how you handle websockets in regard
of blocking/non blocking and thread handling?

See above. If you want more detail, look at the source code. I am not
going to translate that into pseudo code for you.

Mark

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




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



Re: non blocking Websockets?

2012-06-03 Thread Christian Finckler

Am 03.06.2012 19:50, schrieb Mark Thomas:

On 31/05/2012 18:45, Christian Finckler wrote:


Am 31.05.2012 11:09, schrieb Mark Thomas:

On 31/05/2012 10:02, Christian Finckler wrote:

Hello,
as far I understood, the websocket implementation of tomcat is using one
thread per client.
Is there also a possibility to configure it to use non blocking IO?

No. That has not yet been implemented. It shouldn't be too hard provided
that non-blocking is used between messages and blocking is used during
messages. Obviously, the BIO connector will always use blocking.

Whoops. My bad. I implemented this already. NIO and APR/native will be
non-blocking between messages and have been since the first Tomcat
release to include WebSocket support. Note that all connectors will
block between the point the upgrade is started and the first message is
sent.

This was on my to-do list for a while and I simply forgot I had actually
implemented. Had I looked at the code first (like I just did) it would
have been clear that this was implemented.

Sorry for the mis-information.

Mark

Hello Mark,
you have confused me a bit. So there isn't one thread for each websocket 
client used? If not. What are the configuration possibilities for that? 
And how to do it?
Perhaps you can describe more deeply how you handle websockets in regard 
of blocking/non blocking and thread handling?


Thank you,
Chris


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



Re: getting frustrated with web sockets

2012-06-02 Thread Christian Finckler

Hello,
I had the same problem some time ago.
I could get jwesocket to work either.
But I then used autobahn: 
http://autobahn.ws/developers/autobahnandroid/installation

That worked great for me.

I couldn't find out if the different client libraries do something wrong 
or tomcat but I was a bit disapointet, too.

Perhaps that gets better when the draft is finished.

Btw. for normal java I use asynch http with netty.

Bye,
Chris

Am 02.06.2012 04:38, schrieb Ravi:


I am trying to build an android app that connects to tomcat web sockets.

I need a few java classes that can interact with tomcat websockets. I 
have tried 3 different implementations
(strumsoft, jwebsockets and something else also) but neither one can 
talk to tomcat correctly.


The issue seems to be protocol incompatibility between tomcat as 
server and any existing java websockets client.


I even compiled jwebsockets swing based test client and that also 
cannot talk to tomcat. Surprisingly all javascript based clients can 
talk to tomcat, only java based cannot.



So having done all that research, I wonder if somebody can help me 
identify java classes that will work with tomcat. Does tomcat have a 
client jar I can use?


Help!


-
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



non blocking Websockets?

2012-05-31 Thread Christian Finckler

Hello,
as far I understood, the websocket implementation of tomcat is using one 
thread per client.

Is there also a possibility to configure it to use non blocking IO?
Then it should be easier to serve lots of connections without creating 
unlimited threads.


Thank you,
Chris

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



Re: non blocking Websockets?

2012-05-31 Thread Christian Finckler



Am 31.05.2012 11:09, schrieb Mark Thomas:

On 31/05/2012 10:02, Christian Finckler wrote:

Hello,
as far I understood, the websocket implementation of tomcat is using one
thread per client.
Is there also a possibility to configure it to use non blocking IO?

No. That has not yet been implemented. It shouldn't be too hard provided
that non-blocking is used between messages and blocking is used during
messages. Obviously, the BIO connector will always use blocking.

Mark

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


Ok, if that is so easy, it should be done. I am developing an online 
game, in which the player dont send messages very often (max: ten 
messages per minute), but is is very important to get the messages of 
other players very fast. Thats why I want to use websockets. But now it 
would be sad, if I need multiple tomcat instances only for connection 
handling although the process handling itself is not very complicated 
(cpu and memory intensive).


Thank you,
Chris

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



memory leak in tomcat

2012-05-24 Thread Christian Kaufhold
Hi,

I have a leaking Tomcat App
I checked the heap with the Eclipse Memory Analyser
and it says

The classloader/component *org.apache.catalina.loader.WebappClassLoader @
0x94532f50*
occupies *376.421.152 (79,51%)* bytes. The memory is accumulated in one
instance of
*java.util.HashMap$Entry[]* loaded by *system class loader*.

and the data that is in the entries of the gigantic Map is
org.hibernate.impl.SessionFactoryObjectFactory

Does anyone know why this?

Christian




**
  Class Name Shallow Heap Retained Heap

   - java.util.HashMap$Entry[64] @ 0xaa9314c0 mat://object/0xaa9314c0

272 339.906.832 [image: \]

   - *table* java.util.HashMap @ 0xaa931498 mat://object/0xaa931498

40 339.906.872 [image: .][image: \]

   - *map* org.hibernate.util.FastHashMap @ 0x94e4bc98mat://object/0x94e4bc98

16 339.906.888 [image: .][image: .][image: \]

   - *INSTANCES* class org.hibernate.impl.SessionFactoryObjectFactory @
   0x759319f8 mat://object/0x759319f8

24 339.907.088 [image: .][image: .][image: .][image: \]

   - *[1788]* java.lang.Object[5120] @ 0x95148470 mat://object/0x95148470

20.496 375.206.992 [image: .][image: .][image: .][image: .][image: \]

   - *elementData* java.util.Vector @ 0x94538998 mat://object/0x94538998

24 375.207.016 [image: .][image: .][image: .][image: .][image: .][image: \]

   - *classes* org.apache.catalina.loader.WebappClassLoader @
0x94532f50mat://object/0x94532f50

176 376.421.152 [image: .][image: .][image: .][image: .][image:
.][image: .][image:
+]

   - *contextClassLoader* java.lang.Thread @ 0x94e1ac60
Thread-10mat://object/0x94e1ac60
   *Thread*

112 7.112 [image: .][image: .][image: .][image: .][image: .][image: .][image:
+]

   - *contextClassLoader* de.bfd.tools.ConnectionPool$ConnPoolMultiCaster @
   0x94e1ad00 Thread-9 mat://object/0x94e1ad00 »

136 592 [image: .][image: .][image: .][image: .][image: .][image: .][image:
+]

   - *contextClassLoader* java.lang.Thread @ 0x9bb7b548
Keep-Alive-Timermat://object/0x9bb7b548»

112 168 [image: .][image: .][image: .][image: .][image: .][image: .][image:
+]

   - *classloader* java.security.ProtectionDomain @
0x9453a160mat://object/0x9453a160»


Re: tomcat slowing down

2012-05-23 Thread Christian Kaufhold
Hi George,

No its just a plain server.
I used selenium and probe to check the issue.
Its definitely a Memory leak problem.

I try to find the leaks now.


Von meinem iPad gesendet

Am 23.05.2012 um 18:42 schrieb George Sexton geor...@mhsoftware.com:

 Just out of idle curiosity, are you running in a virtual server?
 
 On 5/16/12 6:49 AM, Christian Kaufhold wrote:
 Hi,
 
 we have the problem that tomact is slowing down after a while
 until even the manager app becomes unusable.
 
 Our System:
 2 Quadcores/24 GB Mem
 OpenSuse 11.4
 tomcat 6.0.29
 wicket/hibernate/postgres
 
 Max Memory and total Memory 2GB
 Free Momory 500 MB when the system is slow
 top shows 100 CPU usage by tomcat
 
 Symptom
  System is initially ok, but is slowing down dramtically over time
 when about 30 User are active
 
 What can we do to analyse the problem?
 
 thanks
 
 
 -- 
 George Sexton
 MH Software, Inc.
 303 438-9585
 http://www.mhsoftware.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: tomcat slowing down

2012-05-17 Thread Christian Kaufhold
Hi Mikolaj,

thanks I will do that,
do you know a free tool to generate request for the simulation
of about 30 clients being connected?


Am 16.05.2012 um 21:49 schrieb Mikolaj Rydzewski:

 On 05/16/2012 05:35 PM, Christian Kaufhold wrote:
 its not intentional but the myfaces App runs on the server for years now
 and should not cause the problem
 I recently deployed a wicket app and now
 the server is slowing down when we have about 10 users or so.
 
 
 So there are two different applications? Myfaces (which used to work for a 
 long time) and wicket (which takes server down)?
 I'd separate them first to have clear environment for investigation. Then 
 enable GC logging, attach jvisualvm, deploy psi probe 
 (http://code.google.com/p/psi-probe/), etc.
 
 -- 
 Mikolaj Rydzewskim...@ceti.pl
 
 
 -
 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: tomcat slowing down

2012-05-17 Thread Christian Kaufhold
Hi Warren,

thanx, but I think session size is not an issue with 30 users since Tomcat has 
about
2 GB memory.

But who knows, do you know a way to check the size of a session in tomcat?

christian

Am 17.05.2012 um 00:44 schrieb Warren Bell:

 Here is a good link explaining some of the pros and cons of Wicket. Look
 at the part titled Wicket Session size!
 
 http://www.small-improvements.com/10-things-about-apache-wicket-i-love
 
 Thanks,
 
 Warren Bell
 
 On 5/16/12 12:49 PM, Mikolaj Rydzewski wrote:
 On 05/16/2012 05:35 PM, Christian Kaufhold wrote:
 its not intentional but the myfaces App runs on the server for years now
 and should not cause the problem
 I recently deployed a wicket app and now
 the server is slowing down when we have about 10 users or so.
 
 
 So there are two different applications? Myfaces (which used to work for
 a long time) and wicket (which takes server down)?
 I'd separate them first to have clear environment for investigation.
 Then enable GC logging, attach jvisualvm, deploy psi probe
 (http://code.google.com/p/psi-probe/), etc.
 
 
 -
 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



tomcat slowing down

2012-05-16 Thread Christian Kaufhold
Hi,

we have the problem that tomact is slowing down after a while
until even the manager app becomes unusable.

Our System:
2 Quadcores/24 GB Mem
OpenSuse 11.4
tomcat 6.0.29
wicket/hibernate/postgres

Max Memory and total Memory 2GB
Free Momory 500 MB when the system is slow
top shows 100 CPU usage by tomcat

Symptom
 System is initially ok, but is slowing down dramtically over time
when about 30 User are active

What can we do to analyse the problem?

thanks


Re: tomcat slowing down

2012-05-16 Thread Christian Kaufhold
Hi Christopher,

its not intentional but the myfaces App runs on the server for years now
and should not cause the problem
I recently deployed a wicket app and now
the server is slowing down when we have about 10 users or so.

I have no idea of whats going on...




2012/5/16 Christopher Schultz ch...@christopherschultz.net

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Christian,

 On 5/16/12 11:00 AM, Mikolaj Rydzewski wrote:
  On 16.05.2012 16:46, Christian Kaufhold wrote:
 
  I made a thread dump off the slow server.
 
  You need to investigate it with application developers.

 +1

 I did notice some of the threads performing debugging operations (in
 myfaces). Is that intentional?

 - -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+zxnYACgkQ9CaO5/Lv0PDL8ACggHJagqMHkPQ2dVFub7NUYls6
 HZIAn1celh+spZjcX7KEViyGO7iRZjVm
 =NvnK
 -END PGP SIGNATURE-

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




tomcat doesnt want to start

2011-11-08 Thread Christian Röttger

Hello list,

i updated my ubuntu server to tomcat 6.0.24. (a kernel update was also 
included) After a reboot tomcat doesn't want to start.

The status is not running and when i want to start it, it always says:
/etc/init.d/tomcat6 start
 * Starting Tomcat servlet engine tomcat6   [fail]
the same with force-reload

when i try to look at the logs in /var/log/tomcat i don't get access
sudo cat /var/log$ cd tomcat6/
-bash: cd: tomcat6/: Keine Berechtigung

Where should i look?
Can anyone provide some help how to get it running again?

thanks,
christian



smime.p7s
Description: S/MIME Cryptographic Signature


problems get tomcat6 running

2011-05-25 Thread Christian Röttger
)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
25.05.2011 14:25:53 
org.apache.catalina.mbeans.GlobalResourcesLifecycleListener createMBeans

SCHWERWIEGEND: Exception processing Global JNDI Resources
javax.naming.NamingException: XML document structures must start and end 
within the same entity.

at org.apache.naming.NamingContext.lookup(NamingContext.java:805)
at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
at 
org.apache.naming.NamingContextBindingsEnumeration.nextElementInternal(NamingContextBindingsEnumeration.java:113)
at 
org.apache.naming.NamingContextBindingsEnumeration.next(NamingContextBindingsEnumeration.java:71)
at 
org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:137)
at 
org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:109)
at 
org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.lifecycleEvent(GlobalResourcesLifecycleListener.java:81)
at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at 
org.apache.catalina.core.StandardServer.start(StandardServer.java:703)

at org.apache.catalina.startup.Catalina.start(Catalina.java:593)
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.apa

greetz
christian



smime.p7s
Description: S/MIME Cryptographic Signature


Re: problems get tomcat6 running

2011-05-25 Thread Christian Röttger

Am 25.05.2011 16:00, schrieb Pid:

On 25/05/2011 13:55, Christian Röttger wrote:

Dear List,

i installed tomcat6.0.24 on a ubuntu 10.04 server with this installation
guide ( https://help.ubuntu.com/10.04/serverguide/C/tomcat.html )
without changing the port.

when i try to access the page on myserver:8080 it remains loading and
loading. I don't what went wrong.


The exception gives you a fairly big hint:


25.05.2011 14:25:53 org.apache.tomcat.util.digester.Digester fatalError
SCHWERWIEGEND: Parse Fatal Error at line 23 column 1: XML document
structures must start and end within the same entity.
org.xml.sax.SAXParseException; lineNumber: 23; columnNumber: 1; XML
document structures must start and end within the same entity.


You have an error in your Tomcat configuration, an element of your XML
is incorrectly written...


org.apache.catalina.mbeans.GlobalResourcesLifecycleListener createMBeans
SCHWERWIEGEND: Exception processing Global JNDI Resources
javax.naming.NamingException: XML document structures must start and end
within the same entity.


... in the Global JNDI definition.


If you can't see what it is, you can post the server.xml file inline,
with any username, passwords  IPs removed.


I didn't change anything in that file, but the xml is attached.

?xml version='1.0' encoding='utf-8'?
!--
  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.
--
!-- Note:  A Server is not itself a Container, so you may not
 define subcomponents such as Valves at this level.
 Documentation at /docs/config/server.html
 --
Server port=8005 shutdown=SHUTDOWN

  !--APR library loader. Documentation at /docs/apr.html --
  !--
  Listener className=org.apache.catalina.core.AprLifecycleListener 
SSLEngine=on /

  --
  !--Initialize Jasper prior to webapps are loaded. Documentation at 
/docs/jasper-howto.html --

  Listener className=org.apache.catalina.core.JasperListener /
  !-- Prevent memory leaks due to use of particular java/javax APIs--
  Listener 
className=org.apache.catalina.core.JreMemoryLeakPreventionListener /
  !-- JMX Support for the Tomcat server. Documentation at 
/docs/non-existent.html --
  Listener 
className=org.apache.catalina.mbeans.ServerLifecycleListener /
  Listener 
className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener /


  !-- Global JNDI resources
   Documentation at /docs/jndi-resources-howto.html
  --
  GlobalNamingResources
!-- Editable user database that can also be used by
 UserDatabaseRealm to authenticate users
--
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

  !-- A Service is a collection of one or more Connectors that share
   a single Container Note:  A Service is not itself a 
Container,

   so you may not define subcomponents such as Valves at this level.
   Documentation at /docs/config/service.html
   --
  Service name=Catalina

!--The connectors can use a shared executor, you can define one or 
more named thread pools--

!--
Executor name=tomcatThreadPool namePrefix=catalina-exec-
maxThreads=150 minSpareThreads=4/
--


!-- A Connector represents an endpoint by which requests are 
received

 and responses are returned. Documentation at :
 Java HTTP Connector: /docs/config/http.html (blocking  
non-blocking)

 Java AJP  Connector: /docs/config/ajp.html
 APR (HTTP/AJP) Connector: /docs/apr.html
 Define a non-SSL HTTP/1.1 Connector on port 8080
--
Connector port=8080 protocol=HTTP/1.1
   connectionTimeout=2
   URIEncoding=UTF-8
   redirectPort=8443 /
!-- A Connector using the shared thread pool--
!--
Connector executor=tomcatThreadPool
   port=8080 protocol=HTTP/1.1
   connectionTimeout=2
   redirectPort=8443 /
--
!-- Define a SSL HTTP/1.1 Connector on port 8443
 This connector uses the JSSE configuration, when using APR, the
 connector should be using

java.lang.ClassNotFoundException: org.apache.jasper.servlet.JspServlet when embedding tomcat 7.0.11

2011-04-07 Thread Christian Hödl
Hi,
  I'm trying to start Tomcat 7.0.11 from within an automated test.
  Unfortunately, when I call tomcat.start(), the following
  exception happens:

Servlet /abc/ threw load() exception
java.lang.ClassNotFoundException: org.apache.jasper.servlet.JspServlet
at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
at 
org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:415)
at 
org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:397)
at 
org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118)
at 
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1062)
at 
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1010)
at 
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4915)
at 
org.apache.catalina.core.StandardContext$3.call(StandardContext.java:5242)
at 
org.apache.catalina.core.StandardContext$3.call(StandardContext.java:5237)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
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)

I am running the test with gradle. This is the runtime classpath, I
think all needed tomcat jars should be on the classpath (especially jasper):

classpath = 
D:\dev\workspace\gradle_test\test\build\classes\test;D:\dev\workspace\gradle_test\test\build\classes\main;D:
\dev\programs\gradle_cache\cache\org.apache.tomcat.embed\tomcat-embed-core\jars\tomcat-embed-core-7.0.11.jar;D:\dev\prog
rams\gradle_cache\cache\org.apache.tomcat.embed\tomcat-embed-logging-juli\jars\tomcat-embed-logging-juli-7.0.11.jar;D:\d
ev\programs\gradle_cache\cache\org.apache.tomcat.embed\tomcat-embed-jasper\jars\tomcat-embed-jasper-7.0.11.jar;D:\dev\pr
ograms\gradle_cache\cache\org.eclipse.jdt.core.compiler\ecj\jars\ecj-3.6.jar;D:\dev\programs\gradle_cache\cache\junit\ju
nit\jars\junit-4.8.2.jar;D:\dev\programs\gradle_cache\cache\org.spockframework\spock-core\jars\spock-core-0.5-groovy-1.7
.jar;D:\dev\programs\gradle_cache\cache\org.codehaus.groovy\groovy-all\jars\groovy-all-1.7.5.jar;D:\dev\programs\gradle_
cache\cache\junit\junit-dep\jars\junit-dep-4.8.2.jar;D:\dev\programs\gradle_cache\cache\org.hamcrest\hamcrest-core\jars\
hamcrest-core-1.2.jar;D:\dev\programs\gradle_cache\cache\org.scala-tools.testing\specs_2.8.1\jars\specs_2.8.1-1.6.7.2.ja
r;D:\dev\programs\gradle_cache\cache\org.scala-lang\scala-library\jars\scala-library-2.8.1.jar;D:\dev\programs\gradle_ca
che\cache\org.scala-lang\scala-compiler\jars\scala-compiler-2.8.1.jar;D:\dev\programs\gradle_cache\cache\org.scalatest\s
calatest\jars\scalatest-1.3.jar

This is the very simple test (in Scala):

import org.apache.catalina.startup.Tomcat
import java.io.File._
import org.specs._
import org.specs.runner._

class Main extends Specification with ScalaTest {

  starting the tomcat should {
work in {
val contextPath = /abc/
val tomcat = new Tomcat()
tomcat.setPort(httpPort)
tomcat.addWebapp(contextPath, 
D:\\dev\\workspace\\gradle_test\\build)
tomcat.start()
tomcat.getServer().await()
}
}

}

Does anybody know, what could be the problem here?

Cheers,
  Christian
-- 
GMX DSL Doppel-Flat ab 19,99 Euro/mtl.! Jetzt mit 
gratis Handy-Flat! http://portal.gmx.net/de/go/dsl

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



Tomcat in CentOS 5.5

2011-01-31 Thread Christian Garling

Hi there,

I am new on this list, so first I want to say hello to you. But now to 
my problem.


We develop software for the touristical branch which runs mainly under 
CentOS. Our customers are big companies. Of course they have SLAs with 
their server providers, so they cant use any software version they want. 
CentOS 5.5 ships Tomcat 6.0.18, so this version is available at 
customers site. The developer who writes the java parts of our 
application told me, that we cant use the Tomcat version shipped with 
CentOS, because it has too many bugs. But if we use another one, we 
break with customers SLAs. I might be true, that there are bugs in 
Tomcat 6.0.18, but CentOS is an enterprise operating system. I can not 
believe that these bugs are not fixed with patches there. Can somebody 
shed some light into this?


Best regards, Christian

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



Re: Problems running tomcat 6.0.24 on ubuntu server 10.4

2010-12-01 Thread Christian Röttger

Am 30.11.2010 17:11, schrieb André Warnier:

Christian Röttger wrote:

hello,

i installed tomcat 6.0.24 from the repositorys on ubuntu server 10.04
with this installation guide:
https://help.ubuntu.com/10.04/serverguide/C/tomcat.html

i can access the index.html on myserver:8080 and can run the example
servlets. i updated the |/etc/tomcat6/tomcat-users.xml |with an user
admin and the roles admin and manger. But i cant get access to the
manager page.


1) and what does the log say ? /var/log/tomcat6/
2) the URL is http://myserver:8080/manager/html
3) make sure that you have not forgotten to remove the XML comment signs
around the section in tomcat-users.xml
!-- this is a comment
over several lines
--


Yes, that's it. didn't recongnize that.

thanks christian



smime.p7s
Description: S/MIME Cryptographic Signature


Problems running tomcat 6.0.24 on ubuntu server 10.4

2010-11-30 Thread Christian Röttger

hello,

i installed tomcat 6.0.24 from the repositorys on ubuntu server 10.04 
with this installation guide: 
https://help.ubuntu.com/10.04/serverguide/C/tomcat.html


i can access the index.html on myserver:8080 and can run the example 
servlets. i updated the |/etc/tomcat6/tomcat-users.xml |with an user 
admin and the roles admin and manger. But i cant get access to the 
manager page.
My webapp (geoserver.war) doesn't run at first, but seem to work now (is 
actually runing)


What is my fault, does anybody know?



smime.p7s
Description: S/MIME Cryptographic Signature


Re: another UTF-8 problem

2010-08-26 Thread Tim-Christian Mundt
Thanks for your responses. The problem was not the response from the web 
service. Something must have been completely mixed up. I set the Java 
option -Dfile.encoding to utf-8 which solved the write to file problem 
and also put this in the code:


if (req.getCharacterEncoding() == null)
   req.setCharacterEncoding(UTF-8);
res.setContentType(text/html; charset=UTF-8);
res.setCharacterEncoding(UTF-8);

Which solved the encoding of the response I got from the servlet.

Best
Tim

Christopher Schultz schrieb:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Tim,

On 8/24/2010 9:06 AM, Tim-Christian Mundt wrote:
  

I've encountered a UTF-8 problem and yes, URIEncoding=UTF-8 is set.



If you're connecting-out to a SOAP service, then the URIEncoding setting
doesn't matter.

  

I'm connecting to a web service which returns UTF-8 encoded data. If I
do so from a plain, regular, self-contained Java application everything
is fine. However, if I run the same classes in tomcat (and trigger the
action with a http request instead of a main() method in the
application) I get latin-1 encoded characters. For instance when I make
a call and receive a response which contains Łódź I finally get ?ód?
(console, file, whatever output).



Are you sure it isn't the encoding to your console/file/whatever that
isn't set properly?

If you are getting a response that contains non-ASCII characters, they
ought to be encoded using the declared XML document's encoding. What is
that? Are the bytes correct in the response (before your SOAP client
parses them)? Does your SOAP client parse them correctly? You may have
to use a profiler to verify that the characters in memory are what you
expect them to be.

  

Actually the URIEncoding option should not have anything to do with
this, because I'm not sending a request to my application, but my
application is issuing a SOAP call to a web service. Are there any other
options to consider? Same response from the web service (checked with
Wireshark) but different outputs. I've no idea. Any hint is welcome.



So, when you use your own command-line app as a client, you get a
different response from the SOAP server than when you use Tomcat as the
client? You should look at the requests that are being sent. Perhaps
there is a bad accept-charset header or something (although that
probably shouldn't affect the XML response, since an XML parser is
pretty much required to support UTF-8).

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

iEYEARECAAYFAkxz7SoACgkQ9CaO5/Lv0PCNOQCeLLBz/6e3QNsPyQtw4Ggfnh7R
sYsAn3PNB9UqJDunLDeMyQrz6a3Edbao
=/0N2
-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



another UTF-8 problem

2010-08-24 Thread Tim-Christian Mundt

Hi,

I've encountered a UTF-8 problem and yes, URIEncoding=UTF-8 is set.

I'm connecting to a web service which returns UTF-8 encoded data. If I 
do so from a plain, regular, self-contained Java application everything 
is fine. However, if I run the same classes in tomcat (and trigger the 
action with a http request instead of a main() method in the 
application) I get latin-1 encoded characters. For instance when I make 
a call and receive a response which contains Łódź I finally get ?ód? 
(console, file, whatever output).


Actually the URIEncoding option should not have anything to do with 
this, because I'm not sending a request to my application, but my 
application is issuing a SOAP call to a web service. Are there any other 
options to consider? Same response from the web service (checked with 
Wireshark) but different outputs. I've no idea. Any hint is welcome.


Thanks
Tim


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



Re: another UTF-8 problem

2010-08-24 Thread Tim-Christian Mundt

Caldarale, Charles R schrieb:

From: Tim-Christian Mundt [mailto:d...@tim-erwin.de]
Subject: another UTF-8 problem

I've encountered a UTF-8 problem and yes, URIEncoding=UTF-8 is set.



Tomcat version?  Using APR or not?  JVM version?  Platform?  Default locale 
setting?

 - 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.

  

tomcat 6.0.18
no APR
JVM 1.6.0_14
currently on Windows XP
I don't know how to get the default locale setting on Windows. I'm in 
Germany, have a German version and hence assume it's de.


Hope this helps isolating the problem.

Tim

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



AUTO: Christian Luettenberg ist außer Haus. ( Rückkehr am 18.08.2010)

2010-07-30 Thread christian . luettenberg

Ich bin bis 18.08.2010 abwesend.

Ich werde Ihre Nachricht nach meiner Rückkehr beantworten.


Hinweis: Dies ist eine automatische Antwort auf Ihre Nachricht  Re: [OT]
java.security.NoSuchAlgorithmException: No implementation for
AES/CBC/NoPad gesendet am 30.07.2010 17:10:36.

Diese ist die einzige Benachrichtigung, die Sie empfangen werden, während
diese Person abwesend ist.


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



Re: Connecting Tomcat to a database

2010-07-12 Thread Christian Bruckhoff

Hi.

Am 10.07.2010 06:15, schrieb Caldarale, Charles R:

From: Christian Bruckhoff [mailto:christian.bruckh...@gmx.de]
Subject: Re: Connecting Tomcat to a database

ERROR - GeronimoLog.error(108) | Failed to resolved external
DataSource at java:comp/env/jdbc/TestDB.
javax.naming.NameNotFoundException: Name jdbc is not bound
in this Context

Any idea, what's wrong?


I downloaded and installed ODE on Tomcat 7, configured it for MySQL, and was 
able to reproduce the above error.  (Contrary to popular belief, there is no 
space in the error message - that was just a figment of whatever transposition 
mechanism the OP used.  The grammar in the message is flawed, though.)

Luckily, there's an easy fix (or at least a workaround): get rid of the original .war 
file.  Once Tomcat has expanded ode.war into the ode directory, the .war file is no 
longer needed, and in fact is somehow interfering with the use of the directory.  
Deleting the .war (or changing the extension) lets the META-INF/context.xml file get 
processed, thus defining the JNDI data source.  The same effect can be achieved by 
placing theContext  element in conf/Catalina/[host]/ode.xml, which will 
override any in META-INF/context.xml (in either the .war file or the directory).

I have no idea if things are supposed to work this way, or if this is a bug in 
Tomcat 7 (haven't tried ODE on any other version).  Perhaps the lack of a 
context.xml file inside META-INF of the .war causes Tomcat to ignore the one in 
the expanded directory.


I tried it that way and at least it seems, as if tomcat recognizes the 
database. But now, I get another error (see end of message). Do I have 
to import the ODE schema even if I want to use the database for ODE 
external data?



As a side note, I found two problems with the ODE 2.0 beta:

1) It doesn't shut down properly.  You can't use Tomcat's shutdown.bat (or .sh) 
script to stop Tomcat, since ODE starts extra threads and fails to terminate 
them when the webapp is being stopped.  You can use a signal (CTRL-c on 
Windows) to get the JVM to shutdown cleanly.


Better then the bugs, happening with 1.x :-D


2) The ODE instructions specify the wrong name for the SQL script to initialize 
the database; it should be sql/mysql.sql, not ode_openjpa_mysql-1.3.2.sql (the 
latter appears to be some ancient name).


Can't find this location. :-( Do I have to change something there?


Greetings
Christian

---

C:\Eigene Dateien\Downloads\Diplomarbeit\Evtl. neue 
Entwicklungsumgebung\apache-

tomcat-7.0.0-ode2DB\bincatalina run
Using CATALINA_BASE:   C:\Eigene Dateien\Downloads\Diplomarbeit\Evtl. 
neue Entw

icklungsumgebung\apache-tomcat-7.0.0-ode2DB
Using CATALINA_HOME:   C:\Eigene Dateien\Downloads\Diplomarbeit\Evtl. 
neue Entw

icklungsumgebung\apache-tomcat-7.0.0-ode2DB
Using CATALINA_TMPDIR: C:\Eigene Dateien\Downloads\Diplomarbeit\Evtl. 
neue Entw

icklungsumgebung\apache-tomcat-7.0.0-ode2DB\temp
Using JRE_HOME:C:\Programme\Java\jdk1.6.0_20
Using CLASSPATH:   C:\Eigene Dateien\Downloads\Diplomarbeit\Evtl. 
neue Entw
icklungsumgebung\apache-tomcat-7.0.0-ode2DB\bin\bootstrap.jar;C:\Eigene 
Dateien\
Downloads\Diplomarbeit\Evtl. neue 
Entwicklungsumgebung\apache-tomcat-7.0.0-ode2D

B\bin\tomcat-juli.jar
12.07.2010 10:55:50 org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded APR based Apache Tomcat Native library 1.1.20.
12.07.2010 10:55:50 org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters 
[false], ra

ndom [true].
12.07.2010 10:55:54 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 5583 ms
12.07.2010 10:55:54 org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
12.07.2010 10:55:54 org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.0
12.07.2010 10:55:55 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory docs
12.07.2010 10:55:55 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory examples
12.07.2010 10:55:56 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory host-manager
12.07.2010 10:55:56 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory manager
12.07.2010 10:55:56 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory ode
DEBUG - GeronimoLog.debug(66) | Loading properties
DEBUG - GeronimoLog.debug(66) | Initializing transaction manager
DEBUG - GeronimoLog.debug(66) | Initializing transaction manager using 
org.apach

e.ode.il.EmbeddedGeronimoFactory
DEBUG - GeronimoLog.debug(66) | Creating data source.
DEBUG - GeronimoLog.debug(66) | Starting DAO.
INFO - GeronimoLog.info(79) | Using DAO Connection Factory class 
org.apache.ode.

dao.jpa.BPELDAOConnectionFactoryImpl.
DEBUG

Re: Connecting Tomcat to a database

2010-07-09 Thread Christian Bruckhoff

Hi.

Am 08.07.2010 23:36, schrieb Caldarale, Charles R:

From: Christian Bruckhoff [mailto:christian.bruckh...@gmx.de]
Subject: Re: Connecting Tomcat to a database

Sorry was in a haste, forgot much more than this. :-/
- Tomcat 7.0.0
- Java 1.6 Update 20
- Windows XP SP3
- Wanted to use DB for Apache ODE 2.0 Beta



That's how it was shown here: http://ode.apache.org/war-deployment.html


Most unfortunate that they're suggesting very, very out of date practices.  Put the 
MySQL JDBC driver in Tomcat's lib directory, not common/lib (that was changed quite 
some time ago).  Place the followingContext  element in 
webapps/ode/META-INF/context.xml:

Context reloadable=true crossContext=true
   Resource name=jdbc/ODEDB auth=Container type=javax.sql.DataSource
 maxActive=100 maxIdle=30 maxWait=1
 username=root password= driverClassName=com.mysql.jdbc.Driver
 url=jdbc:mysql://localhost:3306/ode?autoReconnect=true/
/Context


I did and modified it to my database:


?xml version=1.0 encoding=UTF-8?
Context reloadable=true crossContext=true
  Resource name=jdbc/TestDB auth=Container type=javax.sql.DataSource
maxActive=100 maxIdle=30 maxWait=1
username=test_dab password=moep 
driverClassName=com.mysql.jdbc.Driver


url=jdbc:mysql://mysqlhost.uni-koblenz.de:3306/TestDB?autoReconnect=true/
/Context


I also edited ode-axis2.properties to


ode-axis2.db.mode=EXTERNAL
ode-axis2.db.ext.dataSource=java:comp/env/jdbc/TestDB


after this, I get the this error log:


09.07.2010 08:59:04 org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded APR based Apache Tomcat Native library 1.1.20.
09.07.2010 08:59:04 org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters 
[false], ra

ndom [true].
09.07.2010 08:59:05 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1235 ms
09.07.2010 08:59:05 org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
09.07.2010 08:59:05 org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.0
09.07.2010 08:59:05 org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive ode.war
DEBUG - GeronimoLog.debug(66) | Loading properties
DEBUG - GeronimoLog.debug(66) | Initializing transaction manager
DEBUG - GeronimoLog.debug(66) | Initializing transaction manager using 
org.apach

e.ode.il.EmbeddedGeronimoFactory
DEBUG - GeronimoLog.debug(66) | Creating data source.
ERROR - GeronimoLog.error(108) | Failed to resolved external DataSource 
at java

:comp/env/jdbc/TestDB.
javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
at org.apache.naming.NamingContext.lookup(NamingContext.java:774)
at org.apache.naming.NamingContext.lookup(NamingContext.java:144)
at org.apache.naming.NamingContext.lookup(NamingContext.java:785)
at org.apache.naming.NamingContext.lookup(NamingContext.java:144)
at org.apache.naming.NamingContext.lookup(NamingContext.java:785)
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 
org.apache.ode.il.dbutil.Database.lookupInJndi(Database.java:244)
at 
org.apache.ode.il.dbutil.Database.initExternalDb(Database.java:159)
at 
org.apache.ode.il.dbutil.Database.initDataSource(Database.java:144)

at org.apache.ode.il.dbutil.Database.start(Database.java:99)
at 
org.apache.ode.axis2.ODEServer.initDataSource(ODEServer.java:218)

at org.apache.ode.axis2.ODEServer.init(ODEServer.java:157)
at org.apache.ode.axis2.ODEServer.init(ODEServer.java:116)
at 
org.apache.ode.axis2.hooks.ODEAxisServlet.init(ODEAxisServlet.java:53

)
at 
org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.

java:1164)
at 
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.

java:1118)
at 
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:10

05)
at 
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContex

t.java:4529)
at 
org.apache.catalina.core.StandardContext.startInternal(StandardContex

t.java:4800)
at 
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138)
at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase

.java:785)
at 
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:76

3)
at 
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:558

Connecting Tomcat to a database

2010-07-08 Thread Christian Bruckhoff

 Hi.

I need t connect Tomcat to a database, I want to use with ODE. Therefor, 
I changed the configuration decribed in [1] to



server.xml (inside the Host-Element):
--
Context path=/TestDB docBase=TestDB debug=5 reloadable=true 
crossContext=true

Resource name=jdbc/TestDB auth=Container type=javax.sql.DataSource7
 maxActive=100 maxIdle=30 maxWait=1
 username=test_dab password=moep 
driverClassName=com.mysql.jdbc.Driver

 url=jdbc:mysql://mysqlhost.uni-koblenz.de/TestDB/
/Context


ode-axis2.properties:
-
ode-axis2.db.mode=EXTERNAL
ode-axis2.db.ext.dataSource=java:comp/env/jdbc/TestDB

After I did this, Tomcat didn't work anymore. I even can't debug it, 
because the Tomcat window dissapears to fast.


Can you help me?

Greetz
Christian

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



Re: Connecting Tomcat to a database

2010-07-08 Thread Christian Bruckhoff

Hi.

Am 08.07.2010 20:50, schrieb Caldarale, Charles R:

From: Christian Bruckhoff [mailto:christian.bruckh...@gmx.de]
Subject: Connecting Tomcat to a database

I need t connect Tomcat to a database


What version of Tomcat?  What JVM?  What platform are you running Tomcat on?


Sorry was in a haste, forgot much more than this. :-/
- Tomcat 7.0.0
- Java 1.6 Update 20
- Windows XP SP3
- Wanted to use DB for Apache ODE 2.0 Beta




server.xml (inside theHost-Element):
--
Context path=/TestDB docBase=TestDB debug=5 reloadable=true


Extremely bad practice to putContext  elements in server.xml.  The proper location 
is in the webapp's META-INF/context.xml file.  When you do so, remove the path and docBase 
attributes, since they're not allowed when you haveContext  in a proper location.  
Also, the debug attribute hasn't been used in years, so get rid of that as well.


That's how it was shown here: http://ode.apache.org/war-deployment.html 
(that was [1] btw). What's the best solution for this?



Resource name=jdbc/TestDB auth=Container type=javax.sql.DataSource7


What's that 7 hanging on the end?


May I typed it while pasting it into the message, but in the code 
there's no 7.



After I did this, Tomcat didn't work anymore. I even can't
debug it, because the Tomcat window dissapears to fast.


Look in the Tomcat logs.  Also start Tomcat with catalina.bat run (or catalina.sh 
run, depending on the platform - which you didn't tell us); this will run Tomcat in the 
current command window.


Where can I find them? startup.bat run didn't work. Tomcat is still 
started in another window.


Greeting
Christian

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



Connecting openBD via Tomcat to Apache2

2010-05-24 Thread Christian Adelbrecht
Hi there!

I am very new to tomcat and I have a little problem
serving pages...

After the installation of tomcat, mod_jk and openbd
everything was fine. The manager worked and so on.

Now I tried to connect a Domains via the vhost setting
in apache2 to tomcat.

When I go to the domain www.testdomain.org I can
see the directoryindex of /var/www/www.testdomain.org/
but when I click on a file (doesn't matter if .jsp, .cfm or
.html) I come to a 404 tomcat page... I have the logs
down to debug but I cannot see in what directory the
tomcat is searching for the files...

And: clicking on a .css file brings the content throu
apache2... but .html is not! (as i have only the .cfm,
.jsp and that stuff given to tomcat

part of my apache2.conf (debian)

IfModule !mod_jk.c
LoadModule jk_module /usr/lib/apache2/modules/mod_jk.so
/IfModule

IfModule mod_jk.c
JkMount /*.cfm ajp13
JkMount /*.cfc ajp13
JkMount /*.do ajp13
JkMount /*.jsp ajp13
JkMount /*.cfchart ajp13
JkMount /*.cfres ajp13
JkMount /*.cfm/* ajp13
JkMount /*.cfml/* ajp13
JkMountCopy all
JkLogLevel info
JkLogFile /var/log/apache2/mod_jk/mod_jk.log
/IfModule

an my server.xml

  Host name=www.testdomain.org
 appBase=webapps
unpackWARs=true
autoDeploy=true
xmlValidation=false
xmlNamespaceAware=false
Context path=
docBase=/var/www/www.testdomain.org/htdocs/
allowLinking=true
debug=9
 reloadable=true /
/Host

I really need help!

Thanks a lot

Regards
Christian


Re: Connecting openBD via Tomcat to Apache2

2010-05-24 Thread Christian Adelbrecht
hi!

What are the exact OS


Linux 2.6.18-6-k7


 , JVM,


1.6.0_16-b01


 Tomcat,


Apache Tomcat/6.0.20


 HTTPD


Apache 2.2.3

and mod_jk versions


mod_jk 1.2.27


 ?


 p





Re: Connecting openBD via Tomcat to Apache2

2010-05-24 Thread Christian Adelbrecht
2010/5/24 Pid p...@pidster.com

 On 24/05/2010 16:53, Christian Adelbrecht wrote:
  hi!
 
  What are the exact OS
 
  Linux 2.6.18-6-k7
 
  , JVM,
 
  1.6.0_16-b01
 
  Tomcat,
 
  Apache Tomcat/6.0.20
 
  HTTPD
 
  Apache 2.2.3
 
  and mod_jk versions
 
  mod_jk 1.2.27

 Note: there are more recent versions of all of these.  You should
 particularly consider upgrading Tomcat and HTTPD.


Apache 2.2.3 etch11 is the latest etch version
as this tomcat was the version that came with the openbd-installer I want
to try it with this one. (support for Dummies)



 I will assume for now, that you have a sound reason for deploying HTTPD
 and Tomcat at the same time, rather than just letting Tomcat do all the
 work.  If you'd like to know more, ask.


In some newsgroups I read, that tomcat is slower than apache, so thats
why I wanted them both. Btw I am using a servermanager-tool, that cannot
handle tomcat virtual hosts...




 IfModule !mod_jk.c
 LoadModule jk_module /usr/lib/apache2/modules/mod_jk.so
 /IfModule

 IfModule mod_jk.c
 JkMount /*.cfm ajp13
 JkMount /*.cfc ajp13
 JkMount /*.do ajp13
 JkMount /*.jsp ajp13
 JkMount /*.cfchart ajp13
 JkMount /*.cfres ajp13
 JkMount /*.cfm/* ajp13
 JkMount /*.cfml/* ajp13
 JkMountCopy all
 JkLogLevel info
 JkLogFile /var/log/apache2/mod_jk/mod_jk.log
 /IfModule

  and my server.xml

  Host name=www.testdomain.org
  appBase=webapps
 unpackWARs=true
 autoDeploy=true
 xmlValidation=false
 xmlNamespaceAware=false
 Context path=
 docBase=/var/www/www.testdomain.org/htdocs/
 allowLinking=true
 debug=9
  reloadable=true /
 /Host


my new server.xml

 Host name=www.testdomain.org
 appBase=webapps
unpackWARs=true
autoDeploy=true
xmlValidation=false
 xmlNamespaceAware=false
/Host

and my new context.xml.default in the tomcat conf hostname folder:

Context 
path=/var/www/www.testdomain.org/webapps/http://www.testdomain.org/htdocs/
ROOT/
docBase=/var/www/www.testdomain.org/htdocs/
 allowLinking=true
 reloadable=true /

Better?




 The above is very bad practice and likely to lead to you exposing data
 that you shouldn't.  JSPs and other content should not be mixed in the
 same directory.  Context should not be defined in server.xml.  The debug
  attribute isn't used anymore.


 If you have to use both HTTPD and Tomcat, construct a directory
 structure like this:

 All static content should go here:
  /var/www/www.testdomain.org/htdocs/

 All java webapps should go here:
  /var/www/www.testdomain.org/webapps/

 Servlet Spec webapps and other java applications are deployed, one each,
 in a directory inside the above.  e.g.

  /var/www/www.testdomain.org/webapps/ROOT
  /var/www/www.testdomain.org/webapps/myapp
  /var/www/www.testdomain.org/webapps/another_app

 ROOT is the special name for the default application, which is what you
 were attempting to do with the path= attribute.

 as done above?!


 p



Thanks a lot for your support!

Regards
Christian

-
I search the web using www.ecosia.org


Repost: mod_proxy_ajp configuration

2010-05-06 Thread Christian Roche
Hi,

can somebody help me with this? Should I look somewhere else (any
dedicated forum out there)? Thanks!

I have a problem with configuring mod_proxy_ajp to access Tomcat5
through Apache2. My setup:

CentOS release 5.4 (Final)
httpd-2.2.3-31.el5.centos.4
tomcat5-5.5.23-0jpp.7.el5_3.2

I have in /etc/httpd/conf.d/proxy_ajp.conf:

Location /tomcat/
 ProxyPass             ajp://localhost:8009/
 ProxyPassReverse      ajp://localhost:8009/
/Location

i.e., I want all my Tomcat webapps accessible behind a /tomcat location.


Now if I try

 cut - cut --
wget http://copper/tomcat/admin
--2010-05-04 15:11:30--  http://copper/tomcat/admin Resolving
copper... 10.156.31.49 Connecting to copper|10.156.31.49|:80...
connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: http://copper/admin/ [following]
--2010-05-04 15:11:30--  http://copper/admin/ Connecting to
copper|10.156.31.49|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2010-05-04 15:11:30 ERROR 404: Not Found.
 cut - cut --

I get a 404 because the URL in incorrectly redirected.
If I try to access directly

 cut - cut --
wget http://copper/tomcat/admin/
--2010-05-04 15:14:15--  http://copper/tomcat/admin/ Resolving
copper... 10.156.31.49 Connecting to copper|10.156.31.49|:80...
connected.
HTTP request sent, awaiting response... 200 OK
Length: 2504 (2.4K) [text/html]
Saving to: `index.html'
2010-05-04 15:14:15 (13.4 MB/s) - `index.html' saved [2504/2504]
 cut - cut --

I receive something, however it doesn't work since the answer contains

head
 base href=http://copper/admin/login.jsp;
/head

which is wrong.

To alleviate this I tried to modify the AJP connector in web.xml:

 Connector port=8009
       proxyName=copper/tomcat proxyPort=80
       enableLookups=false redirectPort=8443 protocol=AJP/1.3 /

It seems to work better however I receive HTTP Status 408, he time
allowed for the login process has been exceeded which seems to
indicate the cookie is not transmitted correctly. This could be
related to the Attempt to fake the path that is shown by wget:

 cut - cut --
4MAL00298:~/testwget -d http://copper/tomcat/admin/ DEBUG output
created by Wget 1.11.4 on cygwin.

--2010-05-04 15:19:16--  http://copper/tomcat/admin/ Resolving
copper... 10.156.31.49 Caching copper = 10.156.31.49 Connecting to
copper|10.156.31.49|:80... connected.
Created socket 3.
Releasing 0x006d91f0 (new refcount 1).

---request begin---
GET /tomcat/admin/ HTTP/1.0
User-Agent: Wget/1.11.4
Accept: */*
Host: copper
Connection: Keep-Alive

---request end---
HTTP request sent, awaiting response...
---response begin---
HTTP/1.1 200 OK
Date: Tue, 04 May 2010 14:19:16 GMT
Pragma: No-cache
Cache-Control: no-cache
Expires: Thu, 01 Jan 1970 00:00:00 WET
Set-Cookie: JSESSIONID=80BF7B0E2875A3CFD025DA77EF051F71; Path=/admin
Content-Type: text/html;charset=utf-8
Content-Length: 2467
Connection: close

---response end---
200 OK
Attempt to fake the path: /admin, /tomcat/admin/
Length: 2467 (2.4K) [text/html]
Saving to: `index.html.2'
Closed fd 3
2010-05-04 15:19:16 (13.8 MB/s) - `index.html.2' saved [2467/2467]
 cut - cut --

So what gives? Is this all because I want my URL to be slighlty
rewritten? Does nobody ever do that?

Thanks for your help,
Chris

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



mod_proxy_ajp configuration

2010-05-04 Thread Roche, Christian (EXT-Other - MA/Rabat)

Hi,

I have a problem with configuring mod_proxy_ajp to access Tomcat5 through 
Apache2. My setup:

CentOS release 5.4 (Final)
httpd-2.2.3-31.el5.centos.4
tomcat5-5.5.23-0jpp.7.el5_3.2

I have in /etc/httpd/conf.d/proxy_ajp.conf:

Location /tomcat/
  ProxyPass ajp://localhost:8009/
  ProxyPassReverse  ajp://localhost:8009/
/Location

i.e., I want all my Tomcat webapps accessible behind a /tomcat location.


Now if I try

 cut - cut --
wget http://copper/tomcat/admin
--2010-05-04 15:11:30--  http://copper/tomcat/admin
Resolving copper... 10.156.31.49
Connecting to copper|10.156.31.49|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: http://copper/admin/ [following]
--2010-05-04 15:11:30--  http://copper/admin/
Connecting to copper|10.156.31.49|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2010-05-04 15:11:30 ERROR 404: Not Found.
 cut - cut --

I get a 404 because the URL in incorrectly redirected.
If I try to access directly 

 cut - cut --
wget http://copper/tomcat/admin/
--2010-05-04 15:14:15--  http://copper/tomcat/admin/
Resolving copper... 10.156.31.49
Connecting to copper|10.156.31.49|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2504 (2.4K) [text/html]
Saving to: `index.html'
2010-05-04 15:14:15 (13.4 MB/s) - `index.html' saved [2504/2504]
 cut - cut --

I receive something, however it doesn't work since the answer contains

head
  base href=http://copper/admin/login.jsp;
/head

which is wrong.

To alleviate this I tried to modify the AJP connector in web.xml:

  Connector port=8009
proxyName=copper/tomcat proxyPort=80
enableLookups=false redirectPort=8443 protocol=AJP/1.3 /

It seems to work better however I receive HTTP Status 408, he time allowed for 
the login process has been exceeded which seems to indicate the cookie is not 
transmitted correctly. This could be related to the Attempt to fake the path 
that is shown by wget:

 cut - cut --
4MAL00298:~/testwget -d http://copper/tomcat/admin/
DEBUG output created by Wget 1.11.4 on cygwin.

--2010-05-04 15:19:16--  http://copper/tomcat/admin/
Resolving copper... 10.156.31.49
Caching copper = 10.156.31.49
Connecting to copper|10.156.31.49|:80... connected.
Created socket 3.
Releasing 0x006d91f0 (new refcount 1).

---request begin---
GET /tomcat/admin/ HTTP/1.0
User-Agent: Wget/1.11.4
Accept: */*
Host: copper
Connection: Keep-Alive

---request end---
HTTP request sent, awaiting response...
---response begin---
HTTP/1.1 200 OK
Date: Tue, 04 May 2010 14:19:16 GMT
Pragma: No-cache
Cache-Control: no-cache
Expires: Thu, 01 Jan 1970 00:00:00 WET
Set-Cookie: JSESSIONID=80BF7B0E2875A3CFD025DA77EF051F71; Path=/admin
Content-Type: text/html;charset=utf-8
Content-Length: 2467
Connection: close

---response end---
200 OK
Attempt to fake the path: /admin, /tomcat/admin/
Length: 2467 (2.4K) [text/html]
Saving to: `index.html.2'
Closed fd 3
2010-05-04 15:19:16 (13.8 MB/s) - `index.html.2' saved [2467/2467]
 cut - cut --

So what gives? Is this all because I want my URL to be slighlty rewritten? Does 
nobody ever do that?

Thanks for your help,
Chris


*** SPAM *** Tomcat NIO : CometProcessor

2010-03-31 Thread Christian Pfeiffer

Hello,

I just tried to use the tomcat nio and wondered if it is possible to use 
client and server pushes through the same socket connection? Or if I 
have to establish to connections for that purpose. In the end the client 
should be able to receive notification from server (server push) and 
also be able to request certain things. As I understood the Low Latency 
HTTP document it should be possible. Has anyone any advice for me, 
currently the connection gets closed after the second request from 
client with error CLIENT_DISCONNECTED.


Thanks in advance
Chris.

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



Re: Tomcat NIO : CometProcessor

2010-03-31 Thread Christian Pfeiffer

Hey Filip, thanks for your swift response. Wireshark tells me:

//Client//
POST /url/servlet HTTP/1.1
Host: localhost:8080
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.13) 
Gecko/2009080315 Ubuntu/9.04 (jaunty) Firefox/3.0.13

Transfer-Encoding: chunked

145
some xml/some xml

//Server//
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=F9A0B9BAB695EDB6C51253A24D8989D9; 
Path=/streamcam_gwt

Transfer-Encoding: chunked
Date: Mon, 29 Mar 2010 15:44:25 GMT

9a
some answer/some answer

//Client//
8E
second xml/second xml


beside the hex values which are not set properly, cause I changed the 
xml for the sake of simplicity it should be fine right? Or do I miss 
something? BTW the last message(second xml) isnt examined by my servlet, 
there I already receive event Client_Disconnected instead of a read I 
expected. Let me know if you need more information.


Thanks in advance
Chris.


Filip Hanik - Dev Lists schrieb:
hi Chris, if the connection is closed, most likely there is some sort 
of data error somewhere.

Record your transaction with Wireshark, and we can examine it.

Low latency http, meaning sending traffic back and forth should be 
possible within the body of the request


Filip

On 03/31/2010 07:01 AM, Christian Pfeiffer wrote:

Hello,

I just tried to use the tomcat nio and wondered if it is possible to 
use client and server pushes through the same socket connection? Or 
if I have to establish to connections for that purpose. In the end 
the client should be able to receive notification from server (server 
push) and also be able to request certain things. As I understood the 
Low Latency HTTP document it should be possible. Has anyone any 
advice for me, currently the connection gets closed after the second 
request from client with error CLIENT_DISCONNECTED.


Thanks in advance
Chris.

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





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



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



Re: Tomcat NIO : CometProcessor

2010-03-31 Thread Christian Pfeiffer
  
http-alt  46356 [ACK] Seq=247 Ack=179 Win=32768 Len=0 TSV=5914100 
TSER=5914100


Frame 14 (66 bytes on wire, 66 bytes captured)
Ethernet II, Src: 00:00:00_00:00:00 (00:00:00:00:00:00), Dst: 
00:00:00_00:00:00 (00:00:00:00:00:00)

Internet Protocol, Src: 127.0.0.1 (127.0.0.1), Dst: 127.0.0.1 (127.0.0.1)
Transmission Control Protocol, Src Port: http-alt (8080), Dst Port: 
46356 (46356), Seq: 247, Ack: 179, Len: 0


  00 00 00 00 00 00 00 00 00 00 00 00 08 00 45 00   ..E.
0010  00 34 00 00 40 00 40 06 3c c2 7f 00 00 01 7f 00   @.@
0020  00 01 1f 90 b5 14 34 0e e9 fa 33 e8 88 5e 80 10   ..4...3..^..
0030  02 00 4b 2a 00 00 01 01 08 0a 00 5a 3d f4 00 5a   ..K*...Z=..Z
0040  3d f4 =.


Thanks for patience
Chris.



Filip Hanik - Dev Lists schrieb:
I would need the raw data, not copy paste, I can't make anything out 
of that. Or if you have, a simple test case.


Filip

On 03/31/2010 07:57 AM, Christian Pfeiffer wrote:

Hey Filip, thanks for your swift response. Wireshark tells me:

//Client//
POST /url/servlet HTTP/1.1
Host: localhost:8080
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.13) 
Gecko/2009080315 Ubuntu/9.04 (jaunty) Firefox/3.0.13

Transfer-Encoding: chunked

145
some xml/some xml

//Server//
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=F9A0B9BAB695EDB6C51253A24D8989D9; 
Path=/streamcam_gwt

Transfer-Encoding: chunked
Date: Mon, 29 Mar 2010 15:44:25 GMT

9a
some answer/some answer

//Client//
8E
second xml/second xml


beside the hex values which are not set properly, cause I changed the 
xml for the sake of simplicity it should be fine right? Or do I miss 
something? BTW the last message(second xml) isnt examined by my 
servlet, there I already receive event Client_Disconnected instead of 
a read I expected. Let me know if you need more information.


Thanks in advance
Chris.


Filip Hanik - Dev Lists schrieb:
hi Chris, if the connection is closed, most likely there is some 
sort of data error somewhere.

Record your transaction with Wireshark, and we can examine it.

Low latency http, meaning sending traffic back and forth should be 
possible within the body of the request


Filip

On 03/31/2010 07:01 AM, Christian Pfeiffer wrote:

Hello,

I just tried to use the tomcat nio and wondered if it is possible 
to use client and server pushes through the same socket connection? 
Or if I have to establish to connections for that purpose. In the 
end the client should be able to receive notification from server 
(server push) and also be able to request certain things. As I 
understood the Low Latency HTTP document it should be possible. 
Has anyone any advice for me, currently the connection gets closed 
after the second request from client with error CLIENT_DISCONNECTED.


Thanks in advance
Chris.

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





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



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





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



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



Inactive sessions won't be removed

2009-11-04 Thread Christian Stöber

Hello list,

I've the problem that some (yes, really some) HttpSessions won't be 
removed. Here are some details from the manager app of two these 
sessions. Please consider the TTL an the Inactive Time value. I've just 
take a copy of the manager output!


Details for Session A2B3FF68F366B9533CFE66DBF2903DDA.www1
Session IdA2B3FF68F366B9533CFE66DBF2903DDA.www1
Guessed Locale
Guessed User
Creation Time 2009-11-04 09:20:50
Last Accessed Time2009-11-04 09:23:03
Session Max Inactive Interval 00:35:00
Used Time 00:02:13
Inactive Time *00:45:43*
TTL   *00:0-10:0-43*

Details for Session 927B892EE1B94FB4A551B96F84E0BB62.www1
Session Id927B892EE1B94FB4A551B96F84E0BB62.www1
Guessed Locale
Guessed User
Creation Time 2009-11-04 09:27:21
Last Accessed Time2009-11-04 09:27:30
Session Max Inactive Interval 00:35:00
Used Time 00:00:08
Inactive Time *00:41:17*
TTL   *00:0-6:0-17*

Why doesn't tomcat remove these sessions? How often does tomcat check 
when to remove an old session?


As said above only some sessions are affected.

Thanks in advance.

Christian



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



Re: Memory behavior: Tomcat versus Jetty

2009-10-02 Thread Christian Stöber

Tim, thanks for the hint with the BodyContent.
Mark, thanks for your hint to take heap dump.

On this morning the two Tomcat instances were using 200 MB more memory 
than the Jetty instances do. So I thought it's a good time to take a heap 
dump.


In the heap histogram in jhat I saw a big difference between the 
BodyContentImpl (class org.apache.jasper.runtime.BodyContentImpl) counts:


Jetty: 43
Tomcat: 768

Suspicious!

I've take a look at this code and the first thing I've seen was, that 
since Jasper 2.1 BodyContents won't reset its buffer by default. (see 
BodyContentImpl.clear()). The second thing - what's responsible - is the 
change at org.apache.jasper.runtime.JspFactoryImpl. JspFactoryImpl in 
Jasper 2.1 now caches the PageContext-objects per thread. A 
PageContext-object have an array of BodyContents and so the memory the 
buffers of these BodyContents reserved will newer be freed until the 
thread will be stopped and garbage collected.


Until today I were using the default connectors with the maxThreads 
parameter, which newer shutsdown a thread. So the BodyContent's buffer 
were growing and growing, because we have some tags which generates much 
output, and would never be cleared.


Now I am using a separate thread pool (executor), which cleans up the 
pool when a thread is idle. And now the memory behavior is almost equal 
to Jetty.  


Christian


Tim Funk schrieb:
If you use JSP tags where the JSP body does not directly stream but 
needs buffered for the tag to finish processing it (using BodyContent) 
- then tomcat will allocate and reuse these. If you are creating pages 
with large body contents - this can take *A LOT* of memory. The 
rational is to reuse these instead of letting them go to the GC. But 
there is a way to not have tomcat reuse these.


http://tomcat.apache.org/tomcat-5.5-doc/jspapi/javax/servlet/jsp/tagext/BodyContent.html 



-Tim

Christian Stöber wrote:

Hello list,

we are about to migrate our webserver cluster from Jetty 5.1.14 to 
Tomcat 6.0.20. Currently there are four servers in our cluster with 
simple load balancing and no session clustering.


At the moment we are testing Tomcat on 2 nodes of our cluster (also 
no session clustering yet). 2 remains with Jetty. Same WAR file an 
the same environment. Our first test ends in an OutOfMemoryError 
after two days. The java vm of the Tomcat servers has the same memory 
parameters as the server with the Jetty: -Xmx512m. And no other 
special GC parameters.


Apperently the Tomcat needs more memory than Jetty.

So we are trying to give Tomcat more memory: -Xmx768m. After two days 
the Tomcat is still running fine.


Obviously Tomcat needs just a little bit more memory than Jetty. 
After these two days we can state the following memory behavior.


Node   Mem used   Mem reserved
1 TC   400m   530m
2 TC   350m   495m
3 J230m   350m
4 J290m   400m

Averagely Tomcat is using round about 110m more memory than Jetty. 
But why?


I have seen that the Tomcat DefaultServlet may cache content up to 
10m per default. But that are only 10m.

Are there some other things Tomcat may cache and Jetty does not?

Do you have any experiences?

Thanks in advance
Christian


-
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



Memory behavior: Tomcat versus Jetty

2009-09-30 Thread Christian Stöber

Hello list,

we are about to migrate our webserver cluster from Jetty 5.1.14 to 
Tomcat 6.0.20. Currently there are four servers in our cluster with 
simple load balancing and no session clustering.


At the moment we are testing Tomcat on 2 nodes of our cluster (also no 
session clustering yet). 2 remains with Jetty. Same WAR file an the same 
environment. Our first test ends in an OutOfMemoryError after two days. 
The java vm of the Tomcat servers has the same memory parameters as the 
server with the Jetty: -Xmx512m. And no other special GC parameters.


Apperently the Tomcat needs more memory than Jetty.

So we are trying to give Tomcat more memory: -Xmx768m. After two days 
the Tomcat is still running fine.


Obviously Tomcat needs just a little bit more memory than Jetty. After 
these two days we can state the following memory behavior.


Node   Mem used   Mem reserved
1 TC   400m   530m
2 TC   350m   495m
3 J230m   350m
4 J290m   400m

Averagely Tomcat is using round about 110m more memory than Jetty. But why?

I have seen that the Tomcat DefaultServlet may cache content up to 10m 
per default. But that are only 10m.

Are there some other things Tomcat may cache and Jetty does not?

Do you have any experiences?

Thanks in advance
Christian


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



Tomcat 5.5 and Windows Vista x64

2009-02-23 Thread Christian Döbel
Hello together,

I'm trying to use Tomcat 5.5 together with Windows Vista x64. Firstly I 
downloaded and installed Java JDK 1.5.0 and JRE 1.4.2. After doing that I got 
Apache Tomcat 5.5 from the server and installed this as well. Tomcat Monitor is 
starting but localhost:8080 was not found (in server.xml this localhost is 
named). On my x32 system (Windows Vista) everything is running fine. Do you 
know what I have to change? 

After that I tried the x64 versions of tomcat5.exe and tomcat5w.exe. These are 
not running at all. Do you know why? 

Thanks

Christian
-- 
Pt! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: 
http://www.gmx.net/de/go/multimessenger01

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



Re: Tomcat Domain for redirects

2009-02-07 Thread Christian Decker

This seems to have done the trick, the redirects now finally work properly ^^
It would be nice for it to autodiscover the domain a request came from, but
that's fine by me because it's just a test machine, and I'll have my
sysadmin bothering with the deployment later ^^

Konstantin Kolinko wrote:
 
 2009/2/6 Christian Decker decker.christ...@gmail.com:

 Hi all,

 I'm not that good at configuring Tomcat so I thought I'd ask here. My
 problem is that I have a server that is running Tomcat 5.5 and an
 Apache server that runs on port 80 and uses mod_jk to redirect all
 incoming requests to the tomcat server.

 So far, so good. The problem is that I want to access the server from
 outside my local network, so instead of accessing http://server1/app/
 I now have http://server1.example.com/app/ which automatically
 redirects to an index page, but on the wrong address (http://server1/
 app/welcome instead of http://server1.example.com/app/welcome) which
 is kind of annoying.

 As this happens in many different places I assume that the tomcat
 server somehow believes that he is server1 instead of
 server1.example.com.

 Any directions on where to look?

 Regards,
 Chris
 
 Read Apache HTTPD docs on how it determines its server name. I guess
 it should have been the ServerName directive,
 http://httpd.apache.org/docs/2.2/mod/core.html#servername
 
 If I remember correctly, mod_jk passes that information to Tomcat, but if
 that
 does not work, it can be overwritten in Connector element by setting
 proxyName and proxyPort attributes,
 http://tomcat.apache.org/tomcat-6.0-doc/config/ajp.html
 
 Best regards,
 Konstantin Kolinko
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 


-
Christian Decker
http://blog.snyke.net
-- 
View this message in context: 
http://www.nabble.com/Tomcat-Domain-for-redirects-tp21874907p21889858.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 Domain for redirects

2009-02-07 Thread Christian Decker

Problem is that I also host some PHP and RubyOnRails apps on the same server
and I'd like to keep them running ^^

Caldarale, Charles R wrote:
 
 From: Christian Decker [mailto:decker.christ...@gmail.com]
 Subject: Tomcat Domain for redirects

 I have a server that is running Tomcat 5.5 and an
 Apache server that runs on port 80 and uses mod_jk
 to redirect all incoming requests to the tomcat server.
 
 So let's start at the beginning.  Why do you have httpd in the picture at
 all, if everything's being sent to Tomcat?  Simplify your life.
 
  - 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
 
 
 


-
Christian Decker
http://blog.snyke.net
-- 
View this message in context: 
http://www.nabble.com/Tomcat-Domain-for-redirects-tp21874907p21889861.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



Tomcat Domain for redirects

2009-02-06 Thread Christian Decker

Hi all,

I'm not that good at configuring Tomcat so I thought I'd ask here. My
problem is that I have a server that is running Tomcat 5.5 and an
Apache server that runs on port 80 and uses mod_jk to redirect all
incoming requests to the tomcat server.

So far, so good. The problem is that I want to access the server from
outside my local network, so instead of accessing http://server1/app/
I now have http://server1.example.com/app/ which automatically
redirects to an index page, but on the wrong address (http://server1/
app/welcome instead of http://server1.example.com/app/welcome) which
is kind of annoying.

As this happens in many different places I assume that the tomcat
server somehow believes that he is server1 instead of
server1.example.com.

Any directions on where to look?

Regards,
Chris
-- 
http://blog.snyke.net 

-
Christian Decker
http://blog.snyke.net
-- 
View this message in context: 
http://www.nabble.com/Tomcat-Domain-for-redirects-tp21874907p21874907.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: Exception in thread

2008-11-27 Thread Christian Poecher



Pieter Temmerman-2 wrote:
 
 The only thing that I think could be related to the problem is listed
 below.
 
 Exception in thread TP-Processor15 Exception in thread
 Cluster-MembershipSender Exception in thread
 Cluster-MembershipReceiver 
 26 nov 2008 17:12:29,010 : [DEBUG]
 es.ja.sae.ail.mediadoresEquipos.dao.hibernate.AccesoWebDAO () - buscando
 el elemento AccesoWeb con propiedad: acceso, valor:
 v6uSMdkSmTWkdssPyk7WL7hv2iKNoOz6
 Exception in thread TP-Processor2 Exception in thread
 ContainerBackgroundProcessor[StandardEngine[Catalina]] 
 26 nov 2008 17:13:34,138 : [DEBUG]
 es.ja.sae.ail.mediadoresEquipos.dao.hibernate.AccesoWebDAO () - buscando
 el elemento AccesoWeb con propiedad: acceso, valor:
 4SpzXHGwTTgXyzIHVxQWiFVPP0GbFlcm
 Exception in thread TP-Processor5 Exception in thread
 http-8080-Processor22 Exception in thread http-8080-Processor24
 

Hi Pieter,

I think you need to give us at least the name or a stacktrace of that
exception that was thrown. You might have to change the Logging settings for
that.

Cheers, Chris
-- 
View this message in context: 
http://www.nabble.com/Exception-in-thread-tp20717604p20718395.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Exception in thread

2008-11-27 Thread Christian Poecher



Pieter Temmerman-2 wrote:
 
 Hi Chris,
 
 That's what I was afraid of.
 The only thing listed in the logs was what I posted.
 No stacktrace, nor name of the exception.
 I'll try to bump up the logging level, and hope this error occurs again
 in a reasonable amount of time (it's been working for the whole day
 until now)
 
 

If everything fails, you can also restart Tomcat in Debug Mode. As soon as
the application becomes unresponsive you can attach a Debugger, pause
execution and look into the method execution stack of the threads. Just be
aware that the debug mode is eating your performance quite well...

HTH,
Chris
-- 
View this message in context: 
http://www.nabble.com/Exception-in-thread-tp20717604p20721590.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to transfer session to another browser

2008-08-19 Thread Christian Poecher



kohanm wrote:
 
 Hi,
 I have Tomcat 5.5 installed and a Java web applicaion is running.
 How could*  *I *se*t up Tomcat that if I copy and past the URL of the web
 application to anoather browser the session could be tranferred to the new
 browser, in other words:
  Session can be transferred to another browser by copying and pasting the
 URL.
 

Try setting cookies to false. The documentation for that feature is here:
http://tomcat.apache.org/tomcat-5.5-doc/config/context.html

Regards,
Chris
-- 
View this message in context: 
http://www.nabble.com/How-to-transfer-session-to-another-browser-tp19044768p19045406.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Servlet Caching

2008-08-12 Thread Christian Poecher

Hi there,

I am currently investigating a problem with our web app (Tomcat 5.5.23, Java
1.5, JSF 1.2) where the servlet cache does not always get updated when a JSF
include is changed. This happend after changing an included JSF. The
JSF-snippet that includes is:
html
[EMAIL PROTECTED] file=/pages/inc/head.inc%
f:view
[...]
body
[EMAIL PROTECTED] file=/pages/inc/bbs_header.inc% 
h:form
[EMAIL PROTECTED] file=/pages/inc/menu.inc%
[...]

The JSPServlet config in web.xml:
servlet
servlet-namejsp/servlet-name
servlet-classorg.apache.jasper.servlet.JspServlet/servlet-class
init-param
param-namefork/param-name
param-valuefalse/param-value
/init-param
init-param
param-namexpoweredBy/param-name
param-valuefalse/param-value
/init-param
load-on-startup3/load-on-startup
/servlet

Adding development=false and checkInterval=30 to the parameter list did not
change anything.

Am I missing something or is there a limitation to the JSP Compiler with
checking the dependencies? Or is the problem based upon that [EMAIL PROTECTED] 
%
are not the way to include subviews in JSF?

If you want me to provide more infos, please tell me. 

Thanks in advance for enlighten me,
Chris
-- 
View this message in context: 
http://www.nabble.com/Servlet-Caching-tp18942690p18942690.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [programmazione] Servlet Caching

2008-08-12 Thread Christian Poecher

Thanks a bunch Luca. I inherited quite some messy code before the old
developer said goodbye. So far the big architectural issues in the Data
Access and Logic layers have been cleaned up, but the problems in the view
still exist. I will live with this issue for now and refactor the view later
to use JSF subviews instead of static includes.

Best regards,
Chris


Luca Cicale wrote:
 
 Hi,
 [EMAIL PROTECTED] is a static include, that is at compile time the compiled
 code
 of the INCLUDED jsp is simply copied.
 But if you change a included jsp/servlet after the INCLUDING page has been
 compiled, well, nothing happens in the INCLUDING.
 You have to touch (modify something) the including jsp to make it
 recompiled
 with the included modified code.
 An other option is to dinamically include the page using:
 
 jsp:include
 
 but it is really a different behaviour. Every time the including is called
 it dinamically  recall the included one.
 
 

-- 
View this message in context: 
http://www.nabble.com/Servlet-Caching-tp18942690p18947740.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: is it possible more than 1 tomcat in single system?

2008-07-31 Thread Christian Andersson



Peter Crowther skrev:

From: Edi [mailto:[EMAIL PROTECTED]
consider, i had 4 java application running in one tomcat, if
one application
crashes, all the other 3 application gets crashes. right?



Correct.  But it's not always that simple :-).

It's your choice how you want to split up your applications between different 
containers (Tomcats in this case) to trade off memory use vs reliability.  You 
might get a *less* reliable system by splitting up the applications into 
separate Tomcat instances, though.  Each Tomcat runs in its own JVM, and each 
is allocated a maximum memory size.  If you are not careful when tuning the 
system, you might find that one application in one Tomcat/JVM runs out of 
memory although there is plenty of spare memory in the system.  If you put them 
all into one Tomcat/JVM, the applications all use the same (larger) memory pool.
  
And what happens if you get one rough application stealing all the 
memory? probably all your applications will stop functioning..


For me it is always better to have 1 application crash, then 1

it is also easier to see which application is the guilty one if only 
that application crashes..




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: is it possible more than 1 tomcat in single system?

2008-07-31 Thread Christian Andersson
search your tomcats server.xml file for 8005 and you will se that this 
port has been declared at the very top

Server port=8005 shutdown=SHUTDOWN

this is the so called shutdown port, you just have to change this in 
your second tomcat to for example 8006.




Edi skrev:

I have installed JDK1.5 in my local system,

And 1 tomcat5.0 installed in c drive. during the installation, i have given
port 8080
And 1 tomcat5.0 installed in e drive. during the installation, i have given
port 8081

during both tomcat installation, i have specified c:\program
files\java\jdk1.5 path.

First i have started c: tomcat startup.bat, it is started.

after i tried d: tomcat start.bat, it is not started.

But I got exception like

StandardServer.await: create[8005]: java.net.BindException: Address already
in use: JVM_Bind

For Both tomcat's installation, i have given the same JDK1.0 path only. Is
there any need to install one more JDK1.5 (each tomcat needs, separate
jdk1.5 or not ?)

Please advise




Peter Crowther wrote:
  

From: Christian Andersson [mailto:[EMAIL PROTECTED]
Peter Crowther skrev:
  

If you
are not careful when tuning the system, you might find that
one application in one Tomcat/JVM runs out of memory although
there is plenty of spare memory in the system.  If you put
them all into one Tomcat/JVM, the applications all use the
same (larger) memory pool.



And what happens if you get one rough application stealing all the
memory? probably all your applications will stop functioning..
  

Yes.  Certainly memory leaks are much more troublesome in a single JVM.



For me it is always better to have 1 application crash, then 1
  

Given a high enough hardware budget that I can spend on RAM, I agree
entirely :-).  Not all of us have that luxury.  I'm sure there are still
finance directors out there with Gates' 640k is enough for anyone quote
framed on their wall, right by the stone that you have to get blood out of
before you get any budget!



it is also easier to see which application is the guilty one if only
that application crashes..
  

Much easier!

- Peter

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






  


Problem add domain

2008-07-23 Thread Christian Bianchini
Hi,
I have create the new domain on tomcat admin and I've create the context
/manager but after login I receiving this error:

type Exception report

message

description The server encountered an internal error () that prevented it
from fulfilling this request.

exception

javax.servlet.ServletException: Error allocating a servlet instance
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java[image:
:8]74)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java[image:
:8]1)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
java.lang.Thread.run(Thread.java:595)

root cause

Screenshot:
http://foto.freehostz.info/foto.php?code=1b79700537f14e9d48d0823ba03e1610
-- 
---
Admin TicinoCinema.ch
[EMAIL PROTECTED]
La tua risorsa ticinese sul cinema

Admin Euservers.net
[EMAIL PROTECTED]
Hosting web


Re: Problem add domain

2008-07-23 Thread Christian Bianchini
The version of tomcat is: 5.5.26
The server have install debian etch
The tomcat is install of source not package debian.

On Wed, Jul 23, 2008 at 2:11 PM, David Smith [EMAIL PROTECTED] wrote:

 Could you please post tomcat version, OS, root cause (you cropped the stack
 trace too early), any other relevant details.

 --David

 Christian Bianchini wrote:

 Hi,
 I have create the new domain on tomcat admin and I've create the context
 /manager but after login I receiving this error:

 type Exception report

 message

 description The server encountered an internal error () that prevented it
 from fulfilling this request.

 exception

 javax.servlet.ServletException: Error allocating a servlet instance

 org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)

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

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

 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java[image:
 :8]74)

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

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

 org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java[image:
 :8]1)

 org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
 java.lang.Thread.run(Thread.java:595)

 root cause

 Screenshot:
 http://foto.freehostz.info/foto.php?code=1b79700537f14e9d48d0823ba03e1610




 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-- 
---
Admin TicinoCinema.ch
[EMAIL PROTECTED]
La tua risorsa ticinese sul cinema

Admin Euservers.net
[EMAIL PROTECTED]
Hosting web


Re: Problem add domain

2008-07-23 Thread Christian Bianchini
*type* Exception report

*message*

*description* *The server encountered an internal error () that prevented it
from fulfilling this request.*

*exception*

javax.servlet.ServletException: Wrapper cannot find servlet class
org.apache.catalina.manager.HTMLManagerServlet or a class it depends
on

org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)

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

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

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

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

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

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

org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
java.lang.Thread.run(Thread.java:595)

*root cause*

java.lang.ClassNotFoundException: org.apache.catalina.manager.HTMLManagerServlet
java.net.URLClassLoader$1.run(URLClassLoader.java:200)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(URLClassLoader.java:188)
java.lang.ClassLoader.loadClass(ClassLoader.java:306)
java.lang.ClassLoader.loadClass(ClassLoader.java:251)

org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)

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

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

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

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

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

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

org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
java.lang.Thread.run(Thread.java:595)

*note* *The full stack trace of the root cause is available in the Apache
Tomcat/5.5.26 logs.*


On Wed, Jul 23, 2008 at 3:04 PM, David Smith [EMAIL PROTECTED] wrote:

 Thanks still need the stack trace's root cause.  You can find it in
 tomcat's logs if it's not on screen anymore.  Also, are you trying to use
 the Admin tool?  You might be better off just editing the appropriate config
 files.  It was dropped from tomcat 6 because it hadn't been maintained in a
 long time.

 --David


 Christian Bianchini wrote:

 The version of tomcat is: 5.5.26
 The server have install debian etch
 The tomcat is install of source not package debian.

 On Wed, Jul 23, 2008 at 2:11 PM, David Smith [EMAIL PROTECTED] wrote:



 Could you please post tomcat version, OS, root cause (you cropped the
 stack
 trace too early), any other relevant details.

 --David

 Christian Bianchini wrote:



 Hi,
 I have create the new domain on tomcat admin and I've create the context
 /manager but after login I receiving this error:

 type Exception report

 message

 description The server encountered an internal error () that prevented
 it
 from fulfilling this request.

 exception

 javax.servlet.ServletException: Error allocating a servlet instance


 org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)


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


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


 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java[image:
 :8]74)


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


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


 org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java[image:
 :8]1)


 org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
 java.lang.Thread.run(Thread.java:595)

 root cause

 Screenshot:

 http://foto.freehostz.info/foto.php?code=1b79700537f14e9d48d0823ba03e1610




 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]










 --
 David Smith
 Programmer/Analyst
 College of Agriculture and Life Sciences
 Cornell University
 B32 Morrison Hall
 Ithaca, NY 14853
 Phone: (607) 255-4521



 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe

Re: interrupting a multipart post request?

2008-03-25 Thread Christian Kindler

Christopher Schultz wrote:

Christian Kindler wrote:
| Maybe it's a good question for tomcat-dev...

Agreed. Post back if you find a solution.



The only answer I got on tomcat-dev is the following one. So it really 
seems to be a protocol problem...




Rick Knowles wrote:
 Christian,

 Unfortunately due to request pipelining (the norm in HTTP/1.1), any
 attempt to send an error message or abort just results in the container
 having to silently consume the body of the upload anyway. The next
 request in the pipeline after a medium size upload could even
 conceivably be in the same TCP packet, so the container has to consume
 every request to make sure it correctly locates the start of the next
 request.

 It isn't worth even trying to handle - it's a necessary evil, the
 flipside of the taken-for-granted speed boosts that request pipelining
 brings.

 Rick

 Christian Kindler wrote:
 Hi all,

 there seems to be no possibility to immediately cancel a (multipart)
 post request (for example if the content-length exceeds a certain
 limit). Whatever I do in a servlet's doPost method (throwing an
 exception, closing the request's stream, interrupting the current
 thread), the client continues sending the data to the server.
 So there is nothing I can do to prevent users from sending huge amount
 if data to the server and producing a lot of traffic.

 All I want to do is to cancel a request immediately. I don't care if
 the client get's a reasonable error message or if the connection
 remains or not. Is there any way to achieve this or is it a general
 problem of the HTTP protocol?

 I hope it's o.k. that I ask this question here, on the users list
 unfortunately nobody could help or explain the reasons for this 
behavior.


 Christian


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: interrupting a multipart post request?

2008-03-14 Thread Christian Kindler

Christian Kindler schrieb:

Christopher Schultz schrieb:

Christian Kindler wrote:
| I want to interrupt a multipart post request (e.g. if the 
content-length

| exceeds a given limit). The problem is, that the client seems to
| continue sending the data to the server and gets no response from the
| server until the whole data is send.

Maybe try this:

~ if (request.getContentLength()  100) {
~request.getInputStream().close();

~ throw new ServletException(request limit exceeded.);
~ }

...or some variant thereof.


Hello Christopher,

that works, thanks!


Sorry, I was a little bit headily. Ist does not work.
Is something like Thread.currentThread().interrupt() the only way to 
stop a multipart post request?


Regards, Christian

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: interrupting a multipart post request?

2008-03-14 Thread Christian Kindler

Christopher Schultz wrote:

Christian Kindler wrote:
| Is something like Thread.currentThread().interrupt() the only way to
| stop a multipart post request?

I'm pretty sure you don't want to do that. The javadoc for
Thread.interrupt states that any blocked I/O calls will be aborted, but
you never know what Tomcat will do in that case.

You might want to check out the thread-handling code in Tomcat to see
what happens, or re-post with /that/ question to see what some of the
old salts have to say about it.


Hi Chris,

Thread.currentThread().interrupt() does not work anyway. I don't know if 
it is a Tomcat problem or a generall problem of the HTTP protocol.


Maybe it's a good question for tomcat-dev...


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: interrupting a multipart post request?

2008-03-10 Thread Christian Kindler

Christopher Schultz schrieb:

Christian Kindler wrote:
| I want to interrupt a multipart post request (e.g. if the content-length
| exceeds a given limit). The problem is, that the client seems to
| continue sending the data to the server and gets no response from the
| server until the whole data is send.

Maybe try this:

~ if (request.getContentLength()  100) {
~request.getInputStream().close();

~ throw new ServletException(request limit exceeded.);
~ }

...or some variant thereof.


Hello Christopher,

that works, thanks!

Regards,
Christian


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



interrupting a multipart post request?

2008-03-07 Thread Christian Kindler

Hello,

I'm not sure if this is tomcat or general servlet issue. I hope you can 
help me anyway.


I want to interrupt a multipart post request (e.g. if the content-length 
exceeds a given limit). The problem is, that the client seems to 
continue sending the data to the server and gets no response from the 
server until the whole data is send.


Please see the following doPost method. On the console the exception 
appears immediately, but a takes much longer until I can see the 
response in the browser.


public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
if (request.getContentLength()  100) {
throw new ServletException(request limit exceeded.);
}
}

The same thing if I try to forward the request via the 
RequestDispatcher: the request is forwarded when the whole data is sent 
to the server and not immediately.


I am using Tomcat 6.0.16 with jdk 1.6.0_04 on windows xp.

Regards,
Christian

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: tomcat ldap authentication problem

2008-02-29 Thread Christian Andersson

we have tried it with the following..

IE6 and 7 on windows
IE6 on linux (using ie4linux and wine)
Firefox 2.0.12 on windows and on linux

all behave the same..

all the tools we have to get information out from the ldap gives us the 
username out in utf-8 correctly so for me it looks like it is stored in 
utf-8 in ldap..


and since now all our system is configured for utf-8 it is strange that 
this 1 part (the jndirealm) looks like it is using iso-8859-1 .-(




Antonio Petrelli skrev:

2008/2/20, Christian Andersson [EMAIL PROTECTED]:

 all our html pages uses the utf-8 encoding, using slapcat and looking at
 the content the data inside openldap seems to be using utf-8 (the output
 from slapcat is at least utf-8,but I don't know if slapcat converts
 anything)


This might be a shot in the dark, but what client browser are you using?
I've had some problems with IE7: though I tell him to use UTF-8, it
posts the form in UTF-8 charset, but telling that it is using
ISO-8859-1!
Try it with Firefox, if you already didn't do it.

Antonio

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: tomcat ldap authentication problem

2008-02-29 Thread Christian Andersson
ofcourse, it would be better, but unfourtunally it is not up to me to 
enforce this policy, and we already have a lot of users with those 
character in both username and/or password..


we had the system up and running before but after switching the website 
over from ISO-8859-1 to UTF-8 it i sno longer working, the strange part 
is though that with every tool I canuse to check what is in the ldap, it 
say it is in utf-8


and we cannot go back o ISO-8859-1 either..



Andris Eiduks skrev:

I think that better is for userID and passwords don't use national
characters. In Latvia we time after time have similar problems ...

Andris Eiduks

On Fri, Feb 29, 2008 at 9:53 AM, Antonio Petrelli 
[EMAIL PROTECTED] wrote:


2008/2/20, Christian Andersson [EMAIL PROTECTED]:

 all our html pages uses the utf-8 encoding, using slapcat and looking

at

 the content the data inside openldap seems to be using utf-8 (the

output

 from slapcat is at least utf-8,but I don't know if slapcat converts
 anything)

This might be a shot in the dark, but what client browser are you using?
I've had some problems with IE7: though I tell him to use UTF-8, it
posts the form in UTF-8 charset, but telling that it is using
ISO-8859-1!
Try it with Firefox, if you already didn't do it.

Antonio

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: tomcat ldap authentication problem

2008-02-28 Thread Christian Andersson

anyone ?

Christian Andersson skrev:
Hi, we have setup Tomcat (6.0.10) to authenticate using form 
authentication against openldap (2.3.27) with the jndirealm and 
everything works alright except one little bit of a problem.


if the user name has national characters in it (åæø for norwegian) or 
the password does, the user cannot authenticate .-(


for example if our user has a password of hælge the user cannot log 
in, but if we change the password to helge he can log in.


all our html pages uses the utf-8 encoding, using slapcat and looking at 
the content the data inside openldap seems to be using utf-8 (the output 
from slapcat is at least utf-8,but I don't know if slapcat converts 
anything)


We are also administrating the users from within our application (using 
the standard javax.naming package) and from there we can search AND find 
users with user names that have øæå in them so we know that ldap and 
javax.naming can communicate and use national characters correctly..



looking at the logfile for ldap (when turning up the debug level) it 
almost looks like jndirealm is using iso-8859-1 as encoding since in the 
logfile all natinal characters comes out as garbage.


and as I said ALL pages in the system uses UTF-8 as encoding (including 
the login page)



can anyone give me a hint on where to look next, I've searched for an 
answer using google and in the mailinglist but either I'm nort searching 
for the right thing, or I just cannot find it..


/Christian Andersson



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



tomcat ldap authentication problem

2008-02-20 Thread Christian Andersson
Hi, we have setup Tomcat (6.0.10) to authenticate using form 
authentication against openldap (2.3.27) with the jndirealm and 
everything works alright except one little bit of a problem.


if the user name has national characters in it (åæø for norwegian) or 
the password does, the user cannot authenticate .-(


for example if our user has a password of hælge the user cannot log 
in, but if we change the password to helge he can log in.


all our html pages uses the utf-8 encoding, using slapcat and looking at 
the content the data inside openldap seems to be using utf-8 (the output 
from slapcat is at least utf-8,but I don't know if slapcat converts 
anything)


We are also administrating the users from within our application (using 
the standard javax.naming package) and from there we can search AND find 
users with user names that have øæå in them so we know that ldap and 
javax.naming can communicate and use national characters correctly..



looking at the logfile for ldap (when turning up the debug level) it 
almost looks like jndirealm is using iso-8859-1 as encoding since in the 
logfile all natinal characters comes out as garbage.


and as I said ALL pages in the system uses UTF-8 as encoding (including 
the login page)



can anyone give me a hint on where to look next, I've searched for an 
answer using google and in the mailinglist but either I'm nort searching 
for the right thing, or I just cannot find it..


/Christian Andersson



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: problem with mod_jk and tomcat-host downtime on solaris

2008-01-24 Thread Christian Schausberger
Rainer Jung wrote:
 Christian Schausberger wrote:
 Rainer Jung wrote:
 I would start adding a prepost_timeout. See:

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

 Maybe I misunderstood this directive. connect_timeout only applies after
 the TCP connection has been established. I thought the order in which
 those timeouts apply is:
 1.) socket_timeout
 2.) connect_timeout
 3.) prepost_timeout

 socket_timeout is a low level socket timeout (sic!).
 So whenever we read from the socket, the timer starts and if it fires,
 then we get an error. The connection can not be used any more afterwards.

If this is a matter of starting a timer after a read from the socket,
why should this not be supported on Solaris?

 prepost_timeout is similar to connect_timeout, but it is used in the
 situation, where the connection has already been established for some
 previous request and we are going to reuse (what we are supposed to do
 a lot, because AJP13 uses persistent connections). We send a cping and
 wait for cpong before each request when prepost_timeout is set. Such
 behaviour is very common with other persistent connection technologies
 like e.g. database connection pools.


 Does prepost_timeout actually work even though the underlying TCP
 connection can not be established?
 See above, prepost gets used when we reuse an established connection
 to make sure, that the backend is still there and able to answer.


I have tried prepost as you suggested in your first reply but it had no
effect because of the reasons you just explained. Upgrading to
mod_jk-1.2.26 also had no effect.  I assume reply_timeout will also rely
on an established ajp connection.

Regards,

Christian

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



problem with mod_jk and tomcat-host downtime on solaris

2008-01-23 Thread Christian Schausberger
Hi,

I use apache-2.2.4 together with mod_jk-1.2.25 to load balance a bunch
of tomcat-5.5.25 servers. All servers are running on Solaris 10 and are
implemented as zones.

The setup works really good during normal operation. But when a server
dies for some reason, and with it the zones running tomcat, mod_jk does
not stop sending requests to the unavailable tomcats until the operating
system times out the tcp connect. This takes more than a few minutes.

Reading the documentation suggests that socket_timeout is the appropiate
setting to deal with this problem but does not work on Solaris. I could
not find any usable settings in Solaris itself, so I am hoping this can
be solved with mod_jk configuration.

What is the correct way to have mod_jk recognize the tomcats as
unavailable more quickly on Solaris?

Below you can find my current mod_jk configuration.

Thanks

Christian

#

# default worker list
worker.list=escenic,jkstatus

# worker template
worker.template.port=9009
worker.template.type=ajp13
worker.template.lbfactor=1
worker.template.socket_keepalive=0
worker.template.connect_timeout=1
worker.template.reply_timeout=4
worker.template.connection_pool_timeout=30

# workers definition
worker.escapp1.reference=worker.template
worker.escapp1.host=apppubl1.online.local

...
...
...

# load balancer definition
worker.escenic.type=lb
worker.escenic.max_reply_timeouts=3
worker.escenic.balance_workers=escapp1,escapp9,escapp3,escapp4,escapp5,escapp6,escapp7,escapp8
worker.escenic.sticky_session=1.



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: problem with mod_jk and tomcat-host downtime on solaris

2008-01-23 Thread Christian Schausberger
Rainer Jung wrote:
 I would start adding a prepost_timeout. See:

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

Maybe I misunderstood this directive. connect_timeout only applies after
the TCP connection has been established. I thought the order in which
those timeouts apply is:
1.) socket_timeout
2.) connect_timeout
3.) prepost_timeout

Does prepost_timeout actually work even though the underlying TCP
connection can not be established?

 Caution: there's a bug in 1.2.25 that makes max_reply_timouts useless.
 Consider upgrading to 1.2.26 (even if this is not the solution to the
 problem you are asking for).
I will upgrade as soon as possible.

Thanks,

Christian

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



java.lang.NoSuchMethodError: org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest

2008-01-07 Thread Christian Aschoff

Hi,

i have a webapplication developed with NetBeans 5.5. Everything is  
fine. But when i recompile it with NetBeans 6.01, i get a


2008-01-07 10:13:51,244 ERROR [http-8084-2] (RetrobibAction.java:89)  
- Exception in Action
java.lang.NoSuchMethodError:  
org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest 
(Lorg/apache/commons/fileupload/RequestContext;)Ljava/util/List;
	at  
org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest 
(ServletFileUpload.java:126)


Exception when uploading files (via apache.commons.fileupload). I  
upgraded all librarys (io/collections/fileupload) but this does not  
helped.


Any hint for me?

Regards,
Christian

---
Dipl. Ing. (FH) Christian Aschoff

Büro:
Universität Ulm
Kommunikations- und Informationszentrum
Abt. Informationssysteme
Raum O26/5403
Albert-Einstein-Allee 11
89081 Ulm

Tel. 0731 50-22432
Fax. 0731 50-22471
[EMAIL PROTECTED]

Privat:
Fabristr. 13
89075 Ulm
Deutschland/Old Europe

Tel. 0731 602 803 60
Fax. 0731 602 803 61
Mob. 0171 272 03 04
[EMAIL PROTECTED]

Helfen Sie mit: http://www.retrobibliothek.de





-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: java.lang.NoSuchMethodError: org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest

2008-01-07 Thread Christian Aschoff

Hm, i think the complete stack-trace does not help further, but anyway:

java.lang.NoSuchMethodError:  
org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest 
(Lorg/apache/commons/fileupload/RequestContext;)Ljava/util/List;
	at  
org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest 
(ServletFileUpload.java:126)
	at de.retrobib.utils.RequestParameterFetcher.buildHashs 
(RequestParameterFetcher.java:156)
	at de.retrobib.utils.RequestParameterFetcher.init 
(RequestParameterFetcher.java:58)
	at de.retrobib.actions.secure.BatchAction.executeAction 
(BatchAction.java:85)

at de.retrobib.actions.RetrobibAction.execute(RetrobibAction.java:83)
	at org.apache.struts.action.RequestProcessor.processActionPerform 
(RequestProcessor.java:431)
	at org.apache.struts.action.RequestProcessor.process 
(RequestProcessor.java:236)
	at org.apache.struts.action.ActionServlet.process(ActionServlet.java: 
1196)
	at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java: 
432)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter 
(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter 
(ApplicationFilterChain.java:206)

at de.retrobib.filter.SecurityFilter.doFilter(SecurityFilter.java:93)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter 
(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter 
(ApplicationFilterChain.java:206)

at de.retrobib.filter.URLFilter.doFilter(URLFilter.java:98)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter 
(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter 
(ApplicationFilterChain.java:206)
	at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter 
(MonitorFilter.java:390)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter 
(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter 
(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke 
(StandardWrapperValve.java:233)
	at org.apache.catalina.core.StandardContextValve.invoke 
(StandardContextValve.java:175)
	at org.apache.catalina.core.StandardHostValve.invoke 
(StandardHostValve.java:128)
	at org.apache.catalina.valves.ErrorReportValve.invoke 
(ErrorReportValve.java:102)
	at org.apache.catalina.core.StandardEngineValve.invoke 
(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service 
(CoyoteAdapter.java:263)
	at org.apache.coyote.http11.Http11Processor.process 
(Http11Processor.java:844)
	at org.apache.coyote.http11.Http11Protocol 
$Http11ConnectionHandler.process(Http11Protocol.java:584)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run 
(JIoEndpoint.java:447)

at java.lang.Thread.run(Thread.java:613)

I can not find a second commons...-lib. Maybe it is somewhere inside  
NetBeans 6.0...?



Am 07.01.2008 um 12:12 schrieb David Delbecq:

Check you don't have 2 versions of commons fileupload. Also,  
provide a more complete stacktrace to get meaningful answers :)


En l'instant précis du 07/01/08 12:09, Christian Aschoff  
s'exprimait en ces termes:

Hi,

i have a webapplication developed with NetBeans 5.5. Everything is  
fine. But when i recompile it with NetBeans 6.01, i get a


2008-01-07 10:13:51,244 ERROR [http-8084-2] (RetrobibAction.java: 
89) - Exception in Action
java.lang.NoSuchMethodError:  
org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest( 
Lorg/apache/commons/fileupload/RequestContext;)Ljava/util/List;
at  
org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest( 
ServletFileUpload.java:126)


Exception when uploading files (via apache.commons.fileupload). I  
upgraded all librarys (io/collections/fileupload) but this does  
not helped.


Any hint for me?

Regards,
Christian

---
Dipl. Ing. (FH) Christian Aschoff

Büro:
Universität Ulm
Kommunikations- und Informationszentrum
Abt. Informationssysteme
Raum O26/5403
Albert-Einstein-Allee 11
89081 Ulm

Tel. 0731 50-22432
Fax. 0731 50-22471
[EMAIL PROTECTED]

Privat:
Fabristr. 13
89075 Ulm
Deutschland/Old Europe

Tel. 0731 602 803 60
Fax. 0731 602 803 61
Mob. 0171 272 03 04
[EMAIL PROTECTED]

Helfen Sie mit: http://www.retrobibliothek.de





-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
http://www.devlog.be (a belgian developer's logs)



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED

  1   2   >