my dog learned polymorphism*
The moose likes Struts and the fly likes Error creating form bean ... NPE Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Error creating form bean ... NPE" Watch "Error creating form bean ... NPE" New topic
Author

Error creating form bean ... NPE

Matt Tyson
Greenhorn

Joined: Jun 29, 2006
Posts: 5
I'm getting this error from struts:

18:37:52,281 ERROR [RequestUtils] Error creating form bean of class webview.struts.form.QueueViewForm
java.lang.NullPointerException

I've tried recreating the project with a different package structure.

Here's the struts-config.xml (relavant parts, rest is empty):

<form-beans>
<form-bean name="QueueViewForm" type="webview.struts.form.QueueViewForm" />
</form-beans>

...

<action-mappings>

<action path="/QueueViewSetup"
name="QueueViewForm"
type="webview.struts.action.QueueViewSetup"
scope="request" validate="true" input="/webpages/queueView/queueView.jsp" />

</action-mappings>

...And here's the very ambitious jsp:

<html:form action="/QueueViewSetup.do">

</html:form>

...And here's the form bean:

package webview.struts.form;

import org.apache.struts.action.ActionForm;

public class QueueViewForm extends ActionForm {

}

... And the action:

package webview.struts.action;
import org.apache.struts.action.Action;

public class QueueViewSetup extends Action {

}

Any suggestions? I've deployed a number of struts apps and never seen this. I'm in a new environment, and can't seem to get rid of it.

Thanks guys.
Matt Tyson
Greenhorn

Joined: Jun 29, 2006
Posts: 5
Ok... got it. Didn't have my classes under WEB-INF/classes
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Error creating form bean ... NPE