[ https://issues.apache.org/jira/browse/DOSGI-81?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12921425#action_12921425 ]
Sergey Beryozkin commented on DOSGI-81: --------------------------------------- Hi Philippe, sorry for a delay. Have you made it working without applying an external model ? I think the problem in the single bundle case is that either annotations are not visible, i,e, the app bundle is not importing them or you have some a complex interface with annotations being possibly spread across few interfaces - if the latter is yes then please post a sample ? Otherwise it is beyond the control of DOSGI and CXF Now, I have a 'suspicion' though why we have a failing case in the multibundle case. Seungho, did you make it work ? I can see few jersey bundles - thus it won't obviosly work with CXF. Besides, CXF 2.2.9 depends on JAXRS 1.0 while I can see a JAXRS 1.1.1 bundle. As a side note to the dev : we probably should submit a JAXRS 1.1.1 bundle pom to the servicemix bundles project because I suspect javax.ws.rs.jsr311-api_1.1.1 does not deal with OSGI Locator. ServiceMix jsr311-api_1.1 may work ok with CXF 2.3. I'll close this JIRA once I submit a patch to ServiceMIx > No resource methods from RESTful Service(using jax-rs annotation) > ----------------------------------------------------------------- > > Key: DOSGI-81 > URL: https://issues.apache.org/jira/browse/DOSGI-81 > Project: CXF Distributed OSGi > Issue Type: Bug > Components: REST > Affects Versions: 1.2 > Environment: Main Environment > Equinox(org.eclipse.osgi_3.5.2.R35x_v20100126) > CXF(cxf-dosgi-ri-multibundle-distribution-1.2) > SpringDM(org.springframework.osgi.io_2.0.0.M1) > Jersey(com.sun.jersey.jersey-core_1.4.0) > Detail Runtime Environment > Framework is launched. > id State Bundle > 0 ACTIVE org.eclipse.osgi_3.5.2.R35x_v20100126 > Fragments=39, 66 > 1 ACTIVE com.sun.jersey.jersey-server_1.4.0 > 2 ACTIVE org.apache.xml.resolver_1.2.0.v200902170519 > 3 ACTIVE slf4j.api_1.6.1 > Fragments=38 > 4 ACTIVE cxf-dosgi-ri-discovery-distributed_1.2.0 > 5 ACTIVE jackson-xc_1.5.5 > 6 ACTIVE org.jdom_1.0.0.v200806100616 > 7 ACTIVE org.springframework.osgi.web_2.0.0.M1 > 8 ACTIVE jackson-core-asl_1.5.5 > 9 ACTIVE com.springsource.javax.servlet_2.5.0 > 10 ACTIVE org.apache.servicemix.bundles.commons-pool_1.5.4.1 > 11 ACTIVE com.springsource.org.apache.commons.logging_1.1.1 > 12 ACTIVE org.osgi.compendium_4.2.0.200908310645 > 13 ACTIVE org.springframework.core_3.0.4.RELEASE > 14 ACTIVE org.springframework.asm_3.0.4.RELEASE > 15 ACTIVE org.apache.servicemix.bundles.xmlresolver_1.2.0.1 > 16 ACTIVE com.sun.jersey.jersey-json_1.4.0 > 17 ACTIVE jackson-mapper-asl_1.5.5 > 18 ACTIVE org.apache.servicemix.bundles.wsdl4j_1.6.1.1 > 19 ACTIVE org.apache.servicemix.specs.saaj-api-1.3_1.3.0 > 20 ACTIVE com.sun.jersey.jersey-core_1.4.0 > 21 ACTIVE org.apache.cxf.bundle-minimal_2.2.9 > 22 ACTIVE org.springframework.expression_3.0.4.RELEASE > 23 ACTIVE org.apache.felix.fileinstall_1.0.0 > 24 ACTIVE com.springsource.javax.mail_1.4.0 > 25 ACTIVE org.apache.servicemix.specs.jaxb-api-2.1_1.3.0 > 26 ACTIVE org.apache.servicemix.bundles.neethi_2.0.4.1 > 27 ACTIVE org.springframework.osgi.extender_2.0.0.M1 > 28 ACTIVE org.apache.log4j_1.2.13.v200903072027 > 29 ACTIVE javax.ws.rs.jsr311-api_1.1.1 > 30 ACTIVE cxf-dosgi-ri-dsw-cxf_1.2.10 > 31 ACTIVE org.apache.servicemix.specs.jaxws-api-2.1_1.3.0 > 32 ACTIVE org.eclipse.osgi.services_3.2.0.v20090520-1800 > 33 ACTIVE jackson-jaxrs_1.5.5 > 34 ACTIVE com.springsource.org.aopalliance_1.0.0 > 35 ACTIVE com.springsource.javax.xml.soap_1.3.0 > 36 ACTIVE org.hamcrest.core_1.1.0.v20090501071000 > 37 ACTIVE org.codehaus.jettison.jettison_1.1.0 > 38 RESOLVED slf4j.jcl_1.6.1 > Master=3 > 39 RESOLVED javax.transaction_1.1.1.v201002111330 > Master=0 > 40 ACTIVE org.apache.servicemix.bundles.xmlschema_1.4.3.1 > 41 ACTIVE javax.activation_1.1.0.v200906290531 > 42 ACTIVE org.springframework.context_3.0.4.RELEASE > 43 ACTIVE cxf-dosgi-ri-topology-manager_1.2.0 > 44 ACTIVE org.springframework.context.support_3.0.4.RELEASE > 45 ACTIVE org.junit4_4.5.0.v20090824 > 46 ACTIVE cxf-dosgi-ri-discovery-local_1.2.0 > 47 ACTIVE org.springframework.aop_3.0.4.RELEASE > 48 ACTIVE org.springframework.osgi.io_2.0.0.M1 > 49 ACTIVE org.apache.commons.lang_2.3.0.v201005080501 > 50 ACTIVE TestRS_1.0.0.qualifier > 51 ACTIVE javax.wsdl_1.5.1.v200806030408 > 52 ACTIVE org.ops4j.pax.web.service_0.5.1 > 53 ACTIVE org.apache.servicemix.bundles.woodstox_3.2.7.1 > 54 ACTIVE org.apache.servicemix.specs.stax-api-1.0_1.3.0 > 55 ACTIVE org.springframework.osgi.core_2.0.0.M1 > 56 ACTIVE cxf-dosgi-ri-discovery-distributed-zookeeper-wrapper_1.2.0 > 57 ACTIVE org.springframework.beans_3.0.4.RELEASE > 58 ACTIVE javax.servlet_2.5.0.v200806031605 > 59 ACTIVE org.apache.ws.commons.schema_1.4.2.v200905291151 > 60 ACTIVE com.sun.jersey.jersey-client_1.4.0 > 61 ACTIVE org.mortbay.jetty.util_6.1.15.v200905182336 > 62 ACTIVE com.springsource.org.jdom_1.1.0 > 63 ACTIVE com.springsource.javax.xml.stream_1.0.1 > 64 ACTIVE org.apache.servicemix.bundles.jaxb-impl_2.1.6.1 > 65 ACTIVE org.objectweb.asm_3.1.0.v200803061910 > 66 RESOLVED > org.eclipse.persistence.jpa.equinox.weaving_1.1.3.v20091002-r5404 > Master=0 > 67 ACTIVE org.springframework.aspects_3.0.4.RELEASE > 68 ACTIVE org.apache.servicemix.bundles.xmlsec_1.3.0.1 > 69 ACTIVE org.apache.felix.configadmin_1.0.10 > 70 ACTIVE org.mortbay.jetty.server_6.1.15.v200905151201 > Reporter: Seungho Lee > Priority: Critical > Original Estimate: 336h > Remaining Estimate: 336h > > 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.defaultlistablebeanfact...@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.wspolicyfeat...@109dc35, > logging=org.apache.cxf.feature.loggingfeat...@58213c, > soap=org.apache.cxf.binding.soap.soapbindingconfigurat...@1ee04fd, > soap.1_1=org.apache.cxf.binding.soap.soapbindingconfigurat...@1ee04fd, > soap.1_2=org.apache.cxf.binding.soap.soapbindingconfigurat...@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.wspolicyfeat...@109dc35, > logging=org.apache.cxf.feature.loggingfeat...@58213c, > soap=org.apache.cxf.binding.soap.soapbindingconfigurat...@1ee04fd, > soap.1_1=org.apache.cxf.binding.soap.soapbindingconfigurat...@1ee04fd, > soap.1_2=org.apache.cxf.binding.soap.soapbindingconfigurat...@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.jaxrspojoconfigurationtypehand...@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> > ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.