Thanks for the response, let’s work backwards.

3 – yes

2 – looked at and not applicable in this case

1 – The custom classLoader is set fine and it works, except it doesn’t
loader the classes from the webapp base dir, only the outside base dir.

 

Also, if I leave out the custom classLoader by removing the contect.xml
file, the webapp works fine but doesn’t have access to the external optional
files. The whole point of the custom classLoader is to get the optional
external files in addition to the standard base files; and it used to work
for tomcat 5.5 and doesn’t for 7.0 due to changes. I am trying to figure out
which changes are core to this issue and how to work around them.

 

Maybe I should have said that the old process that worked was set up to look
outside the webapp base for additional, optional files for additional,
optional functionality (packaged as exploded war files) and allow access to
those files, treating those files as having precedence over core files. This
was an extension model implemented by a developer who is no longer here and
it worked very well. Now I have to figure out how to get that same
functionality to work in tomcat 7; but so far have only been able to get one
or the other, not both together as an integrated whole.

 

From: Martin Gainty [mailto:mgai...@hotmail.com] 
Sent: Wednesday, July 24, 2013 1:02 PM
To: ero...@comsquared.com
Subject: RE: context problem

 

jars require permission to access and set the classLoader 
here is an example of tomcat-juli.jar which sets ContextClassLoader
1)$CATALINA_HOME/conf/catalina.policy 
 
grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" {
        permission java.lang.RuntimePermission "setContextClassLoader";

http://tomcat.apache.org/tomcat-7.0-doc/security-manager-howto.html

2)
 any JAR file that contains Servlet API classes will be explicitly ignored
by the classloader 
 
 <http://tomcat.apache.org/tomcat-7.0-doc/security-manager-howto.html>
http://tomcat.apache.org/tomcat-7.0-doc/security-manager-howto.html
 

3)
can i assume the context.xml is in webapps/WebAppName/META-INF/context.xml ?

Martin Gainty 
______________________________________________ 
Jogi és Bizalmassági kinyilatkoztatás/Verzicht und
Vertraulichkeitanmerkung/Note de déni et de confidentialité

 

Ez az üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor kérjük, hogy
jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának készítése
nem megengedett.  Ez az üzenet csak ismeret cserét szolgál és semmiféle jogi
alkalmazhatósága sincs.  Mivel az electronikus üzenetek könnyen
megváltoztathatóak, ezért minket semmi felelöség nem terhelhet ezen üzenet
tartalma miatt.

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
dient lediglich dem Austausch von Informationen und entfaltet keine
rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.

Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
destinataire prévu, nous te demandons avec bonté que pour satisfaire
informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie
de ceci est interdite. Ce message sert à l'information seulement et n'aura
pas n'importe quel effet légalement obligatoire. Étant donné que les email
peuvent facilement être sujets à la manipulation, nous ne pouvons accepter
aucune responsabilité pour le contenu fourni.



 

> From: ero...@comsquared.com
> To: users@tomcat.apache.org
> Subject: context problem
> Date: Wed, 24 Jul 2013 12:21:42 -0400
> 
> I have a web app that worked in version 5.5, not working in version 7.0.
The
> Context.xml is:
> 
> 
> 
> <Context>
> 
> <Resources
> className="com.comsquared.idw.catalina.ext.IDWMFileDirContext" />
> 
> <Loader
> loaderClass="com.comsquared.idw.catalina.ext.IDWMClassLoader"/>
> 
> <Resource name="jdbc/ImageDirectorWorkflowDS"
> type="javax.sql.DataSource"
factory="com.comsquared.idwm.DataSourceFactory"
> />
> 
> </Context>
> 
> 
> 
> IDWMFileDirContext extend FileDirContext, IDWMClassLoader extends
> WebappClassLoader. When IDWMFileDirContext is called, it is called with
the
> default (no arg) constructor, which first calls super();, then imports the
> outside the webapp base jar files. That works fine. Then the
IDWMClassLoader
> is called, which uses the (ClassLoader parent) constructor and again,
calls
> super(parent). Parent is org.apache.catalina.loader.StandardClassLoader
and
> seems to be ok.
> 
> 
> 
> But the next step, loading the DataSource from the DataSourceFactory fails
> with a ClassNotFoundException. That class is in the webapps normal
> WEB-INF/classes directory.
> 
> 
> 
> I have been reading to docs to try and figure out how to get both the
normal
> webapp base directories and the outside the base directories to be found.
> The major difference is that the Loader in 5.5 looked like this:
> 
> 
> 
> <Loader
> loaderClass="com.comsquared.idw.catalina.ext.IDWMClassLoader"
> delegate="true"
> 
> useSystemClassLoaderAsParent="false" />
> 
> 
> 
> And useSystemClassLoaderAsParent isn't recognized and delegate has no
> effect.
> 
> 
> 
> Any hints as to where to look would be a big help.
> 

Reply via email to