[ 
https://issues.apache.org/jira/browse/CXF-2173?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12710829#action_12710829
 ] 

Josh Holtzman commented on CXF-2173:
------------------------------------

Thanks David.  Unfortunately, DS is still not working for me.  I think the 
problem is in ServiceHookUtils.getServiceProperties(ServiceEndpointDescription 
sd).

This method assumes that the service description's getProperty(String key) 
returns an object with a meaningful toString().  When using DS, the object is 
an array, leading to invalid service properties such as 
osgi.remote.configuration.type=[Ljava.lang.String;@25d6536d.  This leads to 
CxfPublishHook.publishEndpoint() using defaults rather than the service 
properties configured through DS.

How should CXF deal with serviceDescriptions when getProperty() returns an 
array?

> ClassCastException with Declarative Services
> --------------------------------------------
>
>                 Key: CXF-2173
>                 URL: https://issues.apache.org/jira/browse/CXF-2173
>             Project: CXF
>          Issue Type: Bug
>          Components: Distributed-OSGi
>            Reporter: Josh Holtzman
>            Assignee: David Bosschaert
>         Attachments: dosgi-ds.patch
>
>
> When trying to configure a DOSGI service using declarative services, the 
> following exception is thrown:
> Exception in thread "pool-1-thread-2" java.lang.ClassCastException: 
> [Ljava.lang.String; cannot be cast to java.lang.String
>       at 
> org.apache.cxf.dosgi.dsw.OsgiUtils.getPublishableInterfaces(OsgiUtils.java:470)
>       at 
> org.apache.cxf.dosgi.dsw.hooks.CxfPublishHook.publishEndpoint(CxfPublishHook.java:68)
>       at org.apache.cxf.dosgi.dsw.Activator$1.run(Activator.java:143)
>       at 
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>       at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>       at java.lang.Thread.run(Thread.java:637)
> The OSGI/sample.xml file contains:
> <?xml version="1.0" encoding="UTF-8"?>
> <component name="sample" immediate="true">
>   <implementation class="...SampleServiceImpl"/>
>   <property name="service.description" value="Sample Service" />
>   <property name="osgi.remote.interfaces">*</property>
>   <property name="osgi.remote.requires.intents">SOAP.1_2</property>
>   <property name="osgi.remote.configuration.type">pojo</property>
>   <property 
> name="osgi.remote.configuration.pojo.httpservice.context">/samplews</property>
>   <service>
>     <provide interface="...SampleService"/>
>   </service>
> </component>

-- 
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