2013-08-22 74 views
0

我想使用兵马俑+四郎为了实施SSO。当我尝试测试它时,出现以下错误:兵马俑和shiro

The configuration data in the base configuration from server at 'localhost:9510' does not obey the Terracotta schema: 
    [0]: Line 4, column 5: Expected elements 'tc-properties servers clients' instead of 'system' here in element [email protected]://www.terracotta.org/config 
    [1]: Line 16, column 13: Expected elements 'offheap authentication http-authentication data-backup tsa-port jmx-port tsa-group-port security' instead of 'statistics' here in element server 
    [2]: Line 19, column 13: Expected elements 'offheap authentication http-authentication data-backup tsa-port jmx-port tsa-group-port security' instead of 'dso-port' here in element server 
    [3]: Line 21, column 13: Expected elements 'offheap authentication http-authentication data-backup tsa-port tsa-group-port security' instead of 'l2-group-port' here in element server 
    [4]: Line 32, column 13: Expected elements 'offheap http-authentication data-backup tsa-port tsa-group-port security' instead of 'dso' here in element server 
    [5]: Line 50, column 9: Expected elements 'server mirror-group update-check garbage-collection restartable client-reconnect-window' instead of 'mirror-groups' here in element servers 
    [6]: Line 63, column 9: Expected elements 'server mirror-group update-check garbage-collection restartable client-reconnect-window' instead of 'ha' here in element servers 
    [7]: Line 86, column 5: Element not allowed: application in element [email protected]://www.terracotta.org/config 

任何人都可以帮助我找到问题所在?

这里是我的配置:TC客户端上

ehcache.xml中:TC服务器上

<ehcache name="Plugin_Ehcache" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:noNamespaceSchemaLocation="ehcache.xsd" 
    updateCheck="false" monitoring="autodetect" 
    dynamicConfig="false"> 

<diskStore path="java.io.tmpdir/shiro-ehcache"/> 

<defaultCache 
     maxElementsInMemory="10000" 
     eternal="false" 
     timeToIdleSeconds="120" 
     timeToLiveSeconds="120" 
     overflowToDisk="false" 
     diskPersistent="false" 
     diskExpiryThreadIntervalSeconds="120"> 
    <terracotta/> 
</defaultCache> 
<cache name="shiro-activeSessionCache" 
     maxElementsInMemory="10000" 
     eternal="true" 
     timeToLiveSeconds="0" 
     timeToIdleSeconds="0" 
     diskPersistent="false" 
     overflowToDisk="false" 
     diskExpiryThreadIntervalSeconds="600"> 
    <terracotta/> 
</cache>  

<terracottaConfig url="localhost:9510"/>  
</ehcache> 

TC-config.xml中

<tc:tc-config xsi:schemaLocation="http://www.terracotta.org/schema/terracotta-8.xsd" 
      xmlns:tc="http://www.terracotta.org/config" 
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 

<tc-properties> 
<property name="l2.l1reconnect.enabled" value="true"/> 
<property name="l2.l1reconnect.timeout.millis" value="5000"/> 
<property name="sigar.enabled" value="false"/> 
<property name="search.use.commit.thread" value="false"/> 
<property name="search.lucene.use.ram.directory" value="true"/> 
<property name="search.query.wait.for.txns" value="false"/> 
<property name="logging.maxLogFileSize" value="100"/> 
<property name="logging.maxBackups" value="10"/> 
</tc-properties> 

