Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » War not "Spring Powered" despite using lots of spring
War not "Spring Powered" despite using lots of spring [message #1030169] Sat, 30 March 2013 20:02 Go to next message
Daniel McGreal is currently offline Daniel McGrealFriend
Messages: 27
Registered: April 2012
Junior Member
Hi, I've upgraded Virgo 3.5's Spring to 3.1.3.RELEASE but I don't know if that upgrade is relevant to this problem.
I've built a war which seems to work fine, with Spring - however, it's marked as "Spring Powered: No" in the admin console. I've only noticed this because I came to investigate if a bean I was making was actually being created. By this stage though, I've used a whole bunch of spring things successfully, including Spring Security, Spring Social, Spring JPA, Spring MVC... etc.

The configuration files involved are quite large so I can't really attach them. However, previously, I've noticed some of the following configurations have prevented bundles from utilising Spring.
Manifest:
Import-Library: org.springframework.spring;version="[3.0, 3.2)"
Import-Package: org.eclipse.virgo.web.dm;version="[2.0.0,3.6.0)"
Bundle-ClassPath: .,WEB-INF/classes


Web.xml:
    <!-- Creates the Spring Container shared by all Servlets and Filters -->
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
    
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath*:META-INF/spring/applicationContext*.xml</param-value>
    </context-param>



So the question is, what else does the "Spring Powered" detection rely on?
Thanks, Dan.
Re: War not "Spring Powered" despite using lots of spring [message #1030178 is a reply to message #1030169] Sat, 30 March 2013 20:18 Go to previous messageGo to next message
Daniel McGreal is currently offline Daniel McGrealFriend
Messages: 27
Registered: April 2012
Junior Member
  public String getSpringName()
  {
    Bundle realBundle = this.quasiBundle.getBundle();
    if (realBundle != null) {
      ModuleContext moduleContext = this.moduleContextAccessor.getModuleContext(realBundle);
      if (moduleContext != null) {
        return moduleContext.getDisplayName();
      }
    }
    return "";
  }


I got this far, but by this stage I don't really know what I'm looking at. Is there a way for me to put a breakpoint or something in this via Eclipse?
Re: War not "Spring Powered" despite using lots of spring [message #1030674 is a reply to message #1030178] Sun, 31 March 2013 15:05 Go to previous messageGo to next message
Daniel McGreal is currently offline Daniel McGrealFriend
Messages: 27
Registered: April 2012
Junior Member
Thoroughly embarrassing!

Missing:
        <context-param>
                <param-name>contextClass</param-name>
                <param-value>org.eclipse.virgo.web.dm.ServerOsgiBundleXmlWebApplicationContext</param-value>
        </context-param>


I came back to this post to see if there were any replies, and happened to look at the web.xml I posted and knew immediately it wasn't right... I'm so used to relying on OSGi that I assumed the line above was so essential that nothing could be working without it. However, I haven't split this project out yet so haven't used any OSGi from Spring yet - I guess that's why it was able to work?

Humbly,
Dan.
Re: War not "Spring Powered" despite using lots of spring [message #1031889 is a reply to message #1030674] Tue, 02 April 2013 10:33 Go to previous messageGo to next message
Chris Frost is currently offline Chris FrostFriend
Messages: 230
Registered: January 2010
Location: Southampton, England
Senior Member

Thanks for posting the fix. Responses were probably slow due to some of us being at EclipseCon. Glad it's all working now.

------------------------------------------------
Chris Frost, Twitter @cgfrost
Springsource, a divison of VMware.
Re: War not "Spring Powered" despite using lots of spring [message #1037480 is a reply to message #1031889] Tue, 09 April 2013 15:51 Go to previous message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
The idea of the forum is that the user community can help itself which often works, but not always. Every so often, we committers tend to have a look at unanswered threads and if we can add any value, make a comment.
Previous Topic:Virgo environment from inside the container
Next Topic:Virgo eclise tool : Error when change output folder
Goto Forum:
  


Current Time: Fri Apr 19 09:49:02 GMT 2024

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

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

Back to the top