gpt4 book ai didi

java - 无法通过 eclipse 找到 XML 模式命名空间的 Spring NamespaceHandler [http ://camel. apache.org/schema/spring]

转载 作者:太空宇宙 更新时间:2023-11-04 14:59:58 25 4
gpt4 key购买 nike

我已经阅读了有关此问题的所有其他 SO 帖子,但没有一个涉及 Camel 和 applicationContext.xml。我已经束手无策了,因为我已经尝试解决这个问题一个多星期了。

问题:我可以通过 Tomcat 6 运行我的 GWT 应用程序。但是,一旦我尝试使用 Run As Web Application 通过 Eclipse 执行它,我就会在控制台上收到以下输出:

[WARN] Server class 'org.springframework.web.context.ContextLoaderListener' could not be found in the web app, but was found on the system classpath
[WARN] Adding classpath entry 'file:/C:/company/m2/repo/org/springframework/spring-web/2.5.6/spring-web-2.5.6.jar' to the web app classpath for this session
[WARN] Server resource 'log4j.properties' could not be found in the web app, but was found on the system classpath
[WARN] Adding classpath entry 'file:/C:/company/projects/svn/reco/services/portal/trunk/portal-trunk/portal-um/src/test/resources/' to the web app classpath for this session
[WARN] Server class 'com.company.session.PortalSessionListener' could not be found in the web app, but was found on the system classpath
[WARN] Adding classpath entry 'file:/C:/company/m2/repo/serviceUtil/serviceUtil/trunk/serviceUtil-trunk.jar' to the web app classpath for this session
[WARN] Server class 'org.springframework.context.ApplicationContextException' could not be found in the web app, but was found on the system classpath
[WARN] Adding classpath entry 'file:/C:/company/m2/repo/org/springframework/spring-context/2.5.6/spring-context-2.5.6.jar' to the web app classpath for this session
[WARN] Server class 'org.springframework.beans.FatalBeanException' could not be found in the web app, but was found on the system classpath
[WARN] Adding classpath entry 'file:/C:/company/m2/repo/org/springframework/spring-beans/2.5.6/spring-beans-2.5.6.jar' to the web app classpath for this session
[WARN] Server class 'org.springframework.core.NestedRuntimeException' could not be found in the web app, but was found on the system classpath
[WARN] Adding classpath entry 'file:/C:/company/m2/repo/org/springframework/spring-core/2.5.6/spring-core-2.5.6.jar' to the web app classpath for this session
[WARN] Server class 'org.apache.commons.collections.map.CaseInsensitiveMap' could not be found in the web app, but was found on the system classpath
[WARN] Adding classpath entry 'file:/C:/company/m2/repo/com/google/gwt/gwt-dev/2.4.0/gwt-dev-2.4.0.jar' to the web app classpath for this session
Starting Jetty on port 8888
[WARN] Failed startup of context com.google.gwt.dev.shell.jetty.JettyLauncher$WebAppContextWithReload@192232de{/,C:\company\projects\svn\reco\services\portal\trunk\portal-trunk\portal-entrypoint\target\portal-entrypoint-trunk}
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://camel.apache.org/schema/spring]
Offending resource: ServletContext resource [/WEB-INF/applicationContext.xml]

at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:80)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(BeanDefinitionParserDelegate.java:281)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1294)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1287)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:507)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:422)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:543)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:136)
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1220)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:513)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448)
at com.google.gwt.dev.shell.jetty.JettyLauncher$WebAppContextWithReload.doStart(JettyLauncher.java:468)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
at org.mortbay.jetty.handler.RequestLogHandler.doStart(RequestLogHandler.java:115)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
at org.mortbay.jetty.Server.doStart(Server.java:222)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
at com.google.gwt.dev.shell.jetty.JettyLauncher.start(JettyLauncher.java:672)
at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:509)
at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1068)
at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:811)
at com.google.gwt.dev.DevMode.main(DevMode.java:311)

我不知道该怎么办,我的同事也不知道。我也不知道这篇文章中还应包含哪些其他信息。

最佳答案

看起来您的 Eclipse“作为 Web 应用程序运行”设置正在使用 Jetty 而不是 tomcat,并且以某种方式导致不同的类路径配置。从外观上看,您可能会错过 jetty 上的一些 jar (与 Camel 相关)。

如果您不使用像 maven 这样的依赖管理,通常会发生这种情况,即:您必须有意识地管理哪个路径包含/不包含在哪个环境中的类路径中。

更简单的方法是使用相同的容器进行生产和开发,并通过在 maven pom 中声明它来确保您需要的其他 jar 包含在 WEB-INF/lib 中。

关于java - 无法通过 eclipse 找到 XML 模式命名空间的 Spring NamespaceHandler [http ://camel. apache.org/schema/spring],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22701853/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com