Back Forum Reply New

unable to load applicationContext.xml

I have multiple applicationContexts in my classpath.
(applicationContext.xml amp; applicationContext-core.xml)

web.xml

Code: lt;context-paramgt;       lt;param-namegt;contextConfigLocationlt;/param-namegt;       lt;param-valuegt;classpath:applicationContext*.xml       lt;/param-valuegt;   lt;/context-paramgt;
which is packaged into the root folder of my WEB-INF\lib\core.jar

But on startup I cannot see in the log either of these context files loaded. my myapp-servlet.xml has bean id references to the beans in appContext* and I have autoWireByType. All I get is Not autowiring property xxx of beanxyv by type: no matching bean found as it couldnt check in parent context.

Any help on how to debug this in eclipse with spring source? I tried debugging DefaultListableBeanFactory class, still unable to figure out the source of problem

Is this all you have in the web.xml? Also need to have either a ContextLoadListener (preferred) or StartupServlet configured in web.xml that actually uses the contextConfigLocation parameter.

Code:
lt;listenergt;lt;listener-classgt;org..web.context.ContextLoaderListenerlt;/listener-classgt;
lt;/listenergt;
lt;!-- or use the ContextLoaderServlet instead of the above listener
lt;servletgt;lt;servlet-namegt;contextlt;/servlet-namegt;lt;servlet-classgt;org..web.context.ContextLoaderServletlt;/servlet-classgt;lt;load-on-startupgt;1lt;/load-on-startupgt;
lt;/servletgt;
--gt;

See the following link for more doc on this.
sp...context-create

I am using this Listener by default, it is still not able to pick up my appcontext.

Here's a catch
1) If i combine both app contexts, remove contextConfigLocation and place this here WEB-INF\applicationContext.xml (same level as web.xml)

it works!

(Ive been working in this setup for a while before I split into two and placed them in a jar)

By not specifying a value, its obviously reverting to default behaviour.  If you try the classpath value but put the applicationContext.xml in WEB-INF/classes does it work?

Have you had a read of the reference manual.
sp...resource-paths

Here it is, if you don't specify a value.Code:
public class XmlWebApplicationContext extends AbstractRefreshableWebApplicationContext {

/** Default config location for the root context */
public static final String DEFAULT_CONFIG_LOCATION = quot;/WEB-INF/applicationContext.xmlquot;;

/** Default prefix for building a config location for a namespace */
public static final String DEFAULT_CONFIG_LOCATION_PREFIX = quot;/WEB-INF/quot;;

/** Default suffix for building a config location for a namespace */
public static final String DEFAULT_CONFIG_LOCATION_SUFFIX = quot;.xmlquot;;.JaruclConnection from it, or manually parse the jar ucl, and then traverse the contents of the jar file, to resolve the wildcards.

Can anyone give the syntax for the wildcard?

Thanks

Still no hope of getting this simple task resolved. All I want is
to give the location of the jar file or even better the location where it could search a list of jar files for my applicationContext*.xml files

Is it that hard?
¥
Back Forum Reply New