  | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Struts - A MVC web framework | | Tomcat - JSP/Servlet container | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | | JSP - A mailing list about Java Server Pages specification and reference | |
Struts & Hibernate
|
|
|
  | | | Structs - NoClassDefFoundError | Structs - NoClassDefFoundError 2003-11-29 - By Glenn
Back Hi I have the problem below where the ActionForm seems be unable to be found when my class com.pp.webDomain.actions.animal.AnimalTypeForm inherit from my AbstractForm (subclasses the structs actionForm class). However, if I directly inherit from org.apache.struts.action.ActionForm (normal struts class) it is works fine.
I have checked the following :
1) Struct.jar is in /WEB-INF/Lib directory 2) AnimalTypeForm is in the classes directory 3) Config.xml is in the /WEB-INF directory along with all the strut's .tld files 4) Check that my abstract class in present in the correct directory /WEB-INF /classes/com/common/webDomain/AbstractForm. 5) Check that my abstract class in present in the correct directory /WEB-INF /classes/com/pp/webDomain/actions/animal/AnimalTypeForm. 5) Check that the com.pp.webDomain.actions.animal.AnimalTypeForm (concrete class) inherits okay from my abstract class
I have an class called AbstractForm which subclasses org.apache.struts.action .ActionForm. This resides in the package.
Anyone have any ideas please ???
********************** Error **********************
ERROR org.apache.struts.util.RequestUtils - Error creating form bean of class com.pp.webDomain.actions.animal.AnimalTypeForm java.lang.NoClassDefFoundError : org/apache/struts/action/ActionForm at java.lang.ClassLoader (Native Method) at java.lang.ClassLoader (ClassLoader.java:488) at java.security.SecureClassLoader (SecureClassLoader.java :106) at weblogic.utils.classloaders.GenericClassLoader.findLocalClass (GenericClassLoader.java:401) at weblogic.utils.classloaders.GenericClassLoader.findClass (GenericClassLoader.java:162) at java.lang.ClassLoader (ClassLoader.java:294) at java.lang.ClassLoader (ClassLoader.java:287) at java.lang.ClassLoader (ClassLoader.java:250) at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass (ChangeAwareClassLoader.java:41) at java.lang.ClassLoader (ClassLoader.java:310) at java.lang.ClassLoader (Native Method) at java.lang.ClassLoader (ClassLoader.java:488) at java.security.SecureClassLoader (SecureClassLoader.java :106) at weblogic.utils.classloaders.GenericClassLoader.findLocalClass (GenericClassLoader.java:401) at weblogic.utils.classloaders.GenericClassLoader.findClass (GenericClassLoader.java:162) at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass (ChangeAwareClassLoader.java:62) at java.lang.ClassLoader (ClassLoader.java:294) at java.lang.ClassLoader (ClassLoader.java:250) at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass (ChangeAwareClassLoader.java:41) at org.apache.struts.util.RequestUtils (RequestUtils .java:190) at org.apache.struts.util.RequestUtils (RequestUtils .java:216) at org.apache.struts.util.RequestUtils (RequestUtils .java:610) at org.apache.struts.action.RequestProcessor  (RequestProcessor.java:349) at org.apache.struts.action.RequestProcessor (RequestProcessor .java:243) at org.apache.struts.action.ActionServlet (ActionServlet.java :1109) at org.apache.struts.action.ActionServlet (ActionServlet.java:452) at javax.servlet.http.HttpServlet (HttpServlet.java:740) at javax.servlet.http.HttpServlet (HttpServlet.java:853) at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction .run(ServletStubImpl.java:1058) at weblogic.servlet.internal.ServletStubImpl.invokeServlet (ServletStubImpl.java:401) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:20) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl .java:27) at weblogic.servlet.internal.WebAppServletContext $ServletInvocationAction.run(WebAppServletContext.java:5451) at weblogic.security.service.SecurityServiceManager.runAs (SecurityServiceManager.java:780) at weblogic.servlet.internal.WebAppServletContext.invokeServlet (WebAppServletContext.java:3105) at weblogic.servlet.internal.ServletRequestImpl.execute (ServletRequestImpl.java:2588) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
********************** End of Error **********************
********************** AbstractForm ********************** package com.common.webDomain;
import org.apache.struts.action.ActionForm ;
public class AbstractForm extends ActionForm { public AbstractForm() { } }
********************** End of AbstractForm **********************
********************** AnimalTypeForm ********************** package com.pp.webDomain.actions.animal;
import org.apache.struts.action.ActionForm ; import org.apache.struts.action.ActionMapping ; import javax.servlet.http.HttpServletRequest ; import com.pp.webDomain.WebTierController; import com.common.webDomain.AbstractForm; import org.apache.struts.action.ActionErrors ; import org.apache.struts.action.ActionError ; import com.pp.entityDomain.animalType.AnimalTypeTO; import org.apache.log4j.Logger ;
public class AnimalTypeForm extends AbstractForm { static private Logger logger = Logger.getLogger( AnimalTypeForm.class );
public AnimalTypeForm() { logger.info( "Enter Creating AnimalTypeForm " ); animalType = new AnimalTypeTO(); logger.info( "Exit Creating AnimalTypeForm " ); }
public AnimalTypeTO getAnimalType() { return animalType; }
public void setAnimalType( AnimalTypeTO animalType ) { this.animalType = animalType; }
public void reset( ActionMapping actionMapping, HttpServletRequest req ) { logger.info( "Enter AnimalTypeForm.reset" ); if ( animalType != null ) { animalType.setId( null ); animalType.setCrossBreed( Boolean.FALSE ); animalType.setName( null ); } logger.info( "Exit AnimalTypeForm.reset" ); }
public ActionErrors validate( ActionMapping actionMapping, HttpServletRequest req ) { logger.info( "Enter AnimalTypeForm.validate" ); ActionErrors errors = new ActionErrors(); AnimalTypeTO animalTypeMVO = this.getAnimalType(); String typeName = animalTypeMVO.getName(); if ( typeName == null || typeName.equals( "" ) ) { errors.add( "name", new ActionError( "error.animaltype.name" ) ); } logger.info( "Exit AnimalTypeForm.validate" ); return errors; }
private AnimalTypeTO animalType = null; }
********************** End of AnimalTypeForm **********************
=========================================================================== To unsubscribe, send email to listserv@(protected) and include in the body of the message "signoff J2EE-INTEREST". For general help, send email to listserv@(protected) and include in the body of the message "help".
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=Content-Type content="text/html; charset=iso-8859 (See http://iso-8859.ora-code.com)-1"> <META content="MSHTML 6.00.2800.1276" name=GENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=#ffffff> <DIV><FONT face=Arial size=2>Hi I have the problem below where the ActionForm seems be unable to be found when my class <STRONG>com.pp.webDomain.actions.animal.AnimalTypeForm </STRONG>inherit from my <STRONG>AbstractForm </STRONG>(subclasses the structs actionForm class). However, if I directly inherit from <STRONG>org.apache.struts.action.ActionForm </STRONG>(normal struts class) it is works fine. </FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>I have checked the following :</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>1) Struct.jar is in /WEB-INF/Lib directory</FONT></DIV> <DIV><FONT face=Arial size=2>2) AnimalTypeForm is in the classes directory</FONT></DIV> <DIV><FONT face=Arial size=2>3) Config.xml is in the /WEB-INF directory along with all the strut's .tld files</FONT></DIV> <DIV><FONT face=Arial size=2>4) Check that my abstract class in present in the correct directory /WEB-INF/classes/com/common/webDomain/AbstractForm.</FONT></DIV> <DIV><FONT face=Arial size=2>5) Check that my abstract class in present in the correct directory /WEB-INF/classes/com/pp/webDomain/actions/animal/AnimalTypeForm.</FONT></DIV> <DIV><FONT face=Arial size=2> <DIV><FONT face=Arial size=2>5) Check that the com.pp.webDomain.actions.animal.AnimalTypeForm (concrete class) inherits okay from my abstract class</FONT></FONT></DIV></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>I have an class called AbstractForm which subclasses org.apache.struts.action.ActionForm This resides in the package. </FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>Anyone have any ideas please ???</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>********************** Error ********************** </FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>ERROR org.apache.struts.util.RequestUtils - Error creating form bean of class com.pp.webDomain.actions.animal.AnimalTypeForm<BR>java.lang .NoClassDefFoundError: org/apache/struts/action/ActionForm<BR> at java.lang.ClassLoader (Native Method)<BR> at java.lang.ClassLoader (ClassLoader.java:488)<BR> at java.security.SecureClassLoader (SecureClassLoader.java:106)<BR> at weblogic.utils.classloaders.GenericClassLoader.findLocalClass (GenericClassLoader.java:401)<BR> at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader .java:162)<BR> at java.lang.ClassLoader (ClassLoader.java:294)<BR> at java.lang.ClassLoader (ClassLoader.java:287)<BR> at java.lang.ClassLoader (ClassLoader.java:250)<BR> at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass (ChangeAwareClassLoader.java:41)<BR> at java.lang.ClassLoader (ClassLoader.java:310)<BR> at java.lang.ClassLoader (Native Method)<BR> at java.lang.ClassLoader (ClassLoader.java:488)<BR> at java.security.SecureClassLoader (SecureClassLoader.java:106)<BR> at weblogic.utils.classloaders.GenericClassLoader.findLocalClass (GenericClassLoader.java:401)<BR> at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader .java:162)<BR> at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass (ChangeAwareClassLoader.java:62)<BR> at java.lang.ClassLoader (ClassLoader.java:294)<BR> at java.lang.ClassLoader (ClassLoader.java:250)<BR> at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass (ChangeAwareClassLoader.java:41)<BR> at org.apache.struts.util.RequestUtils (RequestUtils.java:190)<BR> at org.apache.struts.util.RequestUtils (RequestUtils.java:216) <BR> at org.apache.struts.util.RequestUtils (RequestUtils.java:610)<BR> at org.apache.struts.action.RequestProcessor (RequestProcessor .java:349)<BR> at org.apache.struts.action.RequestProcessor (RequestProcessor.java:243)<BR > at org.apache.struts.action.ActionServlet (ActionServlet.java:1109)<BR> at org.apache.struts.action.ActionServlet (ActionServlet.java:452)<BR> at javax.servlet.http.HttpServlet (HttpServlet.java:740)<BR> at javax.servlet.http.HttpServlet (HttpServlet.java:853)<BR> at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run (ServletStubImpl.java:1058)<BR> at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java :401)<BR> at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:20)<BR> at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)<BR> at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run (WebAppServletContext.java:5451)<BR> at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager .java:780)<BR> at weblogic.servlet.internal.WebAppServletContext.invokeServlet (WebAppServletContext.java:3105)<BR> at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java :2588)<BR> at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)<BR> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>********************** End of Error ********************** </FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>********************** AbstractForm ********************** </FONT></DIV> <DIV><FONT face=Arial size=2>package com.common.webDomain;</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>import org.apache.struts.action.ActionForm ;</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>public class AbstractForm extends ActionForm<BR>{<BR> public AbstractForm()<BR> {<BR> }<BR>}</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>********************** End of AbstractForm **********************</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2> <DIV><FONT face=Arial size=2>**********************   ;AnimalTypeForm **********************</FONT></DIV></FONT></DIV> <DIV><FONT face=Arial size=2>package com.pp.webDomain.actions.animal;</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>import org.apache.struts.action.ActionForm ;<BR>import org.apache.struts.action.ActionMapping ;<BR>import javax.servlet.http.HttpServletRequest ;<BR>import com.pp.webDomain.WebTierController;<BR>import com.common.webDomain.AbstractForm;<BR>import org.apache.struts.action.ActionErrors ;<BR>import org.apache.struts.action.ActionError ;<BR>import com.pp.entityDomain.animalType.AnimalTypeTO;<BR>import org.apache.log4j.Logger ;</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>public class AnimalTypeForm extends AbstractForm<BR>{<BR> static private Logger logger = Logger.getLogger( AnimalTypeForm.class );</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2> public AnimalTypeForm()<BR> {<BR> logger.info( "Enter Creating AnimalTypeForm " );<BR> animalType = new AnimalTypeTO();<BR> logger.info( "Exit Creating AnimalTypeForm " );<BR> }</FONT></DIV> <DIV> </DIV> <DIV><FONT face=Arial size=2> public AnimalTypeTO getAnimalType()<BR> {<BR> return animalType;<BR> }</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2> public void setAnimalType( AnimalTypeTO animalType )<BR> {<BR> this.animalType = animalType;<BR> }</FONT></DIV> <DIV> </DIV> <DIV><FONT face=Arial size=2> public void reset( ActionMapping actionMapping, HttpServletRequest req )<BR> {<BR> logger.info( "Enter AnimalTypeForm.reset" );<BR> if ( animalType != null )<BR> {<BR> animalType.setId( null );<BR> animalType.setCrossBreed ( Boolean.FALSE );<BR> animalType.setName( null );<BR> }<BR> logger.info( "Exit AnimalTypeForm.reset" );<BR> }</FONT></DIV> <DIV> </DIV> <DIV><FONT face=Arial size=2> public ActionErrors validate( ActionMapping actionMapping, HttpServletRequest req )<BR> {<BR> logger.info( "Enter AnimalTypeForm.validate " );<BR> ActionErrors errors = new ActionErrors();<BR> AnimalTypeTO animalTypeMVO = this.getAnimalType();<BR> String typeName = animalTypeMVO.getName();<BR> if ( typeName == null || typeName.equals( "" ) )<BR> {<BR> errors.add( "name", new ActionError( "error.animaltype.name" ) );<BR> }<BR> logger.info( "Exit AnimalTypeForm.validate" );<BR> return errors;<BR> }</FONT></DIV> <DIV> </DIV> <DIV><FONT face=Arial size=2> private AnimalTypeTO animalType = null;<BR>}</FONT></DIV> <DIV> </DIV><FONT face=Arial size=2> <DIV><BR> </DIV> <DIV> <DIV><FONT face=Arial size=2>********************** End of AnimalTypeForm **********************</FONT></DIV></DIV></FONT></BODY></HTML> =========================================================================== To unsubscribe, send email to listserv@(protected) and include in the body of the message "signoff J2EE-INTEREST". For general help, send email to listserv@(protected) and include in the body of the message "help". <p>
|
|
 |