[Opensymphony-oscache] Can't instantiate Cache in a wrapper
Tarik <[email protected]> Fri, 15 Jul 2005 17:58:19 CDT
| Newsgroups | gmane.comp.java.open-symphony.os-cache |
|---|---|
| Message-ID | <17889062.1121468950755.JavaMail.os-j2ee@opensymphony01.contegix.com> |
I have a problem instantiating Cache Admin in a Singleton Wrapper class.
What is odd is that there is no Exception being thrown
If I just take a code and place it in lets say Action class method it works like a charm.
// singleton wrapper OSCache
private static OSCache instance = null;
private GeneralCacheAdministrator admin = null;
public static Properties cacheProps = null;
[i][u]private static void loadCacheProperties()[/u][/i]
{
try
{
cacheProps = new Properties();
cacheProps.load(OSCache.class.getClassLoader().getResourceAsStream("oscache.properties"));
}
catch(Exception ex)
{
// error handling
}
}
[i][u]public static ICacheManager getInstance()[/u][/i] {
if (instance == null) {
instance = new OSCache();
}
return instance;
}
[i][u]private OSCache()[/u][/i] {
try{
// load cache properties
loadCacheProperties();
[b]// next line is where it fails[/b]admin = new GeneralCacheAdministrator(cacheProperty);
}
catch(Exception e){
[b]// but it never gets here[/b]
}
}
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=4380&messageID=10754#10754