jakarta-jcs-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Smuts <asm...@yahoo.com>
Subject Re: Simple JCS program
Date Tue, 05 Jul 2005 14:04:52 GMT
Yes.  You can't use JCS without a configuration file.
It should fail more gracefully, but that's a minor
concern.

There are configuration file examples in the
documentation on the web site.  There are many other
configuration file examples in the src/conf directory
in the cvs repository.

Aaron

--- saipradeep.v@tcs.com wrote:

> 
> Hi,
> 
> I am enclosing a simple JCS program with this mail.
> I am not able to run 
> it successfully. I am getting an exception, which i
> couldnt solve. please 
> do help.
> 
> Cheers
> Saipradeep
> 
> PS: I haven't configured any cache file in the form
> of cache.ccf. If it 
> has to be configured, please send a minimal config
> file which can work for 
> this program.
> 
> 
> TestViewCache.java
> 
> public class TestViewCache {
>  
>         public static void main(String args[])
>         {
>                 Long vcid = new Long(4);
>                 List compdata = null;
>                 JCS instance = null;
>                 try {
>                         instance =
> JCS.getInstance("modelcache");
>                 } catch (CacheException e) {
>                         // TODO Auto-generated catch
> block
>                         e.printStackTrace();
>                 }
>                 String cachekey="userid"+4;
>                 compdata.add("My Activities "+"1 
> "+"com.bofa.crme.grp.som.cdb.Activity");
>                 try {
>                        
> instance.put(cachekey,compdata);
>                 } catch (CacheException e1) {
>                         // TODO Auto-generated catch
> block
>                         e1.printStackTrace();
>                 }
>         }
> 
> 
> Exception
> 
> 
> log4j:WARN No appenders could be found for logger 
>
(org.apache.jcs.engine.control.CompositeCacheManager).
> log4j:WARN Please initialize the log4j system
> properly.
> java.lang.NullPointerException
>         at
>
java.util.StringTokenizer.<init>(StringTokenizer.java:146)
>         at
>
java.util.StringTokenizer.<init>(StringTokenizer.java:162)
>         at 
>
org.apache.jcs.engine.control.CompositeCacheConfigurator.parseRegion(CompositeCacheConfigurator.java:227)
>         at 
>
org.apache.jcs.engine.control.CompositeCacheConfigurator.parseRegion(CompositeCacheConfigurator.java:201)
>         at 
>
org.apache.jcs.engine.control.CompositeCacheManager.getCache(CompositeCacheManager.java:303)
>         at 
>
org.apache.jcs.engine.control.CompositeCacheManager.getCache(CompositeCacheManager.java:266)
>         at 
>
org.apache.jcs.engine.control.CompositeCacheManager.getCache(CompositeCacheManager.java:259)
>         at
> org.apache.jcs.JCS.getInstance(JCS.java:66)
>         at TestViewCache.main(TestViewCache.java:27)
> Exception in thread "main" 
> 
> 
> Notice: The information contained in this e-mail
> message and/or attachments to it may contain
> confidential or privileged information.   If you are
> not the intended recipient, any dissemination, use,
> review, distribution, printing or copying of the
> information contained in this e-mail message and/or
> attachments to it are strictly prohibited.   If you
> have received this communication in error, please
> notify us by reply e-mail or telephone and
> immediately and permanently delete the message and
> any attachments.  Thank you


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


Mime
View raw message