<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    posts - 9, comments - 8, trackbacks - 0, articles - 3
      BlogJava :: 首頁(yè) :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理

    2006年11月27日

    作者 cctvx1
    ?關(guān)鍵字:ActiveMQ,實(shí)踐?

    ??? 一.安裝ActiveMQ

    ?????? 首先去http://activemq.apache.org/download.html 下載最新版本4.1.0release (http://activemq.apache.org/activemq-410-release.html),
    ??? 解壓apache-activemq-4.1-incubator.zip(或者apache-activemq-4.1-incubator.tar.gz)目錄如下:
    ??????
    ?????? +bin?????? (windows下面的bat和unix/linux下面的sh)
    ?????? +conf????? (activeMQ配置目錄,包含最基本的activeMQ配置文件)
    ?????? +data????? (默認(rèn)是空的)
    ?????? +docs????? (index,replease版本里面沒(méi)有文檔,-.-b不知道為啥不帶)
    ?????? +example?? (幾個(gè)例子
    ?????? +lib?????? (activemMQ使用到的lib)
    ?????? -apache-activemq-4.1-incubator.jar? (ActiveMQ的binary)
    ?????? -LICENSE.txt??????
    ?????? -NOTICE.txt???????
    ?????? -README.txt
    ?????? -user-guide.html


    ?????? 你可以使用bin\activemq.bat(activemq) 啟動(dòng),如果一切順利,你就會(huì)看見(jiàn)類似下面的信息
    ????? (細(xì)節(jié)可能不一樣,比如路徑,或者jmx,jdbc信息)

    ? ACTIVEMQ_HOME: D:\java\framework_and_lib\activemq\apache-activemq-4.1-incubator\
    bin\..
    Loading message broker from: xbean:activemq.xml
    INFO? BrokerService????????????????? - ActiveMQ null JMS Message Broker (localho
    st) is starting
    INFO? BrokerService????????????????? - For help or more information please see:
    http://incubator.apache.org/activemq/
    INFO? ManagementContext????????????? - JMX consoles can connect to service:jmx:r
    mi:///jndi/rmi://localhost:1099/jmxrmi
    INFO? JDBCPersistenceAdapter???????? - Database driver recognized: [apache_derby
    _embedded_jdbc_driver]
    INFO? DefaultDatabaseLocker????????? - Attempting to acquire the exclusive lock
    to become the Master broker
    INFO? DefaultDatabaseLocker????????? - Becoming the master on dataSource: org.ap
    ache.derby.jdbc.EmbeddedDataSource@1d840cd
    INFO? JournalPersistenceAdapter????? - Journal Recovery Started from: Active Jou
    rnal: using 5 x 20.0 Megs at: D:\java\framework_and_lib\activemq\apache-activemq
    -4.1-incubator\activemq-data\journal
    INFO? JournalPersistenceAdapter????? - Journal Recovered: 0 message(s) in transa
    ctions recovered.
    INFO? TransportServerThreadSupport?? - Listening for connections at: tcp://P-SUW
    EI:61616
    WARN? MulticastDiscoveryAgent??????? - brokerName not set
    INFO? TransportConnector???????????? - Connector default Started
    INFO? TransportServerThreadSupport?? - Listening for connections at: stomp://P-S
    UWEI:61613
    INFO? TransportConnector???????????? - Connector stomp Started
    INFO? NetworkConnector?????????????? - Network Connector default Started
    INFO? BrokerService????????????????? - ActiveMQ JMS Message Broker (localhost, I
    D:P-SUWEI-1207-1170916242296-1:0) started?????

    ???????? *。幾個(gè)小提示
    ? 1. 這個(gè)僅僅是最基礎(chǔ)的ActiveMQ的配置,很多地方都沒(méi)有配置因此不要直接使用這個(gè)配置用于生產(chǎn)系統(tǒng)
    ? 2. 有的時(shí)候由于端口被占用,導(dǎo)致ActiveMQ錯(cuò)誤,ActiveMQ可能需要以下端口1099(JMX),61616(默認(rèn)的TransportConnector)
    ? 3. 如果沒(méi)有物理網(wǎng)卡,或者M(jìn)S的LoopBackAdpater Multicast會(huì)報(bào)一個(gè)錯(cuò)誤

    ???? 二. 測(cè)試你的ActiveMQ
    ???????
    ????????? 由于ActiveMQ是一個(gè)獨(dú)立的jms provider,所以我們不需要其他任何第三方服務(wù)器就可以馬上做我們的測(cè)試了.編譯
    ???? example目錄下面的程序
    ?????????
    ?? ProducerTool/ConsumerTool 是JMS參考里面提到的典型應(yīng)用,Producer產(chǎn)生消息,Consumer消費(fèi)消息
    ?? 而且這個(gè)例子還可以加入?yún)?shù)幫助你測(cè)試剛才啟動(dòng)的本地ActiveMQ或者是遠(yuǎn)程的ActiveMQ

    ?? ProducerTool [url] broker的地址,默認(rèn)的是tcp://localhost:61616
    ??????????????? [true|flase] 是否使用topic,默認(rèn)是false
    ???????? [subject] subject的名字,默認(rèn)是TOOL.DEFAULT
    ???????? [durabl] 是否持久化消息,默認(rèn)是false
    ???????? [messagecount] 發(fā)送消息數(shù)量,默認(rèn)是10
    ???????? [messagesize] 消息長(zhǎng)度,默認(rèn)是255
    ???????? [clientID] durable為true的時(shí)候,需要配置clientID
    ???????? [timeToLive] 消息存活時(shí)間
    ???????? [sleepTime] 發(fā)送消息中間的休眠時(shí)間
    ???????? [transacte]? 是否采用事務(wù)

    ?????????
    ????????? ConsumerTool [url] broker的地址,默認(rèn)的是tcp://localhost:61616
    ??????????????? [true|flase] 是否使用topic,默認(rèn)是false
    ???????? [subject] subject的名字,默認(rèn)是TOOL.DEFAULT
    ???????? [durabl] 是否持久化消息,默認(rèn)是false
    ???????? [maxiumMessages] 接受最大消息數(shù)量,0表示不限制
    ???????
    ???????? [clientID] durable為true的時(shí)候,需要配置clientID
    ????????
    ???????? [transacte]? 是否采用事務(wù)
    ???????? [sleepTime]? 接受消息中間的休眠時(shí)間,默認(rèn)是0,onMeesage方法不休眠
    ???????? [receiveTimeOut] 接受超時(shí)

    ????????? 我們這樣可以使用:
    ?? java -classpath .\apache-activemq-4.1-incubator.jar;example\bin ProducerTool? tcp://192.168.3.142:61616 test.mysubject
    ?? java -classpath .\apache-activemq-4.1-incubator.jar;example\bin ConsumerTool? tcp://192.168.3.142:61616 test.mysubject

    ?? 當(dāng)然你可以使用上面的參數(shù)進(jìn)行更復(fù)雜的測(cè)試,持久,事務(wù)

    ?? 如果出現(xiàn)下面的信息,恭喜你,你的ActiveMQ已經(jīng)能夠工作了
    ????????
    ? Connecting to URL: tcp://192.168.3.142:61616
    ? Publishing a Message with size 255 to queue: TOOL.DEFAULT
    ? Using non-durable publishing
    ? Sleeping between publish 0 ms
    ? Sending message: Message: 0 sent at: Thu Feb 08 15:05:34 CST 2007? ...
    ? Sending message: Message: 1 sent at: Thu Feb 08 15:05:34 CST 2007? ...
    ???????? 。。。。。。。。


    ? Connecting to URL: tcp://192.168.3.142:61616
    ? Consuming queue: test.mysubject
    ???????? Using non-durable subscription
    ???????? Received: Message: 0 sent at: Thu Feb 08 14:51:34 CST 2007? ...
    ???????? Received: Message: 1 sent at: Thu Feb 08 14:51:34 CST 2007? ...
    ? 。。。。


    ???????? 三.小結(jié)
    ?????
    ????? 我們已經(jīng)下載,啟動(dòng),并且用程序測(cè)試了我們的ActiveMQ,而后面將在這個(gè)能跑得ActiveMQ進(jìn)一步的走下去,一步一步展示ActiveMQ的高級(jí)特性。

    posted @ 2007-02-08 17:54 Dr.Water 閱讀(11270) | 評(píng)論 (2)編輯 收藏

    ?? 作者cctvx1
    ?? 關(guān)鍵字:ActiveMQ,實(shí)踐
    ???
    ?? 一.ActiveMQ是什么??
    ????? ActiveMQ is the most popular and powerful open source Message Bus.
    ???????????????????????????????????????????????? 引用ActiveMQ官方網(wǎng)站

    ???? ActiveMQ 是一個(gè)完全支持JMS1.1和J2EE 1.4規(guī)范的 JMS Provider實(shí)現(xiàn),盡管JMS規(guī)范出臺(tái)
    已經(jīng)是很久的事情了,但是JMS在當(dāng)今的J2EE應(yīng)用中間仍然扮演著特殊的地位。
    ??? 下面是它的特性列表 (詳細(xì)的特性清單請(qǐng)參考http://activemq.apache.org/features.html)
    ?? ?1.多種語(yǔ)言和協(xié)議編寫客戶端
    ?? ??語(yǔ)言: Java, C, C++, C#, Ruby, Perl, Python, PHP
    ????? ??應(yīng)用協(xié)議: OpenWire,Stomp REST,WS Notification,XMPP,AMQP
    ?? ?2.完全支持JMS1.1和J2EE 1.4規(guī)范? (持久化,XA消息,事務(wù))
    ?? ?3.對(duì)Spring的支持,ActiveMQ可以很容得內(nèi)嵌到使用Spring的系統(tǒng)里面去,而且也支持Spring2.0的特性
    ?????? 4.通過(guò)了常見(jiàn)J2EE服務(wù)器(如 Geronimo,JBoss 4, GlassFish,WebLogic)的測(cè)試,其中通過(guò)JCA 1.5 resource adaptors的配置,
    ????? 可以讓ActiveMQ可以自動(dòng)的部署到任何兼容J2EE 1.4 商業(yè)服務(wù)器上
    ?????? 5.支持多種傳送協(xié)議:in-VM,TCP,SSL,NIO,UDP,JGroups,JXTA
    ?????? 6.支持通過(guò)JDBC和journal提供高速的消息持久化
    ?????? 7.從設(shè)計(jì)上保證了高性能的集群,客戶端-服務(wù)器,點(diǎn)對(duì)點(diǎn)
    ?????? 8.支持Ajax
    ?????? 9.支持與Axis的整合
    ?????? 10.可以很容易得調(diào)用內(nèi)嵌JMS provider,進(jìn)行測(cè)試
    ??????
    ???? 二.ActiveMQ的競(jìng)爭(zhēng)者???
    ???????
    ??????? 1.其他開源 JMS provider(資料來(lái)自 java-source.net) :
    ??????? jbossmq(jboss 4)
    ??????? jboss messaging (jboss 5)
    ??????? joram-4.3.21? 2006-09-22
    ??????? openjms-0.7.7-alpha-3.zip December 26, 2005
    ??????? mantamq 官網(wǎng)暫時(shí)無(wú)法訪問(wèn)
    ??????? ubermq? 官網(wǎng)暫時(shí)無(wú)法訪問(wèn)
    ??????? SomnifugiJMS? 2005-7-27
    ?????????? 開源的JMS Provider大部分都已經(jīng)停止發(fā)展了,剩下的幾個(gè)都是找到了東家,和某種J2EE 服務(wù)器掛鉤,
    ??????? 比如jboss mq 與jboss,joram與jonas(objectweb組織),ActiveMQ 與Geronimo(ASF APACHE基金組織),
    ??????? 而在這3個(gè)之間,從網(wǎng)絡(luò)底層來(lái)看,只有ActiveMQ使用了NIO,單從這個(gè)角度來(lái)看ActiveMQ在性能上會(huì)有
    ??????? 一定的優(yōu)勢(shì)??????

    ??????? 2.商業(yè)JMS provider
    ??????? IBM WebSphere MQ
    ??????? BEA WebLogic JMS
    ??????? Oracle AQ
    ??????? NonStop Server for Java Message Service(JMS)
    ??????? Sun Java System Message Queue
    ??????? Sonic jms
    ??????? TIBCO Enterprise For JMS
    ??????? iLinkMQ (國(guó)內(nèi))
    ?????????? 現(xiàn)在的商業(yè)J2EE 應(yīng)用服務(wù)器大部分都會(huì)有JMS Provider的實(shí)現(xiàn),畢竟應(yīng)用服務(wù)器都已經(jīng)花費(fèi)不薄,也不在乎
    ??????? 在里面送一個(gè)JMS Provider了,當(dāng)然還是有獨(dú)立的比如IBM WebSphere MQ,Sonic JMS ,前者肯定是商用MQ
    ?????? (這個(gè)概念不僅僅是JMS Provier了,只能說(shuō)JMS 只是它提供的一個(gè)應(yīng)用)中間的巨無(wú)霸了。
    ???????
    ???????? 從這點(diǎn)來(lái)看,ActiveMQ明顯的競(jìng)爭(zhēng)者并不多,因?yàn)樗亲鳛楠?dú)立的開源JMS Provider出現(xiàn)的,很容易被用于多種結(jié)構(gòu)設(shè)計(jì)中,
    ??????? 使用ActiveMQ作為默認(rèn)JMS Provider的開源項(xiàng)目有ServiceMix,Geronimo.
    ?
    ?????????????????????????????????????????????????????????????????????????????????????????????? (待續(xù))
    ??????? P.S
    ??????????? Monday, February 5, 2007
    ????? Apache ActiveMQ graduates from the incubator?
    ????? Apache ActiveMQ has now graduated to become a top level project (TLP) at Apache! Its new site is now hosted at http://activemq.apache.org/. Many thanks to all those in the Incubator and ActiveMQ communities for making this happen!

    posted @ 2007-02-07 00:36 Dr.Water 閱讀(4615) | 評(píng)論 (0)編輯 收藏

    主要就是正則表達(dá)式的運(yùn)用,除了mod_rewrite之外還有一個(gè)urlrewritefilter
    下面是一個(gè)測(cè)試二級(jí)域名映射規(guī)則

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^[^www.]+.test.ecom$
    Rewriterule ^(.+) %{HTTP_HOST}$1 [C]?
    Rewriterule ^([^www.]+)\.test\.ecom(.*) /shop_$1$2
    Rewriterule ^www.test.ecom(.*) /$1 [nc,PT]
    RewriteRule /shop_(.+)/pic/(.*)$ /pic/$2 [nc,PT]
    RewriteRule /shop_(.+)/js/(.*)$ /js/$2 [nc,PT]
    RewriteRule /shop_(.+)/css/(.*)$ /css/$2 [nc,PT]
    RewriteRule /shop_(.+)/(.+).do?(\.*)$? /$2.do?domainName=$1&%{QUERY_STRING} [L,nc]


    RewriteLog "logs/rewrite.log"
    RewriteLogLevel 3


    關(guān)鍵字段:
    ??????????????? RewriteCond 表示如果條件滿足則使用下面的Rewriterule
    ??????????????? Rewriterule 就是采用具體的正則表達(dá)式來(lái)匹配?
    ??????????????????????????????????? Rewriterule 后面還可以帶有參數(shù)

    ???????????? 見(jiàn)apache參考
    ?????????? http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html
    ?????????

    • 'chain|C' (chained with next rule)
      This flag chains the current rule with the next rule (which itself can be chained with the following rule, and so on). This has the following effect: if a rule matches, then processing continues as usual - the flag has no effect. If the rule does not match, then all following chained rules are skipped. For instance, it can be used to remove the ``.www'' part, inside a per-directory rule set, when you let an external redirect happen (where the ``.www'' part should not occur!).
    • 'cookie|CO=NAME:VAL:domain[:lifetime[:path]]' (set cookie)
      This sets a cookie in the client's browser. The cookie's name is specified by NAME and the value is VAL. The domain field is the domain of the cookie, such as '.apache.org', the optional lifetime is the lifetime of the cookie in minutes, and the optional path is the path of the cookie
    • 'env|E=VAR:VAL' (set environment variable)
      This forces an environment variable named VAR to be set to the value VAL, where VAL can contain regexp backreferences ($N and %N) which will be expanded. You can use this flag more than once, to set more than one variable. The variables can later be dereferenced in many situations, most commonly from within XSSI (via <!--#echo var="VAR"-->) or CGI ($ENV{'VAR'}). You can also dereference the variable in a later RewriteCond pattern, using %{ENV:VAR}. Use this to strip information from URLs, while maintaining a record of that information.
    • 'forbidden|F' (force URL to be forbidden)
      This forces the current URL to be forbidden - it immediately sends back a HTTP response of 403 (FORBIDDEN). Use this flag in conjunction with appropriate RewriteConds to conditionally block some URLs.
    • 'gone|G' (force URL to be gone)
      This forces the current URL to be gone - it immediately sends back a HTTP response of 410 (GONE). Use this flag to mark pages which no longer exist as gone.
    • 'handler|H=Content-handler' (force Content handler)
      Force the Content-handler of the target file to be Content-handler. For instance, this can be used to simulate the mod_alias directive ScriptAlias, which internally forces all files inside the mapped directory to have a handler of ``cgi-script''.
    • 'last|L' (last rule)
      Stop the rewriting process here and don't apply any more rewrite rules. This corresponds to the Perl last command or the break command in C. Use this flag to prevent the currently rewritten URL from being rewritten further by following rules. For example, use it to rewrite the root-path URL ('/') to a real one, e.g., '/e/www/'.
    • 'next|N' (next round)
      Re-run the rewriting process (starting again with the first rewriting rule). This time, the URL to match is no longer the original URL, but rather the URL returned by the last rewriting rule. This corresponds to the Perl next command or the continue command in C. Use this flag to restart the rewriting process - to immediately go to the top of the loop.
      Be careful not to create an infinite loop!
    • 'nocase|NC' (no case)
      This makes the Pattern case-insensitive, ignoring difference between 'A-Z' and 'a-z' when Pattern is matched against the current URL.
    • 'noescape|NE' (no URI escaping of output)
      This flag prevents mod_rewrite from applying the usual URI escaping rules to the result of a rewrite. Ordinarily, special characters (such as '%', '$', ';', and so on) will be escaped into their hexcode equivalents ('%25', '%24', and '%3B', respectively); this flag prevents this from happening. This allows percent symbols to appear in the output, as in

      RewriteRule /foo/(.*) /bar?arg=P1\%3d$1 [R,NE]

      which would turn '/foo/zed' into a safe request for '/bar?arg=P1=zed'.
    • 'nosubreq|NS' (not for internal sub-requests)
      This flag forces the rewriting engine to skip a rewriting rule if the current request is an internal sub-request. For instance, sub-requests occur internally in Apache when mod_include tries to find out information about possible directory default files (index.xxx files). On sub-requests it is not always useful, and can even cause errors, if the complete set of rules are applied. Use this flag to exclude some rules.
      To decide whether or not to use this rule: if you prefix URLs with CGI-scripts, to force them to be processed by the CGI-script, it's likely that you will run into problems (or significant overhead) on sub-requests. In these cases, use this flag.
    • 'proxy|P' (force proxy)
      This flag forces the substitution part to be internally sent as a proxy request and immediately (rewrite processing stops here) put through the proxy module. You must make sure that the substitution string is a valid URI (typically starting with http://hostname) which can be handled by the Apache proxy module. If not, you will get an error from the proxy module. Use this flag to achieve a more powerful implementation of the ProxyPass directive, to map remote content into the namespace of the local server.

      Note: mod_proxy must be enabled in order to use this flag.

    • 'passthrough|PT' (pass through to next handler)
      This flag forces the rewrite engine to set the uri field of the internal request_rec structure to the value of the filename field. This flag is just a hack to enable post-processing of the output of RewriteRule directives, using Alias, ScriptAlias, Redirect, and other directives from various URI-to-filename translators. For example, to rewrite /abc to /def using mod_rewrite, and then /def to /ghi using mod_alias:

      RewriteRule ^/abc(.*) /def$1 [PT]
      Alias /def /ghi

      If you omit the PT flag, mod_rewrite will rewrite uri=/abc/... to filename=/def/... as a full API-compliant URI-to-filename translator should do. Then mod_alias will try to do a URI-to-filename transition, which will fail.

      Note: You must use this flag if you want to mix directives from different modules which allow URL-to-filename translators. The typical example is the use of mod_alias and mod_rewrite.

    • 'qsappend|QSA' (query string append)
      This flag forces the rewrite engine to append a query string part of the substitution string to the existing string, instead of replacing it. Use this when you want to add more data to the query string via a rewrite rule.
    • 'redirect|R [=code]' (force redirect)
      Prefix Substitution with http://thishost[:thisport]/ (which makes the new URL a URI) to force a external redirection. If no code is given, a HTTP response of 302 (MOVED TEMPORARILY) will be returned. If you want to use other response codes in the range 300-400, simply specify the appropriate number or use one of the following symbolic names: temp (default), permanent, seeother. Use this for rules to canonicalize the URL and return it to the client - to translate ``/~'' into ``/u/'', or to always append a slash to /u/user, etc.
      Note: When you use this flag, make sure that the substitution field is a valid URL! Otherwise, you will be redirecting to an invalid location. Remember that this flag on its own will only prepend http://thishost[:thisport]/ to the URL, and rewriting will continue. Usually, you will want to stop rewriting at this point, and redirect immediately. To stop rewriting, you should add the 'L' flag.
    • 'skip|S=num' (skip next rule(s))
      This flag forces the rewriting engine to skip the next num rules in sequence, if the current rule matches. Use this to make pseudo if-then-else constructs: The last rule of the then-clause becomes skip=N, where N is the number of rules in the else-clause. (This is not the same as the 'chain|C' flag!)
    • 'type|T=MIME-type' (force MIME type)
      Force the MIME-type of the target file to be MIME-type. This can be used to set up the content-type based on some conditions. For example, the following snippet allows .php files to be displayed by mod_php if they are called with the .phps extension:

      RewriteRule ^(.+\.php)s$ $1 [T=application/x-httpd-php-source]


    ????????????????

    posted @ 2007-01-30 23:06 Dr.Water 閱讀(1383) | 評(píng)論 (0)編輯 收藏

    ConcurrentModificationException
    一個(gè)不該犯的低級(jí)錯(cuò)誤,今天的代碼突然拋了一個(gè)concurrentModificationException錯(cuò)誤,
    Iterator的一個(gè)基本概念沒(méi)有掌握導(dǎo)致的這個(gè)錯(cuò)誤,就是在Iterator的實(shí)現(xiàn)類
    比如Hashtable里面的內(nèi)部類
    ?private class Enumerator<T> implements Enumeration<T>, Iterator<T>

    會(huì)在next,或者remove的時(shí)候檢查當(dāng)前集合是否會(huì)在修改狀態(tài),如果是的話
    就會(huì)拋出 ConcurrentModificationException,而他自己remove則是使用了同步的方法
    而且同步了modCount;expectedModCount;


    ?public T next() {
    ???? if (modCount != expectedModCount)
    ??throw new ConcurrentModificationException();
    ???? return nextElement();
    ?}


    public void remove() {
    ???? if (!iterator)
    ??throw new UnsupportedOperationException();
    ???? if (lastReturned == null)
    ??throw new IllegalStateException("Hashtable Enumerator");
    ???? if (modCount != expectedModCount)
    ??throw new ConcurrentModificationException();

    ???? synchronized(Hashtable.this) {
    ??Entry[] tab = Hashtable.this.table;
    ??int index = (lastReturned.hash & 0x7FFFFFFF) % tab.length;

    ??for (Entry<K,V> e = tab[index], prev = null; e != null;
    ?????? prev = e, e = e.next) {
    ????? if (e == lastReturned) {
    ???modCount++;
    ???expectedModCount++;
    ???if (prev == null)
    ?????? tab[index] = e.next;
    ???else
    ?????? prev.next = e.next;
    ???count--;
    ???lastReturned = null;
    ???return;
    ????? }
    ??}
    ??throw new ConcurrentModificationException();
    ???? }
    ?}
    ??? }
    而自己在next的同時(shí),修改了這個(gè)集合,導(dǎo)致了這個(gè)錯(cuò)誤的出現(xiàn)

    posted @ 2007-01-23 11:31 Dr.Water 閱讀(3483) | 評(píng)論 (1)編輯 收藏

    Spring 官方已經(jīng)提到這個(gè)錯(cuò)誤了

    http://www.springframework.org/docs/reference/xsd-config.html#xsd-config-integration-resin

    A.3.3.1. XML parsing errors in the Resin v.3 application server


    If you are using the XSD-style for Spring 2.0 XML configuration and deploying to v.3 of Caucho's Resin application server, you will need to set some configuration options prior to startup so that an XSD-aware parser is available to Spring.
    Please do read this resource


    而resin給出來(lái)的參考就是他默認(rèn)不是使用xerces和xalan作為xml和xslt的默認(rèn)解析器

    正是由于他默認(rèn)不是采用以上作為xml,xstl的解析器,導(dǎo)致了在resin下面 使用spring 2.0 新xsd配置方式會(huì)報(bào)錯(cuò)誤

    (主要就是xml中的attribute和propertie 他取不到)

    解決的方法就是讓resin使用xerces和xalan作為xml和xslt的默認(rèn)解析器

    配置:

    在resin.conf的<web-app>或者<server>節(jié)點(diǎn)下添加

    <!-- xml -->
    <system-property javax.xml.parsers.DocumentBuilderFactory=
    ???????????? "org.apache.xerces.jaxp.DocumentBuilderFactoryImpl"/>
    <system-property javax.xml.parsers.SAXParserFactory=
    ???????????? "org.apache.xerces.jaxp.SAXParserFactoryImpl"/>
    ??
    ??? <!--? xslt -->
    <system-property javax.xml.transform.TransformerFactory=
    ???????????? "org.apache.xalan.processor.TransformerFactoryImpl"/>


    然后把相應(yīng)的jar加入%RESIN_HOME%/lib 目錄,這里需要說(shuō)明的是我在測(cè)試activemq的時(shí)候

    加入xerces和xalan后,他包其他class無(wú)法找到,感覺(jué)好像是默認(rèn)的web-app目錄下的jar無(wú)效了,我暫時(shí)直接加入系統(tǒng)classpath解決的

    這點(diǎn)不知道是不是我自己的平臺(tái)問(wèn)題。


    經(jīng)過(guò)測(cè)試 resin 3.0.22+spring 2.0+activemq xsd配置方式ok了,


    ps. ^.^ 以前的resin下面項(xiàng)目沒(méi)有用2.0配置,自己也學(xué)習(xí)到了新東西

    posted @ 2007-01-03 17:53 Dr.Water 閱讀(1482) | 評(píng)論 (1)編輯 收藏

    Struts? ValidatorResources 的警告問(wèn)題

    google到的其他人同樣的問(wèn)題描述
    http://www.mail-archive.com/user@struts.apache.org/msg51847.html


    我自己的配置
    struts-config-action.xml中配置

    < form-beans >
    ????
    < form-bean? name ="dynamicForm" ?type ="org.apache.struts.validator.LazyValidatorForm" />
    </ form-beans >

    運(yùn)行所有跟這個(gè)form有關(guān)的頁(yè)面都會(huì)出現(xiàn):
    [ValidatorResources]2006-12-10 00:07:23 WARN : Form 'dynamicForm' not found for locale 'zh_CN'

    我即使在messageResource_zh_CN.properties添加了對(duì)應(yīng)的key/name也不行.

    解決方法,參考其他帖子,我首先升級(jí)strut 到1.3.x,commons-validator也升級(jí)到1.3.0
    然后

    ? < plug-in? className ="org.apache.struts.validator.ValidatorPlugIn" >
    ??
    < set-property? property ="pathnames"
    ???????value
    ="/WEB-INF/validator-rules.xml,/WEB-INF/validation-user.xml" />
    ?
    </ plug-in >


    在validation-user.xml 添加一個(gè)form就行了

    < form-validation >
    ?
    < formset >
    ??
    < form? name ="dynamicForm" />
    ?
    </ formset >
    </ form-validation >

    不再有這個(gè)WARN 了。?

    posted @ 2006-12-10 00:13 Dr.Water 閱讀(2745) | 評(píng)論 (3)編輯 收藏

    Apache 2.2.3 Subversion 1.4.0(r21228) integrate
    reference :
    ?????????
    http://xrinehart.cnblogs.com/archive/2005/10/27/262759.html
    ????????? http://xrinehart.cnblogs.com/archive/2005/10/29/264659.html
    ????????? http://www.apachelounge.com/forum/viewtopic.php?t=121
    ????????????????????? (maniac provide svn 1.4.0 module win32? binary for apache 2.2.x)
    Warning:
    ??????? subversion.tigris.org
    ??????? Windows binaries - ATTENTION!: The mod_dav_svn binaries available here are NOT compatible with Apache 2.2

    FAQ:
    ???? Error:? Expected fromat '3' of repository;found format '5'
    ???????????? use "--pre-1.4-compatible", default format is "5" !!
    ???????????
    Integrate Guide:
    ??????????? I? use other complie svn module for apache 2.2.3 ,
    ???? Step1:
    ???????????? copy *.dll to? %APACHE_HOME%\bin
    ???????????? copy *.so? to? %APACHE_HOME%\modules
    ???? Step2:
    ???????????? edit %APACHE_HOME%\conf\httpd.conf
    ???????????? find:
    ???????????????? #LoadModule dav_module? modules\mod_dav.so
    ???????????????? #LoadModule dav_fs_module modules\mod_dav_fs.so
    ???????????? change: "#" to ""
    ???????????????? LoadModule dav_module? modules\mod_dav.so
    ???????????????? LoadModule dav_fs_module modules\mod_dav_fs.so
    ???????????? and add SVN Module:
    ???????????????? #SVN
    ???????????????? LoadModule dav_svn_module?? modules\mod_dav_svn.so
    ???????????????? LoadModule authz_svn_module? modules\mod_authz_svn.so
    ????? Step3:?
    ????????????? config? SVN auth,add httpd.conf
    ????????????? use apache basic auth,gen password file
    ??????????????? %APACHE_HOME%\bin\htpasswd -cm D:/server/webservice/clear/Apache2.2/svn-auth/svn-auth-file harry

    ??????????????? <IfModule dav_svn_module>
    ???????????????? <Location /svn>
    ?????????????????? DAV svn
    ?????????????????? SVNParentPath D:/SubversionRoot
    ?????????????????? AuthTypeBasic
    ?????????????????? AuthName "Subversion Repository"
    ?????????????????? AuthUserFile D:/server/webservice/clear/Apache2.2/svn-auth/svn-auth-file
    ?????? Require valid-user
    ???????????????? </Location>
    ??????????????? </IfModule>
    ???????
    主要就是svn官方的win binary不支持apache 2.2的新module調(diào)用。
    ??????

    ????????????????

    ?

    posted @ 2006-11-27 00:14 Dr.Water 閱讀(2661) | 評(píng)論 (1)編輯 收藏

    主站蜘蛛池模板: 99re免费99re在线视频手机版| 亚洲ⅴ国产v天堂a无码二区| 亚欧人成精品免费观看| 免费大片av手机看片| 亚洲一久久久久久久久| 99在线免费观看视频| 免费无遮挡无码视频在线观看| 亚洲1区1区3区4区产品乱码芒果| 亚洲精品无码成人片久久| 亚洲国产成人VA在线观看| 国产片免费福利片永久| 一级做受视频免费是看美女| 久久久国产亚洲精品| 亚洲大香人伊一本线| 内射少妇36P亚洲区| 在线免费观看一区二区三区| 91高清免费国产自产拍2021| a色毛片免费视频| 国产精品综合专区中文字幕免费播放| 免费亚洲视频在线观看| 国产亚洲午夜精品| 亚洲av永久无码精品秋霞电影秋| 波多野结衣亚洲一级| 亚洲日本久久久午夜精品| 亚洲免费视频网址| 亚洲AV无码一区二区三区人| 亚洲videos| 在线观看日本亚洲一区| 亚洲综合欧美色五月俺也去| 亚洲综合久久精品无码色欲| 中文字幕在线观看亚洲视频| 亚洲色大成网站www久久九| 亚洲精品456人成在线| 亚洲中文字幕久久精品无码A| 亚洲乱码日产精品BD在线观看| 亚洲成AV人片久久| 亚洲第一成人在线| 亚洲av永久无码精品网址| 无人视频在线观看免费播放影院 | 国产精品内射视频免费| 国产精品免费久久久久电影网|