Fórum Problema com Netbeans + Glassfish #574982
15/02/2017
0
Estou acompanhando o curso Construindo uma aplicação completa com JavaEE, fazendo algumas modificações em cima do que está sendo ensinado (PostgreSQL e Hibernate com anotações JPA).
Embora tenha sido mostrado como configurar a infraestrutura da aplicação, fiz o mesmo passo, porém, quando vou rodar um teste unitário, recebo a mensagem:
Caused by: org.apache.derby.client.am.DisconnectException: java.net.ConnectException : Erro ao conectar no servidor 'localhost' porta '1527'. Recebida a mensagem: 'Conexão recusada (Connection refused)'.
Meu persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="BugTrackerEE-ejbPU" transaction-type="JTA">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<properties>
<property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.SunOneJtaPlatform"/>
<property name="javax.persistence.jdbc.driver" value="org.postgresql.Driver"/>
<property name="javax.persistence.jdbc.url" value="jdbc:postgresql://localhost:5432/bugtrackerEE"/>
<property name="javax.persistence.jdbc.user" value="postgres"/>
<property name="javax.persistence.jdbc.password" value="postgres"/>
<!-- C3P0 -->
<property name="c3p0.acquire_increment" value="2"/>
<property name="c3p0.idle_test_period" value="120"/>
<property name="c3p0.max_size" value="30"/>
<property name="c3p0.max_statments" value="10"/>
<property name="c3p0.min_size" value="5"/>
<property name="c3p0.timeout" value="120"/>
<!-- hibernate -->
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.format_sql" value="true"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
</properties>
</persistence-unit>
</persistence>
Alguém poderia me auxiliar e dizer o que esqueci de configurar na persistência?
Samuel Barbosa
Curtir tópico
+ 0Posts
15/02/2017
Samuel Barbosa
fev 15, 2017 2:42:50 PM org.glassfish.deployment.admin.DeployCommand execute GRAVE: Exception while preparing the app : [PersistenceUnit: BugTrackerEE-ejbPU] Unable to build Hibernate SessionFactory org.hibernate.exception.GenericJDBCException: Unable to open JDBC Connection for DDL execution
Gostei + 0
15/02/2017
Samuel Barbosa
Exception while preparing the app : Invalid resource : jdbc/bugtrackerpool__pm com.sun.appserv.connectors.internal.api.ConnectorRuntimeException: Invalid resource : jdbc/bugtrackerpool__pm
Nesse fórum tem a solução, porém, quando tento criar o resource pelo glassfish, retorna o erro:
HTTP Status 500 - Internal Server Error type Exception report messageInternal Server Error descriptionThe server encountered an internal error that prevented it from fulfilling this request. exception java.lang.IllegalStateException: getOutputStream() has already been called for this response note The full stack traces of the exception and its root causes are available in the GlassFish Server Open Source Edition 4.1.1 logs. GlassFish Server Open Source Edition 4.1.1
No aguardo de uma alma caridosa que saiba como resolver :)
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)