I want to know while developing an internationalization application in struts2 where to put property files named "global" as base name and "Action" as Base name using eclipse?
How are properties file loaded in struts2(since we are using any statement for property loading).How does control flow?
What are reasons if I am getting error like request resource not available on running application?
index.jsp:
<%# page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%#taglib uri="/struts-tags" prefix="s" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Internationalization</title>
</head>
<body>
<h1><s:text name="global.heading"/></h1>
<s:url id="indexEn" action="locale" namespace="/">
<s:param name="request_locale">en</s:param>
</s:url>
<s:url id="indexUR" action="locale" namespace="/">
<s:param name="request_locale">ur</s:param>
</s:url>
<s:url id="indexHN" action="locale" namespace="/">
<s:param name="request_locale">hn</s:param>
</s:url>
<s:a href="%{indexEn}">English</s:a>
<s:a href="%{indexUR}">Urdu</s:a>
<s:a href="%{indexHN}">Hindi</s:a>
<s:form action="emp">
<s:textfield name="name" key="global.name" size="20"/>
<s:textfield name="age" key="global.age" size="20"/>
<s:submit name="submit" key="global.submit" align="right"/>
</s:form>
</body>
</html>
action file:
package com.Localization.myPack;
import com.opensymphony.xwork2.ActionSupport;
public class Employee extends ActionSupport{
private String name;
private int age;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public String execute()
{
return"success";
}
}
Locale file:
global.heading=Select locale
global.age=Age
global.submit=submit
global.success=Successfully authenticated
struts.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<constant name="struts.devMode" value="true" />
<!-- <constant name="struts.custom.i18n.resources" value="global" /> -->
<package name="default" extends="struts-default">
<action name="emp" class="com.Localization.myPack.Employee" method="execute">
<result name="success">/success.jsp</result>
<result name="input">/index.jsp</result>
</action>
<action name="locale" class="com.Localization.myPack.Locale" method="execute">
<result name="success">/index.jsp</result>
</action>
</package>
</struts>
Stack trace:
May 04, 2016 1:47:28 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Localization' did not find a matching property.
May 04, 2016 1:47:28 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version: Apache Tomcat/7.0.57
May 04, 2016 1:47:28 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built: Nov 3 2014 08:39:16 UTC
May 04, 2016 1:47:29 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number: 7.0.57.0
May 04, 2016 1:47:29 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name: Windows 7
May 04, 2016 1:47:29 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version: 6.1
May 04, 2016 1:47:29 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture: x86
May 04, 2016 1:47:29 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JAVA_HOME: C:\Program Files (x86)\Java\jdk1.8.0_20\jre
May 04, 2016 1:47:29 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version: 1.8.0_20-b26
May 04, 2016 1:47:29 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor: Oracle Corporation
May 04, 2016 1:47:29 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE: C:\Users\javed\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp1
May 04, 2016 1:47:29 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME: C:\apache-tomcat-7.0.57
May 04, 2016 1:47:29 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=C:\Users\javed\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp1
May 04, 2016 1:47:29 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=C:\apache-tomcat-7.0.57
May 04, 2016 1:47:29 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dwtp.deploy=C:\Users\javed\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps
May 04, 2016 1:47:29 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=C:\apache-tomcat-7.0.57\endorsed
May 04, 2016 1:47:29 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dfile.encoding=Cp1252
May 04, 2016 1:47:29 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files (x86)\Java\jdk1.8.0_20\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files (x86)/Java/jdk1.8.0_20/jre/bin/client;C:/Program Files (x86)/Java/jdk1.8.0_20/jre/bin;C:/Program Files (x86)/Java/jdk1.8.0_20/jre/lib/i386;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Java\jdk1.8.0_20\bin;C:\Users\javed\Desktop;;.
May 04, 2016 1:47:33 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
May 04, 2016 1:47:33 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
May 04, 2016 1:47:33 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 11757 ms
May 04, 2016 1:47:33 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
May 04, 2016 1:47:33 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.57
May 04, 2016 1:47:35 PM org.apache.catalina.util.SessionIdGenerator createSecureRandom
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [601] milliseconds.
May 04, 2016 1:47:39 PM com.opensymphony.xwork2.config.providers.XmlConfigurationProvider info
INFO: Parsing configuration file [struts-default.xml]
May 04, 2016 1:47:39 PM com.opensymphony.xwork2.config.providers.XmlConfigurationProvider info
INFO: Unable to locate configuration files of the name struts-plugin.xml, skipping
May 04, 2016 1:47:39 PM com.opensymphony.xwork2.config.providers.XmlConfigurationProvider info
INFO: Parsing configuration file [struts-plugin.xml]
May 04, 2016 1:47:39 PM com.opensymphony.xwork2.config.providers.XmlConfigurationProvider info
INFO: Parsing configuration file [struts.xml]
May 04, 2016 1:47:39 PM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.ObjectFactory)
May 04, 2016 1:47:39 PM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.factory.ActionFactory)
May 04, 2016 1:47:39 PM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.factory.ResultFactory)
May 04, 2016 1:47:39 PM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.factory.ConverterFactory)
May 04, 2016 1:47:39 PM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.factory.InterceptorFactory)
May 04, 2016 1:47:39 PM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.factory.ValidatorFactory)
May 04, 2016 1:47:39 PM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.factory.UnknownHandlerFactory)
May 04, 2016 1:47:39 PM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.FileManagerFactory)
May 04, 2016 1:47:39 PM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.conversion.impl.XWorkConverter)
May 04, 2016 1:47:39 PM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.conversion.impl.CollectionConverter)
May 04, 2016 1:47:39 PM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.conversion.impl.ArrayConverter)
May 04, 2016 1:47:39 PM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.conversion.impl.DateConverter)
May 04, 2016 1:47:39 PM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.conversion.impl.NumberConverter)
May 04, 2016 1:47:39 PM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.conversion.impl.StringConverter)
May 04, 2016 1:47:39 PM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.conversion.ConversionPropertiesProcessor)
May 04, 2016 1:47:39 PM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.conversion.ConversionFileProcessor)
May 04, 2016 1:47:39 PM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.conversion.ConversionAnnotationProcessor)
May 04, 2016 1:47:39 PM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.conversion.TypeConverterCreator)
May 04, 2016 1:47:39 PM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.conversion.TypeConverterHolder)
May 04, 2016 1:47:39 PM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.TextProvider)
May 04, 2016 1:47:39 PM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.LocaleProvider)
May 04, 2016 1:47:39 PM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.ActionProxyFactory)
May 04, 2016 1:47:39 PM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.conversion.ObjectTypeDeterminer)
May 04, 2016 1:47:39 PM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (org.apache.struts2.dispatcher.mapper.ActionMapper)
May 04, 2016 1:47:39 PM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (jakarta) for (org.apache.struts2.dispatcher.multipart.MultiPartRequest)
May 04, 2016 1:47:39 PM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (org.apache.struts2.views.freemarker.FreemarkerManager)
May 04, 2016 1:47:39 PM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (org.apache.struts2.components.UrlRenderer)
May 04, 2016 1:47:39 PM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.validator.ActionValidatorManager)
May 04, 2016 1:47:39 PM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.util.ValueStackFactory)
May 04, 2016 1:47:39 PM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.util.reflection.ReflectionProvider)
May 04, 2016 1:47:39 PM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.util.reflection.ReflectionContextFactory)
May 04, 2016 1:47:39 PM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.util.PatternMatcher)
May 04, 2016 1:47:39 PM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (org.apache.struts2.util.ContentTypeMatcher)
May 04, 2016 1:47:39 PM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (org.apache.struts2.dispatcher.StaticContentLoader)
May 04, 2016 1:47:39 PM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.UnknownHandlerManager)
May 04, 2016 1:47:39 PM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (org.apache.struts2.views.util.UrlHelper)
May 04, 2016 1:47:39 PM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.util.TextParser)
May 04, 2016 1:47:39 PM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (org.apache.struts2.dispatcher.DispatcherErrorHandler)
May 04, 2016 1:47:39 PM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.security.ExcludedPatternsChecker)
May 04, 2016 1:47:39 PM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.security.AcceptedPatternsChecker)
May 04, 2016 1:47:39 PM com.opensymphony.xwork2.config.providers.InterceptorBuilder warn
WARNING: Unable to load config class org.apache.struts2.interceptor.debugging.DebuggingInterceptor at interceptor - jar:file:/C:/Users/javed/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/Localization/WEB-INF/lib/struts2-core-2.3.28.jar!/struts-default.xml:198:115 probably due to a missing jar, which might be fine if you never plan to use the debugging interceptor
May 04, 2016 1:47:39 PM com.opensymphony.xwork2.config.providers.InterceptorBuilder error
SEVERE: Actual exception
Caught Exception while registering Interceptor class org.apache.struts2.interceptor.debugging.DebuggingInterceptor - interceptor - jar:file:/C:/Users/javed/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/Localization/WEB-INF/lib/struts2-core-2.3.28.jar!/struts-default.xml:198:115
at com.opensymphony.xwork2.ObjectFactory.buildInterceptor(ObjectFactory.java:202)
at com.opensymphony.xwork2.config.providers.InterceptorBuilder.constructInterceptorReference(InterceptorBuilder.java:59)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.lookupInterceptorReference(XmlConfigurationProvider.java:1092)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadInterceptorStack(XmlConfigurationProvider.java:798)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadInterceptorStacks(XmlConfigurationProvider.java:811)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadInterceptors(XmlConfigurationProvider.java:834)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:441)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:265)
at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:112)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:189)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:55)
at org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:970)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:438)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:482)
at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:57)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4830)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5510)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
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)
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.inject(ContainerImpl.java:295)
at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:485)
at com.opensymphony.xwork2.inject.ContainerImpl$6.call(ContainerImpl.java:523)
at com.opensymphony.xwork2.inject.ContainerImpl$6.call(ContainerImpl.java:522)
at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:574)
at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:521)
at com.opensymphony.xwork2.ObjectFactory.injectInternalBeans(ObjectFactory.java:127)
at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:152)
at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:139)
at com.opensymphony.xwork2.ObjectFactory.buildInterceptor(ObjectFactory.java:180)
... 27 more
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:132)
at com.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:51)
at com.opensymphony.xwork2.inject.ContainerImpl$ParameterInjector.inject(ContainerImpl.java:462)
at com.opensymphony.xwork2.inject.ContainerImpl.getParameters(ContainerImpl.java:477)
at com.opensymphony.xwork2.inject.ContainerImpl.access$000(ContainerImpl.java:34)
at com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.inject(ContainerImpl.java:293)
... 36 more
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:495)
at com.opensymphony.xwork2.inject.ContainerImpl$7.call(ContainerImpl.java:532)
at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:581)
at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:530)
at com.opensymphony.xwork2.config.impl.LocatableFactory.create(LocatableFactory.java:32)
at com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:130)
... 41 more
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.inject(ContainerImpl.java:295)
at com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(ContainerImpl.java:431)
at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:492)
... 46 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.inject(ContainerImpl.java:293)
... 48 more
Caused by: java.lang.NullPointerException
at org.apache.struts2.views.freemarker.FreemarkerManager.setContainer(FreemarkerManager.java:222)
... 53 more
May 04, 2016 1:47:40 PM org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter struts2
java.lang.NoSuchMethodError: com.opensymphony.xwork2.util.LocalizedTextUtil.setDevMode(Z)V
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:444)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:482)
at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:57)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4830)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5510)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
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)
May 04, 2016 1:47:40 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error filterStart
May 04, 2016 1:47:40 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/Localization] startup failed due to previous errors
May 04, 2016 1:47:40 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/Localization] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10#1337873]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;#78064a]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
May 04, 2016 1:47:40 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/Localization] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10#79805f]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;#f02062]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
May 04, 2016 1:47:40 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/Localization] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal#182c2f]) and a value of type [com.opensymphony.xwork2.inject.ContainerImpl] (value [com.opensymphony.xwork2.inject.ContainerImpl#b82ff0]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
May 04, 2016 1:47:40 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
May 04, 2016 1:47:40 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
May 04, 2016 1:47:40 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 6784 ms
Where to put property files named "global" as base name and "Action" as Base name using eclipse?
The MyAction.properties file should be in the same package as the MyAction class.
The global property files can be anywhere. E.g. put it in one of your source packages like "my.app.i18n" and define in the struts.properties file the path to that package with the key "struts.custom.i18n.resources".
How does control flow?
Struts tries to find properties files from classname.properties to global.properties. There order is:
1. ActionClass.properties
2. Interface.properties (every interface and sub-interface)
3. BaseClass.properties (all the way to Object.properties)
4. ModelDriven's model (if implements ModelDriven), for the model object repeat from 1
5. package.properties (of the directory where class is located and every parent directory all the way to the root directory)
6. search up the i18n message key hierarchy itself
7. global resource properties
(Taken from: https://struts.apache.org/docs/localization.html, also read this for more details)
Related
Problems running Apache Ranger 2.2 admin
I'm trying to run Apache Ranger 2.2 admin, but I get an error when entering the main page. At the same time, I checked version 2.1 on the same machine, it works without problems. I also tried the SNAPSHOT version, the same error as 2.2
When entering the page http://host:6080
HTTP Status 404 – Not Found
Do you have any ideas where to look, how to fix it?
Thanks!
Ubuntu 18
In the catalina.out logs
May 06, 2022 6:20:55 AM org.apache.ranger.server.tomcat.EmbeddedServer getKeyManagers
WARNING: Unable to read credential from credential store file [/opt/ranger/ranger-2.2.0-admin/ews/webapp/WEB-INF/classes/conf/.jceks/rangeradmin.jceks] for given alias:keyStoreCredentialAlias
May 06, 2022 6:20:55 AM org.apache.ranger.server.tomcat.EmbeddedServer getTrustManagers
WARNING: Config 'ranger.truststore.file' is not found or contains blank value!
May 06, 2022 6:20:55 AM org.apache.ranger.server.tomcat.EmbeddedServer start
INFO: Deriving webapp folder from catalina.base property. folder=/opt/ranger/ranger-2.2.0-admin/ews/webapp
May 06, 2022 6:20:55 AM org.apache.ranger.server.tomcat.EmbeddedServer start
INFO: Webapp file =/opt/ranger/ranger-2.2.0-admin/ews/webapp, webAppName = /
May 06, 2022 6:20:55 AM org.apache.ranger.server.tomcat.EmbeddedServer start
INFO: Adding webapp [/] = path [/opt/ranger/ranger-2.2.0-admin/ews/webapp] .....
May 06, 2022 6:20:55 AM org.apache.catalina.core.StandardContext setPath
WARNING: A context path must either be an empty string or start with a '/' and do not end with a '/'. The path [/] does not meet these criteria and has been changed to []
May 06, 2022 6:20:55 AM org.apache.ranger.server.tomcat.EmbeddedServer start
INFO: Finished init of webapp [/] = path [/opt/ranger/ranger-2.2.0-admin/ews/webapp].
May 06, 2022 6:20:55 AM org.apache.ranger.server.tomcat.EmbeddedServer start
INFO: Name is empty. Setting Name Rule as 'DEFAULT'
May 06, 2022 6:20:55 AM org.apache.ranger.server.tomcat.EmbeddedServer startServer
INFO: Server Name : rangeradmin
May 06, 2022 6:20:55 AM org.apache.ranger.server.tomcat.SolrCollectionBootstrapper <init>
INFO: Starting Solr Setup
May 06, 2022 6:20:55 AM org.apache.ranger.server.tomcat.SolrCollectionBootstrapper <init>
INFO: AUTHENTICATION_TYPE : null
May 06, 2022 6:20:55 AM org.apache.ranger.server.tomcat.SolrCollectionBootstrapper <init>
INFO: Solr Collection name provided is : ranger_audits
May 06, 2022 6:20:55 AM org.apache.ranger.server.tomcat.SolrCollectionBootstrapper <init>
INFO: Solr Config name provided is : ranger_audits
May 06, 2022 6:20:55 AM org.apache.ranger.server.tomcat.SolrCollectionBootstrapper <init>
INFO: No. of replicas provided is : 1
May 06, 2022 6:20:55 AM org.apache.ranger.server.tomcat.SolrCollectionBootstrapper <init>
INFO: Max no of nodes per shards provided is : 1
May 06, 2022 6:20:55 AM org.apache.ranger.server.tomcat.SolrCollectionBootstrapper <init>
INFO: Solr time interval provided is : 60000
May 06, 2022 6:20:55 AM org.apache.ranger.server.tomcat.SolrCollectionBootstrapper <init>
INFO: Provided custom configSet location : null
May 06, 2022 6:20:55 AM org.apache.ranger.server.tomcat.SolrCollectionBootstrapper run
INFO: Started run method
May 06, 2022 6:20:55 AM org.apache.ranger.server.tomcat.SolrCollectionBootstrapper run
SEVERE: Solr ZKHosts for Audit are empty. Please set property ranger.audit.solr.zookeepers
May 06, 2022 6:20:55 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-nio-6080"]
May 06, 2022 6:20:55 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
May 06, 2022 6:20:55 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service [Tomcat]
May 06, 2022 6:20:55 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet engine: [Apache Tomcat/8.5.69]
May 06, 2022 6:20:55 AM org.apache.catalina.startup.ContextConfig getDefaultWebXmlFragment
INFO: No global web.xml found
May 06, 2022 6:21:00 AM org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
May 06, 2022 6:21:00 AM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
May 06, 2022 6:21:00 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
May 06, 2022 6:21:02 AM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class [org.springframework.web.context.ContextLoaderListener]
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [org.apache.ranger.service.AuthSessionService]; nested exception is java.io.FileNotFoundException: class path resource [org/apache/ranger/service/AbstractBaseResourceService.class] cannot be opened because it does not exist
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:189)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:331)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:247)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:311)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:112)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:746)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:564)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:401)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:292)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:103)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4763)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5232)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1429)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.FileNotFoundException: class path resource [org/apache/ranger/service/AbstractBaseResourceService.class] cannot be opened because it does not exist
at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:187)
at org.springframework.core.type.classreading.SimpleMetadataReader.getClassReader(SimpleMetadataReader.java:55)
at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:49)
at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:103)
at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:123)
at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:81)
at org.springframework.context.annotation.ConfigurationClassParser.asSourceClass(ConfigurationClassParser.java:696)
at org.springframework.context.annotation.ConfigurationClassParser$SourceClass.getSuperClass(ConfigurationClassParser.java:1010)
at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:341)
at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:250)
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:207)
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:175)
... 18 more
May 06, 2022 6:21:02 AM org.apache.catalina.core.StandardContext startInternal
SEVERE: One or more listeners failed to start. Full details will be found in the appropriate container log file
May 06, 2022 6:21:02 AM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [] startup failed due to previous errors
May 06, 2022 6:21:02 AM org.apache.catalina.core.ApplicationContext log
INFO: Closing Spring root WebApplicationContext
May 06, 2022 6:21:02 AM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesJdbc
WARNING: The web application [ROOT] registered the JDBC driver [org.postgresql.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
May 06, 2022 6:21:02 AM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesJdbc
WARNING: The web application [ROOT] registered the JDBC driver [org.apache.solr.client.solrj.io.sql.DriverImpl] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
May 06, 2022 6:21:02 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-nio-6080"]
I have started Jenkins on an aws m5.24xlarge instance with 96 vCPU and 384 GiB memory). When starting it, I find myself unable to access it. curl localhost:8080 hangs forever and gets no response. Also, there is no log output.
However, stopping the same instance, changing the instance type to m5.12xlarge (48 vCPU and 192 GiB memory) and running the same configuration again, works.
This is the same for running it via java -jar jenkins.war, by installing it via the docker run jenkins/jenkins... command or by installing it from a ubuntu repo.
Can any of you reproduce that issue? Is there a known maximum number of cores Jenkins can handle or a maximum memory size?
Or is there a starting flag that I can set so it works?
Thanks in advance.
Edit: This is the log output
Running from: /home/ubuntu/jenkins.war
webroot: $user.home/.jenkins
Jul 06, 2018 1:55:38 PM org.eclipse.jetty.util.log.Log initialized
INFO: Logging initialized #236ms to org.eclipse.jetty.util.log.JavaUtilLog
Jul 06, 2018 1:55:38 PM winstone.Logger logInternal
INFO: Beginning extraction from war file
Jul 06, 2018 1:55:39 PM org.eclipse.jetty.server.handler.ContextHandler setContextPath
WARNING: Empty contextPath
Jul 06, 2018 1:55:39 PM org.eclipse.jetty.server.Server doStart
INFO: jetty-9.4.z-SNAPSHOT, build timestamp: 2017-11-21T21:27:37Z, git hash: 82b8fb23f757335bb3329d540ce37a2a2615f0a8
Jul 06, 2018 1:55:39 PM org.eclipse.jetty.webapp.StandardDescriptorProcessor visitServlet
INFO: NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet
Jul 06, 2018 1:55:39 PM org.eclipse.jetty.server.session.DefaultSessionIdManager doStart
INFO: DefaultSessionIdManager workerName=node0
Jul 06, 2018 1:55:39 PM org.eclipse.jetty.server.session.DefaultSessionIdManager doStart
INFO: No SessionScavenger set, using defaults
Jul 06, 2018 1:55:39 PM org.eclipse.jetty.server.session.HouseKeeper startScavenging
INFO: Scavenging every 660000ms
Jenkins home directory: /home/ubuntu/.jenkins found at: $user.home/.jenkins
Jul 06, 2018 1:55:40 PM org.eclipse.jetty.server.handler.ContextHandler doStart
INFO: Started w.#644c78d4{/,file:///home/ubuntu/.jenkins/war/,AVAILABLE}{/home/ubuntu/.jenkins/war}
Jul 06, 2018 1:55:40 PM org.eclipse.jetty.server.AbstractConnector doStart
INFO: Started ServerConnector#355e34c7{HTTP/1.1,[http/1.1]}{0.0.0.0:8080}
Jul 06, 2018 1:55:40 PM org.eclipse.jetty.server.Server doStart
INFO: Started #1886ms
Jul 06, 2018 1:55:40 PM winstone.Logger logInternal
INFO: Winstone Servlet Engine v4.0 running: controlPort=disabled
Jul 06, 2018 1:55:41 PM jenkins.InitReactorRunner$1 onAttained
INFO: Started initialization
Jul 06, 2018 1:55:41 PM jenkins.InitReactorRunner$1 onAttained
INFO: Listed all plugins
Jul 06, 2018 1:55:42 PM jenkins.InitReactorRunner$1 onAttained
INFO: Prepared all plugins
Jul 06, 2018 1:55:42 PM jenkins.InitReactorRunner$1 onAttained
INFO: Started all plugins
Jul 06, 2018 1:55:42 PM jenkins.InitReactorRunner$1 onAttained
INFO: Augmented all extensions
Jul 06, 2018 1:55:42 PM jenkins.InitReactorRunner$1 onAttained
INFO: Loaded all jobs
Jul 06, 2018 1:55:42 PM hudson.model.AsyncPeriodicWork$1 run
INFO: Started Download metadata
Jul 06, 2018 1:55:43 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.web.context.support.StaticWebApplicationContext#46ce48b7: display name [Root WebApplicationContext]; startup date [Fri Jul 06 13:55:43 UTC 2018]; root of context hierarchy
Jul 06, 2018 1:55:43 PM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
INFO: Bean factory for application context [org.springframework.web.context.support.StaticWebApplicationContext#46ce48b7]: org.springframework.beans.factory.support.DefaultListableBeanFactory#454a5ad5
Jul 06, 2018 1:55:43 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#454a5ad5: defining beans [authenticationManager]; root of factory hierarchy
Jul 06, 2018 1:55:43 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.web.context.support.StaticWebApplicationContext#37a2b2a7: display name [Root WebApplicationContext]; startup date [Fri Jul 06 13:55:43 UTC 2018]; root of context hierarchy
Jul 06, 2018 1:55:43 PM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
INFO: Bean factory for application context [org.springframework.web.context.support.StaticWebApplicationContext#37a2b2a7]: org.springframework.beans.factory.support.DefaultListableBeanFactory#74441a6d
Jul 06, 2018 1:55:43 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#74441a6d: defining beans [filter,legacy]; root of factory hierarchy
Jul 06, 2018 1:55:43 PM jenkins.install.SetupWizard init
INFO:
*************************************************************
*************************************************************
*************************************************************
Jenkins initial setup is required. An admin user has been created and a password generated.
Please use the following password to proceed to installation:
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
This may also be found at: /home/ubuntu/.jenkins/secrets/initialAdminPassword
*************************************************************
*************************************************************
*************************************************************
Jul 06, 2018 1:55:46 PM hudson.model.UpdateSite updateData
INFO: Obtained the latest update center data file for UpdateSource default
Jul 06, 2018 1:55:46 PM hudson.model.UpdateSite updateData
INFO: Obtained the latest update center data file for UpdateSource default
Jul 06, 2018 1:55:46 PM jenkins.InitReactorRunner$1 onAttained
INFO: Completed initialization
Jul 06, 2018 1:55:46 PM hudson.WebAppMain$3 run
INFO: Jenkins is fully up and running
Jul 06, 2018 1:55:46 PM hudson.model.DownloadService$Downloadable load
INFO: Obtained the updated data file for hudson.tasks.Maven.MavenInstaller
Jul 06, 2018 1:55:46 PM hudson.model.AsyncPeriodicWork$1 run
INFO: Finished Download metadata. 3,968 ms
I just started with this Struts 2 HelloWorld Tutorial [1] and exactly followed the steps explained in this tutorial but there is a problem with starting the filters. Here is the console output:
[1] https://www.tutorialspoint.com/struts_2/struts_examples.htm
Jun 06, 2017 4:53:35 PM org.apache.catalina.core.AprLifecycleListener init
INFORMATION: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.8.0_112\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jre1.8.0_131/bin/server;C:/Program Files/Java/jre1.8.0_131/bin;C:/Program Files/Java/jre1.8.0_131/lib/amd64;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Enterprise Vault\EVClient\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files\eclipse;;.
Jun 06, 2017 4:53:35 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNUNG: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:HelloWorldStruts2' did not find a matching property.
Jun 06, 2017 4:53:36 PM org.apache.coyote.AbstractProtocol init
INFORMATION: Initializing ProtocolHandler ["http-bio-18080"]
Jun 06, 2017 4:53:36 PM org.apache.catalina.startup.Catalina load
INFORMATION: Initialization processed in 428 ms
Jun 06, 2017 4:53:36 PM org.apache.catalina.core.StandardService startInternal
INFORMATION: Starting service Catalina
Jun 06, 2017 4:53:36 PM org.apache.catalina.core.StandardEngine startInternal
INFORMATION: Starting Servlet Engine: Apache Tomcat/7.0.52
Jun 06, 2017 4:53:39 PM org.apache.catalina.startup.TaglibUriRule body
INFORMATION: TLD skipped. URI: /struts-tags is already defined
Jun 06, 2017 4:53:39 PM org.apache.catalina.core.ApplicationContext log
INFORMATION: No Spring WebApplicationInitializer types detected on classpath
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console...
Jun 06, 2017 4:53:39 PM org.apache.catalina.core.StandardContext filterStart
SCHWERWIEGEND: Exception starting filter struts2
java.lang.reflect.InvocationTargetException - Class: com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector
File: ContainerImpl.java
Method: construct
Line: 427 - com/opensymphony/xwork2/inject/ContainerImpl.java:427:-1
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:450)
at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4809)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5485)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
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)
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(ContainerImpl.java:427)
at com.opensymphony.xwork2.inject.ContainerBuilder$5.create(ContainerBuilder.java:218)
at com.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:52)
at com.opensymphony.xwork2.inject.ContainerBuilder$3.create(ContainerBuilder.java:91)
at com.opensymphony.xwork2.inject.ContainerBuilder$7.call(ContainerBuilder.java:571)
at com.opensymphony.xwork2.inject.ContainerBuilder$7.call(ContainerBuilder.java:568)
at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:560)
at com.opensymphony.xwork2.inject.ContainerBuilder.create(ContainerBuilder.java:568)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.createBootstrapContainer(DefaultConfiguration.java:278)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:160)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:390)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:437)
... 14 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(ContainerImpl.java:410)
... 26 more
Caused by: java.lang.NoSuchMethodError: org.apache.commons.lang3.text.StrSubstitutor.setValueDelimiter(Ljava/lang/String;)Lorg/apache/commons/lang3/text/StrSubstitutor;
at com.opensymphony.xwork2.config.providers.EnvsValueSubstitutor.<init>(EnvsValueSubstitutor.java:32)
... 31 more
Jun 06, 2017 4:53:39 PM org.apache.catalina.core.StandardContext startInternal
SCHWERWIEGEND: Error filterStart
Jun 06, 2017 4:53:39 PM org.apache.catalina.core.StandardContext startInternal
SCHWERWIEGEND: Context [/HelloWorldStruts2] startup failed due to previous errors
Jun 06, 2017 4:53:39 PM org.apache.coyote.AbstractProtocol start
INFORMATION: Starting ProtocolHandler ["http-bio-18080"]
Jun 06, 2017 4:53:39 PM org.apache.catalina.startup.Catalina start
INFORMATION: Server startup in 3183 ms
I think there is no need to paste my code here as it is exactly the code as stated in the tutorial link above. Except I replaced
<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
with
<filter-class>
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
</filter-class>
as proposed in this answer, which did not resolve the issue: java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.FilterDispatcher
I am using struts 2.3.4, but tried it also with struts 2.2 and 2.5 - neither works.
I found the flaw: I have left the struts 2.5 jars in the "Deployment Assembly", since some other post proposed this when it showed some other exception. I removed them and booom.. now it works. Thanks, Aleksandr!
I'm new to struts2. I'm try to apply spring security on my struts2 application. I'm following this link.I'm getting this error. Help please. Thanks.
my web.xml is
`<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID" version="2.5">
<display-name>Archetype Created Web Application</display-name>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>`
and my applicationcontext-security.xml is
`<beans:beans xmlns="http://www.springframework.org
/schema/security"
xmlns:beans="http://www.springframework.org
/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org
/schema/beans
http://www.springframework.org/schema/beans/spring-
beans-4.0.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-
security-4.0.xsd">
<global-method-security pre-post-annotations="enabled">
<!-- AspectJ pointcut expression that locates our "post" method and applies
security that way <protect-pointcut expression="execution(* bigbank.*Service.post*(..))"
access="ROLE_TELLER"/> -->
</global-method-security>
<http auto-config="true" use-expressions="true">
<intercept-url pattern="/welcome" access="hasRole('ROLE_USER')" />
<form-login login-page="/login" default-target-url="/welcome"
authentication-failure-url="/loginfailed?error=true" />
<logout />
</http>
<authentication-manager>
<authentication-provider>
<user-service>
<user name="anjana" password="packt123" authorities="ROLE_USER" />
</user-service>
</authentication-provider>
</authentication-manager>
</beans:beans>`
and my struts.xml is `
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="default" namespace="/" extends="struts-default">
<action name="helloWorld">
<result>success.jsp</result>
</action>
<action name="login">
<result>login.jsp</result>
</action>
<action name="loginfailed">
<result>login.jsp?error=true</result>
</action>
<action name="welcome">
<result>index.jsp</result>
</action>
</package>
</struts>
console message is
Nov 04, 2015 12:05:00 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:Spring_Security_Struts2' did not find a matching property.
Nov 04, 2015 12:05:00 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version: Apache Tomcat/8.0.26
Nov 04, 2015 12:05:00 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built: Aug 18 2015 11:38:37 UTC
Nov 04, 2015 12:05:00 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number: 8.0.26.0
Nov 04, 2015 12:05:00 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name: Windows 7
Nov 04, 2015 12:05:00 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version: 6.1
Nov 04, 2015 12:05:00 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture: amd64
Nov 04, 2015 12:05:00 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Java Home: C:\Program Files\Java\jdk1.8.0_60\jre
Nov 04, 2015 12:05:00 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version: 1.8.0_60-b27
Nov 04, 2015 12:05:00 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor: Oracle Corporation
Nov 04, 2015 12:05:00 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE: C:\Users\jalagarip\Documents\GitHub\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
Nov 04, 2015 12:05:00 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME: C:\Users\jalagarip\tomcat\apache-tomcat-8.0.26
Nov 04, 2015 12:05:00 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=C:\Users\jalagarip\Documents\GitHub\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
Nov 04, 2015 12:05:00 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=C:\Users\jalagarip\tomcat\apache-tomcat-8.0.26
Nov 04, 2015 12:05:00 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dwtp.deploy=C:\Users\jalagarip\Documents\GitHub\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps
Nov 04, 2015 12:05:00 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=C:\Users\jalagarip\tomcat\apache-tomcat-8.0.26\endorsed
Nov 04, 2015 12:05:00 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dfile.encoding=Cp1252
Nov 04, 2015 12:05:00 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.8.0_60\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre1.8.0_65/bin/server;C:/Program Files/Java/jre1.8.0_65/bin;C:/Program Files/Java/jre1.8.0_65/lib/amd64;C:\ProgramData\Oracle\Java\javapath;C:\app\jalagarip\product\11.2.0\dbhome_1\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Users\jalagarip\curl;C:\Program Files\cURL\bin;C:\Program Files (x86)\Skype\Phone\;C:\Program Files (x86)\Apache Software Foundation\apache-maven-3.3.3\bin;C:\Program Files\Java\jdk1.8.0_60\bin;C:\Program Files\Java\jre1.8.0_60\bin;;C:\Users\jalagarip\Desktop;;.
Nov 04, 2015 12:05:00 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-nio-8080"]
Nov 04, 2015 12:05:00 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Nov 04, 2015 12:05:00 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-nio-8009"]
Nov 04, 2015 12:05:00 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Nov 04, 2015 12:05:00 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1025 ms
Nov 04, 2015 12:05:00 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Nov 04, 2015 12:05:00 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/8.0.26
Nov 04, 2015 12:05:03 PM org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Nov 04, 2015 12:05:04 PM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
Nov 04, 2015 12:05:04 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Nov 04, 2015 12:05:04 PM org.springframework.web.context.ContextLoader initWebApplicationContext
INFO: Root WebApplicationContext: initialization started
Nov 04, 2015 12:05:04 PM org.springframework.web.context.support.XmlWebApplicationContext prepareRefresh
INFO: Refreshing Root WebApplicationContext: startup date [Wed Nov 04 12:05:04 IST 2015]; root of context hierarchy
Nov 04, 2015 12:05:04 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext.xml]
Nov 04, 2015 12:05:04 PM org.springframework.web.context.ContextLoader initWebApplicationContext
SEVERE: Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:344)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:181)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:217)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:188)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:605)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:509)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:446)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:328)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4729)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5167)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
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)
Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
at org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:141)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:330)
... 21 more
Nov 04, 2015 12:05:04 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:344)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:181)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:217)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:188)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:605)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:509)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:446)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:328)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4729)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5167)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
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)
Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
at org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:141)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:330)
... 21 more
Nov 04, 2015 12:05:04 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: One or more listeners failed to start. Full details will be found in the appropriate container log file
Nov 04, 2015 12:05:04 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/Spring_Security_Struts2] startup failed due to previous errors
Nov 04, 2015 12:05:04 PM org.apache.catalina.core.ApplicationContext log
INFO: Closing Spring root WebApplicationContext
Nov 04, 2015 12:05:04 PM org.springframework.web.context.support.XmlWebApplicationContext doClose
INFO: Closing Root WebApplicationContext: startup date [Wed Nov 04 12:05:04 IST 2015]; root of context hierarchy
Nov 04, 2015 12:05:04 PM org.springframework.web.context.support.XmlWebApplicationContext doClose
WARNING: 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 [Wed Nov 04 12:05:04 IST 2015]; root of context hierarchy
at org.springframework.context.support.AbstractApplicationContext.getLifecycleProcessor(AbstractApplicationContext.java:414)
at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:969)
at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:928)
at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:583)
at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:116)
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4776)
at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5390)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:160)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
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)
Nov 04, 2015 12:05:04 PM org.apache.catalina.core.StandardContext listenerStop
SEVERE: Exception sending context destroyed event to listener instance of class org.springframework.web.context.ContextLoaderListener
java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext
at org.springframework.context.support.AbstractRefreshableApplicationContext.getBeanFactory(AbstractRefreshableApplicationContext.java:170)
at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1000)
at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:976)
at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:928)
at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:583)
at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:116)
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4776)
at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5390)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:160)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
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)
Nov 04, 2015 12:05:04 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-nio-8080"]
Nov 04, 2015 12:05:04 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-nio-8009"]
Nov 04, 2015 12:05:04 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 3788 ms
`
The Problem was with the name of the configuration file as I followed that link.
The name used was different at different places in that link.Thanks.
I'm trying to learn the Struts2 framework.
I got the HelloWorld example form the site:
`www.vaannila.com/struts/struts-tutorial/struts-tutorial-using-eclipse-1.html
The highlighted code is shown as a warning:
<%#taglib uri="/struts-tags" prefix="s" %>
s:redirect forward="helloWorld"/>
Th warning is given below:
Multiple annotations found at this line:
- Unknown tag (bean:write).
- Unknown tag (bean:write).
I get the same warning in my index.jsp file for the code:
and when i run the tomcat, I get the following in my console. I know my tomcat is running but how do i rectify this?
Jun 13, 2012 1:12:28 PM org.apache.catalina.core.AprLifecycleListener init
**INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre7\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32;**
**Jun 13, 2012 1:12:28 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:StrutsExample1' did not find a matching property.**
Jun 13, 2012 1:12:28 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Jun 13, 2012 1:12:28 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Jun 13, 2012 1:12:28 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 735 ms
Jun 13, 2012 1:12:28 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Jun 13, 2012 1:12:28 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.27
Jun 13, 2012 1:12:31 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Jun 13, 2012 1:12:31 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Jun 13, 2012 1:12:31 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 2586 ms
<bean:write> is struts 1.x you have to use <s:property> in struts 2.x.
See s:property documentation