Java Mailing List Archive

http://www.junlu.com/

Home » users-digest.tomcat »

users Digest 20 Mar 2013 00:24:10 -0000 Issue 11303

users-digest-help

2013-03-19


Author LoginPost Reply

users Digest 20 Mar 2013 00:24:10 -0000 Issue 11303

Topics (messages 240529 through 240550)

Re: Deadlock when using jetty 8 JDBCSessionManager and Tomcat 7 JDBC Connector
 240529 by: Christopher Schultz
 240547 by: Howard W. Smith, Jr.

Re: problems faced in deploying servlet
 240530 by: Christopher Schultz
 240549 by: Mark Eggers

Re: help on websockets
 240531 by: Christopher Schultz
 240534 by: Muralidhar Yaragalla
 240535 by: Muralidhar Yaragalla
 240536 by: Christopher Schultz
 240537 by: Caldarale, Charles R
 240538 by: Muralidhar Yaragalla
 240539 by: Muralidhar Yaragalla
 240544 by: André Warnier

Re: Tomcat jdbc-pool not closing statements
 240532 by: Christopher Schultz
 240533 by: Bertrand Guay-Paquet
 240541 by: Felix Schumacher
 240542 by: Bertrand Guay-Paquet

small question on Connection
 240540 by: Muralidhar Yaragalla
 240545 by: Caldarale, Charles R

Manager App not working with Windows authentication enabled
 240543 by: Harris Mark R
 240546 by: André Warnier
 240548 by: Harris Mark R

Re: Upgrading Tomcat in the customer base
 240550 by: Martin Gainty

Administrivia:

---------------------------------------------------------------------
To post to the list, e-mail: users@(protected)
To unsubscribe, e-mail: users-digest-unsubscribe@(protected)
For additional commands, e-mail: users-digest-help@(protected)

----------------------------------------------------------------------


Attachment: users_240529.eml (zipped)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Colin,

On 3/19/13 2:29 PM, Colin Ingarfield wrote:
> First of all, thank you this detailed analysis of the situation.
> Based on the bug report I suspected the driver, but it now seems
> clear it was (at least part of) the problem.
>
> re: Why was it necessary for the abandoned connection thread to
> act? I'm not sure.. I looked into the JDBC Session manager class
> and it appeared to be simply reading/deserializing a session from
> the database when the deadlock occurred. I would expect that to be
> a very fast query -- this is a production system but under very
> light load.
>
> I looked into the pool configuration and 'removed abandoned
> timeout' was 60 seconds. That timeout seems a bit short, but if it
> takes > 60 sec to load a session from the database then there is a
> serious performance issue. I've never observed delays like that in
> the application.

I would agree that loading a session from the db should take less than
60 seconds. I'm not sure exactly how your session manager works, but I
suspect that loading a complete session from the db into memory is a
fairly rare event. If it happened a lot, and it took a long time (like
more than 10 seconds), I suspect your website would be quite unusable
- -- or at least very unpleasant to use.

> My guess at this point is perhaps the db (Amazon RDS/MySql) was
> unavailable/very slow/down in some way, causing this connection to
> be held beyond the timeout. I don't have great visibility into
> performance or outage information for RDS, tho I may reach out to
> DBAs and try to get it.

Consider enabling a performance-monitoring interceptor (I believe
there is one included out-of-the-box but as I've never actually used
Tomcat's pool I'm not 100% certain): you may get some good information
about average and maybe even peak pool usage (e.g. average length of
pool check-out).

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

iEYEAREIAAYFAlFIwwMACgkQ9CaO5/Lv0PCbMQCfR2IDE4EeyzDel77hg5J+oHxe
bzoAoJ/fMSMzGoKrY/Mcbjmj/U8vMqjA
=vzRa
-----END PGP SIGNATURE-----


Attachment: users_240547.eml (zipped)
On Tue, Mar 12, 2013 at 5:51 PM, Mark Thomas <markt@(protected):

> On 12/03/2013 21:47, Colin Ingarfield wrote:
> > Hello,
> >
> > We're using Jetty 8.1.3.v20120416 w/ JDBCSessionManager as our
> application
> > server with Tomcat 7's JDBC Connection pool 7.0.28. We've run this
> > particular combination in production since at least Sept 2012. (Java 6
> 64
> > bit/Ubuntu, Amazon RDS/MySQL db.)
> >
> > This morning one Jetty instance stopped accepting requests and the
> problem
> > appears to be a deadlock btw a jetty connection handler thread and the
> conn
> > pool's "PoolCleaner" thread. From jstack trace:
> > Deadlock Detection:
> >
> > Found one Java-level deadlock:
> > =============================
> >
> > "qtp1840392480-3740":
> >  waiting to lock Monitor@(protected),
> a
> > com/mysql/jdbc/JDBC4Connection),
> >  which is held by "PoolCleaner[2009981184:1363034108768]"
> > "PoolCleaner[2009981184:1363034108768]":
> >  waiting to lock Monitor@(protected),
> a
> > com/mysql/jdbc/JDBC4ResultSet),
> >  which is held by "qtp1840392480-3740"
> >
> > Once this happened all other worker threads blocked at various points
> > within JDBCSession manager. Obviously restarting the instance resolved
> the
> > issue for now.
> >
> > How does one go about diagnosing / resolving such an issue? It's not
> clear
> > to me if either component is "at fault" here...I have the full jstack
> > output as well as a full heap dump of the java process, if that would
> help.
>
> Deadlocks occur when two threads attempt to acquire the same locks but
> in a different order. Normally, one of the code paths is at fault. To
> figure out which we need to see the full stack trace for the two threads
> that are deadlocked.
>
> Mark
>
>
I experienced deadlock today while revisiting development of some code that
would automatically insert some data in the background via @Schedule timers.

While first testing the code, I had CDI @RequestScoped bean referencing
@Stateless EJBs to perform inserts against many different tables. That is
when I experienced the deadlock, but then I changed the bean from CDI
@RequestScoped back to @Singleton and @Lock(WRITE) (as advised by David
Blevins of TomEE/openEJB...months ago), and immediately the deadlock went
away. Using TomEE (tomcat7), ActiveMQ/JMS, @Schedule, @Singleton
@Lock(WRITE) and plenty of @Stateless EJBs (1 per table) to get it all
done.... and on my development server, takes few seconds for everything to
work, and 1 second on the database insert and commit.

I assume that the CDI @RequestScoped and @Stateless EJBs were executing
concurrently/simultaneously, which I assume is the 2 threads that Mark was
talking about here.



>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@(protected)
> For additional commands, e-mail: users-help@(protected)
>
>

Attachment: users_240530.eml (zipped)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Leo,

On 3/19/13 12:15 PM, Leo Donahue - RDSA IT wrote:
>> -----Original Message----- From: Satya Priya Das
>> [mailto:am_spdas@(protected)
>> deploying servlet
>>
>> I am a retd. software person,worked with
>> autocoder,COBOL,assembler,c, and now trying to learn java, I am
>> using Java for the Web with Servlets,jsp,and EJB by Budi
>> Kurniwan, but unfortunatetely the tomcat v4 has been used in the
>> book for examples. Downloading of tomcat6.0.36, and installing of
>> tomcat has been done success fully.The example in chapter one has
>> been compiled and tested o.k.,The servlet context example
>> compiled and deployed successfully. Now the example for
>> RequestDemoServlet has been compiled o.k, but when I want to
>> deploy the example with index.html file using action element,
>> the source not found message is displayed. I have used alias
>> name,class name, even url-mapping but result is same. A directory
>> myapp has been created under which subdirs are build,doc,web and
>> build.xml build.properties file. The wb.xml file created as per
>> book with //DTDWeb application 2.3//en pL. guide me how I can
>> trace the causes of resource not found message. Thanks s.p.das
>
> I looked up your book online using Google Books. I can see on
> page 31 where your project starts, but it skips the rest of the
> pages to page 34. I'm guessing this line is your problem:
>
> <FORM ACTION=servlet/ResponseDemoServlet METHOD="POST">
>
> Tomcat 4 had something called the invoker servlet turned on by
> default, which meant requests were passed through the mapping of:
> servlet/someservletname.

+1

> Tomcat 6 doesn't have that on by default anymore, and you should
> leave it that way.

+1

> All you need to do is update the url-mapping for your form's
> action to the correct url pattern, based on how you deployed your
> "myapp" and how you referenced this servlet in your web.xml.

Yup: something like <form action="ResponseDemoServlet"> in your HTML
and then a <servlet> that defines the servlet in web.xml and then a
<servlet-mapping> which maps it later on -- also in web.xml.

> You are likely going to be confused throughout this book if all
> the examples are based on Tomcat 4. I don't know anyone still
> putting HTML code in out.println statements. Can you afford to get
> a newer book on JSP/Servlets? There are also semi-decent websites
> that have some newer content.

I completely agree: while webapps are (mostly) forward-compatible with
newer servers, a lot of old books are going to be relying on features
like the invoker servlet.

Go get a copy of "Tomcat: The Definitive Guide" by Jason Brittain (who
happens to lurk on this list, FYI) and Ian Darwin. It's targeted at
Tomcat 6.x but not much has changed (with old features) since its
publication. There's plenty of new, exciting stuff but the basics will
be well-covered by T:TDG.

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

iEYEAREIAAYFAlFIxO4ACgkQ9CaO5/Lv0PAN4gCfWm/TCacnneTXW6i0377mABPu
cSoAoK53HOPGBQZQ/Vdac9Ey2pJLnJE0
=NNvB
-----END PGP SIGNATURE-----


Attachment: users_240549.eml (zipped)
On 3/19/2013 1:05 PM, Christopher Schultz wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Leo,
>
> On 3/19/13 12:15 PM, Leo Donahue - RDSA IT wrote:
>>> -----Original Message----- From: Satya Priya Das
>>> [mailto:am_spdas@(protected)
>>> deploying servlet
>>>
>>> I am a retd. software person,worked with
>>> autocoder,COBOL,assembler,c, and now trying to learn java, I am
>>> using Java for the Web with Servlets,jsp,and EJB by Budi
>>> Kurniwan, but unfortunatetely the tomcat v4 has been used in the
>>> book for examples. Downloading of tomcat6.0.36, and installing of
>>> tomcat has been done success fully.The example in chapter one has
>>> been compiled and tested o.k.,The servlet context example
>>> compiled and deployed successfully. Now the example for
>>> RequestDemoServlet has been compiled o.k, but when I want to
>>> deploy the example with index.html file using action element,
>>> the source not found message is displayed. I have used alias
>>> name,class name, even url-mapping but result is same. A directory
>>> myapp has been created under which subdirs are build,doc,web and
>>> build.xml build.properties file. The wb.xml file created as per
>>> book with //DTDWeb application 2.3//en pL. guide me how I can
>>> trace the causes of resource not found message. Thanks s.p.das
>>
>> I looked up your book online using Google Books. I can see on
>> page 31 where your project starts, but it skips the rest of the
>> pages to page 34. I'm guessing this line is your problem:
>>
>> <FORM ACTION=servlet/ResponseDemoServlet METHOD="POST">
>>
>> Tomcat 4 had something called the invoker servlet turned on by
>> default, which meant requests were passed through the mapping of:
>> servlet/someservletname.
>
> +1
>
>> Tomcat 6 doesn't have that on by default anymore, and you should
>> leave it that way.
>
> +1
>
>> All you need to do is update the url-mapping for your form's
>> action to the correct url pattern, based on how you deployed your
>> "myapp" and how you referenced this servlet in your web.xml.
>
> Yup: something like <form action="ResponseDemoServlet"> in your HTML
> and then a <servlet> that defines the servlet in web.xml and then a
> <servlet-mapping> which maps it later on -- also in web.xml.
>
>> You are likely going to be confused throughout this book if all
>> the examples are based on Tomcat 4. I don't know anyone still
>> putting HTML code in out.println statements. Can you afford to get
>> a newer book on JSP/Servlets? There are also semi-decent websites
>> that have some newer content.
>
> I completely agree: while webapps are (mostly) forward-compatible with
> newer servers, a lot of old books are going to be relying on features
> like the invoker servlet.
>
> Go get a copy of "Tomcat: The Definitive Guide" by Jason Brittain (who
> happens to lurk on this list, FYI) and Ian Darwin. It's targeted at
> Tomcat 6.x but not much has changed (with old features) since its
> publication. There's plenty of new, exciting stuff but the basics will
> be well-covered by T:TDG.

+1

This is a great book for Tomcat. I also recommend the following book for
learning Servlets, JSP, etc.

Head First Servlets and JSP, 2nd Edition
By Bryan Basham, Kathy Sierra, Bert Bates

It's an enjoyable read even for us old farts who come from traditional
programming backgrounds. It manages to cover both the standards (2.5)
and some best practices at the same time.

I'm not an author, nor affiliated with O'Reilly. I'm just a happy reader.

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




Attachment: users_240531.eml (zipped)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Muralidhar,

Please don't top-post. See my response below.

On 3/17/13 4:44 PM, Muralidhar Yaragalla wrote:
> On Mon, Mar 18, 2013 at 2:00 AM, Mark Thomas <markt@(protected)>
> wrote:
>
>> On 17/03/2013 20:17, Muralidhar Yaragalla wrote:
>>> Hi I have downloaded the tomcat 7.0.37 and trying to run the
>>> websocket
>> chat
>>> program which is with "javax.wesocket" annotations but the
>>> annotations
>> are
>>> not being recognized. how to run this on tomcat.
>>
>> Tomcat 7.0.x does not (yet) implement JSR-356.
>>
>> Tomcat's JSR-356 implementation is a work-in-progress on trunk
>> (i.e. Tomcat 8.0.x). Once the JSR-356 implementation is complete,
>> the non-JSR-356 WebSocket implementation in Tomcat 7 will be
>> deprecated and the JSR-356 implementation ported from trunk to
>> replace it.
>
> Thank you. Without implementing jsr why would they show examples
> in tomcat7 online docs. It is so much confusing. Thanks anyway.

Can you give an example of where some Tomcat 7 online documentation is
inaccurate?

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

iEYEAREIAAYFAlFIxXAACgkQ9CaO5/Lv0PAo9gCfY4IwIMec5mFjs+sfGECxHK2Z
SSAAoKEgs8kJqXP2qTGyKt+C8w2ybdEB
=7s6K
-----END PGP SIGNATURE-----


Attachment: users_240534.eml (zipped)
Hi Christopher,
The following is the link in tomcat7 docs
http://tomcat.apache.org/tomcat-7.0-doc/web-socket-howto.html

in this under the application development section there is a pointer to
server side code which shows an example implementation of chat application
with annotations. You can have a look at it.


On Wed, Mar 20, 2013 at 1:37 AM, Christopher Schultz <
chris@(protected):

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Muralidhar,
>
> Please don't top-post. See my response below.
>
> On 3/17/13 4:44 PM, Muralidhar Yaragalla wrote:
> > On Mon, Mar 18, 2013 at 2:00 AM, Mark Thomas <markt@(protected)>
> > wrote:
> >
> >> On 17/03/2013 20:17, Muralidhar Yaragalla wrote:
> >>> Hi I have downloaded the tomcat 7.0.37 and trying to run the
> >>> websocket
> >> chat
> >>> program which is with "javax.wesocket" annotations but the
> >>> annotations
> >> are
> >>> not being recognized. how to run this on tomcat.
> >>
> >> Tomcat 7.0.x does not (yet) implement JSR-356.
> >>
> >> Tomcat's JSR-356 implementation is a work-in-progress on trunk
> >> (i.e. Tomcat 8.0.x). Once the JSR-356 implementation is complete,
> >> the non-JSR-356 WebSocket implementation in Tomcat 7 will be
> >> deprecated and the JSR-356 implementation ported from trunk to
> >> replace it.
> >
> > Thank you. Without implementing jsr why would they show examples
> > in tomcat7 online docs. It is so much confusing. Thanks anyway.
>
> Can you give an example of where some Tomcat 7 online documentation is
> inaccurate?
>
> - -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/
>
> iEYEAREIAAYFAlFIxXAACgkQ9CaO5/Lv0PAo9gCfY4IwIMec5mFjs+sfGECxHK2Z
> SSAAoKEgs8kJqXP2qTGyKt+C8w2ybdEB
> =7s6K
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@(protected)
> For additional commands, e-mail: users-help@(protected)
>
>


--
Thanks And Regards,
*Muralidhar Yaragalla.
*

Attachment: users_240535.eml (zipped)
sorry, I use gmail and i am not sure how to avoid top-posting.


On Wed, Mar 20, 2013 at 1:37 AM, Christopher Schultz <
chris@(protected):

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Muralidhar,
>
> Please don't top-post. See my response below.
>
> On 3/17/13 4:44 PM, Muralidhar Yaragalla wrote:
> > On Mon, Mar 18, 2013 at 2:00 AM, Mark Thomas <markt@(protected)>
> > wrote:
> >
> >> On 17/03/2013 20:17, Muralidhar Yaragalla wrote:
> >>> Hi I have downloaded the tomcat 7.0.37 and trying to run the
> >>> websocket
> >> chat
> >>> program which is with "javax.wesocket" annotations but the
> >>> annotations
> >> are
> >>> not being recognized. how to run this on tomcat.
> >>
> >> Tomcat 7.0.x does not (yet) implement JSR-356.
> >>
> >> Tomcat's JSR-356 implementation is a work-in-progress on trunk
> >> (i.e. Tomcat 8.0.x). Once the JSR-356 implementation is complete,
> >> the non-JSR-356 WebSocket implementation in Tomcat 7 will be
> >> deprecated and the JSR-356 implementation ported from trunk to
> >> replace it.
> >
> > Thank you. Without implementing jsr why would they show examples
> > in tomcat7 online docs. It is so much confusing. Thanks anyway.
>
> Can you give an example of where some Tomcat 7 online documentation is
> inaccurate?
>
> - -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/
>
> iEYEAREIAAYFAlFIxXAACgkQ9CaO5/Lv0PAo9gCfY4IwIMec5mFjs+sfGECxHK2Z
> SSAAoKEgs8kJqXP2qTGyKt+C8w2ybdEB
> =7s6K
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@(protected)
> For additional commands, e-mail: users-help@(protected)
>
>


--
Thanks And Regards,
*Muralidhar Yaragalla.
*

Attachment: users_240536.eml (zipped)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Muralidhar,

On 3/19/13 4:43 PM, Muralidhar Yaragalla wrote:
> Hi Christopher, The following is the link in tomcat7 docs
> http://tomcat.apache.org/tomcat-7.0-doc/web-socket-howto.html
>
> in this under the application development section there is a
> pointer to server side code which shows an example implementation
> of chat application with annotations. You can have a look at it.

You'll note that page says more than once that the implementation is
unstable and may change at any moment without notification.

It is true, though, that the page (for Tomcat 7) includes links into
viewvc that point to the Tomcat's trunk (which will ultimately be the
forthcoming Tomcat 8) instead of Tomcat 7.

So, if you want to use those examples, I'm afraid you'll have to start
using Tomcat trunk (which currently has no official binary releases).
Fortunately, building Tomcat from source is quite easy these days.

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

iEYEAREIAAYFAlFIzw4ACgkQ9CaO5/Lv0PBXZgCguFePAZikzgn1u/3Tfc5yht0Q
c3MAoJQItSfFZ6K1B2CCU1jfoVieWUv1
=zCNx
-----END PGP SIGNATURE-----


Attachment: users_240537.eml (zipped)
> From: Muralidhar Yaragalla [mailto:java.yaragalla@(protected)]
> Subject: Re: help on websockets

> sorry, I use gmail and i am not sure how to avoid top-posting.

Write your response _below_ the point you are replying to. (This has nothing to do with gmail.)

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



Attachment: users_240538.eml (zipped)
Hi Christopher,
  I dont want to go for those examples which might be in effect from
tomcat8. I am fine with tomcat7 and examples that comes with the
distribution. I am using websockets but i have centralized that code so
when websocket spec changes and when tomcat provides implementation for new
spec that point of time i will change the code. They are only 1-2 classes.
so no problem.


On Wed, Mar 20, 2013 at 2:18 AM, Christopher Schultz <
chris@(protected):

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Muralidhar,
>
> On 3/19/13 4:43 PM, Muralidhar Yaragalla wrote:
> > Hi Christopher, The following is the link in tomcat7 docs
> > http://tomcat.apache.org/tomcat-7.0-doc/web-socket-howto.html
> >
> > in this under the application development section there is a
> > pointer to server side code which shows an example implementation
> > of chat application with annotations. You can have a look at it.
>
> You'll note that page says more than once that the implementation is
> unstable and may change at any moment without notification.
>
> It is true, though, that the page (for Tomcat 7) includes links into
> viewvc that point to the Tomcat's trunk (which will ultimately be the
> forthcoming Tomcat 8) instead of Tomcat 7.
>
> So, if you want to use those examples, I'm afraid you'll have to start
> using Tomcat trunk (which currently has no official binary releases).
> Fortunately, building Tomcat from source is quite easy these days.
>
> - -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/
>
> iEYEAREIAAYFAlFIzw4ACgkQ9CaO5/Lv0PBXZgCguFePAZikzgn1u/3Tfc5yht0Q
> c3MAoJQItSfFZ6K1B2CCU1jfoVieWUv1
> =zCNx
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@(protected)
> For additional commands, e-mail: users-help@(protected)
>
>


--
Thanks And Regards,
*Muralidhar Yaragalla.
*

Attachment: users_240539.eml (zipped)
On Wed, Mar 20, 2013 at 2:19 AM, Caldarale, Charles R <
Chuck.Caldarale@(protected):

> > From: Muralidhar Yaragalla [mailto:java.yaragalla@(protected)]
> > Subject: Re: help on websockets
>
> > sorry, I use gmail and i am not sure how to avoid top-posting.
>
> Write your response _below_ the point you are replying to. (This has
> nothing to do with gmail.)
>
> - 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-unsubscribe@(protected)
> For additional commands, e-mail: users-help@(protected)
>
>

Ok thanks.
--
Thanks And Regards,
*Muralidhar Yaragalla.
*

Attachment: users_240544.eml (zipped)
Muralidhar Yaragalla wrote:
> On Wed, Mar 20, 2013 at 2:19 AM, Caldarale, Charles R <
> Chuck.Caldarale@(protected):
>
>>> From: Muralidhar Yaragalla [mailto:java.yaragalla@(protected)]
>>> Subject: Re: help on websockets
>>> sorry, I use gmail and i am not sure how to avoid top-posting.
>> Write your response _below_ the point you are replying to. (This has
>> nothing to do with gmail.)
>>
>> - 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-unsubscribe@(protected)
>> For additional commands, e-mail: users-help@(protected)
>>
>>
>
> Ok thanks.
*Just* below the item to which you are responding is even better.


Attachment: users_240532.eml (zipped)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Bertrand,

On 3/19/13 3:48 PM, Bertrand Guay-Paquet wrote:
> I'm using Tomcat 7.0.34 via TomEE 1.5.1 with MySQL. I noticed a
> memory leak in my web application which uses jdbc connection
> pooling with Tomcat's jdbc-pool.
>
> The com.mysql.jdbc.JDBC4Connection class has a field named
> "openStatements" which holds, as you can imagine, open sql
> statements. This structure grows continuously over time and no
> statements are ever released. I stepped into my code to verify that
> I closed opened statements and it is the case.

Can you post some example of your code? Can you also post your pool's
configuration?

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

iEYEAREIAAYFAlFIxyEACgkQ9CaO5/Lv0PCdOQCgotmWjkcCxnZvknexMq3ZY2Dp
t64An1WxIm9ptEK24Yq2ub2qbjdw+u7v
=RyXf
-----END PGP SIGNATURE-----


Attachment: users_240533.eml (zipped)
> Can you post some example of your code? Can you also post your pool's
> configuration?
Here is my configuration from tomee.xml. I'm not 100% sure how it maps
to Tomcat values though.
<Resource id="jdbc/my-db" type="javax.sql.DataSource">
 JdbcDriver=com.mysql.jdbc.Driver
 JdbcUrl=jdbc:mysql://localhost:3306/DBNAME
 UserName=....
 Password=....
 JtaManaged=true
