Results 1 to 1 of 1

Thread: How to obtain/retrieve a target object from a scope session object

Threaded View

  1. #1

    Default How to obtain/retrieve a target object from a scope session object

    Hi All

    I am writing a simple web app that contains certian scoped session objects. I need to pass these objects to some EJBs. However because the objects are session scoped, the objects that are returned to me by the spring container are proxies and hence I get a ClassNotFoundException as the EJBs expects the target objects and not a proxy. I wanted to know how I can obtain the target objects of these proxies. I am usng CGLIB. Some sample code of how this is done will be greatly appreciated.

    Here is my bean config for the scoped session object that needs to be passed to the EJB
    Code:
    <bean id = "contactDetails" class ="com.raptorsoftdynamics.ejb.ContactDetails" scope="session">
    	<aop:scoped-proxy />
    </bean>
    Here is my code passing the object from above to the EJB

    Code:
    public void setContactDetails(ContactDetails contactDetails) {
    		this.contactDetails = contactDetails;
    	}
    
    public boolean registerUser(){
    ContactDetails model = this.contactDetails;
    		
    boolean registered = false;
    registered=userBean.register(model.getUsername(),model.getPassword(),model.getConfirmedPassword(),
    model.getEmail()),model.getConfirmedEmail());
    
    return registered;
    }

    The error I get is
    Code:
    Missing class: com.raptorsoftdynamics.ejb.CustomerDetails$$EnhancerByCGLIB$$4575aa43
    Thanks
    Last edited by quophyie; Jan 22nd, 2010 at 05:48 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •