与Sybase的WildFly jdbc连接

时间:2017-02-17 21:10:35

标签: java jdbc sybase-ase wildfly-10

我正在尝试从Glassfish迁移到WildFly 10,我的应用程序连接了Sybase 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]

我用Google搜索并尝试了我发现的所有内容,但仍然有此错误。请帮我。 如果我的英语不正确,这不是我的母语。

我重命名模块并按照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

1 个答案:

答案 0 :(得分:1)

确保已正确安装驱动程序。检查驱动程序jar和modules.xml文件是否存在于WILDFLY_HOME \ modules \ system \ layers \ base \ com \ sybase \ main目录下。

更新名称属性的值

Expr