tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 7082] - Calling an RMI Server from a servlet produces stack trace
Date Wed, 28 Aug 2002 12:29:33 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7082>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7082

Calling an RMI Server from a servlet produces stack trace

Dave@Staffplanner.co.uk changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From Dave@Staffplanner.co.uk  2002-08-28 12:29 -------
Bug in WebappClassLoader where external repositories is now fixed (4.1.10) and 
allows RMI with remote objects to work. This is actually better than 
setting 'java.rmi.server.codebase', because it will only affect the one 
webapp. The following code should be used to set up the remote repository:

// This stuff is for Tomcat 4.1.10 and above.
Method m = null;
try {
    ClassLoader cl = StaffPlannerServer.class.getClassLoader();
    Class clc = cl.getClass();
    if (clc.getName().equals("org.apache.catalina.loader.WebappClassLoader")) {
        Class[] classes = new Class[1];
        Object[] parms = new Object[1];
        classes[0] = String.class;
        parms[0] = codebase_url;

        m = clc.getMethod("addRepository", classes);
        m.invoke(cl, parms);
    }
}
catch (Exception e) {}

// And if we're running Tomcat 3.x or a different AppServer completely. Do it 
the old way.
if (m == null) {
    Properties p = System.getProperties();
    p.put("java.rmi.server.codebase", codebase_url);
    System.setProperties(p);
}

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message