Solucionado (ver solução)
Solucionado
(ver solução)
4
respostas

Error ao fazer o deploy pelo do artefato

{"WFLYCTL0080: Failed services" => {"jboss.persistenceunit.\"agendamentoemail-0.0.1-SNAPSHOT.war#agendamento\"" => 
"javax.persistence.PersistenceException: [PersistenceUnit: agendamento] Unable to build Hibernate SessionFactory
    Caused by: javax.persistence.PersistenceException: [PersistenceUnit: agendamento] Unable to build Hibernate SessionFactory
    Caused by: org.hibernate.exception.GenericJDBCException: Unable to open JDBC Connection for DDL execution
    Caused by: java.sql.SQLException: javax.resource.ResourceException: IJ000453: Unable to get managed connection for 
    java:jboss/datasources/AgendamentoDS
    Caused by: javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:jboss/datasources/AgendamentoDS
    Caused by: javax.resource.ResourceException: IJ031084: Unable to create connection
    Caused by: java.sql.SQLException: The server time zone value 'unknown' is unrecognized or represents more than one time zone. 
    You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value
    if you want to utilize time zone support.
    Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value 'unknown' is unrecognized or 
    represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property)
    to use a more specifc time zone value if you want to utilize time zone support."}}
4 respostas

Oi Miguel,

Na string de conexão jdbc, tenta configurar o timezone, exemplo:

jdbc:mysql://localhost/db?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC

Não funcionou.

Terminal do jboss-cli.

(c) 2019 Microsoft Corporation. Todos os direitos reservados.

F:\Alura\ejb\tools\wildfly-15.0.1.Final\bin>jboss-cli.bat --connect
[standalone@localhost:9990 /] module add --name=com.mysql.jdbc --resources=F:\Alura\ejb\tools\mysql-connector-java-5.1.38\mysql-connector-java-5.1.38-bin.jar --dependencies=javax.api,javax.transaction.api
[standalone@localhost:9990 /] /subsystem=datasources/jdbc-driver=mysql:add(driver-name="mysql",driver-module-name="com.mysql.jdbc",driver-class-name=com.mysql.jdbc.Driver)
{"outcome" => "success"}

[standalone@localhost:9990 /] data-source add --name=AgendamendoDS --driver-name=mysql --connection-url=jdbc:mysql://localhost:3306/agendamentobd --jndi-name=java:jboss/jdbc/AgendamendoDS --user-name=root --password=12345678
[standalone@localhost:9990 /] data-source enable --name=AgendamentoDS
WFLYCTL0216: Management resource '[
    ("subsystem" => "datasources"),
    ("data-source" => "AgendamentoDS")
]' not found

[standalone@localhost:9990 /]
solução!
Log do servidor na ide
23:44:00,109 INFO  [org.jboss.as.ejb3.deployment] (MSC service thread 1-4) WFLYEJB0473: JNDI bindings for session bean named 'AgendamentoEmailBusiness' in deployment unit 'deployment "agendamentoemail-0.0.1-SNAPSHOT.war"' are as follows:

    java:global/agendamentoemail-0.0.1-SNAPSHOT/AgendamentoEmailBusiness!br.com.alura.business.AgendamentoEmailBusiness
    java:app/agendamentoemail-0.0.1-SNAPSHOT/AgendamentoEmailBusiness!br.com.alura.business.AgendamentoEmailBusiness
    java:module/AgendamentoEmailBusiness!br.com.alura.business.AgendamentoEmailBusiness
    ejb:agendamentoemail-0.0.1-SNAPSHOT/AgendamentoEmailBusiness!br.com.alura.business.AgendamentoEmailBusiness
    java:global/agendamentoemail-0.0.1-SNAPSHOT/AgendamentoEmailBusiness
    java:app/agendamentoemail-0.0.1-SNAPSHOT/AgendamentoEmailBusiness
    java:module/AgendamentoEmailBusiness

