0

我正在尝试将 THREDDS 数据服务器 (TDS) ( http://www.unidata.ucar.edu/software/thredds/current/tds/tutorial/GettingStarted.html ) 作为 WAR 文件部署在 tomcat 8 中,应该是琐碎的。但是在部署时,我在 Webapps Manager 中收到一条错误消息:

    FAIL - Application at context path /thredds could not be started

我试图通过查看日志文件来了解有关该问题的更多信息。由于有多个日志,我真的不知道哪个与此错误相关。无论如何,这是日志文件“localhost.2016-05-11.log”的内容,其中包含一些错误:

11-May-2016 11:38:39.811 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log Closing Spring root WebApplicationContext
11-May-2016 11:38:40.186 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log ContextListener: contextInitialized()
11-May-2016 11:38:40.186 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log SessionListener: contextInitialized()
11-May-2016 11:39:16.844 INFO [http-nio-8080-exec-10] org.apache.catalina.core.ApplicationContext.log No Spring WebApplicationInitializer types detected on classpath
11-May-2016 11:39:16.875 INFO [http-nio-8080-exec-10] org.apache.catalina.core.ApplicationContext.log Initializing Spring root WebApplicationContext
11-May-2016 11:39:19.781 SEVERE [http-nio-8080-exec-10] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ConfigCatalogManager': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private thredds.server.config.TdsContext thredds.core.ConfigCatalogManager.tdsContext; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tdsContext' defined in file [C:\Program Files (x86)\Tomcat 8.0\webapps\thredds\WEB-INF\classes\thredds\server\config\TdsContext.class]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: "tds.content.root.path" property isn't defined.
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1210)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:755)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4811)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5251)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
    at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1284)
    at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:666)
    at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:217)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
    at org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:136)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
    at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:614)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1502)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1458)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Unknown Source)
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private thredds.server.config.TdsContext thredds.core.ConfigCatalogManager.tdsContext; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tdsContext' defined in file [C:\Program Files (x86)\Tomcat 8.0\webapps\thredds\WEB-INF\classes\thredds\server\config\TdsContext.class]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: "tds.content.root.path" property isn't defined.
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:561)
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)
    ... 48 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tdsContext' defined in file [C:\Program Files (x86)\Tomcat 8.0\webapps\thredds\WEB-INF\classes\thredds\server\config\TdsContext.class]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: "tds.content.root.path" property isn't defined.
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1120)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1044)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:942)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:533)
    ... 50 more
Caused by: java.lang.IllegalStateException: "tds.content.root.path" property isn't defined.
    at thredds.server.config.TdsContext.afterPropertiesSet(TdsContext.java:315)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1633)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1570)
    ... 60 more

以下是“catalina.2016-05-11.log”文件的片段:

11-May-2016 11:39:16.298 FINE [http-nio-8080-exec-10] org.apache.jasper.servlet.TldScanner.scanResourcePaths No TLD files were found in resource path [/WEB-INF/jsp/errorpages/].
11-May-2016 11:39:16.313 FINE [http-nio-8080-exec-10] org.apache.jasper.servlet.TldScanner.scanResourcePaths No TLD files were found in resource path [/WEB-INF/jsp/thredds/server/serverinfo/].
11-May-2016 11:39:16.313 FINE [http-nio-8080-exec-10] org.apache.jasper.servlet.TldScanner.scanResourcePaths No TLD files were found in resource path [/WEB-INF/jsp/thredds/server/catalogservice/].
11-May-2016 11:39:16.313 FINE [http-nio-8080-exec-10] org.apache.jasper.servlet.TldScanner.scanResourcePaths No TLD files were found in resource path [/WEB-INF/jsp/thredds/server/dqc/].
11-May-2016 11:39:16.313 FINE [http-nio-8080-exec-10] org.apache.jasper.servlet.TldScanner.scanResourcePaths No TLD files were found in resource path [/WEB-INF/jsp/thredds/server/catalog/].
11-May-2016 11:39:16.313 FINE [http-nio-8080-exec-10] org.apache.jasper.servlet.TldScanner.scanResourcePaths No TLD files were found in resource path [/WEB-INF/jsp/thredds/server/cataloggen/].
11-May-2016 11:39:16.313 FINE [http-nio-8080-exec-10] org.apache.jasper.servlet.TldScanner.scanResourcePaths No TLD files were found in resource path [/WEB-INF/jsp/thredds/server/].
11-May-2016 11:39:16.313 FINE [http-nio-8080-exec-10] org.apache.jasper.servlet.TldScanner.scanResourcePaths No TLD files were found in resource path [/WEB-INF/jsp/thredds/].
11-May-2016 11:39:16.313 FINE [http-nio-8080-exec-10] org.apache.jasper.servlet.TldScanner.scanResourcePaths No TLD files were found in resource path [/WEB-INF/jsp/wms/].
11-May-2016 11:39:16.313 FINE [http-nio-8080-exec-10] org.apache.jasper.servlet.TldScanner.scanResourcePaths No TLD files were found in resource path [/WEB-INF/jsp/].
11-May-2016 11:39:16.313 FINE [http-nio-8080-exec-10] org.apache.jasper.servlet.TldScanner.scanResourcePaths No TLD files were found in resource path [/WEB-INF/altContent/startup/root/].
11-May-2016 11:39:16.313 FINE [http-nio-8080-exec-10] org.apache.jasper.servlet.TldScanner.scanResourcePaths No TLD files were found in resource path [/WEB-INF/altContent/startup/public/testdata/].
11-May-2016 11:39:16.313 FINE [http-nio-8080-exec-10] org.apache.jasper.servlet.TldScanner.scanResourcePaths No TLD files were found in resource path [/WEB-INF/altContent/startup/public/wcsExample/testdata/].
11-May-2016 11:39:16.313 FINE [http-nio-8080-exec-10] org.apache.jasper.servlet.TldScanner.scanResourcePaths No TLD files were found in resource path [/WEB-INF/altContent/startup/public/wcsExample/].
11-May-2016 11:39:16.313 FINE [http-nio-8080-exec-10] org.apache.jasper.servlet.TldScanner.scanResourcePaths No TLD files were found in resource path [/WEB-INF/altContent/startup/public/].
11-May-2016 11:39:16.313 FINE [http-nio-8080-exec-10] org.apache.jasper.servlet.TldScanner.scanResourcePaths No TLD files were found in resource path [/WEB-INF/altContent/startup/].
11-May-2016 11:39:16.313 FINE [http-nio-8080-exec-10] org.apache.jasper.servlet.TldScanner.scanResourcePaths No TLD files were found in resource path [/WEB-INF/altContent/].
11-May-2016 11:39:16.329 FINE [http-nio-8080-exec-10] org.apache.jasper.servlet.TldScanner.scanResourcePaths TLD files were found in resource path [/WEB-INF/taglib/wms/].
11-May-2016 11:39:16.329 FINE [http-nio-8080-exec-10] org.apache.jasper.servlet.TldScanner.scanResourcePaths No TLD files were found in resource path [/WEB-INF/taglib/].
11-May-2016 11:39:16.329 FINE [http-nio-8080-exec-10] org.apache.jasper.servlet.TldScanner.scanResourcePaths No TLD files were found in resource path [/WEB-INF/xsl/].
11-May-2016 11:39:16.329 FINE [http-nio-8080-exec-10] org.apache.jasper.servlet.TldScanner.scanResourcePaths No TLD files were found in resource path [/WEB-INF/tags/wms/].
11-May-2016 11:39:16.329 FINE [http-nio-8080-exec-10] org.apache.jasper.servlet.TldScanner.scanResourcePaths No TLD files were found in resource path [/WEB-INF/tags/].
11-May-2016 11:39:16.329 FINE [http-nio-8080-exec-10] org.apache.jasper.servlet.TldScanner.scanResourcePaths No TLD files were found in resource path [/WEB-INF/palettes/].
11-May-2016 11:39:16.329 FINE [http-nio-8080-exec-10] org.apache.jasper.servlet.TldScanner.scanResourcePaths No TLD files were found in resource path [/WEB-INF/views/].
11-May-2016 11:39:16.329 FINE [http-nio-8080-exec-10] org.apache.jasper.servlet.TldScanner.scanResourcePaths No TLD files were found in resource path [/WEB-INF/].
11-May-2016 11:39:16.329 FINE [http-nio-8080-exec-10] org.apache.jasper.servlet.TldScanner$TldScannerCallback.scan No TLD files were found in [file:/C:/Program%20Files%20(x86)/Tomcat%208.0/webapps/thredds/WEB-INF/lib/spring-beans-4.1.6.RELEASE.jar]. Consider adding the JAR to the tomcat.util.scan.StandardJarScanFilter.jarsToSkip property in CATALINA_BASE/conf/catalina.properties file.
11-May-2016 11:39:16.329 FINE [http-nio-8080-exec-10] org.apache.jasper.servlet.TldScanner$TldScannerCallback.scan No TLD files were found in [file:/C:/Program%20Files%20(x86)/Tomcat%208.0/webapps/thredds/WEB-INF/lib/52n-xml-sampling-v20-2.1.0.jar]. Consider adding the JAR to the tomcat.util.scan.StandardJarScanFilter.jarsToSkip property in CATALINA_BASE/conf/catalina.properties file.
11-May-2016 11:39:16.329 FINE [http-nio-8080-exec-10] org.apache.jasper.servlet.TldScanner$TldScannerCallback.scan No TLD files were found in [file:/C:/Program%20Files%20(x86)/Tomcat%208.0/webapps/thredds/WEB-INF/lib/jsi-1.0b8.jar]. Consider adding the JAR to the tomcat.util.scan.StandardJarScanFilter.jarsToSkip property in CATALINA_BASE/conf/catalina.properties file.
11-May-2016 11:39:16.329 FINE [http-nio-8080-exec-10] org.apache.jasper.servlet.TldScanner$TldScannerCallback.scan No TLD files were found in [file:/C:/Program%20Files%20(x86)/Tomcat%208.0/webapps/thredds/WEB-INF/lib/geotk-xml-base-3.21.jar]. Consider adding the JAR to the tomcat.util.scan.StandardJarScanFilter.jarsToSkip property in CATALINA_BASE/conf/catalina.properties file.
11-May-2016 11:39:16.344 FINE [http-nio-8080-exec-10] org.apache.jasper.servlet.TldScanner$TldScannerCallback.scan No TLD files were found in [file:/C:/Program%20Files%20(x86)/Tomcat%208.0/webapps/thredds/WEB-INF/lib/log4j-core-2.2.jar]. Consider adding the JAR to the tomcat.util.scan.StandardJarScanFilter.jarsToSkip property in CATALINA_BASE/conf/catalina.properties file.
11-May-2016 11:39:16.344 FINE [http-nio-8080-exec-10] org.apache.jasper.servlet.TldScanner$TldScannerCallback.scan No TLD files were found in [file:/C:/Program%20Files%20(x86)/Tomcat%208.0/webapps/thredds/WEB-INF/lib/httpmime-4.5.1.jar]. Consider adding the JAR to the tomcat.util.scan.StandardJarScanFilter.jarsToSkip property in CATALINA_BASE/conf/catalina.properties file.
11-May-2016 11:39:16.344 FINE [http-nio-8080-exec-10] org.apache.jasper.servlet.TldScanner$TldScannerCallback.scan No TLD files were found in [file:/C:/Program%20Files%20(x86)/Tomcat%208.0/webapps/thredds/WEB-INF/lib/aopalliance-1.0.jar]. Consider adding the JAR to the tomcat.util.scan.StandardJarScanFilter.jarsToSkip property in CATALINA_BASE/conf/catalina.properties file.
11-May-2016 11:39:16.344 FINE [http-nio-8080-exec-10] org.apache.jasper.servlet.TldScanner$TldScannerCallback.scan No TLD files were found in [file:/C:/Program%20Files%20(x86)/Tomcat%208.0/webapps/thredds/WEB-INF/lib/jackson-core-2.5.3.jar]. Consider adding the JAR to the tomcat.util.scan.StandardJarScanFilter.jarsToSkip property in CATALINA_BASE/conf/catalina.properties file.
11-May-2016 11:39:16.344 FINE [http-nio-8080-exec-10] org.apache.jasper.servlet.TldScanner$TldScannerCallback.scan No TLD files were found in [file:/C:/Program%20Files%20(x86)/Tomcat%208.0/webapps/thredds/WEB-INF/lib/c3p0-0.9.1.1.jar]. Consider adding the JAR to the tomcat.util.scan.StandardJarScanFilter.jarsToSkip property in CATALINA_BASE/conf/catalina.properties file.
11-May-2016 11:39:16.344 FINE [http-nio-8080-exec-10] org.apache.jasper.servlet.TldScanner$TldScannerCallback.scan No TLD files were found in [file:/C:/Program%20Files%20(x86)/Tomcat%208.0/webapps/thredds/WEB-INF/lib/jna-4.1.0.jar]. Consider adding the JAR to the tomcat.util.scan.StandardJarScanFilter.jarsToSkip property in CATALINA_BASE/conf/catalina.properties file.
11-May-2016 11:39:16.344 FINE [http-nio-8080-exec-10] org.apache.jasper.servlet.TldScanner$TldScannerCallback.scan No TLD files were found in [file:/C:/Program%20Files%20(x86)/Tomcat%208.0/webapps/thredds/WEB-INF/lib/52n-oxf-xmlbeans-2.0.0-alpha.3.3.jar]. Consider adding the JAR to the tomcat.util.scan.StandardJarScanFilter.jarsToSkip property in CATALINA_BASE/conf/catalina.properties file.

