该应用程序使用Spring框架,需要一个名为config的环境变量。路径,可以在名为web的文件中配置。xml。看起来是这样的:
<!-- Creates the Spring Container shared by all Servlets and Filters -->
<!-- *** Opcional, si no se quiere arrancar la aplicación con ninguna JAVA_OPT *** -->
<!-- context-param>
<param-name>config.path</param-name>
<param-value>ruta_absoluta_carpeta_ficheros_configuracion</param-value>
</context-param-->
<listener>
<listener-class>es.mpt.dsic.inside.ws.configuration.ConfigLoaderListener</listener-class>
</listener>
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>file:${config.path}/log4j.properties</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:es/mpt/dsic/inside/context/inside-ws-context.xml,
/WEB-INF/mvc-dispatcher-servlet.xml,
classpath:es/mpt/dsic/inside/context/inside-security-context.xml,
classpath:es/mpt/dsic/inside/context/inside-context.xml
</param-value>
</context-param>
<servlet>
<servlet-name>CXFServlet</servlet-name>
<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>CXFServlet</servlet-name>
<url-pattern>/ws/*</url-pattern>
</servlet-mapping>
<!-- Spring MVC -->
<servlet>
<servlet-name>mvc-dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>mvc-dispatcher</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<!-- Spring Security -->
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- Spring encoding obligando a utf-8 -->
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- Firma Trifasica -->
<servlet>
<description>Servicio de firma electronica en 3 fases v2.1</description>
<servlet-name>SignatureService</servlet-name>
<servlet-class>es.gob.afirma.triphase.server.SignatureService</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>SignatureService</servlet-name>
<url-pattern>/SignatureService</url-pattern>
</servlet-mapping>
我是这样设置的:
<context-param>
<param-name>config.path</param-name>
<param-value>/var/lib/tomcat8/webapps/aplicacion/resources/config</param-value>
</context-param>
Mi的问题是,如果我让这些行评论并尝试部署应用程序,我得到这个错误在catalina.out:
INFORMACIÓN: Despliegue del archivo /var/lib/tomcat8/webapps/inside.war de la aplicación web abr 25, 2017 1:51:12 PM org.apache.jasper.servlet.TldScanner scanJars INFORMACIÓN: Al menos un JAR, que se ha explorado buscando TLDs, aún no contenía TLDs. Activar historial de depuración para este historiador para una completa lista de los JARs que fueron explorados y de los que nos se halló TLDs. Saltarse JARs no necesarios durante la exploración puede dar lugar a una mejora de tiempo significativa en el arranque y compilación de JSP . DEBUG: setDebug: JavaMail version 1.4ea 13:51:16,880 ERROR ContextLoader:308 - Context initialization failed java.lang.IllegalArgumentException: Could not resolve placeholder 'config.path' at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:173) at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:125) at org.springframework.core.env.AbstractPropertyResolver.doResolvePlaceholders(AbstractPropertyResolver.java:151) at org.springframework.core.env.AbstractPropertyResolver.resolveRequiredPlaceholders(AbstractPropertyResolver.java:142) at org.springframework.core.env.AbstractEnvironment.resolveRequiredPlaceholders(AbstractEnvironment.java:440) at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:188) at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:149) at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:126) at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:263) at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:203) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:617) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:446) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:385) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4812) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5255) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:939) at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1812) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) abr 25, 2017 1:51:16 PM org.apache.catalina.core.StandardContext startInternal GRAVE: One or more listeners failed to start. Full details will be found in the appropriate container log file abr 25, 2017 1:51:16 PM org.apache.catalina.core.StandardContext startInternal GRAVE: Falló en arranque del Contexto [/inside] debido a errores previos 13:51:16,938 WARN XmlWebApplicationContext:1028 - Exception thrown from ApplicationListener handling ContextClosedEvent java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: Root WebApplicationContext: startup date [Tue Apr 25 13:51:12 CEST 2017]; root of context hierarchy at org.springframework.context.support.AbstractApplicationContext.getApplicationEventMulticaster(AbstractApplicationContext.java:337) at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:324) at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1025) at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:988) at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:556) at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:142) at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4859) at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5478) at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:224) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:159) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:939) at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1812) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) 13:51:16,939 WARN XmlWebApplicationContext:1036 - Exception thrown from LifecycleProcessor on context close java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context: Root WebApplicationContext: startup date [Tue Apr 25 13:51:12 CEST 2017]; root of context hierarchy at org.springframework.context.support.AbstractApplicationContext.getLifecycleProcessor(AbstractApplicationContext.java:350) at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1033) at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:988) at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:556) at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:142) at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4859) at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5478) at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:224) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:159) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:939) at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1812) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) abr 25, 2017 1:51:17 PM org.apache.catalina.startup.HostConfig deployWAR INFORMACIÓN: Deployment of web application archive /var/lib/tomcat8/webapps/inside.war has finished in 8.323 ms
但是如果这些行没有注释,tomcat就不会启动,catalina.out显示:
abr 25, 2017 12:10:08 PM org.apache.jasper.servlet.TldScanner scanJars INFORMACIÓN: Al menos un JAR, que se ha explorado buscando TLDs, aún no contenía TLDs. Activar historial de depuración para este historiador para una completa lista de los JARs que fueron explorados y de los que nos se halló TLDs. Saltarse JARs no necesarios durante la exploración puede dar lugar a una mejora de tiempo significativa en el arranque y compilación de JSP . DEBUG: setDebug: JavaMail version 1.4ea
我知道这是关于配置,但我不知道如何继续
注意:从来没有使用过. war文件,所以我有点迷路了。我使用tomcat8。
这条线
<param-value>file:${config.path}/log4j.properties</param-value>
需要指定一个java系统参数,您可以在Tomcat中通过将其添加到catalina中的java_OPTS中来执行此操作。嘘,所以你需要这样的东西:
JAVA_OPTS='-Xmx256m -Djava.awt.headless=true -Dconfig.path=/var/lib/tomcat8/webapps/aplicacion/resources/config'
卡特琳娜提取物。tomcat7的sh如下所示:
# JAVA_OPTS (Optional) Java runtime options used when any command
# is executed.
# Include here and not in CATALINA_OPTS all options, that
# should be used by Tomcat and also by the stop process,
# the version command etc.
# Most options should go into CATALINA_OPTS.
#
我开发了一个springboot war文件来部署到服务器中,但是由于某些原因,我不得不将它部署到xampp的tomcat中,但是我得到了如下错误。我怎么才能修好这个? 信息:validateJarFile(c:\xampp\tomcat\webapps\ipf-2.0.0.rc2\WEB-INF\lib\tomcat-embed-core-8.5.28.jar)-jar未加载。参见Servlet
数据库为:MSSQL 2008 R2 OS=Windows Server 2008 R2 错误日志为: 2014年3月12日下午5:19:53 org.apache.catalina.realm.UserDatabaseRealm开始内部严重:异常查找键UserDatabase javax.naming.NameNotFoundException:Name[UserDatabase]下的UserD
在此示例的基础上:https://github.com/Pentadrago/spring-boot-example-wicket 并考虑到这里的jar-to-war指南:https://spring.io/guides/gs/convert-jar-to-war/ 我想将我现有的Wicket Spring(使用data-jpa和安全性)转换为Spring Boot。让胖罐设置工作相当容易,但到目
我已经将Shopizer war文件部署到Tomcat Elastic Beanstalk实例。我已经配置了一个mySQL数据库,据我所知,一切都应该是正确的。问题是当我尝试访问URL时,我收到了502错误。我知道Elastic Beanstalk在60后超时,所以我增加了超时限制,但仍然遇到了问题。 我在我的Catalina.out日志中注意到了这一点。我知道这只是一个警告,但它可能指向我的问题
在“生产模式”(使用Vaadin 19.0.9和gradle)下生成“war”文件(大小为90 MB)后,Tomcat 9.0.52中的部署过程非常慢并显示此错误 这种错误经常发生,但并不总是如此。 tomcat服务器运行在Ubuntu 18上,内存为8gb。java版本为15.0.2(适用于此计算机和用于开发的计算机)。 知道吗?谢谢 PS:这是堆栈跟踪:
tomcat支持war部署@运行时??? 当部署多个war文件时,发生tomcat permGen运行时内存不足错误,请停止tomcat并部署并重新启动该时间错误。这个错误的实际原因是什么。是否存在任何tomcat配置问题。