ConnectionProperties=characterEncoding=UTF-8;useLegacyDatetimeCode=false
 initialSize=10
 maxActive=100
 maxIdle=30
 validationQuery=/* ping */
 testOnBorrow=true
 testWhileIdle=true
 timeBetweenEvictionRunsMillis=10000
 minEvictableIdleTimeMillis=60000
</Resource>

Adding "DataSourceCreator=dbcp" to the configuration stops the leak
without any other change to my code. This option reverts the connection
pooling of TomEE to commons-dbcp.

My code uses MyBatis 3.2.1 for the actual management of jdbc, so I'm not
sure which information would help. I use a mapper and I can guarantee
that sqlSession.close() is called which in turn calls
Connection#close(). The code which closes Statements is inside MyBatis.

Let me know if you need more information.

Regards,
Bertrand


Attachment: users_240541.eml (zipped)


Bertrand Guay-Paquet <bernie@(protected):

>Hello,
>
>I'm using Tomcat 7.0.34 via TomEE 1.5.1 with MySQL. I noticed a memory
>leak in my web application which uses jdbc connection pooling with
>Tomcat's jdbc-pool.
>
>The com.mysql.jdbc.JDBC4Connection class has a field named
>"openStatements" which holds, as you can imagine, open sql statements.
>This structure grows continuously over time and no statements are ever
>released. I stepped into my code to verify that I closed opened
>statements and it is the case.
>
Have you looked at http://grokbase.com/t/openejb/users/13135d2a0v/jdbc-connection-pool-memory-leak ? It seems like your problem.

Regards
Felix

>Digging some more, I downloaded Tomcat's source and it seems that
>jdbc-pool discards all calls to java.sql.Statement.close() in
>StatementDecoratorInterceptor#invoke(Object proxy, Method method,
>Object[] args)
>
>I see what could be a bug in StatementCache#closeInvoked() which is
>called by the above method. Here is the code with my own comments
>added:
>@(protected)
>public void closeInvoked() {
>   boolean shouldClose = true;
>   if (cacheSize.get() < maxCacheSize) {
>      // omitted for brievety
>   }
>   closed = true;
>   // [1] I think "delegate = null" is done too soon
>   delegate = null;
>   if (shouldClose) {
>      // check its body below
>      super.closeInvoked();
>   }
>}
>
>// This is super.closeInvoked()
>public void closeInvoked() {
>   if (getDelegate()!=null) {
>      // never true when coming from
>      // StatementCache#closeInvoked()
>      // because of [1]
>      try {
>         getDelegate().close();
>      }catch (SQLException ignore) {
>      }
>   }
>   closed = true;
>   delegate = null;
>}
>
>Regards,
>Bertrand
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@(protected)
>For additional commands, e-mail: users-help@(protected)




Attachment: users_240542.eml (zipped)
On 19/03/2013 5:05 PM, Felix Schumacher wrote:
> Have you looked at
> http://grokbase.com/t/openejb/users/13135d2a0v/jdbc-connection-pool-memory-leak
> ? It seems like your problem. Regards Felix

Indeed, this is extremely similar to my issue. Thanks for sharing this.

It does seem however like the StatementFinalizer Tomcat interceptor
should not be necessary if an application closes its connections,
statements and result sets properly. From what I could see by stepping
in the code, this is the case with MyBatis. The actual source of the
problem really seems to be that Tomcat's jdbc pool swallows calls to
Statement.close() like I showed in my original message.

