技术之大,在乎你我心中

解决 maven + jbpm 错误

     下载了jBPM-4.3的运行包,jpdl也是4.3的版本,按照doc完成GPD插件的安装,examples也完美运行,但是等你把maven也加进来,jboss 的repository也加进来了,把examples中的代码拷贝进来一运行就出现:

error: no start activity in process [line=3 column=61 ]

at org.jbpm.pvm.internal.xml.ProblemList.getJbpmException(ProblemList.java:168)

at org.jbpm.pvm.internal.xml.ProblemList.getJbpmException(ProblemList.java:141)

at org.jbpm.pvm.internal.repository.DeployerManager.deploy(DeployerManager.java:50)

at org.jbpm.pvm.internal.repository.RepositorySessionImpl.deploy(RepositorySessionImpl.java:56)

at org.jbpm.pvm.internal.cmd.DeployCmd.execute(DeployCmd.java:47)

at org.jbpm.pvm.internal.cmd.DeployCmd.execute(DeployCmd.java:33)

at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)

at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:54)

at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:46)

at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)

at org.jbpm.pvm.internal.repository.DeploymentImpl.deploy(DeploymentImpl.java:89)

at TestCase.setUp(TestCase.java:16)

at junit.framework.TestCase.runBare(TestCase.java:128)

at junit.framework.TestResult$1.protect(TestResult.java:106)

at junit.framework.TestResult.runProtected(TestResult.java:124)

at junit.framework.TestResult.run(TestResult.java:109)

at junit.framework.TestCase.run(TestCase.java:120)

at junit.framework.TestSuite.runTest(TestSuite.java:230)

at junit.framework.TestSuite.run(TestSuite.java:225)

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.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:213)

at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)

at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)

at org.apache.maven.surefire.Surefire.run(Surefire.java:177)

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.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)

at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)

 

      原因是这样的, jboss的repossitories(地址是这里:http://repository.jboss.com/maven2)上jBPM最高版本是4.1,而jpdl.xml的版本是4.3的,看看那个名字空间,导致使用maven开发老是提示这个错误,解决的办法有两个:

      方法一:

      修改jpdl.xml文件中的名字空间,也就是xmlns后面的那一串东东,把版本号修改为4.0,注意是4.0,不是4.1。修改前是这个样子的: image

      修改后是这一个样子的:

image

      然后重新跑test,就正常了。这又是一个版本不统一引起的问题,开源世界,习惯就好了! 该方案只是临时的解决方法,不好不好,我们找一个一劳永逸的方案,看方案二。

 

      方案二:

      修改一下POM文件,把所有4.1的修改为4.3,直接替换就成,然后再test一下看看,下载依赖包,测试正常。

 

      那现在的问题又了,为什么在jboss的官方仓库中:http://repository.jboss.com/maven2中是有4.3但是却拉不到索引呢?look here:

image

      再看看我刚刚更新的索引:

image

      怀疑是这样的,maven client通过HTTP协议去下载的是index所有文件,该文件包含所有该仓库中依赖包索引,maven下载后放到本机上解开,然后建立索引文件,记得是看到过index.zip.*开头的文件名,忘记在什么地方了。

posted on 2010-01-06 15:00  cbf4life  阅读(3067)  评论(0编辑  收藏  举报

导航