log4j2 rollover strategy not working as expected - log4j2

I have a Log4j2.xml defined as:
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="DEBUG">
<Properties>
<Property name="log-path">E:/MLM/MLMDomain/servers/${sys:weblogic.Name}/logs</Property>
</Properties>
<Appenders>
<RollingFile name="RollingFile" fileName="${log-path}/MLMServices.log" filePattern="${log-path}/MLMServices-%d{yyyy-MM-dd}-%i.log" >
<PatternLayout>
<pattern>%d{dd/MMM/yyyy HH:mm:ss.SSS} [%-5level] [%c{1}] %m%n</pattern>
</PatternLayout>
<Policies>
<SizeBasedTriggeringPolicy size="1 MB" />
</Policies>
<DefaultRolloverStrategy max="30"/>
</RollingFile>
</Appenders>
<Loggers>
<Logger name="root" level="debug" additivity="false">
<appender-ref ref="RollingFile" level="debug"/>
</Logger>
<Root level="debug" additivity="false">
<AppenderRef ref="RollingFile"/>
</Root>
</Loggers>
</Configuration>
From what I understand, my log file should roll over to new one when it reaches 1MB. The number of files to roll over should be 30. However, if you look at my logs below, there are over 40 of them, and all the latest ones are all close to 30MB. The current log file MLMServices.log has entries from 13 Apr 2016 till now. In fact, the last few log files, MLMServices-2016-05-24-4.log, MLMServices-2016-05-24-3.log, etc, have entries from 13 Apr 2016. When a new log file is created, it duplicates the entries from the previous one, and then append more entries. So progressively each new log file will be slightly bigger than the previous one.
04/28/2016 04:26 PM 1,050,290 MLMServices-2016-04-28-1.log
04/28/2016 06:02 PM 1,188,994 MLMServices-2016-04-28-2.log
04/29/2016 12:11 PM 1,315,487 MLMServices-2016-04-29-1.log
04/29/2016 12:21 PM 1,364,634 MLMServices-2016-04-29-2.log
04/29/2016 12:30 PM 1,413,781 MLMServices-2016-04-29-3.log
04/29/2016 05:02 PM 1,472,373 MLMServices-2016-04-29-4.log
05/03/2016 04:16 PM 2,521,056 MLMServices-2016-05-03-1.log
05/04/2016 04:35 PM 3,379,593 MLMServices-2016-05-04-1.log
05/05/2016 01:47 PM 3,715,698 MLMServices-2016-05-05-1.log
05/05/2016 02:47 PM 3,858,833 MLMServices-2016-05-05-2.log
05/06/2016 02:13 PM 4,908,446 MLMServices-2016-05-06-1.log
05/06/2016 02:46 PM 4,927,119 MLMServices-2016-05-06-2.log
05/06/2016 03:04 PM 5,068,610 MLMServices-2016-05-06-3.log
05/06/2016 05:07 PM 5,267,743 MLMServices-2016-05-06-4.log
05/10/2016 03:16 PM 8,598,426 MLMServices-2016-05-10-1.log
05/10/2016 03:16 PM 11,280,054 MLMServices-2016-05-10-2.log
05/10/2016 03:16 PM 12,328,667 MLMServices-2016-05-10-3.log
05/10/2016 03:16 PM 13,377,298 MLMServices-2016-05-10-4.log
05/10/2016 03:16 PM 14,425,881 MLMServices-2016-05-10-5.log
05/10/2016 03:16 PM 15,474,464 MLMServices-2016-05-10-6.log
05/10/2016 03:16 PM 16,523,059 MLMServices-2016-05-10-7.log
05/10/2016 03:16 PM 17,571,640 MLMServices-2016-05-10-8.log
05/10/2016 03:53 PM 18,620,566 MLMServices-2016-05-10-9.log
05/11/2016 02:37 PM 19,002,926 MLMServices-2016-05-11-1.log
05/11/2016 02:44 PM 19,088,104 MLMServices-2016-05-11-2.log
05/11/2016 03:50 PM 19,375,771 MLMServices-2016-05-11-3.log
05/14/2016 01:51 PM 20,424,415 MLMServices-2016-05-14-1.log
05/16/2016 12:52 PM 21,473,018 MLMServices-2016-05-16-1.log
05/17/2016 07:01 PM 22,521,671 MLMServices-2016-05-17-1.log
05/18/2016 09:57 AM 23,570,365 MLMServices-2016-05-18-1.log
05/18/2016 02:03 PM 24,619,048 MLMServices-2016-05-18-2.log
05/18/2016 08:05 PM 25,667,655 MLMServices-2016-05-18-3.log
05/19/2016 09:18 AM 25,786,502 MLMServices-2016-05-19-1.log
05/19/2016 02:00 PM 26,259,036 MLMServices-2016-05-19-2.log
05/19/2016 05:52 PM 26,593,795 MLMServices-2016-05-19-3.log
05/19/2016 06:26 PM 26,671,744 MLMServices-2016-05-19-4.log
05/20/2016 03:30 PM 27,191,829 MLMServices-2016-05-20-1.log
05/20/2016 05:27 PM 28,240,467 MLMServices-2016-05-20-2.log
05/23/2016 06:10 PM 29,204,271 MLMServices-2016-05-23-1.log
05/24/2016 09:55 AM 29,338,523 MLMServices-2016-05-24-1.log
05/24/2016 10:31 AM 29,441,164 MLMServices-2016-05-24-2.log
05/24/2016 12:04 PM 29,556,676 MLMServices-2016-05-24-3.log
05/24/2016 12:05 PM 29,577,736 MLMServices-2016-05-24-4.log
05/20/2016 05:27 PM 29,734,763 MLMServices.log
This is not the behavior that I want. I just want each log file to be limited to 1MB, and I want to keep a maximum of 30 log files. Where in the configuration did I go wrong?
Thanks in advance
Edited: I have actually specified log4j2 in weblogic.xml
<?xml version="1.0" encoding="UTF-8"?>
<wls:weblogic-web-app xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-web-app"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-web-app
http://xmlns.oracle.com/weblogic/weblogic-web-app/1.7/weblogic-web-app.xsd">
<wls:context-root>XXXXXX</wls:context-root>
<wls:library-ref>
<wls:library-name>jax-rs</wls:library-name>
<wls:specification-version>2.0</wls:specification-version>
<wls:exact-match>false</wls:exact-match>
</wls:library-ref>
<wls:container-descriptor>
<wls:prefer-application-packages>
<wls:package-name>org.slf4j</wls:package-name>
<wls:package-name>log4j</wls:package-name>
</wls:prefer-application-packages>
</wls:container-descriptor>
</wls:weblogic-web-app>

