I figured it out.

Let say /mnt/mynfsserver_img/ contains an image called myimage.png.

If you create the below pre-resource in context.xml, you can access that image 
by typing http://localhost:8080/img/myimage.png.

Philippe

----- Mail original -----
De: phi...@free.fr
À: "Tomcat Users List" <users@tomcat.apache.org>
Envoyé: Vendredi 21 Novembre 2014 15:45:25
Objet: Re: Problem with base directory in Resource


I have solved the problem by replacing PostResources by PreResources (cf. 
http://mikusa.blogspot.fr/2014/07/tips-on-migrating-to-tomat-8-resources.html).

Now I need to figure out how to use the webAppMount. Any suggestions?

Philippe

 

----- Mail original -----
De: phi...@free.fr
À: users@tomcat.apache.org
Envoyé: Vendredi 21 Novembre 2014 15:38:57
Objet: Problem with base directory in Resource


Hello,

in my Apache 8 context.xml file, I have created the following resource:

<Resources>
                <PreResources 
                        
className="org.apache.catalina.webresources.DirResourceSet"
                        base="/mnt/mynfsserver_img/" 
                        webAppMount="/img" 
                        internalPath="/img" />
</Resources>

where /mnt/mynfsserver_img is a mounted volume containing thousands of photos 
in sub-directories.

When I start Tomcat 8, I get the following error message:

-------------------------------------
Caused by: org.apache.catalina.LifecycleException: Failed to initialize 
component [org.apache.catalina.webresources.DirResourceSet@6649bfd3]
        at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106)
        at 
org.apache.catalina.webresources.StandardRoot.initInternal(StandardRoot.java:647)
        at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
        ... 14 more
Caused by: java.lang.IllegalArgumentException: TODO-i18n: base/internalPath is 
not a directory
        at 
org.apache.catalina.webresources.DirResourceSet.checkType(DirResourceSet.java:247)
        at 
org.apache.catalina.webresources.AbstractFileResourceSet.initInternal(AbstractFileResourceSet.java:134)
        at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
        ... 16 more
--------------------------------------------

What am I doing wrong?

Many thanks.

Cheers,

Philippe

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to