File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes ActionServlet was not  executed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "ActionServlet was not  executed " Watch "ActionServlet was not  executed " New topic
Author

ActionServlet was not executed

sathish sanigneni
Greenhorn

Joined: May 15, 2012
Posts: 7
erorrs in tomcat server
---------------------------------

com.opensymphony.xwork2.util.logging.commons.CommonsLogger error
SEVERE: Dispatcher initialization failed
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.ContainerBuilder$5.create(ContainerBuilder.java:207)
at com.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:51)
at com.opensymphony.xwork2.inject.ContainerBuilder$3.create(ContainerBuilder.java:93)
at com.opensymphony.xwork2.inject.ContainerBuilder$7.call(ContainerBuilder.java:487)
at com.opensymphony.xwork2.inject.ContainerBuilder$7.call(ContainerBuilder.java:484)
at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:574)
at com.opensymphony.xwork2.inject.ContainerBuilder.create(ContainerBuilder.java:484)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.createBootstrapContainer(DefaultConfiguration.java:252)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:193)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:380)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:424)
at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:195)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3709)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4363)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:926)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:889)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.inject(ContainerImpl.java:293)
... 41 more
Caused by: java.lang.ExceptionInInitializerError
at com.opensymphony.xwork2.ognl.OgnlValueStackFactory.setContainer(OgnlValueStackFactory.java:85)
... 46 more
Caused by: java.lang.IllegalArgumentException: Javassist library is missing in classpath! Please add missed dependency!
at ognl.OgnlRuntime.<clinit>(OgnlRuntime.java:165)
... 47 more
Caused by: java.lang.ClassNotFoundException: javassist.ClassPool
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at ognl.OgnlRuntime.<clinit>(OgnlRuntime.java:162)
... 47 more
May 23, 2012 2:47:54 PM org.apache.catalina.core.StandardContext start
SEVERE: Error filterStart
May 23, 2012 2:47:54 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/annation validate struts2] startup failed due to previous errors
May 23, 2012 2:47:55 PM com.opensymphony.xwork2.config.providers.XmlConfigurationProvider register
INFO: Parsing configuration file [struts-default.xml]
May 23, 2012 2:47:55 PM



following jar files are added to lib folder
------------------------------------------------

commons-fileupload-1.2.2.jar
commons-io-2.0.1.jar
commons-lang-2.5.jar
commons-logging-1.1.1.jar
freemarker-2.3.18.jar
ognl-3.0.3.jar
struts2-core-2.3.1.jar
xwork-core-2.3.1.jar
jstl-1.0.2.jar



log-in.jsp
----------
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<title>Struts 2 Login Application!</title>

<link href="<s:url value='/main.css'/>" rel="stylesheet" type="text/css"/>

</head>
<body>

<s:form action="AnnotationAction" method="POST" validate="true">
<tr>
<td colspan="2">
Login
</td>

</tr>

<tr>
<td colspan="2">
<s:actionerror />
<s:fielderror />
</td>
</tr>

<s:textfield name="username" label="Login name"/>
<s:password name="password" label="Password"/>
<s:submit value="Login" align="center"/>

</s:form>

</body>

</html





web.xml
------------------------

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<display-name>Struts 2 Display </display-name>
<filter>
<filter-name>strut2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>

</filter>
<init-param>
<param-name>actionPackages</param-name>
<param-value>p1</param-value>
</init-param>
<filter-mapping>
<filter-name>strut2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>log-in.jsp</welcome-file>
</welcome-file-list>`

</web-app>


AnnotationAction.java
------------------------------


import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.validator.annotations.*;


@Validation

public class AnnotationAction extends ActionSupport {


private String username = null;

private String password = null;


@RequiredStringValidator(message="Supply name")

public String getUsername() {

return username;
}



public void setUsername(String value) {

username = value;
}


@RequiredStringValidator(message="Supply password")


public String getPassword() {

return password;
}



public void setPassword(String value) {

password = value;
}




public String execute() throws Exception {

System.out.println("Validating login");
if(!getUsername().equals("Admin") || !getPassword().equals("Admin")){
addActionError("Invalid user name or password! Please try again!");

return ERROR;

}
else{

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>
<include file="struts-default.xml" />
<package name="default" extends="struts-default">
<action name="LoginAnnotation">
<result>/log-in.jsp</result>
</action>

<action name="AnnotationAction" class="AnnotationAction">
<result name="input">/log-in.jsp</result>
<result name="error">/log-in.jsp</result>
<result>/loginsuccess.jsp</result>
</action>
</package>
</struts>

loginsuccess.jsp
-----------------------
<html>

<head>

<title>Login Success</title>

</head>

<body>

<p align="center"><font color="#000080" size="5">Login Successful</font></p>

</body>

</html>



main.css
-----------------

@CHARSET "UTF-8";

body {
font: 12px verdana, arial, helvetica, sans-serif;
background-color:#FFFFFF;
}

table.wwFormTable {
font: 12px verdana, arial, helvetica, sans-serif;
border-width: 1px;
border-color: #030;
border-style: solid;
color: #242;
background-color: #ada;
width: 30%;
margin-left:35%;
margin-right:35%;
margin-top:15%;
}

table.wwFormTable th {
}

table.wwFormTable tr td {
background-color: #dfd;
margin: 5px;
padding: 5px;
}

.tdLabel {
/*
border-width: 1px;
border-color: #afa;
border-style: solid;
*/
font-weight: bold;
align: top;
}

.label {
}

.errorMessage {
color: red;
font-size: 0.8em;
}

#headerDiv {
border-style: solid;
border-width: 1px 1px 0px;
border-color: black;
padding: 5px;
background-color: #7a7;
/* height: 22px; */
height: 1.8em;
/* margin-bottom: 12px; */
}

#buttonBar {
border-width: 0px 1px 1px;
border-style: solid;
border-color: black;
color: white;
margin-bottom: 12px;
background-color: #7a7;
height: 1.6em;
padding: 5px;
}

#appName {
color: white;
font-size: 1.8em;
}

#pageTitle {
font-size: 1.4em;
color: #dfd;
clear: none;
}

#appName, #pageTitle {
float: right;
}

#menuContainer {
float: left;
}

#brandingContainer {
float: right:
text-align: right;
}



Sumit Patil
Ranch Hand

Joined: May 25, 2009
Posts: 296

Check this

and

this


Thanks & Regards, Sumeet
SCJP 1.4, SCWCD 5, LinkedIn Profile
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ActionServlet was not executed
 
Similar Threads
XWorks throws Missing Dependency Exception for HelloWorld? HELP!
Dispatcher initialization failed + Struts 2.1.8
Sending a mail from struts application using the Spring Framework utility library
Error running "Struts 2 Application" with "Tomcat 6.0" in Eclipse Helios
populate items using struts2 <s:select>