Regards,
Bertrand


Attachment: users_240540.eml (zipped)
Hi I am using tomcat connection pool. When using datasource (jdbc) do i
have to manually close the connection using Connection.close();

--
Thanks And Regards,
*Muralidhar Yaragalla.
*

Attachment: users_240545.eml (zipped)
> From: Muralidhar Yaragalla [mailto:java.yaragalla@(protected)]
> Subject: small question on Connection

> I am using tomcat connection pool. When using datasource (jdbc) do i
> have to manually close the connection using Connection.close();

Short answer: yes. Long (and much more comprehensive) answer:

http://blog.christopherschultz.net/index.php/2009/03/16/properly-handling-pooled-jdbc-connections/

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



Attachment: users_240543.eml (zipped)
Environment:
IIS 7.5
Tomcat 7.037
AJP/1.3 connector (redirector.dll) v 1.2
Java 7

We have a requirement for a new intranet application that it use Windows authentication. We have this working in our new application. We do have IIS, the connector and Tomcat serving up the application with no problems.

What did happen is that we discovered that the manager application that comes with Tomcat no longer is accessible. We have some staff that use the manager app routinely.
We did try to set up two AJP connectors, one defined in the server.xml with tomcatAuthentication="true" and another set to false.  In the AJP property files we set the second one to only be mapped to the manager URL. This did not work as we expected.

Anyone have any ideas on how to get the manager application working?

Excerpt from server.xml:
___________________________________________________
<GlobalNamingResources>
  <Resource auth="Container" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" name="UserDatabase" pathname="E:\Tomcat\32Bit\7.0.37\conf\tomcat-users.xml" type="org.apache.catalina.UserDatabase"/>
</GlobalNamingResources>
<Service name="Catalina">
  <Connector connectionTimeout="12000" maxThreads="300" port="10000" protocol="AJP/1.3" tomcatAuthentication="false"/>
          <Connector connectionTimeout="12000" maxThreads="300" port="10005" protocol="AJP/1.3" tomcatAuthentication="true"/>
          <Connector connectionTimeout="20000" port="9080" protocol="HTTP/1.1" redirectPort="8443"/>
  <Engine defaultHost="localhost" jvmRoute="WA1" name="Catalina">
   <Realm className="org.apache.catalina.realm.LockOutRealm">
    <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>
   </Realm>
   <Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true">
    <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" pattern="%h %l %u %t &quot;%r&quot; %s %b" prefix="localhost_access_log." suffix=".txt"/>
   </Host>
  </Engine>
</Service>


Excerpt from worker.properties file
______________________________________________
worker.list=WA1,MGR

worker.WA1.type=ajp13
worker.WA1.host=localhost
worker.WA1.port=10000
worker.WA1.connection_pool_size=300
worker.WA1.connection_pool_timeout=12

worker.MGR.type=ajp13
worker.MGR.host=localhost
worker.MGR.port=10005
worker.MGR.connection_pool_size=300
worker.MGR.connection_pool_timeout=12

