Re: How to config the Tomcat 7.x JNDI datasource by using BoneCP ??

2012-06-06 Thread zuxiong lin
Hi ALL.
Anybody help ?

On Thu, May 3, 2012 at 10:00 PM, zuxiong lin linzuxiong1...@gmail.comwrote:

 Hei.   Of course, I write the name in Resource element.
 But Tomcat 7's logs report it .
 Please to find others before this letter, and you will read the Tomcat's
 logs!
  minConnectionsPerPartition=3 name=jdbc/SoftmgrV3 partitionCount=2


 On Thu, May 3, 2012 at 9:24 PM, Filip Hanik Mailing Lists 
 devli...@hanik.com wrote:

 found it, check the logs at startup for the error and post it here.

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





RE: Help Linking Static Content In a WebApp before and after (6.0.30.x)

2012-06-06 Thread Morgan, Russel
Thanks for the reply Christopher:

The filter / URL rewrite works great on all versions, correct. I could 
certainly post my config but It works fine, so I am going to try to clarify 
what doesn't work.

What I can't get to work in both versions is a link to a static resource.

I have to feed the different generations of Tomcat different URL's to get the 
same asset in the same location in each container.

http://localhost:8080/cms/resources/resources/css/gopublish.css  Is needed in 
the pre 6.0.30.x version
and
http://localhost:8080/cms/resources/css/gopublish.css  works just fine for the 
newer version Post 6.0.30.x

What I don't know how to do is use that redirect filter/rewrite to change the 
url based on the version of tomcat, which it seems I need to do, since the 
container pathing logic changed across versions.

Or, if there was a better way to find a singular path to put static resources 
within a webApp that would remain consistent (with respect to how to reference 
it), that exists, I could really use that...

Thanks again guys, I hope that clarifies the issue.

R.

-Original Message-
From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
Sent: Tuesday, June 05, 2012 5:47 PM
To: Tomcat Users List
Subject: Re: Help Linking Static Content In a WebApp before and after (6.0.30.x)

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Russel,

On 6/5/12 8:38 PM, Morgan, Russel wrote:
 I was initially pretty excited about the URL redirect idea, but after 
 some testing, it has led me back to the same result.
 
 I can make it work with redirects on either version of tomcat.
 Pre and Post that patch... I just can't make the same configuration 
 work for both versions.

What does your configuration actually look like? This should work under all 
versions: it's just a servlet filter.

- -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/OqGoACgkQ9CaO5/Lv0PA0hgCgqrO2mKdjpC9Kw/vAjfW3OOZv
1JsAoI2dT6Cg0+eOM9xgFGB56YZmevNM
=sHhR
-END PGP SIGNATURE-

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



Re: / getting added to action path

2012-06-06 Thread Konstantin Kolinko
2012/6/6 Dharamshila Khandelwal dharmshil...@gmail.com:
 Tim,

 It worked fine with IE 6.
 Tomcat logs clearly say that the path is invalid.
 Wierd this is that when the screen is loaded for the first time, it works
 fine. If I click on save (which makes a call to servlet) , it starts giving
 invalid path error.
 I know that its not a tomcat issue, but is there any configuration I need
 to change to make sure that the paths are always taken relative to base
 context?


1. What is that save that you click on?

2. What exactly Tomcat version you are using?

3. Configure an AccessLogValve inside the Host element in server.xml
and use a custom pattern in it to log Referer request header.

That is to log what requests are actually coming to Tomcat and from what pages.

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



Re: Help Linking Static Content In a WebApp before and after (6.0.30.x)

2012-06-06 Thread Konstantin Kolinko
2012/6/6 Morgan, Russel russel.mor...@disney.com:

 What I don't know how to do is use that redirect filter/rewrite to change the 
 url based on the version of tomcat, which it seems I need to do, since the 
 container pathing logic changed across versions.

Do not use your trick of mapping DefaultServlet to wrong path and it
will work in both versions.


If you are really frustrated, you can fork, compile and configure your
own implementation of DefaultServlet and bundle it with your
application. It is just a servlet. It is not core. Nothing in
implementation of the Servlet specification has changed. All
documented API works.

Best regards,
Konstantin Kolinko

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



RE: Help Linking Static Content In a WebApp before and after (6.0.30.x)

2012-06-06 Thread Morgan, Russel
Thanks for the reply.

So if I bundle the default servlet with my application and then configure it to 
run as a different named servlet, and map static resources to it within the 
webapp that should work? (I will certainly try that)

Also, all tricks aside, what is the proper way to address static assets 
deployed within a webapplication, if pathing them to the default servlet is 
inappropriate?

