brevleq
brevleq

Reputation: 2141

Glassfish connection pool don't work after restart server

QUESTION CHANGED

I have a connection pool in Glassfish 3.1 to connect to SqlServer 2008 Express, this pool works fine, but when Glassfish is restarted, the connection pool can't ping and stops working. To work again, I go to pool configuration->aditional properties and change host name (ex. localhost to 127.0.0.1), as you can see in this screen.aditional properties

I've noticed this problem just happens when my application is deployed before server restart... If my application isn't deployed and I restart server, no problem happens when I try to ping the pool. Looking at log file, I can see these warnings at deployment:

[#|2012-06-22T17:24:48.979-0300|WARNING|null|null|_ThreadID=1;_ThreadName=Thread-2;|Record begin marker is not a proper value so using default.|#]
[#|2012-06-22T17:24:48.979-0300|WARNING|null|null|_ThreadID=1;_ThreadName=Thread-2;|Record end marker is not a proper value so using default.|#]
[#|2012-06-22T17:24:48.979-0300|WARNING|null|null|_ThreadID=1;_ThreadName=Thread-2;|Log Format field separator is not a character so using default.|#]
[#|2012-06-22T17:25:20.080-0300|WARNING|glassfish3.1.1|org.eclipse.persistence.session.file:/home/hudson/projetos/ERP-HM/modulos-web/erp-web/target/erp-web-0.1.0/WEB-INF/lib/persistencia-erp-0.1.0.jar_erpPU.ejb_or_metadata|_ThreadID=17;_ThreadName=Thread-2;|You have specified multiple ids for the entity class [com.hrgi.persistencia.erp.entidades.Composicao] without specifying an @IdClass. By doing this you may lose the ability to find by identity, distributed cache support etc. Note: You may however use entity manager find operations by passing a list of primary key fields. Else, you will have to use JPQL queries to read your entities. For other id options see @PrimaryKey.|#]
[#|2012-06-22T17:25:41.769-0300|WARNING|glassfish3.1.1|org.springframework.beans.GenericTypeAwarePropertyDescriptor|_ThreadID=17;_ThreadName=Thread-2;|Invalid JavaBean property 'armazenador' being accessed! Ambiguous write methods found next to actually used [public void com.hrgi.persistencia.nfe.controladores.ControladorArmazenamentoEmitenteNFe.setArmazenador(com.hrgi.persistencia.nfe.dao.interfaces.IEmitenteDao)]: [public void com.hrgi.persistencia.controladores.ControladorArmazenamento.setArmazenador(com.hrgi.persistencia.dao.IArmazenadorDao)]|#]
[#|2012-06-22T17:25:49.734-0300|WARNING|glassfish3.1.1|org.eclipse.persistence.session.file:/home/hudson/projetos/ERP-HM/modulos-web/erp-web/target/erp-web-0.1.0/WEB-INF/lib/persistencia-erp-0.1.0.jar_erpPU.server|_ThreadID=17;_ThreadName=Thread-2;|Multiple [2] JMX MBeanServer instances exist, we will use the server at index [0] : [com.sun.enterprise.v3.admin.DynamicInterceptor@2ed0005e].|#]
[#|2012-06-22T17:25:49.737-0300|WARNING|glassfish3.1.1|org.eclipse.persistence.session.file:/home/hudson/projetos/ERP-HM/modulos-web/erp-web/target/erp-web-0.1.0/WEB-INF/lib/persistencia-erp-0.1.0.jar_erpPU.server|_ThreadID=17;_ThreadName=Thread-2;|JMX MBeanServer in use: [com.sun.enterprise.v3.admin.DynamicInterceptor@2ed0005e] from index [0] |#]
[#|2012-06-22T17:25:49.740-0300|WARNING|glassfish3.1.1|org.eclipse.persistence.session.file:/home/hudson/projetos/ERP-HM/modulos-web/erp-web/target/erp-web-0.1.0/WEB-INF/lib/persistencia-erp-0.1.0.jar_erpPU.server|_ThreadID=17;_ThreadName=Thread-2;|JMX MBeanServer in use: [com.sun.jmx.mbeanserver.JmxMBeanServer@e40e825] from index [1] |#]
[#|2012-06-22T17:25:52.457-0300|INFO|glassfish3.1.1|org.apache.myfaces.webapp.WebConfigParamsLogger|_ThreadID=17;_ThreadName=Thread-2;|No context init parameter 'org.apache.myfaces.ERROR_HANDLER' found.|#]
[#|2012-06-22T17:25:52.474-0300|INFO|glassfish3.1.1|org.apache.myfaces.webapp.WebConfigParamsLogger|_ThreadID=17;_ThreadName=Thread-2;|No context init parameter 'org.apache.myfaces.ERROR_TEMPLATE_RESOURCE' found, using default value 'META-INF/rsc/myfaces-dev-error.xml'.|#]

I supressed an javax.mail.MessagingException, because it happens when no password is setted to connect to mail server...

Is there something wrong in my application that is causing this problem??

Upvotes: 0

Views: 837

Answers (2)

brevleq
brevleq

Reputation: 2141

Solved, the problem was in jndi dataSource... I simply removed jndi dataSource and used local datasource in the application.

Upvotes: 0

Alex Vaz
Alex Vaz

Reputation: 516

Mmhh thats extrange...

I would first check the C:\Windows\System32\drivers\etc\hosts

Make sure the mapping of localhost is not corrupted...

127.0.0.1       localhost
::1             localhost

Either way, this seems to be an issue of name resolution, either with the hosts file or the DNS server.

Could you check those and give more info if any more available ??

Upvotes: 1

Related Questions