You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by "Peter L. Berghold" <pe...@berghold.net> on 2008/07/23 16:18:30 UTC

Sending arbitrary file types through geronimo/tomcat

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi folks,

Long sordid tale why I want to do this, but here is what I'm attempting
to do:

I have a repository of files on my server that I'm trying to use wget to
retrieve from that server.  The files are a mix of plain text,
tar-balls, zip files, etc. etc.

I set up a context using a geronimo-web.xml file such that:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.1">
  <environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1">
    <moduleId>
      <groupId>net.berghold</groupId>
      <artifactId>served-files</artifactId>
      <version>1.0</version>
      <type>car</type>
    </moduleId>
  </environment>

  <context-root>/served-files</context-root>
  <host>www.berghold.net</host>

</web-app>

and did a in-place deployment.  So far so good....

When I execute the wget I get something that looks like this:

 wget http://www.berghold.net/served-files/awstats-6.7.tar.gz
- --10:12:53--  http://www.berghold.net/served-files/awstats-6.7.tar.gz
Resolving www.berghold.net... 72.249.39.173
Connecting to www.berghold.net|72.249.39.173|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 0 [application/x-gzip]
Saving to: `awstats-6.7.tar.gz'

    [ <=>                                    ] 0           --.-K/s   in
0s

10:12:54 (0.00 B/s) - `awstats-6.7.tar.gz' saved [0/0]

and a zero length file results.  I just know in my heart of hearts there
is some bit I gotta flip to make this work.  Or do I have to create a
web.xml with all the possible mime types in it?

What to do?


- --

Peter L. Berghold     http://www.berghold.net   peter@berghold.net
Unix Professional     Dog Agility Fan   Crazed Cook
"Those who fail to learn from history are condemned to repeat it."

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIhz21UM9/01RIhaARAoDjAKCs7VoLjMtDDNdjM46Hj44h7yUkyQCeJ5oI
p16oyXhcnuW3XwtOmX91wAQ=
=syot
-----END PGP SIGNATURE-----

Re: Sending arbitrary file types through geronimo/tomcat

Posted by David Jencks <da...@yahoo.com>.
I think I ran into a similar problem at one point but didn't really  
investigate what was going on.

IIUC there's a default content servlet that serves requests for static  
content like this.  Again IIRC it is configured by default to look in  
the unpacked war file inside the geronimo repository, but you can  
include such a servlet in your app explicitly and configure it to look  
somewhere else.

So my first dumb question is... where is the static content?  After  
that I'd probably try debugging the default content servlet to see if  
it is getting called and what its trying to do.

hope this helps
david jencks

On Jul 23, 2008, at 7:18 AM, Peter L. Berghold wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi folks,
>
> Long sordid tale why I want to do this, but here is what I'm  
> attempting
> to do:
>
> I have a repository of files on my server that I'm trying to use  
> wget to
> retrieve from that server.  The files are a mix of plain text,
> tar-balls, zip files, etc. etc.
>
> I set up a context using a geronimo-web.xml file such that:
> <?xml version="1.0" encoding="UTF-8"?>
> <web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.1">
>  <environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1 
> ">
>    <moduleId>
>      <groupId>net.berghold</groupId>
>      <artifactId>served-files</artifactId>
>      <version>1.0</version>
>      <type>car</type>
>    </moduleId>
>  </environment>
>
>  <context-root>/served-files</context-root>
>  <host>www.berghold.net</host>
>
> </web-app>
>
> and did a in-place deployment.  So far so good....
>
> When I execute the wget I get something that looks like this:
>
> wget http://www.berghold.net/served-files/awstats-6.7.tar.gz
> - --10:12:53--  http://www.berghold.net/served-files/ 
> awstats-6.7.tar.gz
> Resolving www.berghold.net... 72.249.39.173
> Connecting to www.berghold.net|72.249.39.173|:80... connected.
> HTTP request sent, awaiting response... 200 OK
> Length: 0 [application/x-gzip]
> Saving to: `awstats-6.7.tar.gz'
>
>    [ <=>                                    ] 0           --.-K/s   in
> 0s
>
> 10:12:54 (0.00 B/s) - `awstats-6.7.tar.gz' saved [0/0]
>
> and a zero length file results.  I just know in my heart of hearts  
> there
> is some bit I gotta flip to make this work.  Or do I have to create a
> web.xml with all the possible mime types in it?
>
> What to do?
>
>
> - --
>
> Peter L. Berghold     http://www.berghold.net   peter@berghold.net
> Unix Professional     Dog Agility Fan   Crazed Cook
> "Those who fail to learn from history are condemned to repeat it."
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.5 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFIhz21UM9/01RIhaARAoDjAKCs7VoLjMtDDNdjM46Hj44h7yUkyQCeJ5oI
> p16oyXhcnuW3XwtOmX91wAQ=
> =syot
> -----END PGP SIGNATURE-----


Re: Sending arbitrary file types through geronimo/tomcat

Posted by "Jay D. McHugh" <ja...@gmail.com>.
Hey Peter,

I a going to guess that the problem is that you have it set as 
<type>car</type>.

I have a similar inplace deployment that I made to serve as an archive 
for files generated from my app.  (I didn't set the host element in my 
geronimo-web.xml file though).

For comparison here is a copy of my geronimo-web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1">
     <dep:environment 
xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2">
         <dep:moduleId>
             <dep:groupId>net.jnwd</dep:groupId>
             <dep:artifactId>archives</dep:artifactId>
             <dep:version>2.0</dep:version>
             <dep:type>war</dep:type>
         </dep:moduleId>
         <dep:hidden-classes/>
         <dep:non-overridable-classes/>
     </dep:environment>
     <context-root>archives</context-root>
</web-app>

HTH,

Jay

Peter L. Berghold wrote:
> Hi folks,
> 
> Long sordid tale why I want to do this, but here is what I'm attempting
> to do:
> 
> I have a repository of files on my server that I'm trying to use wget to
> retrieve from that server.  The files are a mix of plain text,
> tar-balls, zip files, etc. etc.
> 
> I set up a context using a geronimo-web.xml file such that:
> <?xml version="1.0" encoding="UTF-8"?>
> <web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.1">
>   <environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1">
>     <moduleId>
>       <groupId>net.berghold</groupId>
>       <artifactId>served-files</artifactId>
>       <version>1.0</version>
>       <type>car</type>
>     </moduleId>
>   </environment>
> 
>   <context-root>/served-files</context-root>
>   <host>www.berghold.net</host>
> 
> </web-app>
> 
> and did a in-place deployment.  So far so good....
> 
> When I execute the wget I get something that looks like this:
> 
>  wget http://www.berghold.net/served-files/awstats-6.7.tar.gz
> --10:12:53--  http://www.berghold.net/served-files/awstats-6.7.tar.gz
> Resolving www.berghold.net... 72.249.39.173
> Connecting to www.berghold.net|72.249.39.173|:80... connected.
> HTTP request sent, awaiting response... 200 OK
> Length: 0 [application/x-gzip]
> Saving to: `awstats-6.7.tar.gz'
> 
>     [ <=>                                    ] 0           --.-K/s   in
> 0s
> 
> 10:12:54 (0.00 B/s) - `awstats-6.7.tar.gz' saved [0/0]
> 
> and a zero length file results.  I just know in my heart of hearts there
> is some bit I gotta flip to make this work.  Or do I have to create a
> web.xml with all the possible mime types in it?
> 
> What to do?
> 
>