Announcement Announcement Module
Collapse
No announcement yet.
How to obtain/retrieve a target object from a scope session object Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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, 06:48 AM.
Working...
X