SSH项目使用tiles报错Can't get definitions factory from context

axings 2009-04-25 12:08:57
之前项目一直运行正常,最近为了使用AutowiringRequestProcessor整合Spring和Struts对web.xml和struts-config.xml文件做出一些修改后,一旦进入使用tiles的页面就会报出Can't get definitions factory from context错误,配置文件如下,希望有好心人能给解决一下这个问题,感激不尽:

web.xml:

<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>3</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>3</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
...
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/classes/applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>


struts-config.xml

...
<controller processorClass="org.springframework.web.struts.AutowiringRequestProcessor" />

<message-resources parameter="com.acarec.nsbd.struts.ApplicationResources" />
<plug-in className="org.apache.struts.tiles.TilesPlugin" >
<set-property property="definitions-config" value="/WEB-INF/tiles-defs.xml" />
<set-property property="definitions-debug" value="2" />
<set-property property="definitions-parser-details" value="2" />
<set-property property="definitions-parser-validate" value="true" />
</plug-in>


服务器启动log
2009-4-24 23:07:18 org.apache.catalina.core.AprLifecycleListener init
信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Programs\Genuitec\Common\binary\com.sun.java.jre.win32.x86_1.5.0.011\bin;C:\Programs\tomcat6\bin
2009-4-24 23:07:18 org.apache.coyote.http11.Http11Protocol init
信息: Initializing Coyote HTTP/1.1 on http-8088
2009-4-24 23:07:18 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 2631 ms
2009-4-24 23:07:19 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2009-4-24 23:07:19 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/6.0.18
2009-4-24 23:07:21 org.apache.catalina.core.ApplicationContext log
信息: ContextListener: contextInitialized()
2009-4-24 23:07:21 org.apache.catalina.core.ApplicationContext log
信息: SessionListener: contextInitialized()
2009-4-24 23:07:28 org.apache.catalina.loader.WebappClassLoader validateJarFile
信息: validateJarFile(C:\Programs\tomcat6\webapps\nsbd\WEB-INF\lib\servlet.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
2009-4-24 23:07:36 com.sun.faces.config.ConfigureListener$WebXmlProcessor scanForFacesServlet
警告: Unable to process deployment descriptor for context 'null'
2009-4-24 23:07:36 com.sun.faces.config.ConfigureListener contextInitialized
信息: Initializing Sun's JavaServer Faces implementation (1.2_04-b07-FCS) for context '/nsbd'
log4j:WARN No appenders could be found for logger (org.apache.struts.faces.application.ActionListenerImpl).
log4j:WARN Please initialize the log4j system properly.
2009-4-24 23:07:42 org.apache.coyote.http11.Http11Protocol start
信息: Starting Coyote HTTP/1.1 on http-8088
2009-4-24 23:07:42 org.apache.jk.common.ChannelSocket init
信息: JK: ajp13 listening on /0.0.0.0:8009
2009-4-24 23:07:42 org.apache.jk.server.JkMain start
信息: Jk running ID=0 time=0/190 config=null
2009-4-24 23:07:42 org.apache.catalina.startup.Catalina start
信息: Server startup in 23828 ms
2009-4-24 23:08:39 org.apache.catalina.core.StandardWrapperValve invoke
...全文
197 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
zjl421498536 2010-04-01
  • 打赏
  • 举报
回复
可以详细点,说说你的tiles在struts-config。xml中式怎么配置的吗 ?
axings 2009-05-11
  • 打赏
  • 举报
回复
原来是应该使用AutowiringTilesRequestProcessor
我是疏忽
x114944880 2009-04-27
  • 打赏
  • 举报
回复

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/classes/applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

放在web.xml的最上面(就是这一段最先配置,再配其他的)试一下
axings 2009-04-25
  • 打赏
  • 举报
回复
自己顶

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