You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Andreas Benneke (JIRA)" <ji...@apache.org> on 2008/10/31 15:03:44 UTC

[jira] Created: (CXF-1893) Endpoints end up at the wrong bus when initializing multiple busses in one thread

Endpoints end up at the wrong bus when initializing multiple busses in one thread
---------------------------------------------------------------------------------

                 Key: CXF-1893
                 URL: https://issues.apache.org/jira/browse/CXF-1893
             Project: CXF
          Issue Type: Bug
          Components: Bus, Core, JAX-WS Runtime
            Reporter: Andreas Benneke


We are using CXF on JBoss 4.2.3 and have an EAR with multiple WARs, each WAR having it's own cxf-bus and endpoint definition(s):

<jaxws:endpoint
      id="endpointId"
      implementorClass="some.package.SomeClass"
      implementor="#theImplementorBean"
      wsdlLocation="service.wsdl"
      address="/service">
      <!-- NOTE: no bus="..." specified here! -->
</jaxws:endpoint>

Deploying this EAR in JBoss all endpoints end up on one single bus (the first one created) and all other busses are "empty".

Looking into the code we found that the org.apache.cxf.jaxws.spring.EndpointDefinitionParser$SpringEndpointImpl resolves the bus (if none is injected so far) using BusFactory.getThreadDefaultBus(). This method however returns the first bus created on the current thread. 
As JBoss initializes the whole EAR in one thread the above situation occures.

As a workaround/solution we added a bus="cxf" to all endpoints which avoids the resolution of the bus using the thread:

<jaxws:endpoint
      bus="cxf" <!-- workaround -->
      id="endpointId"
      implementorClass="some.package.SomeClass"
      implementor="#TheImplementorBean"
      wsdlLocation="service.wsdl"
      address="/service">
</jaxws:endpoint>

We however think, that EndpointDefinitionParser$SpringEndpointImpl should try to resolve the bus using the current application context (by default name, type, whatever) and as a last fallback use the getThreadDefaultBus().

Thanks!

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


[jira] Commented: (CXF-1893) Endpoints end up at the wrong bus when initializing multiple busses in one thread

Posted by "Andreas Benneke (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1893?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12781630#action_12781630 ] 

Andreas Benneke commented on CXF-1893:
--------------------------------------

I just double checked that with version 2.2.2 the above workaround is still working.

Starting from version 2.2.4 we however get the following exception:

Caused by: java.lang.IllegalStateException: Could not register object [org.apache.cxf.bus.CXFBusImpl@1aedfde] under bean name 'cxf': there is already object [org.apache.cxf.bus.CXFBusImpl@1aedfde] bound
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.registerSingleton(DefaultSingletonBeanRegistry.java:124)
        at org.apache.cxf.bus.spring.BusDefinitionParser$BusConfig.setApplicationContext(BusDefinitionParser.java:100)
        at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:70)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:350)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1331)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
        ... 150 more

This happens with and without the above workaround.

> Endpoints end up at the wrong bus when initializing multiple busses in one thread
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-1893
>                 URL: https://issues.apache.org/jira/browse/CXF-1893
>             Project: CXF
>          Issue Type: Bug
>          Components: Bus, Core, JAX-WS Runtime
>    Affects Versions: 2.1.3
>            Reporter: Andreas Benneke
>
> We are using CXF on JBoss 4.2.3 and have an EAR with multiple WARs, each WAR having it's own cxf-bus and endpoint definition(s):
> <jaxws:endpoint
>       id="endpointId"
>       implementorClass="some.package.SomeClass"
>       implementor="#theImplementorBean"
>       wsdlLocation="service.wsdl"
>       address="/service">
>       <!-- NOTE: no bus="..." specified here! -->
> </jaxws:endpoint>
> Deploying this EAR in JBoss all endpoints end up on one single bus (the first one created) and all other busses are "empty".
> Looking into the code we found that the org.apache.cxf.jaxws.spring.EndpointDefinitionParser$SpringEndpointImpl resolves the bus (if none is injected so far) using BusFactory.getThreadDefaultBus(). This method however returns the first bus created on the current thread. 
> As JBoss initializes the whole EAR in one thread the above situation occures.
> As a workaround/solution we added a bus="cxf" to all endpoints which avoids the resolution of the bus using the thread:
> <jaxws:endpoint
>       bus="cxf" <!-- workaround -->
>       id="endpointId"
>       implementorClass="some.package.SomeClass"
>       implementor="#TheImplementorBean"
>       wsdlLocation="service.wsdl"
>       address="/service">
> </jaxws:endpoint>
> We however think, that EndpointDefinitionParser$SpringEndpointImpl should try to resolve the bus using the current application context (by default name, type, whatever) and as a last fallback use the getThreadDefaultBus().
> Thanks!

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


[jira] Commented: (CXF-1893) Endpoints end up at the wrong bus when initializing multiple busses in one thread

Posted by "Andreas Benneke (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1893?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12797051#action_12797051 ] 

Andreas Benneke commented on CXF-1893:
--------------------------------------

Well, I tried to build a proper test case for that from scratch, but could not reproduce it this way.

But the problem still exists in our larger projects and prevents us from upgrading CXF to newer versions, so I will try to strip that down - but it again will take a few days/weeks.

Thank you for your patience.

> Endpoints end up at the wrong bus when initializing multiple busses in one thread
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-1893
>                 URL: https://issues.apache.org/jira/browse/CXF-1893
>             Project: CXF
>          Issue Type: Bug
>          Components: Bus, Core, JAX-WS Runtime
>    Affects Versions: 2.1.3
>            Reporter: Andreas Benneke
>
> We are using CXF on JBoss 4.2.3 and have an EAR with multiple WARs, each WAR having it's own cxf-bus and endpoint definition(s):
> <jaxws:endpoint
>       id="endpointId"
>       implementorClass="some.package.SomeClass"
>       implementor="#theImplementorBean"
>       wsdlLocation="service.wsdl"
>       address="/service">
>       <!-- NOTE: no bus="..." specified here! -->
> </jaxws:endpoint>
> Deploying this EAR in JBoss all endpoints end up on one single bus (the first one created) and all other busses are "empty".
> Looking into the code we found that the org.apache.cxf.jaxws.spring.EndpointDefinitionParser$SpringEndpointImpl resolves the bus (if none is injected so far) using BusFactory.getThreadDefaultBus(). This method however returns the first bus created on the current thread. 
> As JBoss initializes the whole EAR in one thread the above situation occures.
> As a workaround/solution we added a bus="cxf" to all endpoints which avoids the resolution of the bus using the thread:
> <jaxws:endpoint
>       bus="cxf" <!-- workaround -->
>       id="endpointId"
>       implementorClass="some.package.SomeClass"
>       implementor="#TheImplementorBean"
>       wsdlLocation="service.wsdl"
>       address="/service">
> </jaxws:endpoint>
> We however think, that EndpointDefinitionParser$SpringEndpointImpl should try to resolve the bus using the current application context (by default name, type, whatever) and as a last fallback use the getThreadDefaultBus().
> Thanks!

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


[jira] Commented: (CXF-1893) Endpoints end up at the wrong bus when initializing multiple busses in one thread

Posted by "Andreas Benneke (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1893?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12777014#action_12777014 ] 

Andreas Benneke commented on CXF-1893:
--------------------------------------

Thanks Daniel for the feedback - I will look into it, but it might take a few days/weeks. 

