head	1.10;
access;
symbols;
locks
	nobody:1.10; strict;
comment	@# @;


1.10
date	99.05.17.18.06.06;	author nobody;	state Exp;
branches;
next	1.9;

1.9
date	99.05.15.15.18.33;	author nobody;	state Exp;
branches;
next	1.8;

1.8
date	99.05.15.15.17.11;	author nobody;	state Exp;
branches;
next	1.7;

1.7
date	99.05.15.15.16.30;	author nobody;	state Exp;
branches;
next	1.6;

1.6
date	99.05.15.15.15.09;	author nobody;	state Exp;
branches;
next	1.5;

1.5
date	99.05.15.15.13.55;	author nobody;	state Exp;
branches;
next	1.4;

1.4
date	99.05.15.15.09.31;	author nobody;	state Exp;
branches;
next	1.3;

1.3
date	99.05.15.14.55.31;	author nobody;	state Exp;
branches;
next	1.2;

1.2
date	99.05.15.14.54.52;	author nobody;	state Exp;
branches;
next	1.1;

1.1
date	99.05.15.14.54.49;	author nobody;	state Exp;
branches;
next	;


desc
@null
@


1.10
log
@null
@
text
@IDependOn-Set: 1
IDependOn-Set: 119
IDependOn-Set: 161
IDependOn-Set: 163
IDependOn-Set: 165
IDependOn-Set: 2
LastModifiedSecs: 926781512
Parent: 119
SequenceNumber: 7
Title: Dynamically loading classes from servlets
Part: 0
Author-Set: pier@@apache.org
LastModifiedSecs: 926781512
Type: html
Lines: 27
Many users complained about the fact that after placing a certaing set of files in a repository, these files were not accessed via <code>Class.forName()</code> or equivalent methods. Others also noticed that, moving the same entry from the "<code><i>repository=</i></code>" property in file <i>zone.properties</i> to the "<code><i>wrapper.classpath=</i></code>" in <i>jserv.properties</i> file, resulted in successfully restoring this capability.<br>
<br>
In other words:<br>
<pre>
   <i><font color="#ff0000">[jserv.properties]</font></i>
   wrapper.classpath=/usr/java/lib/jsdk20.jar

   <i><font color="#ff0000">[zone.properties]</font></i>
   repository=/usr/java/servlets,<font color="#0000ff">/usr/java/lib/foo.jar</font>
</pre>
<code>Class.forName("org.foo.Bar")</code> doesn't work (where class "<code>org.foo.Bar</code>" is contained in "<i>/usr/java/lib/foo.jar</i>")
while <br>
<pre>
   <i><font color="#ff0000">[jserv.properties]</font></i>
   wrapper.classpath=/usr/java/lib/jsdk20.jar:<font    color="#0000ff">/usr/java/lib/foo.jar</font>

   <i><font color="#ff0000">[zone.properties]</font></i>
   repository=/usr/java/servlets
</pre>
<code>Class.forName("org.foo.Bar")</code> works.<br>
<br>
This happens because repositories are NOT merged with the JVM class path, and, so, unaccessible from the system ClassLoader.<br>
<br>
But why that? Because, to be able to give to JServ the ability of autoreloading servlet classes when these were changed, we had to create a different ClassLoader, and to use a different ClassLoader for each servlet zone.<br>
<br>
This also gives other benefits, expecially about security, in fact a certain zone cannot access classes and servlets specified in a different zone, and so a servlet in zone "<code>Foo</code>" cannot access to the servlet "<code>MyServlet</code>" specified in zone "<code>Bar</code>" when these two zones have different "<code>repository=<code>" entries in the two <i>zone.properties</i> files.<Br>
<br>
EndPart: 0
@


1.9
log
@null
@
text
@d5 1
@


