-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: JCS.getInstance() throws NullpointerException in Websphere
PostPosted: Tue Dec 23, 2003 3:27 am 
Hi,
We are using hibernate in our application. When we call configuration.buildSessionFactory(), internally , the hibernate apis create an instance of JCS. I am getting an NullPointerException here.

Error:

caused by java.lang.NullPointerException
at org.apache.jcs.config.OptionConverter.findAndSubst(OptionConverter.java:298)
at org.apache.jcs.config.OptionConverter.instantiateByKey(OptionConverter.java:186)
at org.apache.jcs.engine.control.CompositeCacheConfigurator.parseElementAttributes(CompositeCacheConfigurator.java:371)
at org.apache.jcs.engine.control.CompositeCacheConfigurator.parseRegion(CompositeCacheConfigurator.java:261)
at org.apache.jcs.engine.control.CompositeCacheConfigurator.parseRegion(CompositeCacheConfigurator.java:243)
at org.apache.jcs.engine.control.CompositeCacheManager.getCache(CompositeCacheManager.java:356)
at org.apache.jcs.engine.control.CompositeCacheManager.getCache(CompositeCacheManager.java:315)
at org.apache.jcs.engine.control.CompositeCacheManager.getCache(CompositeCacheManager.java:308)
at org.apache.jcs.JCS.getInstance(JCS.java:103)
at net.sf.hibernate.cache.JCSCache.<init>(JCSCache.java:22)
at net.sf.hibernate.cache.JCSCacheProvider.buildCache(JCSCacheProvider.java:14)
at net.sf.hibernate.cfg.Configuration.configureCaches(Configuration.java:1013)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:717)

----------

I tried creating an instance of JCS outside my application by using a simple jsp(JCSTest.jsp).
<b>code:</b>
org.apache.jcs.JCS region = org.apache.jcs.JCS.getInstance("com.docent.lms.entities.reference.ReferenceAudience_T");
out.println(region);

Even in this case, I am getting NullPointerException.

<b>Error</b>
java.lang.NullPointerException
at org.apache.jcs.config.OptionConverter.findAndSubst(OptionConverter.java:298)
at org.apache.jcs.config.OptionConverter.instantiateByKey(OptionConverter.java:186)
at org.apache.jcs.engine.control.CompositeCacheConfigurator.parseElementAttributes(CompositeCacheConfigurator.java:371)
at org.apache.jcs.engine.control.CompositeCacheConfigurator.parseRegion(CompositeCacheConfigurator.java:261)
at org.apache.jcs.engine.control.CompositeCacheConfigurator.parseRegion(CompositeCacheConfigurator.java:243)
at org.apache.jcs.engine.control.CompositeCacheManager.getCache(CompositeCacheManager.java:356)
at org.apache.jcs.engine.control.CompositeCacheManager.getCache(CompositeCacheManager.java:315)
at org.apache.jcs.engine.control.CompositeCacheManager.getCache(CompositeCacheManager.java:308)
at org.apache.jcs.JCS.getInstance(JCS.java:103)
at org.apache.jsp._JCSTest._jspService(_JCSTest.java:70)


What could be the problem here?. Is websphere appserver not supporting the JCS .

The above simple jsp works fine when I tried in Weblogic and JBoss app servers.


Top
  
 
 Post subject:
PostPosted: Thu Jan 08, 2004 8:37 pm 
Newbie

Joined: Tue Oct 21, 2003 1:25 pm
Posts: 14
Location: Los Angeles, CA
That is definately a problem with your cache.ccf either not being loaded (is it somewhere in your classpath?) or being of an invalid (read unparsable) format.

Double check your cache.ccf against their example once... specifically look for spaces in the lines (for the most part a configuration line should have no spaces) and things like that.

Hope this helps!

-Travis Savo <tsavo@ifilm.com>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.