I've been using SimpleRemoteStatelessSessionProxyFactoryBean to access SLSBs on a Weblogic 5.1 (yes, very old) server, and it would appear to be causing a memory leak in the client VM.
My appcontext on the client is along the lines of:
This was used to replace code like this:Code:<bean id="myProxyBean" class="org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean"> <property name="jndiName" value="mySLSBHomeInterfaceName" /> <property name="businessInterface" value="myBusinessInterface" /> </bean>
In other words, standard, old-fashioned boilerplate stuff.Code:public static MyObject lookup(String objId) throws MyException { MyRemoteInterface remote = null; try { MySLSBHome home = (MySLSBHome) NamingUtil.lookup("mySLSBHomeInterfaceName"); remote = home.create(); return remote.lookup(objId); } catch (CreateException e) { throw new MyException (e); } catch (NamingException e) { throw new MyException (e); } catch (EJBException e) { throw new MyException (e); } catch (RemoteException e) { throw new MyException (e); } finally { ObjectUtil.removeEJB(tpl); } }
Now, functionally, the Spring proxy approach works just fine, but after a certain amount of time, the VM is running out of memory. It happens every time when using the Spring proxy, but never when using the old-style manual code.
Looking through the sourcecode for SimpleRemoteStatelessSessionProxyFactoryBean, it appears to be doing more or less the same logic as the code shown above.
I've tried running the VM through a profiler, but the memory leak doesn't manifest itself when being profiled (typical).
Factors that may be of interest:
Client: Sun 1.3.1 VM
Server: Weblogic 5.1 running on Sun 1.3.1 VM
I can see that potentially there may be issues when running on old VMs and old appservers, but as I said, the actual handling of the SLSB invocations is pretty much the same between the Spring code and my own code.
The leak is proving to be quite a mystery. Any light anyone could shed on this would be greatly appreciated.


Reply With Quote