tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: /META-INF/context.xml seemingly ignored
Date Sat, 03 Aug 2013 23:05:27 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Nick,

On 8/3/13 2:54 PM, Nick Williams wrote:
> I'm using Tomcat 8.0.0-RC1. Hopefully I'm just missing something 
> here. I created a web application with the following 
> /META-INF/context.xml file (I tried both with and without the 
> path="/support" attribute).
> 
> 
> <?xml version='1.0' encoding='utf-8'?> <Context path="/support"> 
> <Loader
> loaderClass="org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader"/>
>
> 
</Context>

If you are using META-INF/context.xml, then the "path" attribute is
definitely illegal/ignored.

I haven't read the Javadoc for Tomcat 8 yet, but I think you want:

   <Loader className="org.spring....Loader" />

Instead of "loaderClass". At least, that's what it would have been for
Tomcat 7.

> The JAR containing the TomcatInstrumentableClassLoader is in 
> TOMCAT_HOME/lib. However, when the application starts the class 
> loader is still Tomcat's WebappClassLoader.
> 
> So, I moved the <Loader> element to TOMCAT_HOME/conf/context.xml
> and now it works. When the application starts the class loader is
> the TomcatInstrumentableClassLoader.

That's odd.

> Note that I have confirmed the context.xml file IS in META-INF at
> the root of my web application (not in /WEB-INF/classes/META-INF).
> I also noticed that TOMCAT_HOME/conf/Catalina/localhost is empty.
> There are no files or other directories in that directory at all.
> So, it would appear that my context.xml is not getting copied. I
> don't know whether or not that matters. I am deploying my
> application as an exploded directory (not a WAR), and it is in an
> external directory (it is not in TOMCAT_HOME/webapps).
> 
> Am I doing something wrong here, or is this a bug?

Anything in the "work" directory? CATALINA_BASE/conf/[Engine]/[Host]/
should be where context.xml files are copied, so .. this definitely
looks fishy.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.14 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJR/Yy0AAoJEBzwKT+lPKRY67AP/0DCd1vlI6A3Et9rYDkstu2e
RyukiBRG0H+3JeoJ2SuHVNorjKesJV5LgjwopawXKRuCmkmuds5KV9HFtsrhzWoD
PWRFIvGU0RbBKbNisStcBQ5GxafOBKB8uta+HTPukVaOAkjD2jGjp/mE3n4DWfuu
xl73Ij/cwHeULSzrF0RRWm/sB508d8ZyVN17L7rwNTxzBVVoIHDybgYKrOEkyK+o
24/0qkbH3ROmRyzayaWQlqBJUQFgfgIgc5kN9HB710kkNNdECSzs8boMMp9yJL5J
K2MxHq79D4ZrmlqUQAIaM6bGot4qWfVy8iN/y3+GU/L4nmqtxEz9CEdRuLZ6WrB1
tujz1LFu1noVSHaE1CptiLAR72kTU6qCtsR28TJ0kfYUh9QgOWUpCl8Rs7ity3gH
Z5WwZJixHoUVCwSjYTndZEENeIVygNZ8LC6BZKvNS8sAaW3C5Lq0NbO0jBDCgV+G
qD78Hu8UUnZR8i0Vm9QpLYlC2FFPLLNNzCbyqJDClp69LcYxrgTnvk9IouNZDjmW
Vy7xe379AHnmqpF3ZYda2FwnLNe2wqaS6DhA+eEM6cU0uDhutW8KwjcsPSV1dHwi
P7yBINIwlGH3961Knu7lt/PyqpKroBFFr6fSdfGfShLVvla7Z8SZFqCYmZWxolVx
zc6AAqu9IicX6qjgooWa
=NFNC
-----END PGP SIGNATURE-----

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


Mime
View raw message