Jump to content
  • 0
ruanrp

Wildfly executa o projeto sem erros, mas a tabela no banco de dados mysql não é criada

Question

Estou começando a aprender java web com banco de dados usando wildfly jpa, estou fazendo um projeto de gerenciamento de academia, a parte de páginas web já está pronta, mesmo programação em java, o problema é quando uso jpa para criar a tabela no mysql do wildfly log mostra que criou a tabela, mas não aparece no mysql, eu atualizo e nada.

O IDE que estou usando é NETBENS SE ISTO FOR ÚTIL

Agradeço antecipadamente por sua ajuda!!

 

O log que o wildfly me mostra

 JAVA: "C:\Program Files\Java\jdk-16.0.1\bin\java"

  JAVA_OPTS: "-Dprogram.name=standalone.bat -Xms128m -Xmx512m -server -Dhttp.nonProxyHosts=localhost,127.0.0.1,RUAN-LAPTOP -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Djboss.management.http.port=9990 -Djboss.http.port=8080  --add-exports=java.desktop/sun.awt=ALL-UNNAMED --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.management/javax.management=ALL-UNNAMED --add-opens=java.naming/javax.naming=ALL-UNNAMED"

===============================================================================

04:48:24,939 INFO  [org.jboss.modules] (main) JBoss Modules version 1.11.0.Final
04:48:25,223 INFO  [org.jboss.msc] (main) JBoss MSC version 1.4.12.Final
04:48:25,228 INFO  [org.jboss.threads] (main) JBoss Threads version 2.4.0.Final
04:48:25,297 INFO  [org.jboss.as] (MSC service thread 1-2) WFLYSRV0049: WildFly Full 24.0.0.Final (WildFly Core 16.0.0.Final) starting
04:48:25,715 INFO  [org.wildfly.security] (ServerService Thread Pool -- 29) ELY00001: WildFly Elytron version 1.16.0.Final
04:48:26,002 INFO  [org.jboss.as.controller.management-deprecated] (ServerService Thread Pool -- 27) WFLYCTL0033: Extension 'security' is deprecated and may not be supported in future versions
04:48:26,226 INFO  [org.jboss.as.controller.management-deprecated] (Controller Boot Thread) WFLYCTL0028: Attribute 'security-realm' in the resource at address '/core-service=management/management-interface=http-interface' is deprecated, and may be removed in a future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation.
04:48:26,252 INFO  [org.jboss.as.controller.management-deprecated] (ServerService Thread Pool -- 20) WFLYCTL0028: Attribute 'security-realm' in the resource at address '/subsystem=undertow/server=default-server/https-listener=https' is deprecated, and may be removed in a future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation.
04:48:26,286 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) WFLYDS0004: Found Academia.war in deployment directory. To trigger deployment create a file called Academia.war.dodeploy
04:48:26,335 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0039: Creating http management service using socket-binding (management-http)
04:48:26,347 INFO  [org.xnio] (MSC service thread 1-3) XNIO version 3.8.4.Final
04:48:26,356 INFO  [org.xnio.nio] (MSC service thread 1-3) XNIO NIO Implementation Version 3.8.4.Final
04:48:26,385 INFO  [org.wildfly.extension.microprofile.jwt.smallrye] (ServerService Thread Pool -- 70) WFLYJWT0001: Activating MicroProfile JWT Subsystem
04:48:26,389 INFO  [org.wildfly.extension.health] (ServerService Thread Pool -- 55) WFLYHEALTH0001: Activating Base Health Subsystem
04:48:26,394 WARN  [org.jboss.as.txn] (ServerService Thread Pool -- 80) WFLYTX0013: The node-identifier attribute on the /subsystem=transactions is set to the default value. This is a danger for environments running multiple servers. Please make sure the attribute value is unique.
04:48:26,400 INFO  [org.wildfly.extension.microprofile.config.smallrye] (ServerService Thread Pool -- 69) WFLYCONF0001: Activating MicroProfile Config Subsystem
04:48:26,401 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 57) WFLYCLINF0001: Activating Infinispan subsystem.
04:48:26,402 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 72) WFLYNAM0001: Activating Naming Subsystem
04:48:26,402 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 78) WFLYSEC0002: Activating Security Subsystem
04:48:26,404 INFO  [org.wildfly.iiop.openjdk] (ServerService Thread Pool -- 56) WFLYIIOP0001: Activating IIOP Subsystem
04:48:26,414 INFO  [org.jboss.as.jaxrs] (ServerService Thread Pool -- 59) WFLYRS0016: RESTEasy version 3.15.1.Final
04:48:26,415 INFO  [org.jboss.as.security] (MSC service thread 1-6) WFLYSEC0001: Current PicketBox version=5.0.3.Final-redhat-00007
04:48:26,423 INFO  [org.wildfly.extension.microprofile.opentracing] (ServerService Thread Pool -- 71) WFLYTRACEXT0001: Activating MicroProfile OpenTracing Subsystem
04:48:26,424 INFO  [org.jboss.as.jsf] (ServerService Thread Pool -- 64) WFLYJSF0007: Activated the following Jakarta Server Faces Implementations: [main]
04:48:26,425 INFO  [org.wildfly.extension.metrics] (ServerService Thread Pool -- 68) WFLYMETRICS0001: Activating Base Metrics Subsystem
04:48:26,445 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 82) WFLYWS0002: Activating WebServices Extension
04:48:26,472 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0003: Undertow 2.2.8.Final starting
04:48:26,475 INFO  [org.jboss.as.connector] (MSC service thread 1-2) WFLYJCA0009: Starting Jakarta Connectors Subsystem (WildFly/IronJacamar 1.4.35.Final)
04:48:26,482 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 47) WFLYJCA0004: Deploying JDBC-compliant driver class org.h2.Driver (version 1.4)
04:48:26,490 INFO  [org.jboss.as.naming] (MSC service thread 1-1) WFLYNAM0003: Starting Naming Service
04:48:26,494 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-1) WFLYMAIL0001: Bound mail session [java:jboss/mail/Default]
04:48:26,542 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 47) WFLYJCA0005: Deploying non-JDBC-compliant driver class com.mysql.cj.jdbc.Driver (version 8.0)
04:48:26,556 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-2) WFLYJCA0018: Started Driver service with driver-name = h2
04:48:26,561 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-1) WFLYJCA0018: Started Driver service with driver-name = mysql
04:48:26,576 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 81) WFLYUT0014: Creating file handler for path 'C:\Users\Ruan Pablo\Documents\PROGRAMAS\wildfly-24.0.0.Final/welcome-content' with options [directory-listing: 'false', follow-symlink: 'false', case-sensitive: 'true', safe-symlink-paths: '[]']
04:48:26,579 WARN  [org.wildfly.extension.elytron] (MSC service thread 1-2) WFLYELY00023: KeyStore file 'C:\Users\Ruan Pablo\Documents\PROGRAMAS\wildfly-24.0.0.Final\standalone\configuration\application.keystore' does not exist. Used blank.
04:48:26,614 WARN  [org.wildfly.extension.elytron] (MSC service thread 1-1) WFLYELY01084: KeyStore C:\Users\Ruan Pablo\Documents\PROGRAMAS\wildfly-24.0.0.Final\standalone\configuration\application.keystore not found, it will be auto generated on first use with a self-signed certificate for host localhost
04:48:26,834 INFO  [org.wildfly.extension.io] (ServerService Thread Pool -- 58) WFLYIO001: Worker 'default' has auto-configured to 24 IO threads with 192 max task threads based on your 12 available processors
04:48:26,837 INFO  [org.jboss.as.ejb3] (MSC service thread 1-4) WFLYEJB0482: Strict pool mdb-strict-max-pool is using a max instance size of 48 (per class), which is derived from the number of CPUs on this host.
04:48:26,837 INFO  [org.jboss.as.ejb3] (MSC service thread 1-8) WFLYEJB0481: Strict pool slsb-strict-max-pool is using a max instance size of 192 (per class), which is derived from thread worker pool sizing.
04:48:26,860 INFO  [org.jboss.remoting] (MSC service thread 1-2) JBoss Remoting version 5.0.23.Final
04:48:26,868 INFO  [org.jboss.as.patching] (MSC service thread 1-3) WFLYPAT0050: WildFly Full cumulative patch ID is: base, one-off patches include: none
04:48:26,881 WARN  [org.jboss.as.domain.management.security] (MSC service thread 1-2) WFLYDM0111: Keystore C:\Users\Ruan Pablo\Documents\PROGRAMAS\wildfly-24.0.0.Final\standalone\configuration\application.keystore not found, it will be auto generated on first use with a self signed certificate for host localhost
04:48:26,886 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-8) WFLYDS0013: Started FileSystemDeploymentService for directory C:\Users\Ruan Pablo\Documents\PROGRAMAS\wildfly-24.0.0.Final\standalone\deployments
04:48:26,894 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0027: Starting deployment of "Academia.war" (runtime-name: "Academia.war")
04:48:26,907 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-6) WFLYUT0012: Started server default-server.
04:48:26,911 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-4) Queuing requests.
04:48:26,913 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-4) WFLYUT0018: Host default-host starting
04:48:26,939 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-3) WFLYUT0006: Undertow HTTP listener default listening on 127.0.0.1:8080
04:48:26,939 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-6) WFLYUT0006: Undertow HTTPS listener https listening on 127.0.0.1:8443
04:48:26,944 INFO  [org.jboss.as.ejb3] (MSC service thread 1-6) WFLYEJB0493: Jakarta Enterprise Beans subsystem suspension complete
04:48:26,954 INFO  [org.wildfly.extension.messaging-activemq] (MSC service thread 1-3) WFLYMSGAMQ0001: AIO wasn't located on this platform, it will fall back to using pure Java NIO.
04:48:27,047 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-8) WFLYJCA0001: Bound data source [java:jboss/datasources/ExampleDS]
04:48:27,047 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-6) WFLYJCA0001: Bound data source [java:/jdbc/AcademiaDS]
04:48:27,051 INFO  [org.jboss.ws.common.management] (MSC service thread 1-7) JBWS022052: Starting JBossWS 5.4.4.Final (Apache CXF 3.3.10) 
04:48:27,058 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 84) AMQ221000: live Message Broker is starting with configuration Broker Configuration (clustered=false,journalDirectory=C:\Users\Ruan Pablo\Documents\PROGRAMAS\wildfly-24.0.0.Final\standalone\data\activemq\journal,bindingsDirectory=C:\Users\Ruan Pablo\Documents\PROGRAMAS\wildfly-24.0.0.Final\standalone\data\activemq\bindings,largeMessagesDirectory=C:\Users\Ruan Pablo\Documents\PROGRAMAS\wildfly-24.0.0.Final\standalone\data\activemq\largemessages,pagingDirectory=C:\Users\Ruan Pablo\Documents\PROGRAMAS\wildfly-24.0.0.Final\standalone\data\activemq\paging)
04:48:27,096 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 84) AMQ221013: Using NIO Journal
04:48:27,141 INFO  [org.wildfly.iiop.openjdk] (MSC service thread 1-1) WFLYIIOP0009: CORBA ORB Service started
04:48:27,172 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 84) AMQ221043: Protocol module found: [artemis-server]. Adding protocol support for: CORE
04:48:27,174 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 84) AMQ221043: Protocol module found: [artemis-amqp-protocol]. Adding protocol support for: AMQP
04:48:27,174 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 84) AMQ221043: Protocol module found: [artemis-hornetq-protocol]. Adding protocol support for: HORNETQ
04:48:27,175 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 84) AMQ221043: Protocol module found: [artemis-stomp-protocol]. Adding protocol support for: STOMP
04:48:27,231 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 84) AMQ221034: Waiting indefinitely to obtain live lock
04:48:27,231 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 84) AMQ221035: Live Server Obtained live lock
04:48:27,570 INFO  [org.jboss.as.jpa] (MSC service thread 1-1) WFLYJPA0002: Read persistence.xml for AcademiaPU
04:48:27,679 INFO  [org.jipijapa] (MSC service thread 1-5) JIPIORMV53020253: Second level cache enabled for Academia.war#AcademiaPU
04:48:27,834 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 84) AMQ221003: Deploying ANYCAST queue jms.queue.ExpiryQueue on address jms.queue.ExpiryQueue
04:48:27,840 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 84) AMQ221003: Deploying ANYCAST queue jms.queue.DLQ on address jms.queue.DLQ
04:48:27,853 INFO  [org.wildfly.extension.messaging-activemq] (MSC service thread 1-3) WFLYMSGAMQ0016: Registered HTTP upgrade for activemq-remoting protocol handled by http-acceptor-throughput acceptor
04:48:27,853 INFO  [org.wildfly.extension.messaging-activemq] (MSC service thread 1-8) WFLYMSGAMQ0016: Registered HTTP upgrade for activemq-remoting protocol handled by http-acceptor acceptor
04:48:27,853 INFO  [org.wildfly.extension.messaging-activemq] (MSC service thread 1-5) WFLYMSGAMQ0016: Registered HTTP upgrade for activemq-remoting protocol handled by http-acceptor acceptor
04:48:27,853 INFO  [org.wildfly.extension.messaging-activemq] (MSC service thread 1-2) WFLYMSGAMQ0016: Registered HTTP upgrade for activemq-remoting protocol handled by http-acceptor-throughput acceptor
04:48:27,904 INFO  [org.jboss.weld.deployer] (MSC service thread 1-6) WFLYWELD0003: Processing weld deployment Academia.war
04:48:28,000 INFO  [org.hibernate.validator.internal.util.Version] (MSC service thread 1-6) HV000001: Hibernate Validator 6.0.22.Final
04:48:28,054 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 84) AMQ221007: Server is now live
04:48:28,054 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 84) AMQ221001: Apache ActiveMQ Artemis Message Broker version 2.16.0 [default, nodeID=21e8abfa-e792-11eb-912b-005056c00001] 
04:48:28,060 INFO  [org.infinispan.CONTAINER] (ServerService Thread Pool -- 85) ISPN000128: Infinispan version: Infinispan 'Taedonggang' 12.1.4.Final
04:48:28,065 INFO  [org.wildfly.extension.messaging-activemq] (ServerService Thread Pool -- 84) WFLYMSGAMQ0002: Bound messaging object to jndi name java:jboss/exported/jms/RemoteConnectionFactory
04:48:28,076 INFO  [org.wildfly.extension.messaging-activemq] (ServerService Thread Pool -- 88) WFLYMSGAMQ0002: Bound messaging object to jndi name java:/ConnectionFactory
04:48:28,092 INFO  [org.jboss.as.jpa] (ServerService Thread Pool -- 85) WFLYJPA0010: Starting Persistence Unit (phase 1 of 2) Service 'Academia.war#AcademiaPU'
04:48:28,107 INFO  [org.hibernate.jpa.internal.util.LogHelper] (ServerService Thread Pool -- 85) HHH000204: Processing PersistenceUnitInfo [
    name: AcademiaPU
    ...]
04:48:28,107 INFO  [org.jboss.as.connector.deployment] (MSC service thread 1-1) WFLYJCA0007: Registered connection factory java:/JmsXA
04:48:28,156 INFO  [org.apache.activemq.artemis.ra] (MSC service thread 1-1) AMQ151007: Resource adaptor started
04:48:28,157 INFO  [org.jboss.as.connector.services.resourceadapters.ResourceAdapterActivatorService$ResourceAdapterActivator] (MSC service thread 1-1) IJ020002: Deployed: file://RaActivatoractivemq-ra
04:48:28,159 INFO  [org.jboss.as.connector.deployment] (MSC service thread 1-4) WFLYJCA0002: Bound Jakarta Connectors ConnectionFactory [java:/JmsXA]
04:48:28,159 INFO  [org.jboss.as.connector.deployment] (MSC service thread 1-8) WFLYJCA0118: Binding connection factory named java:/JmsXA to alias java:jboss/DefaultJMSConnectionFactory
04:48:28,178 INFO  [org.hibernate.Version] (ServerService Thread Pool -- 85) HHH000412: Hibernate Core {5.3.20.Final}
04:48:28,179 INFO  [org.hibernate.cfg.Environment] (ServerService Thread Pool -- 85) HHH000206: hibernate.properties not found
04:48:28,262 INFO  [org.infinispan.CONFIG] (MSC service thread 1-2) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be passivated.
04:48:28,263 INFO  [io.jaegertracing.internal.JaegerTracer] (MSC service thread 1-6) No shutdown hook registered: Please call close() manually on application shutdown.
04:48:28,264 INFO  [org.infinispan.CONFIG] (MSC service thread 1-2) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be passivated.
04:48:28,264 INFO  [org.wildfly.microprofile.opentracing.smallrye] (MSC service thread 1-6) WFLYTRAC0001: Tracer initialized: JaegerTracer(version=Java-1.5.0, serviceName=Academia.war, reporter=RemoteReporter(sender=org.wildfly.extension.microprofile.opentracing.spi.sender.WildFlySender@46fd8233, closeEnqueueTimeout=1000), sampler=ConstSampler(decision=true, tags={sampler.type=const, sampler.param=true}), tags={hostname=RUAN-LAPTOP, jaeger.version=Java-1.5.0, ip=169.254.192.206}, zipkinSharedRpcSpan=false, expandExceptionLogs=false, useTraceId128Bit=false)
04:48:28,283 INFO  [org.hibernate.annotations.common.Version] (ServerService Thread Pool -- 85) HCANN000001: Hibernate Commons Annotations {5.0.5.Final}
04:48:28,299 INFO  [org.infinispan.CONTAINER] (ServerService Thread Pool -- 88) ISPN000556: Starting user marshaller 'org.wildfly.clustering.infinispan.spi.marshalling.InfinispanProtoStreamMarshaller'
04:48:28,304 INFO  [org.jipijapa] (MSC service thread 1-5) JIPIORMV53020253: Second level cache enabled for Academia.war#AcademiaPU
04:48:28,411 INFO  [org.jboss.weld.Version] (MSC service thread 1-5) WELD-000900: 3.1.7 (SP1)
04:48:28,433 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 88) WFLYCLINF0002: Started http-remoting-connector cache from ejb container
04:48:28,558 INFO  [org.jboss.as.jpa] (ServerService Thread Pool -- 88) WFLYJPA0010: Starting Persistence Unit (phase 2 of 2) Service 'Academia.war#AcademiaPU'
04:48:28,658 INFO  [org.hibernate.dialect.Dialect] (ServerService Thread Pool -- 88) HHH000400: Using dialect: org.hibernate.dialect.MySQL5InnoDBDialect
04:48:28,695 INFO  [org.hibernate.envers.boot.internal.EnversServiceImpl] (ServerService Thread Pool -- 88) Envers integration enabled? : true
04:48:28,997 INFO  [stdout] (ServerService Thread Pool -- 88) Hibernate: 

