当前位置:首页 > 开发 > 编程语言 > Struts2 > 正文

struts2 排错

发表于: 2009-03-11   作者:asialee   来源:转载   浏览次数:
摘要: 以前项目用过webwork2,感觉这两个差不多,今天用struts2开发一个helloworld程序没想到出了很多错,看来自己真实眼高手低呀。 首先是: 严重: Exception starting filter struts javax.xml.transform.TransformerFactoryConfigurationError: Provider org.apache
以前项目用过webwork2,感觉这两个差不多,今天用struts2开发一个helloworld程序没想到出了很多错,看来自己真实眼高手低呀。

首先是:
严重: Exception starting filter struts
javax.xml.transform.TransformerFactoryConfigurationError: Provider org.apache.xalan.processor.TransformerFactoryImpl could not be instantiated: java.lang.NullPointerException
	at javax.xml.transform.TransformerFactory.newInstance(Unknown Source)
	at com.opensymphony.xwork2.util.DomHelper$DOMBuilder.<clinit>(DomHelper.java:167)
	at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:115)
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:830)
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocuments(XmlConfigurationProvider.java:131)
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.java:100)
	at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(DefaultConfiguration.java:130)
	at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:52)
	at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:395)
	at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:452)
	at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:201)
	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:221)
	at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:302)
	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:78)
	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3635)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4222)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
	at org.apache.catalina.core.StandardService.start(StandardService.java:448)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
2009-3-11 11:23:38 org.apache.catalina.core.StandardContext start


最后在网上查到,有人建议移除$TOMCAT_HOME/common/endorsed/下的Jar包,说是很JDK的有冲突,后来,果然可以了。得感谢这些前辈们。


接着程序到时候能运行了,但日志里面出了很多错。
Caught Exception while registering Interceptor class org.apache.struts2.interceptor.debugging.DebuggingInterceptor - interceptor - jar:file:/E:/DevelopWorkspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp2/wtpwebapps/struts2/WEB-INF/lib/struts2-core-2.0.11.jar!/struts-default.xml:98:115
	at org.apache.struts2.impl.StrutsObjectFactory.buildInterceptor(StrutsObjectFactory.java:78)
	at com.opensymphony.xwork2.config.providers.InterceptorBuilder.constructInterceptorReference(InterceptorBuilder.java:57)
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.lookupInterceptorReference(XmlConfigurationProvider.java:905)
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadInterceptorStack(XmlConfigurationProvider.java:743)
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadInterceptorStacks(XmlConfigurationProvider.java:756)
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadInterceptors(XmlConfigurationProvider.java:777)
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:410)
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:239)
	at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:111)
	at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(DefaultConfiguration.java:152)
	at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:52)
	at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:395)
	at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:452)
	at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:201)
	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:221)
	at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:302)
	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:78)
	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3635)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4222)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
	at org.apache.catalina.core.StandardService.start(StandardService.java:448)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
Caused by: com.opensymphony.xwork2.inject.DependencyException: com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No mapping found for dependency [type=org.apache.struts2.views.freemarker.FreemarkerManager, name='default'] in public void org.apache.struts2.interceptor.debugging.DebuggingInterceptor.setFreemarkerManager(org.apache.struts2.views.freemarker.FreemarkerManager).
	at com.opensymphony.xwork2.inject.ContainerImpl.addInjectorsForMembers(ContainerImpl.java:157)
	at com.opensymphony.xwork2.inject.ContainerImpl.addInjectorsForMethods(ContainerImpl.java:126)
	at com.opensymphony.xwork2.inject.ContainerImpl.addInjectors(ContainerImpl.java:103)
	at com.opensymphony.xwork2.inject.ContainerImpl$1.create(ContainerImpl.java:84)
	at com.opensymphony.xwork2.inject.ContainerImpl$1.create(ContainerImpl.java:82)
	at com.opensymphony.xwork2.inject.util.ReferenceCache$CallableCreate.call(ReferenceCache.java:155)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at com.opensymphony.xwork2.inject.util.ReferenceCache.internalCreate(ReferenceCache.java:81)
	at com.opensymphony.xwork2.inject.util.ReferenceCache.get(ReferenceCache.java:121)
	at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:452)
	at com.opensymphony.xwork2.inject.ContainerImpl$6.call(ContainerImpl.java:492)
	at com.opensymphony.xwork2.inject.ContainerImpl$6.call(ContainerImpl.java:491)
	at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:542)
	at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:490)
	at com.opensymphony.xwork2.ObjectFactory.injectInternalBeans(ObjectFactory.java:131)
	at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:156)
	at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:143)
	at org.apache.struts2.impl.StrutsObjectFactory.buildInterceptor(StrutsObjectFactory.java:53)
	... 31 more
Caused by: com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No mapping found for dependency [type=org.apache.struts2.views.freemarker.FreemarkerManager, name='default'] in public void org.apache.struts2.interceptor.debugging.DebuggingInterceptor.setFreemarkerManager(org.apache.struts2.views.freemarker.FreemarkerManager).
	at com.opensymphony.xwork2.inject.ContainerImpl.createParameterInjector(ContainerImpl.java:239)
	at com.opensymphony.xwork2.inject.ContainerImpl.getParametersInjectors(ContainerImpl.java:229)
	at com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.<init>(ContainerImpl.java:282)
	at com.opensymphony.xwork2.inject.ContainerImpl$3.create(ContainerImpl.java:130)
	at com.opensymphony.xwork2.inject.ContainerImpl$3.create(ContainerImpl.java:128)
	at com.opensymphony.xwork2.inject.ContainerImpl.addInjectorsForMembers(ContainerImpl.java:154)
	... 49 more


后来看了看,应该是缺少freemarker的Jar文件,放进去,果然可以了,看来以后还的多学习学习。

以后在也不能想当然了,但为什么struts2不像spring那样,不用freemarker做视图,为什么还得需要那些Jar文件呢,请高人指点?

struts2 排错

  • 0

    开心

    开心

  • 0

    板砖

    板砖

  • 0

    感动

    感动

  • 0

    有用

    有用

  • 0

    疑问

    疑问

  • 0

    难过

    难过

  • 0

    无聊

    无聊

  • 0

    震惊

    震惊

编辑推荐
昨天上午iis莫名奇怪出现问题。自己电脑上搭建的站点无法访问。找了下原因,记录了下来 出现该问题的
debian下安装psdash并排错 1.更新一下系统,安装必要的安装包 root@debian-lege-pro:~# apt-get upd
人在江湖走,岂能不挨刀。今天人生又完整了一点:Emacs出现运行错误。一番折腾,正好学会一点简单的
前几天另一个组的同事遇到了一个问题,他们的服务器cpu总是很高,用性能监视器看来,情况更是奇怪,开始
goagent的大名听说很久,可是一直没能整成功,主要是没这个需求。最近发现耐心下来,很多英文资料都
背景: 这个问题由来已久了,有时经常发现一盘我认为是正常的磁带莫名其妙处于Frozen状态了,经观察
症状: 更换了磁带机部件,导致Robots选项卡中的TLD(2) Robotic Path显示为PATH_MISSING。 解决方法
环境搭建成功后就进入了Hibernate的dao层的修改,将之前的使用MySQL的dao层修改成使用hibernate的da
前几天重新搭建了APAC的Netbackup, 终于可以备份成功了, 但是今天在做还原的时候遇到了些小问题,记
l Serial x is down, line protocol is down l Serial x is up, line protocol is down l Serial x
版权所有 IT知识库 CopyRight © 2009-2015 IT知识库 IT610.com , All Rights Reserved. 京ICP备09083238号