Forgive my ignorance but couldn't I just set this in my webapp xml descriptor, 
and rename it, and then path to it?

Perhaps the fact that the code is loaded by the webapp class loader makes a 
difference , I am not sure.  (just ruling out this possibility)

  servlet
servlet-namedefault/servlet-name

servlet-classorg.apache.catalina.servlets.DefaultServlet/servlet-class
init-param
param-namedebug/param-name
param-value0/param-value
/init-param
init-param
param-namelistings/param-name
param-valuefalse/param-value
/init-param
load-on-startup1/load-on-startup
/servlet

Thanks Again
Russ

-Original Message-
From: Konstantin Kolinko [mailto:knst.koli...@gmail.com] 
Sent: Wednesday, June 06, 2012 4:49 AM
To: Tomcat Users List
Subject: Re: Help Linking Static Content In a WebApp before and after (6.0.30.x)

2012/6/6 Morgan, Russel russel.mor...@disney.com:

 What I don't know how to do is use that redirect filter/rewrite to change the 
 url based on the version of tomcat, which it seems I need to do, since the 
 container pathing logic changed across versions.

Do not use your trick of mapping DefaultServlet to wrong path and it will work 
in both versions.


If you are really frustrated, you can fork, compile and configure your own 
implementation of DefaultServlet and bundle it with your application. It is 
just a servlet. It is not core. Nothing in implementation of the Servlet 
specification has changed. All documented API works.

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: How to config the Tomcat 7.x JNDI datasource by using BoneCP ??

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

Zuxiong,

On 6/6/12 6:47 AM, zuxiong lin wrote:
 Hi ALL. Anybody help ?

Filip asked for your startup logs and you never posted them. If you
post them, perhaps we can help.

- -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/PWccACgkQ9CaO5/Lv0PDjfQCfR4iB4cY3Hmdp8xTVJ16LSE6h
RToAn2DblkYXneNUfAekvsoepHTuxxQs
=iUnJ
-END PGP SIGNATURE-

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



Re: Help Linking Static Content In a WebApp before and after (6.0.30.x)

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

Russel,

On 6/6/12 8:45 AM, Morgan, Russel wrote:
 So if I bundle the default servlet with my application and then 
 configure it to run as a different named servlet, and map static 
 resources to it within the webapp that should work? (I will
 certainly try that)
 
 Also, all tricks aside, what is the proper way to address static 
 assets deployed within a webapplication, if pathing them to the
 default servlet is inappropriate?

What's wrong with letting the DefaultServlet continue to do its normal
job by serving every resource that isn't otherwise mapped?

 Forgive my ignorance but couldn't I just set this in my webapp xml 
 descriptor, and rename it, and then path to it?

Why bother? If /resources/css/gopublish.css isn't mapped explicitly,
then the DefaultServlet will look in your webapp's /resources/css/
directory for gopublish.css and serve the bytes no problem.

 Perhaps the fact that the code is loaded by the webapp class
 loader makes a difference , I am not sure. (just ruling out this
 possibility)

It does not matter.

I think I've gotten lost... what are you actually trying to
accomplish, here? Do you have a bunch of static content that is
outside of the webapp's docBase that you want to serve from within its
URL space? Any possibility that you could upgrade to Tomcat 7 which
has aliases which can do this?

- -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/PW0sACgkQ9CaO5/Lv0PBAkgCcD8hn/ZtuZal8QQNyFOCNepJc
5+gAnjzbuNER8okInm+w2qXvXkvfSvr3
=v2ck
-END PGP SIGNATURE-

-
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-06 Thread Ravi


Mark / Chris,

Essentially, if I want to use websockets, you are asking me to rewrite 
my app + rewrite grails + rewrite hibernate + rewrite apache http 
utilities + rewrite several other web libraries I use.


I do not think this is a reasonable option.



On 6/5/2012 9:04 PM, Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Mark,

On 6/5/12 5:42 PM, Mark Thomas wrote:

WebSocket != HTTP and you simply can't replace one with the other.


+1

You can't just shout websocket and make a webapp work better with no
other changes. It's not just like adding transport encryption by
adding an s to the protocol name, it's a completely different
protocol that just happens to use HTTP to bootstrap itself.

- -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/OrJ0ACgkQ9CaO5/Lv0PDrxACfRk6gj0BWgqlMRBFV04rwaEbW
gikAn3o1rxm9heaiAILQ4iRvTpuLwd+G
=A2ua
-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: getting frustrated with web sockets

2012-06-06 Thread David kerber

On 6/6/2012 10:54 AM, Ravi wrote:


Mark / Chris,

