5
respostas

boa noite, estou tendo esse problema si alguém puder ajudar agradeço,

22:13:57,373 INFO  [org.jboss.modules] (main) JBoss Modules version 1.5.2.Final
22:13:57,682 INFO  [org.jboss.msc] (main) JBoss MSC version 1.2.6.Final
22:13:57,768 INFO  [org.jboss.as] (MSC service thread 1-6) WFLYSRV0049: WildFly Full 10.1.0.Final (WildFly Core 2.2.0.Final) starting
22:13:58,778 ERROR [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0055: Caught exception during boot: org.jboss.as.controller.persistence.ConfigurationPersistenceException: WFLYCTL0085: Failed to parse configuration
    at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:131)
    at org.jboss.as.server.ServerService.boot(ServerService.java:357)
    at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:299)
    at java.lang.Thread.run(Unknown Source)
Caused by: javax.xml.stream.XMLStreamException: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[152,13]
Message: WFLYCTL0198: Unexpected element '{urn:jboss:domain:datasources:4.0}datasource' encountered
    at org.jboss.as.connector.subsystems.datasources.DataSourcesExtension$DataSourceSubsystemParser.readElement(DataSourcesExtension.java:637)
    at org.jboss.as.connector.subsystems.datasources.DataSourcesExtension$DataSourceSubsystemParser.readElement(DataSourcesExtension.java:200)
    at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:110)
    at org.jboss.staxmapper.XMLExtendedStreamReaderImpl.handleAny(XMLExtendedStreamReaderImpl.java:69)
    at org.jboss.as.server.parsing.StandaloneXml_4.parseServerProfile(StandaloneXml_4.java:546)
    at org.jboss.as.server.parsing.StandaloneXml_4.readServerElement(StandaloneXml_4.java:242)
    at org.jboss.as.server.parsing.StandaloneXml_4.readElement(StandaloneXml_4.java:141)
    at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:103)
    at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:49)
    at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:110)
    at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:69)
    at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:123)
    ... 3 more
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[152,13]
Message: WFLYCTL0198: Unexpected element '{urn:jboss:domain:datasources:4.0}datasource' encountered
    at org.jboss.as.controller.parsing.ParseUtils.unexpectedElement(ParseUtils.java:89)
    at org.jboss.as.controller.parsing.ParseUtils.requireNoContent(ParseUtils.java:244)
    at org.jboss.as.connector.subsystems.datasources.DataSourcesExtension$DataSourceSubsystemParser.readElement(DataSourcesExtension.java:631)
    ... 14 more

22:13:58,781 FATAL [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0056: Server boot has failed in an unrecoverable manner; exiting. See previous messages for details.
22:13:58,829 INFO  [org.jboss.as] (MSC service thread 1-5) WFLYSRV0050: WildFly Full 10.1.0.Final (WildFly Core 2.2.0.Final) stopped in 9ms
5 respostas
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.3" name="com.mysql">
    <resources>
       <resource-root path="mysql-connector-java-5.1.35.jar"/>
    </resources>
    <dependencies>
        <module name="javax.api"/>
  <module name="javax.transaction.api"/>
    </dependencies>
</module>

Oi Aldeir,

Tem algo errado na configuração do xml do seu datasource, dá uma olhada, veja se ele está nesse formato:

<datasource jndi-name="java:jboss/datasources/casadocodigoDS" pool-name="casadocodigoDS">
    <connection-url>jdbc:mysql://localhost:3306/casadocodigo_javaee</connection-url>
    <connection-property name="DatabaseName">
        casadocodigo_javaee
    </connection-property>
    <driver>mysql</driver>
    <pool>
        <min-pool-size>10</min-pool-size>
        <max-pool-size>20</max-pool-size>
    </pool>
    <security>
        <user-name>root</user-name>
    </security>
</datasource>

Qualquer coisa posta o conteúdo do arquivo para analisarmos

boa noite Ótavio eu olhei e nao vi nada diferente. olha ai

jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE h2 sa sa
        </datasources>
       <datasource jndi-name="java:jboss/datasources/casadocodigoDS" pool-name="casadocodigoDS">
<connection-url>jdbc:mysql://localhost:3306/casadocodigo_javaee</connection-url>
<connection-property name="DatabaseName">
    casadocodigo_javaee
</connection-property>
<driver>mysql</driver>
<pool>
    <min-pool-size>10</min-pool-size>
    <max-pool-size>20</max-pool-size>
</pool>
<security>
    <user-name>root</user-name>
</security>
org.h2.jdbcx.JdbcDataSource
 <datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlDataSource</datasource-class>
E o persistence aqui Dev persistence unit org.hibernate.ejb.HibernatePersistence java:jboss/datasources/casadocodigoDS

boa noite depois de pesquisar conseguir resolver o erro acima, mas pareceu outro esse aqui.

23:29:30,086 INFO [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 36) WFLYJCA0004: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3) 23:29:30,094 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 36) WFLYCTL0013: Operation ("add") failed - address: ([ ("subsystem" => "datasources"), ("jdbc-driver" => "mysql") ]) - failure description: "WFLYJCA0041: Failed to load module for driver [com.mysql]"

Sobre o erro "WFLYJCA0041: Failed to load module for driver [com.mysql]" você precisa criar também o arquivo module.xml dentro do Wildfly na pasta modules. Crie a estrutura com > mysql > main e dentro de main o module.xml, o seu conteúdo será esse:

<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.3" name="com.mysql">
    <resources>
        <resource-root path="mysql-connector-java-5.1.35.jar"/>
    </resources>
    <dependencies>
        <module name="javax.api"/>
    </dependencies>
</module>

Além desse xml, colar o mysql-connector-java, que é um jar usado para realizar a conexão com o banco, ele pode ser baixado aqui: http://central.maven.org/maven2/mysql/mysql-connector-java/5.1.35/mysql-connector-java-5.1.35.jar