You should check to see if something besides your application is accessing MLMServices.log. On Windows, file renames and deletes will fail if an exclusive lock cannot be obtained.

Related

how to configure timebased logs and its compression policy

I have a requirement to write log files based on the hour.
Apart from the current log, rest of the logs should be compressed (gz), like below
-rw-r--r-- 1 karthick karthick 58546 Aug 31 19:00 console.20200831-19.log.gz
-rw-r--r-- 1 karthick karthick 58546 Aug 31 20:00 console.20200831-20.log.gz
-rw-r--r-- 1 karthick karthick 58546 Aug 31 21:00 console.20200831-21.log
Tried below snippet, but didn't worked as expected.
<RollingRandomAccessFile
name="myFile"
fileName="console.%d{yyyyMMdd-HH}.log"
filePattern="console.%d{yyyyMMdd-HH}.log.gz"
append="true" immediateFlush="true">
<PatternLayout pattern="%d [%t] %-5p %c[1] %m%n">
<Policies>
<TimeBasedTriggerPolicy>
<Policies>
</RollingRandomAccessFile>
You cannot have %{d} in the fileName, it is only used to create the target file at rollover. You could leave the fileName attribute off, however you should be aware that the file will not be compressed at shutdown and if the time is different at restart it won't be compressed then either.

Property files in Internationalization in Struts 2

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)

java.io.FileNotFoundException: Could not open ServletContext resource and BeanFactory not initialized or already closed

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.

How can I extract data from DAT and IDX files of SCADA CIMPLICITY software?

