javax.servlet.UnavailableException: Missing configuration resource for path
错误原因为seviceImpl中的实现少了个注解:@Resource
一个是web.xml文件中的struts配置文件路径的写法问题,解决办法是在struts配置文件路径前加上"/"
<init-param>
<param-name>config</param-name>
<param-value>/struts_test.xml</param-value>
</init-param>
抛的异常如下:
2009-9-28 13:33:53 org.apache.struts.action.ActionServlet handleConfigException
严重: Parsing error processing resource path struts_test.xml
java.net.MalformedURLException: Path struts_test.xml does not start with a "/" c
haracter
at org.apache.catalina.core.ApplicationContext.getResource(ApplicationCo
ntext.java:473)
一个是web.xml中的struts文件的路径,struts配置文件应该是放在class目录下,比如src的根目录下,
配置就是<param-value>/struts_test.xml</param-value>,而不是WEB-INF中的路径。
严重: Servlet /Message threw load() exception
javax.servlet.UnavailableException: Missing configuration resource for path /WEB-INF/struts-config.xml
at org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServlet.java:732)
at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:687)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:333)