6 Replies Latest reply on Jun 18, 2013 10:23 AM by Stephen Coy

    Facing error with the <depends> tag in jboss-web.xml file

    Madhusudhan raju Newbie

      Hi,

       

      We are in process of migating from jBoss EAP 5.1 to jBoss EAP v.6.0.1

       

      When the same code is deployed in jboss v6.0.1/standalone/deployments folder the following errors are occuring which is due to <depends> tag in jboss-web.xml file.

       

      Error log is as follows:

       

      00:09:43,236 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015876: Starting deployment of "appWeb.war"

      00:09:43,369 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC000001: Failed to start service jboss.deployment.subunit."app.ear"."appWeb.war".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.subunit."app.ear"."appWeb.war".PARSE: JBAS018733: Failed to process phase PARSE of subdeployment "appWeb.war" of deployment "app.ear"

      at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:123) [jboss-as-server-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]

      at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA-redhat-2.jar:1.0.2.GA-redhat-2]

      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA-redhat-2.jar:1.0.2.GA-redhat-2]

      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) [rt.jar:1.6.0_45]

      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [rt.jar:1.6.0_45]

      at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_45]

      Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS018014: Failed to parse XML descriptor "/X:/jboss-6.01/bin/content/app.ear/appWeb.war/WEB-INF/jboss-web.xml" at [11,2]

      at org.jboss.as.web.deployment.JBossWebParsingDeploymentProcessor.deploy(JBossWebParsingDeploymentProcessor.java:79)

      at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:116) [jboss-as-server-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]

      ... 5 more

      Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[11,2]

      Message: Unexpected element '{http://www.jboss.com/xml/ns/javaee}depends' encountered

      at org.jboss.metadata.parser.util.MetaDataElementParser.unexpectedElement(MetaDataElementParser.java:109)

      at org.jboss.metadata.parser.jbossweb.JBossWebMetaDataParser.parse(JBossWebMetaDataParser.java:212)

      at org.jboss.as.web.deployment.JBossWebParsingDeploymentProcessor.deploy(JBossWebParsingDeploymentProcessor.java:71)

      ... 6 more

       

       

      jboss-web-xml file looks like this:

       

      <?xml version="1.0" encoding="UTF-8"?>

      <!-- $Id: jboss-web.xml,v 1.1 2008/02/27 21:11:49 so1361 Exp $ -->

      <jboss-web xmlns="http://www.jboss.com/xml/ns/javaee"

                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                 xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss-web_6_0.xsd"

                 version="6.0">

      <replication-config>

        <replication-trigger>SET</replication-trigger>

        <replication-granularity>ATTRIBUTE</replication-granularity>

      </replication-config>

      <depends>jboss.jca:service=DataSourceBinding,name=app_name

       

      </depends>

      </jboss-web>

       

      Can someone please assist me with this issue?

        • 1. Re: Facing error with the <depends> tag in jboss-web.xml file
          Stephen Coy Master
          1. You need to use the jboss-web schema found in $JBOSS_HOME/docs/schema/jboss-web_7_1.xsd.
          2. You will find that depends is no longer supported. If you're injecting your datasource or have proper resource-ref elements in your deployment descriptors then JBossAS/WildFly will figure the dependency out for itself.
          • 2. Re: Facing error with the <depends> tag in jboss-web.xml file
            Madhusudhan raju Newbie

            Stephen,

             

            We are not using resource-ref elements in web.xml. By commenting this out ear deployed successfully.

             

            I have done the datasource configuration in standalone.xml file where the configuration is as follows but during the "Test Connection" from Admin module the below error is occuring.

             

            Standalone.xml file is configured as follows:

             

            <datasources>

                            <datasource jndi-name="java:/datasource/myds" pool-name="myds" enabled="true" use-java-context="true">

                                <connection-url>jdbc:microsoft:sqlserver://localhost:8080;DatabaseName=myds</connection-url>

                                <driver>sqlserver</driver>

                                <pool>

                                    <min-pool-size>9</min-pool-size>

                                    <max-pool-size>25</max-pool-size>

                                </pool>

                                <security>

                                    <user-name>*</user-name>

                                    <password>*</password>

                                </security>

                                <statement>

                                    <prepared-statement-cache-size>100</prepared-statement-cache-size>

                                    <share-prepared-statements>true</share-prepared-statements>

                                </statement>

                            </datasource>

                            <drivers>

                                <driver name="sqlserver" module="com.microsoft.sqlserver">

                                    <xa-datasource-class>org.sqlserver.jdbcx.JdbcDataSource</xa-datasource-class>

                                </driver>

                            </drivers>

                        </datasources>

             

            Error:

             

            Unknown error

            Unexpected HTTP response: 500

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

            Response

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

             

             

            How can this be resolved?

            • 3. Re: Facing error with the <depends> tag in jboss-web.xml file
              Albano Manoni Newbie

              Can you show us the related stacktrace on server's log?

               

              However, are you sure about your datasource settings? It is org.sqlserver.jdbcx.JdbcDataSource correct?

              The error message indicates that there is a configuration problem (or maybe wrong credentials) that preventes the AS to contact your RDBMS.

              • 4. Re: Facing error with the <depends> tag in jboss-web.xml file
                Madhusudhan raju Newbie

                I did the configuration as per given in the jBoss Admin guide.

                 

                Pls see below for server log:

                 

                03:54:00,468 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) JBAS010400: Bound data source [java:/datasource/myds]
                03:54:00,877 WARN  [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (JCA PoolFiller) IJ000610: Unable to fill pool: javax.resource.ResourceException: Could not create connection
                at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:282)
                at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:240)
                at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.createConnectionEventListener(SemaphoreArrayListManagedConnectionPool.java:775) [ironjacamar-core-impl-1.0.13.Final-redhat-1.jar:1.0.13.Final-redhat-1]
                at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.fillToMin(SemaphoreArrayListManagedConnectionPool.java:720) [ironjacamar-core-impl-1.0.13.Final-redhat-1.jar:1.0.13.Final-redhat-1]
                at org.jboss.jca.core.connectionmanager.pool.mcp.PoolFiller.run(PoolFiller.java:97) [ironjacamar-core-impl-1.0.13.Final-redhat-1.jar:1.0.13.Final-redhat-1]
                at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_45]
                Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user 'x'. ClientConnectionId:3e2b63eb-6680-45cb-a60a-d0bbbf2d8c00
                at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:216)
                at com.microsoft.sqlserver.jdbc.TDSTokenHandler.onEOF(tdsparser.java:254)
                at com.microsoft.sqlserver.jdbc.TDSParser.parse(tdsparser.java:84)
                at com.microsoft.sqlserver.jdbc.SQLServerConnection.sendLogon(SQLServerConnection.java:2908)
                at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(SQLServerConnection.java:2234)
                at com.microsoft.sqlserver.jdbc.SQLServerConnection.access$000(SQLServerConnection.java:41)
                at com.microsoft.sqlserver.jdbc.SQLServerConnection$LogonCommand.doExecute(SQLServerConnection.java:2220)
                at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:5696)
                at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1715)
                at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1326)
                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:254)
                ... 5 more

                • 5. Re: Facing error with the <depends> tag in jboss-web.xml file
                  Albano Manoni Newbie

                  The datasource configuration seems ok but in the log i read:

                   

                  Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user 'x'. ClientConnectionId:3e2b63eb-6680-45cb-a60a-d0bbbf2d8c00

                   

                  This is clearly a bad credetials issue but, if you are sure that everything it's ok, then you have to focus on the authentication mode of your Sql Server installation, the best suited is "mixed mode".

                  • 6. Re: Facing error with the <depends> tag in jboss-web.xml file
                    Stephen Coy Master

                    It's quite unlikely that this

                    {code:xml} <connection-url>jdbc:microsoft:sqlserver://localhost:8080;DatabaseName=myds</connection-url>{code}

                    is correct.  localhost:8080?