JSF clustering

2021-08-25 Thread Felipe Jaekel
Hi,

I always used Tomcat's parallel deployment to achieve zero downtime on my
JSF applications. I'm planning on dockerizing them, but I'd like to keep
zero downtime.

I'm familiar with AWS ECS. With the default configuration, when the service
is updated a new instance will be launched in parallel, and only when it's
ready requests are routed to it, so no 404s, but as the old instance gets
terminated right after the new one is ready, the users that were using it
loses their session and are redirected to the login page.

I thought about using memcached or maybe JDBCStore for session management,
but as the user would be redirected to a new version of the application
with an old view state in the session wouldn't JSF throw an exception if
the page structure has changed?

Thanks


Problem with KeyStore.load() after upgrading from 8.5.11 to 8.5.23

2017-10-26 Thread Felipe Jaekel
Hi,

I have a webapp where the user can upload a PFX file to digitally sign PDF
files. After upgrading from 8.5.11(TomEE 7.0.3) to 8.5.23(TomEE
7.0.5-SNAPSHOT) I'm getting this exception:

java.security.UnrecoverableKeyException: failed to decrypt safe contents
entry: javax.crypto.BadPaddingException: pad block corrupted

First I tough it was something related to the upload process, but even
after pointing to a local PFX file and hardcoding the password I still get
this exception on 8.5.23.

ks = KeyStore.getInstance(KeyStore.getDefaultType());
ks.load(new FileInputStream("/home/fjaekel/Desktop/anima.pfx"),
"anima".toCharArray());

Tested with OpenJDK 64-Bit Server VM (build 25.111-b15, mixed mode)  and
Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode).

Any ideias?

Thanks

*Stacktrace:*
java.io.IOException: keystore password was incorrect
at sun.security.pkcs12.PKCS12KeyStore.engineLoad(PKCS12KeyStore.java:2015)
at sun.security.provider.KeyStoreDelegator.engineLoad(
KeyStoreDelegator.java:238)
at sun.security.provider.JavaKeyStore$DualFormatJKS.
engineLoad(JavaKeyStore.java:70)
at java.security.KeyStore.load(KeyStore.java:1445)
at br.com.pacsweb.util.SignatureInterop.(SignatureInterop.java:38)
at br.com.pacsweb.service.AssinaturaLaudoService.persist(
AssinaturaLaudoService.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.openejb.core.interceptor.ReflectionInvocationContext$
Invocation.invoke(ReflectionInvocationContext.java:205)
at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(
ReflectionInvocationContext.java:186)
at org.apache.openejb.monitoring.StatsInterceptor.record(
StatsInterceptor.java:181)
at org.apache.openejb.monitoring.StatsInterceptor.invoke(
StatsInterceptor.java:100)
at sun.reflect.GeneratedMethodAccessor245.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.openejb.core.interceptor.ReflectionInvocationContext$
Invocation.invoke(ReflectionInvocationContext.java:205)
at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(
ReflectionInvocationContext.java:186)
at org.apache.openejb.core.interceptor.InterceptorStack.
invoke(InterceptorStack.java:85)
at org.apache.openejb.core.stateless.StatelessContainer._
invoke(StatelessContainer.java:252)
at org.apache.openejb.core.stateless.StatelessContainer.
invoke(StatelessContainer.java:212)
at org.apache.openejb.core.ivm.EjbObjectProxyHandler.
synchronizedBusinessMethod(EjbObjectProxyHandler.java:265)
at org.apache.openejb.core.ivm.EjbObjectProxyHandler.businessMethod(
EjbObjectProxyHandler.java:260)
at org.apache.openejb.core.ivm.EjbObjectProxyHandler._invoke(
EjbObjectProxyHandler.java:89)
at org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(
BaseEjbProxyHandler.java:347)
at br.com.pacsweb.service.AssinaturaLaudoService$$
LocalBeanProxy.persist(br/com/spdata/pacsweb/service/
AssinaturaLaudoService.java)
at br.com.pacsweb.page.ImpressaoLaudoController.assinar(
ImpressaoLaudoController.java:156)
at br.com.pacsweb.page.ImpressaoLaudoController$$
OwbNormalScopeProxy0.assinar(br/com/spdata/pacsweb/page/
ImpressaoLaudoController.java)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.el.parser.AstValue.invoke(AstValue.java:247)
at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:267)
at org.apache.webbeans.el22.WrappedMethodExpression.invoke(
WrappedMethodExpression.java:52)
at org.apache.myfaces.view.facelets.el.ContextAwareTagMethodExpressio
n.invoke(ContextAwareTagMethodExpression.java:96)
at org.apache.myfaces.application.ActionListenerImpl.processAction(
ActionListenerImpl.java:74)
at javax.faces.component.UICommand.broadcast(UICommand.java:120)
at javax.faces.component.UIViewRoot._broadcastAll(UIViewRoot.java:1174)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:365)
at javax.faces.component.UIViewRoot._process(UIViewRoot.java:1660)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:864)
at org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(
InvokeApplicationExecutor.java:42)
at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(
LifecycleImpl.java:196)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute(
LifecycleImpl.java:143)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(

Question on parallel deployment

2016-09-14 Thread Felipe Jaekel
Hi,

I've been using parallel deployment successfully with JSF based webapps for
some years.

Now I'd like to use it with some web service based webapps (CXF). I noticed
on Tomcat Manager that these webapps doesn't create sessions on the
requests.

I use *undeployOldVersions="true"* on server.xml, so when I deploy a new
version of the webapp, will Tomcat wait active requests finish processing
before undeploying the old version or do I need to create some dummy
session attribute to make parallel deployment work correctly on this case?

I'm using Tomcat 8.5.4.

Thanks


HttpSessionListener.sessionDestroyed() sometimes not called?

2015-10-08 Thread Felipe Jaekel
Hi,

I have a customer support chat webapp where when the attendant session
expires, I need to end all his active conversations and change his status
to offline, so I implemented a HttpSessionListener.

Since some attendants log in the system multiple times, they where being
disconnect incorrectly if the second session ended before the first...

To solve this, I started to track the sessions. First I though about
something application scoped, but as I'm using parallel deployment, I
needed something that would be common to all the versions of the webapp, so
I chose the database(MySQL 5.6). I have a table with the following columns:
recordId, userId, sessionId, appVersion, sessionStart and sessionEnd.

When the attendant log in, a new record is created, leaving sessionEnd with
null. On HttpSessionListener.sessionDestroyed(), I set sessionEnd with the
current timestamp, then I query the database to see if there are additional
sessions active for him. If not, I end all his active conversations and
change his status to offline.

Now the problem is the opposite, some attendants are not disconnected
automatically. Looking at the session tracking table, I see some records
with sessionEnd == null, but the sessionId of the record is not listed on
the server's current active session list of any version of the webapp.

The first thing I do on my sessionDestroyed() method is to log the
sessionId that is destroyed. So in case my business logic failed, at least
this line I should see on the log before any possible exceptions. But there
is nothing there, what makes me think that the method was not called at all.

This webapp uses Apache Shiro 1.2.3. Server is restarted daily at dawn to
reset PermGen...

I thought it could be related to this issue(56657
), since I was using
version 7.0.47. But I upgraded to 7.0.62 and it didn't solved, so I tried
to disable session persistence. Still no luck.


Any ideas?

Thanks in advance


*Session listener code:*

@WebListener
public class SessionListener implements HttpSessionListener
{
@PersistenceUnit(unitName = MySqlListener.PERSISTENCE_UNIT)
private EntityManagerFactory emf;

@Override
public void sessionCreated(final HttpSessionEvent sessionEvent)
{
Logger.getLogger(getClass().getName()).info("create " +
sessionEvent.getSession().getId());
}

@Override
public void sessionDestroyed(final HttpSessionEvent sessionEvent)
{
EntityManager em = null;
try
{
Logger.getLogger(getClass().getName()).info("destroy " +
sessionEvent.getSession().getId());

final HttpSession session = sessionEvent.getSession();

/**
* Nesse caso não há requisição nem FacesContext, portanto o EntityManager
será passado
* por referência para que a mesma instância seja usada em todas as operações
*/
em = emf.createEntityManager();

TbTecnicoService.destroySession(session.getId(), em);

final TBTecnico tecnico = (TBTecnico)
session.getAttribute(TbTecnicoService.TECNICO_LOGADO);

if(tecnico != null)
{
final Long totalSessoesAtivas = new
SessaoColaboradorService(em).countSessoesAtivasByColaborador(tecnico.getId());
if(totalSessoesAtivas < 1)
{
try
{
final Atendente atendente = new AtendenteService(em).findByTecnico(tecnico);

final AtendenteDisponivel atendenteDisponivel = new
AtendenteDisponivelService(em).findAtendenteOnline(atendente);

// Caso o atendente tenha clicado em "Sair" no portal considera como logout
manual
final boolean manualLogout =
Converter.toBoolean(session.getAttribute(Constants.MANUAL_LOGOUT));

new AtendimentoService(em).desconectarAtendente(atendente, manualLogout,
atendenteDisponivel.isPush());
}
catch(final NoResultException ex)
{
// Técnico não é um atendente ou o atendente não estava online
}

if(tecnico.getSetor().getId() == TbSetor.DESENVOLVIMENTO)
{
final ChamadoService chamadoService = new ChamadoService(em);
chamadoService.pause(tecnico);
}
}
}
}
catch(final Exception e)
{
GestaoErroClient.persist(IdAplicacao.COLABORADOR, JsfUtil.getVersion(),
getClass().getName(), e);
}
finally
{
EntityManagerHandler.close(em);
}
}
}


Question on autoDeploy=true + editing conf/context.xml

2015-09-15 Thread Felipe Jaekel
Hi,

I use parallel deployment, so I set *autoDeploy=true* to enable newer
versions of webapps as as soon as they are deployed, but if I edit
*conf/context.xml*, I'd like that Tomcat 7.0.62 did not restart
automatically.

Is it possible?

Thanks


Re: Question on autoDeploy=true + editing conf/context.xml

2015-09-15 Thread Felipe Jaekel
Hi,

I don't replace the war file, only copy a new version to webapps folder.

I restart tomcat everyday at dawn to reset PermGen space. (Tried to profile
the webapps sometimes but didn't figured out the problem...)

I edited conf/context.xml to disable session persistence.

My idea was making tomcat read the new configuration value after it was
restarted.

2015-09-15 16:52 GMT-03:00 Christopher Schultz <ch...@christopherschultz.net
>:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Felipe,
>
> On 9/15/15 2:11 PM, Felipe Jaekel wrote:
> > I use parallel deployment, so I set *autoDeploy=true* to enable
> > newer versions of webapps as as soon as they are deployed
>
> Deployed... how? If you replace webapp.war with a new copy, Tomcat
> will re-start *that* context, and not just add a new versioned context
> with a new version number.
>
> > but if I edit *conf/context.xml*, I'd like that Tomcat 7.0.62 did
> > not restart automatically.
>
> Why would you edit conf/context.xml in the first place?
>
> - -chris
> -BEGIN PGP SIGNATURE-
> Comment: GPGTools - http://gpgtools.org
>
> iQIcBAEBCAAGBQJV+HbxAAoJEBzwKT+lPKRYHwQQAL3t1suhM+z8qk6byUC83QJ4
> KBq3ZXualzokLJj+4VI+zhgniiuVJnEkmwgerqGdVVYrlj8aFS3FquX/SwA3sHMs
> rp5sdIOKBKCyz+xAIsk5eZ5I/BRB5BGk0jFW//ahAHXHUC7BYhmxrHfNI/YfsRn0
> nFNNUoCGvPL0lGMrzhwiZTVlA3hZtPaN2UUpCHo1PbF4JJTv22Z++B4joNqr3s6M
> BSDuZsx/JWp19MphDM8IjfISlaMii4gl9pN5cXTcADhzF9YGkI+GvXOMR30QQHm1
> nO9r/U3rqdkC1ecIuv/Gp8d8snTUHD9nCz52Jm5kQujOxZf4hYdqLZIzsTVFcbcw
> l05Yyt++74Y9wwGzuUYb+8B3Hpa95y0e3rHj9zbOFzlvJrTbZhKNJKGLHQN7IfLO
> ye3h408GtKl4+3jDp0VKBezHvFEvtSzbRAkHpBk1upbK7DepkBbFaYO+pkJAB4SS
> O296H6LhS5E8AS9JInoNE5aGXqyF8JfPN4Ed0FA6yQbo0ZmtvnbUP4fQt3Klty7B
> K0xnFBHX+H7BFRPOSbNJNZ4QUxhV+FVq58MTRHnUqc26SDS69EkKS3mOwaeLZwbh
> b6oZ55EXNSVzQVELwouI+Qy1Iw2QE7gMSYSvd4VZH/zbMwQr+nFWwjt6VelTGwii
> X0HZJh4WB+u6+HTVfShj
> =AhL2
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


ActiveMQ redelivery policy

2014-08-26 Thread Felipe Jaekel
Hi,

I'm trying to run some legacy JMS code in TomEE 1.7.0 using the internal
broker:

Resource id=JmsResourceAdapter type=ActiveMQResourceAdapter
BrokerXmlConfig =  broker:(tcp://localhost:61616?daemon=true)
ServerUrl   =  vm://localhost
/Resource

In this code the redelivery policy is changed:

QueueConnectionFactory connectionFactory = (QueueConnectionFactory)
initialContext.lookup(openejb:Resource/JmsConnectionFactory);

connection = (ActiveMQConnection) connectionFactory.createQueueConnection();

RedeliveryPolicy redeliveryPolicy = connection.getRedeliveryPolicy();
redeliveryPolicy.setRedeliveryDelay(3);
connection.setRedeliveryPolicy(redeliveryPolicy);

I'm getting the following exception when I try to cast the connection:
java.lang.ClassCastException: com.sun.proxy.$Proxy156 cannot be cast to
org.apache.activemq.ActiveMQConnection

I guess the best way to solve it would be with a MDB, I saw in the
documentation I can change the redelivery values with it, but I can't
refactor this code right now.

Is it possible to set the redelivery policy in tomee.xml? If not, I noticed
while debugging in Eclipse
that there is a ManagedConnectionProxy instance behind the proxy, and this
class has a physicalConnection property that holds the current
ActiveMQConnection instance. How can I access it?

Thanks


Re: Help understanding Session System Properties

2014-07-24 Thread Felipe Jaekel
Thanks for the replies.

My session timeout is 15 minutes.

I have thread that may set a session attribute, but it run only once after
user login and take approximately 1 minute to complete.

My applications are JSF based, and most of managed beans are view scoped.
The majority of requests is completed is less than 1 minute.


2014-07-22 17:44 GMT-03:00 Christopher Schultz ch...@christopherschultz.net
:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256

 Felipe,

 On 7/22/14, 10:36 AM, Felipe Jaekel wrote:
  I have a simple authentication logic in my applications, where I
  store the current user in the session and check with a filter if
  the current user value is not null.
 
  Eventually I see some null pointer exceptions in my Tomcat 7.0.47
  that happened in JSF managed beans because the current user value
  was null.
 
  The problem is that the stackTrace shows that login filter was
  executed correctly, so I guess the session timed out right after
  the getAttribute() call in the filter, which would explain why
  there still was value in the filter but not in the managed bean.

 Is your session timeout so low that a session could time out during
 the execution of a single request?

  After some research I found this:
  http://tomcat.apache.org/tomcat-7.0-doc/config/systemprops.html#Sessions
 
   Would org.apache.catalina.session.StandardSession.ACTIVITY_CHECK
  solve this problem?

 If the problem is that your requests are taking longer than the
 session timeout (default: 30 minutes), then yes, this will help.

  What about
  org.apache.catalina.core.StandardHostValve.ACCESS_SESSION

 Perhaps. Do you have lots of requests whose code doesn't actually call
 request.getSession()?

  and
  org.apache.catalina.session.StandardSession.LAST_ACCESS_AT_START?

 Perhaps, depending on whether you really have requests that run so
 long that the session can time-out during their execution.

 What is your session timeout value (in minutes)? How long does a
 typical request/response transaction take? How often do they occur?

 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1
 Comment: GPGTools - http://gpgtools.org
 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

 iQIcBAEBCAAGBQJTzs0qAAoJEBzwKT+lPKRYyroQAIP0DikrED8AWbu0WuB7pDnv
 icK82YnEHVEZwHWeiKl03PV7vZsTkPzG6v+aDP+Yb+DaCuxlCpHN3hGvyT2a8x4x
 oDe82O47B/6cMTzCv/JubK06EWYJOfOGtXEYLRHKSye82+v2wHrkwVdFe3JINu0N
 ka7CKHFuSPIsAN0HPxrvI0lWEOCJeBffLrb8+mFjixLmQHaA09NEthT9Xr6ohWrq
 ZuugHFAo/D+2zW6UGmuYuwU+BkT6HQ13ZuBkyfAl/N/ZylovIde53fxKgWrSMSa3
 ao/9ZMIr9Ig64U9cUyB62RFiJ/kg2piJmq3TCL2UC9zzEmAc0/SpbazO/yAUID8y
 +txrwpOfzxYIMZy0iH7aW5FH7gqdSpv/LKbVumPZlcVleBdr9J0AdBncNedoAw9Y
 3T6N2A4KiQDVHU2/f1NBmW+HOWu9r2a9mJN3rQrM+4Lf12NTFk3p6oyyZDkJuVNm
 8SPvZR90xws413TEAWt3IJTVoG8diUl873GZzHzj4HdvE39mp5gAzN+Nnhi2Meqs
 ro2Rf6/qfdkEM/R0yvAJVFyeyFSjQvFpSphTvAzDxu1IIiJqQ/GvLKQ6eVgOLOM/
 vsPrksjTJ93KPx4iWHjSm6PgvyLc9R5RZVn1MLcROKpidNLwxJEp6wDO27cYj+GL
 8NOX+YMukTJnFebPtrIW
 =cqiq
 -END PGP SIGNATURE-

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




Help understanding Session System Properties

2014-07-22 Thread Felipe Jaekel
I have a simple authentication logic in my applications, where I store the
current user in the session and check with a filter if the current user
value is not null.

Eventually I see some null pointer exceptions in my Tomcat 7.0.47 that
happened in JSF managed beans because the current user value was null.

The problem is that the stackTrace shows that login filter was executed
correctly, so I guess the session timed out right after the getAttribute()
call in the filter, which would explain why there still was value in the
filter but not in the managed bean.

After some research I found this:
http://tomcat.apache.org/tomcat-7.0-doc/config/systemprops.html#Sessions

Would org.apache.catalina.session.StandardSession.ACTIVITY_CHECK solve this
problem?

What about org.apache.catalina.core.StandardHostValve.ACCESS_SESSION and
org.apache.catalina.session.StandardSession.LAST_ACCESS_AT_START?

Thanks


Help with CMSClassUnloadingEnabled

2014-03-26 Thread Felipe Jaekel
I have configured my Tomcat 7 with the following parameters:

-Xms4G -Xmx4G -XX:MaxPermSize=256m -XX:+UseTLAB -XX:+UseConcMarkSweepGC
-XX:+CMSClassUnloadingEnabled -Dorg.apache.el.parser.COERCE_TO_ZERO=false

I've seen in several blogs and StackOverflow posts
that CMSClassUnloadingEnabled should sweep PermGen too, but checking in the
manager application after some undeployments, the PermGen value never
decreases.

Am I missing something? I'm using OpenJDK 7 update 51 64-bit.

Thanks


Re: Possible Tomcat 8.0.3 issue

2014-03-18 Thread Felipe Jaekel
Yes, I started to use it when I migrated from Tomcat 6 to 7.


2014-03-17 17:21 GMT-03:00 Howard W. Smith, Jr. smithh032...@gmail.com:

 On Mon, Mar 17, 2014 at 4:14 PM, Felipe Jaekel fkjae...@gmail.com wrote:

  My Tomcat 7 was running fine with this script, but last friday morning I
  started Tomcat 8 setting only this:
  *-Xms2048m -Xmx2048m -XX:MaxPermSize=1024m
  -Dorg.apache.el.parser.COERCE_TO_ZERO=false*
  and the applications crashed too.
 
  So I'd say that the problem is not my JVM config, but I'm interested on
  improving it. What arguments do you recommend to tune GC?
 
  Last friday afternoon I created a new Amazon EC2 instance with Tomcat 7
 to
  check, and the problem is still there, so It was a damn coincidence that
  this problem started after I migrate to Tomcat 8. As I had a connection
  pool leak with Tomcat 8 it contributed for me to think that it could be
 

 Was the following in your Tomcat7 config before 'and' after migrating to
 tomcat8?

 -Dorg.apache.el.parser.COERCE_TO_ZERO=false*



Re: Possible Tomcat 8.0.3 issue

2014-03-17 Thread Felipe Jaekel
My Tomcat 8 is hosted on an Amazon EC2 large instance (8GB of ram), with a
64-bit Oracle Java 7u51 JVM. The 2GB PermGen is is an oversized value to
guarantee I wont run out of memory in case I need do redeploy my
applications several times in the same day, but the maximum I ever used was
about 512MB.

I admit I don't understand 100% of the script. Actually I prefer the set
the less configuration parameters possible. Some months ago my Tomcat 7 was
locking (process using 100% of CPU and not responding). I found this
script when I was looking for a solution for this, and as it was well
documented I decided to use it. I don't remember facing this locking
issue since them.

My Tomcat 7 was running fine with this script, but last friday morning I
started Tomcat 8 setting only this:
*-Xms2048m -Xmx2048m -XX:MaxPermSize=1024m
-Dorg.apache.el.parser.COERCE_TO_ZERO=false*
and the applications crashed too.

So I'd say that the problem is not my JVM config, but I'm interested on
improving it. What arguments do you recommend to tune GC?

Last friday afternoon I created a new Amazon EC2 instance with Tomcat 7 to
check, and the problem is still there, so It was a damn coincidence that
this problem started after I migrate to Tomcat 8. As I had a connection
pool leak with Tomcat 8 it contributed for me to think that it could be
something wrong with it.

I still didn't solved it, I'll continue it here:
http://forum.primefaces.org/viewtopic.php?f=3t=36823

Any help is appreciated.

Thanks



2014-03-13 17:51 GMT-03:00 Christopher Schultz ch...@christopherschultz.net
:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256

 Felipe,

 On 3/13/14, 3:33 PM, Felipe Jaekel wrote:
  Hmm I didn't looked at the server status yesterday, but the times I
  faced OOEM in the past nothing responded, page rendering didn't
  even started. And today problem is happening again with half the
  memory free.
 
  My best guess for the PermGen issue problem is Hibernate. I read a
  lot of forum threads and articles about it, tried lots of
  monitoring tools with no success. So I gave up and configured a
  large size and restart the server periodically to flush it. Never
  had problems again. I mentioned that I restart server daily to give
  a notion of how long the jvm was running.
 
  I was always curious about this ClientAbortException. I think its
  caused by connection problem on the client(mobile internet for
  example), so the user gives up loading the page.
 
  My web.xml is 3.0.
 
  I'm using a fresh Tomcat 8 install.
 
  I'll attach my setenv.sh, I found it on GitHub and changed the Xms,
  Xmx and PermGen values.
 
  Thanks again
 
  #! /bin/sh #
  ==
  #  __   __ _ # /_  __/___  
  ___  _ _/ /_   /__  / #  / / / __ \/ __ `__ \/ ___/ __ `/
  __/ / / # / / / /_/ / / / / / / /__/ /_/ / /_  / / #/_/
  \/_/ /_/ /_/\___/\__,_/\__/ /_/

 Uh, oh. You are using someone else's script without understanding it?
 Things could work out great, but they could also not be so great. I'm
 particularly interested in this part:

  # Oracle Java as default, uses the serial garbage collector on the
  # Full Tenured heap. The Young space is collected in parallel, but
  the # Tenured is not. This means that at a time of load if a full
  collection # event occurs, since the event is a 'stop-the-world'
  serial event then # all application threads other than the garbage
  collector thread are # taken off the CPU. This can have severe
  consequences if requests continue # to accrue during these 'outage'
  periods. (specifically webservices, webapps) # [Also enables
  adaptive sizing automatically] export CATALINA_OPTS=$CATALINA_OPTS
  -XX:+UseParallelGC

 Parallel GC is still a stop-the-world collector for the tenured (aka
 Old) generation. Technically, what you want is the Parallel Compacy
 GC which is in fact what you get if you use this option on Java 6+.
 Before that, you'll get the old parallel GC implementation which is
 in fact stop-the-world.

  # This is interpreted as a hint to the garbage collector that pause
  times # of nnn milliseconds or less are desired. The garbage
  collector will # adjust the  Java heap size and other garbage
  collection related parameters # in an attempt to keep garbage
  collection pauses shorter than nnn milliseconds. #
  http://java.sun.com/docs/hotspot/gc5.0/ergo5.html export
  CATALINA_OPTS=$CATALINA_OPTS -XX:MaxGCPauseMillis=1500

 If you don't need this, you shouldn't use it. By placing limits on the
 GC, you can run out of memory even if you don't need to because the GC
 can't catch up. 1500ms is pretty reasonable, but I always wonder why
 people mess with things if they don't have to.

  # A hint to the virtual machine that it.s desirable that not more
  than: # 1 / (1 + GCTimeRation) of the application execution time be
  spent in # the garbage collector. #
 
 http

Possible Tomcat 8.0.3 issue

2014-03-13 Thread Felipe Jaekel
Yestarday my PrimeFaces applications started to crash. They didn't render
correctly and nothing worked.

Chrome console output:

 Resource interpreted as Stylesheet but transferred with MIME type
 text/plain: 
 http://spdata-apps.net/cliente/javax.faces.resource/theme.css.jsf?ln=primefaces-redmond;.
 login.jsf:3
 Resource interpreted as Script but transferred with MIME type text/plain: 
 http://spdata-apps.net/cliente/javax.faces.resource/primefaces.js.jsf?ln=primefacesv=4.0.9;.
 login.jsf:3
 Resource interpreted as Image but transferred with MIME type text/plain: 
 http://spdata-apps.net/cliente/javax.faces.resource/loading26.gif.jsf?ln=image;.
 login.jsf:22
 GET
 http://spdata-apps.net/cliente/javax.faces.resource/primefaces.css.jsf?ln=primefacesv=4.0.9net::ERR_INVALID_CHUNKED_ENCODING
  login.jsf:3
 Uncaught ReferenceError: PrimeFaces is not defined common.js.jsf?ln=js:1
 Uncaught ReferenceError: PrimeFaces is not defined login.jsf:22
 Uncaught ReferenceError: PrimeFaces is not defined login.jsf:39
 Uncaught ReferenceError: PrimeFaces is not defined login.jsf:48
 Uncaught ReferenceError: PrimeFaces is not defined login.jsf:48
 Uncaught ReferenceError: PrimeFaces is not defined login.jsf:48
 Uncaught ReferenceError: PrimeFaces is not defined login.jsf:49
 Uncaught ReferenceError: PrimeFaces is not defined login.jsf:22


Every time I hit F5 the page render changed, but still corrupted, and the
console erros changed, but they were basically like above.

Restarting the server solved the problem, and I never had this issue with
Tomcat 7.

Any ideas?

Thanks in advance,
Phillip


Re: Possible Tomcat 8.0.3 issue

2014-03-13 Thread Felipe Jaekel
There are lots of this in catalina log:
*12-Mar-2014 08:41:43.828 WARNING [http-nio-80-exec-28]
com.sun.faces.application.resource.ResourceHandlerImpl.logMissingResource
JSF1064: Unable to find or serve resource, primefaces.js, from library,
primefaces.*
*12-Mar-2014 08:41:43.829 WARNING [http-nio-80-exec-28]
com.sun.faces.application.resource.ResourceHandlerImpl.logMissingResource *
* org.apache.catalina.connector.ClientAbortException: java.io.IOException:
Connection reset by peer*

But these always appeared in my logs, I guess it happens when the client
cancel the page load.


I did found something strange in the access log. Applications crashed
around 2:20PM. I checked for primefaces.js at this time in the access log
and its all 200 status, but I noticed some very small response sizes in
some requests, which explains the JavaScripts errors on Chrome console.

Here are the log files and some print-screens:
https://dl.dropboxusercontent.com/u/66737052/logs-12-03-2014.tar.bz2


Nothing changed in the system. I started to use Tomcat 8.0.3 in production
on February 28th and the server is restarted daily to recycle PermGen space.

I'm using Mojarra 2.2.5.

This issue started to manifest at 10AM after a parallel deploy. At first
only the icons disappeared from the new deployed version, but it was
functional. Although new and old deployed versions had PrimeFaces 4.0.9, I
started to think that might be something wrong with it, so I deployed a new
version using 4.0.10. Problem was solved for some hours, but when it
returned the status was what I mentioned above. Tried to parallel deploy
with 4.0.8 but no success. After I restarted problem was solved, but in
case it's relevant, there was only one version of each application running.


Thanks again,
Phillip



2014-03-13 10:40 GMT-03:00 Howard W. Smith, Jr. smithh032...@gmail.com:

 On Thu, Mar 13, 2014 at 9:33 AM, burghard.britzke 
 b...@charmides.in-berlin.de wrote:

  may be restarting the context would even be sufficient? May be the
  FacesServlet has an issue which implementation are you using? which
  version? which version of PrimeFaces?
 
 
 earlier, in the thread, he provided the following:

 Chrome console output:

  Resource interpreted as Stylesheet but transferred with MIME type
  text/plain: 
 

 http://spdata-apps.net/cliente/javax.faces.resource/theme.css.jsf?ln=primefaces-redmond
 .
  login.jsf:3
  Resource interpreted as Script but transferred with MIME type text/plain:
 
 

 http://spdata-apps.net/cliente/javax.faces.resource/primefaces.js.jsf?ln=primefacesv=4.0.9
 .
  login.jsf:3
  Resource interpreted as Image but transferred with MIME type text/plain:
 
 

 http://spdata-apps.net/cliente/javax.faces.resource/loading26.gif.jsf?ln=image
 .
  login.jsf:22
  GET
 

 http://spdata-apps.net/cliente/javax.faces.resource/primefaces.css.jsf?ln=primefacesv=4.0.9net::ERR_INVALID_CHUNKED_ENCODING
  login.jsf:3

 primefacesv=4.0.9

 PrimeFaces Elite 4.0.9

 Since I usually scour PrimeFaces forum topics, this is the first person
 that I have heard/seen using tomcat 8.0.x with PrimeFaces.



Re: Possible Tomcat 8.0.3 issue

2014-03-13 Thread Felipe Jaekel
Thanks for the replies. I'll answer to all soon.

Problem is happening again. It's on its initial phase, where icons and
other images from the application are missing, but its functional.

No deployment made today.

My server runs with 2GB heap and 2GB PermGen.

Current server status:
https://dl.dropboxusercontent.com/u/66737052/_manager.pdf

Chrome console output:
Resource interpreted as Image but transferred with MIME type text/css: 
http://spdata-apps.net/colaborador/javax.faces.resource/theme.css.jsf?ln=primefaces-aristo;.
jquery.js.jsf?ln=primefacesv=4.0.10:25
Resource interpreted as Image but transferred with MIME type text/css: 
http://spdata-apps.net/colaborador/javax.faces.resource/theme.css.jsf?ln=primefaces-aristo;.
jquery.js.jsf?ln=primefacesv=4.0.10:25

When I look at Network tab and click at theme.css I get a *This request has
no response data available.* message


2014-03-13 12:44 GMT-03:00 Christopher Schultz ch...@christopherschultz.net
:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256

 Daniel,

 On 3/13/14, 8:06 AM, Daniel Mikusa wrote:
  On Mar 13, 2014, at 7:44 AM, Felipe Jaekel fkjae...@gmail.com
  wrote:
 
  Yestarday my PrimeFaces applications started to crash. They
  didn't render correctly and nothing worked.
 
  Chrome console output:
 
  Resource interpreted as Stylesheet but transferred with MIME
  type text/plain: 
 
 http://spdata-apps.net/cliente/javax.faces.resource/theme.css.jsf?ln=primefaces-redmond
 .
 
 
 login.jsf:3
  Resource interpreted as Script but transferred with MIME type
  text/plain: 
 
 http://spdata-apps.net/cliente/javax.faces.resource/primefaces.js.jsf?ln=primefacesv=4.0.9
 .
 
 
 login.jsf:3
  Resource interpreted as Image but transferred with MIME type
  text/plain: 
 
 http://spdata-apps.net/cliente/javax.faces.resource/loading26.gif.jsf?ln=image
 .
 
 
 login.jsf:22
  GET
 
 http://spdata-apps.net/cliente/javax.faces.resource/primefaces.css.jsf?ln=primefacesv=4.0.9net::ERR_INVALID_CHUNKED_ENCODING
  login.jsf:3 Uncaught ReferenceError: PrimeFaces is not defined
  common.js.jsf?ln=js:1 Uncaught ReferenceError: PrimeFaces is
  not defined login.jsf:22 Uncaught ReferenceError: PrimeFaces is
  not defined login.jsf:39 Uncaught ReferenceError: PrimeFaces is
  not defined login.jsf:48 Uncaught ReferenceError: PrimeFaces is
  not defined login.jsf:48 Uncaught ReferenceError: PrimeFaces is
  not defined login.jsf:48 Uncaught ReferenceError: PrimeFaces is
  not defined login.jsf:49 Uncaught ReferenceError: PrimeFaces is
  not defined login.jsf:22
 
 
  Every time I hit F5 the page render changed, but still corrupted,
  and the console erros changed, but they were basically like
  above.
 
  Restarting the server solved the problem, and I never had this
  issue with Tomcat 7.
 
  Any ideas?
 
  Anything in the log files, like exceptions?

 +1

 Whenever things stop making any sense in our development environments,
 it's because we've suffered an OOME that we didn't notice. Weird stuff
 starts to happen at that point, and of course, restarting the JVM
 fixes everything.

 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1
 Comment: GPGTools - http://gpgtools.org
 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

 iQIcBAEBCAAGBQJTIdJIAAoJEBzwKT+lPKRYLegP/jyDVAPFKSjq6Il4k0tFm364
 67egIqQHR/ZoUK6hvB0u1TvnNb2dLAX3JiS/drEp5m9f95YVw5D8XARifmmY1zF0
 seQyn0J6qs/Yd2k7756iytTI0tu/3oQG3u+nGLJ2VRWb1JPT/wADFQxNNJS19V+0
 eyxy3vSFG+m/GYYzHC/fAWqBESFnr0nlrTL8smt8wuax7Jsb/GqDDHRb/X7Lgg/+
 svq/19rzWX4zuQjxbzhdQLxT4RNC/xskfTj3W9avbRTbqOoDZuI88iJ2IaVyh7hl
 E5AEUYaFrGVPdfPJJVQzouqtN5F2MlbhypcpoBb7yrZwUqXFaZmdUduGLVn0fdlk
 BoubFghyPDexd2/eO0nM0nnFB6LTFsCL8W3UgqA7RVU+tlfu7m22IqzBhWCPlpm4
 Ltw+OKP9HRBBg4zW3I+9fJQaKOMjC1nMks/v/SlCNfIDlc/uMGuvqpmq/gdocOaS
 yf30Hh1QjX/CawpRZn1gyiC4mVlfuEQLKaEKylKNEyaUfXWSEGYzhhqz9ouG0JkN
 /AUqbBe6aDY8Em6X+8+Mk00SE+8J3Ocn/vbxFOcXYgKvhBDaknZhf5UF5+v4QYBn
 5xGJ15LrTj7BgSHBYvk36/aDVFec1WcvJ0reZffoQiNwyMlsZ1cE5vC1pRvO5i+B
 DLvbA/qyIlL1wCww7iiZ
 =PzgU
 -END PGP SIGNATURE-

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




Re: Possible Tomcat 8.0.3 issue

2014-03-13 Thread Felipe Jaekel
 CATALINA_OPTS:
for arg in $CATALINA_OPTS
do
echo   $arg
done
echo 

echo Using JAVA_OPTS:
for arg in $JAVA_OPTS
do
echo   $arg
done
echo ___
echo 


2014-03-13 13:15 GMT-03:00 Howard W. Smith, Jr. smithh032...@gmail.com:

 On Thu, Mar 13, 2014 at 11:47 AM, Christopher Schultz 
 ch...@christopherschultz.net wrote:

  -BEGIN PGP SIGNED MESSAGE-
  Hash: SHA256
 
  Felipe,
 
  On 3/13/14, 10:57 AM, Felipe Jaekel wrote:
   There are lots of this in catalina log: *12-Mar-2014 08:41:43.828
   WARNING [http-nio-80-exec-28]
  
 com.sun.faces.application.resource.ResourceHandlerImpl.logMissingResource
  
  
  JSF1064: Unable to find or serve resource, primefaces.js, from library,
   primefaces.* *12-Mar-2014 08:41:43.829 WARNING
   [http-nio-80-exec-28]
  
 com.sun.faces.application.resource.ResourceHandlerImpl.logMissingResource
   * * org.apache.catalina.connector.ClientAbortException:
   java.io.IOException: Connection reset by peer*
  
   But these always appeared in my logs, I guess it happens when the
   client cancel the page load.
 

 Felipe,  why would a user cancel the page load? is this quite common that
 user cancels page load? are there pages in your app that would
 provoke/motivate user(s) to cancel page load? this/some page(s) take a long
 time to load?

 
  
   I did found something strange in the access log. Applications
   crashed around 2:20PM. I checked for primefaces.js at this time in
   the access log and its all 200 status, but I noticed some very
   small response sizes in some requests, which explains the
   JavaScripts errors on Chrome console.
  
   Here are the log files and some print-screens:
   https://dl.dropboxusercontent.com/u/66737052/logs-12-03-2014.tar.bz2
  
  
  
   Nothing changed in the system. I started to use Tomcat 8.0.3 in
   production on February 28th and the server is restarted daily to
   recycle PermGen space.
 
  I'm curious about this: what eats-up your PermGen space?
 

 if this behavior did not occur in tomcat7, why would it (start to) occur
 when using tomcat8?


 
   I'm using Mojarra 2.2.5.
 

 Mojarra 2.2.5 + tomcat8, hmmm

 Felipe, which servlet in your web.xml? servlet 2.5, 3.0, 3.1?

 Felipe, did you look at tomcat 8 migration guide (URL below)?

 https://tomcat.apache.org/migration-8.html



  
   This issue started to manifest at 10AM after a parallel deploy. At
   first only the icons disappeared from the new deployed version, but
   it was functional. Although new and old deployed versions had
   PrimeFaces 4.0.9, I started to think that might be something wrong
   with it, so I deployed a new version using 4.0.10. Problem was
   solved for some hours, but when it returned the status was what I
   mentioned above. Tried to parallel deploy with 4.0.8 but no
   success. After I restarted problem was solved, but in case it's
   relevant, there was only one version of each application running.
 
  My guess is still OOME: immediately after a parallel-deployment (which
  roughly doubles the non-session resident footprint of your web
  application, which you already say has PermGen issues) things start
  going wonky, and a JVM restart fixes things? My money is on an OOME.
  Note that they don't always have stack-traces along with them, so they
  are easy to miss when eyeballing log files.
 

 Felipe, can you share your java settings, similar to what I shared below?

 -Xms3G
 -Xmx3G
 -XX:MaxPermSize=384m
 -XX:+UseTLAB
 -XX:+UseConcMarkSweepGC
 -XX:+CMSClassUnloadingEnabled



  - -chris
  -BEGIN PGP SIGNATURE-
  Version: GnuPG v1
  Comment: GPGTools - http://gpgtools.org
  Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
 
  iQIcBAEBCAAGBQJTIdMGAAoJEBzwKT+lPKRYkkkP/31gOfqH+wxtEFTKXbNRmKPx
  56anmEVQqDo36icLTGRrXS9bhlq5UWZQvdm24n/aA2SeBYJWxOYK0eIU9SnY+Q5w
  CurqA7KLQPw0UVTXXR3k85etGT8Uuivfnup28bPeJTtsifOzlQOHNC/MpyBzhMaR
  vwhc94cXR3HC+eoM5mgGMHiMG17jT1P0ty6kCGuDPPNM3DwVyXxmZE0oQQ+Pgoq9
  XGJEnW1uKJG0vmM4tNRWWCrWxxu0nypMml/a93IdAZNgCkoEUuHnRqS4Qtie9O/i
  sMjuJ/dBrc9qMpBfEvGUhLrO6whFbjnVqwfi6saXIcwvEUhs/w7h0dvOsgF9UxLa
  a8R3mR14QNmLR9Pmh+3OqdwVOx+m4bec5oXjWvitin9RsuaurdRqRDAmvXIWG4ab
  PLTDGaVmKPIx58uizN0WlQloj2haN7FPvlj18rlirb245KK23sYQHPWTRsOV/KXS
  wkzlSmzUoIePzCS6jQcCA+lKQ0Is/+JQvoTlBxOgCV1FlqtYR9LTd4qzTDzsTnuH
  wyhC1+ovscEZPDHlNBUu1RSJGvnB+YccWttcTeXQi3i25bitt+L3HqUyWE7VJbaL
  9SetiKGcsJK/gx9NzSQXEwEoPXuTK3vPmW4HVgIg6X51TKORZpPsfknX/iBd1Hml
  VFCVjzEC334YBFgULc6a
  =w3Sk
  -END PGP SIGNATURE-
 
  -
  To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
  For additional commands, e-mail: users-h...@tomcat.apache.org
 
 



Re: DBCP2 connection pool leak?

2014-03-12 Thread Felipe Jaekel
Changing to tomcat-jdbc solved the problem.

Thanks


2014-02-28 16:03 GMT-03:00 Filip Hanik fi...@hanik.com:

 you can try out tomcat-jdbc, and see if that solves your problem, it may
 help you narrow it down.
 http://tomcat.apache.org/tomcat-8.0-doc/jdbc-pool.html




 On Fri, Feb 28, 2014 at 11:26 AM, Mark Thomas ma...@apache.org wrote:

  On 28/02/2014 18:22, Felipe Jaekel wrote:
   Hi,
  
   Today I tried to migrate my production server from 7.0.50 to 8.0.3.
  
   After about 3 hours running I start to get JDBC exceptions(stacktrace
   below) and the server stops responding. Looking at Amazon RDS
 monitoring
  it
   shows the connection limit reached 97%. Restarted the server and after
   about the same time the same problem happened.
  
   With 7.0.50 the highest value reached was 60%, so I think that the
   connection pool may be leaking.
  
   I understand that DBCP2 isn't final yet. I just like to know if that
 is a
   known issue, so I'll return to Tomcat 7.
 
  It isn't a known issue. There have been some code changes since the DBCP
  version that was used in 8.0.3 but nothing I recall that related to a
  connection leak. It is worth taking a look at what is going on with JMX
  as that might give you some hints.
 
  Mark
 
  
   Thanks,
   Phillip
  
  
  
 
 
  
   javax.persistence.PersistenceException:
   org.hibernate.exception.GenericJDBCException: could not inspect JDBC
   autocommit mode
 at
 
 org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1387)
 at
 
 org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1310)
 at
 org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:316)
 at
 
 br.com.spdata.persistence.mysql.service.ErroService.checkExistente(ErroService.java:134)
 at
 
 br.com.spdata.persistence.mysql.service.ErroService.persist(ErroService.java:58)
 at
 
 br.com.spdata.email.AbstractErrorPageController.(AbstractErrorPageController.java:78)
 at
  br.com.spdata.tecnico.ErrorPageController.(ErrorPageController.java:14)
 at
 sun.reflect.GeneratedConstructorAccessor798.newInstance(Unknown
  Source)
 at
 
 sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
 at
 java.lang.reflect.Constructor.newInstance(Constructor.java:526)
 at java.lang.Class.newInstance(Class.java:374)
 at
  com.sun.faces.mgbean.BeanBuilder.newBeanInstance(BeanBuilder.java:186)
 at com.sun.faces.mgbean.BeanBuilder.build(BeanBuilder.java:100)
 at
  com.sun.faces.mgbean.BeanManager.createAndPush(BeanManager.java:409)
 at com.sun.faces.mgbean.BeanManager.create(BeanManager.java:269)
 at
 
 com.sun.faces.el.ManagedBeanELResolver.resolveBean(ManagedBeanELResolver.java:257)
 at
 
 com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:117)
 at
 
 com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
 at
 
 com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
 at
  org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:80)
 at org.apache.el.parser.AstValue.getValue(AstValue.java:135)
 at
  org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:187)
 at
 
 com.sun.faces.facelets.el.ELText$ELTextVariable.writeText(ELText.java:238)
 at
 
 com.sun.faces.facelets.el.ELText$ELTextComposite.writeText(ELText.java:154)
 at
 
 com.sun.faces.facelets.compiler.TextInstruction.write(TextInstruction.java:85)
 at
 
 com.sun.faces.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:82)
 at
  com.sun.faces.facelets.compiler.UILeaf.encodeAll(UILeaf.java:183)
 at
  javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
 at
  org.primefaces.renderkit.HeadRenderer.encodeEnd(HeadRenderer.java:106)
 at
  javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919)
 at
  javax.faces.component.UIComponent.encodeAll(UIComponent.java:1863)
 at
  javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
 at
 
 com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:461)
 at
 
 com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:133)
 at
 
 javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337)
 at
 
 com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
 at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
 at
  com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
 at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647

