Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

Annotations not being detected

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

If any one can help me resolve this issue , would really appreciate it.

I am not sure why my spring controller doesn't pick up the @XmlRootElement name and @XmlElement name of the domain objects.

my controller request mapping syntax



public class GetChatUserDetails {

private static final Logger logger = LoggerFactory.getLogger("");
private IGetChatUserDetailService iGetChatUserDetailService;

private MessageSource messageSource;

public ChatUserDetail getUserDetails(ModelMap model,@RequestParam("userId") String userId,@RequestParam("ipaddr") String ipAddr) throws Exception
ChatUserDetail chatUserDetail =null;
logger.debug("in GetUser Details Service");
chatCustDetail = iGetChatUserDetailService.getChatCustDetail(userId, ipAddr);
logger.debug("Returning response to the handler");
catch(Exception ex){
model.addAttribute(Message.MESSAGES, populateMessageObject("livechat.service.error",6002));
logger.error("Error. Error Message: "+ex.getMessage());

return chatCustDetail;

private Object populateMessageObject(String string,int errorCode) {

Message messageObject = new Message();
String messageText = messageSource.getMessage(string,null, null);
messageObject.setText( messageText);
return messageObject;

}//end of class

package com.stock.domain;

import java.util.List;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAccessType;

public class ChatUserDetail {

private List<ChatUserAccount> chatUserlist;
private ChatUserLocation userLoc;

public List<ChatUserAccount> getChatUserlist() {
return chatUserlist;
public void setChatUserlist(List<ChatUserAccount> chatUserlist) {
this.chatUserlist = chatUserlist;

public ChatUserLocation getUserLoc() {
return userLoc;
public void setUserLoc(ChatUserLocation userLoc) {
this.userLoc = userLoc;


spring context xml

?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="";
xmlns:xsi=""; xmlns:context="";

<context:component-scan base-package="" />
<context:component-scan base-package="" />
<context:component-scan base-package="" />
<context:annotation-config />
<bean id="messageSource" class="">
<property name="basenames">
This is my favorite show. And this is my favorite tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic