2 Replies Latest reply on Dec 17, 2012 10:04 PM by wmfxly

    How to use jboss pojocache? Configuration warning: cvc-elt.1: Cannot find the declaration of element 'server'.

    wmfxly

      Dear Sir/Madam

           I am a beginner user of JbossCache. I met a problem while using it and I hope you can help solve it. Thank you

           The following is a brief description of the question:

       

       

      While I was using the 3.0.0.GA version of treecache and pojocache, I met an exception:

      [aop-trace] org.jboss.util.xml.JBossEntityResolver resolveSystemID, systemId=urn:jboss:jbosscache-core:config:3.0

      [aop-trace] org.jboss.util.xml.JBossEntityResolver Found entity systemId=urn:jboss:jbosscache-core:config:3.0 fileName=jbosscache-config-3.0.xsd

      [aop-trace] org.jboss.util.xml.JBossEntityResolver schema/jbosscache-config-3.0.xsd maps to URL: jar:file:/E:/src_work/autoSysNew/WebRoot/WEB-INF/lib/jbosscache-core.jar!/schema/jbosscache-config-3.0.xsd

      [aop-trace] org.jboss.util.xml.JBossEntityResolver resolveSystemID, systemId=urn:jboss:jbosscache-core:cache-repo:3.0

      [aop-trace] org.jboss.util.xml.JBossEntityResolver Found entity systemId=urn:jboss:jbosscache-core:cache-repo:3.0 fileName=jbosscache-registry-3.0.xsd

      [aop-trace] org.jboss.util.xml.JBossEntityResolver schema/jbosscache-registry-3.0.xsd maps to URL: jar:file:/E:/src_work/autoSysNew/WebRoot/WEB-INF/lib/jbosscache-core.jar!/schema/jbosscache-registry-3.0.xsd

      2012-12-03 14:42:12,983 [main] org.jboss.cache.config.parsing.RootElementBuilder  - Configuration warning: cvc-elt.1: Cannot find the declaration of element 'server'.

      2012-12-03 14:42:12,987 [main] org.jboss.cache.config.parsing.RootElementBuilder  - org.jboss.cache.config.ConfigurationException: Incorrect configuration file. Use '-Djbosscache.config.validate=false' to disable validation.

      2012-12-03 14:42:13,604 [main] org.jboss.cache.transaction.GenericTransactionManagerLookup  - Falling back to DummyTransactionManager from JBossCache

      2012-12-03 14:42:14,230 [main] org.jboss.cache.pojo.impl.PojoCacheImpl  - PojoCache version: JBossCache 'Naga' 3.0.0.GA

      2012-12-03 14:42:14,247 [main] org.jboss.cache.pojo.impl.PojoCacheImpl  - PojoCache version: JBossCache 'Naga' 3.0.0.GA

      2012-12-03 14:42:14,414 [main] org.jboss.cache.jmx.PlatformMBeanServerRegistration  - JBossCache MBeans were successfully registered to the platform mbean server.

      2012-12-03 14:42:14,437 [main] org.jgroups.JChannel  - JGroups version: 2.6.7.GA

       

       

      -------------------------------------------------------

      GMS: address is 172.17.109.178:58714

      -------------------------------------------------------

      2012-12-03 14:42:16,946 [main] org.jboss.cache.RPCManagerImpl  - Received new cluster view: [172.17.109.178:58714|0] [172.17.109.178:58714]

      2012-12-03 14:42:16,950 [main] org.jboss.cache.RPCManagerImpl  - Cache local address is 172.17.109.178:58714

      2012-12-03 14:42:16,951 [main] org.jboss.cache.factories.ComponentRegistry  - JBoss Cache version: JBossCache 'Naga' 3.0.0.GA

      2012-12-03 14:42:17,348 [main] org.jboss.cache.RPCManagerImpl  - Disconnecting and closing the Channel

      2012-12-03 14:42:17,370 [main] org.jboss.cache.RPCManagerImpl  - Stopping the RpcDispatcher

       

       

       

       

      org.jboss.cache.config.parsing.RootElementBuilder  - Configuration warning: cvc-elt.1: Cannot find the declaration of element 'server'.,I see in the JbossCache community BBS reply,

      https://community.jboss.org/thread/145857,

       

       

      Mircea Markus

      546 发帖自

      2007-1-30

      3. 2009-12-16 上午11:04 (回复 balachandra maddina)

      Re: Configuration problems using Jboss Pojo Cache 3.0.0.GA

      The purpose of the TransactionManagerLookup is to lookup an javax.transaction.TransactionManager within your runtimne and return it to the JBossCache. E.g. if you run in JBossAS then this TransactionManagerLookup implementation (the one you configured, take a look at javadoc) will return the TransactionManager that the AS is using, from JNDI. Read the javadoc for GenericTransactionManagerLookup, should make things more clear. To return to the original question, the warning is caused by the fact that no TransactionManager is found within your runtime, and a default one will be used - which is not so clever, as per the name -> DummyTransactionManager. I'd say you can live with this one if you a) don't have to use it for distributed transactions and b) you don't see any performance degradations for transactions.

       

       

       

       

      configured file information of replSync-service.xml:

       

      <?xml version="1.0" encoding="UTF-8"?>
      <server>
         <mbean code="org.jboss.cache.jmx.CacheJmxWrapper" name="jboss.cache:service=TreeCache"><!--
            <depends>jboss:service=Naming</depends>
            --><depends>jboss:service=TransactionManager</depends>
            <!--Configure the TransactionManager-->
            <attribute name="TransactionManagerLookupClass">org.jboss.cache.transaction.GenericTransactionManagerLookup
            </attribute>
            <!--
                Isolation level : SERIALIZABLE
                                  REPEATABLE_READ (default)
                                  READ_COMMITTED
                                  READ_UNCOMMITTED
                                  NONE
            -->
            <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
            <!--
                 Valid modes are LOCAL
                                 REPL_ASYNC
                                 REPL_SYNC
                                 INVALIDATION_ASYNC
                                 INVALIDATION_SYNC
            -->
            <attribute name="CacheMode">REPL_SYNC</attribute>
            <!-- Name of cluster. Needs to be the same for all TreeCache nodes in a
                 cluster in order to find each other.
            -->
            <attribute name="ClusterName">JBossCache-Cluster</attribute>
            <!-- JGroups protocol stack properties.
               ClusterConfig isn't used if the multiplexer is enabled and successfully initialized.
            -->
            <attribute name="ClusterConfig">
               <config>
                  <UDP mcast_addr="228.10.10.10"
                       mcast_port="45588"
                       ip_ttl="2"
                       tos="8"
                       mcast_recv_buf_size="25000000"
                       ucast_recv_buf_size="20000000"
                       mcast_send_buf_size="640000"
                       ucast_send_buf_size="640000"
                       loopback="false"
                       discard_incompatible_packets="true"
                       max_bundle_size="64000"
                       max_bundle_timeout="30"
                       use_incoming_packet_handler="true"
                       enable_bundling="false"
                       enable_diagnostics="false"
                       use_concurrent_stack="true"
                       thread_naming_pattern="pl"
                       thread_pool.enabled="true"
                       thread_pool.min_threads="1"
                       thread_pool.max_threads="25"
                       thread_pool.keep_alive_time="30000"
                       thread_pool.queue_enabled="true"
                       thread_pool.queue_max_size="10"
                       thread_pool.rejection_policy="Run"
                       oob_thread_pool.enabled="true"
                       oob_thread_pool.min_threads="1"
                       oob_thread_pool.max_threads="4"
                       oob_thread_pool.keep_alive_time="10000"
                       oob_thread_pool.queue_enabled="true"
                       oob_thread_pool.queue_max_size="10"
                       oob_thread_pool.rejection_policy="Run"/>

                  <PING timeout="2000" num_initial_members="3"/>
                  <MERGE2 max_interval="30000" min_interval="10000"/>
                  <FD_SOCK/>
                  <FD timeout="10000" max_tries="5" shun="true"/>
                  <VERIFY_SUSPECT timeout="1500"/>
                  <pbcast.NAKACK use_mcast_xmit="false" gc_lag="0"
                                 retransmit_timeout="300,600,1200,2400,4800"
                                 discard_delivered_msgs="true"/>

                  <UNICAST timeout="300,600,1200,2400,3600"/>
                  <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
                                 max_bytes="400000"/>

                  <pbcast.GMS print_local_addr="true" join_timeout="5000" shun="false"
                              view_bundling="true" view_ack_collection_timeout="5000"/>

                  <FRAG2 frag_size="60000"/>
                  <pbcast.STREAMING_STATE_TRANSFER />
                  <!-- <pbcast.STATE_TRANSFER/> -->
                  <pbcast.FLUSH timeout="0"/>
               </config>
            </attribute>
            <!--
            Just used for async repl: use a replication queue
            -->
            <attribute name="UseReplQueue">false</attribute>
            <!--
                Replication interval for replication queue (in ms)
            -->
            <attribute name="ReplQueueInterval">0</attribute>


            <!--
                Max number of elements which trigger replication
            -->
            <attribute name="ReplQueueMaxElements">0</attribute>


            <!--
             Whether or not to fetch state on joining a cluster
             NOTE this used to be called FetchStateOnStartup and has been renamed to be more descriptive.
            -->
            <attribute name="FetchInMemoryState">true</attribute>


            <!--
                The max amount of time (in milliseconds) we wait until the
                state (ie. the contents of the cache) are retrieved from
                existing members in a clustered environment
            -->
            <attribute name="StateRetrievalTimeout">15000</attribute>


            <!--
                Number of milliseconds to wait until all responses for a
                synchronous call have been received.
            -->

            <attribute name="SyncReplTimeout">15000</attribute>


         </mbean>
      </server>

       

      The following are questions i need your help for:

      1.Can pojocache be used in the tomcat container,I want to use POJO Cache without JBOSS container

      2.If I use pojocache in tomcat, if there any other way to load the jboss-aop.jar,jboss-aop.xml file other than by using SET_OPT to add a vm parameter.

      -javaagent:E:\src_work\autoSysNew\WebRoot\WEB-INF\lib\jboss-aop.jar

      -Djboss.aop.path=E:\src_work\autoSysNew\src\pojocache-aop.xml

      3.If i use it in tomcat, is jndi the only way? Is there any other way to initialize TransactionManager?

      4.Will there be any performance problem in the distributed scenario, if i do not use the Jndi method?

       

       

       

       

      I will appreciate it very much if you could offer me some help.