Re: Is Container Managed Transactions possible in case of Tomcat ?

2015-08-19 Thread Howard W. Smith, Jr.
On Aug 19, 2015 3:56 PM, "Sreyan Chakravarty" 
wrote:
>
> TomEE supports Apache OpenJPA. What if I wanted to use Hibernate as my JPA
> provider ?
>

I searched Google for

tomee hibernate tutorial

And found

http://tomee.apache.org/examples-trunk/jpa-hibernate/README.html

https://rmannibucau.wordpress.com/2012/07/01/hibernate-tomee/

And many more. Please subscribe to the Apache TomEE user list, download
latest version, and ask any further questions on the tomee user list.

> On Wed, Aug 19, 2015 at 9:53 PM, Alex Soto  wrote:
>
> > Yeah in this case you should take a look at Apache TomEE which is Apache
> > Tomcat + Java EE and you will get all of these for free :).
> >
> > El dc., 19 ag. 2015 a les 18:18, Daniel Mikusa () va
> > escriure:
> >
> > > On Wed, Aug 19, 2015 at 12:03 PM, Sreyan Chakravarty <
> > > sreyan.mail...@gmail.com> wrote:
> > >
> > > > I planning to use JPA (Hibernate) in a small project that I am
> > > developing.
> > > > Now I have heard a lot about the benefits of using Container Managed
> > > > Transactions(CMT) for JPA in web apps. But most of the tutorials on
the
> > > web
> > > > use either GlassFish or JBoss, so I was wondering is CMT supported
by
> > > > Tomcat. Send me a link to the documentation for this if there is
any.
> > > > Please note that I am going to use a datasource to connect to my
> > database
> > > > and I am using persistence.xml(JPA style) to use Hibernate.
> > > >
> > >
> > > If you're referring to JTA, then no.  Tomcat doesn't implement that.
> > > Tomcat only implements a subset of the JEE spec.
> > >
> > > http://tomcat.apache.org/whichversion.html
> > >
> > > However most of the parts of the spec that Tomcat does not implement
can
> > be
> > > pulled in via libraries.  For JTA you can use a third party
> > implementation
> > > with Tomcat.  Atomikos, JOTM and Bitronix are ones that come to mind.
> > >
> > > These docs are a little dated, but should get you started.
> > >
> > > http://www.atomikos.com/Documentation/TomcatIntegration
> > > http://jotm.objectweb.org/current/jotm/doc/howto-tomcat-jotm.html
> > >
> > > Dan
> > >
> >


Re: Is Container Managed Transactions possible in case of Tomcat ?

2015-08-19 Thread Sreyan Chakravarty
TomEE supports Apache OpenJPA. What if I wanted to use Hibernate as my JPA
provider ?

On Wed, Aug 19, 2015 at 9:53 PM, Alex Soto  wrote:

> Yeah in this case you should take a look at Apache TomEE which is Apache
> Tomcat + Java EE and you will get all of these for free :).
>
> El dc., 19 ag. 2015 a les 18:18, Daniel Mikusa () va
> escriure:
>
> > On Wed, Aug 19, 2015 at 12:03 PM, Sreyan Chakravarty <
> > sreyan.mail...@gmail.com> wrote:
> >
> > > I planning to use JPA (Hibernate) in a small project that I am
> > developing.
> > > Now I have heard a lot about the benefits of using Container Managed
> > > Transactions(CMT) for JPA in web apps. But most of the tutorials on the
> > web
> > > use either GlassFish or JBoss, so I was wondering is CMT supported by
> > > Tomcat. Send me a link to the documentation for this if there is any.
> > > Please note that I am going to use a datasource to connect to my
> database
> > > and I am using persistence.xml(JPA style) to use Hibernate.
> > >
> >
> > If you're referring to JTA, then no.  Tomcat doesn't implement that.
> > Tomcat only implements a subset of the JEE spec.
> >
> > http://tomcat.apache.org/whichversion.html
> >
> > However most of the parts of the spec that Tomcat does not implement can
> be
> > pulled in via libraries.  For JTA you can use a third party
> implementation
> > with Tomcat.  Atomikos, JOTM and Bitronix are ones that come to mind.
> >
> > These docs are a little dated, but should get you started.
> >
> > http://www.atomikos.com/Documentation/TomcatIntegration
> > http://jotm.objectweb.org/current/jotm/doc/howto-tomcat-jotm.html
> >
> > Dan
> >
>


Re: cpu spike after upgrade from tomcat 6.0.36 to tomcat 7.0.57

2015-08-19 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Musafir,

On 8/19/15 1:57 PM, musafir wrote:
> [The] thread was sleeping at that point of time during initial 
> captureran jstack few times.. going through tomcat source for 
> thisjava thread and verifying  tomcat 7 config  we identified 
> reloadable was set true for one of the application's 
> context..disabling it fixed issue ..

That suggests that your application is reloading a lot. Are there
issues with your clock and/or file timestamps in the future?

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

iQIcBAEBCAAGBQJV1N1aAAoJEBzwKT+lPKRYONcP/jTy6KCqahJQ/l0D5KJIFx7v
I0n2qoXCATR2nQtsmMR+O7lftgMYLrfzDCztj50GE/9OgOKlXHAWFizVEIfIv7a8
nOW31Sx6qNPQZxdjMvKwMGlP2epotc5k8LacnYlmZULUKABPOZ64g/qmT+AhHkI6
UdkqCie7jk+++297UGkoc8tQnjG6lRIklHR/5JlQD5DlVOdPGfGR7/D9r+p38Ac5
a+/Si1s5dnqM2wr3/xr547E6b83alN09hJDZmrvp4UfaJkYUVAsx1qNHecEVNouJ
0Jz5kUW0fuyo2d2PClvf7I5V+TpnZCiZb7NEFIYvo1Xuu7FdOwf/qzprSj0vMVNn
runOICA1egl1XSVZEIX1J3+gMc3EClhTyv9iTLdkSn7UBGZ2l/7E0uzgqDb2zmwf
bWz8BjCZShEI7iRaBqKGj7QhyVoDoiCKgEgpiQyn7TocTT4Kkj6e5ifjr47fEcnE
w6XToU9tDfM4EwU0b472V5l8Qj7fR+plu09wtpbp2tTYPOhGoNDBjWBEhUhzr3Jq
Ybn3MwDLBcHKTvfPOW+vyNNR3YifgafKKFCrfR8VcA78Ajz2tSes2DXytrZ5AEkC
ikuCZnVyZL0yjF6JJgvK0TaXKbAIBVvUNVn2nyVcrhwfThg9A3FYBnE0moZuOIf0
KteTytw3pXcfUyyo4LwI
=M0W4
-END PGP SIGNATURE-

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



Re: cpu spike after upgrade from tomcat 6.0.36 to tomcat 7.0.57

2015-08-19 Thread musafir
On Tue, Aug 18, 2015 at 1:46 PM, Mark Thomas  wrote:

> On 18/08/2015 18:16, Christopher Schultz wrote:
> > Musafir,
> >
> > On 8/18/15 1:08 PM, Mark Thomas wrote:
> >> On 18/08/2015 17:10, musafir wrote:
> >>> On Tue, Aug 18, 2015 at 11:57 AM, Mark Thomas 
> >>> wrote:
> >>>
>  On 18/08/2015 16:50, musafir wrote:
> > Hello, ugraded tomcat from 6.0.36(jdk 6) to tomcat7.0.57
> > (jdk7).. os:centos 6.6 ...seeing high cpu spike after
> > upgrade doing top and  thread dump shows  only thread
> > that is always using cpu is:
> 
>  How have you matched the thread using CPU in top with the
>  thread in the thread dump?
> 
>  Mark
> 
> 
> > "ContainerBackgroundProcessor[StandardEngine[Catalina]]"
> > daemon prio=10 tid=0x7ff8fc599800 nid=0xc1d2e waiting on
> > condition [0x7ff803ffe000] java.lang.Thread.State:
> > TIMED_WAITING (sleeping) at java.lang.Thread.sleep(Native
> > Method) at
>  org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.
> > run(ContainerBase.java:1513)
> >
> 
> > at java.lang.Thread.run(Thread.java:745)
> >
> > disabled  backgroundProcessorDelay
> > (backgroundProcessorDelay=-1) ..don't see any thread that is
> > always using cpu..
> >
> > Q: why backgroundProcessorDelay will cause cpu spike. Is this
> > disabled in tomcat6 by default? Q: will  disabling
> > backgroundProcessorDelay cause any other performance issues
> > with tomcat7.
> >
> >
> > Thanks for Help!!
> >
> > Regards
> >
> 
>  Hi Mark pid java
> 
>  top -H -p  pid for thread id   cpu eating thread
> 
>  kill -3  pid for thread dump
> 
>  and hexa nid for thread id
> >
> >> Then it looks like you did something wrong because the thread you
> >> identified is sleeping. It won't be using any CPU.
> >
> > Assuming that the thread has been mis-identified, could it be this?
> >
> > https://bz.apache.org/bugzilla/show_bug.cgi?id=58151
> >
> > That bug was filed/fixed against trunk/8.0. Any chance there is a
> > similar bug in Tomcat 7?
>
> It doesn't look like it. That bug was introduced when the non-blocking
> I/O support was added in Tomcat 8. The reads in Tomcat 7 look OK.
>
> top + lwp id + thread dump is the way to get to the bottom of this.
> Something isn't right in the description above.
>
> Mark
>


