Skip to main content

JAX-WS client and service within same VM

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
1 reply [Last post]
ak89
Offline
Joined: 2014-06-02

Hi All,

I want to implement Jax-WS client within same VM as service to enable cascading of service calls between different instances ( deployed in different servers ). Basically I want to enable my service to act as a proxy to different instance of same service based on some defined conditions.

When i initiate client inside service , JAX-WS and JAXB gives errors because of conflicting classes with same target name space. ( service implementation classes and generated stubs from wsimport have same target namespaces) . I have tried running client on separate thread with custom class-loader set as the thread's context class loader but namespace conflicts still remains. Also i tried injecting custom JAXB context while initiating client but haven't succeeded yet.

I am seeking for expert advice on method to achieve my goal. Also please provide your comments on feasibility of this as well.

( please note that this is different from a clustering scenario, service instances are managed by different set of entities and requirement is to maintain conditional communication between them )

Thank you.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
spmurphy
Offline
Joined: 2012-08-07

Hi, have you tried to customize the package for the generated Jaxb classes so the two sets are not the same?

Such as with: https://jaxb.java.net/guide/Customizing_Java_packages.html