DBCP2 connection pool leak?

2014-02-28 Thread Felipe Jaekel
Hi,

Today I tried to migrate my production server from 7.0.50 to 8.0.3.

After about 3 hours running I start to get JDBC exceptions(stacktrace
below) and the server stops responding. Looking at Amazon RDS monitoring it
shows the connection limit reached 97%. Restarted the server and after
about the same time the same problem happened.

With 7.0.50 the highest value reached was 60%, so I think that the
connection pool may be leaking.

I understand that DBCP2 isn't final yet. I just like to know if that is a
known issue, so I'll return to Tomcat 7.

Thanks,
Phillip




javax.persistence.PersistenceException:
org.hibernate.exception.GenericJDBCException: could not inspect JDBC
autocommit mode
at 
org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1387)
at 
org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1310)
at org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:316)
at 
br.com.spdata.persistence.mysql.service.ErroService.checkExistente(ErroService.java:134)
at 
br.com.spdata.persistence.mysql.service.ErroService.persist(ErroService.java:58)
at 
br.com.spdata.email.AbstractErrorPageController.(AbstractErrorPageController.java:78)
at 
br.com.spdata.tecnico.ErrorPageController.(ErrorPageController.java:14)
at sun.reflect.GeneratedConstructorAccessor798.newInstance(Unknown 
Source)
at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at java.lang.Class.newInstance(Class.java:374)
at 
com.sun.faces.mgbean.BeanBuilder.newBeanInstance(BeanBuilder.java:186)
at com.sun.faces.mgbean.BeanBuilder.build(BeanBuilder.java:100)
at com.sun.faces.mgbean.BeanManager.createAndPush(BeanManager.java:409)
at com.sun.faces.mgbean.BeanManager.create(BeanManager.java:269)
at 
com.sun.faces.el.ManagedBeanELResolver.resolveBean(ManagedBeanELResolver.java:257)
at 
com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:117)
at 
com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
at 
com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:80)
at org.apache.el.parser.AstValue.getValue(AstValue.java:135)
at 
org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:187)
at 
com.sun.faces.facelets.el.ELText$ELTextVariable.writeText(ELText.java:238)
at 
com.sun.faces.facelets.el.ELText$ELTextComposite.writeText(ELText.java:154)
at 
com.sun.faces.facelets.compiler.TextInstruction.write(TextInstruction.java:85)
at 
com.sun.faces.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:82)
at com.sun.faces.facelets.compiler.UILeaf.encodeAll(UILeaf.java:183)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
at 
org.primefaces.renderkit.HeadRenderer.encodeEnd(HeadRenderer.java:106)
at 
javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1863)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
at 
com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:461)
at 
com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:133)
at 
javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337)
at 
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:301)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at 
org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
at 
org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
at 
org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
at 
org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
at 
org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)
at 
org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
at 

