0

I'm fairly new to OSGi (and JBoss), so forgive me if I've missed something in the documentation - I've been searching for a day or so now.

I'm trying to create a web service hosted within the JBoss OSGi container. The goal is to be able to hit http://localhost:8080/getStuff and receive a JSON object. Is this possible within OSGi? If so, is this possible within JBoss7's OSGi container?

Thanks in advance!

Ledivin
  • 637
  • 5
  • 18

1 Answers1

0

Definitely possible - I'd suspect you'll find better results by googling "OSGi webservice example" than if you include "JBoss ...", also search for implementation examples (Jersey, CXF, etc).

You can create a WAB which is essientally just a WAR with OSGi metadata, that imports dependencies rather than embed them in WEB-INF/lib. JBoss uses PaxWeb to provide WAB/WAR support (it wraps an instance of Jetty).

Projects like Jersey and CXF state that they work on OSGi, so apart from your services, from the webcontainer's perspect it's the same as webservices in a Java EE environment.

JBoss specific examples: https://docs.jboss.org/author/display/JBOSGI/Provided+Examples (didn't see WS examples though).

Arjan Tijms
  • 37,782
  • 12
  • 108
  • 140
earcam
  • 6,662
  • 4
  • 37
  • 57
  • @Ledivin, I commented on another question covering OSGi in JBoss 7, no webservices but might be of some use to you http://stackoverflow.com/questions/15130553/move-a-seam-application-to-osgi/15248556#15248556 HTH – earcam Mar 08 '13 at 20:52