You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by Kai Fei <bo...@gmail.com> on 2009/01/15 07:36:22 UTC

Geronimo Cannot Auto-reload class File

Hello,

My name is Kai, a new geronimo user. I met a small problem when develope a
web application on geronimo. It seems that geronimo won't reload the java
class file when it is replaced.
Here is what I did:
After I deploied a war file, I wanted to change a java class, so I replaced
the old one with a new one, but the application didn't make any changes.
Then I restart the war application, it works.
Is there any way to make geronimo reload the java class file automaticly?

I expect that there could be a config file which can enable this function,
but I didn't find...

Would anyone help?

Re: Geronimo Cannot Auto-reload class File

Posted by Kevan Miller <ke...@gmail.com>.
On Jan 15, 2009, at 3:52 AM, David Jencks wrote:

> I really doubt that pursuing this will turn out to be a good use of  
> our time -- I fear that it is likely to introduce hard-to-find and  
> fix problems -- but if anyone wants to look into it....

Agreed.

>
> -- a tomcat flag is unlikely to work in geronimo since we are not  
> using any tomcat class loaders.

Right. Geronimo is responsible for the deployment (or redeployment),  
not Tomcat...

>
> -- I would investigate what tomcat does from this flag and if  
> eclipse has a similar feature and find out how they work.

Using the Geronimo Eclipse Plugin, this should work (or can be  
configured to work). The development environment wasn't described. So,  
don't know if they're using eclipse or not. If needed, hot deploy  
could be used as a non-GEP solution...

>
> -- I think I recall a jvm feature that lets you replace class  
> definitions in some circumstances.  I've never used it and don't  
> know when it can be used.
>
> Basically I don't see how you can reliably replace one class - say a  
> servlet class - in a web app without restarting the whole web app.   
> There is going to be at least one instance of the servlet class  
> created, so you need to stop and recreate the servlet.  Assuming it  
> has load-on-startup == 0..... you have to start the whole web app.

Took a quick look at Tomcat and this seems to be what they do...

--kevan

Re: Geronimo Cannot Auto-reload class File

Posted by Jack Cai <gr...@gmail.com>.
Actually Tomcat does do a reload for the whole Web app when it detects a
class update. There's no big magic here. The "reloadable" attribute is only
recommended for use during app development, not for production. The feature
just saves a click of "restart".

-Jack

2009/1/15 David Jencks <da...@yahoo.com>

> I really doubt that pursuing this will turn out to be a good use of our
> time -- I fear that it is likely to introduce hard-to-find and fix problems
> -- but if anyone wants to look into it....
>
> -- a tomcat flag is unlikely to work in geronimo since we are not using any
> tomcat class loaders.
>
> -- I would investigate what tomcat does from this flag and if eclipse has a
> similar feature and find out how they work.
>
> -- I think I recall a jvm feature that lets you replace class definitions
> in some circumstances.  I've never used it and don't know when it can be
> used.
>
> Basically I don't see how you can reliably replace one class - say a
> servlet class - in a web app without restarting the whole web app.  There is
> going to be at least one instance of the servlet class created, so you need
> to stop and recreate the servlet.  Assuming it has load-on-startup == 0.....
> you have to start the whole web app.
>
> If people have different perspectives I'd like to hear them :-)
>
> From a user perspective what I do is to set up a maven build that builds my
> app, uses the car-maven-plugin to build it into a geronimo plugin, use the
> car-maven-plugin again to build a micro server including my app, and use
> selenium to run tests against it in the micro server.
>
> thanks
> david jencks
>
> On Jan 15, 2009, at 12:12 AM, Jack Cai wrote:
>
> I also agree that it's nice to have that. But I guess it's not as easy as
> just exposing the attribute. As David J. pointed out in another thread, we
> are dealing with two containers here. I did a small experiment by adding a
> context.xml in Tomcat's conf folder, and set "reloadable=true". Then Tomcat
> reports a NullPointerException each time it wants to do class reload. We
> need to look deeper into this.
>
> -Jack
>
> 2009/1/15 Ivan <xh...@gmail.com>
>
>> Currently, it seems that the reload attribute of the context is not
>> exported by the TomcatWebAppContext GBean, shall we add this attribute to
>> allow the user to set it in the config.xml ?Thanks !
>>
>> 2009/1/15 chi runhua <ch...@gmail.com>
>>
>> Try deploy --inPlace <yourAppHome>,    here is the doc for your
>>> information
>>>
>>> http://cwiki.apache.org/GMOxDOC22/deploy.html#deploy-Deploy
>>>
>>> Jeff C
>>>
>>>
>>> On Thu, Jan 15, 2009 at 2:36 PM, Kai Fei <bo...@gmail.com> wrote:
>>>
>>>> Hello,
>>>>
>>>> My name is Kai, a new geronimo user. I met a small problem when develope
>>>> a web application on geronimo. It seems that geronimo won't reload the java
>>>> class file when it is replaced.
>>>> Here is what I did:
>>>> After I deploied a war file, I wanted to change a java class, so I
>>>> replaced the old one with a new one, but the application didn't make any
>>>> changes. Then I restart the war application, it works.
>>>> Is there any way to make geronimo reload the java class file
>>>> automaticly?
>>>>
>>>> I expect that there could be a config file which can enable this
>>>> function, but I didn't find...
>>>>
>>>> Would anyone help?
>>>>
>>>
>>>
>>
>>
>> --
>> Ivan
>>
>
>
>

Re: Geronimo Cannot Auto-reload class File

Posted by David Jencks <da...@yahoo.com>.
I really doubt that pursuing this will turn out to be a good use of  
our time -- I fear that it is likely to introduce hard-to-find and fix  
problems -- but if anyone wants to look into it....

-- a tomcat flag is unlikely to work in geronimo since we are not  
using any tomcat class loaders.

-- I would investigate what tomcat does from this flag and if eclipse  
has a similar feature and find out how they work.

-- I think I recall a jvm feature that lets you replace class  
definitions in some circumstances.  I've never used it and don't know  
when it can be used.

Basically I don't see how you can reliably replace one class - say a  
servlet class - in a web app without restarting the whole web app.   
There is going to be at least one instance of the servlet class  
created, so you need to stop and recreate the servlet.  Assuming it  
has load-on-startup == 0..... you have to start the whole web app.

If people have different perspectives I'd like to hear them :-)

 From a user perspective what I do is to set up a maven build that  
builds my app, uses the car-maven-plugin to build it into a geronimo  
plugin, use the car-maven-plugin again to build a micro server  
including my app, and use selenium to run tests against it in the  
micro server.

thanks
david jencks

On Jan 15, 2009, at 12:12 AM, Jack Cai wrote:

> I also agree that it's nice to have that. But I guess it's not as  
> easy as just exposing the attribute. As David J. pointed out in  
> another thread, we are dealing with two containers here. I did a  
> small experiment by adding a context.xml in Tomcat's conf folder,  
> and set "reloadable=true". Then Tomcat reports a  
> NullPointerException each time it wants to do class reload. We need  
> to look deeper into this.
>
> -Jack
>
> 2009/1/15 Ivan <xh...@gmail.com>
> Currently, it seems that the reload attribute of the context is not  
> exported by the TomcatWebAppContext GBean, shall we add this  
> attribute to allow the user to set it in the config.xml ?
> Thanks !
>
> 2009/1/15 chi runhua <ch...@gmail.com>
>
> Try deploy --inPlace <yourAppHome>,    here is the doc for your  
> information
>
> http://cwiki.apache.org/GMOxDOC22/deploy.html#deploy-Deploy
>
> Jeff C
>
>
> On Thu, Jan 15, 2009 at 2:36 PM, Kai Fei <bo...@gmail.com> wrote:
> Hello,
>
> My name is Kai, a new geronimo user. I met a small problem when  
> develope a web application on geronimo. It seems that geronimo won't  
> reload the java class file when it is replaced.
> Here is what I did:
> After I deploied a war file, I wanted to change a java class, so I  
> replaced the old one with a new one, but the application didn't make  
> any changes. Then I restart the war application, it works.
> Is there any way to make geronimo reload the java class file  
> automaticly?
>
> I expect that there could be a config file which can enable this  
> function, but I didn't find...
>
> Would anyone help?
>
>
>
>
> -- 
> Ivan
>


Re: Geronimo Cannot Auto-reload class File

Posted by Jack Cai <gr...@gmail.com>.
I also agree that it's nice to have that. But I guess it's not as easy as
just exposing the attribute. As David J. pointed out in another thread, we
are dealing with two containers here. I did a small experiment by adding a
context.xml in Tomcat's conf folder, and set "reloadable=true". Then Tomcat
reports a NullPointerException each time it wants to do class reload. We
need to look deeper into this.

-Jack

2009/1/15 Ivan <xh...@gmail.com>

> Currently, it seems that the reload attribute of the context is not
> exported by the TomcatWebAppContext GBean, shall we add this attribute to
> allow the user to set it in the config.xml ?Thanks !
>
> 2009/1/15 chi runhua <ch...@gmail.com>
>
> Try deploy --inPlace <yourAppHome>,    here is the doc for your information
>>
>> http://cwiki.apache.org/GMOxDOC22/deploy.html#deploy-Deploy
>>
>> Jeff C
>>
>>
>> On Thu, Jan 15, 2009 at 2:36 PM, Kai Fei <bo...@gmail.com> wrote:
>>
>>> Hello,
>>>
>>> My name is Kai, a new geronimo user. I met a small problem when develope
>>> a web application on geronimo. It seems that geronimo won't reload the java
>>> class file when it is replaced.
>>> Here is what I did:
>>> After I deploied a war file, I wanted to change a java class, so I
>>> replaced the old one with a new one, but the application didn't make any
>>> changes. Then I restart the war application, it works.
>>> Is there any way to make geronimo reload the java class file automaticly?
>>>
>>>
>>> I expect that there could be a config file which can enable this
>>> function, but I didn't find...
>>>
>>> Would anyone help?
>>>
>>
>>
>
>
> --
> Ivan
>

Re: Geronimo Cannot Auto-reload class File

Posted by Rex Wang <rw...@gmail.com>.
agree!

Rex

2009/1/15 Ivan <xh...@gmail.com>

> Currently, it seems that the reload attribute of the context is not
> exported by the TomcatWebAppContext GBean, shall we add this attribute to
> allow the user to set it in the config.xml ?Thanks !
>
> 2009/1/15 chi runhua <ch...@gmail.com>
>
> Try deploy --inPlace <yourAppHome>,    here is the doc for your information
>>
>> http://cwiki.apache.org/GMOxDOC22/deploy.html#deploy-Deploy
>>
>> Jeff C
>>
>>
>> On Thu, Jan 15, 2009 at 2:36 PM, Kai Fei <bo...@gmail.com> wrote:
>>
>>> Hello,
>>>
>>> My name is Kai, a new geronimo user. I met a small problem when develope
>>> a web application on geronimo. It seems that geronimo won't reload the java
>>> class file when it is replaced.
>>> Here is what I did:
>>> After I deploied a war file, I wanted to change a java class, so I
>>> replaced the old one with a new one, but the application didn't make any
>>> changes. Then I restart the war application, it works.
>>> Is there any way to make geronimo reload the java class file automaticly?
>>>
>>>
>>> I expect that there could be a config file which can enable this
>>> function, but I didn't find...
>>>
>>> Would anyone help?
>>>
>>
>>
>
>
> --
> Ivan
>

Re: Geronimo Cannot Auto-reload class File

Posted by Ivan <xh...@gmail.com>.
Currently, it seems that the reload attribute of the context is not exported
by the TomcatWebAppContext GBean, shall we add this attribute to allow the
user to set it in the config.xml ?Thanks !

2009/1/15 chi runhua <ch...@gmail.com>

> Try deploy --inPlace <yourAppHome>,    here is the doc for your information
>
> http://cwiki.apache.org/GMOxDOC22/deploy.html#deploy-Deploy
>
> Jeff C
>
>
> On Thu, Jan 15, 2009 at 2:36 PM, Kai Fei <bo...@gmail.com> wrote:
>
>> Hello,
>>
>> My name is Kai, a new geronimo user. I met a small problem when develope a
>> web application on geronimo. It seems that geronimo won't reload the java
>> class file when it is replaced.
>> Here is what I did:
>> After I deploied a war file, I wanted to change a java class, so I
>> replaced the old one with a new one, but the application didn't make any
>> changes. Then I restart the war application, it works.
>> Is there any way to make geronimo reload the java class file automaticly?
>>
>> I expect that there could be a config file which can enable this function,
>> but I didn't find...
>>
>> Would anyone help?
>>
>
>


-- 
Ivan

Re: Geronimo Cannot Auto-reload class File

Posted by chi runhua <ch...@gmail.com>.
Try deploy --inPlace <yourAppHome>,    here is the doc for your information

http://cwiki.apache.org/GMOxDOC22/deploy.html#deploy-Deploy

Jeff C

On Thu, Jan 15, 2009 at 2:36 PM, Kai Fei <bo...@gmail.com> wrote:

> Hello,
>
> My name is Kai, a new geronimo user. I met a small problem when develope a
> web application on geronimo. It seems that geronimo won't reload the java
> class file when it is replaced.
> Here is what I did:
> After I deploied a war file, I wanted to change a java class, so I replaced
> the old one with a new one, but the application didn't make any changes.
> Then I restart the war application, it works.
> Is there any way to make geronimo reload the java class file automaticly?
>
> I expect that there could be a config file which can enable this function,
> but I didn't find...
>
> Would anyone help?
>