1.8
log
@null
@
text
@d6 1
a6 1
LastModifiedSecs: 926781430
d8 1
a8 1
SequenceNumber: 6
d12 1
a12 1
LastModifiedSecs: 926781430
d14 1
a14 1
Lines: 26
d40 2
a41 1
This also gives other benefits, expecially about security, in fact a certain zone cannot access classes and servlets specified in a different zone, and so a servlet in zone "<code>Foo</code>" cannot access to the servlet "<code>MyServlet</code>" specified in zone "<code>Bar</code>" when these two zones have different "<code>repository=<code>" entries in the two <i>zone.properties</i> files.
@


1.7
log
@null
@
text
@d6 1
a6 1
LastModifiedSecs: 926781390
d8 1
a8 1
SequenceNumber: 5
d12 1
a12 1
LastModifiedSecs: 926781390
d19 1
a19 1
   <i><font color="#ff0000">[jserv.properties]</i>
d22 1
a22 1
   <i><font color="#ff0000">[zone.properties]</i>
@


1.6
log
@null
@
text
@d6 1
a6 1
LastModifiedSecs: 926781309
d8 1
a8 1
SequenceNumber: 4
d12 1
a12 1
LastModifiedSecs: 926781309
d14 1
a14 1
Lines: 24
d19 1
a19 1
   <i>[jserv.properties]</i>
d21 2
a22 1
   <i>[zone.properties]</i>
d28 5
a32 4
<i>[jserv.properties]</i>
wrapper.classpath=/usr/java/lib/jsdk20.jar:<font color="#0000ff">/usr/java/lib/foo.jar</font>
<i>[zone.properties]</i>
repository=/usr/java/servlets
@


1.5
log
@null
@
text
@d6 1
a6 1
LastModifiedSecs: 926781235
d8 1
a8 1
SequenceNumber: 3
d12 1
a12 1
LastModifiedSecs: 926781235
d19 4
a22 4
<i>[jserv.properties]</i>
wrapper.classpath=/usr/java/lib/jsdk20.jar
<i>[zone.properties]</i>
repository=/usr/java/servlets,/usr/java/lib/foo.jar
d28 1
a28 1
wrapper.classpath=/usr/java/lib/jsdk20.jar:/usr/java/lib/foo.jar
@


1.4
log
@null
@
text
@d6 1
a6 1
LastModifiedSecs: 926780971
d8 1
a8 1
SequenceNumber: 2
d12 8
a19 5
LastModifiedSecs: 926780971
Lines: 19
Many users complained about the fact that after placing a certaing set of files in a repository, these files were not accessed via Class.forName() or equivalent methods. Others also noticed that, moving the same entry from the "repository=" property in file zone.properties to the "wrapper.classpath=" in jserv.properties file, resulted in successfully restoring this capability. In other words:

[jserv.properties]
d21 1
a21 1
[zone.properties]
d23 5
a27 5

Class.forName("org.foo.Bar") doesn't work (where "org.foo.Bar" is contained in "/usr/java/lib/foo.jar")
while

[jserv.properties]
d29 1
a29 1
[zone.properties]
d31 8
a38 5

Class.forName("org.foo.Bar") works.

This happens because repositories are NOT merged with the JVM class path, and, so, unaccessible from the system ClassLoader. But why that? Because, to be able to give to JServ the ability of autoreloading servlet classes when these were changed, we had to create a different ClassLoader, and to use a different ClassLoader for each servlet zone.
This also gives other benefits, expecially about security, in fact a certain zone cannot access classes and servlets specified in a different zone, and so a servlet in zone "Foo" cannot access to the servlet "MyServlet" specified in zone "Bar" when these two zones have different "repository=" entries in the two "zone.properties" files.
@


1.3
log
@null
@
text
@d6 1
a6 1
LastModifiedSecs: 926780131
d8 1
a8 1
SequenceNumber: 1
d10 24
@


1.2
log
@null
@
text
@d6 1
a6 1
LastModifiedSecs: 926780089
d8 2
a9 2
SequenceNumber: 0
Title: New Item
@


1.1
log
@null
@
text
@d3 1
@
