Spring/Hibernate: InvocationTargetException when deleting entity
        Posted  
        
            by niklassaers
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by niklassaers
        
        
        
        Published on 2010-05-17T11:08:36Z
        Indexed on 
            2010/05/17
            11:10 UTC
        
        
        Read the original article
        Hit count: 374
        
I'm sorry if this question is a bit vague, but I'm quite confused.
I've got a controller that calls a service to delete an entity and then create an entity in its place. In the service, I've got my DAO, and my entity, and I want to delete my entity, so I call
DAO.delete(entity);
Then, seemingly out of nowhere, I get an InvocationTargetException. The parameters here are:
method: public org.springframework.web.servlet.ModelAndView tld.myproject.view.web.controller.MyController.replaceEntity(org.springframework.web.multipart.MultipartFile,javax.servlet.http.HttpServletRequest)
target: tld.myproject.view.web.controller.MyController@185918e
args: [org.springframework.web.multipart.commons.CommonsMultipartFile@14812a6, org.springframework.web.multipart.support.DefaultMultipartHttpServletRequest@c08a64]
ex: java.lang.reflect.InvocationTargetException
private Object doInvokeMethod(Method method, Object target, Object[] args) throws Exception {
    ReflectionUtils.makeAccessible(method);
    try {
        return method.invoke(target, args);
    }
    catch (InvocationTargetException ex) {
        ReflectionUtils.rethrowException(ex.getTargetException());
    }
    throw new IllegalStateException("Should never get here");
}
Does anyone have a suggestion to what's going on? Anything I can use in my debugging?
Cheers
Nik
© Stack Overflow or respective owner