`
lzf0112
  • 浏览: 1568 次
  • 性别: Icon_minigender_1
  • 来自: 北京
文章分类
社区版块
存档分类
最新评论

Struts2 设置 ParentPackage 注解错误

阅读更多
Struts2 扫描包中的 ParentPackage 老是提示 parent package 里面的值是unknown location,具体错误信息如下:
1:10:14.318 [localhost-startStop-1] INFO  o.s.w.c.s.XmlWebApplicationContext - Closing org.springframework.web.context.support.XmlWebApplicationContext@1a8e045: display name [Root WebApplicationContext]; startup date [Thu May 16 11:10:12 CST 2013]; root of context hierarchy
11:10:14.318 [localhost-startStop-1] INFO  o.s.b.f.s.DefaultListableBeanFactory - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@13df2a2: defining beans []; root of factory hierarchy
五月 16, 2013 11:10:14 上午 org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter struts2
Unable to load configuration. - [unknown location]
	at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:485)
	at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
	at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)
	at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:281)
	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:262)
	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:107)
	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4656)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5309)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
	at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: Unable to load configuration. - [unknown location]
	at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:70)
	at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:429)
	at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:473)
	... 15 more
Caused by: ClasspathPackageProvider: Unable to locate parent package default - [unknown location]
	at org.apache.struts2.config.ClasspathPackageProvider.findAllParentPackages(ClasspathPackageProvider.java:439)
	at org.apache.struts2.config.ClasspathPackageProvider.processActionClass(ClasspathPackageProvider.java:398)
	at org.apache.struts2.config.ClasspathPackageProvider.loadPackages(ClasspathPackageProvider.java:306)
	at org.apache.struts2.config.ClasspathPackageProvider.loadPackages(ClasspathPackageProvider.java:543)
	at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:260)
	at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
	... 17 more


web.xml部分配置
        <filter>
		<filter-name>struts2</filter-name>
		<filter-class> 
			org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
		</filter-class>
		<init-param>
			<param-name>actionPackages</param-name>
			<param-value>com.javaeye.test.web</param-value>
		</init-param>
	</filter>
	<filter-mapping>
		<filter-name>encodingFilter</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>


struts.xml配置内容
        <struts>	
	<constant name="struts.multipart.maxSize" value="204800000" />
	<constant name="struts.codebehind.pathPrefix" value="/WEB-INF/template/" />
	<constant name="struts.enable.DynamicMethodInvocation" value="false" />
         <constant name="struts.devMode" value="true" />
	
	<package name="default" extends="struts-default">			
		.....	
         </package>	
        </struts>

分享到:
评论

相关推荐

    Struts2框架及注释和用法

    Struts2的框架及注释和使用法,希望大家支持,我们一起努力,谢谢!

    struts1和struts2的区别

    struts1和struts2的区别struts1和struts2的区别struts1和struts2的区别struts1和struts2的区别struts1和struts2的区别struts1和struts2的区别struts1和struts2的区别struts1和struts2的区别struts1和struts2的区别...

    李顺利Struts2表单验证后回显错误信息 标签使用

    Struts2表单验证后回显错误信息 标签使用 李顺利Struts2表单验证后的错误信息显示格式-样式大全

    struts2如何实现弹出action返回的错误信息

    struts2如何实现弹出action返回的错误信息

    Struts2+spring注解配置

    Struts2+spring注解配置 很好哦

    Struts2注解详细说明文档

    Struts2注解详细说明文档,详细讲述struts2的注解使用

    struts2注解登陆

    注解实现的页面跳转其特点是不用配置文件struts.xml因而可以实现零配置,同时由于有注解的功能,所以说大大增加了程序的可维护性。

    Maven实现struts2注解

    Maven实现struts2注解

    struts2注解详解

    从struts2.1开始,struts2不再推荐使用Codebehind作为零配置插件,而是改为使用Convention插件来支持零配置,和Codebehind相比,Convention插件更彻底,该插件完全抛弃配置信息,不仅不需要是使用struts.xml文件进行...

    Struts 2使用注解配置Action

    Struts 2使用注解配置Action,不配置struts.xml,通过注解直接配置action

    struts2注解与拦截器demo

    该例子为struts2注解与拦截器demo,利用myEclipse8.5开发,导入刚才后,自动加载所需struts2的jar包,可以直接运行,是初学struts2注解、拦截器很好的例子,保证10分钟学会2种技术,愿意分享给大家。

    Struts2注解开发jar

    Struts2注解开发jar,必须导入struts2-convention-plugin-2.3.15.jar包,它在struts2安装包下lib目录中。

    struts2-core.jar

    struts2-core-2.0.1.jar, struts2-core-2.0.11.1.jar, struts2-core-2.0.11.2.jar, struts2-core-2.0.11.jar, struts2-core-2.0.12.jar, struts2-core-2.0.14.jar, struts2-core-2.0.5.jar, struts2-core-2.0.6.jar,...

    struts2 总结工程大全

    struts2 总结工程大全struts2 总结工程大全struts2 总结工程大全struts2 总结工程大全struts2 总结工程大全struts2 总结工程大全struts2 总结工程大全struts2 总结工程大全struts2 总结工程大全struts2 总结工程大全...

    Struts2 注解 Demo

    Struts2Demo 注解的小例子,jar包全包括

    Struts2视频教程

    Struts2是一套非常优秀的Java WEB应用框架,实现优雅、功能强大、使用简洁。目前已有大量的企业项目采用Struts2来作为Web框架进行开发,掌握Struts2是每个进行Web开发的Java程序员的一项必备技能。 本视频对Struts2...

    struts2 资料struts2 资料struts2 资料struts2 资料

    struts2 资料struts2 资料struts2 资料struts2 资料

    maven整合struts2全注解

    maven整合struts2全注解,

    struts2 chm 帮助文档

    struts2 chm 程序包 org.apache.struts2 接口概要 接口 说明 StrutsStatics Constants used by Struts. 类概要 类 说明 RequestUtils Request handling utility class. ServletActionContext Web-specific ...

    ·Struts2配置文件介绍 超级详细

    ·Struts2配置文件介绍 struts.xml action package ·Struts2配置文件介绍 struts.xml action package

Global site tag (gtag.js) - Google Analytics