Re: Limit log files rotation

2013-03-05 Thread Felipe Jaekel
Thanks for the link.

Searching a bit more I found this:
http://www.queuemetrics.com/manuals/QM_AdvancedConfig-chunked/ar01s17.html

Simple to setup, but anyway it would be nice if Tomcat could do this out of
the box, since the server can crash if it runs out of disk space.


2013/3/5 Daniel Mikusa dmik...@vmware.com

 On Mar 5, 2013, at 8:54 AM, Felipe Jaekel wrote:

  Hi,
 
  I'd like to limit log rotation to a specific number of days to avoid that
  the logs folder keep growing indeterminately.

 Which log files are you referring to?  Including the names would help.

 
  Tried to google about, people say to study Log4j or use crontab,
  but isn't there an easier way like a *maxHistory* property?

 Tomcat's default logging mechanism will simply rotate files.  It does not
 perform any cleanup or archival.

 If you want those features, you have two choices …

 1.) Setup a cron job to cleanup or archive old log files.
 2.) Use Tomcat's log4j support.  Log4j supports cleanup and archival.

   https://tomcat.apache.org/tomcat-7.0-doc/logging.html#Using_Log4j

 There's probably other things you can do as well.  Those are just the
 first two that popped into my head.

 Dan

 
  Thanks,
  Phillip

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




