My mistake, i have used the wrong method in spring social . I was trying to use twitter id to send message but the method has string as a parameter which will consider the value i give as ‘screen_name’ Using the method which uses twitter id resolved the issue.
I had to use
twitter.directMessageOperations().sendDirectMessage(long twitter_id,String msg)
but i used
twitter.directMessageOperations().sendDirectMessage(String screen_name,String msg)
which was the issue