LuckyLuke
LuckyLuke

Reputation: 49097

JBoss 7.1.1 doesn't start because of unexpected element "pool"

I get the following error message when I add the pool element:

Caused by: org.jboss.as.connector.util.ParserException: IJ010061: Unexpected element: pool

If I remove the pool element it works. I have checked the XSD in the docs folder and I am pretty sure this is right? Why does it fail?

    <subsystem xmlns="urn:jboss:domain:resource-adapters:1.0">
        <resource-adapters>
            <resource-adapter>
                <archive>
                    jackrabbit-jca-2.6.2.rar
                </archive>
                <transaction-support>XATransaction</transaction-support>
                <connection-definitions>
                    <connection-definition class-name="org.apache.jackrabbit.jca.JCAManagedConnectionFactory" jndi-name="java:/jca/JcrRepository" enabled="true" use-java-context="true" pool-name="jackrabbit-jca-2_6_2_rar-Pool" use-ccm="true">
                    <pool>
                        <min-pool-size>1</min-pool-size>
                        <max-pool-size>4</max-pool-size>
                    </pool>
                   </connection-definition>
                </connection-definitions>
            </resource-adapter>
        </resource-adapters>
    </subsystem>

Upvotes: 5

Views: 3318

Answers (2)

Jan Piel
Jan Piel

Reputation: 540

It's not a bug, it's a feature ;)

...

Let's just go a little bit deep into the responsible implementation:

When you look into the source of the responsible parser you can see the following

     case TRANSACTION_SUPPORT: {
                         if (txSupportMatched) {
                            throw new ParserException(bundle.unexpectedElement(TRANSACTIONSUPPORT.getXmlName()));
                        }
                        String value = rawElementText(reader);
                        TRANSACTIONSUPPORT.parseAndSetParameter(value, operation, reader);
                        isXa = value != null && TransactionSupportEnum.valueOf(value) == TransactionSupportEnum.XATransaction;
                        txSupportMatched = true;
                        break;
                    }

That's the parsing of the resource-adapter-tag. If you write the XATransaction-keyword, the (by default false) isXa-var switches to true.

Now the parser of the connection-definition-tag expects a xa-pool-tag

           case XA_POOL: {
                        if (! isXa) throw new ParserException(bundle.unexpectedElement(CommonConnDef.Tag.XA_POOL.name()));
                        if (poolDefined)
                            throw new ParserException(bundle.multiplePools());
                        parseXaPool(reader, connectionDefinitionNode);
                        poolDefined = true;
                        break;
                    }
                    case POOL: {
                        if (isXa) throw new ParserException(bundle.unexpectedElement(CommonConnDef.Tag.POOL.name()));
                        if (poolDefined)
                            throw new ParserException(bundle.multiplePools());
                        parsePool(reader, connectionDefinitionNode);
                        poolDefined = true;
                        break;
                    }

Depending on the XATransaction-definition the ironjacamar-impl create different pool-implementations. And the xa-poolType of the schema allows more configuration then the standard-pooltype.

But I think that should be documented somewhere, at least in the schema.xsd

Upvotes: 3

Sanjaya Liyanage
Sanjaya Liyanage

Reputation: 4746

Good question and you are totally right. This is a valid according to the schema and I guess this is a bug of JBoss 7.11 .You can file a bug on this . I think you can continue with using a previous version of JBoss and this issue won't be there.

Upvotes: 0

Related Questions