Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Re-publishing base classes in Tomcat
Re-publishing base classes in Tomcat [message #173739] Mon, 10 July 2006 09:42 Go to next message
Thomas Einwaller is currently offline Thomas EinwallerFriend
Messages: 8
Registered: July 2009
Junior Member
Hi,

before I switched to WTP I was working with the Sysdeo Tomcat Plugin. I
was able to transform my projects into WTP style and my application runs
within tomcat.

There is something that makes working really hard. I have got a base
project that holds my model classes and business functions. This base
project is included as J2EE module in the dynamic web project. Every
time I change something in the base project while running the
application the change can not be republished to the server.

Does anybody have a solution to this problem? I is really annoying
having to restart every time.

cheers

tOM
Re: Re-publishing base classes in Tomcat [message #173748 is a reply to message #173739] Mon, 10 July 2006 12:45 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: gene.rockhoppertech.com

For clarification:
I don't know what a "base project" is. This is a java project with pojos
that you want included in a dynamic web project right?

I'm doing that and it works ok. All I did was go to the web project's
properties and choose the java project as a "J2EE module dependency".
They call that a "utility" project for some weird reason.
Is that what you did?


Thomas Einwaller wrote:
> Hi,
>
> before I switched to WTP I was working with the Sysdeo Tomcat Plugin. I
> was able to transform my projects into WTP style and my application runs
> within tomcat.
>
> There is something that makes working really hard. I have got a base
> project that holds my model classes and business functions. This base
> project is included as J2EE module in the dynamic web project. Every
> time I change something in the base project while running the
> application the change can not be republished to the server.
>
> Does anybody have a solution to this problem? I is really annoying
> having to restart every time.
>
> cheers
>
> tOM
Re: Re-publishing base classes in Tomcat [message #173755 is a reply to message #173748] Mon, 10 July 2006 14:04 Go to previous messageGo to next message
Thomas Einwaller is currently offline Thomas EinwallerFriend
Messages: 8
Registered: July 2009
Junior Member
That is exactly what I did. The problem is that every time I change
something in the code of this "utility" project the server tries to
"republish" it and tells me that it can not publish the "jar" because it
is locked.

Maybe this is a problem only on windows machines. Which operating system
do you use?

cheers

tOM

Gene De Lisa wrote:
> For clarification:
> I don't know what a "base project" is. This is a java project with pojos
> that you want included in a dynamic web project right?
>
> I'm doing that and it works ok. All I did was go to the web project's
> properties and choose the java project as a "J2EE module dependency".
> They call that a "utility" project for some weird reason.
> Is that what you did?
>
>
> Thomas Einwaller wrote:
>> Hi,
>>
>> before I switched to WTP I was working with the Sysdeo Tomcat Plugin.
>> I was able to transform my projects into WTP style and my application
>> runs within tomcat.
>>
>> There is something that makes working really hard. I have got a base
>> project that holds my model classes and business functions. This base
>> project is included as J2EE module in the dynamic web project. Every
>> time I change something in the base project while running the
>> application the change can not be republished to the server.
>>
>> Does anybody have a solution to this problem? I is really annoying
>> having to restart every time.
>>
>> cheers
>>
>> tOM
Re: Re-publishing base classes in Tomcat [message #173849 is a reply to message #173755] Mon, 10 July 2006 20:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: gene.rockhoppertech.com

Oh my that's irritating. Same config; different results. I don't see any
mention of a "jar" in my console. I'm using the new callisto release.
You too?
I just tested this on XP.

I've gotten into the habit of inspecting
..metadata\.plugins\org.eclipse.wst.server.core
occasionally. Poke around and maybe something will tell you the problem.



Thomas Einwaller wrote:
> That is exactly what I did. The problem is that every time I change
> something in the code of this "utility" project the server tries to
> "republish" it and tells me that it can not publish the "jar" because it
> is locked.
>
> Maybe this is a problem only on windows machines. Which operating system
> do you use?
>
> cheers
>
> tOM
>
> Gene De Lisa wrote:
>> For clarification:
>> I don't know what a "base project" is. This is a java project with
>> pojos that you want included in a dynamic web project right?
>>
>> I'm doing that and it works ok. All I did was go to the web project's
>> properties and choose the java project as a "J2EE module dependency".
>> They call that a "utility" project for some weird reason.
>> Is that what you did?
>>
>>
>> Thomas Einwaller wrote:
>>> Hi,
>>>
>>> before I switched to WTP I was working with the Sysdeo Tomcat Plugin.
>>> I was able to transform my projects into WTP style and my application
>>> runs within tomcat.
>>>
>>> There is something that makes working really hard. I have got a base
>>> project that holds my model classes and business functions. This base
>>> project is included as J2EE module in the dynamic web project. Every
>>> time I change something in the base project while running the
>>> application the change can not be republished to the server.
>>>
>>> Does anybody have a solution to this problem? I is really annoying
>>> having to restart every time.
>>>
>>> cheers
>>>
>>> tOM
Re: Re-publishing base classes in Tomcat [message #173925 is a reply to message #173755] Tue, 11 July 2006 17:10 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1310
Registered: July 2009
Senior Member
It is a known issue on Windows. My understanding is that if the JAR has
been accessed, an open handle is kept, I assume for performance reasons,
until the JAR is closed and the JAR file object garbage collected. On
Windows, this open handle is sufficient to lock the JAR file. Since the
publish operation in Web Tools tries to delete the file before creating
a new one, the publish operation fails.

The only work around I can think of at the moment is to use Eclipse 3.2
+ WTP 1.5 and temporarily link the "utility" Java file to be worked on
into the Java source folder of your Dynamic Web Project. Eclipse 3.2
supports linking beyond just the project's root folder. The servlet
spec dictates that if there are duplicate classes between
WEB-INF/classes and WEB-INF/lib, WEB-INF/classes wins. You will still
get the "locked JAR" error, but the web application will still reload
and see your changes because of the updated class in WEB-INF/classes.
Remove the link when you are "done" with the modifications.

To be investigated is whether publishing can be updated to rewrite the
JAR if it can't be deleted.

Cheers,
Larry


Thomas Einwaller wrote:
> That is exactly what I did. The problem is that every time I change
> something in the code of this "utility" project the server tries to
> "republish" it and tells me that it can not publish the "jar" because it
> is locked.
>
> Maybe this is a problem only on windows machines. Which operating system
> do you use?
>
> cheers
>
> tOM
>
> Gene De Lisa wrote:
>> For clarification:
>> I don't know what a "base project" is. This is a java project with
>> pojos that you want included in a dynamic web project right?
>>
>> I'm doing that and it works ok. All I did was go to the web project's
>> properties and choose the java project as a "J2EE module dependency".
>> They call that a "utility" project for some weird reason.
>> Is that what you did?
>>
>>
>> Thomas Einwaller wrote:
>>> Hi,
>>>
>>> before I switched to WTP I was working with the Sysdeo Tomcat Plugin.
>>> I was able to transform my projects into WTP style and my application
>>> runs within tomcat.
>>>
>>> There is something that makes working really hard. I have got a base
>>> project that holds my model classes and business functions. This base
>>> project is included as J2EE module in the dynamic web project. Every
>>> time I change something in the base project while running the
>>> application the change can not be republished to the server.
>>>
>>> Does anybody have a solution to this problem? I is really annoying
>>> having to restart every time.
>>>
>>> cheers
>>>
>>> tOM
Re: Re-publishing base classes in Tomcat [message #174064 is a reply to message #173925] Wed, 12 July 2006 09:54 Go to previous message
Eclipse UserFriend
Originally posted by: tei.silbergrau.com

I found out that though the message is displayed the webapp is updated and
changes effect my application immediately (without restarting).

The only thing is that the can-not-publish-because-jar-is-locked-dialog
really "nerves"

cheers

tOM

Larry Isaacs wrote:

> It is a known issue on Windows. My understanding is that if the JAR has
> been accessed, an open handle is kept, I assume for performance reasons,
> until the JAR is closed and the JAR file object garbage collected. On
> Windows, this open handle is sufficient to lock the JAR file. Since the
> publish operation in Web Tools tries to delete the file before creating
> a new one, the publish operation fails.

> The only work around I can think of at the moment is to use Eclipse 3.2
> + WTP 1.5 and temporarily link the "utility" Java file to be worked on
> into the Java source folder of your Dynamic Web Project. Eclipse 3.2
> supports linking beyond just the project's root folder. The servlet
> spec dictates that if there are duplicate classes between
> WEB-INF/classes and WEB-INF/lib, WEB-INF/classes wins. You will still
> get the "locked JAR" error, but the web application will still reload
> and see your changes because of the updated class in WEB-INF/classes.
> Remove the link when you are "done" with the modifications.

> To be investigated is whether publishing can be updated to rewrite the
> JAR if it can't be deleted.

> Cheers,
> Larry


> Thomas Einwaller wrote:
>> That is exactly what I did. The problem is that every time I change
>> something in the code of this "utility" project the server tries to
>> "republish" it and tells me that it can not publish the "jar" because it
>> is locked.
>>
>> Maybe this is a problem only on windows machines. Which operating system
>> do you use?
>>
>> cheers
>>
>> tOM
>>
>> Gene De Lisa wrote:
>>> For clarification:
>>> I don't know what a "base project" is. This is a java project with
>>> pojos that you want included in a dynamic web project right?
>>>
>>> I'm doing that and it works ok. All I did was go to the web project's
>>> properties and choose the java project as a "J2EE module dependency".
>>> They call that a "utility" project for some weird reason.
>>> Is that what you did?
>>>
>>>
>>> Thomas Einwaller wrote:
>>>> Hi,
>>>>
>>>> before I switched to WTP I was working with the Sysdeo Tomcat Plugin.
>>>> I was able to transform my projects into WTP style and my application
>>>> runs within tomcat.
>>>>
>>>> There is something that makes working really hard. I have got a base
>>>> project that holds my model classes and business functions. This base
>>>> project is included as J2EE module in the dynamic web project. Every
>>>> time I change something in the base project while running the
>>>> application the change can not be republished to the server.
>>>>
>>>> Does anybody have a solution to this problem? I is really annoying
>>>> having to restart every time.
>>>>
>>>> cheers
>>>>
>>>> tOM
Previous Topic:web tools : html editor
Next Topic:Files with .# in my war, why?
Goto Forum:
  


Current Time: Sun Nov 23 17:27:37 GMT 2014

Powered by FUDForum. Page generated in 0.02205 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software