Replicated cache scheme with cache store

Hi All,
I am having following configuration for the UserCacheDB in the coherence-cache-config.xml
I having cachestore class which inserts data in the database and this data will be loaded from data on application start up.
I need to make this cache replicated so that the other application will have this data. Can any one please guide me what should be my configuration which will make this cache replicated with cache store class.
<distributed-scheme>
               <scheme-name>UserCacheDB</scheme-name>
               <service-name>DistributedCache</service-name>
               <serializer>
                    <class-name>com.tangosol.io.pof.ConfigurablePofContext</class-name>
                    <init-params>
                         <init-param>
                              <param-type>String</param-type>
                              <param-value>pof-config.xml</param-value>
                         </init-param>
                    </init-params>
               </serializer>
               <backing-map-scheme>
                    <read-write-backing-map-scheme>
                         <internal-cache-scheme>
                              <class-scheme>
                                   <class-name>com.tangosol.util.ObservableHashMap</class-name>
                              </class-scheme>
                         </internal-cache-scheme>
                         <cachestore-scheme>
                              <class-scheme>
                                   <class-name>test.UserCacheStore</class-name>
                                   <init-params>
                                        <init-param>
                                             <param-type>java.lang.String</param-type>
                                             <param-value>PC_USER</param-value>
                                        </init-param>
                                   </init-params>
                              </class-scheme>
                         </cachestore-scheme>
                         <read-only>false</read-only>
                         <!--
                              To make this a write-through cache just change the value below to
                              0 (zero)
                         -->
                         <write-delay-seconds>0</write-delay-seconds>
                    </read-write-backing-map-scheme>
               </backing-map-scheme>
               <listener />
               <autostart>true</autostart>
          </distributed-scheme>
Thanks in Advance.

Hi,
You should be able to use a cachestore with a local-scheme.
      <replicated-scheme>
        <scheme-name>UserCacheDB</scheme-name>
        <service-name>ReplicatedCache</service-name>
        <serializer>
          <class-name>com.tangosol.io.pof.ConfigurablePofContext</class-name>
          <init-params>
            <init-param>
              <param-type>String</param-type>
              <param-value>coherence-pof-config.xml</param-value>
            </init-param>
          </init-params>
        </serializer>
        <backing-map-scheme>
          <local-scheme>
            <scheme-name>UserCacheDBLocal</scheme-name>
            <cachestore-scheme>
              <class-scheme>
                <class-name>test.UserCacheStore</class-name>
                <init-params>
                  <init-param>
                    <param-type>java.lang.String</param-type>
                    <param-value>PC_USER</param-value>
                  </init-param>
                </init-params>
              </class-scheme>
            </cachestore-scheme>
          </local-scheme>
        </backing-map-scheme>
        <listener/>
        <autostart>true</autostart>
      </replicated-scheme>

