Deeply, this difference of handling logic is caused by a config prop
called "org.apache.cxf.rs.httpservice.context".

While org.apache.cxf.rs.httpservice.context is not null(specified by
user),  HttpServiceManager.getHttpService() will be called.

However, in greeter demo, the prop is not specified.

Pl. seeing JaxRSPojoConfigurationTypeHandler 123 line

Thanks
--Tang

Tang Yong wrote:
> Maybe you can ask why greeter demo can work normally using http service?
> 
> The reason is that handling logics of jax ws and jax rs scenes are
> different.
> 
> In jax rs scene, http service is obtained by
> HttpServiceManager.getHttpService() , and needing a http service impl is
> registered into OSGi registry ahead of time.
> 
> However,in jax ws scene, http server with jax ws endpoint is created
> using AbstractPojoConfigurationTypeHandler.createServerFromFactory.
> 
> So, if you do not specify an activator(eg. from
> pax-web-jetty-1.0.11.jar) in activators.list which can register a http
> service impl, HttpServiceManager.getHttpService() will be failed.
> 
> Thanks
> --Tang
> 
> Tang Yong wrote:
>> Then, I added org.ops4j.pax.web.service.jetty.internal.Activator into
>> activators.list and re-launched felix and installed/started greeter_rest
>> demo, now the exception does not happen,
>>
>> D:\gf\org.apache.felix.main.distribution-4.0.3_1\felix-framework-4.0.3>java
>> -jar bin\felix.jar
>> ____________________________
>> Welcome to Apache Felix Gogo
>>
>> g! install file:/d:/gf/org.osgi.compendium-4.2.0.jar
>> Bundle ID: 6
>> g! start file:/d:/gf/cxf-dosgi-ri-singlebundle-distribution-1.4-SNAPSHOT.jar
>> g! log4j:WARN No appenders could be found for logger
>> (org.apache.zookeeper.ZooKeeper).
>> log4j:WARN Please initialize the log4j system properly.
>> 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-impl-1.4-SNAPSHOT.jar
>> g! 12 21, 2012 12:17:00 午後 org.apache.cxf.endpoint.ServerImpl
>> initDestination
>> INFO: Setting the server's publish address to be
>> /org/apache/cxf/dosgi/samples/greeter/rest/GreeterService
>> 12 21, 2012 12:17:00 午後 org.apache.cxf.endpoint.ServerImpl initDestination
>> INFO: Setting the server's publish address to be
>> /org/apache/cxf/dosgi/samples/greeter/rest/GreeterService2
>>
>> So, please team confirmed the issue.
>>
>> Thanks
>> --Tang
>>
>> Tang Yong wrote:
>>> I have done a initial investigation on the exception,
>>> Apparently, not any HttpService impl is registered.
>>>
>>> Although in activators.list,
>>> org.ops4j.pax.web.service.internal.Activator is written, whether having
>>> other reqiured activator(for example,
>>> org.ops4j.pax.web.service.jetty.internal.Activator) used for registering
>>> a HttpService impl is missing or not?
>>>
>>> Thanks
>>> --Tang
>>>
>>> Tang Yong wrote:
>>>> In addition,
>>>>
>>>> Does not the exception happened while trigging
>>>> https://issues.apache.org/jira/browse/DOSGI-145?
>>>>
>>>> Thanks
>>>> --Tang
>>>>
>>>> Tang Yong wrote:
>>>>> Hi Team,
>>>>>
>>>>> About Distributed OSGi greeter_rest demo[1],
>>>>> [1]: http://cxf.apache.org/distributed-osgi.html
>>>>>
>>>>> here there are some problems:
>>>>>
>>>>> 1 link[2] of greeter_rest demo is not right
>>>>> [2]: http://cxf.apache.org/distributed-osgi-greeter-demo-walkthrough.html
>>>>>
>>>>> 2 about greeter_rest demo[3]'s running
>>>>> [3]: http://svn.apache.org/repos/asf/cxf/dosgi/trunk/samples/greeter_rest
>>>>>
>>>>> Using the following steps, while installing and starting
>>>>> cxf-dosgi-ri-samples-greeter-rest-impl-1.4-SNAPSHOT.jar, an exception
>>>>> happened:
>>>>>
>>>>> ____________________________
>>>>> Welcome to Apache Felix Gogo
>>>>>
>>>>> g! lb
>>>>> 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)
>>>>> g! install file:/d:/gf/org.osgi.compendium-4.2.0.jar
>>>>> Bundle ID: 6
>>>>> g! lb
>>>>> 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|Installed  |    1|osgi.cmpn (4.2.0.200908310645)
>>>>> g! start 
>>>>> file:/d:/gf/cxf-dosgi-ri-singlebundle-distribution-1.4-SNAPSHOT.jar
>>>>> g! log4j:WARN No appenders could be found for logger
>>>>> (org.apache.zookeeper.ZooKeeper).
>>>>> log4j:WARN Please initialize the log4j system properly.
>>>>> lb
>>>>> 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-impl-1.4-SNAPSHOT.jar
>>>>> g! Exception in thread "pool-1-thread-2"
>>>>> org.osgi.framework.ServiceException: CXF DOSGi: problem registering CXF
>>>>> HTTP Servlet
>>>>> Exception in thread "pool-1-thread-1"   at
>>>>> org.apache.cxf.dosgi.dsw.handlers.HttpServiceManager.registerServletAndGetBus(HttpServiceManager.java:84)
>>>>>         at
>>>>> org.apache.cxf.dosgi.dsw.handlers.JaxRSPojoConfigurationTypeHandler.createServer(JaxRSPojoConfigurationTypeHandler.java:123)
>>>>>         at
>>>>> org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminCore.exportService(RemoteServiceAdminCore.java:123)
>>>>>         at
>>>>> org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminInstance$1.run(RemoteServiceAdminInstance.java:70)
>>>>>         at
>>>>> org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminInstance$1.run(RemoteServiceAdminInstance.java:64)
>>>>>         at java.security.AccessController.doPrivileged(Native Method)
>>>>>         at
>>>>> org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminInstance.exportService(RemoteServiceAdminInstance.java:64)
>>>>>         at
>>>>> org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminInstance.exportService(RemoteServiceAdminInstance.java:37)
>>>>>         at
>>>>> org.apache.cxf.dosgi.topologymanager.exporter.TopologyManagerExport.doExportService(TopologyManagerExport.java:250)
>>>>>         at
>>>>> org.apache.cxf.dosgi.topologymanager.exporter.TopologyManagerExport.access$200(TopologyManagerExport.java:51)
>>>>>         at
>>>>> org.apache.cxf.dosgi.topologymanager.exporter.TopologyManagerExport$3.run(TopologyManagerExport.java:214)
>>>>>         at
>>>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
>>>>>         at
>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
>>>>>         at java.lang.Thread.run(Thread.java:722)
>>>>> Caused by: java.lang.RuntimeException: No HTTPService found
>>>>>         at
>>>>> org.apache.cxf.dosgi.dsw.handlers.HttpServiceManager.getHttpService(HttpServiceManager.java:92)
>>>>>         at
>>>>> org.apache.cxf.dosgi.dsw.handlers.HttpServiceManager.registerServletAndGetBus(HttpServiceManager.java:77)
>>>>>         ... 13 more
>>>>> org.osgi.framework.ServiceException: CXF DOSGi: problem registering CXF
>>>>> HTTP Servlet
>>>>>         at
>>>>> org.apache.cxf.dosgi.dsw.handlers.HttpServiceManager.registerServletAndGetBus(HttpServiceManager.java:84)
>>>>>         at
>>>>> org.apache.cxf.dosgi.dsw.handlers.JaxRSPojoConfigurationTypeHandler.createServer(JaxRSPojoConfigurationTypeHandler.java:123)
>>>>>         at
>>>>> org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminCore.exportService(RemoteServiceAdminCore.java:123)
>>>>>         at
>>>>> org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminInstance$1.run(RemoteServiceAdminInstance.java:70)
>>>>>         at
>>>>> org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminInstance$1.run(RemoteServiceAdminInstance.java:64)
>>>>>         at java.security.AccessController.doPrivileged(Native Method)
>>>>>         at
>>>>> org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminInstance.exportService(RemoteServiceAdminInstance.java:64)
>>>>>         at
>>>>> org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminInstance.exportService(RemoteServiceAdminInstance.java:37)
>>>>>         at
>>>>> org.apache.cxf.dosgi.topologymanager.exporter.TopologyManagerExport.doExportService(TopologyManagerExport.java:250)
>>>>>         at
>>>>> org.apache.cxf.dosgi.topologymanager.exporter.TopologyManagerExport.access$200(TopologyManagerExport.java:51)
>>>>>         at
>>>>> org.apache.cxf.dosgi.topologymanager.exporter.TopologyManagerExport$3.run(TopologyManagerExport.java:214)
>>>>>         at
>>>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
>>>>>         at
>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
>>>>>         at java.lang.Thread.run(Thread.java:722)
>>>>> Caused by: java.lang.RuntimeException: No HTTPService found
>>>>>         at
>>>>> org.apache.cxf.dosgi.dsw.handlers.HttpServiceManager.getHttpService(HttpServiceManager.java:92)
>>>>>         at
>>>>> org.apache.cxf.dosgi.dsw.handlers.HttpServiceManager.registerServletAndGetBus(HttpServiceManager.java:77)
>>>>>         ... 13 more
>>>>> gosh: stopping framework
>>>>>
>>>>>
>>>>>
>>>
>>
>>
> 
> 
> 


Reply via email to