04:48:28,997 INFO  [stdout] (ServerService Thread Pool -- 88)     

04:48:28,997 INFO  [stdout] (ServerService Thread Pool -- 88)     drop table if exists Estado

04:48:29,001 INFO  [stdout] (ServerService Thread Pool -- 88) Hibernate: 

04:48:29,001 INFO  [stdout] (ServerService Thread Pool -- 88)     

04:48:29,001 INFO  [stdout] (ServerService Thread Pool -- 88)     create table Estado (

04:48:29,001 INFO  [stdout] (ServerService Thread Pool -- 88)        SIGLA varchar(255) not null auto_increment,

04:48:29,001 INFO  [stdout] (ServerService Thread Pool -- 88)         NOME varchar(255),

04:48:29,002 INFO  [stdout] (ServerService Thread Pool -- 88)         primary key (SIGLA)

04:48:29,002 INFO  [stdout] (ServerService Thread Pool -- 88)     ) engine=InnoDB

04:48:29,008 INFO  [org.hibernate.tool.schema.internal.SchemaCreatorImpl] (ServerService Thread Pool -- 88) HHH000476: Executing import script 'org.hibernate.tool.schema.internal.exec.ScriptSourceInputNonExistentImpl@28ccd72b'
04:48:29,062 WARN  [org.jboss.weld.Bootstrap] (MSC service thread 1-8) WELD-000146: BeforeBeanDiscovery.addAnnotatedType(AnnotatedType<?>) used for class com.sun.faces.flow.FlowDiscoveryCDIHelper is deprecated from CDI 1.1!
04:48:29,413 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 107) Inicializando Mojarra 2.3.14.SP04 para o contexto '/Academia'
04:48:29,771 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 107) WFLYUT0021: Registered web context: '/Academia' for server 'default-server'
04:48:29,828 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 48) WFLYSRV0010: Deployed "Academia.war" (runtime-name : "Academia.war")
04:48:29,859 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0212: Resuming server
04:48:29,861 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Full 24.0.0.Final (WildFly Core 16.0.0.Final) started in 5162ms - Started 782 of 963 services (366 services are lazy, passive or on-demand)
04:48:29,863 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
04:48:29,863 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990

 