我试图弄清楚这些错误是什么意思,但在过去的几个小时里我没有进一步了解。我尝试使用我自己创建的 Eclipse 项目部署另一个 .war,它运行良好。有人可以帮我解决这个问题吗?

更新: - - - - - - - - - - - - - - - - - - - - - - - - ----------------------

好的,所以我尝试通过创建一个setenv.bat(.bat 而不是 .sv 来解决这个问题,因为我正在运行 Windows 7)。如果我做对了,tds.content.root.pathinsidesetenv.bat通常指向contentTomcat 主目录中的一个文件夹,其中包含类似threddsConfig.xml见这里)的文件。不幸的是,我发现在我的 tomcat 主目录中没有应有的“内容”文件夹。

所以这个目录通常应该在部署 TDS 时自动创建,但这并没有发生。有人可以解释一下我能做些什么吗?

4

2 回答 2

2

根据本文中的描述。将系统属性添加-Dtds.content.root.path=?a valid folder?到 Tomcat setenv 脚本可以解决问题。

5/19 更新:

要为安装为 Windows 服务的 Tomcat 设置系统属性,解决方案之一是执行 GUI 应用程序Tomcat8w

  1. 打开命令行窗口并将目录更改为$TOMCAT_HOME\bin
  2. 执行tomcat8w //ES//Tomcat8Tomcat8是默认服务名)
  3. 在Java 选项中添加系统属性
  4. 单击应用/确定,然后重新启动服务。

阅读Windows 服务 HOW-TO以获取更多详细信息...

于 2016-05-11T15:36:17.637 回答
1

正如其他人所说,您尚未定义该tds.content.root.path属性。您通常会在 中执行此操作setenv.sh,您需要在 Tomcatbin/目录中创建它。是 Unidata 的教程。

Content Root 只是 THREDDS 的工作目录。你把你的根目录放在那里。它也是写入日志和缓存数据的地方。

于 2016-05-11T16:24:25.267 回答