/my.properties did the job.
Sorry for spamming you all.

Cheers,


--- On Wed, 2012/9/19, [email protected] <[email protected]> wrote:

Latest construction:
InputStream inputStream = 
this.getClass().getClassLoader().getResourceAsStream("classes/my.properties"); 
is giving me null.

--- On Wed, 2012/9/19, [email protected] <[email protected]> wrote:

Thanks Guy Thomas.
Yes, moving the my.properties file inside /WEB-INF/classes DID help to get rid 
of the cas.log error.

Now how do I get rid of the catalina.out error? It still says inputstream is 
null.

PS: My spring config now looks like:
 <value>/WEB-INF/classes/my.properties< /value>




--- On Tue, 2012/9/18,
 Guy Thomas <[email protected]> wrote:

/WEB-INF/my.properties is not on your classpath. Put it for example under 
/WEB-INF/classes

Op dinsdag 18 september 2012 13:42:45 UTC+2 schreef (onbekend) het volgende:I 
am trying to read a properties file ("my.properties"), which I put right under 
/WEB-INF when I created an eclipse project.

I told Spring where the file is like this:
<bean id=" propertyPlaceholderConfigurer" class="xx..
       <property name="locations">
       
     <list>
                <value>/WEB-INF/my.properties< /value>
            </list>
        </property>
</bean>

I created a war file, and deployed under /webapps.

Inside some class, which is an ordinary java class (not a servlet), I wanted to 
read that "my.properties" file like
 this:
InputStream inputStream =
 this.getClass(). getClassLoader(). getResourceAsStream("WEB-INF/ 
my.properties");  

When I "System.out" inputStream, it is null.

cas.log has this error:
org.springframework.beans. factory. BeanInitializationException: Could not load 
properties; nested exception is java.io.FileNotFoundException: Could not open 
ServletContext resource [/my.properties]

I spent a day googling, but could not make it work-- that's why I am here.

What's happening? Can someone give me some pointers?

Thanks!




-- 
You are currently subscribed to [email protected] as: jasig-cas-user...@ 
googlegroups.com
To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/ display/JSG/cas-user
-- 
You are currently subscribed to [email protected] as: [email protected]
To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/cas-user
-- 
You are currently subscribed to [email protected] as: [email protected]
To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/cas-user
-- 
You are currently subscribed to [email protected] as: 
[email protected]
To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/cas-user

Reply via email to