Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » WAB context not finding local classes
WAB context not finding local classes [message #739911] Tue, 18 October 2011 01:05 Go to next message
Mark Elliot is currently offline Mark ElliotFriend
Messages: 13
Registered: June 2011
Junior Member
I'm running Virgo Jetty 3.0.1; my setup looks like this:


baz-context.xml contains (... is the xmlns stuff):

<beans ...>
    <bean id="baz" class="" />

When I start this bundle I get an error:

Caused by: java.lang.ClassNotFoundException:

My web.xml contains:


Clearly Baz is a class. Strangely, if I move my spring config to the WEB-INF directory and set it up to be loaded by the servlet loader (using the web.xml stuff), the class is found and things come up just fine -- which leads me to believe the MANIFEST is correct and the actual class is getting included.

Why can't I initialize this class in the spring/ folder?

Supposing I can eventually initialize that bean with a config in the spring/ folder, can beans in servlet specific contexts reference items defined in those configs?
Re: WAB context not finding local classes [message #740324 is a reply to message #739911] Tue, 18 October 2011 11:45 Go to previous messageGo to next message
Chris Frost is currently offline Chris FrostFriend
Messages: 230
Registered: January 2010
Location: Southampton, England
Senior Member


You can either put all your spring context information in the applicationContext.xml file under WEB-INF and no config will be required in the web.xml or keep it in META-INF/spring and specify that as the location with 'contextConfigLocation' context-param.

Yes, servlet specific contexts will have full access to beans in your spring/osgi context, it will be one of its parent contexts due to the config you have put in web.xml as shown in your post.

As a side note, all the Manifest should need is the bundle classpath being set to include WEB-INF/classes where Baz.class should be compiled to.


Chris Frost, Twitter @cgfrost
Springsource, a divison of VMware.

[Updated on: Tue, 18 October 2011 11:46]

Report message to a moderator

Re: WAB context not finding local classes [message #741509 is a reply to message #740324] Wed, 19 October 2011 15:45 Go to previous message
Dmitry Sklyut is currently offline Dmitry SklyutFriend
Messages: 279
Registered: January 2010
Senior Member
or keep it in META-INF/spring and specify that as the location with 'contextConfigLocation' context-param.

That would bring spring-dm extender into the picture. You want to keep spring context files out of META-INF/spring for web-apps and let deploy them.

Previous Topic:JavaOne
Next Topic:problems upgrading from 2.1.1 to 3.0.1
Goto Forum:

Current Time: Sat May 26 04:38:02 GMT 2018

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

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

Back to the top