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

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

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

    andyj2ee

    java tec sky

    統計

    留言簿(4)

    activemq

    aop

    design pattern

    other blog

    spring

    workflow

    多線程

    軟件架構師

    閱讀排行榜

    評論排行榜

    2005年4月14日 #

    系統cvs to Git 遷移

    遷移簡介

    應用工具:cvs2git

    工作原理:文件系統的copy, from cvs repository to export temp file, then import to Git repository.

    使用條件: Git version 1.5.4.4 or later (我們的目標 git 庫版本:

    git --version

    git version 1.9.0

    git --version
    git version 1.9.0

    cvs2git工具安裝

    遷移過程

    具體的遷移過程:

    以下為遷移wxxr-core-framework

    1. 在123.1上用cvs2git把cvs倉庫,導出成git的備份文件(blob file and dump file)

    • cvs2git --blobfile=/tmp/cvs2git/output/git-blob-cfw.dat --dumpfile=/tmp/cvs2git/output/git-dump-cfw.dat --username=zhangjunqing --fallback-encoding=GBK /app/cvsroot/wxxr-projects/wxxr-core-framework
    • 創建本地git倉庫 
      • git init --bare wxxr-core-framework.git
    • 下載導出的git的備份文件到本地臨時目錄 **
      • cd /Users/zhangjq/temp/cvs2git
      • scp -r djboss@192.168.123.1:/tmp/cvs2git/output/git-* . 
    • 用git的fast-import命令把從cvs導出的git備份文件導入剛創建的git倉庫** cd /Users/zhangjq/git/wxxr-core-framework/wxxr-core-framework.git** cat /Users/zhangjq/temp/cvs2git/git-blob-cfw.dat /Users/zhangjq/temp/cvs2git/git-dump-cfw.dat | git fast-import
    • 在Stash 上創建遠程倉庫** 創建了framework-core 倉庫集,并在此倉庫集下創建了wxxr-core-framework, wxxr-core-web  等遠程倉庫**http://developer.corp.wxxr.com.cn/git/projects/FRMCORE/repos/wxxr-core-framework/browse
      •  
    • 在本地執行** git branch -D TAG.FIXUP (執行git branch -a 沒有找到這個分支,為什么刪除?error: branch 'TAG.FIXUP' not found. )
      • git gc --prune=now
      • git push --all origin  (將本地的所有分支都推送到遠程主機)
      • git push -tags origin (最后,git push不會推送標簽(tag),除非使用-tags選項。)
    • 至此,完成了wxxr-core-framework的遷移。下一步執行比較驗證。

    Git 時不時地將這些對象打包至一個叫 packfile 的二進制文件以節省空間并提高效率。當倉庫中有太多的松散對象,或是手工調用git gc 命令,或推送至遠程服務器時,Git 都會這樣做。

    附:遷移腳本

    遷移驗證

    用本地cvs代碼庫代碼與git下載的庫代碼比較,有$Revision$ 的少版本信息外,其它一切正常。

    遷移報告

    wxxr-core-framework

    cvs2svn Statistics:
    ------------------
    Total CVS Files:              3000
    Total CVS Revisions:          9439
    Total CVS Branches:          33449
    Total CVS Tags:            3278944
    Total Unique Tags:            2446
    Total Unique Branches:          24
    CVS Repos Size in KB:       159751
    Total SVN Commits:            5260
    First Revision Date:    Wed May 31 15:56:03 2006
    Last Revision Date:     Sun Jan  4 17:22:23 2015
    ------------------
    Timings (seconds):
    ------------------
    1065   pass1    CollectRevsPass
    0   pass2    CleanMetadataPass
    0   pass3    CollateSymbolsPass
    648   pass4    FilterSymbolsPass
    1   pass5    SortRevisionsPass
    37   pass6    SortSymbolsPass
    436   pass7    InitializeChangesetsPass
    82   pass8    BreakRevisionChangesetCyclesPass
    82   pass9    RevisionTopologicalSortPass
    296   pass10   BreakSymbolChangesetCyclesPass
    406   pass11   BreakAllChangesetCyclesPass
    413   pass12   TopologicalSortPass
    319   pass13   CreateRevsPass
    159   pass14   SortSymbolOpeningsClosingsPass
    15   pass15   IndexSymbolsPass
    432   pass16   OutputPass
    4391   total
    

    fast-import wxxr-core-framework source code:

    git-fast-import statistics:
    ---------------------------------------------------------------------
    Alloc'd objects:      45000
    Total objects:        41365 (      2260 duplicates                  )
    blobs  :         7817 (       709 duplicates       6887 deltas of       7248 attempts)
    trees  :        30677 (      1551 duplicates      12608 deltas of      29589 attempts)
    commits:         2871 (         0 duplicates          0 deltas of          0 attempts)
    tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
    Total branches:        2472 (        24 loads     )
    marks:     1073741824 (     11397 unique    )
    atoms:           2772
    Memory total:          4532 KiB
    pools:          2423 KiB
    objects:          2109 KiB
    ---------------------------------------------------------------------
    pack_report: getpagesize()            =       4096
    pack_report: core.packedGitWindowSize = 1073741824
    pack_report: core.packedGitLimit      = 8589934592
    pack_report: pack_used_ctr            =      23737
    pack_report: pack_mmap_calls          =        824
    pack_report: pack_open_windows        =          1 /          1
    pack_report: pack_mapped              =    7439224 /    7439224
    ---------------------------------------------------------------------

    :)

    @import url(http://m.tkk7.com/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);

    posted @ 2015-01-13 18:53 java光環 閱讀(733) | 評論 (0)編輯 收藏

    異常:java.lang.ArrayIndexOutOfBoundsException: 48188



    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-plugin-plugin:3.2:helpmojo (generate-help-mojo) on project wxxr-build-maven-plugin: Execution generate-help-mojo of goal org.apache.maven.plugins:maven-plugin-plugin:3.2:helpmojo failed: 48188 -> [Help 1]
    org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-plugin-plugin:3.2:helpmojo (generate-help-mojo) on project wxxr-build-maven-plugin: Execution generate-help-mojo of goal org.apache.maven.plugins:maven-plugin-plugin:3.2:helpmojo failed: 48188
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
    Caused by: org.apache.maven.plugin.PluginExecutionException: Execution generate-help-mojo of goal org.apache.maven.plugins:maven-plugin-plugin:3.2:helpmojo failed: 48188
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:144)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
        ... 19 more
    Caused by: java.lang.ArrayIndexOutOfBoundsException: 48188
        at org.objectweb.asm.ClassReader.readClass(Unknown Source)
        at org.objectweb.asm.ClassReader.accept(Unknown Source)
        at org.objectweb.asm.ClassReader.accept(Unknown Source)
        at org.apache.maven.tools.plugin.annotations.scanner.DefaultMojoAnnotationsScanner.scanFile(DefaultMojoAnnotationsScanner.java:139)
        at org.apache.maven.tools.plugin.annotations.scanner.DefaultMojoAnnotationsScanner.scan(DefaultMojoAnnotationsScanner.java:85)
        at org.apache.maven.tools.plugin.annotations.JavaAnnotationsMojoDescriptorExtractor.scanAnnotations(JavaAnnotationsMojoDescriptorExtractor.java:125)
        at org.apache.maven.tools.plugin.annotations.JavaAnnotationsMojoDescriptorExtractor.execute(JavaAnnotationsMojoDescriptorExtractor.java:104)
        at org.apache.maven.tools.plugin.scanner.DefaultMojoScanner.populatePluginDescriptor(DefaultMojoScanner.java:108)
        at org.apache.maven.plugin.plugin.AbstractGeneratorMojo.execute(AbstractGeneratorMojo.java:233)
        at org.apache.maven.plugin.plugin.HelpGeneratorMojo.execute(HelpGeneratorMojo.java:88)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
        ... 20 more
    [ERROR]
    [ERROR]
    [ERROR] For more information about the errors and possible solutions, please read the following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

    臨時解決辦法:將commons-jelly 版本由1.0改為1.0-RC1
            <dependency>
                <groupId>commons-jelly</groupId>
                <artifactId>commons-jelly</artifactId>
                <version>1.0-RC1</version>
            </dependency>

    posted @ 2014-12-17 15:27 java光環 閱讀(3696) | 評論 (0)編輯 收藏

    如何成為一名軟件架構師?

    Daniel Mohl是一名專業的軟件工程師/架構師,他的興趣包括理解各種復雜的編程語言、企業應用架構以及如何搭建業務與技術,他通曉F#、C#、 CoffeeScript、JavaScript、Erlang、ASP.NET、MVC、WPF、WCF、Sliverlight、SQL Server等技術。有著多年的軟件開發經驗。

    他經常會被一些有潛力和有前途的程序員問到:“我要怎么做才能成為一名架構師?”說實話,這已經是老生常談的話題了,答案當然是視情況而定。不過他也根據自己的經驗,給大家一些建議,并且提供一些資料,助你快速走上架構師這條道路。

    下面是Daniel Mohl所提出的列表,供大家參考:

    首先,你必須不斷地尋求改善和提升自己。而提升自己的最好方法是閱讀,下面有幾本書,對我的軟件架構技能的提升很大。推薦給大家:

    除了閱讀,還有沒有其他需要注意的、或者在平時需要關注的東西呢?

    • 每隔一兩年學習一門新語言,F#是個不錯的選擇。
    • 選擇一個重點領域,但是盡可能對許多技術有個高層次的理解
    • 對你所關注的重點領域,開通一個博客并且繼續拓展該領域的知識面,讓自己漸漸成為一名專家。
    • 與不同的技術、編程語言、設計模式和結構等(甚至是它并沒有在日常中給予你直接的幫助)打交道。你永遠都不知道這些知識是否會在未來派上用場,但是對你絕對是有益無害。
    • 根據你的目標受眾來談論“語言”。作為一名架構師,你將會與各種各樣等級的人打交道,并且他們對技術的理解也會有所不同。所以要學會調整你的講解方式,做到因人制宜,讓他們能夠理解。
    • 閱讀博客、觀看/參加Twitter或G+、聽播客、讀雜志、參加用戶小組會議和技術會議,并且在這些會議上踴躍發言。這些都會給你帶來無窮無盡的知識和樂趣,建立自己的“品牌”和提供交流機會。
    • 紀律是關鍵。永遠做你自己最喜歡的工作,即使它聽起來不那么有趣。每天安排時間學習一些新的東西,即使是15分鐘也可,千萬不要被其他事情占用了這段時間。
    • 開啟博客之旅。我發現,與閱讀比起來,把東西寫下來會讓你有更深入的理解。
    • 利用好“閑暇時間”,這段時間可以拿本雜志讀讀,或者去聽聽播客等。
    • 了解各種可用的開發工具,可以使架構師的工作更好、更有效
    • 看許多不同項目里的架構
    • 學習各個項目的管理方法
    • 學習一些評估技術,對業務可以提供有價值的評估

    上面是作者總結出來的列表,雖然看起來有點枯燥無味,但在整個軟件開發過程中是樂趣無窮的。如果你還有更好的建議,歡迎與我們分享。

    來自:How to Become a Software Architect

    posted @ 2014-06-18 22:49 java光環| 編輯 收藏

    Maven3 在Mac平臺安裝

     

    Maven在Mac平臺安裝

    如果有安裝XCode, XCode會自動幫你安裝Maven, 安裝在/usr/share/java/

    安裝3.0.3

    1. http://maven.apache.org/download.html下載maven 3.0.3
    2. 將apache-maven-3.0.3-bin.tar.gz解壓縮到/usr/share/java
    3. 移除/usr/share下的softlink maven
    4. ln -s /usr/share/java/apache-maven-3.0.3 /usr/share/maven
    5. 修改~/.profile 設定M3_HOME=/usr/share/java/apache-maven-3.0.3

      注意事項

      不能同時設M2_HOME與M3_HOME兩個環境變數, 不然執行maven會出現以下的exception
      Exception in thread "main" java.lang.NoClassDefFoundError: org/codehaus/plexus/classworlds/launcher/Launcher  Caused by: java.lang.ClassNotFoundException: org.codehaus.plexus.classworlds.launcher.Launcher   at java.net.URLClassLoader$1.run(URLClassLoader.java:202)   at java.security.AccessController.doPrivileged(Native Method)   at java.net.URLClassLoader.findClass(URLClassLoader.java:190)   at java.lang.ClassLoader.loadClass(ClassLoader.java:307)   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)   at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
      參考:http://cb.esast.com/cb/wiki/22945



      Installing Maven 3 on OS X

      1. Install Mac Ports
      2. Install Maven 3

      Open a terminal and type the following:

      sudo port install maven3 maven_select
      sudo maven_select maven3

    posted @ 2011-05-31 14:12 java光環 閱讀(3966) | 評論 (0)編輯 收藏

    jboss AS 使用websphere MQ 連接方式



    MBean Name: Domain Name: jboss.jca

    service: ConnectionFactoryBinding

    name: /wmq/XAQueueConnectionFactory
    MBean Java Class: org.jboss.resource.connectionmanager.ConnectionFactoryBindingService


    /** Whether to use the java naming context */
       protected boolean useJavaContext = true;


    src/main/org/jboss/resource/adapter/jms/inflow/JmsActivationSpec.java:
    Caused by: javax.jms.JMSException: MQJCA1018:Only one session per connection allowed.
    /** The maximum number of sessions */
       private int maxSession = 15;

    <tx-connection-factory>
        <jndi-name>/wmq/XAQueueConnectionFactory</jndi-name>
        <xa-transaction>
        </xa-transaction>
        <rar-name>wmq.jmsra.rar</rar-name>
        <connection-definition>javax.jms.ConnectionFactory</connection-definition>
        <config-property name="channel" type="java.lang.String">SYSTEM.ADMIN.SVRCONN</config-property>
        <config-property name="hostName" type="java.lang.String">192.168.123.20</config-property>
        <config-property name="port" type="java.lang.String">1420</config-property>
        <config-property name="queueManager" type="java.lang.String">QM.NODE.20</config-property>
        <config-property name="maxSession" type="java.lang.String">1</config-property>
        <use-java-context>false</use-java-context>
        <max-pool-size>20</max-pool-size>
      </tx-connection-factory>


    posted @ 2009-08-04 14:00 java光環 閱讀(845) | 評論 (0)編輯 收藏

    了解OptimalJ



    OptimalJ是一款高級的企業級應用開發環境,它使用成熟的模式(Pattern) 直接從可視化模型生成全面的、可運行的J2EE應用系統,實現了最好的實踐經驗并基于J2EE規則編寫代碼。使用OMG的模型驅動架構標準, OptimalJ幫助簡化開發,使架構師、設計人員和開發人員快速開發可靠的應用系統

    MDA的開發工具OptimalJ總共有三個版本:
    一、架構版本
    1、可以定制模型和增加、修改刪除轉換模式。
    2、涵蓋專業版本的所有功能。
    3、適合公司的架構師使用。
    二、專業版本
    1、開發PIM、PSM和代碼模型。
    2、涵蓋開發版本的所有功能。
    3、適合公司的分析和設計人員使用。
    三、開發版本
    1、可以只讀PIM、PSM模型,可以修改Free Block的代碼,并添加自己的代碼。
    2、可以調試、運行測試系統的功能。
    3、適合公司的開發人員使用。

    posted @ 2009-03-19 12:59 java光環 閱讀(297) | 評論 (0)編輯 收藏

    tomcat 如何跟蹤調試




    看了好多關于tomcat 如何跟蹤的文檔
    大多說要手工加上debug
    Tomcat:在catalina.bat中:%_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS%后面加上
    -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1044

    其實還有更簡單的做法:

    修改startup.sh
    在最后一行啟動代碼中加上  jpda 即可
    參考如下:
    exec "$PRGDIR"/"$EXECUTABLE" jpda start "$@"

    posted @ 2008-08-28 15:46 java光環 閱讀(1646) | 評論 (1)編輯 收藏

    linux 下的jadclipse plugin 的安裝

     

    需要下載包:
    1.dwonload jad包
    http://www.kpdus.com/jad.html#download
    http://www.kpdus.com/jad/linux/jadls158.zip
    (Jad 1.5.8e for Linux (statically linked) (389972 bytes) - take this version if the one above crashes or displays the "seek error" message. )
    2.download jadclipse包
    http://jaist.dl.sourceforge.net/sourceforge/jadclipse/net.sf.jadclipse_3.3.0.jar
    嘗試這個地址查找最新包:   http://sourceforge.net/project/showfiles.php?group_id=40205

    步驟:
    1.  解壓jadls158.zip 到/home/zhangjunqing/devTools/這包僅兩 個文件,jad , Readme.txt. 
    2.  net.sf.jadclipse_3.3.0.jar 此包copy 到eclipse\plugins目錄下
    3. 啟動Eclipse后,在Windows——>Perference——>Java下面應該會多出一個JadClipse目錄,
    修改配置jadclipse:設置path to decompiler為jad 的全路徑,如:/home/zhangjunqing/devTools/jad
    可在Directory for temporary files中指定臨時文件的路徑
    4.查Eclipse的Windows——>Perference——>General->Editors->File Associations中修改“*.class”默認關聯的編輯器為“JadClipse Class File Viewer”
    5.安裝完成,雙擊class文件,Eclipse將自動反編譯了。
    trouble:
    在執行步驟5時遇到如下錯誤:
    /home/zhangjunqing/devTools/jad: error while loading shared libraries: libstdc++-libc6.2-2.so.3: cannot open shared object file: No such file or directory
    我用的linux 為ubuntu 7.10.    執行以下命令,

    sudo apt-get install libstdc++2.10-glibc2.2

    重啟eclipse 后解決 。

    ##


    posted @ 2008-04-30 13:56 java光環 閱讀(1775) | 評論 (0)編輯 收藏

    PSIVTRun jndi 驗證成功


    關鍵詞:   PSIVTRun    MQQueueManager

    一般的進行nojndi 驗證全能成功,下面進行jndi 方式的驗證:
    要先建jndi , 供PSIVTRun 默認使用.
    cd /opt/mqm/java/bin
    ./JMSAdmin
    DEFINE TCF(ivtTCF)
    --This command defines the TopicConnectionFactory.
    DEFINE T(ivtT) TOPIC(MQJMS/PSIVT/Information)
    --This command defines the Topic.

    執行命令:
    ./PSIVTRun -url "file:/JNDI-Directory" -icf com.sun.jndi.fscontext.RefFSContextFactory
    即可.

    [djboss@DevStation1 bin]$ ./PSIVTRun -url "file:/JNDI-Directory" -icf com.sun.jndi.fscontext.RefFSContextFactory
     
    5724-H72, 5655-L82, 5724-L26 (c) Copyright IBM Corp. 2002, 2005. All Rights Reserved.
    用于 Java(tm) 消息服務的 Websphere MQ 類 6.0
    發布/預訂安裝驗證測試
     
    正在使用受管對象,請確保它們可用
    正在檢索來自 JNDI 的 TopicConnectionFactory
    正在檢索來自 JNDI 的 Topic
    正在創建 Connection
    正在創建 Session
    正在創建 TopicPublisher
    正在創建 TopicSubscriber
    正在創建 TextMessage
    正在添加文本
    正在將消息發布至 topic://MQJMS/PSIVT/Information
    正在等待消息抵達[最大為 5 秒]...
     
    取出消息:
    JMS 消息類: jms_text
      JMSType:         null
      JMSDeliveryMode: 2
      JMSExpiration:   0
      JMSPriority:     4
      JMSMessageID:    ID:414d5120706172656e74323020202020060ee147c5da0020
      JMSTimestamp:    1206523343329
      JMSCorrelationID:ID:414d5120706172656e74323020202020060ee14705680320
      JMSDestination:  topic://MQJMS/PSIVT/Information
      JMSReplyTo:      null
      JMSRedelivered:  false
      JMS_IBM_PutDate:20080326
      JMSXAppID:parent20                   
      JMS_IBM_Format:MQSTR  
      JMS_IBM_PutApplType:26
      JMS_IBM_MsgType:8
      JMSXUserID:djboss     
      JMS_IBM_PutTime:09222333
      JMSXDeliveryCount:1
    A simple text message from the MQJMSPSIVT program
    應答字符串等于原始字符串
    正在關閉 TopicSubscriber
    正在關閉 TopicPublisher
    正在關閉 Session
    正在關閉 Connection
    PSIVT 已完成
     
    [djboss@DevStation1 bin]$


    若遇到如下錯誤,是由于默認隊列管理器沒有建立.

    [tjboss@TestStation30 bin]$ ./PSIVTRun -url "file:/JNDI-Directory" -icf com.sun.jndi.fscontext.RefFSContextFactory
     
    5724-H72, 5655-L82, 5724-L26 (c) Copyright IBM Corp. 2002, 2005. All Rights Reserved.
    用于 Java(tm) 消息服務的 Websphere MQ 類 6.0
    發布/預訂安裝驗證測試
     
    正在使用受管對象,請確保它們可用
    正在檢索來自 JNDI 的 TopicConnectionFactory
    正在檢索來自 JNDI 的 Topic
    正在創建 Connection
    捕獲到異常: javax.jms.JMSException: MQJMS2005: 未能為 '' 創建 MQQueueManager
    鏈接的異常: com.ibm.mq.MQException: MQJE001: 完成代碼是 2,原因為 2059
    PSIVT 已完成
     
    winXP 上用圖形的隊列管理器工具就可以了.

    修改屬性圖:


    若為lunix 環境:
    修改在mqm 用戶的當前目錄有文件mqs.ini
    直接修改加入
    DefaultQueueManager:
       Name=parent20
    也可用命令產生:
    >crtmqm -q testQM 
    這條語句將產生
    DefaultQueueManager:
       Name=testQM
    改成你想要的結果即可.

    參考資料:
    The publish/subscribe installation verification test
    MQJMS5062 2085 PSIVTRun with JNDI failed

    posted @ 2008-03-25 14:45 java光環 閱讀(830) | 評論 (0)編輯 收藏

    websphere mq 不能訪問集群中其它節點對列

    2008-03-23 12:49:02,310 WARN  [CMPP Protocol Thread :adaptor2 -- 58] [com.arjuna.ats.arjuna.logging.arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator_2] TwoPhaseCoordinator.beforeCompletion - failed for com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple@f69bf2
    org.springframework.jms.InvalidDestinationException: MQJMS2008: 未能打開 MQ 隊列 CENTER; nested exception is javax.jms.InvalidDestinationException: MQJMS2008: 未能打開 MQ 隊列 CENTER; nested exception is com.ibm.mq.MQException: MQJE001: 完成代碼是 2,原因為 2085
    Caused by:
    javax.jms.InvalidDestinationException: MQJMS2008: 未能打開 MQ 隊列 CENTER
            at com.ibm.mq.jms.MQQueueServices.getQueueOpenException(MQQueueServices.java:412)
            at com.ibm.mq.jms.MQQueueServices.getOutputQueue(MQQueueServices.java:354)
            at com.ibm.mq.jms.JMSServicesMgr.getOutputQueue(JMSServicesMgr.java:145)
            at com.ibm.mq.jms.MQSession.createQSender(MQSession.java:6359)
            at com.ibm.mq.jms.MQQueueSession.createSender(MQQueueSession.java:240)
            at com.ibm.mq.jms.MQQueueSession.createProducer(MQQueueSession.java:360)
            at org.springframework.jms.core.JmsTemplate.doCreateProducer(JmsTemplate.java:846)
            at org.springframework.jms.core.JmsTemplate.createProducer(JmsTemplate.java:827)
            at org.springframework.jms.core.JmsTemplate.doSend(JmsTemplate.java:505)
            at org.springframework.jms.core.JmsTemplate$2.doInJms(JmsTemplate.java:477)
            at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:428)
            at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:475)
            at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:467)
            at com.wxxr.common.service.JMSDataTransferer.transfer(JMSDataTransferer.java:48)
            at com.wxxr.workstation.jboss.service.WSDataTransferInterceptor$1.invoke(WSDataTransferInterceptor.java:66)
            at com.wxxr.common.service.UserCacheLoaderService$updateObject_7337301020227518154.invokeNext(UserCacheLoaderService$updateObject_7337301020227518154.java)
            at com.wxxr.common.service.UserCacheLoaderService.updateObject(UserCacheLoaderService.java)
            at com.wxxr.common.service.BizObjectCacheLoader.updateNode(BizObjectCacheLoader.java:391)
            at com.wxxr.common.service.BizObjectCacheLoader.put(BizObjectCacheLoader.java:255)
            at com.wxxr.common.service.BizObjectCacheLoader.prepare(BizObjectCacheLoader.java:479)
            at org.jboss.cache.interceptors.CacheStoreInterceptor.prepareCacheLoader(CacheStoreInterceptor.java:258)
            at org.jboss.cache.interceptors.CacheStoreInterceptor.invoke(CacheStoreInterceptor.java:131)
            at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:68)
            at org.jboss.cache.interceptors.TxInterceptor.runPreparePhase(TxInterceptor.java:873)
            at org.jboss.cache.interceptors.TxInterceptor$LocalSynchronizationHandler.beforeCompletion(TxInterceptor.java:1156)
            at org.jboss.cache.interceptors.OrderedSynchronizationHandler.beforeCompletion(OrderedSynchronizationHandler.java:75)
            at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:114)
            at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:247)
            at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:86)
            at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:177)
            at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1389)
            at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:135)
            at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:87)
            at org.jboss.aspects.tx.TxPolicy.endTransaction(TxPolicy.java:175)
            at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:87)
            at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
            at com.wxxr.common.jboss.ExJMSGateKeeper$MyMessageListener$onMessage_N6811220613805550889.invokeNext(ExJMSGateKeeper$MyMessageListener$onMessage_N6811220613805550889.java)
            at com.wxxr.common.jboss.ExJMSGateKeeper$MyMessageListener.onMessage(ExJMSGateKeeper.java)
            at com.wxxr.network.adaptor.cmpp.CMPPProtocolService.processReceivedMessage(CMPPProtocolService.java:643)
            at com.wxxr.network.adaptor.cmpp.CMPPProtocolService.handleEvent(CMPPProtocolService.java:627)
            at com.wxxr.network.adaptor.cmpp.AbstractCMPPSession.processMessage(AbstractCMPPSession.java:481)
            at com.wxxr.network.adaptor.cmpp.AbstractCMPPClientSession.processReceivePacket(AbstractCMPPClientSession.java:73)
            at com.wxxr.network.adaptor.cmpp.AbstractCMPPSession$4.run(AbstractCMPPSession.java:1001)
            at com.hygensoft.common.util.AnotherThreadPoolExecutor$Worker.runTask(AnotherThreadPoolExecutor.java:397)
            at com.hygensoft.common.util.AnotherThreadPoolExecutor$Worker.run(AnotherThreadPoolExecutor.java:422)
            at java.lang.Thread.run(Thread.java:595)

    環境:

    2008年01月23日 20時05分54秒 - Process(28036.1) User(jboss) Program(dspmq)
    AMQ6047: Conversion not supported.
     
    EXPLANATION:
    WebSphere MQ is unable to convert string data tagged in CCSID 0 to data in
    CCSID 0.
    ACTION:
    Check the WebSphere MQ Application Programming Reference Appendix and the
    appropriate National Language Support publications to see if the CCSIDs  are
    supported by your system.
    ----- amqxfdcx.c : 768 --------------------------------------------------------



    192.168.5.9

    InitCtx> dis q(queue.SendQueue)
     
        FAILIFQUIESCE(YES)
        QUEUE(CENTER)
        QMANAGER()
        PERSISTENCE(APP)
        CCSID(1208)
        TARGCLIENT(JMS)
        ENCODING(NATIVE)
        PRIORITY(APP)
        EXPIRY(APP)
        VERSION(6)
     
    InitCtx>




    192.168.5.10
    InitCtx> dis q(queue.SendQueue)
     
        FAILIFQUIESCE(YES)
        QUEUE(CENTER)
        QMANAGER()
        PERSISTENCE(APP)
        CCSID(1208)
        TARGCLIENT(JMS)
        ENCODING(NATIVE)
        PRIORITY(APP)
        EXPIRY(APP)
        VERSION(6)
     
    InitCtx>

    192.168.1.6
    InitCtx> dis q(queue.ReceiveQueue)
     
        FAILIFQUIESCE(YES)
        QUEUE(CENTER)
        QMANAGER(QM.CENTER)
        PERSISTENCE(APP)
        CCSID(1208)
        TARGCLIENT(JMS)
        ENCODING(NATIVE)
        PRIORITY(APP)
        EXPIRY(APP)
        VERSION(6)
    InitCtx> dis q(queue.SendQueue.guangzhou)
     
        FAILIFQUIESCE(YES)
        QUEUE(GUANGZHOU)
        QMANAGER()
        PERSISTENCE(APP)
        CCSID(1208)
        TARGCLIENT(JMS)
        ENCODING(NATIVE)
        PRIORITY(APP)
        EXPIRY(APP)
        VERSION(6)
    InitCtx>


    經查文檔:
    zh_CN.gb18030 簡體中文 GB18030 5488

    參考鏈接:
    How to find the CCSID value associated with the coded character set for a locale in a UNIX session
    MQ client does not work unless export MQCCSID is used
    XC076001 with a reason code of xecX_E_CONV_NOT_SUP when LC_ALL is left blank


    解決方案:
    集群環境出了問題,原因不詳,在CENTER 節點,找到不正常的對列將其刪除.
    RESET CLUSTER(WXXRCLUS) ACTION(FORCEREMOVE) QMID('QM.GUANGDONG2_2008-03-10_14.37.13') QUEUES(YES)
    (注:其中的QMID 可以通過websphere MQ 資源管理器/隊列管理器集群/WXXRCLUS/完整存儲庫/qm.center 中找到不正常隊列的QMID.)

    posted @ 2008-03-23 22:06 java光環 閱讀(3234) | 評論 (0)編輯 收藏

    tomcat 不能啟動

    關鍵詞 : tomcat session EOFException

    嚴重: IOException while loading persisted sessions: java.io.EOFException
    嚴重: Exception loading sessions from persistent storage

    原因是tomcat對硬盤的session讀取失敗,徹底解決辦法一下:將work下面的文件清空,主要是*.ser文件,或者只是刪除掉session.ser即可以解決。


    -------------日志如下:
    Listening for transport dt_socket at address: 17001
    2008-3-20 15:51:57 org.apache.coyote.http11.Http11Protocol init
    信息: Initializing Coyote HTTP/1.1 on http-8081
    2008-3-20 15:51:58 org.apache.catalina.startup.Catalina load
    信息: Initialization processed in 719 ms
    2008-3-20 15:51:58 org.apache.catalina.core.StandardService start
    信息: Starting service Catalina
    2008-3-20 15:51:58 org.apache.catalina.core.StandardEngine start
    信息: Starting Servlet Engine: Apache Tomcat/5.5.9
    2008-3-20 15:51:58 org.apache.catalina.core.StandardHost start
    信息: XML validation disabled
    2008-3-20 15:51:58 org.apache.catalina.core.ApplicationContext log
    信息: org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News / Redirect URL: http://www.cnn.com], [org.apache.webapp.balancer.rules.RequestParameterRule: Target param name: paramName / Target param value: paramValue / Redirect URL: http://www.yahoo.com], [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL: http://jakarta.apache.org]]
    log4j:WARN No appenders could be found for logger (org.apache.catalina.session.ManagerBase).
    log4j:WARN Please initialize the log4j system properly.
    2008-3-20 15:51:59 org.apache.catalina.core.ApplicationContext log
    信息: ContextListener: contextInitialized()
    2008-3-20 15:51:59 org.apache.catalina.core.ApplicationContext log
    信息: SessionListener: contextInitialized()
    2008-3-20 15:51:59 org.apache.catalina.core.ApplicationContext log
    信息: ContextListener: contextInitialized()
    2008-3-20 15:51:59 org.apache.catalina.core.ApplicationContext log
    信息: SessionListener: contextInitialized()
    log4j:WARN No appenders could be found for logger (org.apache.catalina.session.ManagerBase).
    log4j:WARN Please initialize the log4j system properly.
    2008-3-20 15:52:05 org.apache.catalina.session.StandardManager doLoad
    嚴重: IOException while loading persisted sessions: java.io.EOFException
    java.io.EOFException
     at java.io.ObjectInputStream$PeekInputStream.readFully(Unknown Source)
     at java.io.ObjectInputStream$BlockDataInputStream.readShort(Unknown Source)
     at java.io.ObjectInputStream.readStreamHeader(Unknown Source)
     at java.io.ObjectInputStream.<init>(Unknown Source)
     at org.apache.catalina.util.CustomObjectInputStream.<init>(CustomObjectInputStream.java:57)
     at org.apache.catalina.session.StandardManager.doLoad(StandardManager.java:361)
     at org.apache.catalina.session.StandardManager.load(StandardManager.java:320)
     at org.apache.catalina.session.StandardManager.start(StandardManager.java:634)
     at org.apache.catalina.core.ContainerBase.setManager(ContainerBase.java:431)
     at org.apache.catalina.startup.ContextConfig.managerConfig(ContextConfig.java:391)
     at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:1042)
     at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:255)
     at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
     at org.apache.catalina.core.StandardContext.start(StandardContext.java:4053)
     at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
     at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
     at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
     at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:894)
     at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:857)
     at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:475)
     at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1102)
     at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
     at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
     at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1020)
     at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
     at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012)
     at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
     at org.apache.catalina.core.StandardService.start(StandardService.java:450)
     at org.apache.catalina.core.StandardServer.start(StandardServer.java:683)
     at org.apache.catalina.startup.Catalina.start(Catalina.java:537)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
     at java.lang.reflect.Method.invoke(Unknown Source)
     at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
     at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)
    2008-3-20 15:52:05 org.apache.catalina.session.StandardManager start
    嚴重: Exception loading sessions from persistent storage
    java.io.EOFException
     at java.io.ObjectInputStream$PeekInputStream.readFully(Unknown Source)
     at java.io.ObjectInputStream$BlockDataInputStream.readShort(Unknown Source)
     at java.io.ObjectInputStream.readStreamHeader(Unknown Source)
     at java.io.ObjectInputStream.<init>(Unknown Source)
     at org.apache.catalina.util.CustomObjectInputStream.<init>(CustomObjectInputStream.java:57)
     at org.apache.catalina.session.StandardManager.doLoad(StandardManager.java:361)
     at org.apache.catalina.session.StandardManager.load(StandardManager.java:320)
     at org.apache.catalina.session.StandardManager.start(StandardManager.java:634)
     at org.apache.catalina.core.ContainerBase.setManager(ContainerBase.java:431)
     at org.apache.catalina.startup.ContextConfig.managerConfig(ContextConfig.java:391)
     at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:1042)
     at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:255)
     at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
     at org.apache.catalina.core.StandardContext.start(StandardContext.java:4053)
     at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
     at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
     at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
     at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:894)
     at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:857)
     at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:475)
     at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1102)
     at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
     at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
     at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1020)
     at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
     at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012)
     at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
     at org.apache.catalina.core.StandardService.start(StandardService.java:450)
     at org.apache.catalina.core.StandardServer.start(StandardServer.java:683)
     at org.apache.catalina.startup.Catalina.start(Catalina.java:537)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
     at java.lang.reflect.Method.invoke(Unknown Source)
     at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
     at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)
    2008-3-20 15:52:05 org.apache.coyote.http11.Http11Protocol start
    信息: Starting Coyote HTTP/1.1 on http-8081
    2008-3-20 15:52:05 org.apache.jk.common.ChannelSocket init
    信息: JK: ajp13 listening on /0.0.0.0:8009
    2008-3-20 15:52:05 org.apache.jk.server.JkMain start
    信息: Jk running ID=0 time=0/31  config=null
    2008-3-20 15:52:05 org.apache.catalina.storeconfig.StoreLoader load
    信息: Find registry server-registry.xml at classpath resource
    2008-3-20 15:52:06 org.apache.catalina.startup.Catalina start
    信息: Server startup in 8093 ms

    posted @ 2008-03-20 16:41 java光環 閱讀(1182) | 評論 (1)編輯 收藏

    mysql 用戶授權


    show databases;

    root 給jboss 用戶授權:
    grant all on jbpm.* to jboss@localhost identified by 'jboss';

    jboss 用戶登錄:
    mysql -ujboss -pjboss

    :)

    posted @ 2008-03-06 18:15 java光環 閱讀(364) | 評論 (0)編輯 收藏

    查主鍵沖突所在的表語句


    用以下語句可查主鍵沖突所在的表:
    如 nested throwable: (java.sql.SQLException: ORA-00001: unique constraint (DEVSTATION3.SYS_C0019365) violated
    --

    select owner,CONSTRAINT_NAME,table_name from user_CONSTRAINTS where CONSTRAINT_NAME='SYS_C0066622'

    posted @ 2007-11-28 14:19 java光環 閱讀(689) | 評論 (0)編輯 收藏

    win xp 下實現的linux MQ6.0 遠程隊列管理


    開發環境是在linux redhat 上,
    開發機為win Xp OS
    MQ version 6.0.
    目的:Xp 遠程管理linux 下的MQ 隊列管理器

    在linux 上,我已經將jboss 加入到了mqm 組
    用jboss 登錄linux 做以下操作(以下是參考網友配置,已經不能再精簡了)
    1.    runmqsc QM.NODE.20
    2.    define channel(SYSTEM.ADMIN.SVRCONN) CHLTYPE(SVRCONN) MCAUSER('mqm')
    3.    alter qmgr CCSID(1381)
    4.    END
    5.    endmqm QM.NODE.20
    6.    strmqm QM.NODE.20
    7.    strmqcsv QM.NODE.20
    8.    runmqlsr -t tcp -p 1421 -m QM.NODE.20 &
    9.    netstat -an |grep 1421

    win xp 開發機用戶為本機管理員(administrator)
    啟初想把管理員加入到 上面語句的MCAUSER 中,結果報錯說'administrator' 字符太長,失敗.
    在win xp 下把本機管理員加入到mqm 組.
    即可成功

    posted @ 2007-10-19 18:16 java光環 閱讀(1035) | 評論 (0)編輯 收藏

    activemq-4.2 SNAPSHOT 嵌入到jboss-4.0.3sp1的異常

    下載包為:
    activemq-rar-4.2-incubator-SNAPSHOT-20070121.082022-22.rar

    異常1:

    ??? [java] 00:58:46,434 WARN? [ServiceController] Problem starting service jboss.jca:service=RARDepl
    oyment,name='activemq-rar-4.2-incubator-SNAPSHOT-20070121.082022-22.rar'
    ??? [java] javax.resource.spi.ResourceAdapterInternalException: Failed to startup an embedded broker
    : xbean:broker-config.xml, due to: java.lang.IllegalStateException: Could not find valid implementat
    ion for: 2.0

    ??? [java]????? at org.apache.activemq.ra.ActiveMQResourceAdapter.start(ActiveMQResourceAdapter.java
    :83)
    ??? [java]????? at org.jboss.resource.deployment.RARDeployment.startService(RARDeployment.java:107)
    ??? [java]????? at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:
    274)
    ??? [java]????? at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.j
    ava:230)
    ??? [java]????? at org.jboss.system.ServiceDynamicMBeanSupport.invoke(ServiceDynamicMBeanSupport.jav
    a:110)
    ??? [java]????? at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:150)
    ??? [java]????? at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
    ??? [java]????? at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:943
    )
    ??? [java]????? at $Proxy0.start(Unknown Source)
    ??? [java]????? at org.jboss.system.ServiceController.start(ServiceController.java:428)
    ??? [java]????? at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
    ??? [java]????? at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java
    :25)
    ??? [java]????? at java.lang.reflect.Method.invoke(Method.java:585)
    ??? [java]????? at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)

    ??? [java]????? at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
    ??? [java]????? at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
    ??? [java]????? at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
    ??? [java]????? at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
    ??? [java]????? at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
    ??? [java]????? at $Proxy33.start(Unknown Source)
    ??? [java]????? at org.jboss.deployment.SimpleSubDeployerSupport.startService(SimpleSubDeployerSuppo
    rt.java:330)
    ??? [java]????? at org.jboss.deployment.SimpleSubDeployerSupport.start(SimpleSubDeployerSupport.java
    :112)
    ??? [java]????? at org.jboss.deployment.MainDeployer.start(MainDeployer.java:989)
    ??? [java]????? at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:790)
    ??? [java]????? at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:753)
    ??? [java]????? at sun.reflect.GeneratedMethodAccessor40.invoke(Unknown Source)
    ??? [java]????? at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java
    :25)
    ??? [java]????? at java.lang.reflect.Method.invoke(Method.java:585)
    ??? [java]????? at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)

    ??? [java]????? at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
    ??? [java]????? at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:118)

    ??? [java]????? at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
    ??? [java]????? at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperatio
    nInterceptor.java:127)
    ??? [java]????? at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
    ??? [java]????? at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
    ??? [java]????? at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
    ??? [java]????? at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
    ??? [java]????? at $Proxy9.deploy(Unknown Source)
    ??? [java]????? at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.jav
    a:319)
    ??? [java]????? at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:
    507)
    ??? [java]????? at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(Abstr
    actDeploymentScanner.java:192)
    ??? [java]????? at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeplo
    ymentScanner.java:265)
    ??? [java]????? at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:
    274)
    ??? [java]????? at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.j
    ava:230)
    ??? [java]????? at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    ??? [java]????? at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java
    :25)
    ??? [java]????? at java.lang.reflect.Method.invoke(Method.java:585)
    ??? [java]????? at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)

    ??? [java]????? at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
    ??? [java]????? at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
    ??? [java]????? at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
    ??? [java]????? at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
    ??? [java]????? at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:943
    )
    ??? [java]????? at $Proxy0.start(Unknown Source)
    ??? [java]????? at org.jboss.system.ServiceController.start(ServiceController.java:428)
    ??? [java]????? at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
    ??? [java]????? at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java
    :25)
    ??? [java]????? at java.lang.reflect.Method.invoke(Method.java:585)
    ??? [java]????? at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)

    ??? [java]????? at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
    ??? [java]????? at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
    ??? [java]????? at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
    ??? [java]????? at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
    ??? [java]????? at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
    ??? [java]????? at $Proxy4.start(Unknown Source)
    ??? [java]????? at org.jboss.deployment.SARDeployer.start(SARDeployer.java:285)
    ??? [java]????? at org.jboss.deployment.MainDeployer.start(MainDeployer.java:989)
    ??? [java]????? at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:790)
    ??? [java]????? at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:753)
    ??? [java]????? at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:737)
    ??? [java]????? at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    ??? [java]????? at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    ??? [java]????? at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java
    :25)
    ??? [java]????? at java.lang.reflect.Method.invoke(Method.java:585)
    ??? [java]????? at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)

    ??? [java]????? at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
    ??? [java]????? at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:118)

    ??? [java]????? at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
    ??? [java]????? at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperatio
    nInterceptor.java:127)
    ??? [java]????? at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
    ??? [java]????? at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
    ??? [java]????? at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
    ??? [java]????? at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
    ??? [java]????? at $Proxy5.deploy(Unknown Source)
    ??? [java]????? at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:453)
    ??? [java]????? at org.jboss.system.server.ServerImpl.org$jboss$system$server$ServerImpl$start$aop(S
    erverImpl.java:330)
    ??? [java]????? at org.jboss.system.server.ServerImpl$start_N8025343665958530775.invokeNext(ServerIm
    pl$start_N8025343665958530775.java)
    ??? [java]????? at com.wxxr.common.aop.bootrap.JBossServerStartupInterceptor.invoke(JBossServerStart
    upInterceptor.java:36)
    ??? [java]????? at org.jboss.system.server.ServerImpl$start_N8025343665958530775.invokeNext(ServerIm
    pl$start_N8025343665958530775.java)
    ??? [java]????? at org.jboss.system.server.ServerImpl.start(ServerImpl.java)
    ??? [java]????? at org.jboss.Main.boot(Main.java:187)
    ??? [java]????? at org.jboss.Main$1.run(Main.java:438)
    ??? [java]????? at java.lang.Thread.run(Thread.java:595)
    ??? [java] Caused by: java.lang.IllegalStateException: Could not find valid implementation for: 2.0
    ??? [java]????? at org.apache.xbean.spring.context.impl.XBeanHelper.createBeanDefinitionReader(XBean
    Helper.java:48)
    ??? [java]????? at org.apache.xbean.spring.context.ClassPathXmlApplicationContext.loadBeanDefinition
    s(ClassPathXmlApplicationContext.java:170)
    ??? [java]????? at org.springframework.context.support.AbstractRefreshableApplicationContext.refresh
    BeanFactory(AbstractRefreshableApplicationContext.java:89)
    ??? [java]????? at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractAp
    plicationContext.java:268)
    ??? [java]????? at org.apache.xbean.spring.context.ClassPathXmlApplicationContext.<init>(ClassPathXm
    lApplicationContext.java:161)
    ??? [java]????? at org.apache.xbean.spring.context.ClassPathXmlApplicationContext.<init>(ClassPathXm
    lApplicationContext.java:51)
    ??? [java]????? at org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java
    :41)
    ??? [java]????? at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:57)
    ??? [java]????? at org.apache.activemq.ra.ActiveMQResourceAdapter.start(ActiveMQResourceAdapter.java
    :80)
    ??? [java]????? ... 92 more
    ??? [java] Caused by: java.lang.reflect.InvocationTargetException
    ??? [java]????? at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    ??? [java]????? at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorIm
    pl.java:39)
    ??? [java]????? at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAc
    cessorImpl.java:27)
    ??? [java]????? at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
    ??? [java]????? at org.apache.xbean.spring.context.impl.XBeanHelper.createBeanDefinitionReader(XBean
    Helper.java:46)
    ??? [java]????? ... 100 more
    ??? [java] Caused by: java.lang.NoSuchMethodError: org.springframework.beans.factory.xml.XmlBeanDefi
    nitionReader.setValidationMode(I)V
    ??? [java]????? at org.apache.xbean.spring.context.v2.XBeanXmlBeanDefinitionReader.<init>(XBeanXmlBe
    anDefinitionReader.java:58)
    ??? [java]????? ... 105 more

    解決辦法:
    spring 的jar包有重復,刪除spring-1.4.jar,保留spring-2.0.jar


    異常2:

    ??? [java] 01:02:27,663 INFO? [XBeanXmlBeanDefinitionReader] Loading XML bean definitions from class
    ?path resource [broker-config.xml]
    ??? [java] 01:02:27,927 WARN? [ServiceController] Problem starting service jboss.jca:service=RARDepl
    oyment,name='activemq-rar-4.2-incubator-SNAPSHOT-20070121.082022-22.rar'
    ??? [java] javax.resource.spi.ResourceAdapterInternalException: Failed to startup an embedded broker
    : xbean:broker-config.xml, due to: org.springframework.beans.factory.BeanDefinitionStoreException: U
    nrecognized xbean element mapping: beans in namespace
    http://activemq.org/config/1.0
    ??? [java]????? at org.apache.activemq.ra.ActiveMQResourceAdapter.start(ActiveMQResourceAdapter.java
    :83)
    ??? [java]????? at org.jboss.resource.deployment.RARDeployment.startService(RARDeployment.java:107)
    ??? [java]????? at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:
    274)
    ??? [java]????? at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.j
    ava:230)
    ??? [java]????? at org.jboss.system.ServiceDynamicMBeanSupport.invoke(ServiceDynamicMBeanSupport.jav
    a:110)
    ??? [java]????? at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:150)
    ??? [java]????? at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
    ??? [java]????? at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:943
    )
    ??? [java]????? at $Proxy0.start(Unknown Source)
    ??? [java]????? at org.jboss.system.ServiceController.start(ServiceController.java:428)
    ??? [java]????? at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
    ??? [java]????? at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java
    :25)
    ??? [java]????? at java.lang.reflect.Method.invoke(Method.java:585)
    ??? [java]????? at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)

    ??? [java]????? at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
    ??? [java]????? at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
    ??? [java]????? at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
    ??? [java]????? at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
    ??? [java]????? at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
    ??? [java]????? at $Proxy33.start(Unknown Source)
    ??? [java]????? at org.jboss.deployment.SimpleSubDeployerSupport.startService(SimpleSubDeployerSuppo
    rt.java:330)
    ??? [java]????? at org.jboss.deployment.SimpleSubDeployerSupport.start(SimpleSubDeployerSupport.java
    :112)
    ??? [java]????? at org.jboss.deployment.MainDeployer.start(MainDeployer.java:989)
    ??? [java]????? at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:790)
    ??? [java]????? at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:753)
    ??? [java]????? at sun.reflect.GeneratedMethodAccessor40.invoke(Unknown Source)
    ??? [java]????? at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java
    :25)
    ??? [java]????? at java.lang.reflect.Method.invoke(Method.java:585)
    ??? [java]????? at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)

    ??? [java]????? at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
    ??? [java]????? at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:118)

    ??? [java]????? at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
    ??? [java]????? at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperatio
    nInterceptor.java:127)
    ??? [java]????? at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
    ??? [java]????? at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
    ??? [java]????? at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
    ??? [java]????? at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
    ??? [java]????? at $Proxy9.deploy(Unknown Source)
    ??? [java]????? at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.jav
    a:319)
    ??? [java]????? at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:
    507)
    ??? [java]????? at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(Abstr
    actDeploymentScanner.java:192)
    ??? [java]????? at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeplo
    ymentScanner.java:265)
    ??? [java]????? at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:
    274)
    ??? [java]????? at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.j
    ava:230)
    ??? [java]????? at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    ??? [java]????? at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java
    :25)
    ??? [java]????? at java.lang.reflect.Method.invoke(Method.java:585)
    ??? [java]????? at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)

    ??? [java]????? at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
    ??? [java]????? at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
    ??? [java]????? at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
    ??? [java]????? at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
    ??? [java]????? at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:943
    )
    ??? [java]????? at $Proxy0.start(Unknown Source)
    ??? [java]????? at org.jboss.system.ServiceController.start(ServiceController.java:428)
    ??? [java]????? at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
    ??? [java]????? at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java
    :25)
    ??? [java]????? at java.lang.reflect.Method.invoke(Method.java:585)
    ??? [java]????? at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)

    ??? [java]????? at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
    ??? [java]????? at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
    ??? [java]????? at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
    ??? [java]????? at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
    ??? [java]????? at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
    ??? [java]????? at $Proxy4.start(Unknown Source)
    ??? [java]????? at org.jboss.deployment.SARDeployer.start(SARDeployer.java:285)
    ??? [java]????? at org.jboss.deployment.MainDeployer.start(MainDeployer.java:989)
    ??? [java]????? at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:790)
    ??? [java]????? at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:753)
    ??? [java]????? at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:737)
    ??? [java]????? at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    ??? [java]????? at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    ??? [java]????? at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java
    :25)
    ??? [java]????? at java.lang.reflect.Method.invoke(Method.java:585)
    ??? [java]????? at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)

    ??? [java]????? at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
    ??? [java]????? at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:118)

    ??? [java]????? at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
    ??? [java]????? at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperatio
    nInterceptor.java:127)
    ??? [java]????? at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
    ??? [java]????? at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
    ??? [java]????? at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
    ??? [java]????? at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
    ??? [java]????? at $Proxy5.deploy(Unknown Source)
    ??? [java]????? at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:453)
    ??? [java]????? at org.jboss.system.server.ServerImpl.org$jboss$system$server$ServerImpl$start$aop(S
    erverImpl.java:330)
    ??? [java]????? at org.jboss.system.server.ServerImpl$start_N8025343665958530775.invokeNext(ServerIm
    pl$start_N8025343665958530775.java)
    ??? [java]????? at com.wxxr.common.aop.bootrap.JBossServerStartupInterceptor.invoke(JBossServerStart
    upInterceptor.java:36)
    ??? [java]????? at org.jboss.system.server.ServerImpl$start_N8025343665958530775.invokeNext(ServerIm
    pl$start_N8025343665958530775.java)
    ??? [java]????? at org.jboss.system.server.ServerImpl.start(ServerImpl.java)
    ??? [java]????? at org.jboss.Main.boot(Main.java:187)
    ??? [java]????? at org.jboss.Main$1.run(Main.java:438)
    ??? [java]????? at java.lang.Thread.run(Thread.java:595)
    ??? [java] Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Unrecognized x
    bean element mapping: beans in namespace http://activemq.org/config/1.0
    ??? [java]????? at org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.parseBeanFromExtensionE
    lement(XBeanNamespaceHandler.java:258)
    ??? [java]????? at org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.parse(XBeanNamespaceHan
    dler.java:152)
    ??? [java]????? at org.apache.xbean.spring.context.v2.XBeanNamespaceHandler.parse(XBeanNamespaceHand
    ler.java:49)
    ??? [java]????? at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomEle
    ment(BeanDefinitionParserDelegate.java:1147)
    ??? [java]????? at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomEle
    ment(BeanDefinitionParserDelegate.java:1137)
    ??? [java]????? at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBe
    anDefinitions(DefaultBeanDefinitionDocumentReader.java:150)
    ??? [java]????? at org.apache.xbean.spring.context.v2.XBeanBeanDefinitionDocumentReader.parseBeanDef
    initions(XBeanBeanDefinitionDocumentReader.java:63)
    ??? [java]????? at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registe
    rBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:89)
    ??? [java]????? at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinit
    ions(XmlBeanDefinitionReader.java:499)
    ??? [java]????? at org.apache.xbean.spring.context.v2.XBeanXmlBeanDefinitionReader.registerBeanDefin
    itions(XBeanXmlBeanDefinitionReader.java:79)
    ??? [java]????? at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitio
    ns(XmlBeanDefinitionReader.java:407)
    ??? [java]????? at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions
    (XmlBeanDefinitionReader.java:357)
    ??? [java]????? at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions
    (XmlBeanDefinitionReader.java:334)
    ??? [java]????? at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDe
    finitions(AbstractBeanDefinitionReader.java:126)
    ??? [java]????? at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDe
    finitions(AbstractBeanDefinitionReader.java:142)
    ??? [java]????? at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDe
    finitions(AbstractBeanDefinitionReader.java:168)
    ??? [java]????? at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinit
    ions(AbstractXmlApplicationContext.java:113)
    ??? [java]????? at org.apache.xbean.spring.context.ClassPathXmlApplicationContext.loadBeanDefinition
    s(ClassPathXmlApplicationContext.java:180)
    ??? [java]????? at org.springframework.context.support.AbstractRefreshableApplicationContext.refresh
    BeanFactory(AbstractRefreshableApplicationContext.java:94)
    ??? [java]????? at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractAp
    plicationContext.java:294)
    ??? [java]????? at org.apache.xbean.spring.context.ClassPathXmlApplicationContext.<init>(ClassPathXm
    lApplicationContext.java:161)
    ??? [java]????? at org.apache.xbean.spring.context.ClassPathXmlApplicationContext.<init>(ClassPathXm
    lApplicationContext.java:51)
    ??? [java]????? at org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java
    :41)
    ??? [java]????? at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:57)
    ??? [java]????? at org.apache.activemq.ra.ActiveMQResourceAdapter.start(ActiveMQResourceAdapter.java
    :80)
    ??? [java]????? ... 92 more
    ??? [java] 01:02:28,345 INFO? [RARDeployment] Required license terms exist, view META-INF/ra.xml in
    .../deploy/jboss-local-jdbc.rar

    解決辦法 :
    <beans? xmlns="

    ? <broker brokerName="sender-ws2" useJmx="true">
    ==》改成:
    <beans>
    ?<broker brokerName="sender-ws2" useJmx="true"? xmlns="
    參考
    http://www.mail-archive.com/activemq-users@geronimo.apache.org/msg06853.html

    posted @ 2007-02-06 01:10 java光環 閱讀(1239) | 評論 (0)編輯 收藏

    eclipse 中加入linked resource



    修改.project.xml文件

    </natures>
    ?<linkedResources>
    ??<link>
    ???<name>spring_src</name>
    ???<type>2</type>
    ???<location>E:/spring-framework-1.2.5/src</location>
    ??</link>
    ?</linkedResources>
    </projectDescription>

    posted @ 2006-08-14 10:39 java光環 閱讀(1342) | 評論 (0)編輯 收藏

    輕松的五一

    今天終于開始工作了,干勁實足。

    1 睡了一天的覺,把電飯堡修了
    2到了大中買了兩個大家電冰箱洗衣機(國產品牌海爾)
    3做了一個全身的體檢(花了千元)
    4享受了海爾服務,家電運行正常.
    5回家.看望了老爸老媽,父親的腿病多年了,查查盧友明醫院
    6 go shopping,買家居裝飾物品
    7聚友。忘年交的老朋友來我家小聚送了我他的字畫還有一套茶具。

    posted @ 2006-05-08 10:12 java光環 閱讀(663) | 評論 (0)編輯 收藏

    一生中最應珍惜的十種人


    一生中最應珍惜的十種人


    1.遇到真愛的人時,要努力爭取和他相伴一生的機會,因為當他離去時一切都來不及了。
    2.遇到可相信的朋友時,要好好和他相處下去,因為人的一生中遇到知己真的不易。
    3.遇到貴人時,要記得好好感激,因為他是你人生的轉折點。
    4.遇到曾經愛過的人時,記得感激他,因為他讓你更懂得愛。
    5.遇到曾經恨過你的人時,要微笑向他打招呼,因為他讓你更加堅強。
    6.遇到曾經背叛你的人時,要跟他好好聊一聊,因為若不是他今天你不會讀懂這世界。
    7.遇到曾經偷偷喜歡的人時,要祝他幸福,因為你喜歡他時不是希望他幸福快樂嗎?
    8.遇到匆匆離開你人生的人時,要謝謝他走過你的人生,因為他是你精彩回憶的一部分。
    9.遇到曾經和你有誤會的人時,要解清誤會,因為你可能只有這一次機會解釋清楚。
    10.遇到和你相伴一生的人時,要百分百感謝他愛你,因為你們現在都得到幸福和真愛。

    posted @ 2006-02-28 14:41 java光環 閱讀(368) | 評論 (0)編輯 收藏

    用maven 啟動 jboss 時出現異常:[java] FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=JVMTI_ERROR_INTERNAL(113)

        [java] FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=JVMTI_ERROR_INTERNAL(113)
        [java] ERROR: transport error 202: socket creation failed: Provider initialization failed (check %SystemRoot%) ["transport.c",L41]
        [java] ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510) ["debugInit.c",L500]
        [java] JDWP exit error JVMTI_ERROR_INTERNAL(113): No transports initialized
        [java] [ERROR] Java Result: 1


    原因:

    posted @ 2006-02-16 15:19 java光環 閱讀(8027) | 評論 (2)編輯 收藏

    Oracle Blob/Clob 字段寫入時產生轉型異常Cast Exception

    CLOB clob = (CLOB)us.getStatisticsInfo();

    原因是
    java.sql.Blob不能強制傳喚成oracle.sql.BLOB

    解決方法如下:

    SerializableClob lob=(SerializableClob)us.getStatisticsInfo();
    CLOB lob2 = (CLOB)lob.getWrappedClob(); 
    Writer out = lob2.getCharacterOutputStream(); 
      

    public void testAdd() throws Exception {
            
    byte[] buffer = new byte[1]; 
            buffer[
    0= 1;
            Session s 
    = null;
            
    try 
                s 
    = sf.openSession(); 
                Transaction tx 
    = s.beginTransaction();
                BizUserStatistics us
    = new BizUserStatistics();
                us.setId(
    new Long(100));
                us.setStatisticsInfo(Hibernate.createClob(
    " "));

                s.save(us); 
                s.flush(); 
                s.refresh(us, LockMode.UPGRADE); 
    //            CLOB clob = (CLOB)us.getStatisticsInfo(); 
                SerializableClob lob=(SerializableClob)us.getStatisticsInfo();
                CLOB lob2 
    = (CLOB)lob.getWrappedClob();     
                Writer out 
    = lob2.getCharacterOutputStream();
                String fileName 
    = "d:/process_log.sql";
                File f 
    = new File(fileName); 
                FileInputStream fin 
    = new FileInputStream(f);
     
                StringBuffer sb 
    = new StringBuffer();
                
    for (int i = 0; i < 1000; i++){
                    sb.append(
    "<data>" + i + "</data>");
                }

                out.write(sb.toString());
                out.close();
                
                s.flush(); 
                tx.commit(); 
                }
     catch (Exception e) {
                    e.printStackTrace(); 
                }
     finally {
                    
    if (s != null)
                    
    try {
                    s.close(); 
                    }
     catch (Exception e){}
                }


        }

    posted @ 2006-02-14 16:35 java光環 閱讀(1240) | 評論 (0)編輯 收藏

    利用scomp 生成指定package java jar 包命令

    scomp -out weather.jar weather_latlong.xsd  myconfig.xsdconfig

    Compiles a schema into XML Bean classes and metadata.
    Usage: scomp [opts] [dirs]* [schema.xsd]* [service.wsdl]* [config.xsdconfig]*
    Options include:
        -cp [a;b;c] - classpath
        -d [dir] - target binary directory for .class and .xsb files
        -src [dir] - target directory for generated .java files
        -srconly - do not compile .java files or jar the output.
        -out [xmltypes.jar] - the name of the output jar
        -dl - permit network downloads for imports and includes (default is off)
        -noupa - do not enforce the unique particle attribution rule
        -nopvr - do not enforce the particle valid (restriction) rule
        -noann - ignore annotations
        -novdoc - do not validate contents of <documentation>
        -compiler - path to external java compiler
        -javasource [version] - generate java source compatible for a Java version (1.4 or 1.5)
        -ms - initial memory for external java compiler (default '8m')
        -mx - maximum memory for external java compiler (default '256m')
        -debug - compile with debug symbols
        -quiet - print fewer informational messages
        -verbose - print more informational messages
        -version - prints version information
        -license - prints license information
        -allowmdef "[ns] [ns] [ns]" - ignores multiple defs in given namespaces (use ##local for no-namespace)
        -catalog [file] -  catalog file for org.apache.xml.resolver.tools.CatalogResolver. (Note: needs resolver.jar from http://xml.apache
    .org/commons/components/resolver/index.html)

    posted @ 2006-02-14 16:23 java光環 閱讀(1255) | 評論 (0)編輯 收藏

    jboss service 本地方法調用

    if(raMgrService == null){
                try {
                 return raMgrService = (RemoteAccessManager)MBeanProxyExt.create(RemoteAccessManager.class, "mycomp:service=AccessCenter");
                } catch (Exception e) {
                    log.error("Failed to find mycomp:service=AccessCenter", e);
                }
            }
            return raMgrService;

    mycomp:service=AccessCenter 是 jboss service mbean 服務名
    <?xml version='1.0' encoding='UTF-8' ?>
    <server>
     <mbean code="com.jhalo.security.AccessCenterService"
      name="jhalo:service=AccessCenter">
    如果希望遠程調用可以:
    <attribute name="ExportInterfaces">com.jhalo.security.RemoteAccessManager</attribute>
    export 實現類的接口.

    posted @ 2005-12-09 15:02 java光環 閱讀(432) | 評論 (0)編輯 收藏

    WARN afterTransactionCompletion() was never called

    WARN:
    afterTransactionCompletion() was never called
    unclosed connection, forgot to call close() on your session?


    警告: afterTransactionCompletion() was never called

    執行了tx = session.beginTransaction();

    但是后來沒處理tx

    應該用tx.commit() or tx.rollback()

    一般查詢時容易出現此問題

    posted @ 2005-10-08 09:58 java光環 閱讀(1963) | 評論 (3)編輯 收藏

    hibernate ant Hbm2JavaTask Exception of:org.xml.sax.SAXParseException: Attribute "insert" must be declared for element type "discriminator".

    <discriminator type="java.lang.String" column="REGION_TYPE"
       length="10" force="false" insert="true"/>

    Region.hbm.xml(15)
    org.xml.sax.SAXParseException: Attribute "insert" must be declared for element type "discriminator".

            at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
            at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
            at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
            at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
            at org.apache.xerces.impl.dtd.XMLDTDValidator.addDTDDefaultAttrsAndValidate(Unknown Source)
            at org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source)
            at org.apache.xerces.impl.dtd.XMLDTDValidator.emptyElement(Unknown Source)
            at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
            at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(
    Unknown Source)
            at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
            at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
            at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
            at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
            at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
            at org.jdom.input.SAXBuilder.build(Unknown Source)
            at org.jdom.input.SAXBuilder.build(Unknown Source)
            at org.jdom.input.SAXBuilder.build(Unknown Source)
            at net.sf.hibernate.tool.hbm2java.CodeGenerator.main(CodeGenerator.java:100)
            at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.processFile(Hbm2JavaTask.java:149)
            at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.execute(Hbm2JavaTask.java:97)
            at org.apache.tools.ant.Task.perform(Task.java:341)
            at org.apache.commons.jelly.tags.ant.AntTag.doTag(AntTag.java:185)
            at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:233)
            at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:89)
            at org.apache.maven.jelly.tags.werkz.MavenGoalTag.runBodyTag(MavenGoalTag.java:79)
            at org.apache.maven.jelly.tags.werkz.MavenGoalTag$MavenGoalAction.performAction(MavenGoalTag
    .java:110)
            at com.werken.werkz.Goal.fire(Goal.java:639)
            at com.werken.werkz.Goal.attain(Goal.java:575)
            at com.werken.werkz.Goal.attainPrecursors(Goal.java:488)
            at com.werken.werkz.Goal.attain(Goal.java:573)
            at org.apache.maven.plugin.PluginManager.attainGoals(PluginManager.java:671)
            at org.apache.maven.MavenSession.attainGoals(MavenSession.java:263)
            at org.apache.maven.cli.App.doMain(App.java:488)
            at org.apache.maven.cli.App.main(App.java:1239)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:324)
            at com.werken.forehead.Forehead.run(Forehead.java:551)
            at com.werken.forehead.Forehead.main(Forehead.java:581)

    build:
    ----------------------------------
    ----------------------------------
    solution : 升級hiberate verion 2.1.8
    ----------------------------------
    ----------------------------------
    改maven :project.xml
    <dependency>
       <groupId>hibernate</groupId>
       <artifactId>hibernate</artifactId>
       <version>2.1.8</version>
       <properties>
        <ejb.manifest.classpath>true</ejb.manifest.classpath>
       </properties>
      </dependency>

    這樣寫,也是沒有問題的
    <discriminator type="java.lang.String" column="REGION_TYPE" length="10"/>

    posted @ 2005-08-19 13:52 java光環 閱讀(4253) | 評論 (1)編輯 收藏

    jasperreport 0.6.8 生成 excel 報表,目前還不能支持圖片

    在 jasperreports-0.6.8\lib 中,使用的apache poi 版本: poi-2.0-final-20040126.jar  
    此版本poi 還不支持圖片的處理。
    到現在 poi 3.0 alphal 已經發布,(2005-07-04) 這個版本已經加入插入圖片的功能。
    下載原代碼:http://apache.freelamp.com/jakarta/poi/dev/src/ poi-src-3.0-alpha1-20050704.zip  
    詳細查看 sample 部分
    src/examples/src
    org.apache.poi.hssf.usermodel.examples
    OfficeDrawing

    于2005-05-01加入了新的示例代碼:drawSheet5
    public class OfficeDrawing
    {
        
    public static void main(String[] args)
            throws IOException
        
    {
    // Create the workbook and sheets.
            HSSFWorkbook wb = new HSSFWorkbook();
    HSSFSheet sheet5 
    = wb.createSheet("fifth sheet");
    drawSheet5( sheet5, wb );

    // Write the file out.
            FileOutputStream fileOut = new FileOutputStream("workbook.xls");
            wb.write(fileOut);
            fileOut.close();
        }


    private static void drawSheet5( HSSFSheet sheet5, HSSFWorkbook wb ) throws IOException
        
    {

            
    // Create the drawing patriarch.  This is the top level container for
            
    // all shapes. This will clear out any existing shapes for that sheet.
            HSSFPatriarch patriarch = sheet5.createDrawingPatriarch();

            HSSFClientAnchor anchor;
            anchor 
    = new HSSFClientAnchor(0,0,0,255,(short)2,2,(short)4,7);
            anchor.setAnchorType( 
    2 );
            patriarch.createPicture(anchor, loadPicture( 
    "src/resources/logos/logoKarmokar4.png", wb ));

            anchor 
    = new HSSFClientAnchor(0,0,0,255,(short)4,2,(short)5,7);
            anchor.setAnchorType( 
    2 );
            patriarch.createPicture(anchor, loadPicture( 
    "src/resources/logos/logoKarmokar4edited.png", wb ));

            anchor 
    = new HSSFClientAnchor(0,0,1023,255,(short)6,2,(short)8,7);
            anchor.setAnchorType( 
    2 );
            HSSFPicture picture 
    = patriarch.createPicture(anchor, loadPicture( "src/resources/logos/logoKarmokar4s.png", wb ));
            picture.setLineStyle( picture.LINESTYLE_DASHDOTGEL );

        }


    private static int loadPicture( String path, HSSFWorkbook wb ) throws IOException
        
    {
            
    int pictureIndex;
            FileInputStream fis 
    = null;
            ByteArrayOutputStream bos 
    = null;
            
    try
            
    {
                fis 
    = new FileInputStream( path);
                bos 
    = new ByteArrayOutputStream( );
                
    int c;
                
    while ( (c = fis.read()) != -1)
                    bos.write( c );
                pictureIndex 
    = wb.addPicture( bos.toByteArray(), HSSFWorkbook.PICTURE_TYPE_PNG );
            }

            
    finally
            
    {
                
    if (fis != null)
                    fis.close();
                
    if (bos != null)
                    bos.close();
            }

            
    return pictureIndex;
        }


    }

    posted @ 2005-07-13 14:28 java光環 閱讀(1250) | 評論 (0)編輯 收藏

    jboss 遠程方法調用RMIAdaptor 數組參數的梆定

    public interface TestEngine {
     public void scheduleTest(String[] systemIds,ScheduleData data) throws Exception;
    ........
    }
    public interface TestEngineServiceMBean extends TestEngine,com.hygensoft.common.service.Service,org.jboss.system.ServiceMBean {
    ......
    }
    String[] systemIds = {"HZ","FZ"};
    server.invoke(TestEngineServiceMBean.OBJECT_NAME,"scheduleTest",
                    new Object[]{ systemIds, data},
                    new String[]{ systemIds.getClass().getName(),ScheduleData.class.getName()});



    jndi.properties
    # DO NOT EDIT THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING
    #
    java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
    java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
    java.naming.provider.url=jnp://localhost:1099

    jndi.properties 文件放于classes 目錄.

    posted @ 2005-06-14 13:41 java光環 閱讀(1226) | 評論 (0)編輯 收藏

    關于iReport中生成報表中文顯示問題

    解決方案:用外部trueType字體
    操作方法:
    1.將simhei.ttf copy到ireport安裝目錄下的fonts中,并把fonts加到classpath中,重啟ireport就可以用外部字體了。
    注:classpath  = %IREPORT_HOME%\iReport-0.5.0-src\fonts
     2.pdf font name選External TTF font...
    在TrueType font下選框選“黑體(simhei.ttf)” or “宋體(simsun.ttc,0)”
    注:不要勾選PDF embedded
    Pdf encoding:   Identity-H

    posted @ 2005-06-14 13:30 java光環 閱讀(1517) | 評論 (0)編輯 收藏

    hiberante persistence

     you had a table "miners" that looked like this 
    create table miners (
       id BIGINT NOT NULL AUTO_INCREMENT,
       first_name VARCHAR(
    255),
       last_name VARCHAR(
    255),
       primary key (id)
    )
     
    Hibernate class (Miner.java) specifies the fields, getters/setters and xdoclet tags looks like so.
    package deadwood;
    /**
     * @hibernate.class table="miners"
     
    */

    public class Miner {
        
    private Long id;
        
    private String firstName;
        
    private String lastName;
        
    /**
         * @hibernate.id generator-class="native"
         
    */

        
    public Long getId() return id; }
        
    public void setId(Long id) this.id = id; }

        
    /**
         * @hibernate.property column="first_name"
         
    */

        
    public String getFirstName() return firstName; }
        
    public void setFirstName(String firstName) this.firstName = firstName; }

        
    /**
         * @hibernate.property column="last_name"
         
    */

        
    public String getLastName() return lastName; }
        
    public void setLastName(String lastName) this.lastName = lastName; }
    }

     

    Associations

     the Miner class we looked at was single table oriented, mapping to a single miners table. ORM solutions support ways to map associated tables to in memory objects ,
     

    • Many to One/One to one - belongs_to/has_one
    • One to Many (set) - has_many
    • Many to Many (set) - has_and_belongs_to_many
    • Single Table Inheritance
    • Components (mapping > 1 object per table)

     As a comparative example, lets look at the many to one relationship. We are going to expand our Deadwood example from part I. We add to the Miner a many to one association with a GoldClaim object. This means there is a foreign key, gold_claim_id in the miners table, which links it to a row in the gold_claims table.

    (Java)
    public class Miner {
       
    // Other fields/methods omitted

        
    private GoldClaim goldClaim;
        
    /**
         * @hibernate.many-to-one column="gold_claim_id"
         *         cascade="save"
         
    */

        
    public GoldClaim getGoldClaim() return goldClaim; }
        
    public void setGoldClaim(GoldClaim goldClaim) {
            
    this.goldClaim = goldClaim;
        }

    }
    Hibernate uses explicit mapping to specify the foreign key column, as well as the cascade behavior, which we will talk about next. Saving a Miner will save its associated GoldClaim, but updates and deletes to it won't affect the associated object.

     Transitive Persistence  
    Its important for an ORM solution to provide a way to detect and cascade changes from in memory objects to the database, without the need to manually save() each one. Hibernate features a flexible and powerful version of this via declarative cascading persistence. 

    Deleting Hibernate offers a number of different cascading behaviors for all associations types, giving it a high degree of flexibility. For example, setting cascade="all" will make GoldClaim save, update and delete along with its parent Miner, like so...

    Miner miner = new Miner();
    miner.setGoldClaim(
    new GoldClaim());
    session.save(miner); 
    // Saves Miner and GoldClaim objects.
    session.delete(miner); // Deletes both of them.
    By using the cascade="save-update", you could get this behavior on any association, regardless of which table the foreign key lives in. Hibernate doesn't base the transistive persistence behavior off the relationship type, but rather the cascade style, which is much more fine grained and powerful. 

    Query Languages

     Hibernate has its own object oriented query language (Hibernate Query Language - HQL), which is deliberately very similar to SQL. How it differs is that it lets developers express their queries in terms of objects and fields instead of tables and columns. Hibernate translates the query into SQL optimized for your particular database. Obviously, inventing a new query language is very substantial task, but the expressiveness and power of it is one of Hibernate's selling points. 

    Querying for Objects with HQL 
    when you have to start navigating across objects with SQL, HQL can be very convenient alternative. Let's take a look at our sample queries for HQL.

    // Find first Miner by name
    Query q = session.createQuery("from Miner m where m.firstName = :name");
    q.setParameter(
    "name""Elma");
    Miner m 
    = (Miner) q.setMaxResults(1).uniqueResult();

    // Finds up to 10 miners older than 30, ordered by age.
    Integer age = new Integer(30);
    Query q 
    = session.createQuery(
        
    "from Miner m where m.age > :age order by age asc");
    List miners 
    = q.setParameter("age", age).setMaxResults(10).list();

    // Similar to join query above, but no need to manually join
    Query q = session.createQuery(
       
    "from Miner m where m.goldClaim.squareArea = :area");
    List minersWithSqA 
    = q.setParameter("area"new Integer(1000)).list();

     Having covered some of the basics of fetching objects, let's turn your attention to how we can make fetching objects fast. The next section covers the means by which we can tune the performance. 

    Performance Tuning

     Beyond just mapping objects to tables, robust ORM solutions need to provide ways to tune the performance of the queries. One of the risks of working with ORM's is that you often pull back too much data from the database. This tends to happen because it its very easy to pull back several thousand rows, with multiple SQL queries, with a simple statement like "from Miner". Common ORM strategies for dealing with this include Lazy fetching, outer join fetching and caching. 

    What I mean by lazy is that when you fetch an object, the ORM tool doesn't fetch data from other tables, until you request the association. This prevents loading to much unneeded data.  Hibernate allows you to choose which associations are lazy.  This leads us to one of the great fallacies of ORM, that Lazy loading is always good. In reality, lazy loading is only good if you didn't need the data. Otherwise, you are doing with 2-1000+ queries what you could have done with one. This is dreaded N+1 select problem, where to get all the objects require N selects + 1 original selects. This problem gets much worse when you deal with collections..

    Outer Joins and Explicit Fetching

    Generally, one of the best way to improve performance is to limit the number of trips to the database. Better 1 big query than a few small ones. Hibernate has a number ways its handles the N+1 issue. Associations can be explicitly flagged for outer join fetching (via outer-join="true"), and you can add outer join fetching to HQL statements. For example...

    /**
    * @hibernate.many-to-one column="gold_claim_id"
    *           cascade="save-update" outer-join="true"
    */

    public GoldClaim getGoldClaim() return goldClaim;  }

    // This does one select and fetches both the Miner and GoldClaim
    // and maps them correctly.
    Miner m = (Miner) session.load(Miner.classnew Long(1));
    In addition, when selecting lists or dealing with collection associations, you can use an explicit outer join fetch, like so...
    // Issues a single select, instead of 1 + N (where N is the # miners)
    List list = session.find("from Miner m left join fetch m.goldClaim");
    The performance savings from this can very significant. 

    Caching

    While object caching isn't always going to be helpful or a performance silver bullet, Hibernate has a huge potential advantage here. It provides several levels of caching, including a session (UnitOfWork) level as well as an optional second level cache. You always use the '1st level' cache, as it prevents circular references and multiple trips to the database for the same object. Using a second level cache can allow much of the database state to stay resident in memory. This is especially useful for frequently read and reference data.

    posted @ 2005-05-12 18:38 java光環 閱讀(569) | 評論 (0)編輯 收藏

    shark 工作流引擎新特性 handling Deadlines

    shark1.0新特性:

    * Added new functionality of handling Deadlines.
      Shark now has defined client API, and its implementation 
    for handling Activity deadlines.
      This API 
    is supposed to be used by shark client to periodically ask shark to check deadines.
      Shark can be setup to re
    -evaluate deadlines every time deadline check is performed,
      or to initially calculate deadline times and store it into DB, and when asked to
      check deadlines, deadline limit 
    is retrieved from DB.
      Shark comes with an example XPDL processes contained 
    in deadlineexamples.xpdl file,
      that shows ASYNC and SYNC deadline handling.

      In shark deadline expressions along with all process variables, you can use special variables called:

          
    1. PROCESS_STARTED_TIME - the time when the process is started

          
    2. ACTIVITY_ACTIVATED_TIME - the time when process flow comes to activity and
                                       assignments 
    for the activity are created

          
    3. ACTIVITY_ACCEPTED_TIME - the time when the first assignment for the activity is accepted

          NOTE: If activity 
    is being rejected after its acceptance, or it is not accepted at all,
                the ACTIVITY_ACCEPTED_TIME 
    is set to some maximum value in the future

       IMPORTANT:

          
    - There shouldn't be process variables (DataField or FormalParameter entities from XPDL)
            that have the same Id as the one of previously listed - The Java type of these variables is java.util.Date.

          
    - deadline expression result must be java.util.Date

          
    - if shark is setup to not re-evaluate deadlines, but to initially evaluate
            deadline limit times, ACTIVITY_ACCEPTED_TIME should not be used 
    in expressions
            because it will contain some maximum time 
    in the future.

       When starting Shark CORBA server, it can be configured 
    if it will open a thread for checking Deadlines.

    posted @ 2005-04-30 18:23 java光環 閱讀(922) | 評論 (0)編輯 收藏

    shark 工作流引擎新特性MailToolAgent

    shark1.0 新特性:
    * New MailToolAgent is included:

       
    - in Shark.conf file you have some settings for MailToolAgent (in fact for the DefaultMailMessageHandler)

       
    - when calling this tool agent, AppMode 0 means sending and 1 means receiving mail

       
    - when calling this tool agent, AppName is the name of MailMessageHandler class to use.
         We have 
    default implementation of this interface called DefaultMailMessageHandler which
         needs 
    3 String IN parameters (destination address, mail subject and mail content) when sending mails,
         and 
    1 OUT or INOUT type parameter (message subject) when receiving mails.
         The example of usage 
    for this tool agent is in test-JavaScript.xpdl -> Mail Handling process.

    posted @ 2005-04-30 18:19 java光環 閱讀(513) | 評論 (0)編輯 收藏

    shark 工作流引擎新特性 HistoryRelated assigment

    shark 新特性:

    * Included new HistoryRelated implementation of Assignment API - great contribution by Rich Robinson.
      You can use it by commenting standard AssignmentManager and uncommenting HistoryRelated assignment
      manager entries 
    in Shark.conf (if you are configuring shark this way), and test it with
      Publish Document proces from test
    -JavaScript.xpdl.

    I've attached the latest HistoryRelatedAssignmentManager class and also an updated
    version of test-JavaScript.xpdl.
    
    The class now supports the following extended attributes (the names of which
    can be redefined in Shark.conf):
    
    * ReassignToOriginalPerformer
    * ReassignToOriginalPerformer
    * DoNotAssignToPerformerOfActivity
    
    As mentioned in the comments, one of each extended attribute should be
    associated with any single activity definition.  If anybody wishes to
    extend/modify this class in any way, one obvious improvment would be to allow
    multiple copies of each extended attribute to be assigned to a single 
    activity.
    I would ideally have liked to do this, but I don't need such functionality at
    the moment, and unfortunately don't have any more time to spend on it.
    
    In order to get the class working, the following properties need to be 
    specified
    in Shark.conf:
    
    
    #
    # HistoryRelated assigment manager
    #
    AssignmentManagerClassName
    =org.enhydra.shark.assignment.HistoryRelatedAssignmentManager
    HistoryRelatedAssignmentManager.username
    =admin
    HistoryRelatedAssignmentManager.password
    =enhydra
    HistoryRelatedAssignmentManager.extAttrReassignToOriginalPerformer
    =ReassignToOriginalPerformer
    HistoryRelatedAssignmentManager.extAttrAssignToPerformerOfActivity
    =AssignToPerformerOfActivity
    HistoryRelatedAssignmentManager.extAttrDoNotAssignToPerformerOfActivity
    =DoNotAssignToPerformerOfActivity
    The XPDL example is a "publish document" process that describes the workflow that may occur when publishing a web-based document. Note that in the following, a question mark represents either "1" or "2" depending on which moderator we are referring to: * Initially, an author creates a document and submits it to two moderators. The "DoNotAssignToPerformerOfActivity" ext attrib is used for each moderate_document_? activity to ensure that two different moderators moderate the document and that the same moderator cannot moderate it twice. * Each moderator moderates the document and says whether or not it is ok by setting the values of the moderate_?_ok WRD. If OK, the moderator then has to submit the document. Note that the AssignToPerformerOfActivity ext attrib is used to ensure that the moderator who moderated the document is assigned the appropriate submit_document_? activity. * If either moderator rejects the document, then the author has to update it. Again, we use the AssignToPerformerOfActivity ext attrib to ensure that the author who originally created the document has to update it. * When updated, the author has to re-submit the document using the same submit_document activity. We use the ReassignToOriginalPerformer ext attrib to ensure that the author who resubmits the document is the same author that originally submitted it. * Finally, when both the moderators are happy with the document, a publisher reviews it (if he rejects it, we head back to "update document" - in exactly the same way as if a moderator rejects it). When the publisher is happy with the document, he publishes it. We use the AssignToPerformerOfActivity ext attrib to ensure that the publisher who publishes the document is the same publisher that reviewed it. That's it... I've tested both the class and the XPDL to some extent, but both could do with some more testing if anybody would like to do it. Let me know if you have any questions.

    posted @ 2005-04-30 14:16 java光環 閱讀(568) | 評論 (0)編輯 收藏

    Integrating workflow engines with other system modules

    Hi all,

    This is probably a newbie question so please be tolerant :-)

    I am involved in the development of a system that has a business process management component. The system is based on Spring, Hibernate and Web Work 2. The question is, out of all those available BPM engines, which ones can easily be integrated into other infrastructures? My first impression is that BPM engines designed to be the infrastructure itself, so that functions such as data access, business logic and user interface are specified around it. As opposed to using another infrastructure (in our case, Spring + Hibernate + Web Work) where the BPM engine is merely a component.

    Is this distinction real? Should BPM engines logically be the center-piece of the system? Or am I grossly misunderstanding the issues?


    --->

    I feel that the best way to use a Workflow/BPM system is as a database is : something external that you access with some system users.

    Sometimes an embedded workflow engine is necessary, but in this case, the application that embeds should dictate the infrastructure

    --->

    I think it should be implemented as an aspect

    I have implemented a workflow engine before. I made it completely independent of the business objects etc. However, I had to modify business facades to call into the workflow engine; for example, to start a new process for a new request. At this point, I am thinking of doing it as an aspect in Spring, and I believe this will work out nicely.

    --->

    I am currently building a project using Struts, Spring and Hibernate with OSWorkflow. The current development build (2.8) has built-in support for a Spring / Hibernate environment. In this case, performing an action in the workflow can check against a set of pre-conditions, which can refer to logic in the business layer and can then call some functions if the conditions hold, which can also refer to business logic. This is nice because Spring deals with the dependencies for the conditions and functions. The end result is my business logic is protected by the workflow engine, which prevents any action being performed in the wrong stage of the process.

    The only downside of OSWorkflow is that you have to call the workflow action by passing the action's id (an int) and a map of all the inputs to the engine. I'm getting around this by writing an abstraction layer that provides nice method signatures (the business facade) for my struts actions (or any other client). These methods will map to an action id, take all the arguments from the signature and wrap them in a map and call the action.

    I hope this is helpful.

    Adam

    http://www.manageability.org/blog/stuff/workflow_in_java/view

    posted @ 2005-04-28 18:49 java光環 閱讀(535) | 評論 (0)編輯 收藏

    工作流引擎Shark配置

     如果在Shark中未定義程序映射,Shark將調用默認的ToolAgent,在Shark.conf中可定義;

    RuntimeApplicationToolAgent可執行其它外部程序,比如notepad等,此時,傳入的application mode如果為0,則Shark會等待應用程序的執行結束;如果不為0,則Shark在應用程序開始后會繼續流程的處理;

    JavaScriptToolAgent可用于執行JavaScript,application mode為0,則系統將搜索名為applicationName的文件,執行;

    posted @ 2005-04-22 11:37 java光環 閱讀(876) | 評論 (0)編輯 收藏

    Spring Hibernate Config: mappingDirectoryLocations

     I have seen a bunch of projects which are using Spring and Hibernate, and have something like the following in their applicationContext.xml file.

    <property name="mappingResources">
    <list>
    <value>com/almaer/model/Person.hbm.xml</value>
    <value>com/almaer/model/Car.hbm.xml</value>
    <value>com/almaer/model/Engine.hbm.xml</value>
    <value>com/almaer/model/Toy.hbm.xml</value>
    </list>
    </property>

     Luckily, you can just point to the directory now, and have Spring work it out for you :)

    <property name="mappingDirectoryLocations">
    <list>
    <value>WEB-INF/mappings</value>
    </list>
    </property>

    posted @ 2005-04-20 13:59 java光環 閱讀(1389) | 評論 (0)編輯 收藏

    關于cascade 與inverse

    看貼記錄:

     在絕大多數(100%?)情況下,many-to-many的cascade都會設置為"save-update",
    比如User和Role是many-to-many的,你不可能在刪除一個Role時,把它的所有User都刪除吧,反之也不可能。 

    雙向的many-to-many維護起來確實比較麻煩,且效率可能比較低。
    但我始終還是堅持一個原則:雙向關聯一定要一邊設置為inverse="true",更新時兩邊一起更新。我從來沒有遇到過違反外鍵的情況。
     

    從關系本身來講,一對多,多對一的關系本身都是由多的一方來維護的,
    多對多是由雙方來維護的

    posted @ 2005-04-15 15:09 java光環 閱讀(273) | 評論 (0)編輯 收藏

    How do you use findByNamedParam,findByNamedQueryAndNamedParam?

    spring  封裝了對hibernate 底層操作,現列了一些查詢方法:

    1,findByNamedParam
    code:

    public List getRolesByName(String roleName) {
            
    return getHibernateTemplate().findByNamedParam("from Role role where role.name=:roleName""roleName",roleName);
        }

    2,findByNamedQueryAndNamedParam
    code:
    getHibernateTemplate().findByNamedQueryAndNamedParam("testeCQuery""idCidade", cidade);
    xml code:
    <query name="testeCQuery"><![CDATA[
                 from br.com.ag2.casarural.vo.Cidade as cidade where cidade.idCidade = :idCidade
            
    ]]></query>

    posted @ 2005-04-14 19:31 java光環 閱讀(5817) | 評論 (1)編輯 收藏

    主站蜘蛛池模板: 最近免费中文字幕大全免费版视频| 亚洲AV无码XXX麻豆艾秋| 亚洲国产成人手机在线电影bd | 亚洲色大网站WWW永久网站| 亚洲成AV人片高潮喷水| 男人免费视频一区二区在线观看| 国产午夜不卡AV免费| 又大又硬又爽又粗又快的视频免费| 最近2019中文字幕mv免费看| 又粗又大又硬又爽的免费视频| 亚洲毛片αv无线播放一区| 亚洲第一成年人网站| 色天使亚洲综合一区二区| 香蕉免费看一区二区三区| 99久久99这里只有免费费精品| 精品国产免费观看一区| 亚洲中文字幕无码专区| 亚洲av日韩av激情亚洲| 亚洲乱妇老熟女爽到高潮的片| 中国一级特黄的片子免费| 免费观看无遮挡www的视频| 亚洲?V无码成人精品区日韩| 亚洲ⅴ国产v天堂a无码二区| 亚洲Av无码国产一区二区| 久久精品国产免费| 日本高清免费不卡在线| 亚洲国产成人片在线观看无码 | 日本不卡免费新一区二区三区| 成年女人免费碰碰视频| 在线a亚洲v天堂网2019无码| 性xxxx黑人与亚洲| 中文日本免费高清| 免费鲁丝片一级观看| 亚洲中文字幕无码一久久区| 亚洲午夜无码毛片av久久京东热| 国产在线国偷精品免费看| 四虎成人免费观看在线网址| 亚洲AV无码久久精品蜜桃| 在线观看亚洲免费视频| 久久久免费精品re6| 亚洲乱码日产精品a级毛片久久|