Help coderanch get a
new server
by contributing to the fundraiser

Rohit Bhal

Ranch Hand
+ Follow
since Aug 28, 2007
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Rohit Bhal

I was mistakenly using a different schema than the one I was generating using Hibernate. Both the schema had passwordConfirmation field in the User entity so got confused.

I've got it working now. Thanks
Hi Rishi

Here is the complete stacktrace:

And here is the schema of the user table:

Hi Hemant

The only entity that I have is User entity and the schema was generated using Hibernate itself. Although it should not be a problem but even after removing @NotEmpty from passwordConfirmation fields, it still gives me the same error. I am using spring mvc 3 with hibernate 3. I am using User entity to represent the form and after submitting the form I find the model populated with the respective fields properly.

I've been scratching my head over this error for sometime now but can't work it out. I've been using Hibernate 3 to persist User entity. But I am getting java.sql.SQLException: Field 'passwordConfirmation' doesn't have a default value error when I try to do that.

Following is my User entity:

Could someone help me understand that why am I getting this error?
@joy: I think query like "" is not supported anymore. I am not sure if it was supported in the older version of Hibernate either. Thanks for reply

@Bogdan: Yes, "select book from Book book inner join book.chapters chapter where chapter.title like '%Hibernate%'" gave me exactly that. Thanks for reply
The situation is like this:

I have an entity Book that holds a one-to-many relationship with Chapter.

Now if I try the query, "from Book book inner join book.chapters chapter where chapter.title like '%hibernate%'", it gives me the desired result.

But if I try, "from Book where book.chapters.title like '%hibernate%'", I get the error illegal attempt to dereference collection.

The thing is that I only want the collection of Book objects in return and not a collection of pair of Book and Chapter objects in return which I get with the former query.

Could someone help me understand?
Hi Mark
I was mistakenly using the wrong import for ModelAndView.
I was supposed to use org.springframework.web.servlet.ModelAndView but the one I was mistakenly using was org.springframework.web.portlet.ModelAndView.

I've got the code working now.

13 years ago
Hi Mark
I am using the User backing object for form representation. Do you think we need ${} around all the variables for that?
I have never handled form using ${} around variables in spring mvc 3.
I am just not able to understand why am I getting this error and what am I doing wrong here?

Thanks for reply though:)

13 years ago
Could someone help me understand what am I doing wrong in the following code due to which I am getting this error:


Could someone help me understand it?

13 years ago
Hi Mark, to get jCaptcha working I just needed a Controller and a bean configured in the application context configuration file to get the image displayed. And then some validation to check is the response entered by user was correct.

This is a piece from the addNewUser.jsp:

For some reasons attribute inside the img tag is not being displayed, its just src="".
The other object inside Model model is org.springframework.validation.BindingResult.user.
model.toString() gave me:

Thanks again for reply:)

13 years ago
I've got jCaptcha working but I am still missing reCaptcha

13 years ago
Hi Mark, thanks for reply again.
request.getParameter('..')[http status 500, with null value for challenge and response fields], request.getAttribute('..')[http status 500, with null value for challenge and response fields] and @RequestParam('..')[http status 400].
I ran it under debug mode to see what was inside the 'Model model' and have taken 2 screen shots in case you find them useful.
Here are the links for them:
user inside model

I had reCaptcha working with Spring 2.5 from the book 'Spring in Practice' sometime ago, I wonder what am I missing with Spring 3. I have started feeling depressed now

Thanks for reply
13 years ago
I removed the and and tried and , what I found was that I was getting null value for both recaptcha_response_field and recaptcha_response_field.
13 years ago
Hi Mark, that was exactly what I thought first and tried the crude way to having the <script> and <noscript> tags in the jsp with public key and tried working it out but it dint help either.

Here is the code of the controller I am using, all I am trying to do is register a user with reCaptcha functionality but what I am getting is a http status 400 with the error :

Here is the addNewUser.jsp element on the form page for the above controller:

I wonder what am I missing here?
Thanks for reply.

13 years ago

I've been trying to integrate reCaptcha with my application built on Spring framework, but I am getting this error:

Could someone help me understand that why am I getting this error. I've got both "recaptcha_challenge_field" and "recaptcha_response_field" parameters bound to the User domain object.

Could anybody help me understand what am I missing?

13 years ago