Uploaded image for project: 'JBoss Enterprise Application Platform 4 and 5'
  1. JBoss Enterprise Application Platform 4 and 5
  2. JBPAPP-6249

JAXWS client running in-container re-uses server default bus

XMLWordPrintable

    • Hide

      A ws client deployed on server side can prevent this issue by creating a new Bus instance for the current thread before going through the JAXWS ServiceDelegate.

      Bar.java
      Bus orig = BusFactory.getThreadDefaultBus(false);
      if (orig == null)
      {
        Bus bus = BusFactory.newInstance().createBus(); //this also sets the thread local bus internally as it's not set yet
      }
      
      Service service = new Service(..);
      service.getPort(..);
      ...
      
      Show
      A ws client deployed on server side can prevent this issue by creating a new Bus instance for the current thread before going through the JAXWS ServiceDelegate. Bar.java Bus orig = BusFactory.getThreadDefaultBus( false ); if (orig == null ) { Bus bus = BusFactory.newInstance().createBus(); // this also sets the thread local bus internally as it's not set yet } Service service = new Service(..); service.getPort(..); ...
    • Hide
      The JBossWS-CXF JAXWS client relies on the CXF ProviderImpl which requires a Bus instance. Unless a Bus was associated with the current thread, the Bus retrieval process returned the Bus instance that was created for the server. Now a customized Provider implementation creates a new Bus instance for the client and the Bus request returns this Bus instance.

      Show
      The JBossWS-CXF JAXWS client relies on the CXF ProviderImpl which requires a Bus instance. Unless a Bus was associated with the current thread, the Bus retrieval process returned the Bus instance that was created for the server. Now a customized Provider implementation creates a new Bus instance for the client and the Bus request returns this Bus instance.
    • Documented as Resolved Issue

      The JBossWS-CXF / Apache CXF jaxws client requires a bus instance. That is provided by the CXF ProviderImpl which looks for the current thread associated bus calling BusFactory.getThreadDefaultBus(). Unfortunately, whenever the current thread is not associated yet with a Bus instance, that falls back to looking for the VM default bus before deciding to actually create a new bus instance. A new bus is actually created only if both thread and VM default bus are not available.
      This can lead to many potential side effects. One of the more evident, even if not very critical, is the re-use of server side only bus customizations for address rewriting when the default bus has been set deploying a ws endpoint.

              rhn-support-asoldano Alessio Soldano
              rhn-support-asoldano Alessio Soldano
              Eva Kopalova Eva Kopalova (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: