• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Error creating form bean of class Problem

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Im encountering this problem in struts for several days

18:47:21,954 ERROR [RequestUtils] Error creating form bean of class com.xcare.meta.web.DatabaseForm
java.lang.NoClassDefFoundError: org/apache/struts/action/ActionForm

My struts-config.xml contains:


My DatabaseForm.java contains:


My DatabaseAction.java contains:



What should I do to fix this?
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The important part of this error message is:

java.lang.NoClassDefFoundError: org/apache/struts/action/ActionForm

Here are some possible causes of this error:

1- Check to make sure struts.jar is in your WEB-INF/lib directory
2- Check to make sure that the commons-xxx.jar files and the struts.jar file are for the same version of struts, meaning that they all came from the same struts download package.
3- Make sure that there is not another struts.jar or one of the commons-xxx.jar files being loaded by another Class Loader. This could happen if there's a copy of one of these jar files in some common area used by your App Server.
 
Harry Tiu
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here are some possible causes of this error:

1- Check to make sure struts.jar is in your WEB-INF/lib directory [check!]

2- Check to make sure that the commons-xxx.jar files and the struts.jar
file are for the same version of struts, meaning that they all came
from the same struts download package. [check!]

3- Make sure that there is not another struts.jar or one of the commons-xxx.jar
files being loaded by another Class Loader. This could happen if there's a copy
of one of these jar files in some common area used by your App Server. [check!]

>> But Im still encountering the same error. Actually I removed struts.jar in WEB-INF/lib
then I encountered java.lang.ClassNotFoundException: org.apache.struts.action.ActionServlet
that means my app is only looking at one struts.jar and it is in WEB-INF/lib.

Before I only encountered this:
ERROR [RequestUtils] Error creating form bean of class com.xcare.meta.web.DatabaseAction
java.lang.NoClassDefFoundError: org/apache/struts/action/Action

DatabaseAction extends Action. I found out that my DatabaseAction and other relevant classes were not copied in its package jar file.
After fixing it, I now have two errors:

[RequestUtils] Error creating form bean of class com.xcare.meta.web.DatabaseForm
java.lang.NoClassDefFoundError: org/apache/struts/action/ActionForm

and

ERROR [RequestProcessor] No action instance for path /meta/search could be created
java.lang.NoClassDefFoundError: org/apache/struts/action/Action


Please help

[ June 21, 2006: Message edited by: Harry Tiu ]
[ June 21, 2006: Message edited by: Harry Tiu ]
 
Harry Tiu
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've found the problem and was able to fix it.

The cause of the problem was that I was duplicatedly deploying my classes (DatabaseAction, DatabaseForm) to different jar files that is causing the NoClassDefFound Exception. This is actually fixed in my build.xml.

Thanks Merrill Higginson!
 
Do not set lab on fire. Or this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic