users@glassfish.java.net

specify my own ejbclassloader?

From: <glassfish_at_javadesktop.org>
Date: Sun, 05 Apr 2009 23:24:53 PDT

Hi,

i have found myself in a situation where i need to add a tiny bit of custom functionality to the ejb classloader.. e.g. i am trying to load generated byte code during runtime, and would like to be able to slightly extend the ejbclassloader by adding functionality to load generated bytecode for an entity which cannot be found then (which it wouldn't because it hasn't yet been loaded) i would like to add then load it from here.. and add it as byte[] of the entity class in question?

so after a reasonable while searching for a solution i ask you guys and gals here? any ideas? so far i have tried extending my own classloader and setting the parent to the current ejbclassloader, however this does not work, as i am effectively sandboxign the class and nothing else can see it..

then i have found where you can specify a classloader for a webapp.. and i have tried this for my ejbapp without much luck? e.g. creating a context.xml and setting the <Loader ...> property

[code]
<Context>
    
    <Loader loaderClass="test.MyClassLoader" loaderClass="test.MyClassLoader"/>

</Context>
[/code]

to me this looks as though it could possibly work, however all i have found is that it works with webapps, and no mention of ejbapps? has anyone any experience with this?

finally the only documentation i have been able to find on this is from tomcat, and in there it says that inorder to work the custom classloader must implement org.apache.catalina.Loader..

so does anyone know which glassfish interface i would need to implement to make it compatable?

or finally is my logic ok or am i off on another tangent with no light at the end?

cheers,

dix
[Message sent by forum member 'newdixieland' (newdixieland)]

http://forums.java.net/jive/thread.jspa?messageID=340704