Essentially, if I want to use websockets, you are asking me to rewrite
my app + rewrite grails + rewrite hibernate + rewrite apache http
utilities + rewrite several other web libraries I use.

I do not think this is a reasonable option.


Or rewrite your app to not libraries that won't work with your desired 
communications method.


Or rewrite your app to use a communications method that will work with 
those libraries.







On 6/5/2012 9:04 PM, Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Mark,

On 6/5/12 5:42 PM, Mark Thomas wrote:

WebSocket != HTTP and you simply can't replace one with the other.


+1

You can't just shout websocket and make a webapp work better with no
other changes. It's not just like adding transport encryption by
adding an s to the protocol name, it's a completely different
protocol that just happens to use HTTP to bootstrap itself.

- -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/OrJ0ACgkQ9CaO5/Lv0PDrxACfRk6gj0BWgqlMRBFV04rwaEbW
gikAn3o1rxm9heaiAILQ4iRvTpuLwd+G
=A2ua
-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





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



Can someone suggest mail some opensource mail server which works well with Tomcat.

2012-06-06 Thread Kiran Badi

Hi,

I have a requirement to send pw reset mails,send deals HTML mails etc.

So for this I was looking for some mail servers which can work with my 
existing setup which I can integrate with Tomcat 7.0x,should have 
pop3/smtp support.


can some one give me some  other names which I can check ?.

PS:I am going through apache james to see if it works for me.



- Kiran Badi

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



Re: Can someone suggest mail some opensource mail server which works well with Tomcat.

2012-06-06 Thread David kerber

On 6/6/2012 12:24 PM, Kiran Badi wrote:

Hi,

I have a requirement to send pw reset mails,send deals HTML mails etc.

So for this I was looking for some mail servers which can work with my
existing setup which I can integrate with Tomcat 7.0x,should have
pop3/smtp support.

can some one give me some other names which I can check ?.

PS:I am going through apache james to see if it works for me.



- Kiran Badi


I use JES (Java Email Server).  Works fine for me, and very simple to 
configure.



-
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-06 Thread Steve Millidge
Mark,

 

I think it would be useful to get access to the session at least when you
are bootstrapping the web socket and creating the MessageInBound subclass
instance. It is very likely that a user will have accessed a web application
and logged in etc. prior to bootstrapping the websocket connection.
Therefore there's likely to be a whole bunch of useful context information I
want in my MessageInbound class when I create it.

 

Looking at the code it would be a simple change to pass Session into the
createWebSocketInbound(String subProtocol)  call.

 

Any chance we can get it added as a parameter, otherwise I'll have to hack
about with thread locals in the subclass of WebSocketServlet.

 

Cheers

 

 

Steve Millidge
Director
C2B2
The Leading Independent Middleware Experts. 
W:  http://www.c2b2.co.uk/ www.c2b2.co.uk | 

 



Re: getting frustrated with web sockets

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

David,

On 6/6/12 11:09 AM, David kerber wrote:
 On 6/6/2012 10:54 AM, Ravi wrote:
 
 Mark / Chris,
 
 Essentially, if I want to use websockets, you are asking me to
 rewrite my app + rewrite grails + rewrite hibernate + rewrite
 apache http utilities + rewrite several other web libraries I
 use.
 
 I do not think this is a reasonable option.
 
 Or rewrite your app to not libraries that won't work with your
 desired communications method.
 
 Or rewrite your app to use a communications method that will work
 with those libraries.

+1

I'm not sure why anyone would have to rewrite hibernate in order to
use it with WebSocket: AFAIK, there is no dependency from hibernate -
servlet API.

Grails is a web framework which probably fairly tightly-couples
itself to the servlet API. Certain other frameworks (off the top of my
head, Spring and Apache Struts 2) do not depend upon the servlet API
unless you want them to. You can certainly write your own glue that
will shuttle servlet-API-provided data (i.e. from the request or
session) to your business logic (which should never rely on the
servlet API) and then write similar glue that uses the WebSocket APIs.

- -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/Pnb4ACgkQ9CaO5/Lv0PAxiACfSo/64zE1xaF4OvfjCVSAn6Sr
LDgAnROqBOorHOnf+ilPFVA38HrSWqzZ
=aPEU
-END PGP SIGNATURE-

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



Re: Can someone suggest mail some opensource mail server which works well with Tomcat.

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

Kiran,

On 6/6/12 12:24 PM, Kiran Badi wrote:
 I have a requirement to send pw reset mails,send deals HTML mails
 etc.
 
 So for this I was looking for some mail servers which can work with
 my existing setup which I can integrate with Tomcat 7.0x,should
 have pop3/smtp support.

Do you want to send messages, receive messages, or both? Sounds like
you definitely want to send, but do you really need to receive?

When you say integrate with Tomcat 7.0x, do you mean that you want
to run the mail server in-process with Tomcat? I would guess that a
separate process would be more secure, more reliable, and give you
more options. For instance, there are many tried-and-true mail servers
that are not Java-based that could certainly meet your needs as long
as you don't need them to be in-process. For example: sendmail, EXIM,
Courier, and others are all available as options through most Linux
package-managers.

- -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/PnoYACgkQ9CaO5/Lv0PATlACeLFwTshyue/N7U45Wf6CzdR68
Uf4AoI8U4INzbUHX07VLRmpgrQQBPxKL
=fYSN
-END PGP SIGNATURE-

-
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-06 Thread Mark Thomas
On 06/06/2012 17:40, Steve Millidge wrote:
 Mark,
 
  
 
 I think it would be useful to get access to the session at least when you
 are bootstrapping the web socket and creating the MessageInBound subclass
 instance. It is very likely that a user will have accessed a web application
 and logged in etc. prior to bootstrapping the websocket connection.
 Therefore there's likely to be a whole bunch of useful context information I
 want in my MessageInbound class when I create it.
 
 Looking at the code it would be a simple change to pass Session into the
 createWebSocketInbound(String subProtocol)  call.

I'd rather not pass in the session object since it just encourages folks
to retain a copy of it and I am not at all convinced that is a good idea
for WebSockets.

I have no objection to making session attributes available at that point
(or data from the request) but I don't like the idea of providing direct
access to the Request and Session objects. Neither do I like the idea of
having to proxy every getter...

Hmm. We could wrap them with a façade and null out the underlying
objects once the HTTP request ends to discourage folks from retaining
references to them since all they'll get is NPEs.

 Any chance we can get it added as a parameter, otherwise I'll have to hack
 about with thread locals in the subclass of WebSocketServlet.

If the above seems reasonable then that is probably doable with the
caveat I haven't thought too hard about it at this point.

Mark

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



Re: Can someone suggest mail some opensource mail server which works well with Tomcat.

2012-06-06 Thread Kiran Badi

Thanks David ,I will research java email server and Chris for replying,

High level requirement which I feel I need is, to send mail(ex pw reset 
mails, welcome mails, HTML Content deals mails etc), receive mails( yes 
I need to receive mails as well),


Integrate well with Tomcat means that it should not have more set up or 
communication issues talking to tomcat.I plan to use Javamail api's and 
read mail servers parameters via web xml resources section.



On 6/6/2012 11:46 PM, Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Kiran,

On 6/6/12 12:24 PM, Kiran Badi wrote:

I have a requirement to send pw reset mails,send deals HTML mails
etc.

So for this I was looking for some mail servers which can work with
my existing setup which I can integrate with Tomcat 7.0x,should
have pop3/smtp support.

Do you want to send messages, receive messages, or both? Sounds like
you definitely want to send, but do you really need to receive?

When you say integrate with Tomcat 7.0x, do you mean that you want
to run the mail server in-process with Tomcat? I would guess that a
separate process would be more secure, more reliable, and give you
more options. For instance, there are many tried-and-true mail servers
that are not Java-based that could certainly meet your needs as long
as you don't need them to be in-process. For example: sendmail, EXIM,
Courier, and others are all available as options through most Linux
package-managers.

- -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/PnoYACgkQ9CaO5/Lv0PATlACeLFwTshyue/N7U45Wf6CzdR68
Uf4AoI8U4INzbUHX07VLRmpgrQQBPxKL
=fYSN
-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: getting frustrated with web sockets

2012-06-06 Thread smilli...@c2b2.co.uk
Thinking off the top of my head. How about passing in an unmodifiable map of the
session attributes to give some context to the creation of the MessageInbound
class?

Hmm however then some bright spark will probably want the URL and the request
parameters, then the cookies etc. of the initiating HTTP request.

I assume the JSR 356 expert group is grappling with this question as well.

Steve