> Endpoints end up at the wrong bus when initializing multiple busses in one thread
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-1893
>                 URL: https://issues.apache.org/jira/browse/CXF-1893
>             Project: CXF
>          Issue Type: Bug
>          Components: Bus, Core, JAX-WS Runtime
>    Affects Versions: 2.1.3
>            Reporter: Andreas Benneke
>
> We are using CXF on JBoss 4.2.3 and have an EAR with multiple WARs, each WAR having it's own cxf-bus and endpoint definition(s):
> <jaxws:endpoint
>       id="endpointId"
>       implementorClass="some.package.SomeClass"
>       implementor="#theImplementorBean"
>       wsdlLocation="service.wsdl"
>       address="/service">
>       <!-- NOTE: no bus="..." specified here! -->
> </jaxws:endpoint>
> Deploying this EAR in JBoss all endpoints end up on one single bus (the first one created) and all other busses are "empty".
> Looking into the code we found that the org.apache.cxf.jaxws.spring.EndpointDefinitionParser$SpringEndpointImpl resolves the bus (if none is injected so far) using BusFactory.getThreadDefaultBus(). This method however returns the first bus created on the current thread. 
> As JBoss initializes the whole EAR in one thread the above situation occures.
> As a workaround/solution we added a bus="cxf" to all endpoints which avoids the resolution of the bus using the thread:
> <jaxws:endpoint
>       bus="cxf" <!-- workaround -->
>       id="endpointId"
>       implementorClass="some.package.SomeClass"
>       implementor="#TheImplementorBean"
>       wsdlLocation="service.wsdl"
>       address="/service">
> </jaxws:endpoint>
> We however think, that EndpointDefinitionParser$SpringEndpointImpl should try to resolve the bus using the current application context (by default name, type, whatever) and as a last fallback use the getThreadDefaultBus().
> Thanks!

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


[jira] Updated: (CXF-1893) Endpoints end up at the wrong bus when initializing multiple busses in one thread

Posted by "Andreas Benneke (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-1893?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Benneke updated CXF-1893:
---------------------------------

    Affects Version/s: 2.1.3

Added CXF version in question

> Endpoints end up at the wrong bus when initializing multiple busses in one thread
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-1893
>                 URL: https://issues.apache.org/jira/browse/CXF-1893
>             Project: CXF
>          Issue Type: Bug
>          Components: Bus, Core, JAX-WS Runtime
>    Affects Versions: 2.1.3
>            Reporter: Andreas Benneke
>
> We are using CXF on JBoss 4.2.3 and have an EAR with multiple WARs, each WAR having it's own cxf-bus and endpoint definition(s):
> <jaxws:endpoint
>       id="endpointId"
>       implementorClass="some.package.SomeClass"
>       implementor="#theImplementorBean"
>       wsdlLocation="service.wsdl"
>       address="/service">
>       <!-- NOTE: no bus="..." specified here! -->
> </jaxws:endpoint>
> Deploying this EAR in JBoss all endpoints end up on one single bus (the first one created) and all other busses are "empty".
> Looking into the code we found that the org.apache.cxf.jaxws.spring.EndpointDefinitionParser$SpringEndpointImpl resolves the bus (if none is injected so far) using BusFactory.getThreadDefaultBus(). This method however returns the first bus created on the current thread. 
> As JBoss initializes the whole EAR in one thread the above situation occures.
> As a workaround/solution we added a bus="cxf" to all endpoints which avoids the resolution of the bus using the thread:
> <jaxws:endpoint
>       bus="cxf" <!-- workaround -->
>       id="endpointId"
>       implementorClass="some.package.SomeClass"
>       implementor="#TheImplementorBean"
>       wsdlLocation="service.wsdl"
>       address="/service">
> </jaxws:endpoint>
> We however think, that EndpointDefinitionParser$SpringEndpointImpl should try to resolve the bus using the current application context (by default name, type, whatever) and as a last fallback use the getThreadDefaultBus().
> Thanks!

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


[jira] Commented: (CXF-1893) Endpoints end up at the wrong bus when initializing multiple busses in one thread

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1893?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12776259#action_12776259 ] 

Daniel Kulp commented on CXF-1893:
----------------------------------

Is this still an issue with 2.1.7 or 2.2.4?    We've done quite a bit of work on the spring context stuff to get the properly configured bus injected in.   