Re: Get active session list

2012-10-19 Thread Felipe Jaekel
Anyone?

2012/10/18 Felipe Jaekel fkjae...@gmail.com

 Found the following:

 context = (Context) wrapper.getParent();
 host = (Host) context.getParent();



 Context ctx = (Context) host.findChild(name);
 Manager manager = ctx.getManager();
 Session [] sessions = manager.findSessions();


 Had the same doubt I had when I looked at the PSI Probe code some days
 ago: how to handle the wrapper property?


 As a alternative I tried to implement *HttpSessionActivationListener*,
 but the methods aren't called when I restart the server.

 Thanks again for the help,
 Phillip


 2012/10/18 Christopher Schultz ch...@christopherschultz.net

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Felipe,

 On 10/18/12 9:34 AM, Felipe Jaekel wrote:
  I need to get the active session list. Searching about I saw a lot
  of people with the same question, but no answer.
 
  I don't want to write a list inside a HttpSessionListener and keep
  the session list there, because I use session serialization and the
  list inside the listener would be destroyed in case the server is
  restarted.

 You *can* get notification of sessions being de-serialized from the
 disk to maintain your list. Look at the other session-related
 listeners in the servlet API.

 You could also use JMX to get a list of sessions. Use JConsole to
 poke-around in Tomcat's JMX beans and find the one(s) that expose
 sessions. You may have to make your webapp privileged in order to
 make JMX calls.

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

 iEYEARECAAYFAlCAEgwACgkQ9CaO5/Lv0PARBACfZ+EG7KJWXt+49sbB1kVsLunF
 A4MAoKv1hM4KBlaAS4a1UaP0ePqfRr3W
 =n3WU
 -END PGP SIGNATURE-

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





