无法使用wildfly 10

时间:2018-03-15 11:12:51

标签: java sql-server jdbc connection wildfly

我试图将Wildfly中的数据库连接到jJva。不幸的是我收到错误,说连接和登录失败。我该如何解决这个问题?

当我尝试在wildfly管理中测试我的连接时,我收到错误:

Unexpected HTTP response: 500

Request
{
    "address" => [
        ("subsystem" => "datasources"),
        ("data-source" => "LaundryBookingApp")
    ],
    "operation" => "test-connection-in-pool"
}

Response

Internal Server Error
{
    "outcome" => "failed",
    "failure-description" => "WFLYJCA0040: failed to invoke operation:  
WFLYJCA0047: Connection is not valid",
    "rolled-back" => true
}

当我用Java查看控制台时,它给了我很长的错误:

WARN  [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (External 
Management Request Threads -- 1) IJ000604: Throwable while attempting to get 
a new connection: null: javax.resource.ResourceException: IJ031084: Unable 
to create connection
errors.....
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for 
user 'username'. ClientConnectionId:1588df01-34e0-4590-9b3a-48b220671c84
errors.....
ERROR [org.jboss.as.controller.management-operation] (External Management 
Request Threads -- 1) WFLYCTL0013: Operation ("test-connection-in-pool") 
failed - address: ([
    ("subsystem" => "datasources"),
    ("data-source" => "LaundryBookingApp")
]) - failure description: "WFLYJCA0040: failed to invoke operation: 
WFLYJCA0047: Connection is not valid"

这是我的standalone.xml:

<datasources>
<datasource jndi-name="java:jboss/datasources/jdbc/LaundryBookingApp" pool- 
name="LaundryBookingApp" enabled="true" jta="true" use-ccm="false">
<connection-url>
jdbc:sqlserver://localhost:1433;databaseName=LaundryBookingApp;
</connection-url>
<driver>sqljdbc4</driver>
<security>
<user-name>username</user-name>
<password>password</password>
</security>
<validation>
<validate-on-match>false</validate-on-match>
<background-validation>false</background-validation>
<background-validation-millis>1</background-validation-millis>
</validation>
<statement>
<prepared-statement-cache-size>0</prepared-statement-cache-size>
<share-prepared-statements>false</share-prepared-statements>
</statement>
</datasource>
<drivers>
<driver name="h2" module="com.h2database.h2">
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
</driver>
<driver name="sqljdbc4" module="com.microsoft.sqlserver.jdbc">
<xa-datasource-class>com.microsoft.sqlserver.jdbc.SQLServerXADataSource</xa- 
datasource-class>
</driver>
</drivers>
</datasources>
</subsystem>

0 个答案:

没有答案