andyj2ee

java tec sky

统计

留言簿(4)

activemq

aop

design pattern

other blog

spring

workflow

多线程

软件架构师

阅读排行榜

评论排行榜

2005年4月15日 #

系统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://www.blogjava.net/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);

posted @ 2015-01-13 18:53 java光环 阅读(724) | 评论 (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光环 阅读(3680) | 评论 (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光环 阅读(3956) | 评论 (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光环 阅读(829) | 评论 (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光环 阅读(287) | 评论 (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光环 阅读(1638) | 评论 (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光环 阅读(1767) | 评论 (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光环 阅读(816) | 评论 (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光环 阅读(3223) | 评论 (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光环 阅读(1177) | 评论 (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光环 阅读(355) | 评论 (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光环 阅读(686) | 评论 (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光环 阅读(1030) | 评论 (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="http://activemq.org/config/1.0">

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

posted @ 2007-02-06 01:10 java光环 阅读(1234) | 评论 (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光环 阅读(1340) | 评论 (0)编辑 收藏

轻松的五一

今天终于开始工作了,干劲实足。

1 睡了一天的觉,把电饭堡修了
2到了大中买了两个大家电冰箱洗衣机(国产品牌海尔)
3做了一个全身的体检(花了千元)
4享受了海尔服务,家电运行正常.
5回家.看望了老爸老妈,父亲的腿病多年了,查查卢友明医院
6 go shopping,买家居装饰物品
7聚友。忘年交的老朋友来我家小聚送了我他的字画还有一套茶具。

posted @ 2006-05-08 10:12 java光环 阅读(655) | 评论 (0)编辑 收藏

一生中最应珍惜的十种人


一生中最应珍惜的十种人


1.遇到真爱的人时,要努力争取和他相伴一生的机会,因为当他离去时一切都来不及了。
2.遇到可相信的朋友时,要好好和他相处下去,因为人的一生中遇到知己真的不易。
3.遇到贵人时,要记得好好感激,因为他是你人生的转折点。
4.遇到曾经爱过的人时,记得感激他,因为他让你更懂得爱。
5.遇到曾经恨过你的人时,要微笑向他打招呼,因为他让你更加坚强。
6.遇到曾经背叛你的人时,要跟他好好聊一聊,因为若不是他今天你不会读懂这世界。
7.遇到曾经偷偷喜欢的人时,要祝他幸福,因为你喜欢他时不是希望他幸福快乐吗?
8.遇到匆匆离开你人生的人时,要谢谢他走过你的人生,因为他是你精彩回忆的一部分。
9.遇到曾经和你有误会的人时,要解清误会,因为你可能只有这一次机会解释清楚。
10.遇到和你相伴一生的人时,要百分百感谢他爱你,因为你们现在都得到幸福和真爱。

posted @ 2006-02-28 14:41 java光环 阅读(362) | 评论 (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光环 阅读(8017) | 评论 (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光环 阅读(1232) | 评论 (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光环 阅读(1251) | 评论 (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光环 阅读(429) | 评论 (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光环 阅读(1955) | 评论 (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光环 阅读(4248) | 评论 (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光环 阅读(1243) | 评论 (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光环 阅读(1221) | 评论 (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光环 阅读(1511) | 评论 (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光环 阅读(565) | 评论 (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光环 阅读(913) | 评论 (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光环 阅读(505) | 评论 (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光环 阅读(539) | 评论 (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光环 阅读(528) | 评论 (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光环 阅读(869) | 评论 (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光环 阅读(1383) | 评论 (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光环 阅读(267) | 评论 (0)编辑 收藏