On 06 June 2012 at 19:42 Mark Thomas ma...@apache.org wrote:

 On 06/06/2012 17:40, Steve Millidge wrote:
  Mark,
 
  
 
  I think it would be useful to get access to the session at least when you
  are bootstrapping the web socket and creating the MessageInBound subclass
  instance. It is very likely that a user will have accessed a web application
  and logged in etc. prior to bootstrapping the websocket connection.
  Therefore there's likely to be a whole bunch of useful context information I
  want in my MessageInbound class when I create it.
 
  Looking at the code it would be a simple change to pass Session into the
  createWebSocketInbound(String subProtocol)  call.

 I'd rather not pass in the session object since it just encourages folks
 to retain a copy of it and I am not at all convinced that is a good idea
 for WebSockets.

 I have no objection to making session attributes available at that point
 (or data from the request) but I don't like the idea of providing direct
 access to the Request and Session objects. Neither do I like the idea of
 having to proxy every getter...

 Hmm. We could wrap them with a façade and null out the underlying
 objects once the HTTP request ends to discourage folks from retaining
 references to them since all they'll get is NPEs.

  Any chance we can get it added as a parameter, otherwise I'll have to hack
  about with thread locals in the subclass of WebSocketServlet.

 If the above seems reasonable then that is probably doable with the
 caveat I haven't thought too hard about it at this point.

 Mark

 -
 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-06 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Mark,

On 6/6/12 2:42 PM, Mark Thomas wrote:
 I'd rather not pass in the session object since it just encourages 
 folks to retain a copy of it and I am not at all convinced that is
 a good idea for WebSockets.
 
 I have no objection to making session attributes available at that
 point (or data from the request) but I don't like the idea of
 providing direct access to the Request and Session objects. Neither
 do I like the idea of having to proxy every getter...
 
 Hmm. We could wrap them with a façade and null out the underlying 
 objects once the HTTP request ends to discourage folks from
 retaining references to them since all they'll get is NPEs.

This was going to be my suggestion. There are a number of frameworks
out there that avoid tightly binding application with the servlet API
by exposing things as a java.util.Map instead of, say,
javax.servlet.http.HttpSession or javax.servlet.http.HttpServletRequest.

This strategy gives access to the underlying data (that is, the
attributes), hides the real source of the data, and allows
interception of arbitrary calls. So, we could either throw an NPE when
the session/request goes out of scope with respect to the WebSocket
message, or we could even throw a more useful exception that informs
the client that the data is no longer accessible.

- -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/PvioACgkQ9CaO5/Lv0PDvygCgmHBxHcTjqWAO+jiOKZOpygFH
nCUAnRhTHnQlO7/9oQDeqYg+teopFrKB
=RoX5
-END PGP SIGNATURE-

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



Re: Can someone suggest mail some opensource mail server which works well with Tomcat.

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

Kiran,

On 6/6/12 2:56 PM, Kiran Badi wrote:
 High level requirement which I feel I need is, to send mail(ex pw
 reset mails, welcome mails, HTML Content deals mails etc), receive
 mails( yes I need to receive mails as well),

Okay.

 Integrate well with Tomcat means that it should not have more set
 up or communication issues talking to tomcat.I plan to use Javamail
 api's and read mail servers parameters via web xml resources
 section.

So you don't need in-process: that's good.

If you are going to use Javamail to access a remote mailbox (even if
it's on localhost), then you can use any email server software that
otherwise meets your needs. Javamail can communicate with any POP3 or
IMAP server -- it need not be Java-based. You can even use Google Mail
as your email service if you want (for both SMTP/send and
POP3/IMAP/fetch).

- -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/PvwMACgkQ9CaO5/Lv0PALPgCcCPPCiIQAmfF1Y3doeGjuJLu+
cKUAn21U1oothcddtEUUCU03g70eT+xH
=rPRU
-END PGP SIGNATURE-

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



RE: Help Linking Static Content In a WebApp before and after (6.0.30.x)

2012-06-06 Thread Morgan, Russel
I found a fix :)

Thanks again for all the replies, the thought that if a resource wasn't mapped 
it would drop to the default servlet got me thinking.

I did some looking and it was actually my spring dispatcher picking up /* and 
causing calls to static resources to fail as the dispatcher picked them up.

servlet-mapping
servlet-namedispatcher/servlet-name
url-pattern/*/url-pattern
  /servlet-mapping

servlet
servlet-namedispatcher/servlet-name

servlet-classorg.springframework.web.servlet.DispatcherServlet/servlet-class
load-on-startup1/load-on-startup  
  /servlet

Sure enough if I commented that out, then my static paths worked great.

Obviously this killed my application though, as the dispatcher wasn't handling 
requests.  I did a bunch of searching around and reading on Spring and found 
that adding the following entries to my spring config allowed me to control 
routing on the 5 versions of tomcat I tested perfectly.

