0 Replies Latest reply on May 27, 2009 3:58 PM by Moissane Hernández

    com.mysql.jdbc.CommunicationsException???

    Moissane Hernández Newbie

      Hello I´m using seam 2.0 with tomcat 6. I have my program that using hibernate to connect to MySQL database works perfect at the  development environment. The thing is when I pass it on to production enviroment, works almost fine. Next of being several hours doing nothing (in the evening), and when I want to do a transaction, it throw this exception at me:


      May 26, 2009 4:24:03 PM org.jboss.seam.contexts.Contexts startup
      INFO: starting up: org.jboss.seam.security.identity
      May 26, 2009 4:24:04 PM org.jboss.seam.drools.RuleBase compileRuleBase
      INFO: parsing rules: /security.drl
      May 26, 2009 4:24:05 PM org.jboss.seam.contexts.Contexts startup
      INFO: starting up: org.jboss.seam.web.session
      May 26, 2009 4:24:05 PM org.hibernate.transaction.JDBCTransaction begin
      SEVERE: JDBC begin failed
      com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception: 
      
      ** BEGIN NESTED EXCEPTION ** 
      
      java.io.EOFException
      
      STACKTRACE:
      
      java.io.EOFException
              at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1956)
              at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2368)
              at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2867)
              at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1616)
              at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1708)
              at com.mysql.jdbc.Connection.execSQL(Connection.java:3249)
              at com.mysql.jdbc.Connection.setAutoCommit(Connection.java:5392)
              at org.apache.tomcat.dbcp.dbcp.DelegatingConnection.setAutoCommit(DelegatingConnection.java:331)
              at org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.setAutoCommit(PoolingDataSource.java:317)
              at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:63)
              at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1326)
              at org.hibernate.ejb.TransactionImpl.begin(TransactionImpl.java:38)
              at org.jboss.seam.transaction.EntityTransaction.begin(EntityTransaction.java:81)
              at org.jboss.seam.jsf.SeamPhaseListener.begin(SeamPhaseListener.java:566)
              at org.jboss.seam.jsf.SeamPhaseListener.handleTransactionsBeforePhase(SeamPhaseListener.java:307)
              at org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:142)
              at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:116)
              at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:222)
              at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
              at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
              at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:44)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
              at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
              at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
              at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
              at java.lang.Thread.run(Unknown Source)
      
      ** END NESTED EXCEPTION **
      
      Last packet sent to the server was 47 ms ago.
              at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2579)
              at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2867)
              at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1616)
              at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1708)
              at com.mysql.jdbc.Connection.execSQL(Connection.java:3249)
              at com.mysql.jdbc.Connection.setAutoCommit(Connection.java:5392)
              at org.apache.tomcat.dbcp.dbcp.DelegatingConnection.setAutoCommit(DelegatingConnection.java:331)
              at org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.setAutoCommit(PoolingDataSource.java:317)
              at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:63)
              at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1326)
              at org.hibernate.ejb.TransactionImpl.begin(TransactionImpl.java:38)
              at org.jboss.seam.transaction.EntityTransaction.begin(EntityTransaction.java:81)
              at org.jboss.seam.jsf.SeamPhaseListener.begin(SeamPhaseListener.java:566)
              at org.jboss.seam.jsf.SeamPhaseListener.handleTransactionsBeforePhase(SeamPhaseListener.java:307)
              at org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:142)
              at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:116)
              at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:222)
              at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
              at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
              at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:44)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
              at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
              at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
              at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
              at java.lang.Thread.run(Unknown Source)
      May 26, 2009 4:24:05 PM org.jboss.seam.jsf.SeamPhaseListener beforePhase
      SEVERE: uncaught exception
      java.lang.IllegalStateException: Could not start transaction
              at org.jboss.seam.jsf.SeamPhaseListener.begin(SeamPhaseListener.java:571)
              at org.jboss.seam.jsf.SeamPhaseListener.handleTransactionsBeforePhase(SeamPhaseListener.java:307)
              at org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:142)
              at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:116)
              at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:222)
              at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
              at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
              at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:44)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
              at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
              at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
              at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
              at java.lang.Thread.run(Unknown Source)
      Caused by: javax.persistence.PersistenceException: org.hibernate.TransactionException: JDBC begin failed: 
              at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:630)
              at org.hibernate.ejb.TransactionImpl.begin(TransactionImpl.java:41)
              at org.jboss.seam.transaction.EntityTransaction.begin(EntityTransaction.java:81)
              at org.jboss.seam.jsf.SeamPhaseListener.begin(SeamPhaseListener.java:566)
              ... 39 more
      Caused by: org.hibernate.TransactionException: JDBC begin failed: 
              at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:68)
              at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1326)
              at org.hibernate.ejb.TransactionImpl.begin(TransactionImpl.java:38)
              ... 41 more
      Caused by: com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception: 
      
      ** BEGIN NESTED EXCEPTION ** 
      
      java.io.EOFException
      
      STACKTRACE:
      
      java.io.EOFException
              at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1956)
              at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2368)
              at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2867)
              at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1616)
              at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1708)
              at com.mysql.jdbc.Connection.execSQL(Connection.java:3249)
              at com.mysql.jdbc.Connection.setAutoCommit(Connection.java:5392)
              at org.apache.tomcat.dbcp.dbcp.DelegatingConnection.setAutoCommit(DelegatingConnection.java:331)
              at org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.setAutoCommit(PoolingDataSource.java:317)
              at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:63)
              at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1326)
              at org.hibernate.ejb.TransactionImpl.begin(TransactionImpl.java:38)
              at org.jboss.seam.transaction.EntityTransaction.begin(EntityTransaction.java:81)
              at org.jboss.seam.jsf.SeamPhaseListener.begin(SeamPhaseListener.java:566)
              at org.jboss.seam.jsf.SeamPhaseListener.handleTransactionsBeforePhase(SeamPhaseListener.java:307)
              at org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:142)
              at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:116)
              at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:222)
              at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
              at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
              at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:44)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
              at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
              at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
              at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
              at java.lang.Thread.run(Unknown Source)
      
      ** END NESTED EXCEPTION **
      
      Last packet sent to the server was 47 ms ago.
              at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2579)
              at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2867)
              at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1616)
              at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1708)
              at com.mysql.jdbc.Connection.execSQL(Connection.java:3249)
              at com.mysql.jdbc.Connection.setAutoCommit(Connection.java:5392)
              at org.apache.tomcat.dbcp.dbcp.DelegatingConnection.setAutoCommit(DelegatingConnection.java:331)
              at org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.setAutoCommit(PoolingDataSource.java:317)
              at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:63)
              ... 43 more
      



      Any idea about this comunication expception?


      This is my context.xml:


      <?xml version="1.0" encoding="UTF-8"?>
      
      <Context path="/myapp" docBase="myapp" debug="5" reloadable="true" 
              crossContext="true">
      
              <Resource auth="Container" driverClassName="com.mysql.jdbc.Driver"
                      maxActive="100" maxIdle="30" maxWait="1000" name="jdbc/myappDS"
                      type="javax.sql.DataSource" url="jdbc:mysql://localhost:3306/mydb" 
                      username="uuuu" password="pppp" />
                              
      </Context>



      this is my components.xml:


      <?xml version="1.0" encoding="UTF-8"?>
      <components xmlns="http://jboss.com/products/seam/components"
                  xmlns:core="http://jboss.com/products/seam/core"
                  xmlns:persistence="http://jboss.com/products/seam/persistence"
                  xmlns:drools="http://jboss.com/products/seam/drools"
                  xmlns:bpm="http://jboss.com/products/seam/bpm"
                  xmlns:security="http://jboss.com/products/seam/security"
                  xmlns:mail="http://jboss.com/products/seam/mail"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xmlns:transaction="http://jboss.com/products/seam/transaction"
                  xmlns:web="http://jboss.com/products/seam/web"            
                  xsi:schemaLocation=
                      "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd 
                       http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.0.xsd 
                       http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.0.xsd
                       http://jboss.com/products/seam/bpm http://jboss.com/products/seam/bpm-2.0.xsd
                       http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.0.xsd
                       http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-2.0.xsd
                       http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.0.xsd">
      
         <core:init debug="true" jndi-pattern="@jndiPattern@"/>
         
         <transaction:entity-transaction entity-manager="#{entityManager}"/>
           
         <core:manager concurrent-request-timeout="500" 
                       conversation-timeout="120000" 
                       conversation-id-parameter="cid"/>
          
         <persistence:managed-persistence-context name="entityManager"
                                           auto-create="true"
                                entity-manager-factory="#{myappEntityManagerFactory}"/>
      
         <persistence:entity-manager-factory name="myappEntityManagerFactory" 
                            persistence-unit-name="myapp"/>
         
         <drools:rule-base name="securityRules">
             <drools:rule-files><value>/security.drl</value></drools:rule-files>
         </drools:rule-base>
      
         <security:identity authenticate-method="#{authenticator.authenticate}" 
                                 security-rules="#{securityRules}"
                                    remember-me="true"/>
                                    
         <event type="org.jboss.seam.notLoggedIn">
             <action execute="#{redirect.captureCurrentView}"/>
         </event>
         <event type="org.jboss.seam.postAuthenticate">
             <action execute="#{redirect.returnToCapturedView}"/>
         </event>
         
         <web:context-filter url-pattern="/myapp"/>
            
         <!-- 
         <mail:mail-session host="localhost" port="2525" username="test" password="test" />
         -->
              
         <!-- For use with jBPM pageflow or process management -->
         <!--  
         <bpm:jbpm>
            <bpm:process-definitions></bpm:process-definitions>
            <bpm:pageflow-definitions></bpm:pageflow-definitions>
         </bpm:jbpm>
         -->
            
      </components>



      this is my web.xml:


      <?xml version="1.0"?>
      <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
      
              <!-- Ajax4jsf -->
              <context-param>
                      <param-name>org.richfaces.SKIN</param-name>
                      <param-value>blueSky</param-value>
              </context-param>
      
              <!-- Facelets development mode (disable in production) -->
              <!-- 
                      <context-param>
                      <param-name>facelets.DEVELOPMENT</param-name>
                      <param-value>true</param-value>
                      </context-param>
              -->
              <!-- JSF -->
      
              <context-param>
                      <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
                      <param-value>.xhtml</param-value>
              </context-param>
      
              <filter>
                      <filter-name>Seam Filter</filter-name>
                      <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
              </filter>
      
              <filter-mapping>
                      <filter-name>Seam Filter</filter-name>
                      <url-pattern>/*</url-pattern>
              </filter-mapping>
      
              <!-- URL Rewriter -->
      
              <filter>
                      <filter-name>UrlRewriteFilter</filter-name>
                      <filter-class>
                              org.tuckey.web.filters.urlrewrite.UrlRewriteFilter
                      </filter-class>
                      <init-param>
                              <param-name>logLevel</param-name>
                              <param-value>WARN</param-value>
                      </init-param>
              </filter>
              
              <filter-mapping>
                      <filter-name>UrlRewriteFilter</filter-name>
                      <url-pattern>/*</url-pattern>
              </filter-mapping>
      
              <!-- Seam -->
      
              <listener>
                      <listener-class>
                              org.jboss.seam.servlet.SeamListener
                      </listener-class>
              </listener>
      
              <servlet>
                      <servlet-name>Seam Resource Servlet</servlet-name>
                      <servlet-class>
                              org.jboss.seam.servlet.SeamResourceServlet
                      </servlet-class>
              </servlet>
      
              <servlet>
                      <servlet-name>Faces Servlet</servlet-name>
                      <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
                      <load-on-startup>1</load-on-startup>
              </servlet>
      
              <servlet-mapping>
                      <servlet-name>Seam Resource Servlet</servlet-name>
                      <url-pattern>/seam/resource/*</url-pattern>
              </servlet-mapping>
      
              <servlet-mapping>
                      <servlet-name>Faces Servlet</servlet-name>
                      <url-pattern>*.seam</url-pattern>
              </servlet-mapping>
      
              <session-config>
                      <session-timeout>20</session-timeout>
              </session-config>
      
              <security-constraint>
                      <display-name>Restrict raw XHTML Documents</display-name>
                      <web-resource-collection>
                              <web-resource-name>XHTML</web-resource-name>
                              <url-pattern>*.xhtml</url-pattern>
                      </web-resource-collection>
                      <auth-constraint />
              </security-constraint>
      
              <login-config>
                      <auth-method>BASIC</auth-method>
              </login-config>
      
              <!-- for connection, add by me -->
              <resource-ref>
                      <description>DB Connection</description>
                      <res-ref-name>jdbc/myappDS</res-ref-name>
                      <res-type>javax.sql.DataSource</res-type>
                      <res-auth>Container</res-auth>
              </resource-ref>
      
      </web-app>