WildFly jdbc 与 Sybase 的连接
WildFly jdbc connection with Sybase
我正在尝试从 Glassfish 迁移到 WildFly 10,我的应用程序连接到 Sybase ASE 数据库。我将 jconn3.jar 放入 WILDFLY_HOME\modules\system\layers\base\com\sybase\sybase\main,创建了 modules.xml,内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="com.sybase.sybase">
<resources>
<resource-root path="jconn3.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
</dependencies>
</module>
并插入到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 jndi-name="java:jboss/datasources/FRAME_IBS" pool-name="FRAME_IBS" enabled="true" use-java-context="true">
<connection-url>jdbc:sybase:Tds:localhost:5000/Banksys;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
<driver>sybase</driver>
<pool>
<min-pool-size>5</min-pool-size>
<max-pool-size>100</max-pool-size>
<prefill>true</prefill>
</pool>
<driver-class>
com.sybase.jdbc3.jdbc.SybDriver
</driver-class>
<security>
<user-name>admin</user-name>
<password>admin</password>
</security>
</datasource>
<drivers>
<driver name="h2" module="com.h2database.h2">
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
</driver>
<driver name="sybase" module="com.sybase.sybase">
<datasource-class>com.sybase.jdbc3.jdbc.SybDataSource</datasource-class>
<xa-datasource-class>com.sybase.jdbc3.jdbc.SybXADataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
我在启动 WF 时在 server.log 文件中遇到此错误:
2017-02-17 12:48:56,297 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("data-source" => "FRAME_IBS")
]) - failure description: {
"WFLYCTL0412: Required services that are not installed:" => ["jboss.jdbc-driver.sybase"],
"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"jboss.driver-demander.java:jboss/datasources/FRAME_IBS is missing [jboss.jdbc-driver.sybase]",
"org.wildfly.data-source.FRAME_IBS is missing [jboss.jdbc-driver.sybase]"
]
}
2017-02-17 12:48:56,297 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("data-source" => "FRAME_IBS")
]) - failure description: {
"WFLYCTL0412: Required services that are not installed:" => [
"jboss.jdbc-driver.sybase",
"jboss.jdbc-driver.sybase"
],
"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"jboss.driver-demander.java:jboss/datasources/FRAME_IBS is missing [jboss.jdbc-driver.sybase]",
"org.wildfly.data-source.FRAME_IBS is missing [jboss.jdbc-driver.sybase]",
"org.wildfly.data-source.FRAME_IBS is missing [jboss.jdbc-driver.sybase]"
]
}
2017-02-17 12:48:56,453 INFO [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
WFLYCTL0184: New missing/unsatisfied dependencies:
service jboss.jdbc-driver.sybase (missing) dependents: [service org.wildfly.data-source.FRAME_IBS, service jboss.driver-demander.java:jboss/datasources/FRAME_IBS]
我用谷歌搜索并尝试了我找到的所有方法,但仍然有这个错误。请帮我。
对不起,如果我的英语不正确,那不是我的母语。
我按照 Leozeo 和 Mark 的建议重命名模块并将其移至 WILDFLY_HOME\modules,但仍然有相同的消息。我再次从 standalone.xml、运行 WF 中删除了我的数据源,然后我看到了这条消息:
ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 33) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("jdbc-driver" => "sybase")
文件 module.xml 和 .jar 现在都存在于 WILDFLY_HOME\modules
确保您已正确安装驱动程序。检查驱动程序 jar 和 modules.xml 文件是否存在于 WILDFLY_HOME\modules\system\layers\base\com\sybase\main 目录下。
更新名称属性的值
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="com.sybase">
<resources>
<resource-root path="jconn3.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
我正在尝试从 Glassfish 迁移到 WildFly 10,我的应用程序连接到 Sybase ASE 数据库。我将 jconn3.jar 放入 WILDFLY_HOME\modules\system\layers\base\com\sybase\sybase\main,创建了 modules.xml,内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="com.sybase.sybase">
<resources>
<resource-root path="jconn3.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
</dependencies>
</module>
并插入到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 jndi-name="java:jboss/datasources/FRAME_IBS" pool-name="FRAME_IBS" enabled="true" use-java-context="true">
<connection-url>jdbc:sybase:Tds:localhost:5000/Banksys;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
<driver>sybase</driver>
<pool>
<min-pool-size>5</min-pool-size>
<max-pool-size>100</max-pool-size>
<prefill>true</prefill>
</pool>
<driver-class>
com.sybase.jdbc3.jdbc.SybDriver
</driver-class>
<security>
<user-name>admin</user-name>
<password>admin</password>
</security>
</datasource>
<drivers>
<driver name="h2" module="com.h2database.h2">
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
</driver>
<driver name="sybase" module="com.sybase.sybase">
<datasource-class>com.sybase.jdbc3.jdbc.SybDataSource</datasource-class>
<xa-datasource-class>com.sybase.jdbc3.jdbc.SybXADataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
我在启动 WF 时在 server.log 文件中遇到此错误:
2017-02-17 12:48:56,297 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("data-source" => "FRAME_IBS")
]) - failure description: {
"WFLYCTL0412: Required services that are not installed:" => ["jboss.jdbc-driver.sybase"],
"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"jboss.driver-demander.java:jboss/datasources/FRAME_IBS is missing [jboss.jdbc-driver.sybase]",
"org.wildfly.data-source.FRAME_IBS is missing [jboss.jdbc-driver.sybase]"
]
}
2017-02-17 12:48:56,297 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("data-source" => "FRAME_IBS")
]) - failure description: {
"WFLYCTL0412: Required services that are not installed:" => [
"jboss.jdbc-driver.sybase",
"jboss.jdbc-driver.sybase"
],
"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"jboss.driver-demander.java:jboss/datasources/FRAME_IBS is missing [jboss.jdbc-driver.sybase]",
"org.wildfly.data-source.FRAME_IBS is missing [jboss.jdbc-driver.sybase]",
"org.wildfly.data-source.FRAME_IBS is missing [jboss.jdbc-driver.sybase]"
]
}
2017-02-17 12:48:56,453 INFO [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
WFLYCTL0184: New missing/unsatisfied dependencies:
service jboss.jdbc-driver.sybase (missing) dependents: [service org.wildfly.data-source.FRAME_IBS, service jboss.driver-demander.java:jboss/datasources/FRAME_IBS]
我用谷歌搜索并尝试了我找到的所有方法,但仍然有这个错误。请帮我。 对不起,如果我的英语不正确,那不是我的母语。
我按照 Leozeo 和 Mark 的建议重命名模块并将其移至 WILDFLY_HOME\modules,但仍然有相同的消息。我再次从 standalone.xml、运行 WF 中删除了我的数据源,然后我看到了这条消息:
ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 33) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("jdbc-driver" => "sybase")
文件 module.xml 和 .jar 现在都存在于 WILDFLY_HOME\modules
确保您已正确安装驱动程序。检查驱动程序 jar 和 modules.xml 文件是否存在于 WILDFLY_HOME\modules\system\layers\base\com\sybase\main 目录下。
更新名称属性的值
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="com.sybase">
<resources>
<resource-root path="jconn3.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>