thread was sleeping at that point of time during initial captureran
jstack few times.. going through tomcat source for thisjava thread and
verifying  tomcat 7 config  we identified  reloadable was set true for one
of the application's context..disabling it fixed issue .. Appreciate
everyone's response..

  [root@app01 logs]# echo $(date) && jstack -F 590848  |awk '/Thread
'593818:' /,/^$/'
Tue Aug 18 12:42:34 CDT 2015
Attaching to process ID 590848, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 24.75-b04
Thread 593818: (state = IN_NATIVE)
 - java.io.UnixFileSystem.canonicalize0(java.lang.String) @bci=0 (Compiled
frame; information may be imprecise)
 - java.io.UnixFileSystem.canonicalize(java.lang.String) @bci=140, line=172
(Compiled frame)
 - java.io.File.getCanonicalPath() @bci=27, line=618 (Compiled frame)
 - org.apache.naming.resources.FileDirContext.file(java.lang.String)
@bci=39, line=774 (Compiled frame)
 -
org.apache.naming.resources.FileDirContext.doGetAttributes(java.lang.String,
java.lang.String[]) @bci=2, line=398 (Compiled frame)
 -
org.apache.naming.resources.BaseDirContext.getAttributes(java.lang.String,
java.lang.String[]) @bci=41, line=1157 (Compiled frame)
 -
org.apache.naming.resources.BaseDirContext.getAttributes(java.lang.String)
@bci=3, line=1110 (Compiled frame)
 -
org.apache.naming.resources.ProxyDirContext.getAttributes(java.lang.String)
@bci=35, line=882 (Compiled frame)
 - org.apache.catalina.loader.WebappClassLoader.modified() @bci=57,
line=1026 (Compiled frame)
 - org.apache.catalina.loader.WebappLoader.modified() @bci=11, line=500
(Interpreted frame)
 - org.apache.catalina.loader.WebappLoader.backgroundProcess() @bci=8,
line=420 (Compiled frame)
 - org.apache.catalina.core.ContainerBase.backgroundProcess() @bci=70,
line=1345 (Compiled frame)
 -
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(org.apache.catalina.Container,
java.lang.ClassLoader) @bci=27, line=1546 (Compiled frame)
 -
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(org.apache.catalina.Container,
java.lang.ClassLoader) @bci=115, line=1556 (Compiled frame)
 -
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(org.apache.catalina.Container,
java.lang.ClassLoader) @bci=115, line=1556 (Compiled frame)
 -
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run()
@bci=108, line=1524 (Interpreted frame)
 - java.lang.Thread.run() @bci=11, line=745 (Interpreted frame)

[root@app01 logs]# ech

Re: Is Container Managed Transactions possible in case of Tomcat ?

2015-08-19 Thread Alex Soto
Yeah in this case you should take a look at Apache TomEE which is Apache
Tomcat + Java EE and you will get all of these for free :).

El dc., 19 ag. 2015 a les 18:18, Daniel Mikusa () va
escriure:

> On Wed, Aug 19, 2015 at 12:03 PM, Sreyan Chakravarty <
> sreyan.mail...@gmail.com> wrote:
>
> > I planning to use JPA (Hibernate) in a small project that I am
> developing.
> > Now I have heard a lot about the benefits of using Container Managed
> > Transactions(CMT) for JPA in web apps. But most of the tutorials on the
> web
> > use either GlassFish or JBoss, so I was wondering is CMT supported by
> > Tomcat. Send me a link to the documentation for this if there is any.
> > Please note that I am going to use a datasource to connect to my database
> > and I am using persistence.xml(JPA style) to use Hibernate.
> >
>
> If you're referring to JTA, then no.  Tomcat doesn't implement that.
> Tomcat only implements a subset of the JEE spec.
>
> http://tomcat.apache.org/whichversion.html
>
> However most of the parts of the spec that Tomcat does not implement can be
> pulled in via libraries.  For JTA you can use a third party implementation
> with Tomcat.  Atomikos, JOTM and Bitronix are ones that come to mind.
>
> These docs are a little dated, but should get you started.
>
> http://www.atomikos.com/Documentation/TomcatIntegration
> http://jotm.objectweb.org/current/jotm/doc/howto-tomcat-jotm.html
>
> Dan
>


