문제

I'm currently trying to upgrade my web application from jboss 5.1 to jboss 7.1.1.Final

In my jboss.xml I have configured some custom ejb timeouts like the following:

     <session>
        <ejb-name>MSServiceEJB</ejb-name>
        <jndi-name>ejb/MSServiceEJB</jndi-name>
        <local-jndi-name>ejb/LocalMSServiceEJB</local-jndi-name>
        <method-attributes>
            <method>
                <method-name>*</method-name>
                <transaction-timeout>3600</transaction-timeout>
            </method>
        </method-attributes>
    </session>

jboss 7 ignores jboss.xml, where can I specify my ejb 2.1 transaction timeouts?

도움이 되었습니까?

해결책

Per

Source

Replace the jboss.xml deployment descriptor file

The jboss-ejb3.xml deployment descriptor replaces the jboss.xml deployment descriptor to override and add to the features provided by the Java Enterprise Edition (EE) defined ejb3-jar.xml deployment descriptor. The new file is incompatible with jboss.xml, and the jboss.xml is now ignored in deployments.

You need to create a jboss-ejb3.xml and put the configuration inside it.

It would look something like this:

<assembly-descriptor>
    <container-transaction>
        <method>
            <ejb-name>EJBName</ejb-name>
            <method-name>methodName</method-name>
            <method-intf>Local</method-intf>
        </method>
        <tx:trans-timeout>
            <tx:timeout>500</tx:timeout>
            <tx:unit>Seconds</tx:unit>
        </tx:trans-timeout>
    </container-transaction>
</assembly-descriptor>

You are using EJB2.x , so it would be better and wise to configure it in ejb-jar.xml

It should be created in META-INF of the EJB jar.

다른 팁

You can specify on the Bean method with @TransactionTimeOut annotation.

@TransactionTimeout(value = 10, unit = TimeUnit.SECONDS)

For detailed description of how to set, please refer here

Maddy

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top