JBPM deploy processdefinition 报错的问题原因及解决办法

今天遇到一个非常奇怪的问题,在本地的tomcat环境中部署jbpm的processdefinition xml文件正常,但是一放到服务器上就报错,报错内容如下:
 
org.jbpm.jpdl.JpdlException: [[ERROR] line  382 : cos - ct - extends . 1.4 . 2.2 . 2.2 . 1 : Error  for  type  ' #AnonType_assignment ' .  The content type of a derived type and that of its base must both be mixed or element - only., [WARNING] warning: no swimlane or assignment specified  for  task  ' <task xmlns="urn:jbpm.org:jpdl-3.2" blocking="false" signalling="true" priority="normal">

                            
< controller config - type = " field " >

                                     
< variable name = " remark "  access = " read,write " />

                                     
< variable name = " desc "  access = " read,write " />

                                     
< variable name = " userName "  access = " read,write " />

                            
</ controller >

                   
</ task > ' , [WARNING] warning: no swimlane or assignment specified for task  ' < task xmlns = " urn:jbpm.org:jpdl-3.2 "  blocking = " false "  signalling = " true "  priority = " normal " >

                            
< controller config - type = " field " >

                                     
< variable name = " remark "  access = " read,write " />

                                     
< variable name = " desc "  access = " read,write " />

                                     
< variable name = " name "  access = " read,write " />

                                     
< variable name = " address "  access = " read,write " />

                            
</ controller >

                   
</ task > ' ]

         at org.jbpm.jpdl.xml.JpdlXmlReader.readProcessDefinition(JpdlXmlReader.java:
173 )

         at org.jbpm.graph.def.ProcessDefinition.parseXmlInputStream(ProcessDefinition.java:
172 )

         at com.ebao.pub.workflow.jbpm.tools.deployer.ProcessDeployer.deploy4Jbpm(ProcessDeployer.java:
39 )

         at com.ebao.pub.workflow.jbpm.tools.deployer.ProcessDeployer.deployProcess(ProcessDeployer.java:
32 )

         at com.ebao.pub.workflow.worklist.web.action.procmgmt.ProcMgmtAction.process(ProcMgmtAction.java:
41 )

         at com.ebao.pub.framework.GenericActionProxy.process(GenericActionProxy.java:
36 )

         at com.ebao.foundation.module.web.action.GenericAction.execute(GenericAction.java:
142 )

         at com.ebao.pub.framework.GenericAction.execute(GenericAction.java:
51 )

         at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:
484 )

         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:
274 )

         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:
1482 )

         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:
525 )

         at javax.servlet.http.HttpServlet.service(HttpServlet.java:
760 )

         at javax.servlet.http.HttpServlet.service(HttpServlet.java:
853 )

         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:
1006 )

         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:
419 )

         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:
28 )

         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:
27 )

         at com.ebao.foundation.module.web.filter.SynchronizerTokenFilter.doFilter(SynchronizerTokenFilter.java:
79 )

         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:
27 )

         at com.ebao.foundation.module.security.filters.PermissionFilter.doFilter(PermissionFilter.java:
105 )

         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:
27 )

         at com.ebao.foundation.module.security.filters.CheckNeedChangePasswordFilter.doFilter(CheckNeedChangePasswordFilter.java:
115 )

         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:
27 )

         at com.ebao.foundation.module.security.filters.LoginFilter.doFilter(LoginFilter.java:
113 )

         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:
27 )

         at com.ebao.foundation.module.web.filter.ThreadBindResourceFilter.doFilter(ThreadBindResourceFilter.java:
46 )

         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:
27 )

         at com.ebao.foundation.module.web.filter.ThreadBindResourceCleanFilter.doFilter(ThreadBindResourceCleanFilter.java:
54 )

         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:
27 )

         at com.ebao.foundation.module.web.filter.StaticFileDispatchFilter.doFilter(StaticFileDispatchFilter.java:
134 )

         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:
27 )

         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:
6724 )

         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:
321 )

         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
121 )

         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:
3764 )

         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:
2644 )

         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:
219 )

         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:
178 )
 分析原因第一个可能就是引用的jar库不正确,具体看报错原因,一个以前从来没有遇到过的错误
org.jbpm.jpdl.JpdlException: [[ERROR] line  382 : cos - ct - extends . 1.4 . 2.2 . 2.2 . 1 : Error  for  type  ' #AnonType_assignment ' .  The content type of a derived type and that of its base must both be mixed or element - only.,
第一个怀疑是服务器上的xsd文件有问题,但是比较下来是正确的.继续追查jpdl的原代码,感觉是xml解析的问题,继续察看原代码想确认一下jpdl是用什么来处理xml的.下面的代码我们就可以看到jpdl用了一个JpdlXmlReader来解析xml.
public  ProcessDefinition readProcessDefinition()  ... {
    
// create a new definition
    processDefinition = ProcessDefinition.createNewProcessDefinition();

    
// initialize lists
    problems = new ArrayList();
    unresolvedTransitionDestinations 
= new ArrayList();
    unresolvedActionReferences 
= new ArrayList();    
        
    
try ...{
      
// parse the document into a dom tree
      Document document = JpdlParser.parse(inputSource, this);
      Element root 
= document.getRootElement();
            
      
// read the process name
      parseProcessDefinitionAttributes(root);
      
      
// get the process description 
      String description = root.elementTextTrim("description");
      
if (description!=null...{
        processDefinition.setDescription(description);
      }


      
// first pass: read most content
      readSwimlanes(root);
      readActions(root, 
nullnull);
      readNodes(root, processDefinition);
      readEvents(root, processDefinition);
      readExceptionHandlers(root, processDefinition);
      readTasks(root, 
null);

      
// second pass processing
      resolveTransitionDestinations();
      resolveActionReferences();
      verifySwimlaneAssignments();

    }
 catch (Exception e) ...{
      log.error(
"couldn't parse process definition", e);
      addProblem(
new Problem(Problem.LEVEL_ERROR, "couldn't parse process definition", e));
    }

    
    
if (Problem.containsProblemsOfLevel(problems, Problem.LEVEL_ERROR)) ...{
      
throw new JpdlException(problems);
    }


    
return processDefinition;
  }

我们继续打开JpdlXmlReader.java的源代码,我们发现jpdl用的是标准的javax扩展库,应该没问题的啊,但是我们要知道weblogic自己提供了一套jdk会不会这里有问题呢,于是在代码部署的代码中加入
System.setProperty("javax.xml.parsers.SAXParserFactory","org.apache.xerces.jaxp.SAXParserFactoryImpl"):
重新运行,哈哈成功.原来是webloogic 8 自己提供的xml解析有问题,我们手动指定一下就ok了,问题搞定,出去点只烟
 
       尊重原创,原创地址: http://blog.csdn.net/hxshandle/archive/2007/07/23/1704234.aspx

你可能感兴趣的:(职场,休闲)