我JBoss
作为独立版本运行。我想连接到我的本地mysql database
我在模块文件夹中复制了 mysql 连接器
me@air~/Downloads/jboss/standalone/configuration - 10:56:18 $ ls ../../modules/org/mysql/main/
mysql-connector-java-5.1.22-bin.jar
接下来我将standalone.xml
in更改jboss/standalone/configuration
为
<drivers>
<driver name="com.mysql" module="org.mysql" />
<driver name="h2" module="com.h2database.h2"> <!-- default provided-->
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
</driver>
</drivers>
然后我将数据源添加为
<datasource jndi-name="java:/bb" pool-name="bb-pool" enabled="true" use-java-context="true" use-ccm="true">
<connection-url>jdbc:mysql://127.0.0.1:3306/mydb</connection-url>
<driver>mysql</driver>
<pool>
<min-pool-size>10</min-pool-size>
<max-pool-size>100</max-pool-size>
<prefill>true</prefill>
</pool>
<security>
<user-name>bb</user-name>
<password>bb</password>
</security>
<statement>
<prepared-statement-cache-size>100</prepared-statement-cache-size>
<share-prepared-statements>true</share-prepared-statements>
</statement>
</datasource>
我正在使用JBoss AS 7.1
. 当我在控制台上启动服务器时,我看到了错误
10:54:47,458 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-1) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]
10:54:47,671 INFO [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report
JBAS014775: New missing/unsatisfied dependencies:
service jboss.jdbc-driver.mysql (missing) dependents: [service jboss.data-source.java:/bb]
10:54:47,676 INFO [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9990
10:54:47,676 ERROR [org.jboss.as] (Controller Boot Thread) JBAS015875: JBoss AS 7.1.1.Final "Brontes" started (with errors) in 2000ms - Started 134 of 212 services (2 services failed or missing dependencies, 74 services are passive or on-demand)
当我击球时Ctrl+C
,我看到了
^C10:54:54,998 INFO [org.jboss.as.osgi] (MSC service thread 1-8) JBAS011942: Stopping OSGi Framework
10:54:55,004 INFO [org.jboss.as.logging] JBAS011503: Restored bootstrap log handlers
10:54:55,007 INFO [com.arjuna.ats.jbossatx] ARJUNA032018: Destroying TransactionManagerService
10:54:55,008 INFO [com.arjuna.ats.jbossatx] ARJUNA032014: Stopping transaction recovery manager
10:54:55,010 INFO [org.apache.catalina.core.StandardContext] Container org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/] has not been started
10:54:55,039 INFO [org.apache.coyote.http11.Http11Protocol] Pausing Coyote HTTP/1.1 on http--127.0.0.1-8080
10:54:55,039 INFO [org.apache.coyote.http11.Http11Protocol] Stopping Coyote HTTP/1.1 on http--127.0.0.1-8080
10:54:55,043 INFO [org.jboss.as.controller] JBAS014774: Service status report
JBAS014776: Newly corrected services:
service jboss.jdbc-driver.mysql (new available)
10:54:55,044 INFO [org.jboss.as] JBAS015950: JBoss AS 7.1.1.Final "Brontes" stopped in 47ms
我是 JBoss 的新手,不知道如何解决此问题或了解我在这里做错了什么