Silently ignoring invalid resource references etc
hostalp Jan 6, 2011 7:14 AMHello,
I'm hitting the following problem:
We''ve got an app packaged in ear and targeted for various app servers - WAS, WLS, JBossAS.
We use app servers work managers via spring. For WAS, WLS we use commonj, for JBossAS we use the JCA WorkManager.
We've got an external configuration file which we use to specify at which app server we're running and thus which sping bean to use for accessing the appropriate work manager so we always initialize the correct one.
Because of commonj WorkManagers being accessed via JNDI we've got to add a resource references into web.xml:
<resource-ref>
<description>WebSphere work manager for batch processing</description>
<res-ref-name>commonj/MyWorkManager</res-ref-name>
<res-type>commonj.work.WorkManager</res-type>
<res-auth>Container</res-auth>
</resource-ref>
With this JBoss doesn't deploy the app complaining about nothing could be bound to satisfy
Therefore we add a dummy binding into jboss-web.xml:
<resource-ref>
<res-ref-name>commonj/MyWorkManager</res-ref-name>
<jndi-name>MyWorkManager</jndi-name>
</resource-ref>
This way it did deploy in JBossAS 5.1, but on JBossAS 6.0 it doesn't and it doesn't also produce any error, it just doesn't deploy.
Is there a way to get around it? We need to keep the web.xml entry but still let JBoss to deploy the app (and don't care about that resource reference).
And another issue closely related:
The spring bean for JBoss JCA Work Manager uses the following configuration (spring 3.0.5):
<bean id="jbossCommonTaskExecutor" class="org.springframework.jca.work.jboss.JBossWorkManagerTaskExecutor" lazy-init="true">
<property name="workManagerMBeanName" value="${common.work.manager.jbossmbeanname}"/>
</bean>
with common.work.manager.jbossmbeanname=jboss.jca:service=MyWorkManager
and this WorkManager exists in the instance:
...
<bean name="MyWorkManager" class="org.jboss.resource.work.JBossWorkManager">
<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.jca:service=MyWorkManager", exposedInterface=org.jboss.resource.work.JBossWorkManagerMBean.class)</annotation>
<property name="executor"><inject bean="MyWorkManagerThreadPool"/></property>
<property name="XATerminator"><inject bean="TransactionManager" property="XATerminator"/></property>
</bean
and I can see it in JMX objects view
however during startup I'm getting a strange exception:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'workManagerMBeanName' threw exception; nested exception is java.lang.IllegalStateException: Could not initialize JBossWorkManagerTaskExecutor because JBoss API is not available: java.lang.reflect.InvocationTargetException
Which again doesn't occur on JBossAS 5.1. We'll try to debug it, but anyway - any ideas on this one?