Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

WAS 6.1 and MQ v6

11 views
Skip to first unread message

pedw...@identitysolutions.co.nz

unread,
Apr 2, 2008, 5:27:03 PM4/2/08
to
Guys,<br />
<br />
I'm hoping someone can help as I'm at the end of my rope on this.<br />
<br />
I have an java application, it uses spring to do all the config and startup. It works fine when run as a standalone java app, either remotely or on the same machine as the MQ (I have two different sets of configs for this, as one has to change the binding type for MQ).<br />
<br />
The issue I have is when I turn my spring app into a WAR file and try and run from inside WAS. The war is starting just fine, but has an issue when it comes time to connect to the MQ (Both WAS and MQ are on the same machine). We thought it was a config issue, so we changed the startup user of the WAS to a user that belongs to the mqm group so has access to the MQ. (We are running on windows).<br />
<br />
We are getting an IllegalAccessError. If I supply the wrong password I get a securityException. So the issue isn't with the user, but with how WAS is trying to create its context.<br />
<br />
<strike>3/04/08 08:24:11:640 NZST</strike> 00000022 SystemOut O islAudit: 08:24:11,625 ERROR <a href="http://www-128.ibm.com/developerworks/forums/">ContextLoader</a> Context initialization failed<br />
<br />
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'AuditingProcessor1' defined in ServletContext resource [/WEB-INF/auditing.xml]: Cannot resolve reference to bean 'AuditInputJmsReader' while setting bean property 'jmsInput'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'AuditInputJmsReader' defined in ServletContext resource [/WEB-INF/auditing.xml]: Invocation of init method failed; nested exception is java.lang.IllegalAccessError<br />
<br />
Caused by: <br />
<br />
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'AuditInputJmsReader' defined in ServletContext resource [/WEB-INF/auditing.xml]: Invocation of init method failed; nested exception is java.lang.IllegalAccessError<br />
<br />
Caused by: <br />
<br />
java.lang.IllegalAccessError<br />
<br />
at com.ibm.mq.jms.context.MQContext.createMQObject(MQContext.java:691)<br />
<br />
at com.ibm.mq.jms.context.MQContext.lookup(MQContext.java:938)<br />
<br />
at javax.naming.InitialContext.lookup(InitialContext.java:363)<br />
<br />
at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:124)<br />
<br />
at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:86)<br />
<br />
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:122)<br />
<br />
at nz.co.identitysolutions.islAudit.jms.IbmJMSConnection.lookupDestination(IbmJMSC onnection.java:301)<br />
<br />
at nz.co.identitysolutions.islAudit.jms.JMSReadConnector.createMessageConsumerFor( JMSReadConnector.java:239)<br />
<br />
at nz.co.identitysolutions.islAudit.jms.JMSReadConnector.connect(JMSReadConnector. java:135)<br />
<br />
The relevant part of the config file is:<br />
<p />
<br />
<bean id="LocalTransport"

class="org.springframework.beans.factory.config.FieldRetrievingFactoryBean">
<br />
<property name="staticField">
<br />
<value>com.ibm.mq.jms.JMSC.MQJMS_TP_BINDINGS_MQ</value>
<br />
</property>
<br />
</bean>
<p />
<p />
<br />
<bean id="MQLocalConnectionFactory" class="com.ibm.mq.jms.MQQueueConnectionFactory">
<br />
<property name="transportType" ref="LocalTransport" />
<br />
<property name="hostName" value="localhost" />
<br />
<property name="port" value="1422" />
<br />
<property name="channel" value="Audit_C" />
<br />
<property name="queueManager" value="AUDIT" />
<br />
</bean>
<p />
<br />
<bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
<br />
<property name="environment">
<br />
<props>
<p />
<br />
<!-- WARNING WARNING WARNING<br />
<p /><br />
<br />
This connects as WHO you are on THIS machine. You can set the credentials but against<br />
<br />
MQ v6 they are ignored. The person how is running this must have an account on the<br />
<br />
server and be a member of the "mqm" group.<br />
<br />
--><br />
<p />
<br />
<prop key="java.naming.factory.initial">com.ibm.mq.jms.context.WMQInitialContextFacto ry</prop>
<br />
<prop key="java.naming.provider.url">localhost:1422/SYSTEM.DEF.SVRCONN</prop>
<br />
</props>
<br />
</property>
<br />
</bean>
<p />
<p />
<p />
<br />
<bean id="AuditInputJmsConnection" class="nz.co.identitysolutions.islAudit.jms.IbmJMSConnection" >
<br />
<!-- Note: We test on the name to determine that it is a queue connection factory later --><br />
<br />
<property name="connectionFactory" ref="MQLocalConnectionFactory" />
<br />
<property name="jndiTemplate" ref="jndiTemplate" /> <br />
<br />
<property name="username" value="Paul Edwards" />
<br />
<property name="password" value="test" /> <br />
<br />
</bean>
<p />
<br />
<bean id="AuditInputJmsReader" class="nz.co.identitysolutions.islAudit.jms.JMSReadConnector"

singleton="true" init-method="connect" destroy-method="disconnect">
<br />
<property name="destinationName" value="Q.AUDIT.INPUT" />
<br />
<property name="jmsConnection" ref="AuditInputJmsConnection" />
<br />
<property name="transacted" value="false" />
<br />
</bean>
<br />
I figure there is a configuration issue here as WAS can't seem to get access to MQ. I really hope someone can help.<br />
<br />
Thanks<br />
P.