Similar Messages

  • Replicated cache with cache store configuration

    Hi All,
    I am having two different applications. One is Admin kind of module from where data will be insterted/updated and another application will read data from Coherence cache.
    My requirement is to use Replicated cache and data also needs to be stored in the database. I am configuring cache with cache store DB operation.
    I have following coherence configuration. It works fine. Other application is able to read updated data. But while second application is trying to join the first application coherence cluster I am getting following exception in cache store. If I use distributed cache the same cache store works fine without any issues.
    Also note that eventhough it is throwing exception, application is working fine as expected. Other thing I am pre loading data on application start up in first application.
    Let me know if you need any further information.
    Thanks in advance.
    coherence-cache-config.xml
    <?xml version="1.0"?>
    <!DOCTYPE cache-config SYSTEM "cache-config.dtd">
    <cache-config>
    <caching-scheme-mapping>
    <cache-mapping>
    <cache-mapping>
    <cache-name>TestCache</cache-name>
    <scheme-name>TestCacheDB</scheme-name>
    </cache-mapping>
    </caching-scheme-mapping>
    <caching-schemes>
    <replicated-scheme>
    <scheme-name>TestCacheDB</scheme-name>
    <service-name>ReplicatedCache</service-name>
    <backing-map-scheme>
    <local-scheme>
    <scheme-name>TestDBLocal</scheme-name>
    <cachestore-scheme>
    <class-scheme>
    <class-name>test.TestCacheStore</class-name>
    <init-params>
    <init-param>
    <param-type>java.lang.String</param-type>
    <param-value>TEST_SUPPORT</param-value>
    </init-param>
    </init-params>
    </class-scheme>
    </cachestore-scheme>
    </local-scheme>
    </backing-map-scheme>
    <listener/>
    <autostart>true</autostart>
    </replicated-scheme>
    <!--
    Proxy Service scheme that allows remote clients to connect to the
    cluster over TCP/IP.
    -->
    <proxy-scheme>
    <scheme-name>proxy</scheme-name>
    <service-name>ProxyService</service-name>
    <thread-count system-property="tangosol.coherence.extend.threads">10</thread-count>
    <acceptor-config>
    <tcp-acceptor>
    <local-address>
    <address system-property="tangosol.coherence.extend.address">localhost</address>
    <port system-property="tangosol.coherence.extend.port">7001</port>
    <reusable>true</reusable>
    </local-address>
    </tcp-acceptor>
    <serializer>
    <class-name>com.tangosol.io.pof.ConfigurablePofContext</class-name>
    <init-params>
    <init-param>
    <param-type>String</param-type>
    <param-value>pof-config.xml</param-value>
    </init-param>
    </init-params>
    </serializer>
    </acceptor-config>
    <autostart system-property="tangosol.coherence.extend.enabled">false</autostart> </proxy-scheme>
    </caching-schemes>
    </cache-config>
    Exception:
    2010-08-31 10:46:09.062/171.859 Oracle Coherence GE 3.5.2/463 <Error> (thread=ReplicatedCache, member=2): java.lang.Clas
    sCastException: com.tangosol.util.Binary cannot be cast to test.TestBean
    at test.TestCacheStore.store(TestCacheStore.java:137)
    at com.tangosol.net.cache.LocalCache$InternalListener.onModify(LocalCache.java:637)
    at com.tangosol.net.cache.LocalCache$InternalListener.entryInserted(LocalCache.java:599)
    at com.tangosol.util.MapEvent.dispatch(MapEvent.java:206)
    at com.tangosol.util.MapEvent.dispatch(MapEvent.java:166)
    at com.tangosol.util.MapListenerSupport.fireEvent(MapListenerSupport.java:556)
    at com.tangosol.net.cache.OldCache.dispatchEvent(OldCache.java:1916)
    at com.tangosol.net.cache.OldCache$Entry.onAdd(OldCache.java:1985)
    at com.tangosol.util.SafeHashMap.put(SafeHashMap.java:244)
    at com.tangosol.net.cache.OldCache.put(OldCache.java:266)
    at com.tangosol.coherence.component.util.CacheHandler.onLeaseUpdate(CacheHandler.CDB:42)
    at com.tangosol.coherence.component.util.CacheHandler.populateCache(CacheHandler.CDB:33)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.ReplicatedCache$CacheUpdate.onReceiv
    ed(ReplicatedCache.CDB:5)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onMessage(Grid.CDB:9)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onNotify(Grid.CDB:136)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.ReplicatedCache.onNotify(ReplicatedC
    ache.CDB:3)
    at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
    at java.lang.Thread.run(Thread.java:619)
    2010-08-31 10:46:09.203/216.735 Oracle Coherence GE 3.5.2/463 <D5> (thread=DistributedCache, member=2): Deferring the di
    stribution due to 128 pending configuration updates
    TestBean.java
    public class TestBean implements PortableObject, Serializable {
         private static final long serialVersionUID = 1L;
         private String name;
         private String number;
         private String taskType;
         public String getName() {
              return name;
         public void setName(String name) {
              this.name = name;
         public String getNumber() {
              return productId;
         public void setNumber(String number) {
              this.number= number;
         public String getTaskType() {
              return taskType;
         public void setTaskType(String taskType) {
              this.taskType = taskType;
         @Override
         public void readExternal(PofReader reader) throws IOException {
              name = reader.readString(0);
              number = reader.readString(1);
              taskType = reader.readString(2);
         @Override
         public void writeExternal(PofWriter writer) throws IOException {
              writer.writeString(0, name);
              writer.writeString(1, number);
              writer.writeString(2, taskType);
    TestCacheStore.java
    public class TestCacheStore extends Base implements CacheStore {
         @Override
         public void store(Object oKey, Object oValue) {
         if(logger.isInfoEnabled())
              logger.info("store :"+oKey);
         TestBean testBean = (TestBean)oValue; //Giving classcast exception here
    //Doing some processing here over testBean
              ConnectionFactory connectionFactory = ConnectionFactory.getInstance();
              //Get the Connection
              Connection con = connectionFactory.getConnection();
              if(con != null){
    //Code to insert into the database
              }else{
                   logger.error("Connection is NULL");
    Edited by: user8279242 on Aug 30, 2010 11:44 PM

    Hello,
    The problem is that replicated caches are not supported with read write backing maps.
    Please refer to the link below for more information.
    http://download.oracle.com/docs/cd/E15357_01/coh.360/e15723/cache_rtwtwbra.htm#CFHEJHCI
    Best regards,
    -Dave

  • Storage disabled nodes and near-cache scheme

    This probably is a newbie question. I have a named cache with a near cache scheme, with a local-scheme as the front tier. I can see how this will work in a cache-server node. But I have a application node which pushes a lot of data into the same named cache, but it is set to be storage disabled.
    My understanding of a local cache scheme is that data is cached locally in the heap for faster access and the writes are delegated to the service for writing to backing map. If my application is storage disabled, is the local cache still used or is all data obtained from the cache-servers?

    Hello,
    You understanding is correct. To answer your question writes will always go through the cache servers. A put will also always go through the cache servers but the near cache may or may not be populated at that point.
    hth,
    -Dave

  • Need Clarification on using cache along with JPA

    Hi,
    I am using Oracle Coherence 3.5 and Jdeveloper 11g.
    I have written a sample program which implements CacheStore which performs the following operations:
    Insert, Update, Delete
    Configured cache-config.xml file in whcih the element cachestore-scheme is used to invoke the corressponding class and the table name.
    When I tried to run the cache using the JPA-Cache-server.bat I got the values accordingly. But each and every time the data is fetched from Database. I am using distributed-scheme in the configuration file. How do I configure the file such that for the first time the values comes form DB and then next time I get values from cache.
    I used the same cache name in another program and tried to retrieve the values from cache but i got only null values:(
    I will be very thank full to you if any one helps me on this.
    Waiting for ur response..
    Thanks,
    Jagadeesh

    I did not change any data in DB. I tried changing data in DB and then tested I got the updated content.
    Below is my configuration file.
    <cache-config>
    <caching-scheme-mapping>
    <cache-mapping>
    <cache-name>Sample*</cache-name>
    <scheme-name>distributed-db-backed</scheme-name>
    </cache-mapping>
    </caching-scheme-mapping>
    <caching-schemes>
    <distributed-scheme>
    <scheme-name>distributed-db-backed</scheme-name>
    <service-name>DistributedCache</service-name>
    <backing-map-scheme>
    <read-write-backing-map-scheme>
    <internal-cache-scheme>
    <class-scheme>
    <class-name>com.tangosol.util.ObservableHashMap</class-name>
    </class-scheme>
    </internal-cache-scheme>
    <cachestore-scheme>
    <class-scheme>
    <class-name>com.oracle.coherence.handson.cachest</class-name> <!-- Class where Cache store is implemented-->
    <init-params>
    <init-param>
    <param-type>java.lang.String</param-type>
    <param-value>filest</param-value> <!-- Table name-->
    </init-param>
    </init-params>
    </class-scheme>
    </cachestore-scheme>
    <read-only>false</read-only>
    <!--
    To make this a write-through cache just change the value below to 0 (zero)
    -->
    <write-delay-seconds>0</write-delay-seconds>
    </read-write-backing-map-scheme>
    </backing-map-scheme>
    <listener/>
    <partition-count>100M</partition-count>
    <autostart>true</autostart>
    </distributed-scheme>
    </caching-schemes>
    </cache-config>
    Thanks,
    Jagadeesh

  • How to specify index for cache in coherence-cache-config.xml

    Hi All,
    We want to apply indexing on cache data.
    Suppose i have a EMPLOYEE object in coherence cache.
    and i want to use employeeID for indexing purpose.
    Can anybody help me to achieve this at Congregational level i.e. using xml file (coherence-cache-config.xml) .
    Edited by: 981644 on Jan 16, 2013 1:51 AM

    Hi,
    I've posted some [url http://coherence.oracle.com/download/attachments/14647422/add-index-namespace.jar]code and the [url http://coherence.oracle.com/download/attachments/14647422/add-index-namespace-src.jar]source. It depends on coherence common version 2.3.0.39174 however I believe it will work with 2.0.0.23649 also. Coherence common library can be downloaded from [url http://coherence.oracle.com/display/INC10/coherence-common]here
    Note: This is purely an example on how to achieve index creation via a cache configuration file and is not a part of the product thus is not covered by product support.
    Here is an example cache configuration that uses the namespace:
    <cache-config xmlns:service="class://com.oracle.coherence.environment.extensible.ServiceOperations">
        <caching-scheme-mapping>
            <service:index-add cache-name="dist-indexes">
                <extractor>
                    <class-name>ReflectionExtractor</class-name>
                    <init-params>
                        <init-param>
                            <param-type>string</param-type>
                            <param-value>getName</param-value>
                        </init-param>
                    </init-params>
                </extractor>
            </service:index-add>
            <!-- Simplified POF Config -->
            <service:index-add cache-name="dist-indexes" pof-enabled="true">
                <pof-index>8,16,32</pof-index>
            </service:index-add>
            <!-- This should not be counted based on system-property override -->
            <service:index-add cache-name="dist-indexes" pof-enabled="true" enabled="{tangosol.index.add}">
                <pof-index>8,16,31</pof-index>
            </service:index-add>
            <!-- Explicit POF Config -->
            <service:index-add cache-name="dist-indexes">
                <extractor>
                    <class-name>PofExtractor</class-name>
                    <init-params>
                        <init-param>
                            <param-type>{class}</param-type>
                            <param-value>null</param-value>
                        </init-param>
                        <init-param>
                            <param-type>{object}</param-type>
                            <param-value>
                                <class-name>com.tangosol.io.pof.reflect.SimplePofPath</class-name>
                                <init-params>
                                    <init-param>
                                        <param-type>{int[]}</param-type>
                                        <param-value>1,2,4</param-value>
                                    </init-param>
                                </init-params>                     
                            </param-value>
                        </init-param>
                    </init-params>
                </extractor>
            </service:index-add>
        </caching-scheme-mapping>
    </cache-config>Thanks,
    Harvey

  • Remote distributed scheme with custom serializer does not work

    HI,
    I have a remote scheme invoked through TcpExtend which is distributed-scheme. Now if I have a custom serializer attached the first node in the cluster comes up without a problem but not the second one onwards. It gives the following exception...
    2010-11-01 18:17:27.302/21.532 Oracle Coherence EE 3.6.0.1 <Error> (thread=Distr
    ibutedCache:extend-service, member=2): The service "extend-service" is configure
    d to use serializer <our package>.JavaSerialisation@562
    78964, which appears to be different from the serializer used by Member(Id=1, Ti
    mestamp=2010-11-01 18:14:35.066, Address=192.168.113.56:8088, MachineId=6456, Lo
    cation=site:oursite.corp,machine:mg-ldn-d0002,process:540, Role=Exe4jRuntimeWi
    nLauncher).
    java.io.IOException: invalid type: 119
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.g
    rid.PartitionedService$PartitionConfig.readObject(PartitionedService.CDB:25)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.g
    rid.PartitionedService$MemberWelcome.read(PartitionedService.CDB:20)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.G
    rid.deserializeMessage(Grid.CDB:42)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.G
    rid.onNotify(Grid.CDB:31)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.g
    rid.PartitionedService.onNotify(PartitionedService.CDB:3)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.g
    rid.partitionedService.PartitionedCache.onNotify(PartitionedCache.CDB:3)
    at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
    at java.lang.Thread.run(Thread.java:619)
    Stopping the extend-service service.
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.G
    rid.start(Grid.CDB:6)2010-11-01 18:17:27.302/21.532 Oracle Coherence EE 3.6.0.1
    <D5> (thread=DistributedCache:extend-service, member=2): Service extend-service
    left the cluster

    Config file contents follow...
    The server config - <cache-config>
    <caching-scheme-mapping>
    <cache-mapping>
    <cache-name>client-request-cache</cache-name>
    <scheme-name>extend-scheme</scheme-name>
    </cache-mapping>
    </caching-scheme-mapping>
    <caching-schemes>
    <proxy-scheme>
    <service-name>ExtendTcpProxyService</service-name>
    <acceptor-config>
    <tcp-acceptor>
    <local-address>
              <address>localhost</address>
              <port>9098</port>
    </local-address>
    </tcp-acceptor>
    <serializer>
    <class-name>test.JavaSerialisation</class-name>
    </serializer>
    </acceptor-config>
    </proxy-scheme>
    <distributed-scheme>
    <scheme-name>extend-scheme</scheme-name>
    <service-name>extend-service</service-name>
    <serializer>
    <class-name>test.JavaSerialisation</class-name>
    </serializer>
    <backing-map-scheme>
    <local-scheme/>
    </backing-map-scheme>
    <autostart>false</autostart>
    </distributed-scheme>
    </caching-schemes>
    </cache-config>
    Client - config is as follows
    <cache-config>
    <caching-scheme-mapping>
    <cache-mapping>
    <cache-name>client-request-cache</cache-name>
    <scheme-name>client-extend-scheme</scheme-name>
    </cache-mapping>
    </caching-scheme-mapping>
    <caching-schemes>
    <remote-cache-scheme>
    <scheme-name>client-extend-scheme</scheme-name>
    <service-name>ExtendTcpCacheService</service-name>
    <initiator-config>
    <tcp-initiator>
    <remote-addresses>
    <socket-address>
                   <address>localhost</address>
                   <port>9099</port>
              </socket-address>
    </remote-addresses>
                   <connect-timeout>5s</connect-timeout>
    </tcp-initiator>
    <outgoing-message-handler>
    <!-- If server has not responded by 100s, then will time out -->
    <request-timeout>100s</request-timeout>
    </outgoing-message-handler>
    <serializer>
    <instance>
    <class-name>test.JavaSerialisation</class-name>
    </instance>
    </serializer>
    </initiator-config>
    </remote-cache-scheme>
    </caching-schemes>
    </cache-config>
    Edited by: 807718 on 08-Nov-2010 10:14
    Edited by: 807718 on 08-Nov-2010 10:15

  • Replicated vs optimistic cache schem

    Hi,
    I have two questions:
    First one.
    In replicated cache, a single put operation, first accures cluster wide lock on cache entry, then performs put, then release lock/replicate entry over the cluster - at least 2 network round trips. (correct me if I wrong please)
    In optimistic cache, put performed in local replica, then entry is replicated over the cluster. Is replication done synchroniously (put does not return until all replicas confirm change) or asynchronious?
    Second one.
    How EntryProcessor is executed on optimistic cache. Does it run locally, then changes are broadcasted to other replicas or EntryProcessor itself is broadcasted and executed on every replica? (does not sounds realistic, but I want to be sure)
    Thank you

    Hi,
    In replicated cache, a single put operation, first accures cluster wide lock on cache entry, then performs put, then release lock/replicate entry over the cluster - at least 2 network round trips. (correct me if I wrong please)I think a better way to think about how Coherence implements the replicated cache is like a partitioned cache that is backed up on all the nodes running the specified service. Assuming the put() is performed on a member that does not own the object, a message is sent to the owning member with the update. The owning member distributes the update to the remaining members and sends a message back to the originating member. Note: There are no locks required because there is always only one owner of an object in the cluster.
    In optimistic cache, put performed in local replica, then entry is replicated over the cluster. Is replication done synchroniously (put does not return until all replicas confirm change) or asynchronious?Coherence implements the optimistic cache very much like the replicated cache. The put behaves the same, i.e., the put does not return until the replicas have confirmed the change. Note: The replication is performed asynchronously. (The updates are sent to the members and their acknowledgements are reaped as they complete.) The difference between optimistic cache and the replicated cache is that the optimistic cache does not support concurrency control. This means that you can not use the explicit locking provided by the ConcurrentMap interface. In a replicated cache, puts() are blocked on keys that are locked but they are not blocked in a partitioned cache.
    How EntryProcessor is executed on optimistic cache. Does it run locally, then changes are broadcasted to other replicas or EntryProcessor itself is broadcasted and executed on every replica? (does not sounds realistic, but I want to be sure)In an optimistic cache (as with the replicated cache), the execution of an EntryProcessor will occur on the initiating member.
    Ragards,
    Harv

  • Directory Caching issue with Cisco Jabber client for Windows

    Hi ,
    I am facing cache issue with Cisco Jabber client for Windows. If I do any change related to modification or deletion of contacts in Active Directory/ Callmanager, it does not reflect in the Jabber. Because jabber takes the contacts from the locally stored cache file in the Windows system.
    Every time I have to remove the cache file to overcome this issue, practically it's not possible to do the same with all the Widows users. As, if any employee leaves the company and still I can see his contact appears in the "Cisco Jabber client". I have not seen this issue with Android/Apple iOS.
    Is there any automated way to remove the cache file? 
    Here is the detail of CUCM,Presence and Jabber.
    CUCM version: 9.1.x
    Presence          : 9.1.X
    Jabber              : 10.5 and 10.6

    Hello
    On our environment we had to install a dedicated Microsoft Certificate Authority "just for Cisco Jabber usage" to house the
    Network Device Enrollment Service.
    Our certificate for the CUPS were generated on this Certification Authority too.
    I discussed this certificate matter with my colleagues this afternoon and nobody seems to remember how these certificates were deployed into the
    Enterprise Trust store for the users.
    But I think they asked all 400 users to accept the 3 certificates by answering "yes" to the popup instead of using a script deployed by GPO...
    I wish you success with that deployment and really hope you have a technical partner that *Knows* this subject.
    Our partner left us alone with that unfortunately.
    Florent
    EDIT: If the "Certutil script method" works, please let me know. This could be useful in our own deployment.

  • Wildcards in caching-scheme-mapping

    Hi,
    I am trying to use this mapping:
    <cache-mapping>
    <cache-name>*CR</cache-name>
    <scheme-name>bitemporal-dist-CR</scheme-name>
    </cache-mapping>
    however, coherence can not find the scheme. If I put '*' at the end of the pattern it works, but i wonder whether the wildcard should work in the middle/beginning of a string as well. It would simplify our naming convention for disaster recovery cache names because we append them with '-CR' string.

    Hi Roman,
    According to the documentation the following cache name patterns are supported:
    * exact match, i.e. "MyCache"
    * prefix match, i.e. "My*" that matches to any cache name starting with "My"
    * any match "*", that matches to any cache name
    So it won't work at the beginning or in the middle.
    Best regards,
    Robert

  • Caching data with Entity Bean

    Hello,
    I am performing some tests concerning the benefit of caching data with Entity Bean.
    Here is the case :
    I have an Entity Bean with a business method getName() to retrieve a name field in the EJB.
    I understand that in order to cach data, I have to set the NOT_SUPPORTED transaction attr for this method. In this way, when this method is called, the ejbReload() is not called and the data is retreived from the EJB ready instance (and not from the database).
    Is it true and is it the good way to use the cach mechanism ?
    Now if we consider that this instance is the only one in the ready stage, and it is never pooled (it seems so !), what about a modification of the database from a tier (or from an other EB instance)? The Entity Bean is not able to see this modification seence it does not call the ejbLoad method.
    Is there a way to force an Entity Bean to be periodically polled in order to recover data from the data store when activated ?
    Thanks in advance,
    Thierry

    No, This is wrong way of doing what you want. Most of the application servers provide various configuration settings for this. Eg. caching mechanism, interval on when to call ejbLoad and ejbStore, read only beans. You have to check the documentation for this.
    --Ashwani

  • Sunone 7 bug with cache helper

    hi,
    I upgrade the server sun one 6.1 to 7 in a sparc solaris 9 cluster few days ago and we had problems running our web application servelts and jsp.
    We got errors connected with the cache helper we desable it in the web-sun.xml file because it did problems before :
    <cache enabled="false"></cache>
    in the server 6.1 the cache was desable and everything work ok. I must remark our web application are in a storage conected to the server by nfs. The server instances is local disk installed in each server. Then the cache is in a local disk, only the servlets and jsp are in the storage engine.
    The sun one 7 ignores the cache def. in the web-sun.xml file and it tries to work with cache causing errors in our application:
    [15/Jan/2008:09:02:23] failure (24363): for host lib-353-1.law.huji.ac.il trying to POST /dataj/controller/students/, service-j2ee reports: ApplicationDispatcher[dataj] PWC1231: Servlet.service() for servlet default threw exc
    eption
    javax.servlet.ServletException: WEB8002: HTTP status code 500
    at com.sun.webserver.connector.nsapi.NSAPIConnector.include(NSAPIConnector.java:540)
    at com.sun.webserver.connector.nsapi.NSAPIConnector.dispatch(NSAPIConnector.java:469)
    at com.sun.webserver.servlets.DefaultServlet.service(DefaultServlet.java:101)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:917)
    at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:398)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:792)
    at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:630)
    at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:548)
    at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:984)
    at org.apache.jsp.template_jsp._jspService(Unknown Source)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:80)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:917)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:464)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:358)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:917)
    at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:398)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:792)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:472)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:353)
    at com.huji.data.system.RegularDataSystem.gotoSystemPage(RegularDataSystem.java:347)
    at com.huji.data.controller.processRequest(controller.java:274)
    at com.huji.data.controller.doPost(controller.java:71)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:816)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:917)
    at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:398)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:185)
    at com.huji.data.ControllerFilter.doFilter(ControllerFilter.java:65)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:217)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:185)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
    at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:255)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:556)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:187)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:556)
    at com.sun.webserver.connector.nsapi.NSAPIProcessor.service(NSAPIProcessor.java:160)
    what can we do to avoid this problems ? there is a bug in the sun one 7 we can't desable the cache feature for web applications if we don't wnat it.
    thanks!

    The details about this bug we find here:
    http://docsun.cites.uiuc.edu/sun_docs/C/solaris_9/SUNWadoc/SUNONEAPPSVRERROR/logweb.html#1011284
    the problems exists also in sunone 6.1 sp5 under solaris 9 but we desable the cache and everthing work find. But it's a big bug that the caching cause such problem, i didn't see this problems in our linux/apache/tomcat platforms. We use sunone only in our sparc/solaris machines due to special circunstaces in some applications that they don't work well with apache.
    Details about server:
    SunOS www 5.9 Generic_117171-15 sun4u sparc SUNW,Sun-Fire-V210
    obj.conf
    <Object name="default">
    AuthTrans fn="match-browser" browser="*MSIE*" ssl-unclean-shutdown="true"
    NameTrans fn="assign-name" name="stats-xml" from="(/stats-xml|/stats-xml/*)"
    NameTrans fn="ntrans-j2ee" name="j2ee"
    PathCheck fn="uri-clean"
    PathCheck fn="check-acl" acl="default"
    PathCheck fn="find-pathinfo"
    PathCheck fn="find-index-j2ee"
    PathCheck fn="find-index" index-names="index.html,home.html,index.htm,.index.html,.index.htm"
    PathCheck fn="set-cache-control" control="no-store"
    ObjectType fn="type-j2ee"
    ObjectType fn="type-by-extension"
    ObjectType fn="force-type" type="text/plain"
    ObjectType fn="shtml-hacktype"
    Service type="magnus-internal/jsp" fn="service-j2ee"
    Service fn="shtml_send" type="magnus-internal/parsed-html" method="(GET|HEAD)" opts="noexec"
    Error fn="error-j2ee"
    AddLog fn="flex-log"
    </Object>
    <Object name="x-httpd-php">
    ObjectType fn="force-type" type="magnus-internal/x-httpd-php"
    Service fn="php4_execute"
    </Object>
    <Object name="cgi">
    ObjectType fn="force-type" type="magnus-internal/cgi"
    Service fn="send-cgi" user="$user" group="$group" dir="$dir" chroot="$chroot" nice="$nice"
    </Object>
    <Object name="j2ee">
    ObjectType fn="force-type" type="text/html"
    Service fn="service-j2ee"
    </Object>
    <Object name="es-internal">
    PathCheck fn="check-acl" acl="es-internal"
    </Object>
    <Object name="stats-xml">
    Service fn="stats-xml"
    </Object>
    server.xml
    <file-cache>
    <max-age>120</max-age>
    <max-entries>1024</max-entries>
    <sendfile>true</sendfile>
    <max-heap-file-size>2048</max-heap-file-size>
    <max-heap-space>1048576</max-heap-space>
    <max-mmap-file-size>537600</max-mmap-file-size>
    <max-mmap-space>10485760</max-mmap-space>
    </file-cache>
    <web-app>
    <uri>/dataj</uri>
    <path>/fs/www/w2w7/dataj</path>
    <description>The java based data</description>
    </web-app>
    <jvm>
    <java-home>/home/SunOne7/jdk</java-home>
    <debug>false</debug>
    <server-class-path>/home/SunOne7/lib/webserv-rt.jar:/home/SunOne7/lib/pwc.jar:${java.home}/lib/tools.jar:/home/SunOne7/lib/webserv-jstl.jar:/home/SunOne7/lib/container-auth.jar:/home/SunOne7/lib/jsf-impl.jar:/home/SunOne7/lib/jsf-api.jar:/home/SunOne7/lib/webserv-jwsdp.jar:/home/SunOne7/lib/ktsearch.jar:/home/SunOne7/lib/mail.jar:/home/SunOne7/lib/activation.jar:/home/SunOne7/lib/ant.jar::${java.home}/lib/tools.jar</server-class-path>
    <env-class-path-ignored>true</env-class-path-ignored>
    <jvm-options>-Dorg.xml.sax.parser=org.xml.sax.helpers.XMLReaderAdapter</jvm-options>
    <jvm-options>-Dorg.xml.sax.driver=org.apache.crimson.parser.XMLReaderImpl</jvm-options>
    <jvm-options>-Djava.security.policy=server.policy</jvm-options>
    <jvm-options>-Djava.security.auth.login.config=login.conf</jvm-options>
    <jvm-options>-Xmx256m</jvm-options>
    <jvm-options>-Xrs</jvm-options>
    </jvm>
    <servlet-container>
    <dynamic-reload-interval>5</dynamic-reload-interval>
    <anonymous-role>ANYONE</anonymous-role>
    </servlet-container>
    sun-web.xml
    <session-config>
    <cookie-properties>
    <property name="isSecure" value="true"/>
    </cookie-properties>
    </session-config>
    <cache enabled="false"></cache>
    <class-loader delegate="true"
    extra-class-path="lib/log4j.jar;lib/mysql-connector-java-3.1.13-bin.jar;lib/SSOCommon.jar;lib/SSOClient-dis.jar;lib/activati
    on.jar;lib/jax-qname.jar;lib/jaxb-api.jar;lib/jaxb-impl.jar;lib/jaxb-libs.jar;lib/namespace.jar;lib/ralaxngDatatype.jar;lib/xs
    dlib.jar"/>
    <jsp-config>
    <property name="javaEncoding" value="windows-1255"/>
    <property name="classdebuginfo" value="true">
    <description>Enable debug info compilation in the generated servlet class</description>
    </property>
    <property name="mappedfile" value="true">
    <description>Maintain a one-to-one correspondence between static content and the generated servlet class' java code</des
    cription>
    </property>
    </jsp-config>
    </sun-web-app>

  • Is there any ocasional Cache cleaning with Yosemite ever needed?

    Just curious if there is ever any need or benefit to do any type of Cache cleaning with Yosemite?   Thanks, Bill

    How to maintain a Mac
    1. Make two or more backups of all your files, keeping at least one off site at all times in case of disaster. One backup is not enough to be safe. Don’t back up your backups; all should be made directly from the original data. Don’t rely completely on any single backup method, such as Time Machine. If you get an indication that a backup has failed, don't ignore it.
    2. Keep your software up to date. In the App Store or Software Update preference pane (depending on the OS version), you can configure automatic notifications of updates to OS X and other Mac App Store products. Some third-party applications from other sources have a similar feature, if you don’t mind letting them phone home. Otherwise you have to check yourself on a regular basis.
    Keeping up to date is especially important for complex software that modifies the operating system, such as device drivers. Don't install such modifications unless they're absolutely necessary. Remove them when they are no longer needed. Before installing any Apple update, you must check that all system modifications that you use are compatible. Incompatibility with third-party software is by far the most common cause of difficulties with system updates.
    3. Don't install crapware, such as “themes,” "haxies," “add-ons,” “toolbars,” “enhancers," “optimizers,” “accelerators,” "boosters," “extenders,” “cleaners,” "doctors," "tune-ups," “defragmenters,” “firewalls,” "barriers," “guardians,” “defenders,” “protectors,” most “plugins,” commercial "virus scanners,” "disk tools," or "utilities." With very few exceptions, such stuff is useless or worse than useless. Above all, avoid any software that purports to change the look and feel of the user interface.
    It's not much of an exaggeration to say that the whole "utility" software industry for the Mac is a fraud on consumers. The most extreme examples are the "CleanMyMac," "TuneUpMyMac," and “MacKeeper” scams, but there are many others.
    As a rule, you should avoid software that changes the way other software works. Plugins for Photoshop and similar programs are an obvious exception to this rule. Safari extensions, and perhaps the equivalent for other web browsers, are a partial exception. Most are safe, and they're easy to get rid of if they don't work. Some may cause the browser to crash or otherwise malfunction. Some are malicious. Use with caution, and install only well-known extensions from relatively trustworthy sources, such as the Safari Extensions Gallery.
    Only install software that is useful to you, not (as you imagine) to the computer. For example, a word processor is useful for writing. A video editor is useful for making movies. A game is useful for fun. But a "cache cleaner" isn't useful for anything. Cleaning caches is not an end in itself.
    Never install any third-party software unless you know how to uninstall it. Otherwise you may create problems that are very hard to solve. Do not rely on "utilities" such as "AppCleaner" and the like that purport to remove software.
    4. Don't install bad, conflicting, or unnecessary fonts. Whenever you install new fonts, use the validation feature of the built-in Font Book application to make sure the fonts aren't defective and don't conflict with each other or with others that you already have. See the built-in help and this support article for instructions. Deactivate or remove fonts that you don't really need to speed up application launching.
    5. Avoid malware. Malware is malicious software that circulates on the Internet. This kind of attack on OS X was once so rare that it was hardly a concern, but malware is now increasingly common, and increasingly dangerous.
    There is some built-in protection against malware, but you can’t rely on it—the attackers are always at least one day ahead of the defense. You can’t rely on third-party protection either. What you can rely on is common-sense awareness—not paranoia, which only makes you more vulnerable.
    Never install software from an untrustworthy or unknown source. If in doubt, do some research. Any website that prompts you to install a “codec” or “plugin” that comes from the same site, or an unknown site, is untrustworthy. Software with a corporate brand, such as Adobe Flash Player, must come directly from the developer's website. No intermediary is acceptable, and don’t trust links unless you know how to parse them. Any file that is automatically downloaded from the web, without your having requested it, should go straight into the Trash. A web page that tells you that your computer has a “virus,” or that anything else is wrong with it, is a scam.
    In OS X 10.7.5 or later, downloaded applications and Installer packages that have not been digitally signed by a developer registered with Apple are blocked from loading by default. The block can be overridden, but think carefully before you do so.
    Because of recurring security issues in Java, it’s best to disable it in your web browsers, if it’s installed. Few websites have Java content nowadays, so you won’t be missing much. This action is mandatory if you’re running any version of OS X older than 10.6.8 with the latest Java update. Note: Java has nothing to do with JavaScript, despite the similar names. Don't install Java unless you're sure you need it. Most people don't.
    6. Don't fill up your disk/SSD. A common mistake is adding more and more large files to your home folder until you start to get warnings that you're out of space, which may be followed in short order by a startup failure. This is more prone to happen on the newer Macs that come with an internal SSD instead of the traditional hard drive. The drive can be very nearly full before you become aware of the problem.
    While it's not true that you should or must keep any particular percentage of space free, you should monitor your storage use and make sure you're not in immediate danger of using it up. According to Apple documentation, you need at least 9 GB of free space on the startup volume for normal operation.
    If storage space is running low, use a tool such as OmniDiskSweeper to explore the volume and find out what's taking up the most space. Move seldom-used large files to secondary storage.
    7. Relax, don’t do it. Besides the above, no routine maintenance is necessary or beneficial for the vast majority of users; specifically not “cleaning caches,” “zapping the PRAM,” "resetting the SMC," “rebuilding the directory,” "defragmenting the drive," “running periodic scripts,” “dumping logs,” "deleting temp files," “scanning for viruses,” "purging memory," "checking for bad blocks," "testing the hardware," or “repairing permissions.” Such measures are either completely pointless or are useful only for solving problems, not for prevention.
    To use a Mac effectively, you have to free yourself from the Windows mindset that every computer needs regular downtime maintenance such as "defragging" and "registry cleaning." Those concepts do not apply to the Mac platform.
    A well-designed computing device is not something you should have to think about much. It should be an almost transparent medium through which you communicate, work, and play. If you want a machine that needs a lot of attention, use a PC.
    The very height of futility is running an expensive third-party application called “Disk Warrior” when nothing is wrong, or even when something is wrong and you have backups, which you must have. Disk Warrior is a data-salvage tool, not a maintenance tool, and you will never need it if your backups are adequate. Don’t waste money on it or anything like it.

  • When group-working from SAN, where is the best place to store Cache Files, the Cache Database, and render files?

    I have a small post production house, and we are spinning up into editing our first series. We're all working from a SAN, and sharing projects and sequences via the Media Browser. It's working great so far, but we've been having issues (could be user error) with trying to figure out where best to store the Media Cache database, the cache files, and the preview files so when a project is moved from one machine to another, it doesn't constantly have to re-conform all of the media in the project.
    We have a very large master project, as this is a documentary style show, so there are hours and hours of clips.
    When I open a project on a new or different machine it has to conform EVERYTHING in the project again.
    Where should I store all these conform and cache files so that new people can get started working without having a machine literally be unusable until the conform process finishes?
    Thanks!

    Hi Jon,
    I have a small post production house, and we are spinning up into editing our first series. We're all working from a SAN, and sharing projects and sequences via the Media Browser.
    Glad it is working for you. Just to let you know, this workflow is not officially supported so your mileage may vary based on the kind of system you're working with. There are a lot of variations to the quality of these kinds of systems. Some are turn key, some home built - so I think you understand.
    It's working great so far, but we've been having issues (could be user error) with trying to figure out where best to store the Media Cache database, the cache files, and the preview files so when a project is moved from one machine to another, it doesn't constantly have to re-conform all of the media in the project.
    While it's possible to have the cache files (and the database) in a central location (I only know of one place that pulls that off, and it's a very, very large place), the systems that have this data stored locally are far more reliable. You can work around all the reconfirming by avoiding moving the project data around. You really don't need to move the project around from place to place. Have one computer as the "hub" for inputting data from other workstations. Wouldn't that work?
    When I open a project on a new or different machine it has to conform EVERYTHING in the project again.
    Can't you just have the master project on one machine and work on shorter sequences of your doc on the other machines? When done, just import to the master machine.
    Where should I store all these conform and cache files so that new people can get started working without having a machine literally be unusable until the conform process finishes?
    Premiere Pro simply must have those cache files in order to work. Sorry, there's no way around this problem unless you change your workflow.
    Thanks,
    Kevin

  • Viewing Excel Files using Tomcat - Problem with caching

    Hi all,
    A small part of an application I'm writing has links to Excel files for users to view/download. I'm currently using Tomcat v5 as the web/app server and have some very simple code (an example is shown below) which calls the excel file.
    <%@ page contentType = "application/vnd.ms-excel" %>
    <%
    response.setHeader("Pragma", "no-cache");
    response.setHeader("Cache-Control", "no-cache");
    response.setDateHeader("Expires", 0);
    response.sendRedirect("file1.xls");
    %>
    This all works except but I'm having one big problem.
    The xls file (file1.xls) is updated via a share on the server so each month, the xls file is overwritten with the same name but with different contents. I'm finding that when an update is made to the xls file and the user then attempts to view the new file in the browser they recieve only the old xls file. It's caching the xls file and I don't want it to. How can I fix this so that it automatically gives the user the new updated file.
    The only way I've managed to get Tomcat to do this is to delete the work directory and delete the file from my IE temp folder and then restart Tomcat - this is a bit much!
    Any help would be greatly appreciated.
    Thanks.

    I'd a problem with caching a few years back, for a servlet request which returned an SVG file.
    As a workaround, I ended up putting appending "#" and a timestamp / random number after it. The browser assuming each request was new, and didn't use the cache.
    Eg.
    http://myserver/returnSVG.do#1234567
    where 1234567 is a timestamp / random.
    Not sure whether you can do this on a file based URL... but maybe worth a shot...
    regards,
    Owen

  • I need the old cache system with strict alphabetical filter, not the "intelligent" one. Is it possible to have it on this new version of Firefox ? Thanks.

    Hi, is it possible to have a strict alphabetical filter for the cache suggestions in fields (like with the previous version) instead of the new "intelligent" system? For example, if I type "fire dr", I only want suggestions "fire dragon" or "fire drake" but not "dragon fire" or "dread fire". Thanks!
    == This happened ==
    Every time Firefox opened
    == I updated Firefox

    Hi Morbus,
    thanks for your answer.
    First I must say that my question was in fact concerning Firefox 3.6.3. I updated my Firefox 3.0.19 to 3.6.3 and that's why I had this problem. But I also kept my 3.0.19 version and use it when I need the alphabetic field cache recognition (to play an online game in which you must be the first to recognize a picture and type its name in a field).
    I launched 3.6.3 and install the cache utility you recommend, but unfortunately it's not the function I need. My question doesn't concern URL cache but ''field'' cache, and I don't need a soft that opens a new window.
    I just would like to get the old alphabetic cache so the options are more restricted when I type, so I gain a little time. With the "new" cache, I have to type the whole name so the cache is not useful anymore.
    Sorry, I don't know if I make myself clear...

Maybe you are looking for