Wildfly 8.0.0 mysql数据源问题 [英] Wildfly 8.0.0 mysql problems with datasource
问题描述
modules / system / layers / base / com
中命令mysql。 在这个文件夹里面有一个主文件夹,里面有我的
mysql-Connector v.5.1.28
和module.xml。 但是当我在Eclipse中运行一个项目时,它不会打开浏览器。如果我在Safari浏览器中打开它,而不是显示文本框,但是应该显示整个数据库条目也没有。相反,它会为mysql驱动程序引发一个 ClassNotFoundExeption
。这是我的standalone.xml的片段:
< datasources>
< datasource jndi-name =java:jboss / datasources / ExampleDSpool-name =ExampleDSenabled =trueuse-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 =truejndi-name =java:jboss / datasources / MyDBpool-name =MyDBenabled =trueuse-java-context =trueuse-ccm = 真 >
< connection-url> jdbc:mysql:// localhost:3306 / test< / connection-url>
< driver> mysql< / driver>
< security>
< user-name>根< / user-name>
< password>根< / password>
< / security>
< statement>
< prepared-statement-cache-size> 32< / prepared-statement-cache-size>
< share-prepared-statements> true< / share-prepared-statements>
< / statement>
< / datasource>
< drivers>
< driver name =mysqlmodule =com.mysql>
< xa-datasource-class> com.mysql.jdbc.jdbc2.optional.MysqlXADataSource< / xa-datasource-class>
< / driver>
< driver name =h2module =com.h2database.h2>
< xa-datasource-class> org.h2.jdbcx.JdbcDataSource< / xa-datasource-class>
< / driver>
< / drivers>
< / datasources>
任何人都可以看到问题?
路径是modules / system / layers / base / com / mysql / main ...里面是mysql-connector-java-5.1.28-bin.jar..the module.xml:
<?xml version =1.0encoding =UTF-8?>
< module xmlns =urn:jboss:module:1.1name =com.mysql>
< resources>
< resource-root path =mysql-connector-java-5.1.28-bin.jar/>
< / resources>
<依赖关系>
< module name =javax.api/>
< module name =javax.transaction.api/>
< module name =javax.servlet.apioptional =true/>
< / dependencies>
< / module>
我也遇到了这个问题并删除了这部分: / p>
<?xml version =1.0encoding =UTF-8?>
帮助我解决了我的问题。
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>
I also had this problem and removing this part:
<?xml version="1.0" encoding="UTF-8"?>
helped me solve my problem.
这篇关于Wildfly 8.0.0 mysql数据源问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!