Ken Hygh

unread,
Apr 2, 2008, 9:46:04 PM4/2/08
to
pedw...@identitysolutions.co.nz wrote:
> Guys,

>
> I'm hoping someone can help as I'm at the end of my rope on this.
>
> I have an java application, it uses spring to do all the config and startup. It works fine when run as a standalone java app, either remotely or on the same machine as the MQ (I have two different sets of configs for this, as one has to change the binding type for MQ).
>
> The issue I have is when I turn my spring app into a WAR file and try and run from inside WAS. The war is starting just fine, but has an issue when it comes time to connect to the MQ (Both WAS and MQ are on the same machine). We thought it was a config issue, so we changed the startup user of the WAS to a user that belongs to the mqm group so has access to the MQ. (We are running on windows).
>
> We are getting an IllegalAccessError. If I supply the wrong password I get a securityException. So the issue isn't with the user, but with how WAS is trying to create its context.
>
> 3/04/08 08:24:11:640 NZST 00000022 SystemOut O islAudit: 08:24:11,625 ERROR ContextLoader Context initialization failed

>
> org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'AuditingProcessor1' defined in ServletContext resource [/WEB-INF/auditing.xml]: Cannot resolve reference to bean 'AuditInputJmsReader' while setting bean property 'jmsInput'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'AuditInputJmsReader' defined in ServletContext resource [/WEB-INF/auditing.xml]: Invocation of init method failed; nested exception is java.lang.IllegalAccessError
>
> Caused by:
>
> org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'AuditInputJmsReader' defined in ServletContext resource [/WEB-INF/auditing.xml]: Invocation of init method failed; nested exception is java.lang.IllegalAccessError
>
> Caused by:
>
> java.lang.IllegalAccessError
>
> at com.ibm.mq.jms.context.MQContext.createMQObject(MQContext.java:691)
>
> at com.ibm.mq.jms.context.MQContext.lookup(MQContext.java:938)
>
> at javax.naming.InitialContext.lookup(InitialContext.java:363)
>
> at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:124)
>
> at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:86)
>
> at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:122)
>
> at nz.co.identitysolutions.islAudit.jms.IbmJMSConnection.lookupDestination(IbmJMSC onnection.java:301)
>
> at nz.co.identitysolutions.islAudit.jms.JMSReadConnector.createMessageConsumerFor( JMSReadConnector.java:239)
>
> at nz.co.identitysolutions.islAudit.jms.JMSReadConnector.connect(JMSReadConnector. java:135)

>
> The relevant part of the config file is:
>
> <bean id="LocalTransport"
>
> class="org.springframework.beans.factory.config.FieldRetrievingFactoryBean">
>
> <property name="staticField">
>
> <value>com.ibm.mq.jms.JMSC.MQJMS_TP_BINDINGS_MQ</value>
>
> </property>
>
> </bean>

>
> <bean id="MQLocalConnectionFactory" class="com.ibm.mq.jms.MQQueueConnectionFactory">
>
> <property name="transportType" ref="LocalTransport" />
>
> <property name="hostName" value="localhost" />
>
> <property name="port" value="1422" />
>
> <property name="channel" value="Audit_C" />
>
> <property name="queueManager" value="AUDIT" />
>
> </bean>

>
> <bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
>
> <property name="environment">
>
> <props>
>
> <!-- WARNING WARNING WARNING

>
> This connects as WHO you are on THIS machine. You can set the credentials but against
>
> MQ v6 they are ignored. The person how is running this must have an account on the
>
> server and be a member of the "mqm" group.
>
> -->

>
> <prop key="java.naming.factory.initial">com.ibm.mq.jms.context.WMQInitialContextFacto ry</prop>
>
> <prop key="java.naming.provider.url">localhost:1422/SYSTEM.DEF.SVRCONN</prop>
>
> </props>
>
> </property>
>
> </bean>

>
> <bean id="AuditInputJmsConnection" class="nz.co.identitysolutions.islAudit.jms.IbmJMSConnection" >
>
> <!-- Note: We test on the name to determine that it is a queue connection factory later -->
>
> <property name="connectionFactory" ref="MQLocalConnectionFactory" />
>
> <property name="jndiTemplate" ref="jndiTemplate" />
>
> <property name="username" value="Paul Edwards" />
>
> <property name="password" value="test" />
>
> </bean>
> <p />

>
> <bean id="AuditInputJmsReader" class="nz.co.identitysolutions.islAudit.jms.JMSReadConnector"
>
> singleton="true" init-method="connect" destroy-method="disconnect">
>
> <property name="destinationName" value="Q.AUDIT.INPUT" />
>
> <property name="jmsConnection" ref="AuditInputJmsConnection" />
>
> <property name="transacted" value="false" />
>
> </bean>

>
> I figure there is a configuration issue here as WAS can't seem to get access to MQ. I really hope someone can help.
>
> Thanks
> P.
>
<wag>
IllegalAccess often has something to do with classloader issues. Try
busting Spring and the MQ jars into Shared Libraries loaded by the
Application Server instead of buried in your WAR file.
</wag>

Ken

0 new messages