关于xml类型文件的问题
最近在搞一个OA系统,导师要我负责工作流这个方面,在网上看到很多人是用Jboss的jbpm这个开源的东西,自己从网上下了一个demo,简单配置了一下。Junit测试时console里出现下面的错误:
0:17:29,078 [main] ERROR JpdlXmlReader : couldn't parse process definition
org.dom4j.DocumentException: Error on line 2 of document : The processing instruction target matching "[xX][mM][lL]" is not allowed. Nested exception: The processing instruction target matching "[xX][mM][lL]" is not allowed.
at org.dom4j.io.SAXReader.read(SAXReader.java:482)
at org.jbpm.jpdl.xml.JpdlParser.parse(JpdlParser.java:58)
at org.jbpm.jpdl.xml.JpdlXmlReader.readProcessDefinition(JpdlXmlReader.java:147)
at org.jbpm.graph.def.ProcessDefinition.parseXmlInputStream(ProcessDefinition.java:179)
at org.jbpm.graph.def.ProcessDefinition.parseXmlResource(ProcessDefinition.java:160)
at cn.senta.test.TestJBPM.testDeployProcessDifinition(TestJBPM.java:32)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
---------------
注意上面的红色信息。我打开xml文件,发现<?xml version="1.0" encoding="UTF-8"?>是从第二行开始的,也就是说第一行我是空着的。
当我把第一行空行删除的时候 运行成功了!不知怎么回事。请教一下大家