cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Georgi Dimitrov <...@abv.bg>
Subject Re: Re: Re: CXF Distributed OSGI and RESTful
Date Wed, 19 May 2010 13:29:38 GMT
 
Hi Sergey,

thank you for your help despite my lack of experience :)

I have checked out from svn the samples dir (that is somewhere inside ...cxf/dosgi/)
Then I browsed into the folder greeter_rest and ran "mvn" without arguments. It created the
target bundles:
cxf-dosgi-ri-samples-greeter-rest-interface-1.1.jar
cxf-dosgi-ri-samples-greeter-rest-impl-1.1.jar

I have edited the Activator.java class to and changed the port (eg. localhost:23990) to match
my configuration.

After I started my OSGI Environment I went to the osgi console and verified that the both
bundles are up and running:

----------------------------------------------------
osgi> bundle 209
cxf-dosgi-ri-samples-greeter-rest-impl_1.1.0 [209]

 Id=209, Status=ACTIVE




 Data Root=/home/dimitrov/Work/workspace/eclipse/finca/installation.server/tmp/gui/configuration/org.eclipse.osgi/bundles/209/data

 Registered Services



 {org.apache.cxf.dosgi.samples.greeter.rest.GreeterService}={org.apache.cxf.rs.databinding=aegis,
service.exported.intents=HTTP, org.apache.cxf.rs.address=http://localhost:23990/greeter, service.exported.configs=org.apache.cxf.rs,
service.exported.interfaces=*, service.id=157}



 {org.apache.cxf.dosgi.samples.greeter.rest.GreeterService2}={org.apache.cxf.rs.databinding=aegis,
service.exported.intents=HTTP, org.apache.cxf.rs.address=http://localhost:23990/greeter2,
service.exported.configs=org.apache.cxf.rs, service.exported.interfaces=*, service.id=158}

 Services in use:



 {org.apache.cxf.dosgi.dsw.decorator.ServiceDecorator}={service.id=51}

 No exported packages

 Imported packages



 org.apache.cxf.dosgi.samples.greeter.rest; version="0.0.0" 



 org.osgi.framework; version="1.5.0" 

 No fragment bundles

 Named class space



 cxf-dosgi-ri-samples-greeter-rest-impl; bundle-version="1.1.0"[provided]

 No required bundles

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

This means that everything is OK with the greeter_rest bundle. And I have 2 Services - greeter
and greeter2 Well so far so good. However when I go to the URL for the RESTful version of
a service like for example: http://localhost:23990/greeter i get:

 HTTP ERROR: 404  ProxyServlet: /greeter 

RequestURI=/greeter 
   Powered by Jetty://    
 I've not described greeter in the sd.xml (since its Activator does that in the props it writes
- am I right?). I however described the greeter2 in sd.xml like so:






  



  









 <add-property name="service.exported.interfaces"











 value="org.apache.cxf.dosgi.samples.greeter.rest.GreeterService2" />










  








 








  









  








  





  
 

Then when I go to: http://localhost:23990/greeter2 i get:

XML Parsing Error: no element found
Location: http://localhost:23990/greeter2
Line Number 1, Column 1:
^
I sniffed on interface lo with wireshark and it is this that I saw: 

