重启服务器后,Glassfish连接池不起作用

时间:2012-06-11 13:02:16

标签: java-ee jpa-2.0 eclipselink glassfish-3 connection-pooling

问题已更改

我在Glassfish 3.1中有一个连接池连接到SqlServer 2008 Express,这个池工作正常,但是当Glassfish重新启动时,连接池无法ping并停止工作。要再次使用,我将转到pool configuration-> aditional属性并更改主机名(例如localhost到127.0.0.1),如此屏幕所示。aditional properties

我注意到在服务器重启之前部署我的应用程序时会发生此问题...如果我的应用程序未部署且我重新启动服务器,那么当我尝试ping池时没有问题。查看日志文件,我可以在部署时看到这些警告:

[#|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'.|#]

我压制了一个javax.mail.MessagingException,因为当没有设置密码连接到邮件服务器时会发生这种情况......

我的应用程序中是否存在导致此问题的错误?

2 个答案:

答案 0 :(得分:1)

Mmhh那就是外推......

我首先检查C:\ Windows \ System32 \ drivers \ etc \ hosts

确保localhost的映射没有损坏...

127.0.0.1       localhost
::1             localhost

无论哪种方式,这似乎都是名称解析的问题,无论是使用hosts文件还是DNS服务器。

你能检查一下并提供更多信息吗?

答案 1 :(得分:0)

解决了,问题出在jndi dataSource中...... 我只是删除了jndi dataSource并在应用程序中使用了本地数据源。