You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Josh Holtzman (JIRA)" <ji...@apache.org> on 2009/04/16 19:33:14 UTC

[jira] Created: (CXF-2173) ClassCastException with Declarative Services

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


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.


[jira] Updated: (CXF-2173) ClassCastException with Declarative Services

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

Josh Holtzman updated CXF-2173:
-------------------------------

    Attachment: dosgi-ds.patch

This patch seems to fix the problem, though I'm not sure whether it's 100% "correct".  Please let me know if this needs any changes prior to merging.

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


[jira] Commented: (CXF-2173) ClassCastException with Declarative Services

Posted by "Josh Holtzman (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-2173?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12705009#action_12705009 ] 

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

The latest snapshot no longer throws an exception.  However, the service properties are not read correctly from the DS configuration:

[pool-1-thread-2] INFO org.apache.cxf.endpoint.ServerImpl - Setting the server's publish address to be http://localhost:9000/org/opencastproject/sampleservice/api/SampleService
May 1, 2009 7:26:20 AM org.apache.cxf.dosgi.dsw.hooks.ServiceHookUtils getServiceProperties
INFO: service properties: {osgi.remote.configuration.type=[Ljava.lang.String;@72a60df8, osgi.remote.configuration.pojo.httpservice.context=[Ljava.lang.String;@73df4f95, osgi.remote.interfaces=[Ljava.lang.String;@49e1faa1, osgi.remote.endpoint.location=http://localhost:9000/org/opencastproject/sampleservice/api/SampleService, osgi.remote.requires.intents=[Ljava.lang.String;@130d85ec}

It's unclear whether this leads to the improper publish address (which should be on :8080, and should be registered under /samplews).

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


[jira] Commented: (CXF-2173) ClassCastException with Declarative Services

Posted by "David Bosschaert (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-2173?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12710749#action_12710749 ] 

David Bosschaert commented on CXF-2173:
---------------------------------------

Hi Josh,

I was able to reproduce the problem, but wasn't able to take your fix because it always only uses the first element in case the osgi.remote.interfaces property contains an array, while multiple values on this property are actually allowed. 
So I ended up fixing it in a slightly different way, however it should solve your problem.
It's been committed in SVN r776338 please give it a try...

David

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


[jira] Resolved: (CXF-2173) ClassCastException with Declarative Services

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

David Bosschaert resolved CXF-2173.
-----------------------------------

    Resolution: Fixed

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


[jira] Commented: (CXF-2173) ClassCastException with Declarative Services

Posted by "Josh Holtzman (JIRA)" <ji...@apache.org>.
    [ 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.


[jira] Closed: (CXF-2173) ClassCastException with Declarative Services

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

Josh Holtzman closed CXF-2173.
------------------------------


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


[jira] Reopened: (CXF-2173) ClassCastException with Declarative Services

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

David Bosschaert reopened CXF-2173:
-----------------------------------


Reopening the issue. Let me see if I can get an end-to-end case working with DS...

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


[jira] Resolved: (CXF-2173) ClassCastException with Declarative Services

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

David Bosschaert resolved CXF-2173.
-----------------------------------

    Resolution: Fixed

Fixed in r778390

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


[jira] Updated: (DOSGI-43) ClassCastException with Declarative Services

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

David Bosschaert updated DOSGI-43:
----------------------------------

    Fix Version/s: 1.2

> ClassCastException with Declarative Services
> --------------------------------------------
>
>                 Key: DOSGI-43
>                 URL: https://issues.apache.org/jira/browse/DOSGI-43
>             Project: CXF Distributed OSGi
>          Issue Type: Bug
>            Reporter: Josh Holtzman
>            Assignee: David Bosschaert
>             Fix For: 1.2
>
>         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.


[jira] Assigned: (CXF-2173) ClassCastException with Declarative Services

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

David Bosschaert reassigned CXF-2173:
-------------------------------------

    Assignee: David Bosschaert

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


[jira] Commented: (CXF-2173) ClassCastException with Declarative Services

Posted by "David Bosschaert (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-2173?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12711532#action_12711532 ] 

David Bosschaert commented on CXF-2173:
---------------------------------------

Did some more digging and found that the issue lies on the consumer side. DS (at least the implementation at Equinox) doesn't use ServiceLIsteners/ServiceTrackers to look for services. It rather uses BundleContext.getServiceReferences(), which are not covered with the ListenerHook. I think we need a FindHook to cover this case. Will try to add one as soon as I can.

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