Excerpt from uriworkermap.properties:
___________________________________________________
/manager|/*=MGR

R. Mark Harris


Attachment: users_240546.eml (zipped)
Harris Mark R wrote:
> Environment:
> IIS 7.5
> Tomcat 7.037
> AJP/1.3 connector (redirector.dll) v 1.2
> Java 7
>
> We have a requirement for a new intranet application that it use Windows authentication. We have this working in our new application. We do have IIS, the connector and Tomcat serving up the application with no problems.
>
> What did happen is that we discovered that the manager application that comes with Tomcat no longer is accessible. We have some staff that use the manager app routinely.
> We did try to set up two AJP connectors, one defined in the server.xml with tomcatAuthentication="true" and another set to false.  In the AJP property files we set the second one to only be mapped to the manager URL. This did not work as we expected.

Setting tomcatAuthentication="false" in this case means that Tomcat is going to rely on
the authenticated user-id sent to it by the front-end, through AJP.
So you should authenticate the user at the Apache httpd front-end level.

>
> Anyone have any ideas on how to get the manager application working?

How would you like the users of the manager application to be authenticated ? also via
Windows Integrated Authentication, or at the Apache httpd level, via some other mechanism ?

For a simple case, you could for example do this at the Apache httpd level :

<Location /manager>
 setHandler jakarta-servlet
 AuthType Basic
 AuthName tomcat-manager
 require user x y z ...
 ...
</Location>

(and set tomcatAuthentication="false")

("setHandler jakarta-servlet" in that <Location> section is roughly equivalent to "JkMount
/manager" worker1)

This syntax is explained in one of the on-line AJP connector's info pages on the tomcat
website, at the very end of the page.



Attachment: users_240548.eml (zipped)
Sorry, guess I was not clear enough. We are using Microsoft's IIS to front-end Tomcat, not the Apache HTTP server. Apache HTTP server is not an option for our environment. We would prefer to use the Windows authenticated user passed to Tomcat by IIS, but are open to anything that works reliably.

As I said, our custom application is working great in this environment, but the manager app is not. We are having trouble associating the roles that the manager app is expecting with the authenticated user.  We have tried altering the tomcat-users file just about every which way we could think of.  Essentially we need any way to associate the authenticated user with the " "manager-gui" that the manager app is expecting. Would we need to implement a custom realm to make this work?

- Mark Harris
-

-----Original Message-----
From: André Warnier [mailto:aw@(protected)]
Sent: Tuesday, March 19, 2013 3:28 PM
To: Tomcat Users List
Subject: Re: Manager App not working with Windows authentication enabled

Harris Mark R wrote:
> Environment:
> IIS 7.5
> Tomcat 7.037
> AJP/1.3 connector (redirector.dll) v 1.2 Java 7
>
> We have a requirement for a new intranet application that it use Windows authentication. We have this working in our new application. We do have IIS, the connector and Tomcat serving up the application with no problems.
>
> What did happen is that we discovered that the manager application that comes with Tomcat no longer is accessible. We have some staff that use the manager app routinely.
> We did try to set up two AJP connectors, one defined in the server.xml with tomcatAuthentication="true" and another set to false.  In the AJP property files we set the second one to only be mapped to the manager URL. This did not work as we expected.

Setting tomcatAuthentication="false" in this case means that Tomcat is going to rely on the authenticated user-id sent to it by the front-end, through AJP.
So you should authenticate the user at the Apache httpd front-end level.

>
> Anyone have any ideas on how to get the manager application working?

How would you like the users of the manager application to be authenticated ? also via Windows Integrated Authentication, or at the Apache httpd level, via some other mechanism ?

For a simple case, you could for example do this at the Apache httpd level :

<Location /manager>
 setHandler jakarta-servlet
 AuthType Basic
 AuthName tomcat-manager
 require user x y z ...
 ...
</Location>

(and set tomcatAuthentication="false")

("setHandler jakarta-servlet" in that <Location> section is roughly equivalent to "JkMount /manager" worker1)

This syntax is explained in one of the on-line AJP connector's info pages on the tomcat website, at the very end of the page.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@(protected)
For additional commands, e-mail: users-help@(protected)



Attachment: users_240550.eml (zipped)
Patrick if client and tc-server are on same domain..how about implementing Windows Authentication in TC?
When client authenticates to the Domain all of the TC shares are restored (including TC share) http://tomcat.apache.org/tomcat-7.0-doc/windows-auth-howto.html

HTHMartin ______________________________________________
..place disclaimer here...

> From: pflahrty@(protected)
> To: users@(protected)
> Subject: Upgrading Tomcat in the customer base
> Date: Tue, 19 Mar 2013 15:24:07 -0400
>
> Hi,
>
> We deploy tomcat in our own folder (c:\rsi_tc\tomcat) on a WIndows
> machine as a service. We use the service.bat to install
> as a service. Historically to update tomcat we would remove the
> current version and install the new version. There is rub in all
> this which we have to change the service login to be an account that
> can access files from a network share. Therefore when
> we upgrade tomcat, we remove the current version and install the new
> version and then someone ( the customer :-( ) has to
> go into the service and change the service login back to the account
> that will give them access to the network share.
>
> I'm looking for a way (if possible) to avoid having the customer to
> have change the service login. I'm looking for suggestions
> to make this easier and have the following questions about whether
> some of my thoughts to make it easier are safe.
>
> 1. Can I *not* uninstall the service and just replace the folder
> structure on the file system with the new version? I have tried it
>    and it seems to work but question whether or not it is safe. I
> know if a major version changes I cannot do this as the service
>    calls tomcat6.exe vs tomcat7.exe for instance and therefore would
> have to do the complete uninstall/install.
>
> 2. If I do the above does calling the "service.bat install" again
> using the *newer* service.bat version make a difference? We are
> calling it (the newer service.bat)
>    and it seems to be harmless and thought that it might help in
> case something in the batch install changed, we would get the changes.
>
> Bottom line, has anyone faced this dilemma and found a successful way
> to upgrade a tomcat instance that uses a unique service login.
>
> Thanks for any input.
> Pat
>
>
>
>  
>  
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@(protected)
> For additional commands, e-mail: users-help@(protected)
>
           
©2008 junlu.com - Jax Systems, LLC, U.S.A.