> Endpoints end up at the wrong bus when initializing multiple busses in one thread
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-1893
>                 URL: https://issues.apache.org/jira/browse/CXF-1893
>             Project: CXF
>          Issue Type: Bug
>          Components: Bus, Core, JAX-WS Runtime
>    Affects Versions: 2.1.3
>            Reporter: Andreas Benneke
>
> We are using CXF on JBoss 4.2.3 and have an EAR with multiple WARs, each WAR having it's own cxf-bus and endpoint definition(s):
> <jaxws:endpoint
>       id="endpointId"
>       implementorClass="some.package.SomeClass"
>       implementor="#theImplementorBean"
>       wsdlLocation="service.wsdl"
>       address="/service">
>       <!-- NOTE: no bus="..." specified here! -->
> </jaxws:endpoint>
> Deploying this EAR in JBoss all endpoints end up on one single bus (the first one created) and all other busses are "empty".
> Looking into the code we found that the org.apache.cxf.jaxws.spring.EndpointDefinitionParser$SpringEndpointImpl resolves the bus (if none is injected so far) using BusFactory.getThreadDefaultBus(). This method however returns the first bus created on the current thread. 
> As JBoss initializes the whole EAR in one thread the above situation occures.
> As a workaround/solution we added a bus="cxf" to all endpoints which avoids the resolution of the bus using the thread:
> <jaxws:endpoint
>       bus="cxf" <!-- workaround -->
>       id="endpointId"
>       implementorClass="some.package.SomeClass"
>       implementor="#TheImplementorBean"
>       wsdlLocation="service.wsdl"
>       address="/service">
> </jaxws:endpoint>
> We however think, that EndpointDefinitionParser$SpringEndpointImpl should try to resolve the bus using the current application context (by default name, type, whatever) and as a last fallback use the getThreadDefaultBus().
> Thanks!

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


[jira] Commented: (CXF-1893) Endpoints end up at the wrong bus when initializing multiple busses in one thread

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1893?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12790276#action_12790276 ] 

Daniel Kulp commented on CXF-1893:
----------------------------------


Can we get a testcase for this?    I'm not able to reproduce it with the simple stuff I have.



> Endpoints end up at the wrong bus when initializing multiple busses in one thread
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-1893
>                 URL: https://issues.apache.org/jira/browse/CXF-1893
>             Project: CXF
>          Issue Type: Bug
>          Components: Bus, Core, JAX-WS Runtime
>    Affects Versions: 2.1.3
>            Reporter: Andreas Benneke
>
> We are using CXF on JBoss 4.2.3 and have an EAR with multiple WARs, each WAR having it's own cxf-bus and endpoint definition(s):
> <jaxws:endpoint
>       id="endpointId"
>       implementorClass="some.package.SomeClass"
>       implementor="#theImplementorBean"
>       wsdlLocation="service.wsdl"
>       address="/service">
>       <!-- NOTE: no bus="..." specified here! -->
> </jaxws:endpoint>
> Deploying this EAR in JBoss all endpoints end up on one single bus (the first one created) and all other busses are "empty".
> Looking into the code we found that the org.apache.cxf.jaxws.spring.EndpointDefinitionParser$SpringEndpointImpl resolves the bus (if none is injected so far) using BusFactory.getThreadDefaultBus(). This method however returns the first bus created on the current thread. 
> As JBoss initializes the whole EAR in one thread the above situation occures.
> As a workaround/solution we added a bus="cxf" to all endpoints which avoids the resolution of the bus using the thread:
> <jaxws:endpoint
>       bus="cxf" <!-- workaround -->
>       id="endpointId"
>       implementorClass="some.package.SomeClass"
>       implementor="#TheImplementorBean"
>       wsdlLocation="service.wsdl"
>       address="/service">
> </jaxws:endpoint>
> We however think, that EndpointDefinitionParser$SpringEndpointImpl should try to resolve the bus using the current application context (by default name, type, whatever) and as a last fallback use the getThreadDefaultBus().
> Thanks!

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