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

jboss erro ao usar

Boa noite, vi umas video aula no professor nico e achei muito melhor usar o jboss e o widfly, porem estou com erro. Faço tudo que nem ele vo no meu widfly-modules-sytem-layers-base-com. Crio a minha pasta mysql e dentro dela outra chamada main, na pasta main tenho o meu module.xml configurado, e meu jar connector com banco, Logo depois fui no standalone-configuration-standalone.xml. Nesse arquivo modifico

<datasource jndi-name="java:jboss/datasources/auronDS" pool-name="auronDS"
    enabled="true" use-java-context="true">

    <connection-url>jdbc:mysql://localhost:3306/auron</connection-url>
    <driver>com.mysql</driver>
    <pool>
        <min-pool-size>10</min-pool-size>
        <max-pool-size>100</max-pool-size>
        <prefill>true</prefill>
    </pool>
    <security>
        <user-name>root</user-name>
        <password></password>
    </security>
</datasource>

E meu

<driver name="com.mysql" module="com.mysql">
    <xa-datasource-class>
        com.mysql.jdbc.jdbc2.optional.MysqlXADataSource
    </xa-datasource-class>
</driver>

Faço a alteração no meu persistence.xml e quando tento executar aparece.

22:24:11,160 INFO  [org.jboss.modules] (main) JBoss Modules version 1.5.1.Final
22:24:11,465 INFO  [org.jboss.msc] (main) JBoss MSC version 1.2.6.Final
22:24:11,563 INFO  [org.jboss.as] (MSC service thread 1-6) WFLYSRV0049: WildFly Full 10.0.0.Final (WildFly Core 2.0.10.Final) starting
22:24:12,029 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:356)
    at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:299)
    at java.lang.Thread.run(Unknown Source)
Caused by: com.ctc.wstx.exc.WstxParsingException: Received non-all-whitespace CHARACTERS or CDATA event in nextTag().
 at [row,col {unknown-source}]: [16,8]
    at com.ctc.wstx.sr.StreamScanner.constructWfcException(StreamScanner.java:614)
    at com.ctc.wstx.sr.StreamScanner.throwParseError(StreamScanner.java:487)
    at com.ctc.wstx.sr.StreamScanner.throwParseError(StreamScanner.java:472)
    at com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1174)
    at org.jboss.staxmapper.XMLExtendedStreamReaderImpl.nextTag(XMLExtendedStreamReaderImpl.java:152)
    at org.jboss.as.controller.parsing.ExtensionXml.parseExtensions(ExtensionXml.java:107)
    at org.jboss.as.server.parsing.StandaloneXml$DefaultExtensionHandler.parseExtensions(StandaloneXml.java:126)
    at org.jboss.as.server.parsing.StandaloneXml_4.readServerElement(StandaloneXml_4.java:218)
    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

22:24:12,038 FATAL [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0056: Server boot has failed in an unrecoverable manner; exiting. See previous messages for details.
22:24:12,163 INFO  [org.jboss.as.server] (Thread-2) WFLYSRV0220: Server shutdown has been requested.
22:24:12,237 INFO  [org.jboss.as] (MSC service thread 1-4) WFLYSRV0050: WildFly Full 10.0.0.Final (WildFly Core 2.0.10.Final) stopped in 15ms
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
3 respostas

Opa, então, acho que vc caiu num erro chato.. tem alguma coisa errada no seu xml.. alguma tag que não fechou, espaço a mais do que deveria na declaração de alguma tag... Vc vai precisar ficar mexendo e vendo o resultado.

kkkkk passei o dia todo vendo e revendo a aula e depois procurando o meu código se deixei algo em espaço ou alguma tag sem fechar mais não encontrei nada. :( Irei postar aqui oque eu atualizei.

 <datasources>
                <datasource jndi-name="java:jboss/datasources/auronDS" pool-name="auronDS" enabled="true" use-java-context="true">
                   <connection-url>jdbc:mysql://localhost:3306/jboss</connection-url>
                     <driver>com.mysql</driver>
                      <pool>
                          <min-pool-size>10</min-pool-size>
                          <max-pool-size>100</max-pool-size>
                          <prefill>true</prefill>
                     </pool>
                     <security>
                        <user-name>root</user-name>
                        <password>admin</password>
                     </security>
                </datasource>

  <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">
                    <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
                    <driver>h2</driver>
                    <security>
                        <user-name>sa</user-name>
                        <password>sa</password>
                    </security>
                </datasource>


 <drivers>
                    <driver name="com.mysql" module="com.mysql">
                         <xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
                    </driver>
                    <driver name="h2" module="com.h2database.h2">
                        <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
                    </driver>
                </drivers>
            </datasources>

dentro da minha pasta main

<?xml version="1.0" encoding="UTF-8"?>

<module xmlns="urn:jboss:module:1.1" name="com.mysql">
    <resources>
        <resource-root path="mysql-connector-java-5.1.22-bin.jar"/>
    </resources>
    <dependencies>
        <module name="javax.api"/>
    </dependencies>
</module>

e as alteração no persistence.xml Sera que o erro não é o widfly 10 que baixei? oque vi na video aula era o 8. Mais acho que a versão não interfere em nada.

solução!

Alberto fiz as configuração pro meu widfly 8.1 e rodou!