Re: Is Container Managed Transactions possible in case of Tomcat ?

2015-08-19 Thread Daniel Mikusa
On Wed, Aug 19, 2015 at 12:03 PM, Sreyan Chakravarty <
sreyan.mail...@gmail.com> wrote:

> I planning to use JPA (Hibernate) in a small project that I am developing.
> Now I have heard a lot about the benefits of using Container Managed
> Transactions(CMT) for JPA in web apps. But most of the tutorials on the web
> use either GlassFish or JBoss, so I was wondering is CMT supported by
> Tomcat. Send me a link to the documentation for this if there is any.
> Please note that I am going to use a datasource to connect to my database
> and I am using persistence.xml(JPA style) to use Hibernate.
>

If you're referring to JTA, then no.  Tomcat doesn't implement that.
Tomcat only implements a subset of the JEE spec.

http://tomcat.apache.org/whichversion.html

However most of the parts of the spec that Tomcat does not implement can be
pulled in via libraries.  For JTA you can use a third party implementation
with Tomcat.  Atomikos, JOTM and Bitronix are ones that come to mind.

These docs are a little dated, but should get you started.

http://www.atomikos.com/Documentation/TomcatIntegration
http://jotm.objectweb.org/current/jotm/doc/howto-tomcat-jotm.html

Dan


Is Container Managed Transactions possible in case of Tomcat ?

2015-08-19 Thread Sreyan Chakravarty
I planning to use JPA (Hibernate) in a small project that I am developing.
Now I have heard a lot about the benefits of using Container Managed
Transactions(CMT) for JPA in web apps. But most of the tutorials on the web
use either GlassFish or JBoss, so I was wondering is CMT supported by
Tomcat. Send me a link to the documentation for this if there is any.
Please note that I am going to use a datasource to connect to my database
and I am using persistence.xml(JPA style) to use Hibernate.


Regards
Sreyan Chakravarty


Errors at INFO level despite "Note: further occurrences of ... errors will be logged at DEBUG level."

2015-08-19 Thread Robert Tupelo-Schneck
I'm running Tomcat 8.0.24.  I see lots of errors in catalina.out with lines like

 Note: further occurrences of Cookie errors will be logged at DEBUG level.
 Note: further occurrences of Parameter errors will be logged at DEBUG level.
 Note: further occurrences of HTTP header parsing errors will be logged at 
DEBUG level.

But, the errors keep showing up at INFO level!

I get these many many times a day, but I do not get user complaints, and I have 
not been able to cause the errors myself.

I would like to either
(1) Make these errors go away (such as by really having them logged at DEBUG 
level), or
(2) Get detailed information on the client request that caused the error so I 
can figure out how to make them less frequent.

Can anyone advise on how I could accomplish either of those goals?

For completeness, here are the kinds of errors:

org.apache.tomcat.util.http.LegacyCookieProcessor.processCookieHeader Cookies: 
Invalid cookie. Value not a token or quoted value
org.apache.coyote.http11.AbstractHttp11Processor.process Error parsing HTTP 
request header
org.apache.tomcat.util.http.Parameters.processParameters Invalid chunk starting 
at byte [242] and ending at byte [244] with a value of [=1] ignored

I also see a lot of this one, at SEVERE level; I'd like to deal with it the 
same way as the others:

org.apache.coyote.http11.AbstractHttp11Processor.process Error processing 
request
 java.lang.IllegalArgumentException: Control character in cookie value or 
attribute.

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



Re: [ANN] Apache Tomcat Connectors 1.2.41 released

2015-08-19 Thread jean-frederic clere

On 08/17/2015 01:10 PM, Mark Thomas wrote:

The Apache Tomcat Project is proud to announce the release of version
1.2.41 of the Apache Tomcat Connectors.
This version fixes one security issue (CVE-2014-8111) and a number of
bugs found in previous releases.


Many thanks for the release and sorry for all the troubles around 
CVE-2014-8111.


Cheers

Jean-Frederic

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