[ 
https://issues.apache.org/jira/browse/AMQ-2656?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12986410#action_12986410
 ] 

Peter Hinds edited comment on AMQ-2656 at 1/25/11 9:56 AM:
-----------------------------------------------------------

Gary, thanks for your help on this. In the end I had to use the version of 
ActiveMQInitialContextFactory.java as attached by Edan idzerda at 2010-03-18 
11:05 PM. I had a search through the ActiveMQ issue tracker and couldn't find 
if Edan's suggested code was ever added to core - do you know if it was? It 
would be very useful if it was for cases like the one I have outlined below 
where the setting up of the jndi environment is abstracted up out of the code. 
(i.e. in websphere you cannot define the 'xa=true' property anywhere - hence 
Edan's 'XAConnection' jndi name is invaluable!

For anybody else trying to get a connection to ActiveMQ within a 
WebSphere7.0.0-managed XA transaction and getting an error of "An illegal 
attempt to commit a one phase capable resource with existing two phase capable 
resources has occured" in the WebSphere SystemOut.log. Here are the steps to 
get around it:

1) Use the attached file kindly attached by Edan at 2010-03-18 11:05 PM to 
compile activemq-5.4.0.

2) In WebSphere Admin Console, create a new JMS provider:
i) Resources > JMS > JMS providers > New
ii) Use the following:
    Name: use a name like 'ActiveMQ 5.4.0'
    Classpath: add the paths to the following jar files (each path needs to be 
on a new line in the text box) activemq-all-5.4.0.jar, commons-logging-1.1.jar, 
geronimo-j2ee-management_1.1_spec-1.0.1.jar
    External Initial Context Factory: 
org.apache.activemq.jndi.ActiveMQWASInitialContextFactory
    External Provider URL: tcp://localhost:61616

3) In WebSphere Admin Console, create a new ConnectionFactory
i) Resources > JMS > Connection factories > New
ii) Use the following:
    Name: use a name like 'ActiveMQ 5.4.0 Connection Factory'
    JNDI name: jmsfactory/activemq540connfactory (this will be the name that 
any WebSphere-run apps will lookup using jndi)
    External JNDI name: XAConnectionFactory (this is the new name added by 
Edan's code in step 1 above - basically, when you're code running in WebSphere 
calls 'jmsfactory/activemq540connfactory', WebSphere does a call to activemq 
using this jndi name, i.e. XAConnectionFactory )



      was (Author: hindsbeans):
    Gary, thanks for your help on this. In the end I had to use the version of 
ActiveMQInitialContextFactory.java as attached by Edan idzerda at 2010-03-18 
11:05 PM. I had a search through the ActiveMQ issue tracker and couldn't find 
if Edan's suggested code was ever added to core - do you know if it was? It 
would be very useful if it was for cases like the one I have outlined below 
where the setting up of the jndi environment is abstracted up out of the code. 
(i.e. in websphere you cannot define the 'xa=true' property anywhere - hence 
Edan's 'XAConnection' jndi name is invaluable!

For anybody else trying to get a connection to ActiveMQ within a 
WebSphere7.0.0-managed XA transaction and getting an error of "An illegal 
attempt to commit a one phase capable resource with existing two phase capable 
resources has occured" in the WebSphere SystemOut.log. Here are the steps to 
get around it:

1) Use the attached file kindly attached by Edan at 2010-03-18 11:05 PM to 
compile activemq-5.4.0.

2) In WebSphere Admin Console, create a new JMS provider:
i) Resources > JMS > JMS providers > New
ii) Use the following:
    Name: use a name like 'ActiveMQ 5.4.0'
    Classpath: add the paths to the following jar files (each path needs to be 
on a new line in the text box) activemq-all-5.4.0.jar, commons-logging-1.1.jar, 
geronimo-j2ee-management_1.1_spec-1.0.1.jar
    External Initial Context Factory: 
org.apache.activemq.jndi.ActiveMQWASInitialContextFactory
    External Provider URL: tcp://localhost:61616

3) In WebSphere Admin Console, create a new ConnectionFactory
i) Resources > JMS > Connection factories > New
ii) Use the following:
    Name: use a name like 'ActiveMQ 5.4.0 Connection Factory'
    JNDI name: jmsfactory/activemq540connfactory (this will be the name that 
any WebSphere-run apps will lookup using jndi)
    External JNDI name: XAConnectionFactory (this is the new name added by 
Edan's code in step 1 above - basically, when you're code running in WebSphere 
calls 'jmsfactory/activemq540connfactory', WebSphere then does a call to 
activemq)


  
> ActiveMQInitialConnectionFactory cannot return an XAConnectionFactory
> ---------------------------------------------------------------------
>
>                 Key: AMQ-2656
>                 URL: https://issues.apache.org/jira/browse/AMQ-2656
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.3.0
>            Reporter: Edan idzerda
>            Assignee: Gary Tully
>             Fix For: 5.4.0
>
>         Attachments: ActiveMQInitialContextFactory.java, 
> ActiveMQInitialContextFactory.java
>
>
> ActiveMQInitialContextFactory cannot resolve the name "XAConnectionFactory"  
> a la:
> INFO: JNDI API lookup failed: javax.naming.NameNotFoundException: 
> XAConnectionFactory
> This prevents using the builtin JNDI service in an XA transaction context.  
> I've created a simple patch to workaround this and discussed it on the 
> mailing list:  
> http://old.nabble.com/ActiveMQ%27s-JNDI-does-not-resolve-XAConnectionFactory-td27936255.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to