1

I've got a small problem with my standalone.xml. I made an order mysql in modules/system/layers/base/com. Inside this folder there is the folder main and inside that there is my mysql-Connector v.5.1.28 and the module.xml.

But when I run a project in Eclipse it doesn't open up the browser.If I open it in the Safari browser than the textfields are shown but the whole database entries, which should be shown up too, are missing. Instead it throws an ClassNotFoundExeption for the mysql driver. Here the snippet of my standalone.xml:

<datasources>
  <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>
  <datasource jta="true" jndi-name="java:jboss/datasources/MyDB" pool-name="MyDB" enabled="true" use-java-context="true" use-ccm="true">
    <connection-url>jdbc:mysql://localhost:3306/test</connection-url>
    <driver>mysql</driver>
    <security>
      <user-name>root</user-name>
      <password>root</password>
    </security>
    <statement>
      <prepared-statement-cache-size>32</prepared-statement-cache-size>
      <share-prepared-statements>true</share-prepared-statements>
    </statement>
  </datasource>
  <drivers>
    <driver name="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>

Can anyone see the problem?

the path is modules/system/layers/base/com/mysql/main...inside is the mysql-connector-java-5.1.28-bin.jar..the module.xml:

<?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.28-bin.jar"/>
</resources>
<dependencies>
    <module name="javax.api"/>
    <module name="javax.transaction.api"/>
    <module name="javax.servlet.api" optional="true"/>
</dependencies>
</module>
4

4 回答 4

4

我也有这个问题并删除了这部分:

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

帮助我解决了我的问题。

于 2014-05-06T13:53:58.003 回答
1

试试这个配置:

$WILDFLY_HOME/modules/com/mysql/main/mysql-connector-java-5.1.28-bin.jar。

在 $WILDFLY_HOME/modules/com/mysql/main/module.xml 中:

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

  <module xmlns="urn:jboss:module:1.0" name="com.mysql">
    <resources>
      <resource-root path="mysql-connector-java-5.1.28-bin.jar"/>
    </resources>

    <dependencies>
      <module name="javax.api"/>
      <module name="javax.transaction.api"/>
      <module name="javax.servlet.api" optional="true"/>
    </dependencies>
  </module>

在 $WILDFLY_HOME/standalone/configuration/standalone.xml 中:

<drivers>
  ...
  <driver name="mysql" module="com.mysql"/>
  ...
</drivers>
于 2014-04-21T20:40:04.857 回答
0

这里有很棒的指南。 http://wildfly.org/news/2014/02/06/GlassFish-to-WildFly-migration/

遵循这一点,您应该擅长设置它。

注意一点(我犯的错误)

在 Windows 系统上创建 module.xml 时,请注意使用适当的扩展名保存文件。检查 Windows 资源管理器上的类型,它不应该是文本文档,而是 XML 文档。

为了更安全,请启用以下功能:

组织 --> 文件夹和搜索选项 --> 查看选项卡 -->(取消选中该选项:隐藏已知文件类型的扩展名)

所以你最终创建的文件不应该是modudle.xml.txt而是 module.xml

问候。

于 2014-08-30T07:18:08.257 回答
0

如果人们正在尝试集成此版本 mysql-connector-java-5.0.8 请不要浪费时间,只需使用以下版本即可。我要离开这个原因我正在寻找细节,但可以找到关于失败的版本的更多细节,即“mysql-connector-java-5.0.8”

请下载最新版本的 mysql-connector-java-5.1.34 它将适用于 Wild fly 部署。我相信早期版本的 mysql 驱动程序存在缺陷,他们在最新版本中修复了该问题。我相信它看到了可能没有加载类的合规性检查。

检查更多关于这个网址 http://bugs.mysql.com/bug.php?id=62038

上面的配置是对的,只是驱动有问题。请不要尝试浪费时间,只需下载最新的。

于 2015-01-04T07:09:43.013 回答