Bug in serverdefinitions of generic server [message #121990] |
Mon, 18 July 2005 16:40  |
Eclipse User |
|
|
|
Hi,
I consider the following a bug. I will give you an explanation of of why I
think so. Maybe the fix I suggest will be considered for 0.7RC2. I would be
happy to get feedback from a committer, otherwise I would have to file this
as a bug too. Thanks in advance.
First, let me give you the paths that are relevant:
The build file jonas.xml is located at
${eclipse_home}/eclipse/plugins/org.eclipse.jst.server.gener ic.serverdefinitions_0.7.0/buildfiles/jonas.xml
The web project is located at
${workspace}/ProjectName
The deployables are located at
${workspace}/ProjectName/.deployables/ModuleName
In jonas.xml, the following piece of code is currently used to deploy a war:
<jar destfile="${module.name}.war">
<zipfileset dir="${module.dir}">
<include name="**/*.*"/>
<exclude name="**/*.war"/>
</zipfileset>
</jar>
<move file="${module.name}.war" todir="${server.publish.dir}"/>
The properties module.name and module.dir are set in the class
org.eclipse.jst.server.generic.core.internal.AntPublisher.ja va to
module.name = ModuleName
module.dir = ${workspace}/ProjectName/.deployables/ModuleName
Hence, the jar command tries to create the war file at
${eclipse_home}/eclipse/plugins/org.eclipse.jst.server.gener ic.serverdefinitions_0.7.0/buildfiles/
the home of the file jonas.xml, before it is to be moved to the servers
publish dir.
This is the bug.
In general, users will have write access to ${workspace}, but not to
${eclipse_home}. Hence, the ant script aborts because the war file cannot
be created. But even if a user had write access to ${eclipse_home}, a
temporary file should never be stored there.
As a fix, the war should be created somewhere in the projects file system,
before it is moved to the server. I have used the following change in
jonas.xml, which works:
<jar destfile="${module.dir}/${module.name}.war">
<zipfileset dir="${module.dir}">
<include name="**/*.*"/>
<exclude name="**/*.war"/>
</zipfileset>
</jar>
<move file="${module.dir}/${module.name}.war"
todir="${server.publish.dir}"/>
One could as well use another path in the projects file system for the
temporary war file.
Regards,
Andreas Schenk
|
|
|
Re: Bug in serverdefinitions of generic server [message #122043 is a reply to message #121990] |
Mon, 18 July 2005 17:58  |
Eclipse User |
|
|
|
Originally posted by: gercan.removeThis.acm.org
Hi Andreas,
That is a good point eclipse_home is not the best place to create
temporary files. Please go ahead and open that bug report, you can
assign it directly to me.
Thanks
--
Gorkem Ercan
Andreas Schenk wrote:
> Hi,
>
> I consider the following a bug. I will give you an explanation of of why I
> think so. Maybe the fix I suggest will be considered for 0.7RC2. I would be
> happy to get feedback from a committer, otherwise I would have to file this
> as a bug too. Thanks in advance.
>
> First, let me give you the paths that are relevant:
>
> The build file jonas.xml is located at
>
> ${eclipse_home}/eclipse/plugins/org.eclipse.jst.server.gener ic.serverdefinitions_0.7.0/buildfiles/jonas.xml
>
> The web project is located at
>
> ${workspace}/ProjectName
>
> The deployables are located at
>
> ${workspace}/ProjectName/.deployables/ModuleName
>
> In jonas.xml, the following piece of code is currently used to deploy a war:
>
> <jar destfile="${module.name}.war">
> <zipfileset dir="${module.dir}">
> <include name="**/*.*"/>
> <exclude name="**/*.war"/>
> </zipfileset>
> </jar>
> <move file="${module.name}.war" todir="${server.publish.dir}"/>
>
> The properties module.name and module.dir are set in the class
>
> org.eclipse.jst.server.generic.core.internal.AntPublisher.ja va to
>
> module.name = ModuleName
>
> module.dir = ${workspace}/ProjectName/.deployables/ModuleName
>
> Hence, the jar command tries to create the war file at
>
> ${eclipse_home}/eclipse/plugins/org.eclipse.jst.server.gener ic.serverdefinitions_0.7.0/buildfiles/
>
> the home of the file jonas.xml, before it is to be moved to the servers
> publish dir.
>
> This is the bug.
>
> In general, users will have write access to ${workspace}, but not to
> ${eclipse_home}. Hence, the ant script aborts because the war file cannot
> be created. But even if a user had write access to ${eclipse_home}, a
> temporary file should never be stored there.
>
> As a fix, the war should be created somewhere in the projects file system,
> before it is moved to the server. I have used the following change in
> jonas.xml, which works:
>
> <jar destfile="${module.dir}/${module.name}.war">
> <zipfileset dir="${module.dir}">
> <include name="**/*.*"/>
> <exclude name="**/*.war"/>
> </zipfileset>
> </jar>
> <move file="${module.dir}/${module.name}.war"
> todir="${server.publish.dir}"/>
>
>
> One could as well use another path in the projects file system for the
> temporary war file.
>
> Regards,
>
> Andreas Schenk
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03080 seconds