Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Publish service from web bundle
Publish service from web bundle [message #639970] Thu, 18 November 2010 15:16 Go to next message
Kurt  is currently offline Kurt Friend
Messages: 3
Registered: November 2010
Junior Member
Is it not possible to publish a service from a web bundle (is the intention only to consume a service)? I have two nearly identical sample projects setup, one is a 'regular' bundle project and the other is denoted 'web'.

I've created a published a simple service from the regular bundle, but despite many hours of attempts, I can't get the nearly identical service to publish for the web bundle. The Virgo logs aren't much help, I don't get any more information than 'Web application failed to start'.
Re: Publish service from web bundle [message #639977 is a reply to message #639970] Thu, 18 November 2010 15:32 Go to previous messageGo to next message
Dmitry Sklyut is currently offline Dmitry SklyutFriend
Messages: 279
Registered: January 2010
Senior Member
How are you trying to publish service from web bundle?

Are you using SpringDM or getting bundleContext from ServlectContext and doing it manually?

If you can provide a bit more info, we should be able to figure it out.

Regards,
Dmitry
Re: Publish service from web bundle [message #639992 is a reply to message #639970] Thu, 18 November 2010 15:53 Go to previous messageGo to next message
Kurt  is currently offline Kurt Friend
Messages: 3
Registered: November 2010
Junior Member
Thanks for the reply.

I'm using SpringDM. I'm then attempting to publish it via a spring context configuration file:

<osgi:service ref="..." interface="..." />

I'm certainly not precluding that I've mis-configured something with my project.

This should be possible, though? I'm not violating some known constraint of a web bundle to not be able to publish services?

Re: Publish service from web bundle [message #639993 is a reply to message #639992] Thu, 18 November 2010 15:59 Go to previous messageGo to next message
Dmitry Sklyut is currently offline Dmitry SklyutFriend
Messages: 279
Registered: January 2010
Senior Member
In web apps you really do not want spring-dm-extender to start you bundle appContext.

You want to let web app start and configure custom ApplicationContext class.
    <context-param>
        <param-name>contextClass</param-name>
        <param-value>org.eclipse.virgo.web.dm.ServerOsgiBundleXmlWebApplicationContext</param-value>
    </context-param>


    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>




Move your spring configuration files away from /META-INF/spring and define them in web.xml like you would do for a Spring MVC web-app.

Hope this helps.

Regards,
Dmitry
Re: Publish service from web bundle [message #640023 is a reply to message #639993] Thu, 18 November 2010 17:06 Go to previous message
Kurt  is currently offline Kurt Friend
Messages: 3
Registered: November 2010
Junior Member
It is helpful, I'm reconfiguring as per your suggestions now. Thanks for the quick replies.
Previous Topic:Bundled JSEE?
Next Topic:org.osgi.framework.bootdelegation and org.osgi.framework.system.packages, how they function?
Goto Forum:
  


Current Time: Sat Dec 14 10:31:46 GMT 2024

Powered by FUDForum. Page generated in 0.03378 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top