Minha 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="AcademiaPU" transaction-type="RESOURCE_LOCAL">
    <provider>org.hibernate.ejb.HibernatePersistence</provider>
    <class>br.com.academia.Estado</class>
    <exclude-unlisted-classes>false</exclude-unlisted-classes>
    <shared-cache-mode>NONE</shared-cache-mode>
    <validation-mode>NONE</validation-mode>
    <properties>
      <property name="javax.persistence.jdbc.url" value="jdbc:mysql://127.0.0.1:3306/AcademiaDataBase?user=ruan"/>
      <property name="javax.persistence.jdbc.user" value="ruan"/>
      <property name="javax.persistence.jdbc.driver" value="com.mysql.cj.jdbc.Driver"/>
      <property name="javax.persistence.jdbc.password" value="ruan"/>
      <property name="hibernate.cache.provider_class" value="org.hibernate.cache.NoCacheProvider"/>
      <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
      <property name="hibernate.hbm2ddl.auto" value="update"/>
      <property name="hibernate.show_sql" value="true"/>
      <property name="hibernate.format_sql" value="true"/>
    </properties>
  </persistence-unit>
</persistence>

 

A class que quero gerar a tabela no mysql

package br.com.academia;
import java.io.Serializable;
import java.util.Objects;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

@Table(name = "Estado")
@Entity
public class Estado implements Serializable {
   
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY )
    @Column(name = "SIGLA")
    private String sigla;
    
    @Column(name="NOME")
    private String nome;
    
    public String getSigla() {
        return sigla;
    }

    public void setSigla(String sigla) {
        this.sigla = sigla;
    }

    public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }

    @Override
    public String toString() {
        return "Estado{" + "sigla=" + sigla + ", nome=" + nome + '}';
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 47 * hash + Objects.hashCode(this.sigla);
        return hash;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Estado other = (Estado) obj;
        return Objects.equals(this.sigla, other.sigla);
    }
}

 

