Solved

errors in the  struts application

Posted on 2013-06-08
5
664 Views
Last Modified: 2013-06-09
Hello,

I have a sample program when i try to run using strut2 framework using tomcat7 it gives me error. I have added the right jars of the strut2. i donot know why it did not run and i have set the jars in my lib also.. here is my sample code attached with the list of jars.... and the structure of the package........
can some body able to resolve it

Thanks

error log
==================================================================
SEVERE: Exception starting filter action
java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils
      at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:211)
      at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:102)
      at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:226)
      at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
      at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:429)
      at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:473)
      at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
      at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
jars-errorlog.docx
0
Comment
Question by:roy_sanu
  • 2
  • 2
5 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 500 total points
ID: 39232059
You need commons-lang. The jar is missing. The class in question is provided on my system by commons-lang3-3.1.jar
0
 

Author Comment

by:roy_sanu
ID: 39232808
Thanks for the info.there is no error regarding that.
but  getting another error on strut2 application while running  on the  tomcat
Here is the error log on the namespaces.
am  using the url as
http://localhost:8080/Strut2Latest/tutorials/getTutorial.action

==================================================================
SEVERE: Exception occurred during processing request: There is no Action mapped for namespace [/] and action name [] associated with context path [/Strut2Latest].
There is no Action mapped for namespace [/] and action name [] associated with context path [/Strut2Latest]. - [unknown location]
      at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:185)
      at org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:63)
      at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39)
      at com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58)
      at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:536)
      at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
      at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)

+++++++++++++++++++++++++++
http://localhost:8080/Strut2Latest/tutorials/getTutorial.action
Here is my struts.xml with a namespace and a url above, but i do not have any idea why it gives the above error. let me know if this can be resolved


<?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="default" namespace= "/tutorials" extends="struts-default">
      <action name="getTutorial" class ="com.tutorial.Tutorialaction">
      <result name ="success">/sucess.jsp</result>
      </action>
            
      
</package>
 
 
 </struts>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Here is my class
=========================================================
package com.tutorial;

public class Tutorialaction {

      
      public String execute() {
            System.out.println(" Hello");
            return "success";
}
}

=====================================================
error-log.docx
0
 
LVL 12

Expert Comment

by:Sharon Seth
ID: 39233159
From where did you pick up Strut2Latest that is seen in the URL?
0
 

Author Comment

by:roy_sanu
ID: 39233200
Thanks it is working now
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 39233297
:)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
firstswap challenge 20 68
Java passing arguments (type error) 2 48
what is a "java.lang.System Property"   ? 20 57
ForLoop Example 3 40
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now