Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Synchronization with temporary deploy directory
Synchronization with temporary deploy directory [message #222594] Tue, 07 October 2008 19:06 Go to next message
Dominik Raymann is currently offline Dominik RaymannFriend
Messages: 37
Registered: July 2009
Member
Hi there,

I would like to use WTP for my web projects. At the moment I'm working
with the sysdeo plugin, the eclipse project is directly the
application's root.

My application generates and modifies files in the web application. The
files and modifications are part of the application afterwards. This was
no problem up to now, since the application was never really deployed
with the sysdeo plugin. However, WTP does a real deploy and copies the
files to a temporary directory. If the application modifies or creates
files, only the temporary directory is affected and the changes are lost
(i.e. not synchronized back to the project directory).

Is there a way to achieve such a synchronization of the two directories?
Or can the project directory directly be used as the webroot while
developing (i.e. the files are never deployed elsewhere)?

Thanks for your help,

Dominik
Re: Synchronization with temporary deploy directory [message #222601 is a reply to message #222594] Wed, 08 October 2008 12:10 Go to previous messageGo to next message
Dominik Raymann is currently offline Dominik RaymannFriend
Messages: 37
Registered: July 2009
Member
Ok,

I found out that I can check the option "Serve modules with out
publishing". I think that this will avoid the need of copying back
published and modified files.

Dominik Raymann schrieb:
> Hi there,
>
> I would like to use WTP for my web projects. At the moment I'm working
> with the sysdeo plugin, the eclipse project is directly the
> application's root.
>
> My application generates and modifies files in the web application. The
> files and modifications are part of the application afterwards. This was
> no problem up to now, since the application was never really deployed
> with the sysdeo plugin. However, WTP does a real deploy and copies the
> files to a temporary directory. If the application modifies or creates
> files, only the temporary directory is affected and the changes are lost
> (i.e. not synchronized back to the project directory).
>
> Is there a way to achieve such a synchronization of the two directories?
> Or can the project directory directly be used as the webroot while
> developing (i.e. the files are never deployed elsewhere)?
>
> Thanks for your help,
>
> Dominik
Re: Synchronization with temporary deploy directory [message #222603 is a reply to message #222601] Wed, 08 October 2008 14:56 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
Yes, this non-standard feature should achieve what you want. The
docBase of the context will point to the "webcontent" folder of the
project. In addition, a custom classloader is used by the webapp to get
a list of resources so that the jars and classes in your project are
used directly. This also applies to Java utility projects that your web
application project depends on.

Cheers,
Larry

Dominik Raymann wrote:
> Ok,
>
> I found out that I can check the option "Serve modules with out
> publishing". I think that this will avoid the need of copying back
> published and modified files.
>
> Dominik Raymann schrieb:
>> Hi there,
>>
>> I would like to use WTP for my web projects. At the moment I'm working
>> with the sysdeo plugin, the eclipse project is directly the
>> application's root.
>>
>> My application generates and modifies files in the web application. The
>> files and modifications are part of the application afterwards. This was
>> no problem up to now, since the application was never really deployed
>> with the sysdeo plugin. However, WTP does a real deploy and copies the
>> files to a temporary directory. If the application modifies or creates
>> files, only the temporary directory is affected and the changes are lost
>> (i.e. not synchronized back to the project directory).
>>
>> Is there a way to achieve such a synchronization of the two directories?
>> Or can the project directory directly be used as the webroot while
>> developing (i.e. the files are never deployed elsewhere)?
>>
>> Thanks for your help,
>>
>> Dominik
Re: Synchronization with temporary deploy directory [message #222613 is a reply to message #222603] Thu, 09 October 2008 08:46 Go to previous messageGo to next message
Dominik Raymann is currently offline Dominik RaymannFriend
Messages: 37
Registered: July 2009
Member
What do you mean by "non-standard" feature? Is it discouraged to use
this feature?

Cheers, Dominik

Larry Isaacs schrieb:
> Yes, this non-standard feature should achieve what you want. The
> docBase of the context will point to the "webcontent" folder of the
> project. In addition, a custom classloader is used by the webapp to get
> a list of resources so that the jars and classes in your project are
> used directly. This also applies to Java utility projects that your web
> application project depends on.
>
> Cheers,
> Larry
>
> Dominik Raymann wrote:
>> Ok,
>>
>> I found out that I can check the option "Serve modules with out
>> publishing". I think that this will avoid the need of copying back
>> published and modified files.
>>
>> Dominik Raymann schrieb:
>>> Hi there,
>>>
>>> I would like to use WTP for my web projects. At the moment I'm working
>>> with the sysdeo plugin, the eclipse project is directly the
>>> application's root.
>>>
>>> My application generates and modifies files in the web application. The
>>> files and modifications are part of the application afterwards. This was
>>> no problem up to now, since the application was never really deployed
>>> with the sysdeo plugin. However, WTP does a real deploy and copies the
>>> files to a temporary directory. If the application modifies or creates
>>> files, only the temporary directory is affected and the changes are lost
>>> (i.e. not synchronized back to the project directory).
>>>
>>> Is there a way to achieve such a synchronization of the two directories?
>>> Or can the project directory directly be used as the webroot while
>>> developing (i.e. the files are never deployed elsewhere)?
>>>
>>> Thanks for your help,
>>>
>>> Dominik
Re: Synchronization with temporary deploy directory [message #222617 is a reply to message #222613] Thu, 09 October 2008 13:03 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
Not discouraged, but you may not find this feature available for other
servers. Within an Eclipse workspace with dynamic web projects, you
typically won't find a folder that can serve root folder of a webapp
with a WAR file directory structure. Thus a WAR or folder with a WAR
file structure has to be created so the webapp can be deployed or
served, as you noted in your first e-mail.

Because the Tomcat server adapter imports the server's configuration
into Eclipse, it is able to play some special games with that
configuration to make the "Serve modules without publishing" work. Note
that enabling this feature non-intrusively modifies the Tomcat server by
adding an extra jar to the server. You can also take a peek at the
<Context> that gets added to the server.xml when this feature is enabled
to see the special configuration of that <Context> gets to make this work.

Cheers,
Larry

Dominik Raymann wrote:
> What do you mean by "non-standard" feature? Is it discouraged to use
> this feature?
>
> Cheers, Dominik
>
> Larry Isaacs schrieb:
>> Yes, this non-standard feature should achieve what you want. The
>> docBase of the context will point to the "webcontent" folder of the
>> project. In addition, a custom classloader is used by the webapp to
>> get a list of resources so that the jars and classes in your project
>> are used directly. This also applies to Java utility projects that
>> your web application project depends on.
>>
>> Cheers,
>> Larry
>>
>> Dominik Raymann wrote:
>>> Ok,
>>>
>>> I found out that I can check the option "Serve modules with out
>>> publishing". I think that this will avoid the need of copying back
>>> published and modified files.
>>>
>>> Dominik Raymann schrieb:
>>>> Hi there,
>>>>
>>>> I would like to use WTP for my web projects. At the moment I'm working
>>>> with the sysdeo plugin, the eclipse project is directly the
>>>> application's root.
>>>>
>>>> My application generates and modifies files in the web application. The
>>>> files and modifications are part of the application afterwards. This
>>>> was
>>>> no problem up to now, since the application was never really deployed
>>>> with the sysdeo plugin. However, WTP does a real deploy and copies the
>>>> files to a temporary directory. If the application modifies or creates
>>>> files, only the temporary directory is affected and the changes are
>>>> lost
>>>> (i.e. not synchronized back to the project directory).
>>>>
>>>> Is there a way to achieve such a synchronization of the two
>>>> directories?
>>>> Or can the project directory directly be used as the webroot while
>>>> developing (i.e. the files are never deployed elsewhere)?
>>>>
>>>> Thanks for your help,
>>>>
>>>> Dominik
Re: Synchronization with temporary deploy directory [message #222620 is a reply to message #222617] Thu, 09 October 2008 18:04 Go to previous messageGo to next message
Dominik Raymann is currently offline Dominik RaymannFriend
Messages: 37
Registered: July 2009
Member
Thanks Larry for all your comprehensive answers in this and the other
thread.

Considering all the special tricks that have to be done to run the
application in situ (and the impossiblity to do it with other
application servers than Tomcat), what are the advantages of the dynamic
web project structure proposed by WTP? Wouldn't it be easier to use the
standard WAR file structure (i.e. exploded WAR) in the first place?

Cheers,

Dominik

Larry Isaacs schrieb:
> Not discouraged, but you may not find this feature available for other
> servers. Within an Eclipse workspace with dynamic web projects, you
> typically won't find a folder that can serve root folder of a webapp
> with a WAR file directory structure. Thus a WAR or folder with a WAR
> file structure has to be created so the webapp can be deployed or
> served, as you noted in your first e-mail.
>
> Because the Tomcat server adapter imports the server's configuration
> into Eclipse, it is able to play some special games with that
> configuration to make the "Serve modules without publishing" work. Note
> that enabling this feature non-intrusively modifies the Tomcat server by
> adding an extra jar to the server. You can also take a peek at the
> <Context> that gets added to the server.xml when this feature is enabled
> to see the special configuration of that <Context> gets to make this work.
>
> Cheers,
> Larry
>
> Dominik Raymann wrote:
>> What do you mean by "non-standard" feature? Is it discouraged to use
>> this feature?
>>
>> Cheers, Dominik
>>
>> Larry Isaacs schrieb:
>>> Yes, this non-standard feature should achieve what you want. The
>>> docBase of the context will point to the "webcontent" folder of the
>>> project. In addition, a custom classloader is used by the webapp to
>>> get a list of resources so that the jars and classes in your project
>>> are used directly. This also applies to Java utility projects that
>>> your web application project depends on.
>>>
>>> Cheers,
>>> Larry
>>>
>>> Dominik Raymann wrote:
>>>> Ok,
>>>>
>>>> I found out that I can check the option "Serve modules with out
>>>> publishing". I think that this will avoid the need of copying back
>>>> published and modified files.
>>>>
>>>> Dominik Raymann schrieb:
>>>>> Hi there,
>>>>>
>>>>> I would like to use WTP for my web projects. At the moment I'm working
>>>>> with the sysdeo plugin, the eclipse project is directly the
>>>>> application's root.
>>>>>
>>>>> My application generates and modifies files in the web application.
>>>>> The
>>>>> files and modifications are part of the application afterwards.
>>>>> This was
>>>>> no problem up to now, since the application was never really deployed
>>>>> with the sysdeo plugin. However, WTP does a real deploy and copies the
>>>>> files to a temporary directory. If the application modifies or creates
>>>>> files, only the temporary directory is affected and the changes are
>>>>> lost
>>>>> (i.e. not synchronized back to the project directory).
>>>>>
>>>>> Is there a way to achieve such a synchronization of the two
>>>>> directories?
>>>>> Or can the project directory directly be used as the webroot while
>>>>> developing (i.e. the files are never deployed elsewhere)?
>>>>>
>>>>> Thanks for your help,
>>>>>
>>>>> Dominik
Re: Synchronization with temporary deploy directory [message #222624 is a reply to message #222620] Fri, 10 October 2008 13:05 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
There are a number of reasons. First the servlet spec in no way
requires servlet containers or application servers serve exploded
directories, though many do as a convenience.

Second, Eclipse is very big on separating source from build artifacts.
So building your webapp's Java classes into WEB-INF/classes of the
"webcontent" folder, which should only contain source, would be
considered bad practice. Note that there is support for this use case
in WTP. If you manually direct the build output of your Java files to
WEB-INF/classes, I believe WTP detects this and won't be confused by
having built artifacts the it expects to publish being placed someplace
that it also expects to publish. It's just that Eclipse would never
require something like this be done in order to work.

Third, there is an important feature that I don't think would work that
well in your scenario. This is the ability to create "virtual"
dependencies on jars and not have them physically in the WEB-INF/lib of
the "webcontent" folder. They are available for compiling at build time
and are copied to the webapp as part of publishing in preparation for
run time. The same jar can serve many projects. It's a similar story
for Java utility projects, which are built into jars during and placed
in the published webapp's WEB-INF/lib. Having such dependencies
physically created so that the "webcontent" folder is a fully functional
WAR directory structure wouldn't be practical.

I assume you are aware that a self-modifying webapp may have limited
portability. There is nothing in the servlet spec that promises it
would work on a given servlet container or application server. Also,
the webapp could easily be deployed to a "working" area that isn't
persisted beyond a restart. I believe this would even be the case for
Tomcat if you turn on antiResourceLocking. However, if portability
isn't an issue, then this may not matter that much.

Cheers,
Larry

Dominik Raymann wrote:
> Thanks Larry for all your comprehensive answers in this and the other
> thread.
>
> Considering all the special tricks that have to be done to run the
> application in situ (and the impossiblity to do it with other
> application servers than Tomcat), what are the advantages of the dynamic
> web project structure proposed by WTP? Wouldn't it be easier to use the
> standard WAR file structure (i.e. exploded WAR) in the first place?
>
> Cheers,
>
> Dominik
>
> Larry Isaacs schrieb:
>> Not discouraged, but you may not find this feature available for other
>> servers. Within an Eclipse workspace with dynamic web projects, you
>> typically won't find a folder that can serve root folder of a webapp
>> with a WAR file directory structure. Thus a WAR or folder with a WAR
>> file structure has to be created so the webapp can be deployed or
>> served, as you noted in your first e-mail.
>>
>> Because the Tomcat server adapter imports the server's configuration
>> into Eclipse, it is able to play some special games with that
>> configuration to make the "Serve modules without publishing" work.
>> Note that enabling this feature non-intrusively modifies the Tomcat
>> server by adding an extra jar to the server. You can also take a peek
>> at the <Context> that gets added to the server.xml when this feature
>> is enabled to see the special configuration of that <Context> gets to
>> make this work.
>>
>> Cheers,
>> Larry
>>
>> Dominik Raymann wrote:
>>> What do you mean by "non-standard" feature? Is it discouraged to use
>>> this feature?
>>>
>>> Cheers, Dominik
>>>
>>> Larry Isaacs schrieb:
>>>> Yes, this non-standard feature should achieve what you want. The
>>>> docBase of the context will point to the "webcontent" folder of the
>>>> project. In addition, a custom classloader is used by the webapp to
>>>> get a list of resources so that the jars and classes in your project
>>>> are used directly. This also applies to Java utility projects that
>>>> your web application project depends on.
>>>>
>>>> Cheers,
>>>> Larry
>>>>
>>>> Dominik Raymann wrote:
>>>>> Ok,
>>>>>
>>>>> I found out that I can check the option "Serve modules with out
>>>>> publishing". I think that this will avoid the need of copying back
>>>>> published and modified files.
>>>>>
>>>>> Dominik Raymann schrieb:
>>>>>> Hi there,
>>>>>>
>>>>>> I would like to use WTP for my web projects. At the moment I'm
>>>>>> working
>>>>>> with the sysdeo plugin, the eclipse project is directly the
>>>>>> application's root.
>>>>>>
>>>>>> My application generates and modifies files in the web
>>>>>> application. The
>>>>>> files and modifications are part of the application afterwards.
>>>>>> This was
>>>>>> no problem up to now, since the application was never really deployed
>>>>>> with the sysdeo plugin. However, WTP does a real deploy and copies
>>>>>> the
>>>>>> files to a temporary directory. If the application modifies or
>>>>>> creates
>>>>>> files, only the temporary directory is affected and the changes
>>>>>> are lost
>>>>>> (i.e. not synchronized back to the project directory).
>>>>>>
>>>>>> Is there a way to achieve such a synchronization of the two
>>>>>> directories?
>>>>>> Or can the project directory directly be used as the webroot while
>>>>>> developing (i.e. the files are never deployed elsewhere)?
>>>>>>
>>>>>> Thanks for your help,
>>>>>>
>>>>>> Dominik
Re: Synchronization with temporary deploy directory [message #222633 is a reply to message #222624] Mon, 13 October 2008 08:53 Go to previous message
Dominik Raymann is currently offline Dominik RaymannFriend
Messages: 37
Registered: July 2009
Member
Larry,

thanks for your answer. I see the advantages of a directory layout as
proposed by the WTP, especially when it comes to separation of build
artifacts. I'm aware of the limitation of a self-modifying webapp and
there are plans to change this behaviour in the near future. By then
I'll have to cope with it somehow ;-)

Thanks again.
Cheers,

Dominik

Larry Isaacs schrieb:
> There are a number of reasons. First the servlet spec in no way
> requires servlet containers or application servers serve exploded
> directories, though many do as a convenience.
>
> Second, Eclipse is very big on separating source from build artifacts.
> So building your webapp's Java classes into WEB-INF/classes of the
> "webcontent" folder, which should only contain source, would be
> considered bad practice. Note that there is support for this use case
> in WTP. If you manually direct the build output of your Java files to
> WEB-INF/classes, I believe WTP detects this and won't be confused by
> having built artifacts the it expects to publish being placed someplace
> that it also expects to publish. It's just that Eclipse would never
> require something like this be done in order to work.
>
> Third, there is an important feature that I don't think would work that
> well in your scenario. This is the ability to create "virtual"
> dependencies on jars and not have them physically in the WEB-INF/lib of
> the "webcontent" folder. They are available for compiling at build time
> and are copied to the webapp as part of publishing in preparation for
> run time. The same jar can serve many projects. It's a similar story
> for Java utility projects, which are built into jars during and placed
> in the published webapp's WEB-INF/lib. Having such dependencies
> physically created so that the "webcontent" folder is a fully functional
> WAR directory structure wouldn't be practical.
>
> I assume you are aware that a self-modifying webapp may have limited
> portability. There is nothing in the servlet spec that promises it
> would work on a given servlet container or application server. Also,
> the webapp could easily be deployed to a "working" area that isn't
> persisted beyond a restart. I believe this would even be the case for
> Tomcat if you turn on antiResourceLocking. However, if portability
> isn't an issue, then this may not matter that much.
>
> Cheers,
> Larry
>
> Dominik Raymann wrote:
>> Thanks Larry for all your comprehensive answers in this and the other
>> thread.
>>
>> Considering all the special tricks that have to be done to run the
>> application in situ (and the impossiblity to do it with other
>> application servers than Tomcat), what are the advantages of the
>> dynamic web project structure proposed by WTP? Wouldn't it be easier
>> to use the standard WAR file structure (i.e. exploded WAR) in the
>> first place?
>>
>> Cheers,
>>
>> Dominik
>>
>> Larry Isaacs schrieb:
>>> Not discouraged, but you may not find this feature available for
>>> other servers. Within an Eclipse workspace with dynamic web
>>> projects, you typically won't find a folder that can serve root
>>> folder of a webapp with a WAR file directory structure. Thus a WAR
>>> or folder with a WAR file structure has to be created so the webapp
>>> can be deployed or served, as you noted in your first e-mail.
>>>
>>> Because the Tomcat server adapter imports the server's configuration
>>> into Eclipse, it is able to play some special games with that
>>> configuration to make the "Serve modules without publishing" work.
>>> Note that enabling this feature non-intrusively modifies the Tomcat
>>> server by adding an extra jar to the server. You can also take a
>>> peek at the <Context> that gets added to the server.xml when this
>>> feature is enabled to see the special configuration of that <Context>
>>> gets to make this work.
>>>
>>> Cheers,
>>> Larry
>>>
>>> Dominik Raymann wrote:
>>>> What do you mean by "non-standard" feature? Is it discouraged to use
>>>> this feature?
>>>>
>>>> Cheers, Dominik
>>>>
>>>> Larry Isaacs schrieb:
>>>>> Yes, this non-standard feature should achieve what you want. The
>>>>> docBase of the context will point to the "webcontent" folder of the
>>>>> project. In addition, a custom classloader is used by the webapp
>>>>> to get a list of resources so that the jars and classes in your
>>>>> project are used directly. This also applies to Java utility
>>>>> projects that your web application project depends on.
>>>>>
>>>>> Cheers,
>>>>> Larry
>>>>>
>>>>> Dominik Raymann wrote:
>>>>>> Ok,
>>>>>>
>>>>>> I found out that I can check the option "Serve modules with out
>>>>>> publishing". I think that this will avoid the need of copying back
>>>>>> published and modified files.
>>>>>>
>>>>>> Dominik Raymann schrieb:
>>>>>>> Hi there,
>>>>>>>
>>>>>>> I would like to use WTP for my web projects. At the moment I'm
>>>>>>> working
>>>>>>> with the sysdeo plugin, the eclipse project is directly the
>>>>>>> application's root.
>>>>>>>
>>>>>>> My application generates and modifies files in the web
>>>>>>> application. The
>>>>>>> files and modifications are part of the application afterwards.
>>>>>>> This was
>>>>>>> no problem up to now, since the application was never really
>>>>>>> deployed
>>>>>>> with the sysdeo plugin. However, WTP does a real deploy and
>>>>>>> copies the
>>>>>>> files to a temporary directory. If the application modifies or
>>>>>>> creates
>>>>>>> files, only the temporary directory is affected and the changes
>>>>>>> are lost
>>>>>>> (i.e. not synchronized back to the project directory).
>>>>>>>
>>>>>>> Is there a way to achieve such a synchronization of the two
>>>>>>> directories?
>>>>>>> Or can the project directory directly be used as the webroot while
>>>>>>> developing (i.e. the files are never deployed elsewhere)?
>>>>>>>
>>>>>>> Thanks for your help,
>>>>>>>
>>>>>>> Dominik
Previous Topic:EJB Project and Entity
Next Topic:XSL Tools 0.5M9 available
Goto Forum:
  


Current Time: Fri Mar 29 07:03:54 GMT 2024

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

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

Back to the top