What I added to my appicationContext.xml

   xmlns:mvc=http://www.springframework.org/schema/mvc;
   
   Then to go with that the following schema locations:
  http://www.springframework.org/schema/mvc
  http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd

  
   mvc:resources mapping=/resources/** location=//
   mvc:default-servlet-handler/

(info on that last little gem, which still feels hacky)
16.14.6 mvc:default-servlet-handler

This tag allows for mapping the DispatcherServlet to / (thus overriding the 
mapping of the container's default Servlet), while still allowing static 
resource requests to be handled by the container's default Servlet. It 
configures a DefaultServletHttpRequestHandler with a URL mapping of /** and 
the lowest priority relative to other URL mappings.

This handler will forward all requests to the default Servlet. Therefore it is 
important that it remains last in the order of all other URL HandlerMappings. 
That will be the case if you use mvc:annotation-driven or alternatively if 
you are setting up your own customized HandlerMapping instance be sure to set 
its order property to a value lower than that of the 
DefaultServletHttpRequestHandler, which is Integer.MAX_VALUE.

Thanks again everyone!
Russ

-Original Message-
From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
Sent: Wednesday, June 06, 2012 6:30 AM
To: Tomcat Users List
Subject: Re: Help Linking Static Content In a WebApp before and after (6.0.30.x)

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Russel,

On 6/6/12 8:45 AM, Morgan, Russel wrote:
 So if I bundle the default servlet with my application and then 
 configure it to run as a different named servlet, and map static 
 resources to it within the webapp that should work? (I will certainly 
 try that)
 
 Also, all tricks aside, what is the proper way to address static 
 assets deployed within a webapplication, if pathing them to the 
 default servlet is inappropriate?

What's wrong with letting the DefaultServlet continue to do its normal job by 
serving every resource that isn't otherwise mapped?

 Forgive my ignorance but couldn't I just set this in my webapp xml 
 descriptor, and rename it, and then path to it?

Why bother? If /resources/css/gopublish.css isn't mapped explicitly, then the 
DefaultServlet will look in your webapp's /resources/css/ directory for 
gopublish.css and serve the bytes no problem.

 Perhaps the fact that the code is loaded by the webapp class loader 
 makes a difference , I am not sure. (just ruling out this
 possibility)

It does not matter.

I think I've gotten lost... what are you actually trying to accomplish, here? 
Do you have a bunch of static content that is outside of the webapp's docBase 
that you want to serve from within its URL space? Any possibility that you 
could upgrade to Tomcat 7 which has aliases which can do this?

- -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/PW0sACgkQ9CaO5/Lv0PBAkgCcD8hn/ZtuZal8QQNyFOCNepJc
5+gAnjzbuNER8okInm+w2qXvXkvfSvr3
=v2ck
-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



Java process killed by oom-killer in Ubuntu

2012-06-06 Thread Jorge Medina
Hello,
   I have an application that runs under Tomcat 7.0.23 that
periodically crashes. The java process running tomcat keeps growing in
memory until the Linux oom-killer kills the process. I do not get an
OutOfMemoryError because the memory leak is not in the Java heap. In
fact, it seems the heap is only using 4GB of the max 6GB specified in
the -Xmx parameter. Nevertheless the total memory held by the java
process keeps growing up to 16GB when the OS kills the process.
I haven't been able to find the conditions to reproduce this
problem, so I am not able to replicate it. Nevertheless it keeps
occurring; sometimes at midnight with no user activity sometimes in
the middle of a busy day.

   The web application uses Spring/Postgres/Mongo.

   I know this is not a Tomcat related problem, but some of you may
have experience a similar problem and may have some suggestions on how
to troubleshoot it.
   I already have read many of the links that come after searching the
web for java invoked oom-killer but I still don't have any clue on
what causes the problem and how to solve it.
   It looks like a memory leak in native code, not java code; so my
usual java toolset is not useful.

   Tomcat runs behind nginx in a EC2 instance. The application uses
Sun (now Oracle) JDK 1.6.

   Any suggestions on what should I look at?


-Jorge


Jun  4 16:02:49 ip-10-83-35-78 kernel: [1468800.179218] 3795110 pages non-shared
Jun  5 06:50:07 ip-10-83-35-78 rsyslogd: [origin software=rsyslogd
swVersion=4.2.0 x-pid=599 x-info=http://www.rsyslog.com;]
rsyslogd was HUPed, type 'lightweight'.
Jun  5 22:06:40 ip-10-83-35-78 kernel: [1576977.209487] java invoked
oom-killer: gfp_mask=0x201da, order=0, oom_adj=0
Jun  5 22:06:41 ip-10-83-35-78 kernel: [1576977.209492] java cpuset=/
mems_allowed=0
Jun  5 22:06:41 ip-10-83-35-78 kernel: [1576977.209496] Pid: 15618,
comm: java Not tainted 2.6.32-317-ec2 #36-Ubuntu
Jun  5 22:06:41 ip-10-83-35-78 kernel: [1576977.209498] Call Trace:
Jun  5 22:06:41 ip-10-83-35-78 kernel: [1576977.209507]
[8107cbbc] ? cpuset_print_task_mems_allowed+0x8c/0xc0
Jun  5 22:06:41 ip-10-83-35-78 kernel: [1576977.209513]
[810b1723] oom_kill_process+0xe3/0x210
Jun  5 22:06:41 ip-10-83-35-78 kernel: [1576977.209516]
[810b18a0] __out_of_memory+0x50/0xb0
Jun  5 22:06:41 ip-10-83-35-78 kernel: [1576977.209519]
[810b195f] out_of_memory+0x5f/0xc0
Jun  5 22:06:41 ip-10-83-35-78 kernel: [1576977.209523]
[810b4641] __alloc_pages_slowpath+0x561/0x580
Jun  5 22:06:41 ip-10-83-35-78 kernel: [1576977.209526]
[810b47d1] __alloc_pages_nodemask+0x171/0x180
Jun  5 22:06:41 ip-10-83-35-78 kernel: [1576977.209530]
[810b76f7] __do_page_cache_readahead+0xd7/0x220
Jun  5 22:06:41 ip-10-83-35-78 kernel: [1576977.209534]
[810b785c] ra_submit+0x1c/0x20
Jun  5 22:06:41 ip-10-83-35-78 kernel: [1576977.209536]
[810b01fe] filemap_fault+0x3fe/0x450
Jun  5 22:06:41 ip-10-83-35-78 kernel: [1576977.209541]
[810cbef0] __do_fault+0x50/0x680
Jun  5 22:06:41 ip-10-83-35-78 kernel: [1576977.209547]
[8102afdb] ? __dequeue_entity+0x2b/0x50
Jun  5 22:06:41 ip-10-83-35-78 kernel: [1576977.209550]
[810cde30] handle_mm_fault+0x260/0x4f0
Jun  5 22:06:41 ip-10-83-35-78 kernel: [1576977.209555]
[814b3ab7] do_page_fault+0x147/0x390
Jun  5 22:06:41 ip-10-83-35-78 kernel: [1576977.209558]
[814b18e8] page_fault+0x28/0x30
Jun  5 22:06:41 ip-10-83-35-78 kernel: [1576977.209560] Mem-Info:
Jun  5 22:06:41 ip-10-83-35-78 kernel: [1576977.209561] DMA per-cpu:
Jun  5 22:06:41 ip-10-83-35-78 kernel: [1576977.209563] CPU0: hi:
  0, btch:   1 usd:   0
Jun  5 22:06:41 ip-10-83-35-78 kernel: [1576977.209565] CPU1: hi:
  0, btch:   1 usd:   0
Jun  5 22:06:41 ip-10-83-35-78 kernel: [1576977.209567] CPU2: hi:
  0, btch:   1 usd:   0
Jun  5 22:06:41 ip-10-83-35-78 kernel: [1576977.209569] CPU3: hi:
  0, btch:   1 usd:   0
Jun  5 22:06:41 ip-10-83-35-78 kernel: [1576977.209570] DMA32 per-cpu:
Jun  5 22:06:41 ip-10-83-35-78 kernel: [1576977.209572] CPU0: hi:
155, btch:  38 usd:  44
Jun  5 22:06:41 ip-10-83-35-78 kernel: [1576977.209574] CPU1: hi:
155, btch:  38 usd:   0
Jun  5 22:06:41 ip-10-83-35-78 kernel: [1576977.209575] CPU2: hi:
155, btch:  38 usd:   0
Jun  5 22:06:41 ip-10-83-35-78 kernel: [1576977.209577] CPU3: hi:
155, btch:  38 usd:   0
Jun  5 22:06:41 ip-10-83-35-78 kernel: [1576977.209578] Normal per-cpu:
Jun  5 22:06:41 ip-10-83-35-78 kernel: [1576977.209580] CPU0: hi:
155, btch:  38 usd:  32
Jun  5 22:06:41 ip-10-83-35-78 kernel: [1576977.209582] CPU1: hi:
155, btch:  38 usd:   0
Jun  5 22:06:41 ip-10-83-35-78 kernel: [1576977.209584] CPU2: hi:
155, btch:  38 usd:   0
Jun  5 22:06:41 ip-10-83-35-78 kernel: [1576977.209585] CPU3: hi:
155, btch:  38 usd:   0
Jun  5 22:06:41 ip-10-83-35-78 kernel: [1576977.209590]
active_anon:3513144 inactive_anon:29 isolated_anon:0
Jun  5 22:06:41 ip-10-83-35-78 kernel: 

isHexDigit error problems and upgrading Tomcat and jdk

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

Hi,

  We are getting isHexDigit errors again, although there is no 
malformed URL requests


  We are using Tomcat 5.5 and jdk 1.5 (from Sun). As some of you have 
suggested me in the past, I'm considering to upgrade to a more 
up-to-date Tomcat and/or jdk so I can get more support and help from the 
community since probably the stability issues are solved in newer 
versions. I have set up a test environment and Tomcat 7.0.27 and jdk 1.7 
seems to work fine.


  Do you suggest me to upgrade to Tomcat 6 or 7? What about jdk? 1.6 or 
1.7?


 Thanks

 Miguel


-


Jun 6, 2012 9:05:59 AM org.apache.tomcat.util.http.Parameters 
processParameters

WARNING: Parameters: Character decoding failed. Parameter skipped.
java.io.CharConversionException: isHexDigit
at org.apache.tomcat.util.buf.UDecoder.convert(UDecoder.java:87)
at org.apache.tomcat.util.buf.UDecoder.convert(UDecoder.java:48)
at 
org.apache.tomcat.util.http.Parameters.urlDecode(Parameters.java:411)
at 
org.apache.tomcat.util.http.Parameters.processParameters(Parameters.java:393)
at 
org.apache.tomcat.util.http.Parameters.processParameters(Parameters.java:344)
at 
org.apache.catalina.connector.Request.parseParameters(Request.java:2401)
at 
org.apache.catalina.connector.Request.getParameterNames(Request.java:1047)
at 
org.apache.catalina.connector.RequestFacade.getParameterNames(RequestFacade.java:369)
at 
javax.servlet.ServletRequestWrapper.getParameterNames(ServletRequestWrapper.java:178)
at 
org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1225)
at 
org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:821)
at 
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254)
at 
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at 
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at 
net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:185)
at 
net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:159)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875)
at 
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at 
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at 
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)

at java.lang.Thread.run(Thread.java:595)

Jun 6, 2012 10:15:22 AM org.apache.coyote.http11.Http11BaseProtocol pause
INFO: Pausing Coyote HTTP/1.1 on http-80
Jun 6, 2012 10:15:22 AM org.apache.coyote.http11.Http11BaseProtocol pause
INFO: Pausing Coyote HTTP/1.1 on http-443

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



Re: isHexDigit error problems and upgrading Tomcat and jdk

2012-06-06 Thread Konstantin Kolinko
2012/6/7 Miguel González Castaños miguel_3_gonza...@yahoo.es:
 Hi,

  We are getting isHexDigit errors again, although there is no malformed URL
 requests

It is parameter parsing code. It cannot claim the request as malformed
(API does not allow it). It can only skip malformed parameters.

It sets some error flag that can be examined. FailedRequestFilter is
example of a filter that checks that flag.

  We are using Tomcat 5.5 and jdk 1.5 (from Sun). As some of you have
 suggested me in the past, I'm considering to upgrade to a more up-to-date
 Tomcat and/or jdk so I can get more support and help from the community
 since probably the stability issues are solved in newer versions. I have set
 up a test environment and Tomcat 7.0.27 and jdk 1.7 seems to work fine.

  Do you suggest me to upgrade to Tomcat 6 or 7? What about jdk? 1.6 or 1.7?

1.6 is more widely tested (many years), but for a new system I would
go with 1.7.

I heard that Oracle plans to stop provide free updates for 1.6 this
summer. So they will be available only as Java for Business.

Best regards,
Konstantin Kolinko

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



RE: Request for Aliases or Alias as element inside Context

2012-06-06 Thread Esmond Pitt
For information of the list, this was first opened as a feature request:
https://issues.apache.org/bugzilla/show_bug.cgi?id=53359 but after
discussion the following was implemented instead and will be in 7.0.28:
https://issues.apache.org/bugzilla/show_bug.cgi?id=53373. Basically
whitespace is now allowed around the comma and the '=' in the attribute, so
e.g. newlines and whitespace can be used. This meets my requirement
entirely.


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



Re: Can someone suggest mail some opensource mail server which works well with Tomcat.

2012-06-06 Thread Kiran Badi




If you are going to use Javamail to access a remote mailbox (even if
it's on localhost), then you can use any email server software that
otherwise meets your needs. Javamail can communicate with any POP3 or
IMAP server -- it need not be Java-based. You can even use Google Mail
as your email service if you want (for both SMTP/send and
POP3/IMAP/fetch).

Kiran: Is google mail a part of google apps or its normal gmail service which 
we use ?.I feel there might be some limits on the number of requests like 
google api's Can you elaborate more please.

Any feedback on apache james ?







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