Question: I have 15 list items. I allow user to pick only 5 out of them. Then I put this info into the array and submit to the server.

```
<li><a href="#" id="item1" class="select">Item One</a></li> ... etc.

```

Then I use this code to toggle class of selected items

```
function SelectPrizes (){
$('a.select').click(function() {
    $(this).toggleClass("selected");
    $(this).text($(this).text() == 'Choose prize' ? 'Selected' : 'Choose prize');
    return false;
});
}

```

My question is, how to allow only 5 selections and add only selected items to an array by ID.

I understand that I can filter by hasClass('selected'), but I can't figure out the right syntax for that.

Answer: 
It's actually complaining about the `annotatedClasses` property of the session factory, you are using a `LocalSessionFactoryBean` that doesn't have it (you have commented out `AnnotationSessionFactoryBean` that *does* have it).
Looks like you want to set "annotatedClasses" property originally coming from AnnotationSessionFactoryBean while you are actually using LocalSessionFactoryBean that does not have this property.