Win a copy of TensorFlow 2.0 in Action this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

WSAD5 - Struts ActionErrors

Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a Web Project that uses struts. The project needs to access a common java project containing a class that serves as an error handler (
The ErrorHandler class is instantiated from an Action class in the web project. The ErrorHandler has a method getErrors() which returns an ActionErrors object.
I have placed struts.jar in WEB-INF/lib of the web project and included struts.jar in the classpath for the Java project containing I have also linked the Java project to the web application.
Though the ErrorHandler class compiles correctly, a 'java.lang.NoClassDefFoundError: org/apache/struts/action/ActionErrors' is thrown at runtime when the getErrors() method is called.
If is made part of the web project it works fine. The 'NoClassDef found' error occurs only when it is moved out into a separate Java Project.
Is there a specific configuration in WSAD5 that can help me run my application when the ErrorHandler is moved out into a separate Java Project?
Ranch Hand
Posts: 374
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On the project properties, select Web Library Projects. Click Add, create a jar name, and select the project containing your error handler.
The other possibility is that one (or both) of the struts.jar files is corrupted. Check their sizes, then check them against one that you know is good. I've seen this happen and cause similar errors in the past.
Is that a spider in your hair? Here, threaten it with this tiny ad:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic