On Wed, 2016-09-14 at 11:54 +0000, Venkata Reddy P wrote:
> Thanks Chris for replying. 
> 
> I have tried placing all the jars into webapps/auth/web-inf/lib
> folder but still getting the null value.
> 
You mean WEB-INF/lib not web-inf/lib, right?  Case matters.


> Is there any way to confirm the property file in tomcat classpath?
> 
> Many Thanks.
> -----Original Message-----
> From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
> Sent: Monday, September 12, 2016 2:39 AM
> To: Tomcat Users List
> Subject: Re: tomcat8 unable to load the Resource/property file from jar
> 
> Venkata,
> 
> On 9/9/16 2:48 PM, Venkata Reddy P wrote:
> > 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.
> 
> What happens if you put those JAR files separately into each web application?
> 
> I would expect the code as presented to work, but it's worth trying.
> And much easier to deal with than a complicated deployment where you need to 
> stash things in Tomcat's common classloader.
> 
> -chris
> 
> > -----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
> > 
> > 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.proper
> t
> >
> >> 
> 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.proper
> t
> >
> >>> 
> 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.proper
> t
> >
> >> 
> 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
> > 
> > 
> > ---------------------------------------------------------------------
> >
> > 
> 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
> 
> 
> ---------------------------------------------------------------------
> 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