Uploaded image for project: 'CXF Distributed OSGi (Retired)'
  1. CXF Distributed OSGi (Retired)
  2. DOSGI-81

No resource methods from RESTful Service(using jax-rs annotation)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Cannot Reproduce
    • 1.2
    • 1.3
    • provider-rs
    • None

    Description

      Summary

      • I'm developing RESTful services by using apache cxf f/w.
      • OSGi Service Bundle has a spring application context file (META-INF/spring/beans.xml).
      • The file(beans.xml) define restful services and beans.

      Situation

      • cxf-dosgi-ri-singlebundle-distribution-1.2 is driving RESTful service successfully.
      • But, cxf-dosgi-ri-multibundle-distribution-1.2 on my runtime environment(like upper environment), it makes error
      • Our project is on the latest spring f/w environment, so I had to composite with different bundles from the original bundles of cxf-dosgi-ri-multibundle-distribution-1.2

      Problem
      ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      ...

      INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@91f0de: defining beans [intentMap,nonDecoupledAddressing,AddressingPolicy,messageLogging,soap11Binding,soap12Binding]; root of factory hierarchy
      2010. 9. 29 PM 2:38:36 org.apache.cxf.dosgi.dsw.qos.IntentMap setIntents
      INFO: Injected intents:

      {addressing=org.apache.cxf.ws.policy.WSPolicyFeature@109dc35, logging=org.apache.cxf.feature.LoggingFeature@58213c, SOAP=org.apache.cxf.binding.soap.SoapBindingConfiguration@1ee04fd, SOAP.1_1=org.apache.cxf.binding.soap.SoapBindingConfiguration@1ee04fd, SOAP.1_2=org.apache.cxf.binding.soap.SoapBindingConfiguration@1898115, HTTP=PROVIDED}
      2010. 9. 29 PM 2:38:36 org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext publishContextAsOsgiServiceIfNecessary
      INFO: Not publishing application context OSGi service for bundle cxf-dosgi-ri-dsw-cxf (cxf-dosgi-ri-dsw-cxf)
      application context: OsgiBundleXmlApplicationContext(bundle=cxf-dosgi-ri-dsw-cxf, config=classpath:/OSGI-INF/cxf/intents/intent-map.xml): startup date [Wed Sep 29 14:38:34 KST 2010]; root of context hierarchy
      2010. 9. 29 PM 2:38:36 org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminCore exportService
      INFO: interfaces selected for export: [com.example.bundles.rs.IRestByExampleResource, com.example.bundles.rs.RestByExampleResouce]
      2010. 9. 29 PM 2:38:36 org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminCore exportService
      INFO: configuration types selected for export: [org.apache.cxf.rs]
      2010. 9. 29 PM 2:38:36 org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminCore exportService
      INFO: creating initial ExportDescription for interface com.example.bundles.rs.IRestByExampleResource with configuration types [org.apache.cxf.rs]
      retrieved intent map: IntentMap: {addressing=org.apache.cxf.ws.policy.WSPolicyFeature@109dc35, logging=org.apache.cxf.feature.LoggingFeature@58213c, SOAP=org.apache.cxf.binding.soap.SoapBindingConfiguration@1ee04fd, SOAP.1_1=org.apache.cxf.binding.soap.SoapBindingConfiguration@1ee04fd, SOAP.1_2=org.apache.cxf.binding.soap.SoapBindingConfiguration@1898115, HTTP=PROVIDED}

      2010. 9. 29 PM 2:38:36 org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminCore exportService
      INFO: creating initial ExportDescription for interface com.example.bundles.rs.RestByExampleResouce with configuration types [org.apache.cxf.rs]
      2010. 9. 29 PM 2:38:36 org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminCore exportService
      INFO: creating server for interface com.example.bundles.rs.IRestByExampleResource
      2010. 9. 29 PM 2:38:36 org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminCore exportService
      INFO: found handler for com.example.bundles.rs.IRestByExampleResource -> org.apache.cxf.dosgi.dsw.handlers.JaxRSPojoConfigurationTypeHandler@c5f468
      2010. 9. 29 PM 2:38:36 org.apache.cxf.dosgi.dsw.handlers.PojoConfigurationTypeHandler getPojoAddress
      INFO: Using a default address : http://xxx.xxx.xxx.xxx:9000/com/example/bundles/rs/IRestByExampleResource
      2010. 9. 29 PM 2:38:36 org.apache.cxf.dosgi.dsw.handlers.JaxRSPojoConfigurationTypeHandler createServer
      INFO: Creating a com.example.bundles.rs.IRestByExampleResource endpoint via JaxRSPojoConfigurationTypeHandler, address is http://xxx.xxx.xxx.xxx:9000/com/example/bundles/rs/IRestByExampleResource
      2010. 9. 29 PM 2:38:36 org.apache.cxf.jaxrs.utils.ResourceUtils checkMethodDispatcher
      WARN: No resource methods have been found for resource class com.example.bundles.rs.IRestByExampleResource
      2010. 9. 29 PM 2:38:37 org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean checkResources
      FATAL: No resource classes found
      Exception in thread "pool-1-thread-2" org.apache.cxf.service.factory.ServiceConstructionException
      at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:122)
      at org.apache.cxf.dosgi.dsw.handlers.JaxRSPojoConfigurationTypeHandler.createServer(JaxRSPojoConfigurationTypeHandler.java:135)
      at org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminCore.exportService(RemoteServiceAdminCore.java:244)
      at org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminInstance$1.run(RemoteServiceAdminInstance.java:78)
      at org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminInstance$1.run(RemoteServiceAdminInstance.java:1)
      at java.security.AccessController.doPrivileged(Native Method)
      at org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminInstance.exportService(RemoteServiceAdminInstance.java:71)
      at org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminInstance.exportService(RemoteServiceAdminInstance.java:1)
      at org.apache.cxf.dosgi.topologymanager.TopologyManager$2.run(TopologyManager.java:254)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)
      Caused by: javax.ws.rs.WebApplicationException
      at org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean.checkResources(AbstractJAXRSFactoryBean.java:238)
      at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:85)
      ... 11 more
      ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

      Source Java (Any Simple Service)
      ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

      import javax.ws.rs.Consumes;
      import javax.ws.rs.GET;
      import javax.ws.rs.PUT;
      import javax.ws.rs.Path;
      import javax.ws.rs.PathParam;
      import javax.ws.rs.Produces;

      @Path("/Bundle01/")
      public class Bundle01RS{

      @GET
      public String getYourName()

      { return "ABC"; }

      }

      ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

      Service Definition (META-INF/spirng/beans.xml)
      ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

      <?xml version="1.0" encoding="UTF-8"?>
      <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:osgi="http://www.springframework.org/schema/osgi" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi-1.2.xsd">
      <osgi:service auto-export="all-classes">
      <osgi:service-properties>
      <entry key="service.exported.interfaces" value="*" />
      <entry key="service.exported.configs" value="org.apache.cxf.rs" />
      </osgi:service-properties>
      <bean class="com.example.bundles.rs.Bundle01RS"/>
      </osgi:service>
      </beans>

      ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

      Attachments

        Activity

          People

            sergey_beryozkin Sergey Beryozkin
            elseman Seungho Lee
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 336h
                336h
                Remaining:
                Remaining Estimate - 336h
                336h
                Logged:
                Time Spent - Not Specified
                Not Specified