I am tasked with extracting the data from the data files of an old software - CIMplicity HMI Plant Edition version 6.0. Its a SCADA software from 2002. I have a copy of the data files directory which contains a lot of *.DAT and *.IDX files. I am required to extract this data to CSV or to an SQL database. Some of the DAT files are just plain-text, but others have a binary-like format and when opened in PSPad, shows up in HEX view mode.
What tools can I use to reliably read and extract the data from these files?
TIA.
UPDATE: I've added a directory listing of the directory with the data files:
Directory of C:\tmp\xxxxxxII\data
04/30/2013 01:53 PM <DIR> .
04/30/2013 01:53 PM <DIR> ..
09/02/2008 10:46 AM 17,260 1220323606.clz
09/02/2008 10:46 AM 60,490 1220323607.clz
09/10/2008 06:36 PM 288,554 1220323608.clz
09/02/2008 10:46 AM 66,977 1220323609.clz
09/10/2008 06:37 PM 23,900 1220323610.clz
09/10/2008 06:37 PM 19,162 1220323611.clz
09/10/2008 06:48 PM 37,596 1220323612.clz
09/10/2008 06:49 PM 27,882 1220323613.clz
09/10/2008 06:49 PM 47,850 1220323614.clz
09/10/2008 06:50 PM 47,816 1220323615.clz
09/10/2008 06:52 PM 3,427,511 1220323616.clz
09/02/2008 10:46 AM 31,169 1220323617.clz
09/10/2008 06:53 PM 30,353 1220323618.clz
09/02/2008 10:46 AM 122,159 1220323619.clz
09/02/2008 10:50 AM 3,539,414 1220323828.clz
09/10/2008 06:02 PM 208 action.dat
09/10/2008 06:02 PM 3,072 action.idx
02/19/2002 11:58 PM 5,636 alarm_class.dat
02/19/2002 11:58 PM 3,072 alarm_class.idx
09/23/2008 04:26 PM 137,128 alarm_def.dat
09/23/2008 04:26 PM 49,152 alarm_def.idx
02/19/2002 11:58 PM 2,929 alarm_field.dat
02/19/2002 11:58 PM 4,096 alarm_field.idx
02/19/2002 11:58 PM 0 alarm_intproc.dat
02/19/2002 11:58 PM 4,096 alarm_intproc.idx
02/19/2002 11:58 PM 135 alarm_mgr.dat
02/19/2002 11:58 PM 3,072 alarm_mgr.idx
09/23/2008 04:26 PM 69,531 alarm_routing.dat
09/23/2008 04:26 PM 387,072 alarm_routing.idx
02/19/2002 11:58 PM 912 alarm_type.dat
02/19/2002 11:58 PM 3,072 alarm_type.idx
02/19/2002 11:58 PM 0 alm_setup.dat
02/19/2002 11:58 PM 4,096 alm_setup.idx
02/19/2002 11:58 PM 0 alm_setup_cl.dat
02/19/2002 11:58 PM 3,072 alm_setup_cl.idx
02/19/2002 11:58 PM 0 alm_setup_fr.dat
02/19/2002 11:58 PM 3,072 alm_setup_fr.idx
02/19/2002 11:58 PM 0 alm_user.dat
02/19/2002 11:58 PM 3,072 alm_user.idx
02/19/2002 11:58 PM 0 alrm_blk_alarm.dat
02/19/2002 11:58 PM 4,096 alrm_blk_alarm.idx
02/19/2002 11:58 PM 0 alrm_blk_group.dat
02/19/2002 11:58 PM 3,072 alrm_blk_group.idx
02/11/1998 04:05 PM 602 amlp.cfg
09/10/2008 06:53 PM 2,415 class.dat
09/10/2008 06:53 PM 3,072 class.idx
02/11/1998 04:06 PM 5 client.cfg
09/10/2008 02:14 PM 393 comm_exe.dat
09/10/2008 02:14 PM 4,096 comm_exe.idx
09/23/2008 03:40 PM 9,893 datalog.dat
09/23/2008 03:40 PM 5,120 datalog.idx
02/19/2002 11:58 PM 1,272 data_field.dat
02/19/2002 11:58 PM 3,072 data_field.idx
09/04/2008 03:10 PM 1,218 dbms_def.dat
09/04/2008 03:10 PM 3,072 dbms_def.idx
09/16/2008 10:45 AM 37,820 derived_point.dat
09/16/2008 10:45 AM 16,384 derived_point.idx
09/10/2008 02:14 PM 256 devcom_proc.dat
09/10/2008 02:14 PM 4,096 devcom_proc.idx
09/10/2008 02:16 PM 1,305 device.dat
09/10/2008 02:16 PM 5,120 device.idx
09/23/2008 04:26 PM 2,243,024 device_point.dat
09/23/2008 04:26 PM 1,745,920 device_point.idx
09/23/2008 04:04 PM 6 dyn_cfg.cfg
02/19/2002 11:58 PM 0 em_alu.dat
02/19/2002 11:58 PM 3,072 em_alu.idx
02/19/2002 11:58 PM 0 es_eu_conv.dat
02/19/2002 11:58 PM 3,072 es_eu_conv.idx
02/19/2002 11:58 PM 0 es_point_info.dat
02/19/2002 11:58 PM 4,096 es_point_info.idx
09/23/2008 04:26 PM 719,712 eu_conv.dat
09/23/2008 04:26 PM 78,848 eu_conv.idx
09/10/2008 06:02 PM 166 event.dat
09/10/2008 06:02 PM 3,072 event.idx
09/10/2008 06:03 PM 121 event_action.dat
09/10/2008 06:03 PM 3,072 event_action.idx
04/30/2013 01:53 PM 0 f.txt
02/19/2002 09:49 PM 199,302 field_def.dat
02/19/2002 09:49 PM 87,040 field_def.idx
09/10/2008 02:15 PM 1,608 fr.dat
09/10/2008 02:15 PM 5,120 fr.idx
07/15/2010 03:41 PM 262 gef_cfg.ini
09/23/2008 03:39 PM 6,435 glb_parms.dat
09/23/2008 03:39 PM 6,144 glb_parms.idx
12/15/1999 11:16 AM 899 ie_deflds.cfg
11/14/2001 11:06 AM 1,101 ie_formats.cfg
02/19/2002 09:49 PM 7,548 keyconst.dat
02/19/2002 09:49 PM 18,432 keyconst.idx
02/19/2002 09:49 PM 16,984 key_field.dat
02/19/2002 09:49 PM 13,312 key_field.idx
02/19/2002 09:49 PM 9,546 lenconst.dat
02/19/2002 09:49 PM 17,408 lenconst.idx
09/10/2008 02:14 PM 990 logproc.dat
09/10/2008 02:14 PM 3,072 logproc.idx
09/23/2008 03:54 PM 47,952 log_attrib.dat
09/23/2008 03:54 PM 77,824 log_attrib.idx
09/23/2008 03:40 PM 1,848 log_event.dat
09/23/2008 03:40 PM 4,096 log_event.idx
08/05/1998 09:04 AM 1,671 log_names.cfg
09/10/2008 02:14 PM 121 master.mcp
07/18/2008 06:32 PM 32 master_mcp.app
09/10/2008 02:14 PM 29 master_mcp.dc
07/18/2008 06:32 PM 52 master_mcp.rp
09/28/2001 02:22 PM 17,449 master_opc_0.ini
02/19/2002 11:58 PM 11,312 meas_assoc.dat
02/19/2002 11:58 PM 8,192 meas_assoc.idx
02/19/2002 11:58 PM 276 meas_system.dat
02/19/2002 11:58 PM 3,072 meas_system.idx
02/19/2002 11:58 PM 1,096 meas_unit.dat
02/19/2002 11:58 PM 3,072 meas_unit.idx
09/10/2008 02:14 PM 365 model.dat
09/10/2008 02:14 PM 4,096 model.idx
07/18/2008 06:32 PM 86 node.dat
07/18/2008 06:32 PM 3,072 node.idx
09/10/2008 02:14 PM 2,167 node_logproc.dat
09/10/2008 02:14 PM 5,120 node_logproc.idx
09/23/2008 04:26 PM 32,890 object.dat
09/23/2008 04:26 PM 28,672 object.idx
09/23/2008 04:26 PM 310,464 object_attrib.dat
09/23/2008 04:26 PM 293,888 object_attrib.idx
09/23/2008 04:26 PM 22,080 object_routing.dat
09/23/2008 04:26 PM 30,720 object_routing.idx
09/10/2008 02:14 PM 715 physproc.dat
09/10/2008 02:14 PM 5,120 physproc.idx
04/26/2010 12:27 PM 2,527,608 point.dat
04/26/2010 12:27 PM 637,952 point.idx
02/19/2002 11:58 PM 95 point_alstr.dat
02/19/2002 11:58 PM 3,072 point_alstr.idx
02/19/2002 11:58 PM 0 point_disp.dat
02/19/2002 11:58 PM 3,072 point_disp.idx
02/19/2002 11:58 PM 194 point_enum.dat
02/19/2002 11:58 PM 3,072 point_enum.idx
02/19/2002 11:58 PM 216 point_enum_fld.dat
02/19/2002 11:58 PM 4,096 point_enum_fld.idx
02/19/2002 11:58 PM 609 point_type.dat
02/19/2002 11:58 PM 3,072 point_type.idx
09/10/2008 02:14 PM 129 port_comm.dat
09/10/2008 02:14 PM 4,096 port_comm.idx
09/10/2008 02:14 PM 42 port_list.dat
09/10/2008 02:14 PM 4,096 port_list.idx
09/10/2008 02:14 PM 294 port_type.dat
09/10/2008 02:14 PM 3,072 port_type.idx
02/11/1998 04:05 PM 5 projects.cfg
09/10/2008 02:14 PM 123 protocol.dat
09/10/2008 02:14 PM 3,072 protocol.idx
02/19/2002 11:58 PM 37 ptmgmt.dat
02/19/2002 11:58 PM 3,072 ptmgmt.idx
04/27/2010 03:25 PM 19,343 ptx_points.cfg
02/19/2002 11:58 PM 0 pt_uf_assoc.dat
02/19/2002 11:58 PM 4,096 pt_uf_assoc.idx
02/19/2002 11:58 PM 93 pt_uf_sets.dat
02/19/2002 11:58 PM 3,072 pt_uf_sets.idx
02/19/2002 11:58 PM 1,568 pt_user_fields.dat
02/19/2002 11:58 PM 4,096 pt_user_fields.idx
02/19/2002 09:49 PM 9,856 record_def.dat
02/19/2002 09:49 PM 13,312 record_def.idx
02/19/2002 11:58 PM 0 redund_addrs.dat
02/19/2002 11:58 PM 4,096 redund_addrs.idx
02/19/2002 11:58 PM 111 role.dat
02/19/2002 11:58 PM 3,072 role.idx
02/19/2002 11:58 PM 159 role_subsys.dat
02/19/2002 11:58 PM 4,096 role_subsys.idx
09/10/2008 02:14 PM 1,067 service.dat
09/10/2008 02:14 PM 5,120 service.idx
02/19/2002 11:58 PM 181 service_use.dat
02/19/2002 11:58 PM 3,072 service_use.idx
09/23/2008 03:57 PM 711 TCPIP0.ini
02/19/2002 11:58 PM 0 trend_pt.dat
02/19/2002 11:58 PM 3,072 trend_pt.idx
09/02/2008 09:29 AM 434 user.dat
09/02/2008 09:29 AM 4,096 user.idx
09/10/2008 02:15 PM 784 user_fr.dat
09/10/2008 02:15 PM 6,144 user_fr.idx
07/15/2010 03:40 PM 15 warmdata.sav
174 File(s) 17,990,662 bytes
UPDATE:
Screenshot of point.dat attached:
My condolences, you have been tasked with an almost impossible task.
Ok, I don't know much about CIMPLICITY HMI Plant Edition, save what I can see from the outside. But maybe I can give you some helpful pointers, since I am also developing industrial HMI and Engineering software. (WinCC & PCS7)
First off, the format is, with a certainty of 99%, a proprietary format. The only real help you can expect to get is from GE. The question is, will they give it to you and at what cost. (Since you are trying to extract data, you are probably migrating away; then why should they help.)
So some reverse engineering is probably in order. You want the software that created the project. That is the engineering package and not the HMI run-time software. (May be one piece of software.) Your company should still have licenses for that from the original project.
From there you either create a new project and see what happens and or load the existing project and then play around and see what changes in the data. It is important that you understand what data is in the system and where you can find it.
It is important to note that the data comes in two forms, project configuration and run-time data.
The project configuration is actually not data, this is "just" configuration what the run-time system should display/react. The project data are things like users, views/screens, PLC variable bindings or control scripts. I honestly don't know how you want to put most of this efficiently into CVS or a database. But it is possible WinCC uses MSSQL. (with a default password, thank you stuxnet)
The run-time data is simpler. This are either event logs, that record things like operator commands, alarms and warnings or recorded values. This data should be easily extracted, since it is strictly formatted. To find out what and where was recorded you should open the project in the engineering software, there you should find clues about logging and trends.
Nevertheless you want to get yourself a good hex editor and LOTS of time.
Addendum:
After you added the listing and screenshot, the files make 3/4 sense to me.
For example, alarm_class.* contains the clases of alarms that the run-time may raise, the alarm_type the data types of alarms, alarm_field contains the configured alarms for field alaram, i.e. form the PLC, alarm_rounting are routing or network errors, alm_user are probably user alarms, i.e. from scripts in the HMI runtime.
Everything with point in the name is probably a "measurement point", that is a field device; either a sensor or a feedback from an actuator.
Everything with user, is probably the configured users and their permissions.
redund_addrs is a map of PLC or device addresses that are redundant siblings of primary values.
Everything with port is probably about the "ports" on the SCADA server or PLC, for example FF, PROFIBUS or PROFINET.
Everything with object is probably structures. That is when single variables (aka tags) are bound together for form hierarchical values. For example the value of a sensor and all values about it's status are bound into one structure, this is maybe then treated as one measurement point.
Also when looking at the hex dump you provided, it seams like a structured constant length format.
In this case:
struct Point
{
char name[16] = "$ALARM.ACKED";
char type[32] = "UDINT";
char comment[128] = "...";
};
The values are then padded with space "0x20".
Addendum 2:
You may actually looking at a flat file database, such like dBase and each *.dat is the data and *.idx the table index. Just an idea. It may pay to invest some time into DB technology available circa 2000. Then maybe you can just "dump" the data.
::EXPORT::
If you open up a command prompt in the master directory
Type "idtpop event" for event.idx file
It will create a file event.idt
This file can be edited in notepad or other editor.
Any .DAT & .IDX files of Cimplicity can be accessed in the same way.
::IMPORT:
If you want the required changes to be imported, at the command prompt
type scpop event
This will regenerate the event file. Also do the other files.
Nova Gladson is correct, but that only works on a system that has Cimpicity installed on it.
Cimplicity is still being actively developed and marketed. The newest version is very capable of opening version 6.
Cimplicity HMI & Scada

Struts2 errors:The requested resource () is not available

Could you help me solve this problem. When I was trying to program the simple Struts2 HelloWorld program. It always has this error:The requested resource () is not available. Could you help me solve it?Thank you!
JSP File
<%# 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">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
hello world
</body>
</html>
This is HelloWorld.java
package com.test.action;
public class HelloWorld {
public String execute()throws Exception
{
return "success";
}
}
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>
<package name="struts2" extends="struts-default">
<action name="helloworld" class="com.test.action.HelloWorld">
<result name="success">/helloworld.jsp</result>
</action>
</package>
</struts>
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<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>
Exception
Nov 30, 2012 11:07:54 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: .:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
Nov 30, 2012 11:07:54 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:test' did not find a matching property.
Nov 30, 2012 11:07:54 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Hibernate' did not find a matching property.
Nov 30, 2012 11:07:54 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:struts2' did not find a matching property.
Nov 30, 2012 11:07:54 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Nov 30, 2012 11:07:54 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1232 ms
Nov 30, 2012 11:07:54 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Nov 30, 2012 11:07:54 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.35
Nov 30, 2012 11:07:55 PM org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter struts2
java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:269)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:115)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4072)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4726)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Nov 30, 2012 11:07:55 PM org.apache.catalina.core.StandardContext start
SEVERE: Error filterStart
Nov 30, 2012 11:07:55 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/struts2] startup failed due to previous errors
Nov 30, 2012 11:07:55 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Nov 30, 2012 11:07:55 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Nov 30, 2012 11:07:55 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/64 config=null
Nov 30, 2012 11:07:55 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 821 ms
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher<filter-class> and remove the unwanted jar files.you keep only the following jar files in in lib folder
commons-logging-1.0.4.jar
freemarker-2.3.8.jar
ognl-2.6.11.jar
struts2-core-2.0.11.jar
xwork-2.0.4.jar.
Regards,
Nag kamma.

Resources