2 Replies Latest reply: Jan 22, 2012 3:05 PM by Jonathan.Knight RSS

    issues with element:introduce-cache-config

    908671
      we have a common cache configuration file (log4j-server-cache-config.xml) and we want to include it to other cache config file. but we tried different approaches, none of them seems work. here are the configuration file we use:




      <?xml version='1.0'?>

      <cache-config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns="http://xmlns.oracle.com/coherence/coherence-cache-config"
      xsi:schemaLocation="http://xmlns.oracle.com/coherence/coherence-cache-config coherence-cache-config.xsd"
      xmlns:element="class://com.oracle.coherence.environment.extensible.namespaces.XmlElementProcessingNamespaceContentHandler"
      element:introduce-cache-config="log4j-server-cache-config.xml">

           <defaults>
                <serializer>
                     <instance>
                          <class-name>com.tangosol.io.pof.ConfigurablePofContext</class-name>
                          <init-params>
                               <init-param>
                                    <param-type>String</param-type>
                                    <param-value>etlm-pof-config.xml</param-value>
                               </init-param>
                          </init-params>
                     </instance>
                </serializer>
           </defaults>

           <caching-scheme-mapping>
                <cache-mapping>
                     <cache-name>etlm-codelist</cache-name>
                     <scheme-name>etlm-distribute-scheme</scheme-name>
                     <init-params>
                          <init-param>
                               <param-name>max-size</param-name>
                               <param-value>5m</param-value>
                          </init-param>

                          <init-param>
                               <param-name>expiry-delay</param-name>
                               <param-value>5m</param-value>
                          </init-param>
                     </init-params>
                </cache-mapping>
                <cache-mapping>
                     <cache-name>etlm-*</cache-name>
                     <scheme-name>etlm-distribute-scheme</scheme-name>
                </cache-mapping>
           </caching-scheme-mapping>

           <caching-schemes>
                     <local-scheme>
                          <scheme-name>unlimited-local</scheme-name>
                          <high-units>{max-size 50m}</high-units>
                          <unit-calculator>BINARY</unit-calculator>
           
                          <expiry-delay>{expiry-delay 0}</expiry-delay>
                     </local-scheme>
           
                     <distributed-scheme>
                          <scheme-name>etlm-distribute-scheme</scheme-name>
                          <scheme-ref>etlm-base</scheme-ref>
                          <autostart>true</autostart>
           
                     </distributed-scheme>
           
           
                     <distributed-scheme>
                          <scheme-name>etlm-base</scheme-name>
                          <service-name>ETLMDistributedCache</service-name>
                          <partition-count>257</partition-count>
                          <backing-map-scheme>
           
                               <local-scheme>
                                    <scheme-ref>unlimited-local</scheme-ref>
                               </local-scheme>
                          </backing-map-scheme>
                          <autostart>true</autostart>
                     </distributed-scheme>
           
           
                     <proxy-scheme>
           
                          <service-name>ExtendTcpProxyService</service-name>
                          <thread-count>20</thread-count>
                          <acceptor-config>
                               <tcp-acceptor>
                                    <local-address>
                                         <address system-property="tangosol.coherence.proxy.host">localhost</address>
                                         <port system-property="tangosol.coherence.proxy.port">18030</port>
           
                                    </local-address>
                               </tcp-acceptor>
                          </acceptor-config>
                          <autostart system-property="tangosol.coherence.proxy">true</autostart>
                     </proxy-scheme>
           </caching-schemes>
      </cache-config>


      Following is the log4j-server-cache-config.xml

      <?xml version='1.0'?>

      <cache-config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns="http://xmlns.oracle.com/coherence/coherence-cache-config"
           xsi:schemaLocation="http://xmlns.oracle.com/coherence/coherence-cache-config coherence-cache-config.xsd">

           <cachdding-scheme-mapping>
                <cache-mapping>
                     <cache-name>dist-log4j</cache-name>
                     <scheme-name>engineering-distributed</scheme-name>
                     <init-params>
                          <init-param>
                               <param-name>write-delay</param-name>
                               <param-value>1s</param-value>
                          </init-param>
                          <init-param>
                               <param-name>write-batch-factor</param-name>
                               <param-value>0.5</param-value>
                          </init-param>
                     </init-params>
                </cache-mapping>
           </caching-scheme-mapping>

           <caching-schemes>
                <local-scheme>
                     <scheme-name>unlimited-local</scheme-name>
                     <unit-calculator>BINARY</unit-calculator>
                </local-scheme>
                <distributed-scheme>
                     <scheme-name>engineering-distributed</scheme-name>
                     <service-name>Log4JDistributedCache</service-name>
                     <thread-count>20</thread-count>
                     <backing-map-scheme>
                          <read-write-backing-map-scheme>
      <internal-cache-scheme>
                               <local-scheme/>
                          </internal-cache-scheme>
                          <cachestore-scheme>
                          <class-scheme>
                               <class-name>com.adp.cache.log4j.LoggingCacheStore</class-name>
                                    <init-params>
                                    <init-param>
                                         <param-type>java.lang.String</param-type>
                                         <param-value>jdbc:oracle:thin:@10.17.134.215:1521:poc</param-value>
                                    </init-param>
                                    <init-param>
                                         <param-type>java.lang.String</param-type>
                                         <param-value>oracle.jdbc.driver.OracleDriver</param-value>
                                    </init-param>
                                    <init-param>
                                         <param-type>java.lang.String</param-type>
                                         <param-value>poc</param-value>
                                    </init-param>
                                    <init-param>
                                         <param-type>java.lang.String</param-type>
                                         <param-value>tiger</param-value>
                                    </init-param>
                                    <init-param>
                                         <param-type>java.lang.String</param-type>
                                         <param-value>INSERT INTO LOG_JDBC (LogTime, LogLevel, ClassName, LogMessage) VALUES (?)</param-value>
                                    </init-param>
                                    </init-params>
                               </class-scheme>
                </cachestore-scheme>
                <write-delay>
                     {write-delay 0}
                </write-delay>
                <write-batch-factor>
                     {write-batch-factor 0}
                </write-batch-factor>
                <write-requeue-threshold>
                     {write-requeue-threshold 0}
                </write-requeue-threshold>
                
           </read-write-backing-map-scheme>
                     </backing-map-scheme>
                     <autostart>true</autostart>
                </distributed-scheme>
                
                <proxy-scheme>
                     <service-name>Log4JTcpProxyService</service-name>
                     <thread-count>20</thread-count>
                     <acceptor-config>
                          <tcp-acceptor>
                               <local-address>
                                    <address system-property="tangosol.coherence.proxy.host">localhost</address>
                                    <port system-property="tangosol.coherence.proxy.port">20170</port>
                               </local-address>
                          </tcp-acceptor>
                     </acceptor-config>
                     <autostart system-property="tangosol.coherence.proxy.enabled">true</autostart>
                </proxy-scheme>
           </caching-schemes>
      </cache-config>

      I included coherence-common 2.1.1.288 jar file in front of all of the other jar files. the server can be started up successfully without any error or exceptions, but I don't see any services from Log4J-server-cache-config.xml from the startup console. here is the output from server startup:
      C:\coherence\coherence3.7.1\bin>"C:\Progra~1\Java\jdk1.6.0_21\bin\java" -server -showversion ""-Xms512m -Xmx512m"" -Dtangosol.coherence.log.level=9 -Dtangosol.coherence.override=et
      lm\etlm-server-config.xml -Dtangosol.coherence.localhost=10.17.134.215 -Dtangosol.coherence.localport=8088 -cp "etlm\coherence-common.jar;C:\coherence\coherence3.7.1\bin\\..\lib\c
      oherence.jar;etlm\CacheService.jar;etlm\commons-pool-1.5.6.jar;etlm\commons-dbcp-1.4.jar;etlm\commons-lang3-3.1.jar;etlm\log4j-1.2.16.jar;etlm\ojdbc6.jar;etlm\etlm.jar" com.tangoso
      l.net.DefaultCacheServer
      java version "1.6.0_21"
      Java(TM) SE Runtime Environment (build 1.6.0_21-b07)
      Java HotSpot(TM) 64-Bit Server VM (build 17.0-b17, mixed mode)

      2012-01-03 10:18:21.256/0.461 Oracle Coherence 3.7.1.0 <Info> (thread=main, member=n/a): Loaded operational configuration from "jar:file:/C:/coherence/coherence3.7.1/lib/coherence.
      jar!/tangosol-coherence.xml"
      2012-01-03 10:18:21.344/0.549 Oracle Coherence 3.7.1.0 <Info> (thread=main, member=n/a): Loaded operational overrides from "file:/C:/coherence/coherence3.7.1/bin/etlm/etlm-server-c
      onfig.xml"
      2012-01-03 10:18:21.349/0.554 Oracle Coherence 3.7.1.0 <D5> (thread=main, member=n/a): Optional configuration override "/custom-mbeans.xml" is not specified
      2012-01-03 10:18:21.349/0.554 Oracle Coherence 3.7.1.0 <D6> (thread=main, member=n/a): Loaded edition data from "jar:file:/C:/coherence/coherence3.7.1/lib/coherence.jar!/coherence-
      grid.xml"

      Oracle Coherence Version 3.7.1.0 Build 27797
      Grid Edition: Development mode
      Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

      2012-01-03 10:18:21.672/0.877 Oracle Coherence GE 3.7.1.0 <Info> (thread=main, member=n/a): Loaded cache configuration from "file:/C:/coherence/coherence3.7.1/bin/etlm/etlm-server-
      cache-config.xml"
      2012-01-03 10:18:22.313/1.518 Oracle Coherence GE 3.7.1.0 <D4> (thread=main, member=n/a): TCMP bound to /10.17.134.215:8088 using SystemSocketProvider
      2012-01-03 10:18:22.559/1.764 Oracle Coherence GE 3.7.1.0 <D7> (thread=PacketListener1, member=n/a): Growing MultiplexingWriteBufferPool segment '65536' to 2 generations
      2012-01-03 10:18:27.622/6.827 Oracle Coherence GE 3.7.1.0 <Info> (thread=Cluster, member=n/a): Created a new cluster "ETLMDIT" with Member(Id=1, Timestamp=2012-01-03 10:18:22.373,
      Address=10.17.134.215:8088, MachineId=27829, Location=site:,machine:leon-desk,process:9064, Role=CoherenceServer, Edition=Grid Edition, Mode=Development, CpuCount=8, SocketCount=8)
      UID=0x0A1186D700000134A42653A56CB51F98
      2012-01-03 10:18:27.626/6.831 Oracle Coherence GE 3.7.1.0 <Info> (thread=main, member=n/a): Started cluster Name=ETLMDIT

      WellKnownAddressList(Size=1,
      WKA{Address=10.17.134.215, Port=8088}
      )

      MasterMemberSet(
      ThisMember=Member(Id=1, Timestamp=2012-01-03 10:18:22.373, Address=10.17.134.215:8088, MachineId=27829, Location=site:,machine:leon-desk,process:9064, Role=CoherenceServer)
      OldestMember=Member(Id=1, Timestamp=2012-01-03 10:18:22.373, Address=10.17.134.215:8088, MachineId=27829, Location=site:,machine:leon-desk,process:9064, Role=CoherenceServer)
      ActualMemberSet=MemberSet(Size=1
      Member(Id=1, Timestamp=2012-01-03 10:18:22.373, Address=10.17.134.215:8088, MachineId=27829, Location=site:,machine:leon-desk,process:9064, Role=CoherenceServer)
      )
      MemberId|ServiceVersion|ServiceJoined|MemberState
      1|3.7.1|2012-01-03 10:18:27.622|JOINED
      RecycleMillis=1200000
      RecycleSet=MemberSet(Size=0
      )
      )

      TcpRing{Connections=[]}
      IpMonitor{AddressListSize=0}

      2012-01-03 10:18:27.657/6.862 Oracle Coherence GE 3.7.1.0 <D5> (thread=Invocation:Management, member=1): Service Management joined the cluster with senior service member 1
      2012-01-03 10:18:27.893/7.098 Oracle Coherence GE 3.7.1.0 <Info> (thread=DistributedCache:ETLMDistributedCache, member=1): Loaded POF configuration from "jar:file:/C:/coherence/coh
      erence3.7.1/bin/etlm/etlm.jar!/etlm-pof-config.xml"; this document does not refer to any schema definition and has not been validated.
      2012-01-03 10:18:27.929/7.134 Oracle Coherence GE 3.7.1.0 <Info> (thread=DistributedCache:ETLMDistributedCache, member=1): Loaded included POF configuration from "jar:file:/C:/cohe
      rence/coherence3.7.1/lib/coherence.jar!/coherence-pof-config.xml"
      2012-01-03 10:18:27.995/7.200 Oracle Coherence GE 3.7.1.0 <D5> (thread=DistributedCache:ETLMDistributedCache, member=1): Service ETLMDistributedCache joined the cluster with senior
      service member 1
      2012-01-03 10:18:28.021/7.226 Oracle Coherence GE 3.7.1.0 <D6> (thread=DistributedCache:ETLMDistributedCache, member=1): Service ETLMDistributedCache: sending PartitionConfig Confi
      gSync to all
      2012-01-03 10:18:28.275/7.480 Oracle Coherence GE 3.7.1.0 <Info> (thread=Proxy:ExtendTcpProxyService:TcpAcceptor, member=1): TcpAcceptor now listening for connections on 10.17.134.
      215:18030
      2012-01-03 10:18:28.414/7.619 Oracle Coherence GE 3.7.1.0 <D5> (thread=Proxy:ExtendTcpProxyService:TcpAcceptor, member=1): Started: TcpAcceptor{Name=Proxy:ExtendTcpProxyService:Tcp
      Acceptor, State=(SERVICE_STARTED), ThreadCount=20, HungThreshold=0, TaskTimeout=0, Codec=Codec(Format=POF), Serializer=com.tangosol.io.pof.ConfigurablePofContext, PingInterval=0, P
      ingTimeout=30000, RequestTimeout=30000, SocketProvider=SystemSocketProvider, LocalAddress=[WRTVDCDVMJPCA33/10.17.134.215:18030], SocketOptions{LingerTimeout=0, KeepAliveEnabled=tru
      e, TcpDelayEnabled=false}, ListenBacklog=0, BufferPoolIn=BufferPool(BufferSize=2KB, BufferType=DIRECT, Capacity=Unlimited), BufferPoolOut=BufferPool(BufferSize=2KB, BufferType=DIRE
      CT, Capacity=Unlimited)}
      2012-01-03 10:18:28.419/7.624 Oracle Coherence GE 3.7.1.0 <D5> (thread=Proxy:ExtendTcpProxyService, member=1): Service ExtendTcpProxyService joined the cluster with senior service
      member 1
      2012-01-03 10:18:28.422/7.627 Oracle Coherence GE 3.7.1.0 <Info> (thread=main, member=1):
      Services
      (
      ClusterService{Name=Cluster, State=(SERVICE_STARTED, STATE_JOINED), Id=0, Version=3.7.1, OldestMemberId=1}
      InvocationService{Name=Management, State=(SERVICE_STARTED), Id=1, Version=3.1, OldestMemberId=1}
      PartitionedCache{Name=ETLMDistributedCache, State=(SERVICE_STARTED), LocalStorage=enabled, PartitionCount=257, BackupCount=1, AssignedPartitions=257, BackupPartitions=0}
      ProxyService{Name=ExtendTcpProxyService, State=(SERVICE_STARTED), Id=3, Version=3.7, OldestMemberId=1}
      )

      Started DefaultCacheServer...


      It seems to me class XmlElementProcessingNamespaceContentHandler is not invoked.

      thanks for the help
        • 1. Re: issues with element:introduce-cache-config
          User738616-Oracle
          Hi,

          The invocation of XmlElementProcessingNamespaceContentHandler is not logged with default log level. Increase the log level by setting the property -Dtangosol.coherence.log.level=9 and then you should be able to see the message as below:

          +:+
          Using the Incubator Extensible Environment for Coherence Cache Configuration
          +:+

          Hope this helps!

          Cheers,
          NJ
          • 2. Re: issues with element:introduce-cache-config
            Jonathan.Knight
            Hi Leon,

            Your problem might be that you have a custom overrides file so you are not including the overrides file from the Incubator Commons...
            2012-01-03 10:18:21.344/0.549 Oracle Coherence 3.7.1.0 <Info> (thread=main, member=n/a): Loaded operational overrides from "file:/C:/coherence/coherence3.7.1/bin/etlm/etlm-server-config.xml"
            The tangosol-coherence-override file in the Incubator looks like this
            <coherence>
                <configurable-cache-factory-config>
                    <class-name>com.oracle.coherence.environment.extensible.ExtensibleEnvironment</class-name>
                    <init-params>
                        <init-param>
                            <param-type>java.lang.String</param-type>
                            <param-value system-property="tangosol.coherence.cacheconfig">coherence-cache-config.xml</param-value>
                        </init-param>
                    </init-params>
                </configurable-cache-factory-config>
            </coherence>
            If you do not have the configuration shown above then the Incubator com.oracle.coherence.environment.extensible.ExtensibleEnvironment will not be used as the Cache Factory and most of the Incubator functionality will not work.

            You have two options; either make sure that the <configurable-cache-factory-config> section from the Incubator configuration added to your etlm-server-config.xml or make the first part of your etlm-server-config.xml file look like this...
            <coherence xml-override="/tangosol-coherence-override.xml">    
            ...if you do this then your etlm-server-config.xml file will be read in then the tangosol-coherence-override file from the Incubator will be read in too.

            JK