开发者

Spring/Resin configuration problem

开发者 https://www.devze.com 2023-02-13 05:36 出处:网络
I am wiring up a servlet thru spring running inside resin.. When the web app starts up i get [11-02-22 12:12:36.259] {main} org.springframework.beans.factory.BeanDefinitionStoreException: Could not

I am wiring up a servlet thru spring running inside resin.. When the web app starts up i get

[11-02-22 12:12:36.259] {main} org.springframework.beans.factory.BeanDefinitionStoreException: Could not resolve bean definition resource pattern [/WEB-INF/*-context.xml]; nested exception is java.io.FileNotFoundException: ServletContext resource [/WEB-INF/] cannot be resolved to URL because it does not exist at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java

I indeed have my spring configuration files in

WEB-INF/

as

WEB-INF/persist-context.xml

and the web.xml file does have

<servlet>
    <servlet-name>dsservlet</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherS开发者_JS百科ervlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>

and

<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/*-context.xml</param-value>
</context-param>

all of this works fine in jetty, but in resin (again) i get the error:

ServletContext resource [/WEB-INF/] cannot be resolved to URL because it does not exist

I have added a line in resin.conf like

<web-app id="/myapp" root-directory="$/path/to/myapps/explodedwardir"/>

Any idea what i'm doing wrong?


Initial Answer

Note the error text: /WEB-INF/*-context.xml
Now, note your text: WEB-INF/dsservlet-servlet.xml
*-context.xml will never match *-servlet.xml

More stuff

I include the following in the Spring Dispatch Servlet (in the web.xml file) when I want the Dsipatch Servlet to reference the contextConfigLocation config-param in my web.xml.

    <init-param>
        <param-name>contextConfigLocation</param-name>
        <param-value/>
    </init-param>


Try:

<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath:/WEB-INF/*-context.xml</param-value>
</context-param>

(adding classpath: prefix).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号