File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes IDEs, Version Control and other tools and the fly likes Encountreing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Encountreing "SEVERE: Dispatcher initialization failed" in Netbeans, while running a "Struts App"" Watch "Encountreing "SEVERE: Dispatcher initialization failed" in Netbeans, while running a "Struts App"" New topic
Author

Encountreing "SEVERE: Dispatcher initialization failed" in Netbeans, while running a "Struts App"

Palraj Jayaraj
Ranch Hand

Joined: Jun 06, 2012
Posts: 35

I'm a beginner in "struts", trying my fist struts application.

I just encountered "SEVERE: Dispatcher initialization failed" in Netbeans, while running the "Struts App".

Kindly, help.

I have listed the
1)struts.xml
2)config file
3)Error message.

Thanks, In advance

Index.jsp

<%--
Document : index
Created on : Jun 26, 2013, 4:39:24 PM
Author : Paul_E
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Results Page</title>
</head>
<body>
<h1>
<s:property value="first_int" default="0"/>
<s:property value="second_int" default="1"/>

<s:form method=GET" action="Maths_Operation.action">

<table border="0" cellpadding="0" cellspacing="2">

<tr>
<td align="right"> Enter the first Number:</td>
<td align="left"> <s:textfield theme="simple" name="first_int"/> </td>
</tr>

<tr>
<td align="right"></td>
<td align="center"> + </td>
</tr>
<tr>
<td align="right"> Enter the Second Number:</td>
<td align="left"<s:textfield theme="simple" name="second_int"/></td>
</tr>
<tr>
<td align="right"></td>
<td align="left"> <s:submit theme="simple" value="Submit" </td>
</tr>
</table>
</s:form>
</h1>
</body>
</html>


Struts.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->

<!DOCTYPE struts PUBLIC '-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.1.3//EN' 'http://struts.apache.org/dtds/struts-2.0.dtd'>

<struts>
<package name="temp" extends="struts-default">

<action name="Maths_Operation" class="Matha.Maths">

<result name="1">/index.jsp</result>
</action>
</package>
</struts>



The Error Message:

SEVERE: Dispatcher initialization failed
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.inject(ContainerImpl.java:301)
at com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(ContainerImpl.java:438)
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:584)
at com.opensymphony.xwork2.inject.ContainerBuilder.create(ContainerBuilder.java:484)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.createBootstrapContainer(DefaultConfiguration.java:324)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:221)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:446)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:490)
at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:193)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:264)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:120)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4685)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5377)
at com.sun.enterprise.web.WebModule.start(WebModule.java:498)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:917)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:901)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:733)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2019)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1669)
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:109)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:301)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:461)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:389)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:348)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1085)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1291)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1259)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:461)
at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:212)
at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)
at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
at com.sun.enterprise.v3.services.impl.ContainerMapper$Hk2DispatcherCallable.call(ContainerMapper.java:354)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.inject(ContainerImpl.java:299)
... 57 more
Caused by: java.lang.ExceptionInInitializerError
at com.opensymphony.xwork2.ognl.OgnlValueStackFactory.setContainer(OgnlValueStackFactory.java:84)
... 62 more
Caused by: java.lang.IllegalArgumentException: Javassist library is missing in classpath! Please add missed dependency!
at ognl.OgnlRuntime.<clinit>(OgnlRuntime.java:168)
... 63 more
Caused by: java.lang.ClassNotFoundException: javassist.ClassPool
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1509)
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1359)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:186)
at ognl.OgnlRuntime.<clinit>(OgnlRuntime.java:165)
... 63 more
Saif Asif
Ranch Hand

Joined: Aug 11, 2011
Posts: 440


Caused by: java.lang.IllegalArgumentException: Javassist library is missing in classpath! Please add missed dependency!
at ognl.OgnlRuntime.<clinit>(OgnlRuntime.java:168)
... 63 more
Caused by: java.lang.ClassNotFoundException: javassist.ClassPool


Those are ClassNotFoundExceptions. Is the JavaAssist.jar file on your class-path ? That is required.


Muhammad Saif Asif Mirza
OCJA(5/6) OCJP(6) OCJWCD(6)
Palraj Jayaraj
Ranch Hand

Joined: Jun 06, 2012
Posts: 35

Thanks, It cleared it you

But, I ended up with another error. "SEVERE: WebModule[/TEMP1]PWC1270: Exception starting filter Sructs2Filter"

Please help me resolve this.

Please find the whole exception stack below:
Saif Asif
Ranch Hand

Joined: Aug 11, 2011
Posts: 440


INFO: Parsing configuration file [struts-default.xml]
SEVERE: WebModule[/TEMP1]PWC1270: Exception starting filter Sructs2Filter
java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils


Thats another ClassNotFoundException for the Apache-commons.jar .

You should pay more attention to the stack-traces you encounter. If you look into the details of the stack-trace, it tells you the root cause itself ( thats the whole purpose of the stack trace ) .

Do post back for any further queries .
Palraj Jayaraj
Ranch Hand

Joined: Jun 06, 2012
Posts: 35

Thanks Saif

It is working now
Saif Asif
Ranch Hand

Joined: Aug 11, 2011
Posts: 440

Palraj Jayaraj wrote:Thanks Saif

It is working now


Glad you got it to work
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Encountreing "SEVERE: Dispatcher initialization failed" in Netbeans, while running a "Struts App"