It's not a secret anymore!*
The moose likes Struts and the fly likes Exception while running struts2 application. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Exception while running struts2 application." Watch "Exception while running struts2 application." New topic
Author

Exception while running struts2 application.

hemanth acharya
Ranch Hand

Joined: Aug 10, 2011
Posts: 51
Hi all,

I am building a simple struts application using struts-2.1.6, but i am getting the following exception.



My struts xml is the following...




The following is my lib structure..

antlr-2.7.6.jar
commons-collections-3.1.jar
commons-fileupload-1.2.1.jar
commons-io-1.3.2.jar
commons-logging-1.1.1.jar
dom4j-1.6.1.jar
freemarker-2.3.13.jar
jsonplugin-0.32.jar
ognl-2.6.11.jar
struts2-convention-plugin-2.1.6.jar
struts2-core-2.1.6.jar
xwork-2.1.2.jar

Suggestions appreciated..

Thanks and regards,
Hemanth.
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8843
    
    7

java.lang.NoSuchMethodException: struts2.LoginAction.execute()()


It looks like your struts2.LoginAction class does not have a method named "execute".


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
hemanth acharya
Ranch Hand

Joined: Aug 10, 2011
Posts: 51
Joe,

It has a execute method !..
The following is my action class...



Regards,
hemanth.
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8843
    
    7

It has a execute method !..


The error is in a class called struts2.LoginAction. You posted the source for a class named struts2.Populating.
hemanth acharya
Ranch Hand

Joined: Aug 10, 2011
Posts: 51
Joe,

My bad !! I apologize for that.... Here is the Login.action and my struts xml...



Struts.xml

Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8843
    
    7

If your source contains the method, I suspect that the .class file is an old version that does not. How are you building your web application?
hemanth acharya
Ranch Hand

Joined: Aug 10, 2011
Posts: 51
joe,

I am building using tomcat,

Here's my classpath file,



Regards,
hemanth.
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8843
    
    7

hemanth acharya wrote:
I am building using tomcat,


Tomcat is a servlet container, not a build tool. I am unfamiliar with this classpath file, but it looks like something from Eclipse.
hemanth acharya
Ranch Hand

Joined: Aug 10, 2011
Posts: 51
Joe,

yes, I am using eclipse.
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8843
    
    7

So are you running Tomcat from Eclipse, or are you packaging the application and deploying it to Tomcat independently?
hemanth acharya
Ranch Hand

Joined: Aug 10, 2011
Posts: 51
Joe,

The former, running tomcat from eclipse.
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8843
    
    7

Did you try rebuilding your application?
hemanth acharya
Ranch Hand

Joined: Aug 10, 2011
Posts: 51
Joe,

Yep, i tried everything.. seems stuck there...
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8843
    
    7

I don't use Eclipse to run Tomcat, so I can't help you. Perhaps you can get some help in our IDE Forum if you can describe your problem effectively.
hemanth acharya
Ranch Hand

Joined: Aug 10, 2011
Posts: 51
Joe,
Ok, thank you..
 
wood burning stoves
 
subject: Exception while running struts2 application.
 
Similar Threads
Struts2 annotation in JBoss 4.0.5.GA
Struts2 Helloworld Problem
strtus 2 application error
Struts2 Filter and Includes
Struts2 + JSON : Getting Class Not Found Error