问题描述
小弟新手,重新装了系统,请各位高手帮忙看看是什么问题载入工作空间之后启动服务器就会报错:Unabletoloadconfiguration.-[unknownlocation]atcom.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:58)atorg.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:360)atorg.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:403)atorg.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:190)atorg.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)atorg.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)atorg.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)atorg.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3693)atorg.apache.catalina.core.StandardContext.start(StandardContext.java:4340)atorg.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)atorg.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)atorg.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)atorg.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)atorg.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)atorg.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)atorg.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)atorg.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)atorg.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)atorg.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)atorg.apache.catalina.core.StandardHost.start(StandardHost.java:719)atorg.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)atorg.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)atorg.apache.catalina.core.StandardService.start(StandardService.java:516)atorg.apache.catalina.core.StandardServer.start(StandardServer.java:710)atorg.apache.catalina.startup.Catalina.start(Catalina.java:566)atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)atsun.reflect.NativeMethodAccessorImpl.invoke(UnknownSource)atsun.reflect.DelegatingMethodAccessorImpl.invoke(UnknownSource)atjava.lang.reflect.Method.invoke(UnknownSource)atorg.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)atorg.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)Causedby:Caughtexceptionwhileloadingfilestruts-default.xml-[unknownlocation]atcom.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:894)atcom.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocuments(XmlConfigurationProvider.java:144)atcom.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.java:111)atcom.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:164)atcom.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:55)...30moreCausedby:java.lang.ClassCastException:org.apache.xerces.parsers.XML11Configurationcannotbecasttoorg.apache.xerces.xni.parser.XMLParserConfigurationatorg.apache.xerces.parsers.DOMParser.<init>(UnknownSource)atorg.apache.xerces.parsers.DOMParser.<init>(UnknownSource)atorg.apache.xerces.jaxp.DocumentBuilderImpl.<init>(UnknownSource)atorg.apache.xerces.jaxp.DocumentBuilderFactoryImpl.newDocumentBuilder(UnknownSource)atcom.sun.org.apache.xalan.internal.xsltc.trax.SAX2DOM.<init>(UnknownSource)atcom.sun.org.apache.xalan.internal.xsltc.runtime.output.TransletOutputHandlerFactory.getSerializationHandler(UnknownSource)atcom.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getOutputHandler(UnknownSource)atcom.sun.org.apache.xalan.internal.xsltc.trax.TransformerHandlerImpl.setResult(UnknownSource)atcom.opensymphony.xwork2.util.DomHelper$DOMBuilder.setup(DomHelper.java:205)atcom.opensymphony.xwork2.util.DomHelper$DOMBuilder.<init>(DomHelper.java:190)atcom.opensymphony.xwork2.util.DomHelper$DOMBuilder.<init>(DomHelper.java:181)atcom.opensymphony.xwork2.util.DomHelper$DOMBuilder.<init>(DomHelper.java:167)atcom.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:107)atcom.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:885)...34more2010-6-119:52:59org.apache.catalina.core.StandardContextstart
解决方案
解决方案二:
把struts2-core那个包重新加一下看!
解决方案三:
错误挺多的工程上面有红叉没?
解决方案四:
工程上没有错误啊就是换了个地方。。。重新装系统了嘛
解决方案五:
那应该是你环境的问题了
解决方案六:
确实是环境的问题我重新搭建了个环境,但是把struts.xml文件内容复制之后就会出现同样的错误为何?
解决方案七:
引用5楼yichinan的回复:
但是把struts.xml文件内容复制之后就会出现同样的错误
不复制内容没错?那么应该是你的内容里面有问题了..拿出来看看吧
解决方案八:
jar包有冲突,应该是XML解析包有冲突.检查发布后的WEB-INF/lib有两个XML解析包:xml-apis.jar和xerces-2.6.2.jar这种错误真正原因不是JDK6和Struts2冲突,而是MyEclipseHibernate类库中多了两个包:xml-apis.jar和xerces-2.6.2.jar,这两个包的功能和JDK的冲突了.解决办法:1.删除发布后目录的WEB-INF/lib/下的这两个文件;2.或者使用JDK1.5来启动Tomcat6.
解决方案九:
确定包是否完整,版本是否有问题?要不然就是xml配置问题了,最好把这些包和配置文件的内容也贴上,要不这样看很抽象!
解决方案十:
jar冲突,请下载最新的strutsLIB,然后删除老的
解决方案十一:
应该是某一个配置文件没有配置完整,我开始也是出现这个错误,后来发现时struts.xml文件没配置完整导致的。