flixe
flixe

Reputation: 656

THREDDS Data Server: Deployment fails in Tomcat 8

I´m trying to deploy THREDDS Data Server (TDS) (http://www.unidata.ucar.edu/software/thredds/current/tds/tutorial/GettingStarted.html) as a WAR file in tomcat 8, which should be trivial. But when deploying i get an error message in the Webapps Manager:

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

I tried to find out more about the problem by looking into the log files. Since there are several logs, i didn´t really know which one is relevant for this error. Anyway, this is the content of log file "localhost.2016-05-11.log" and it contains some errors:

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

The following is a snippet from the "catalina.2016-05-11.log" file:

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.

I´ve tried to figure out what these errors mean, but i didn´t get any further in the last hours. I tried to deploy another .war with an eclipse project i created myself and it works fine. Can someone please help me with this problem?

Update: ----------------------------------------------------------------------

Ok, so i tried to solve the problem by creating a setenv.bat (.bat instead of .sv because i´m running windows 7). If i got it right, the tds.content.root.path within setenv.bat normally points to a content folder within tomcat home directory which contains files like threddsConfig.xml(see here). Unfortunately, i discovered that in my tomcat home directory there is no "content" folder like it should be.

So this directory normally should be created automatically when deploying the TDS, but this is not happening. Can somebody explain what i can do about that?

Upvotes: 0

Views: 2365

Answers (2)

Beck Yang
Beck Yang

Reputation: 3024

Based on description in this article. Add system property -Dtds.content.root.path=?a valid folder? to Tomcat setenv scrtipt could fix the problem.

Update in 5/19:

To set system propety for Tomcat installed as Windows service, one of solution is executing GUI application Tomcat8w

  1. Open command line windows and change dir to $TOMCAT_HOME\bin
  2. Execute tomcat8w //ES//Tomcat8 (Tomcat8 is the default service name)
  3. Add system property in Java Options
  4. Click Apply/OK, then restart service.

Read Windows service HOW-TO for more detail...

Upvotes: 2

Christian W
Christian W

Reputation: 25

As others have said, you haven't defined the tds.content.root.path property. You'd typically do that in setenv.sh, which you'll need to create in the Tomcat bin/ directory. Here is a tutorial from Unidata.

The Content Root is simply the working directory of THREDDS. You put your root catalog there. It's also where logs and cache data are written.

Upvotes: 1

Related Questions