`@]/~03
l`l`VHTTP/1.1 404 Not Found
Content-Type: text/xml
Date: Wed, 19 May 2010 11:45:51 GMT
Content-Length: 0
Server: Jetty(6.1.x)

SO STILL NOT FOUND 404 .... but with error.

I feel like I am missing something! But what? Could you list all bundles that I need to have
in my config.ini (in my OSGI Environment) in order for the RESTful Services to eb exposed
correctly?
This is my current config.ini (only the cxfdosgi related part):

---------------------------------------------------------------------
osgi.bundles=



 ../../../jars/org.apache.cxf/com.springsource.org.apache.commons.logging-1.1.1.jar@start,
\

 ../../../jars/org.apache.cxf/pax-web-service-0.5.1.jar@start, \

 ../../../jars/org.apache.cxf/geronimo-annotation_1.0_spec-1.1.1.jar@start, \

 ../../../jars/org.apache.cxf/geronimo-activation_1.1_spec-1.0.2.jar@start, \

 ../../../jars/org.apache.cxf/geronimo-javamail_1.4_spec-1.2.jar@start, \

 ../../../jars/org.apache.cxf/geronimo-ws-metadata_2.0_spec-1.1.2.jar@start, \

 ../../../jars/org.apache.cxf/com.springsource.org.jdom-1.0.0.jar@start, \

 ../../../jars/org.apache.cxf/spring-core-2.5.6.jar@start, \

 ../../../jars/org.apache.cxf/spring-beans-2.5.6.jar@start, \

 ../../../jars/org.apache.cxf/spring-context-2.5.6.jar@start, \

 ../../../jars/org.apache.cxf/com.springsource.org.aopalliance-1.0.0.jar@start, \

 ../../../jars/org.apache.cxf/spring-aop-2.5.6.jar@start, \

 ../../../jars/org.apache.cxf/spring-osgi-io-1.2.0.jar@start, \

 ../../../jars/org.apache.cxf/spring-osgi-core-1.2.0.jar@start, \

 ../../../jars/org.apache.cxf/spring-osgi-extender-1.2.0.jar@start, \

 ../../../jars/org.apache.cxf/org.apache.servicemix.bundles.jaxb-impl-2.1.6_1.jar@3:start,
\

 ../../../jars/org.apache.cxf/org.apache.servicemix.bundles.wsdl4j-1.6.1_1.jar@3:start, \

 ../../../jars/org.apache.cxf/org.apache.servicemix.bundles.xmlsec-1.3.0_1.jar@3:start, \

 ../../../jars/org.apache.cxf/org.apache.servicemix.bundles.xmlschema-1.4.3_1.jar@3:start,
\

 ../../../jars/org.apache.cxf/org.apache.servicemix.bundles.asm-2.2.3_1.jar@3:start, \

 ../../../jars/org.apache.cxf/org.apache.servicemix.bundles.xmlresolver-1.2_1.jar@3:start,
\

 ../../../jars/org.apache.cxf/org.apache.servicemix.bundles.neethi-2.0.4_1.jar@3:start, \

 ../../../jars/org.apache.cxf/org.apache.servicemix.bundles.woodstox-3.2.7_1.jar@3:start,
\

 ../../../jars/org.apache.cxf/cxf-bundle-minimal-2.2.4.jar@3:start, \

 ../../../jars/org.apache.cxf/org.apache.servicemix.specs.saaj-api-1.3-1.3.0.jar@3:start,
\

 ../../../jars/org.apache.cxf/org.apache.servicemix.specs.stax-api-1.0-1.3.0.jar@3:start,
\

 ../../../jars/org.apache.cxf/org.apache.servicemix.specs.jaxb-api-2.1-1.3.0.jar@3:start,
\

 ../../../jars/org.apache.cxf/org.apache.servicemix.specs.jaxws-api-2.1-1.3.0.jar@3:start,
\

 ../../../jars/org.apache.cxf/org.apache.servicemix.specs.jsr311-api-1.0-1.3.0.jar@3:start,
\

 ../../../jars/org.apache.cxf/cxf-dosgi-ri-dsw-cxf-1.1.jar@3:start, \

\
---------------------------------------------------------------------


I hope I am not disturbing you too much, I am really stuck here :)

Cheers,
George








 >Hi
 >
 >It is difficult to suggest anything without seeing the actual details...
 >
 >""No services have been found"" is a CXF services page, saying that no
 >endpoints have been deployed successfully.
 >
 >I think the best way for you to move forward is to run a greeter_rest demo
 >shipped with DOSGI 1.1, see that actually works for you and that you can
 >access the endpoint using the browser and the client bundle. Next start
 >modifying this demo as you need, step by step, and you'll be able to succeed
 >that way...
 >
 >some more comments inline
 >
 >ping me please if you get stuck - but please confirm that a greeter_rest
 >demo works and also provide more details
 >
 >cheers, Sergey
 >
 >
 >On Wed, May 19, 2010 at 9:47 AM, Georgi Dimitrov  wrote:
 >
 >>  Hello Sergey,
 >>
 >> I ve done everything as described. Still no RESTful service ....
 >>
 >> The documentation you pointed me to doesn't explain what I need to do.
 >> Here is what I've done Could you please correct me on any step that is
 >> wrong or complement my steps where needed?
 >>
 >> 1) specified the service-description in sd.xml
 >> 2) also in remote-services.xml (as I don't use discovery service)
 >>
 >
 >it is only needed if you use a client bundle to access the endpoint, no need
 >for it if a browser is used.
 >
 >
 >> 3) Created MyService-model.xml and put it into OSGI-INF/cxf/jaxrs/ of my
 >> Service (should this reside here or some place else?)
 >>
 >
 >yes...It can also be named 'model.xml'. Note - you only have to use it if
 >you do prefer to avoid adding JAXRS annotations to your service classes
 >
 >
 >> 4) Startet my OSGI Environment.
 >> 5) When I go to localhost:port/MyService i get: "No servicesa have been
 >> found"
 >> Well at leas no 404 right? :) So that means to me that my sd.xml and
 >> remote-services.xml are correct. Then the mistake is somwhere else.
 >>
 >>
 >> Thank you for your help!
 >>
 >>
 >> Cheers,
 >> George
 >>
 >
 
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message