0

I'm trying to update a big projekt from Spring 2 to Spring 4. On the deep end of the Beans hierarchy i found a class called CustomAbstractStatelessSessionBean and that extends the AbstractStatelessSessionBean class from org.springframework.ejb.support.AbstractStatelessSessionBean.

The content of the class:

public abstract class CustomAbstractStatelessSessionBean extends

AbstractStatelessSessionBean{

    /**
     * 
     */
    private static final long serialVersionUID = -8467612263077285422L;

    @Override
    public void setSessionContext(SessionContext sessionContext) {
        LocalSlsbInvokerInterceptor asd =new LocalSlsbInvokerInterceptor;

        super.setSessionContext(sessionContext);

        setBeanFactoryLocatorKey("global.spring.ejb.context");
        setBeanFactoryLocator(SingletonBeanFactoryLocator.getInstance());
    }
}

Be patient Spring rookie here! :D

Every idea or workaround is welcomed!

M. Deinum
  • 115,695
  • 22
  • 220
  • 224
hEngi
  • 865
  • 10
  • 23
  • 1
    And your question is? – M. Deinum Jun 18 '15 at 12:23
  • Is there a workaround? As i see the only reason for this anchestor class is to set the context. Is there any interface that is capable of that? – hEngi Jun 18 '15 at 12:37
  • 1
    The class doesn't exist anymore because it is old, it dates back to the old EJB specs and hence has been removed. There is no replacement you can get the source from an older spring version and add it to your own project and use that. Else figure out what is needed exactly from the `AbstractStatelessSessionBean` and make a minimal implementation for that. Or refactor to not have to use the EJB at all. – M. Deinum Jun 18 '15 at 12:41
  • Okey. I will find some older source :) – hEngi Jun 18 '15 at 13:03
  • Thanks for the help :) The best workaround was to find the source and copy it :) It's a very thin layer between the javax and the spring classes. Is it possible to mark your comment as the answer? – hEngi Jun 18 '15 at 14:31
  • This workaround did not work for me. Am I missing something here ? I believe the AbstractStatelessSessionBean allows to setSessionContext, but I am not able to set it without support to this class. – Ashish K Dec 23 '19 at 14:39
  • Damn you must be working on some very old code cause it was legacy thing 5 years ago. I guess your problem is that the setSessionContext was removed(it was only deprecated in that time) – hEngi Jan 06 '20 at 13:25

1 Answers1

0

Simplest way is to find the source of the spring classes and copy it. It was a very thin layer between the spring class and the real javax classes :)

hEngi
  • 865
  • 10
  • 23