Share this post


Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • By Fabio Jonas
      Pessoal, estou precisando retornar o valor total de receita e valor total de despesas por mês nesse estilo:
                      
                           Despesa        Receita
      Janeiro          50.00            200.00
      Fevereiro               0            500.00
      Março           100.00           500.00
       
      Cheguei a essa consulta abaixo mas esta retornando o mesmo valor para todos os mês
      SELECT MONTHNAME(`data_vencimento`) as mes, (SELECT SUM(`valor`) as valor_total FROM lancamentos WHERE tipo = 'despesa' and YEAR(`data_vencimento`) = 2022 AND `empresa` = 1) as despesas, (SELECT SUM(`valor`) as valor_total FROM lancamentos WHERE tipo = 'receita' and YEAR(`data_vencimento`) = 2022 AND `empresa` = 1) as receitas From lancamentos GROUP BY MONTH(`data_vencimento`) ORDER BY MONTH (`data_vencimento`);  
      O Retorno esta assim 
                           Despesa        Receita
      Janeiro          50.00            200.00
      Fevereiro       50.00            200.00
      Março            50.00            200.00
       
      Alguém consegue me ajudar com essa consulta?
      Obrigado
    • By cmoreira1300
      Meu programa não consegue identificar o dotenv na middleware
      Eu estava fazendo um CRUD simples, implementei o dotenv no meu programa, está funcionando quando faço a conexão com o banco de dados e a inserção e uma função normal,  mais quando vou fazer isso dentro de uma middleware ele não chama meu dotenv, só funciona quando tiro o process.env e ponho as informações direto na função de conexão.
      require( 'dotenv' ).config( { path: '../../.env' } ) const mysql = require( 'mysql2' ) // DESSA FORMA NÃO FUNCIONA const connection_pool = mysql.createPool( { host: process.env.DB_HOST, user: process.env.DB_USER, database: process.env.DB_DATABASE, password: process.env.DB_PASS } ) // DESSA FORMA FUNCIONA // const connection_pool = mysql.createPool( { // host: 'localhost', // user: 'carlos', // database: 'simple_crud', // password: 'pass1241' // } ) module.exports = connection_pool.promise() INSERÇÃO NO BANCO DE DADOS
      const db_conn = require( '../db/connection' ) const createNewClient = ( name ) => { return db_conn.execute( `INSERT INTO client ( name ) values (?)`, [ name ] ) } module.exports = { createNewClient } FAZENDO A INSERÇÃO NO MIDDLEWARE
      const data = require( '../data/client' ) const createClient = ( req, res, next ) => { const client = req.body.name data.createNewClient( client ) .then( () => { res.status( 200 ).json( { 'status': 'sucess', 'client': client } ) } ) .catch( ( err ) => { res.status( 404 ).json( { status: 'error', error: err } ) } ) .finally( () => { next() } ) } module.exports = { createClient } { "status": "error", "error": { "message": "Access denied for user ''@'localhost' (using password: YES)", "code": "ER_ACCESS_DENIED_ERROR", "errno": 1045, "sqlState": "28000", "sqlMessage": "Access denied for user ''@'localhost' (using password: YES)" } }  Esse é o erro que obtenho quando uso o dotenv, lenbrando que as informações de login estão todas certas, e que em outra função que não seja um middleware funciona.
    • By danielambrosio
      Estou trabalhando numa programação PHP é conectado na tabela (cl_configs) para reconhece coluna name que reconhece esses 5 campos.
      e também que adiciona esses 5 valores é adicionado nessa outra tabela (cl_ads_block_ips) nesses 8 coluna (id, ip, clicks, last_click, dads_refresh_qtd, dads_refresh_data, dads_refresh_ldata, clicks_rotativo_dia).
      E a conexão que eu usa era de outro site e não estou tendo problema e configurar em outro site que reconhece essa banco de dados abaixo.
       
      <?php $host = "localhost"; $user = "ads"; $pass = "_CMpFF4Hpa!G_gTh"; $dbname = "ads"; $port = 3306; try {     $conn = new PDO('mysql:host=' . $host . ';port=' . $port . ';dbname=' . $dbname, $user, $pass);     //echo "Conexão com banco de dados realizado com sucesso!"; } catch (PDOException $err) {     echo "Erro: Conexão com banco de dados não foi realizada com sucesso. Erro gerado " . $err->getMessage(); } ?>  
      Conecta com sucesso só não está reconhecendo a tabela (cl_configs) e nem adicionando na tabela (cl_ads_block_ips).
       
       
      Agora não sei porque não esta reconhecendo (cl_configs) e nem adicionando (cl_ads_block_ips).
       
       


    • By Yuri080
      Bom dia, ultimamente eu venho tentado baixar o connector/J do MySQL para fazer um CRUD porém quando eu baixo o connector ele vem em formato de pasta, e sinceramente não sei mais o que fazer, eu baixei até pelo instalador do MySQL mas ele vem em formato de pasta  ele vem assim, e não sei o porque disso.
    • By ment0r
      Boa tarde a todos.

      Estou iniciando um estudo com o banco MySQL (trabalho co PostgreSQL e Firebird) para futuros trabalhos. Bom, me deparei com um problema chato: caracteres especiais.
      Um exemplo: T�tulo.
      Não consigo exibir no meu site tais caracteres. O banco tem Charset/Collation: utf8/utf8_bin como configuração.
      Já usei o utf_encode e utf_decode - não resolveu.

      Alguém sabe o que mais posso fazer?
      Desde já, muito obrigado.
×

Important Information

Ao usar o fórum, você concorda com nossos Terms of Use.