Trouble connecting to a SQL Server Database through a JBoss 6 EAP docker container

I’m able to connect to a SQL Server 2008 Database I have set up in my local JBOSS Eap 6 App Server. I installed the sqljdbc module, set up the datasource, tested the connection, etc.

However, when I attempt to build a docker container with this same information, I get the following stack trace when attempting to test the connection:

  • ERROR: mkdir with chown not working in Dockerfile (nginx with php-fpm)
  • Docker container cannot resolve website names, but can ping their ip
  • Installing Docker with sudo
  • docker-compose images volumes
  • Can't start application within docker using linked mysql database
  • Connecting to MySQL Server on localhost through Docker
  • 18:36:10,630 WARN  [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (HttpManagementService-threads - 2) IJ000604: Throwable while attempting to get a new connection: null: javax.resource.ResourceException: Could not create connection
        at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:356) [ironjacamar-jdbc-1.0.31.Final-redhat-1.jar:1.0.31.Final-redhat-1]
        at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:304) [ironjacamar-jdbc-1.0.31.Final-redhat-1.jar:1.0.31.Final-redhat-1]
        at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.createConnectionEventListener(SemaphoreArrayListManagedConnectionPool.java:834) [ironjacamar-core-impl-1.0.31.Final-redhat-1.jar:1.0.31.Final-redhat-1]
        at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.getConnection(SemaphoreArrayListManagedConnectionPool.java:379) [ironjacamar-core-impl-1.0.31.Final-redhat-1.jar:1.0.31.Final-redhat-1]
        at org.jboss.jca.core.connectionmanager.pool.AbstractPool.internalTestConnection(AbstractPool.java:728) [ironjacamar-core-impl-1.0.31.Final-redhat-1.jar:1.0.31.Final-redhat-1]
        at org.jboss.jca.core.connectionmanager.pool.strategy.OnePool.testConnection(OnePool.java:89) [ironjacamar-core-impl-1.0.31.Final-redhat-1.jar:1.0.31.Final-redhat-1]
        at org.jboss.as.connector.subsystems.common.pool.PoolOperations$TestConnectionInPool.invokeCommandOn(PoolOperations.java:143) [jboss-as-connector-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
        at org.jboss.as.connector.subsystems.common.pool.PoolOperations$1.execute(PoolOperations.java:82) [jboss-as-connector-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
        at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:702) [jboss-as-controller-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
        at org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:537) [jboss-as-controller-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
        at org.jboss.as.controller.AbstractOperationContext.completeStepInternal(AbstractOperationContext.java:338) [jboss-as-controller-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
        at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:314) [jboss-as-controller-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
        at org.jboss.as.controller.OperationContextImpl.executeOperation(OperationContextImpl.java:1144) [jboss-as-controller-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
        at org.jboss.as.controller.ModelControllerImpl.internalExecute(ModelControllerImpl.java:331) [jboss-as-controller-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
        at org.jboss.as.controller.ModelControllerImpl.execute(ModelControllerImpl.java:201) [jboss-as-controller-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
        at org.jboss.as.domain.http.server.DomainApiHandler.processRequest(DomainApiHandler.java:295)
        at org.jboss.as.domain.http.server.DomainApiHandler.doHandle(DomainApiHandler.java:179)
        at org.jboss.as.domain.http.server.DomainApiHandler.handle(DomainApiHandler.java:186)
        at org.jboss.as.domain.http.server.security.SubjectAssociationHandler$1.run(SubjectAssociationHandler.java:69)
        at org.jboss.as.domain.http.server.security.SubjectAssociationHandler$1.run(SubjectAssociationHandler.java:65)
        at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.8.0_71]
        at javax.security.auth.Subject.doAs(Subject.java:422) [rt.jar:1.8.0_71]
        at org.jboss.as.controller.AccessAuditContext.doAs(AccessAuditContext.java:94) [jboss-as-controller-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
        at org.jboss.as.domain.http.server.security.SubjectAssociationHandler.handleRequest(SubjectAssociationHandler.java:65)
        at org.jboss.as.domain.http.server.security.SubjectAssociationHandler.handle(SubjectAssociationHandler.java:59)
        at org.jboss.as.domain.http.server.DomainApiCheckHandler.handle(DomainApiCheckHandler.java:45)
        at org.jboss.com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:78)
        at org.jboss.sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:69)
        at org.jboss.com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:81)
        at org.jboss.sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:710)
        at org.jboss.com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:78)
        at org.jboss.as.domain.http.server.RealmReadinessFilter.doFilter(RealmReadinessFilter.java:48)
        at org.jboss.as.domain.http.server.DmrFailureReadinessFilter.doFilter(DmrFailureReadinessFilter.java:45)
        at org.jboss.com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:81)
        at org.jboss.sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:682)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_71]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_71]
        at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_71]
        at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.1.2.Final-redhat-1.jar:2.1.2.Final-redhat-1]
    Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host rhssqlprod1, port 1433 has failed. Error: "null. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.".
        at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:190)
        at com.microsoft.sqlserver.jdbc.SQLServerException.ConvertConnectExceptionToSQLServerException(SQLServerException.java:241)
        at com.microsoft.sqlserver.jdbc.SocketFinder.findSocket(IOBuffer.java:2243)
        at com.microsoft.sqlserver.jdbc.TDSChannel.open(IOBuffer.java:491)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1309)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:991)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:827)
        at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:1012)
        at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:328) [ironjacamar-jdbc-1.0.31.Final-redhat-1.jar:1.0.31.Final-redhat-1]
        ... 38 more
    

    Here is my dockerfile in case that helps. Please keep in mind this is the identical process I have set up to install a JBoss EAP 6 Oralce DB Instance and it works fine. I’m thinking there’s something about the Docker container the receiving SqlServer doesn’t like. I’m not sure what though, or if I can even make changes on that side:

    ### Set the base image to Fedora
    FROM jboss/base-jdk:8
    
    ### File Author / Maintainer
    MAINTAINER "Daniel Grant" "dsgrant@*****"
    
    ### Install EAP 6.4
    ADD install/jboss-eap-6.4.zip /tmp/jboss-eap-6.4.zip
    RUN unzip /tmp/jboss-eap-6.4.zip
    
    ### Set Environment
    ENV JBOSS_HOME /opt/jboss/jboss-eap-6.4
    
    ### Create EAP User
    RUN $JBOSS_HOME/bin/add-user.sh admin admin123! --silent
    
    RUN echo "JAVA_OPTS=\"\$JAVA_OPTS -Djboss.bind.address=0.0.0.0 -Djboss.bind.address.management=0.0.0.0\"" >> $JBOSS_HOME/bin/standalone.conf
    
    ### Open Ports
    EXPOSE 8080 9990 9999
    
    ### Add SqlServer Module
    ADD sqljdbc4.jar $JBOSS_HOME/modules/com/microsoft/main/sqljdbc4.jar
    ADD module.xml $JBOSS_HOME/modules/com/microsoft/main/module.xml
    
    ### Overwrite Standalone Config
    ADD standalone.xml $JBOSS_HOME/standalone/configuration/standalone.xml
    
    ### Start EAP
    ENTRYPOINT $JBOSS_HOME/bin/standalone.sh
    

  • Making an API call from dockerized web page to back-end server ends up with net::ERR_CONNECTION_REFUSED
  • docker exec is missing
  • Install docker-volume-netshare on Linux AMI
  • Docker Compose does not bind ports
  • Using docker behind a proxy on an EC2 instance
  • Access docker container running in coreos on vagrant vm through browser in host ubuntu host
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.