File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other Application Frameworks and the fly likes does not support command class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "does not support command class" Watch "does not support command class" New topic
Author

does not support command class

Darshan Shah
Greenhorn

Joined: Oct 20, 2007
Posts: 12
Hi all,
i am darshan.
i am very new abt spring and hibernate.
i am stucking some errors form last week.
below error i got . i tried to debugg several times but still i unable to find out exact solution for this problem.

default constructor call in OhbillFormController...
[HllLegal1] ERROR [http-8080-Processor5] DispatcherServlet.initServletBean(228)
| Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean wit
h name 'OhbillFormController' defined in ServletContext resource [/WEB-INF/actio
n-servlet.xml]: Initialization of bean failed; nested exception is java.lang.Ill
egalArgumentException: Validator [org.springmodules.commons.validator.DefaultBea
nValidator@1890c67] does not support command class [com.cybermanagers.legal.mode
l.OHBill]
java.lang.IllegalArgumentException: Validator [org.springmodules.commons.validat
or.DefaultBeanValidator@1890c67] does not support command class [com.cybermanage
rs.legal.model.OHBill]


if any one know please guide me ..
i really appericiate for your reply.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

Can you post your mappings. It seems that Spring is being told to do a dependency injection that doesn't exist, or it expects one and you didn't declare it.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Darshan Shah
Greenhorn

Joined: Oct 20, 2007
Posts: 12
Thanks Mark for giving reply me...
here i sending whtver code are suppose to be added in several fils

1) following are bean add in action-servlet.xml



2)OHBillFormController.java added in action


3)Following is pojo file OHBill.java wrote in model .



4) OHBillDdao.java




5) OHBillManager.java



i wrote this all classes in my existing project.
i want to store new data in new table tht y i wrote new pojo file which i give to you. this class are set to as setcommand class in controller then i got exception when i run application on tomcat.

Does not support command class...

i am very new abt spring and hibernate...
if you have to something figure out form this then Guide me...i am very stucking ....ignore my english grammer mistake

Once again thanks for Reply
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

Your doing great with the English.

I found this in a Google Search with the text "Spring Validator Command"

http://tech-scribbles.blogspot.com/2006/06/spring-validator-does-not-support.html

there might be some more good stuff with that search, if that first link doesn't help.

Good Luck

Mark
Darshan Shah
Greenhorn

Joined: Oct 20, 2007
Posts: 12
Hi Mark,
first of all sorry for late reply.from last last i m not touch with this topic tht y unable to reply you. what ever you send me link i go through but i did get any thin from that.

i hope you undersatnd my problem.
please tell me solution for that and one more thin can you guide me exact proper way for spring web application development.

thanks.
Darshan Shah
Greenhorn

Joined: Oct 20, 2007
Posts: 12
even i am go through the link whatever mentioned their , i check according to my war file also ...is it right..
but still i m confusing wht should i do???
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

In the action-servlet.xml you posted, you have autowire="byName" set.

Is there a bean or property named "commandClass" defined that might be mapped onto the OhbillFormController's commandClass property?

Also, in the documentation of springmodules Commons Validator it says,

"The beanValidator bean uses the value of the property commandClass of the controller to select the name of the form tag in the validation.xml file. The configuration is not based on the commandName property. For example, with the class name org.springmodules.sample.MyForm, Commons Validator must contain a form tag with myForm as value of the name property."

It appears that capitalization matters here, so this might be where the problem is...

Do you have a form validation entry in your validation.xml with the name "oHBill"?



-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Darshan Shah
Greenhorn

Joined: Oct 20, 2007
Posts: 12
Hi Nathan,
according to you instruction i update changes till i m stucking with same problem. actually whatever way i following is it right or wrong i am confusing about that.

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'OhbillFormController' defined in ServletContext resource [/WEB-INF/action-servlet.xml]: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: Validator [org.springmodules.commons.validator.DefaultBeanValidator@abaf8c] does not support command class [com.cybermanagers.legal.model.OHBill]
java.lang.IllegalArgumentException: Validator [org.springmodules.commons.validator.DefaultBeanValidator@abaf8c] does not support command class [com.cybermanagers.legal.model.OHBill]


Thanks for your reply.
Darshan Shah
Greenhorn

Joined: Oct 20, 2007
Posts: 12
Hi all,
right now i able to display jsp page...but right now i got one error

org.springframework.beans.NotReadablePropertyException: Invalid property 'description' of bean class [com.cybermanagers.legal.model.OHBill]: Bean property 'description' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?

OHBill.java


Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

Your getDescription()/setDescription() methods are both marked as protected... you'll need to make at least the getter public. The class created by the JSP isn't going to be in the same package/class structure as your OHBill class(most likely, unless you've defined a package structure and class for the JSP to be compiled to), so it can't call the protected methods.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: does not support command class