<system> 
<configuration-model>development</configuration-model> 
</system> 

    <servers> 
    <server host="localhost" name="Terracotta Server1"> 
     <!-- Specify the path where the server should store its data. --> 
      <data>C:\Program Files\Terracotta\terracotta-3.7.5\server\server-data</data> 
      <logs>C:\Program Files\Terracotta\terracotta-3.7.5\server\server-logs</logs> 
      <index>C:\Program Files\Terracotta\terracotta-3.7.5\server\server-index</index> 
      <statistics>C:\Program Files\Terracotta\terracotta-3.7.5\server\server-statistics</statistics> 

     <!-- Specify the port where the server should listen for client 
     traffic. --> 
     <dso-port bind="127.0.0.1">9510</dso-port> 
     <jmx-port bind="127.0.0.1">9520</jmx-port> 
      <l2-group-port bind="localhost">9530</l2-group-port> 
      <!--jmx-port bind="xxx.xxx.xxx.xxx">9520</jmx-port> 
     <tsa-port>9510</tsa-port> 

     <tsa-group-port>9530</tsa-group-port--> 
     <!-- Enable BigMemory on the server. --> 
     <!--offheap> 
     <enabled>true</enabled> 
     <maxDataSize>4g</maxDataSize> 
     </offheap--> 

    <authentication/> 

     <dso> 
    <client-reconnect-window>120</client-reconnect-window> 
    <persistence> 
     <mode>permanent-store</mode> 
      <!--mode>temporary-swap-only</mode--> 
      <!--<offheap> 
     <enabled>false</enabled> 
     <maxDataSize>450m</maxDataSize> 
     </offheap>--> 
    </persistence> 
    <garbage-collection> 
     <enabled>true</enabled> 
     <verbose>false</verbose> 
     <interval>300</interval> 
    </garbage-collection> 
    </dso> 

    </server> 

     <mirror-groups> 
    <mirror-group group-name="group1"> 
    <members> 
     <member>Terracotta Server1</member> 
    </members> 
    <ha> 
     <mode>networked-active-passive</mode> 
     <networked-active-passive> 
     <election-time>5</election-time> 
     </networked-active-passive> 
    </ha> 
    </mirror-group> 
</mirror-groups>  
<ha> 
    <mode>networked-active-passive</mode> 
    <networked-active-passive> 
    <election-time>5</election-time> 
    </networked-active-passive> 
</ha> 

     <update-check> 
    <enabled>false</enabled> 
</update-check> 

    <!-- Add the restartable element for Fast Restartability (optional). --> 
    <!--restartable enabled="true"/--> 
    </servers> 
    <clients> 
    <logs>logs-%i</logs> 
    </clients> 
</tc:tc-config> 

回答

0

哪个兵马俑库的版本是你在用吗? tc-config.xml在4.x版本中有一些更新的标签。请确保tc-config和ehcache xml符合架构。

干杯, Ridhav

0

我看见你试图用镜组标签在你的TC的配置,但似乎你放错了地方。

例如,这个配置应该工作:

<?xml version="1.0" encoding="UTF-8" ?> 
<tc:tc-config xsi:schemaLocation="http://www.terracotta.org/schema/terracotta-8.xsd" 
       xmlns:tc="http://www.terracotta.org/config" 
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 

    <tc-properties> 
    <property name="l2.l1reconnect.enabled" value="true"/> 
    <property name="l2.l1reconnect.timeout.millis" value="5000"/> 
    <property name="sigar.enabled" value="false"/> 
    <property name="search.use.commit.thread" value="false"/> 
    <property name="search.lucene.use.ram.directory" value="true"/> 
    <property name="search.query.wait.for.txns" value="false"/> 
    <property name="logging.maxLogFileSize" value="100"/> 
    <property name="logging.maxBackups" value="10"/> 
    </tc-properties> 

    <servers> 
    <mirror-group group-name="group1"> 
     <server host="localhost" name="Terracotta Server1"> 
     <!-- Specify the path where the server should store its data. --> 
     <data>C:\Program Files\Terracotta\terracotta-3.7.5\server\server-data</data> 
     <logs>C:\Program Files\Terracotta\terracotta-3.7.5\server\server-logs</logs> 
     <index>C:\Program Files\Terracotta\terracotta-3.7.5\server\server-index</index> 
     <!--<statistics>C:\Program Files\Terracotta\terracotta-3.7.5\server\server-statistics</statistics>--> 

     <!-- Specify the port where the server should listen for client 
     traffic. --> 
     <tsa-port>9510</tsa-port> 
     <jmx-port>9520</jmx-port> 
     <tsa-group-port>9530</tsa-group-port> 

     <authentication/> 

     </server> 
    </mirror-group> 

    <update-check> 
     <enabled>false</enabled> 
    </update-check> 

    <!-- Add the restartable element for Fast Restartability (optional). --> 
    <!--restartable enabled="true"/--> 
    </servers> 
    <clients> 
    <logs>logs-%i</logs> 
    </clients> 
</tc:tc-config> 
0

看看这个行定义用于构造XML配置文件的模式:

<tc:tc-config xsi:schemaLocation="http://www.terracotta.org/schema/terracotta-8.xsd 

输入地址提供,并采取看看如何使用嵌套的XML元素和属性。

例如,在terracotta-6.xsd和terracotta-7.xsd中允许使用元素dso-port,但不允许在声明的terracotta-8.xsd中使用元素dso-port。

顺便说一下,取决于您使用的兵马俑服务器的版本,由于元素不兼容,应该声明适当的xml架构。