Dynamic class reloading

Dynamic class reloading

We integrate the web portal CISCO SESM (3.3.1) that
embed Jetty server (4.2.23) and we must implement a process
to reloading JSP classes at runtime.

We think about two solutions :

Solution 1 :

The JSP pages are modified and precompiled on the
fly using Jasper, on a backup server and they are putting (*.jsp and
*.class) on the production sever at run-time.

We have a question about this solution
:

How the Jetty server can take in
account the modified classes without re-compile the jsp pages on the production
site?

Is exist a configuration parameter to
enable reloading classes derived from jsp at run-time?

Solution 2:

The JSP pages are modified and compiled
with JSPC and JAVAC, on a backup server and they are putting (*.jsp
and *.class) on the production sever at run-time.

We derived the anonymous servlet Invoker to extend
it with dynamic class loading through new classloader instanciation each time is
it required.

We have a question about this solution
:

Is a such function already implemented into Jetty server ?

We have read jetty FAQ : "Can Jetty reload servlets?"

"Jetty no longer supports automatic reloading of Servlets." is it true for
Jetty 4.2.23 ?

Regards,

Jerome.

This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.

Re: Dynamic class reloading

To add dynamic class loading to Jetty, you need to replace the classloader
with a dynamic classloader.

Extending the invoker servlet is probably a good way to go - but make sure
you don't open security problems and allow arbitrary servlets to be executed.

regards

Jérôme DELVIGNE wrote:

> Hi,
>
> We integrate the web portal CISCO SESM (3.3.1) that embed Jetty server
> (4.2.23) and we must implement a process to reloading JSP classes at
> runtime.
>
> We think about two solutions :
>
> _Solution 1_ :
> The JSP pages are modified and precompiled on the fly using Jasper, on a
> backup server and they are putting (*.jsp and *.class) on the production
> sever at run-time.
>
> We have a question about this solution :
> How the Jetty server can take in account the modified classes without
> re-compile the jsp pages on the production site?
> Is exist a configuration parameter to enable reloading classes derived
> from jsp at run-time?
>
> _Solution 2:_
> The JSP pages are modified and compiled with JSPC and JAVAC, on a backup
> server and they are putting (*.jsp and *.class) on the production sever
> at run-time.
> We derived the anonymous servlet Invoker to extend it with dynamic class
> loading through new classloader instanciation each time is it required.
>
> We have a question about this solution :
> Is a such function already implemented into Jetty server ?
>
> We have read jetty FAQ : "Can Jetty reload servlets?"
> "Jetty no longer supports automatic reloading of Servlets." is it true
> for Jetty 4.2.23 ?
>
>
> Regards,
>
>
> Jerome.
> This message contains information that may be privileged or confidential
> and is the property of the Capgemini Group. It is intended only for the
> person to whom it is addressed. If you are not the intended recipient,
> you are not authorized to read, print, retain, copy, disseminate,
> distribute, or use this message or any part thereof. If you receive this
> message in error, please notify the sender immediately and delete all
> copies of this message.
>

RE: Dynamic class reloading

I've been thinking about this issue of dynamic reloading
and my conclusion is that you probably want to handle this with a new http
context. In effect - I'm assuming that a new context (effectivly
referencing a new classloader) could be asserted with a higher pririty that the
current context, and assuming that context instances is itself priority loaded
(which assumes custom comparable context handlers) then the incomming http
request will be delegated to a new (and distinct) classloader stack without
disrupting the state of existing context handlers.

We integrate the web portal CISCO SESM (3.3.1)
that embed Jetty server (4.2.23) and we must implement a process
to reloading JSP classes at runtime.

We think about two solutions :

Solution 1 :

The JSP pages are modified and precompiled on the
fly using Jasper, on a backup server and they are putting (*.jsp and
*.class) on the production sever at run-time.

We have a question about this solution
:

How the Jetty server can take in
account the modified classes without re-compile the jsp pages on the
production site?

Is exist a configuration parameter
to enable reloading classes derived from jsp at run-time?

Solution 2:

The JSP pages are modified and compiled
with JSPC and JAVAC, on a backup server and they are putting (*.jsp
and *.class) on the production sever at run-time.

We derived the anonymous servlet Invoker to
extend it with dynamic class loading through new classloader instanciation
each time is it required.

We have a question about this solution
:

Is a such function already implemented into Jetty server ?

We have read jetty FAQ : "Can Jetty reload servlets?"

"Jetty no longer supports automatic reloading of Servlets." is it true
for Jetty 4.2.23 ?

Regards,

Jerome.

This message contains
information that may be privileged or confidential and is the property
of the Capgemini Group. It is intended only for the person to whom it is
addressed. If you are not the intended recipient, you are not authorized
to read, print, retain, copy, disseminate, distribute, or use this
message or any part thereof. If you receive this message in error,
please notify the sender immediately and delete all copies of this
message.