23:44:00,109 INFO  [org.jboss.as.ejb3.deployment] (MSC service thread 1-4) WFLYEJB0473: JNDI bindings for session bean named 'AgendamentoEmailDao' in deployment unit 'deployment "agendamentoemail-0.0.1-SNAPSHOT.war"' are as follows:

    java:global/agendamentoemail-0.0.1-SNAPSHOT/AgendamentoEmailDao!dao.AgendamentoEmailDao
    java:app/agendamentoemail-0.0.1-SNAPSHOT/AgendamentoEmailDao!dao.AgendamentoEmailDao
    java:module/AgendamentoEmailDao!dao.AgendamentoEmailDao
    ejb:agendamentoemail-0.0.1-SNAPSHOT/AgendamentoEmailDao!dao.AgendamentoEmailDao
    java:global/agendamentoemail-0.0.1-SNAPSHOT/AgendamentoEmailDao
    java:app/agendamentoemail-0.0.1-SNAPSHOT/AgendamentoEmailDao
    java:module/AgendamentoEmailDao

23:44:00,186 INFO  [org.apache.activemq.artemis.ra] (MSC service thread 1-2) AMQ151007: Resource adaptor started
23:44:00,189 INFO  [org.jboss.as.connector.services.resourceadapters.ResourceAdapterActivatorService$ResourceAdapterActivator] (MSC service thread 1-2) IJ020002: Deployed: file://RaActivatoractivemq-ra
23:44:00,195 INFO  [org.jboss.as.connector.deployment] (MSC service thread 1-2) WFLYJCA0002: Bound JCA ConnectionFactory [java:/JmsXA]
23:44:00,195 INFO  [org.jboss.as.connector.deployment] (MSC service thread 1-2) WFLYJCA0118: Binding connection factory named java:/JmsXA to alias java:jboss/DefaultJMSConnectionFactory
23:44:00,392 WARN  [org.jboss.as.jaxrs] (MSC service thread 1-7) WFLYRS0018: Explicit usage of Jackson annotation in a JAX-RS deployment; the system will disable JSON-B processing for the current deployment. Consider setting the 'resteasy.preferJacksonOverJsonB' property to 'false' to restore JSON-B.
23:44:00,404 INFO  [org.infinispan.factories.GlobalComponentRegistry] (MSC service thread 1-5) ISPN000128: Infinispan version: Infinispan 'Infinity Minus ONE +2' 9.4.3.Final
23:44:00,435 INFO  [org.jboss.weld.Version] (MSC service thread 1-7) WELD-000900: 3.0.5 (Final)
23:44:01,074 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 80) WFLYCLINF0002: Started client-mappings cache from ejb container
23:44:01,156 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "agendamentoemail-0.0.1-SNAPSHOT.war")]) - failure description: {
    "WFLYCTL0412: Required services that are not installed:" => ["jboss.naming.context.java.jboss.datasources.AgendamendoDS"],
    "WFLYCTL0180: Services with missing/unavailable dependencies" => [
        "jboss.persistenceunit.\"agendamentoemail-0.0.1-SNAPSHOT.war#agendamentobd\".__FIRST_PHASE__ is missing [jboss.naming.context.java.jboss.datasources.AgendamendoDS]",
        "jboss.persistenceunit.\"agendamentoemail-0.0.1-SNAPSHOT.war#agendamentobd\" is missing [jboss.naming.context.java.jboss.datasources.AgendamendoDS]"
    ]
}
23:44:01,166 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 46) WFLYSRV0010: Deployed "agendamentoemail-0.0.1-SNAPSHOT.war" (runtime-name : "agendamentoemail-0.0.1-SNAPSHOT.war")
23:44:01,169 INFO  [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
WFLYCTL0184:    New missing/unsatisfied dependencies:
      service jboss.naming.context.java.jboss.datasources.AgendamendoDS (missing) dependents: [service jboss.persistenceunit."agendamentoemail-0.0.1-SNAPSHOT.war#agendamentobd", service jboss.persistenceunit."agendamentoemail-0.0.1-SNAPSHOT.war#agendamentobd".__FIRST_PHASE__] 
WFLYCTL0448: 24 additional services are down due to their dependencies being missing or failed
23:44:01,261 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0212: Resuming server