These jars are deployed in common folder to make use of my two web 
applications. I have modified the catalina.properties file to load these jars 
by tomcat server.

Many thanks. 

-----Original Message-----
From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
Sent: 10 September 2016 00:08
To: Tomcat Users List
Subject: Re: tomcat8 unable to load the Resource/property file from jar

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Venkata,

On 9/9/16 5:18 AM, Venkata Reddy P wrote:
> I have tried it and still getting the null value. URL url = 
> Auth.class.getClassLoader().getResource("/com/trianz/auth/auth.propert
ies");
>
>  The Auth.java is part of other jar called tools.jar
> 
> My jars: 1)auth.jar com/trianz/auth/*.java 
> com/trianz/auth/auth.properties
> 
> 2)tools.jar com/trianz/tools /Auth.java com/trianz/tools/*.properties
> 
> Many thanks for the response.

And where are those .jar files located?

- -chris

> -----Original Message----- From: Christopher Schultz 
> [mailto:ch...@christopherschultz.net] Sent: Thursday, September 08,
> 2016 8:33 PM To: Tomcat Users List Subject: Re: tomcat8 unable to load 
> the Resource/property file from jar
> 
> Venkata,
> 
> On 9/7/16 4:49 AM, Venkata Reddy P wrote:
>> Recently we have upgraded the one of application from tomcat6.x to 
>> tomcat8.0.36 version. In tomcat6, i was able to read the 
>> property/resource file from the jar file but certain reasons after 
>> upgrading to the tomca8.0.36 its failing to load.
> 
>> My jar: auth.jar com/trianz/auth/*.java 
>> com/trianz/auth/auth.properties
> 
>> //failing code, here url always getting null value. URL  url = 
>> Auth.class.getClassLoader().getResource("com/trianz/auth/auth.propert
i
>
>> 
es");
> 
>> I am sure by looking at the tomcat catalina.startup logs the auth.jar 
>> is loading properly Is there any way to confirm the file in classpath 
>> "com/trianz/auth/auth.properties"? How do I fix this?
> 
>> Many Thanks in advance.
> 
> Can you try reading the file like this:
> 
> URL url =
> Auth.class.getClassLoader().getResource("/com/trianz/auth/auth.propert
ie
>
> 
s")
> 
> ? (note the leading "/")
> 
> Also, from where is the Auth class being loaded? Where is auth.jar 
> located?
> 
> -chris
> 
> ---------------------------------------------------------------------
>
> 
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
> 
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJX0wGQAAoJEBzwKT+lPKRYnPsP/Ri0B76o9g1Gxw3/YGNGmZFl
z7Q2IP7MpwCVb97kMNVleq+YD8uhBNYEZAfwu6l0k1l+YfPmJIkqItoFHapIvzOQ
9J5HwxJsSS4O1Hc0w458C1LYLtVlFNUC19upnzxkfx58S6Il9t5M1GhBtWhyJiUj
VrJqoU8DYksv4ZbNWLiUTse2vubxtjqxqv7SW5cXL+XckgCZ32LYb4xZWv0CiJER
sSEVRMwti+RrzwHqda1ClSwaRm3kyDfU8fYIiIcmDE4eIh/iUjWvGjCBfpQyaVPm
p5ZEvF73NInSmWZ2rIk7C2ELGY/LIk51UDUbjwaZtE929yCaLtBJn7dAnOV209YK
CSfm9Ichi7DU8mbimIaxCGtGIjrXk8FDvRGm8RaRocimf7mm/1gyLaLoQyCH484V
9SprUrr3AFxaME4uLB+3SZQBJtPEreVNXxZDYRXBoR9m/YJ7NsaV2xo51s9JgTAD
5IERjUoHJZkq7O6/Qy8vefL1ER5/p4fLMJjdG9FU54wQAfmm1Eh1GTUrUau4oBED
MAXugnweBMoXiCwxaTgEB9SKqbDcX5M8gH6Z6nbghVgkePy0v7icWTxapbWLA2y/
J4ByVjRBpXR2cU/PGd1y+9IcKAwYPDoaq67gNBNPWlEgnr+AbMmLPkZBnPo9y/jI
tUl8dnzjI5W08dUB4HtD
=3QzT
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
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