You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Greg Allen <GA...@arrayinc.com> on 2006/06/05 20:34:34 UTC

Image files and DeployTask...

I have a build.xml that used DeployTask to deploy my application. Here's
the build.xml:

 

  <target    name="install" depends="compile"

      description="Install webapp on Tomcat">

    <taskdef name="install"

        classname="org.apache.catalina.ant.DeployTask"

     classpathref="catalina.classpath"/>

    <install  url="${catalina.manager}"

         username="${catalina.username}"

         password="${catalina.password}"

             path="/${project.path}"

         localwar="file://${build.web.dir}"/>

  </target>

 

In my deployed application I have some image files (GIF format), which 
end up in the <app>/images directory.

 

However, for some reason, when the application is deployed the images
end
up being corrupted and displaying incorrectly on the screen. I have
verified that
the deployed images with the pre-deployed ones, and they are the same
number of bytes. But when I try to view the deployed images, the images
themselves are hosed.

 

I've tried using jar and bundling up my application by hand, and if I do
that
the images end up fine.

 

Has anybody see this before?  Do I have to do something special with
image files?

 

Thanks,

 

-- Greg

 


Re: Image files and DeployTask...

Posted by Marc Farrow <ma...@gmail.com>.
No issues.   Thanks for the explanation

I will test the WEBDAV setting again and see what happens.


On 6/5/06, Mark Thomas <ma...@apache.org> wrote:
>
> Marc Farrow wrote:
> > Mark,
> >
> >  Why do you have to mark the WEBDAV servlet as NOT read-only in order to
> > use the ant tasks?  By default the read-only/false parameter is
> commented
> > out.  The ant tasks will not work unless you uncomment them out.
>
> You don't have to do this. The Ant tasks use the manager servlet. The
> manager servlet does not use the webdav servlet. The webdav servlet is
> in a separate web-app all of it's own. As can be seen from the source,
> nothing in either the Ant tasks or the manager servlet expects the
> webdav servlet or application to be present.
>
> The deploy task does require the readonly parameter of the default
> servlet to be configured so PUT works. It is possible that someone may
> have added the WEBDAV servlet to the manager application as an
> alternative method of enabling PUT. I can see how this might work but
> it certainly isn't the standard way of doing things neither have I
> tested it. I would also have security concerns about the using the
> webdav servlet in this way and would want to check exactly what was
> and wasn't exposed for edit in such a configuration. I am not saying
> it couldn't be secured, just that I would want to be careful.
>
> >> 2. To what fault in the WEBDAV are you referring? When I last looked
> >> at the WEBDAV servlet it had no problems handling the upload of images
> >> or any other files for that matter.
>
> You didn't answer this point. If there is an issue with webdav and
> images I would very much like to know about it since it hasn't
> appeared in any of my testing.
>
> Mark
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


-- 
Marc Farrow

Re: Image files and DeployTask...

Posted by Mark Thomas <ma...@apache.org>.
Marc Farrow wrote:
> Mark,
> 
>  Why do you have to mark the WEBDAV servlet as NOT read-only in order to
> use the ant tasks?  By default the read-only/false parameter is commented
> out.  The ant tasks will not work unless you uncomment them out.

You don't have to do this. The Ant tasks use the manager servlet. The
manager servlet does not use the webdav servlet. The webdav servlet is
in a separate web-app all of it's own. As can be seen from the source,
nothing in either the Ant tasks or the manager servlet expects the
webdav servlet or application to be present.

The deploy task does require the readonly parameter of the default
servlet to be configured so PUT works. It is possible that someone may
have added the WEBDAV servlet to the manager application as an
alternative method of enabling PUT. I can see how this might work but
it certainly isn't the standard way of doing things neither have I
tested it. I would also have security concerns about the using the
webdav servlet in this way and would want to check exactly what was
and wasn't exposed for edit in such a configuration. I am not saying
it couldn't be secured, just that I would want to be careful.

>> 2. To what fault in the WEBDAV are you referring? When I last looked
>> at the WEBDAV servlet it had no problems handling the upload of images
>> or any other files for that matter.

You didn't answer this point. If there is an issue with webdav and
images I would very much like to know about it since it hasn't
appeared in any of my testing.

Mark

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Image files and DeployTask...

Posted by Marc Farrow <ma...@gmail.com>.
Mark,

  Why do you have to mark the WEBDAV servlet as NOT read-only in order to
use the ant tasks?  By default the read-only/false parameter is commented
out.  The ant tasks will not work unless you uncomment them out.

At least on OpenVMS, the manager application uses WEBDAV to remotely
download the WAR file and set the file attributes properly.



  <servlet>
    <servlet-name>webdav</servlet-name>
    <servlet-class>org.apache.catalina.servlets.WebdavServlet
</servlet-class>
    <init-param>
      <param-name>debug</param-name>
      <param-value>0</param-value>
    </init-param>
    <init-param>
      <param-name>listings</param-name>
      <param-value>true</param-value>
    </init-param>
    <!-- Uncomment this to enable read and write access -->
    <init-param>
      <param-name>readonly</param-name>
      <param-value>false</param-value>
    </init-param>
    <!--load-on-startup>1</load-on-startup-->
  </servlet>

On 6/5/06, Mark Thomas <ma...@apache.org> wrote:
>
> Marc Farrow wrote:
> > I am not going to be able to give you the resolution to this problem.
> > However, the ant tasks use the WEBDAV application from within Tomcat and
> > this is the source of your problem.  Are you deploying to local or
> remote
> > host?  If it is a remote host, then it could be a bug in the Tomcat
> version
> > running on the remote host.
>
> 1. The Ant tasks go nowhere near the WEBDAV application. They use the
> manager application.
> 2. To what fault in the WEBDAV are you referring? When I last looked
> at the WEBDAV servlet it had no problems handling the upload of images
> or any other files for that matter.
>
> Mark
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


-- 
Marc Farrow

Re: Image files and DeployTask...

Posted by Mark Thomas <ma...@apache.org>.
Marc Farrow wrote:
> I am not going to be able to give you the resolution to this problem.
> However, the ant tasks use the WEBDAV application from within Tomcat and
> this is the source of your problem.  Are you deploying to local or remote
> host?  If it is a remote host, then it could be a bug in the Tomcat version
> running on the remote host.

1. The Ant tasks go nowhere near the WEBDAV application. They use the
manager application.
2. To what fault in the WEBDAV are you referring? When I last looked
at the WEBDAV servlet it had no problems handling the upload of images
or any other files for that matter.

Mark


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Image files and DeployTask...

Posted by Marc Farrow <ma...@gmail.com>.
I am not going to be able to give you the resolution to this problem.
However, the ant tasks use the WEBDAV application from within Tomcat and
this is the source of your problem.  Are you deploying to local or remote
host?  If it is a remote host, then it could be a bug in the Tomcat version
running on the remote host.

On 6/5/06, Greg Allen <GA...@arrayinc.com> wrote:
>
> I have a build.xml that used DeployTask to deploy my application. Here's
> the build.xml:
>
>
>
> <target    name="install" depends="compile"
>
>      description="Install webapp on Tomcat">
>
>    <taskdef name="install"
>
>        classname="org.apache.catalina.ant.DeployTask"
>
>     classpathref="catalina.classpath"/>
>
>    <install  url="${catalina.manager}"
>
>         username="${catalina.username}"
>
>         password="${catalina.password}"
>
>             path="/${project.path}"
>
>         localwar="file://${build.web.dir}"/>
>
> </target>
>
>
>
> In my deployed application I have some image files (GIF format), which
> end up in the <app>/images directory.
>
>
>
> However, for some reason, when the application is deployed the images
> end
> up being corrupted and displaying incorrectly on the screen. I have
> verified that
> the deployed images with the pre-deployed ones, and they are the same
> number of bytes. But when I try to view the deployed images, the images
> themselves are hosed.
>
>
>
> I've tried using jar and bundling up my application by hand, and if I do
> that
> the images end up fine.
>
>
>
> Has anybody see this before?  Do I have to do something special with
> image files?
>
>
>
> Thanks,
>
>
>
> -- Greg
>
>
>
>
>


-- 
Marc Farrow