Solucionado (ver solução)
Solucionado
(ver solução)
1
resposta

Erro ao rodar o projeto após ter criado a classe AgendamentoEmailDao

Eu executei os comandos pelo jboss-cli e mesmo assim não está indo. Baixei o connector duas vezes, uma pelo site(mysql-connector-java-8.0.18) no formato .tar e outra usando Maven(mysql-connector-java-8.0.15).

Não é possível adicionar um datasource no standalone manualmente?

22:48:41,919 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.deployment.unit."agendamentoemail-0.0.1-SNAPSHOT.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."agendamentoemail-0.0.1-SNAPSHOT.war".INSTALL: WFLYSRV0153: Failed to process phase INSTALL of deployment "agendamentoemail-0.0.1-SNAPSHOT.war"
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:151)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1738)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1700)
    at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1558)
    at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
    at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1364)
    at java.lang.Thread.run(Thread.java:748)
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYEE0041: Component class br.com.alura.dao.AgendamentoEmailDao for component AgendamentoEmailDao has errors: 
WFLYJPA0033: Can't find a persistence unit named null in deployment "agendamentoemail-0.0.1-SNAPSHOT.war"
    at org.jboss.as.ee.component.deployers.ModuleJndiBindingProcessor$1.handle(ModuleJndiBindingProcessor.java:201)
    at org.jboss.as.ee.component.ClassDescriptionTraversal.run(ClassDescriptionTraversal.java:54)
    at org.jboss.as.ee.component.deployers.ModuleJndiBindingProcessor.processClassConfigurations(ModuleJndiBindingProcessor.java:229)
    at org.jboss.as.ee.component.deployers.ModuleJndiBindingProcessor.deploy(ModuleJndiBindingProcessor.java:154)
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:144)
    ... 8 more

22:48:41,943 INFO  [org.infinispan.factories.GlobalComponentRegistry] (MSC service thread 1-7) ISPN000128: Infinispan version: Infinispan 'Infinity Minus ONE +2' 9.4.3.Final
22:48:42,170 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 81) WFLYCLINF0002: Started client-mappings cache from ejb container
22:48:42,207 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "agendamentoemail-0.0.1-SNAPSHOT.war")]) - failure description: {
    "WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"agendamentoemail-0.0.1-SNAPSHOT.war\".INSTALL" => "WFLYSRV0153: Failed to process phase INSTALL of deployment \"agendamentoemail-0.0.1-SNAPSHOT.war\"
    Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYEE0041: Component class br.com.alura.dao.AgendamentoEmailDao for component AgendamentoEmailDao has errors: 
WFLYJPA0033: Can't find a persistence unit named null in deployment \"agendamentoemail-0.0.1-SNAPSHOT.war\""},
    "WFLYCTL0412: Required services that are not installed:" => [
        "jboss.deployment.unit.\"agendamentoemail-0.0.1-SNAPSHOT.war\".beanmanager",
        "jboss.deployment.unit.\"agendamentoemail-0.0.1-SNAPSHOT.war\".WeldStartService"
    ],
    "WFLYCTL0180: Services with missing/unavailable dependencies" => [
        "jboss.deployment.unit.\"agendamentoemail-0.0.1-SNAPSHOT.war\".batch.artifact.factory is missing [jboss.deployment.unit.\"agendamentoemail-0.0.1-SNAPSHOT.war\".beanmanager]",
        "jboss.deployment.unit.\"agendamentoemail-0.0.1-SNAPSHOT.war\".weld.weldClassIntrospector is missing [jboss.deployment.unit.\"agendamentoemail-0.0.1-SNAPSHOT.war\".WeldStartService, jboss.deployment.unit.\"agendamentoemail-0.0.1-SNAPSHOT.war\".beanmanager]"
    ]
}
22:48:42,211 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")
22:48:42,212 INFO  [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
1 resposta
solução!

Resolvi criando na mão o datasource e criando o arquivo persistence.xml, talvez só precisasse criar o persistence, mas achei estranho porque os comandos executados no jboss-cli não criaram um datasource no standalone.full-xml.

standalone.full-xml

                <datasource jta="true"
                    jndi-name="java:jboss/datasources/AgendamentoDS" pool-name="AgendamentoDS"
                    enabled="true" use-java-context="true" use-ccm="true">
                    <connection-url>jdbc:mysql://localhost:3306/agendamentobd</connection-url>
                    <driver>mysql</driver>
                    <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
                    <pool>
                        <min-pool-size>10</min-pool-size>
                        <max-pool-size>100</max-pool-size>
                        <prefill>true</prefill>
                    </pool>
                    <security>
                        <user-name>agendamento</user-name>
                        <password>agendamento</password>
                    </security>
                    <statement>
                        <prepared-statement-cache-size>32</prepared-statement-cache-size>
                        <share-prepared-statements>true</share-prepared-statements>
                    </statement>
                </datasource>
                    <driver name="mysql" module="com.mysql">
                        <xa-datasource-class>com.mysql.cj.jdbc.MysqlXADataSource</xa-datasource-class>
                    </driver>

/agendamentoemail/src/main/webapp/WEB-INF/classes/META-INF/persistence.xml

<?xml version="1.0" encoding="UTF-8"?>
<persistence>
   <persistence-unit name="agendamentobd">

        <jta-data-source>java:jboss/datasources/AgendamentoDS</jta-data-source>
        <properties>
            <property name="javax.persistence.schema-generation.database.action" value="update" />
        </properties>

    </persistence-unit>
</persistence>