This sounds like a case for the
org.jboss.deployment.scope.J2eeGlobalScopeDeployer which
builds some kind of "virtual" classloader hosting all (or, in the future, a
configurable part of) 
the deployed applications. Currently it�s disabled (dunno whether it�s
already in the binary), 
for 3.0 it is planned to merge the code into the default J2eeDeployer.

Best,
CGJ

-----Urspr�ngliche Nachricht-----
Von: Victor Hadianto [mailto:[EMAIL PROTECTED]]
Gesendet: Mittwoch, 11. Juli 2001 14:25
An: [EMAIL PROTECTED]
Betreff: [JBoss-user] dynamic class loading and deploying


This is the background of the problem. First bear with me as this is quite a
problem.

Say that I have created a framework called ComponentFramework and package
this framework in a jar file called ComponentFramework.jar. In this
framework I have the ComponentExecutor (Session Bean) and
ComponentEntityBean (CMP EntityBean) and then a ComponentInterface. The idea
is having a ComponentInterface as an attribute of ComponentEntityBean and
let the container handle the persistence.

This framework will allow other developer to create their component, say for
argument sake ComponentLinux. This ComponentLinux is to implement the
ComponentInterface and have a well defined contract with the
ComponentFramework. ComponentLinux for sure has to know the classes in
ComponentFramework.jar as it extends ComponentInterface hence it the
ComponentLinux.jar file the MANIFEST.MF file contains a Classpath reference
to ComponentFramework.jar.

Now the problem arise since the ComponentExecutor need to create an instance
of ComponentLinux. For example:
<cut .. after getting the Home interface and get ComponentExecutor remote
interface -->

componentExecutor.execute("com.confuse.ComponentLinux", param);

Inside the ComponentExecutor class it will do something like this;
<say param="com.confuse.ComponentLinux")

Class x = Class.forName(param)
and then
ComponentInterface y = x.newInstance();
y.doSomething();

Now you can see my problem lies when I do Class.forName(param) as the
ComponentFramework.jar cannot see the ComponentLinux.jar. I can't simply put
a MANIFEST.MF file in the ComponentFramework to point to the ComponentLinux
as this is supposed to be the framework. We can later on deploy more
components in the framework as required (say ComponentWindows,
ComponentSolaris and so on) and hot deploying in the EJB Container. If I
make the manifest file in the ComponentFramework to point to the new
component I will have to deploy the framework everytime I deploy a new
component.

Has anyone ever come to this problem? Any suggestions?

Don't you wish that jBoss uses the same class loader for all jars :-), or is
there a way to tell jBoss to do this?

Thanks,

Victor



_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to