Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Gemini » Blueprint: How to implement AbstractApplicationContext.getEnvironment()
Blueprint: How to implement AbstractApplicationContext.getEnvironment() [message #992021] Thu, 20 December 2012 12:36 Go to next message
eis - is currently offline eis -
Messages: 16
Registered: September 2012
Junior Member
I'm trying to refer to OSGi services from my spring app. Blueprint and spring app are deployed in JBoss AS 7.

I keep getting this:

18:55:35,192 ERROR [org.springframework.web.context.ContextLoader] (ServerServic
e Thread Pool -- 156) Context initialization failed: org.springframework.beans.f
actory.BeanCreationException: Error creating bean with name 'InformationService'
: Invocation of init method failed; nested exception is java.lang.IllegalArgumen
tException: Required 'bundleContext' property was not set.
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455) [spring-bea
ns-3.1.3.RELEASE.jar:3.1.3.RELEASE]


now, based on things I've found, I need to implement ServerOsgiBundleXmlWebApplicationContext and define that as a context class for this to work.

Almost-ready code can be found for example at here: http://grepcode.com/file_/repo1.maven.org/maven2/com.tqlab.sense/tqlab-sense-mvc/1.0.0/com/tqlab/sense/context/ServerOsgiBundleXmlWebApplicationContext.java/?v=source

however, using that, I get a complaint

The type ServerOsgiBundleXmlWebApplicationContext must implement the inherited abstract method ConfigurableWebApplicationContext.getEnvironment() to override AbstractApplicationContext.getEnvironment()


and I have no idea how to implement that. Is there any existing example on this? What should the method contain? I tried some things, but they kept on failing.

Re: Blueprint: How to implement AbstractApplicationContext.getEnvironment() [message #992236 is a reply to message #992021] Fri, 21 December 2012 02:05 Go to previous messageGo to next message
eis - is currently offline eis -
Messages: 16
Registered: September 2012
Junior Member
I managed to implement this, based on a previous class in spring-osgi. I don't get why the class has been removed as I was unable to get this working without it.
Re: Blueprint: How to implement AbstractApplicationContext.getEnvironment() [message #992325 is a reply to message #992236] Fri, 21 December 2012 06:04 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn Normington
Messages: 1222
Registered: July 2009
Senior Member
I think this issue is caused by changes in the Spring framework. You may be interested to know that some of the Virgo 3.6.0 deliverables integrate Spring framework v3.1 and support Spring framework v3.2. You can see the corresponding commits, 72a4f21 and 4bf332b, in Virgo's web integration layer git repo (details).
Re: Blueprint: How to implement AbstractApplicationContext.getEnvironment() [message #996982 is a reply to message #992325] Thu, 03 January 2013 05:39 Go to previous messageGo to next message
eis - is currently offline eis -
Messages: 16
Registered: September 2012
Junior Member
A-ha. So the file is in there:
http://git.eclipse.org/c/virgo/org.eclipse.virgo.web.git/tree/org.eclipse.virgo.web.dm/src/main/java/org/eclipse/virgo/web/dm/ServerOsgiBundleXmlWebApplicationContext.java
and changes can be seen at
http://git.eclipse.org/c/virgo/org.eclipse.virgo.web.git/commit/?id=4bf332b and http://git.eclipse.org/c/virgo/org.eclipse.virgo.web.git/commit/?id=72a4f21

Thank you for this. So these are Spring 3.2 related changes.

So... why isn't the file distributed with Gemini Blueprint packages/dependencies?
Re: Blueprint: How to implement AbstractApplicationContext.getEnvironment() [message #996985 is a reply to message #996982] Thu, 03 January 2013 05:45 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn Normington
Messages: 1222
Registered: July 2009
Senior Member
The web support in Spring DM was discarded when Spring DM was contributed to form Gemini Blueprint. Gemini Web is the OSGi web container and Virgo provides integration with Spring framework.
Re: Blueprint: How to implement AbstractApplicationContext.getEnvironment() [message #997190 is a reply to message #996985] Fri, 04 January 2013 06:13 Go to previous message
eis - is currently offline eis -
Messages: 16
Registered: September 2012
Junior Member
Ok. Well, that kind of sucks. I read this so that Gemini Blueprint/Spring-integration isn't really supported in other containers. Hm.

Thank you for your answers.

[Updated on: Fri, 04 January 2013 06:21]

Report message to a moderator

Previous Topic:Gemini Web 2.2.0 RELEASE is now available
Next Topic:Bundles always refresh when using the config admin
Goto Forum:
  


Current Time: Thu Aug 21 00:42:02 EDT 2014

Powered by FUDForum. Page generated in 0.08237 seconds