Get active session list

2012-10-18 Thread Felipe Jaekel
I need to get the active session list. Searching about I saw a lot of
people with the same question, but no answer.

I don't want to write a list inside a HttpSessionListener and keep the
session list there, because I use session serialization and the list inside
the listener would be destroyed in case the server is restarted.

I'd like know which class does the Manager Application uses to get the
session list, so I can use it in my application too.

Thanks a lot,
Phillip


Re: Get active session list

2012-10-18 Thread Felipe Jaekel
Found the following:

context = (Context) wrapper.getParent();
 host = (Host) context.getParent();



 Context ctx = (Context) host.findChild(name);
 Manager manager = ctx.getManager();
 Session [] sessions = manager.findSessions();


Had the same doubt I had when I looked at the PSI Probe code some days ago:
how to handle the wrapper property?


As a alternative I tried to implement *HttpSessionActivationListener*, but
the methods aren't called when I restart the server.

Thanks again for the help,
Phillip


2012/10/18 Christopher Schultz ch...@christopherschultz.net

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Felipe,

 On 10/18/12 9:34 AM, Felipe Jaekel wrote:
  I need to get the active session list. Searching about I saw a lot
  of people with the same question, but no answer.
 
  I don't want to write a list inside a HttpSessionListener and keep
  the session list there, because I use session serialization and the
  list inside the listener would be destroyed in case the server is
  restarted.

 You *can* get notification of sessions being de-serialized from the
 disk to maintain your list. Look at the other session-related
 listeners in the servlet API.

 You could also use JMX to get a list of sessions. Use JConsole to
 poke-around in Tomcat's JMX beans and find the one(s) that expose
 sessions. You may have to make your webapp privileged in order to
 make JMX calls.

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

 iEYEARECAAYFAlCAEgwACgkQ9CaO5/Lv0PARBACfZ+EG7KJWXt+49sbB1kVsLunF
 A4MAoKv1hM4KBlaAS4a1UaP0ePqfRr3W
 =n3WU
 -END PGP SIGNATURE-

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




