[ 
https://issues.apache.org/jira/browse/DOSGI-145?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13537653#comment-13537653
 ] 

TangYong commented on DOSGI-145:
--------------------------------

I think that I have triggered the issue after I installed and started 
greeter_rest client, once accessing the two endpoints from the client, the 
following exception happened:

START LEVEL 1
   ID|State      |Level|Name
    0|Active     |    0|System Bundle (4.0.3)
    1|Active     |    1|Apache Log4J (1.2.15)
    2|Active     |    1|Apache Felix Bundle Repository (1.6.6)
    3|Active     |    1|Apache Felix Gogo Command (0.12.0)
    4|Active     |    1|Apache Felix Gogo Runtime (0.10.0)
    5|Active     |    1|Apache Felix Gogo Shell (0.10.0)
    6|Resolved   |    1|osgi.cmpn (4.2.0.200908310645)
    7|Active     |    1|Distributed OSGi Distribution Software Single-Bundle 
Distribution (1.4.0.SNAPSHOT)
g! start 
file:/d:/gf/cxf-dosgi-ri-samples-greeter-rest-interface-1.4-SNAPSHOT.jar
g! start file:/d:/gf/cxf-dosgi-ri-samples-greeter-rest-client-1.4-SNAPSHOT.jar
g! *** Opening greeter client dialog ***
*** Opening greeter2 client dialog ***
*** Invoking greeter2 ***
Exception in thread "Thread-18" org.osgi.framework.ServiceException: REMOTE
        at 
org.apache.cxf.dosgi.dsw.handlers.ServiceInvocationHandler.invoke(ServiceInvocationHandler.java:82)
        at $Proxy19.greetMe(Unknown Source)
        at 
org.apache.cxf.dosgi.samples.greeter.client.rest.Activator.greeter2UI(Activator.java:125)
        at 
org.apache.cxf.dosgi.samples.greeter.client.rest.Activator.access$100(Activator.java:33)
        at 
org.apache.cxf.dosgi.samples.greeter.client.rest.Activator$4.run(Activator.java:87)
        at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at 
org.apache.cxf.dosgi.dsw.handlers.ServiceInvocationHandler$1.run(ServiceInvocationHandler.java:63)
        at java.security.AccessController.doPrivileged(Native Method)
        at 
org.apache.cxf.dosgi.dsw.handlers.ServiceInvocationHandler.invoke(ServiceInvocationHandler.java:61)
        ... 5 more
Caused by: javax.ws.rs.NotFoundException
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
        at 
org.apache.cxf.jaxrs.client.AbstractClient.convertToWebApplicationException(AbstractClient.java:425)
        at 
org.apache.cxf.jaxrs.client.ClientProxyImpl.checkResponse(ClientProxyImpl.java:290)
        at 
org.apache.cxf.jaxrs.client.ClientProxyImpl.handleResponse(ClientProxyImpl.java:582)
        at 
org.apache.cxf.jaxrs.client.ClientProxyImpl.doChainedInvocation(ClientProxyImpl.java:548)
        at 
org.apache.cxf.jaxrs.client.ClientProxyImpl.invoke(ClientProxyImpl.java:205)
        at $Proxy18.greetMe(Unknown Source)
        ... 12 more
*** Invoking greeter ***
Exception in thread "Thread-17" org.osgi.framework.ServiceException: REMOTE
        at 
org.apache.cxf.dosgi.dsw.handlers.ServiceInvocationHandler.invoke(ServiceInvocationHandler.java:82)
        at $Proxy17.greetMe(Unknown Source)
        at 
org.apache.cxf.dosgi.samples.greeter.client.rest.Activator.greeterUI(Activator.java:102)
        at 
org.apache.cxf.dosgi.samples.greeter.client.rest.Activator.access$000(Activator.java:33)
        at 
org.apache.cxf.dosgi.samples.greeter.client.rest.Activator$3.run(Activator.java:72)
        at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at 
org.apache.cxf.dosgi.dsw.handlers.ServiceInvocationHandler$1.run(ServiceInvocationHandler.java:63)
        at java.security.AccessController.doPrivileged(Native Method)
        at 
org.apache.cxf.dosgi.dsw.handlers.ServiceInvocationHandler.invoke(ServiceInvocationHandler.java:61)
        ... 5 more
Caused by: javax.ws.rs.NotFoundException
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
        at 
org.apache.cxf.jaxrs.client.AbstractClient.convertToWebApplicationException(AbstractClient.java:425)
        at 
org.apache.cxf.jaxrs.client.ClientProxyImpl.checkResponse(ClientProxyImpl.java:290)
        at 
org.apache.cxf.jaxrs.client.ClientProxyImpl.handleResponse(ClientProxyImpl.java:582)
        at 
org.apache.cxf.jaxrs.client.ClientProxyImpl.doChainedInvocation(ClientProxyImpl.java:548)
        at 
org.apache.cxf.jaxrs.client.ClientProxyImpl.invoke(ClientProxyImpl.java:205)
        at $Proxy16.greetMe(Unknown Source)
        ... 12 more

                
> Multiple services using HTTP Service and published from the same bundle do 
> not work 
> ------------------------------------------------------------------------------------
>
>                 Key: DOSGI-145
>                 URL: https://issues.apache.org/jira/browse/DOSGI-145
>             Project: CXF Distributed OSGi
>          Issue Type: Bug
>          Components: DSW
>            Reporter: Sergey Beryozkin
>             Fix For: 1.4
>
>
> This issue was reported at the CXF users list and now is reproducible on the 
> trunk.
> Consider the following activator code:
> {code:java}
> public class Activator implements BundleActivator {
>     private ServiceRegistration registration;
>     private ServiceRegistration registration2;
>     public void start(BundleContext bc) throws Exception {
>         Dictionary props = getProperties("/greeter");
>         registration = bc.registerService(GreeterService.class.getName(), 
>                                           new GreeterServiceImpl(), props);
>         
>         props = getProperties("/greeter2");
>         registration2 = bc.registerService(GreeterService2.class.getName(), 
>                                           new GreeterServiceImpl2(), props);
>         
>     }
>     private Dictionary getProperties(String address) { 
>       Dictionary props = new Hashtable();
>         props.put("service.exported.interfaces", "*");
>         props.put("service.exported.configs", "org.apache.cxf.rs");
>         props.put("service.exported.intents", "HTTP");
>         props.put("org.apache.cxf.rs.httpservice.context", address);
>         return props;
>     }
>     
>     public void stop(BundleContext bc) throws Exception {
>         registration.unregister();
>         registration2.unregister();
>     }
> }
> {code}
> This is RS activator code but the issue will show itself for WS endpoints too.
> After the deployment, requesting a service at "/greeter" will make 
> "/greeter2" endpoint not accessible and the other way around.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to