[jboss-user] [Installation, Configuration & DEPLOYMENT] - Re: Setting codebase in jboss ejb3 application has no efffe
do-not-reply at jboss.com
Mon Oct 6 03:44:36 EDT 2008
Thanks Peter ...
I took a deeper look in the Jboss code (including changing some code, recompiling, debugging) and I found the answer to my question.
Basically that's it, jboss only reads once the java.rmi.server.codebase system property.
So my question is: is this a bug? is this the desired behavior?
Here some info about my researches:
-the codebase is set by the org.jboss.web.WebService.createService() method, if the codebase is null on the creation of the service.
- The class JBossRMIClassLoader is responsible for class annotation when marshaling objects. The method "public String getClassAnnotation(Class cl)" should add the annotation (i.e. the codebase), but it delegates this job (adding annotations) to an RMIClassLoaderSpi object that is created when the JBossRMIClassLoader class is loaded. For some resson, the RMIClassLoaderSpi object only reads the codebase once, and not each time it annotates a class. I have changed the code of org.jboss.system.JBossRMIClassLoader.getClassAnnotation(Class cl) method in order to make it print the annnotations. And indeed, the codebase annotations stays the same affter the system property java.rmi.server.codebase has changed.
So yes, we can say, generally, that "Jboss only reads the "java.rmi.server.codebase" property once, at startup.
One can add the java property -Djava.rmi.server.codebase="codebaseJboss someOtherCodebase" to JBoss startup in order to add different codebases.
This solution works for my problem but I'm not happy with it because my application dinamically decides the codebases addresses it uses. So I have to force it to use some specified ports.
So shoud I create a JIRA issue for this? (should that be a bug? or request for new feature? or improovement?)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4180487#4180487
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4180487
More information about the jboss-user