EL not working with multiple parameters

2012-08-09 Thread Felipe Jaekel
When I try to call a method with two parametes in a XHTML page on Tomcat
7.0.29 it doesn't works. I'll attach the stacktrace below.

It's strange because the same code runs fine on Glassfish 3.1.

Is this a bug in Tomcat EL?

Thanks,
Phillip

Stacktrace:
Advertência: #{atendimentosBean.atender(atendimento, rowKey)}:
java.lang.NullPointerException
javax.faces.FacesException: #{atendimentosBean.atender(atendimento,
rowKey)}: java.lang.NullPointerException
at
com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:110)
at javax.faces.component.UICommand.broadcast(UICommand.java:315)
at javax.faces.component.UIData.broadcast(UIData.java:1093)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)
at
javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)
at
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at br.com.spdata.persistence.MySqlFilter.doFilter(MySqlFilter.java:57)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
br.com.spdata.persistence.FirebirdFilter.doFilter(FirebirdFilter.java:50)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.jboss.solder.servlet.exception.CatchExceptionFilter.doFilter(CatchExceptionFilter.java:65)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.jboss.solder.servlet.event.ServletEventBridgeFilter.doFilter(ServletEventBridgeFilter.java:74)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
br.com.spdata.tecnico.filter.LoginFilter.doFilter(LoginFilter.java:115)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1001)
at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: javax.faces.el.MethodNotFoundException:
java.lang.NullPointerException
at
javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:104)
at
com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
... 42 more
Caused by: java.lang.NullPointerException
at java.lang.Class.isAssignableFrom(Native Method)
at
org.apache.el.util.ReflectionUtil.isAssignableFrom(ReflectionUtil.java:319)
at org.apache.el.util.ReflectionUtil.getMethod(ReflectionUtil.java:185)
at org.apache.el.parser.AstValue.invoke(AstValue.java:257)
at

Re: EL not working with multiple parameters

2012-08-09 Thread Felipe Jaekel
Weld 1.1.8
Seam Faces 3.1.0

public void atender(StAtendimento atendimento, int
indiceAtendimentoSelecionado)
{
 try
{
stAtendimentoService.atender(atendimento, atendente,
status, indiceAtendimentoSelecionado);

conversasBean.abrirAba(atendimento);

filasBean.atualizaFilas();

//exibirDadosCliente(atendimento);
}
catch(InicioAtendimentoException ex)
 {
addErrorMessage(ex.getMessage());
}
 }



2012/8/9 Martin Gainty mgai...@hotmail.com


 WHICH VERSION of Jboss are you implementing?

 where is the code for atendimentosBean?

 Martin
 __
 Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

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


  From: fkjae...@gmail.com
  Date: Thu, 9 Aug 2012 10:06:15 -0300
  Subject: EL not working with multiple parameters
  To: users@tomcat.apache.org
 
  When I try to call a method with two parametes in a XHTML page on Tomcat
  7.0.29 it doesn't works. I'll attach the stacktrace below.
 
  It's strange because the same code runs fine on Glassfish 3.1.
 
  Is this a bug in Tomcat EL?
 
  Thanks,
  Phillip
 
  Stacktrace:
  Advertência: #{atendimentosBean.atender(atendimento, rowKey)}:
  java.lang.NullPointerException
  javax.faces.FacesException: #{atendimentosBean.atender(atendimento,
  rowKey)}: java.lang.NullPointerException
  at
 
 com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:110)
  at javax.faces.component.UICommand.broadcast(UICommand.java:315)
  at javax.faces.component.UIData.broadcast(UIData.java:1093)
  at
 javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)
  at
  javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)
  at
 
 com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
  at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
  at
 com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
  at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
  at
 
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
  at
 
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
  at
 
 org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
  at
 
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
  at
 
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
  at
 br.com.spdata.persistence.MySqlFilter.doFilter(MySqlFilter.java:57)
  at
 
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
  at
 
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
  at
  br.com.spdata.persistence.FirebirdFilter.doFilter(FirebirdFilter.java:50)
  at
 
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
  at
 
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
  at
 
 org.jboss.solder.servlet.exception.CatchExceptionFilter.doFilter(CatchExceptionFilter.java:65)
  at
 
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
  at
 
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
  at
 
 org.jboss.solder.servlet.event.ServletEventBridgeFilter.doFilter(ServletEventBridgeFilter.java:74)
  at
 
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
  at
 
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
  at
  br.com.spdata.tecnico.filter.LoginFilter.doFilter(LoginFilter.java:115)
  at
 
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
  at
 
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
  at