0

I'm configuring a datasource to use windows authentication with SQL Server.

I put the DLL sqljdbc_auth.dll in C:\Program Files\XXXX\wildfly-10.1.0.Final\bin

Stating Wildfly using standalone.bat works fine.

But using windows service I got this error:

Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Cannot open database "Scope_Build36" requested by the login. The login failed. ClientConnectionId:831c2f7f-4352-4467-b54f-a6eb1369d6e9
    at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:217)
    at com.microsoft.sqlserver.jdbc.TDSTokenHandler.onEOF(tdsparser.java:251)
    at com.microsoft.sqlserver.jdbc.TDSParser.parse(tdsparser.java:81)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection$1LogonProcessor.complete(SQLServerConnection.java:2825)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.sendLogon(SQLServerConnection.java:3079)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(SQLServerConnection.java:2360)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.access$100(SQLServerConnection.java:43)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection$LogonCommand.doExecute(SQLServerConnection.java:2346)
    at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:6276)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1793)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1404)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:1068)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:904)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:451)
    at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:1014)
    at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createLocalManagedConnection(LocalManagedConnectionFactory.java:321)
    ... 44 more

DataSource configuration:

            <datasource jta="true" jndi-name="java:/datasources/PortalScopeWeb_Scope" pool-name="PortalScopeWeb_Scope" enabled="true" use-ccm="true">
                <connection-url>jdbc:sqlserver://RI001421D\SQLEXPRESS:1433;databasename=Scope_Build36;integratedSecurity=true</connection-url>
                <driver>sqlServer</driver>
                <security>
                    <security-domain>securityDomainPortalScopeWeb_Scope</security-domain>
                </security>
                <validation>
                    <check-valid-connection-sql>SELECT 1</check-valid-connection-sql>
                    <validate-on-match>true</validate-on-match>
                    <background-validation>false</background-validation>
                </validation>
            </datasource>

Putting DDL in folder C:\Program Files\XXXX\wildfly-10.1.0.Final\bin\service\amd64 don't solved the problem.

Rodrigo Menezes
  • 245
  • 7
  • 20
  • 1
    If the service was running under your account (the standalone.bat works for you) then I don't know. But it seems like loading the dll worked... I would like to know how you managed to get the standalone.bat to work. (having trouble installing the sqlserver driver myself) – Darsstar Mar 29 '17 at 14:09

1 Answers1

0

you can use a .udl file to test and verify your connection. In you desktop create a new .txt file, and rename it like "test.udl". Now, open it, and you can configure and test your connection. When you have the connection ready, you can open the .udl file with notepad and copy connection string.

here you have a reference: udl reference

hope this help!

M84
  • 727
  • 6
  • 14