我们正在从hibernate 5(来自v3)和spring boot 1.5升级我们的技术栈,特别是当我们将相同的域对象用于hibernate和jibx编组时,尤其面临hibernate和jibx编组的问题。
def compileJibx() {
ant {
taskdef(name: 'bind',
classname: 'org.jibx.binding.ant.CompileTask',
classpath: configurations.jibx.asPath)
bind(binding: "${projectDir}/src/main/resources/jibx-binding.xml", verbose: 'false') {
classpath {
pathelement(path: "${projectDir}/build/classes/main")
}
}
}
}此jibx编译任务在compileJava步骤之后执行。
使用以下依赖项
jibx group: 'org.apache.bcel', name: 'bcel', version:'6.0'
jibx group: 'org.jibx', name: 'jibx-run', version:'1.1.5'
jibx group: 'org.jibx', name: 'jibx-extras', version:'1.1.5'
jibx group: 'org.jibx', name: 'jibx-bind', version:'1.1.5'
jibx group: 'xmlpull', name: 'xmlpull', version:'1.1.4'
jibx group: 'xpp3', name: 'xpp3', version:'1.1.4c'
jibx group: 'org.hibernate.javax.persistence', name: 'hibernate-jpa-2.1-api', version:'1.0.2.Final'
jibx group: 'javax.xml.bind', name: 'jaxb-api', version:'2.2.11'在gradle构建之后,我看到jibx类在jar文件中被正确构造。但当我启动应用程序时,jibx编组由于以下错误而失败。
[2019-09-18 10:30:40.537] [BDSPUSD00000582] [ERROR] [com.abc.UnhandledExceptionHandler] [{Correlation-ID=skdfhjwe39850jkhfsd}] - Unhandled exception
org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.VerifyError: Expecting a stackmap frame at branch target 26
Exception Details:
Location:
com/abc/jibx/domain/JibxDomain.JiBX_ABC_marshal_6_0(Lorg/jibx/runtime/impl/MarshallingContext;)V @19: ifnonnull
Reason:
Expected stackmap frame at this location.
Bytecode:
0x0000000: 2b2a b600 462b 2b06 1248 b600 4c57 2ab6
0x0000010: 0050 59c7 0007 57a7 0007 2bb6 0056 0612
...
Caused by: java.lang.VerifyError: Expecting a stackmap frame at branch target 26
Exception Details:
Location:
com/abc/jibx/domain/JibxDomain.JiBX_ABC_marshal_6_0(Lorg/jibx/runtime/impl/MarshallingContext;)V @19: ifnonnull
Reason:
Expected stackmap frame at this location.
Bytecode:
0x0000000: 2b2a b600 462b 2b06 1248 b600 4c57 2ab6
0x0000010: 0050 59c7 0007 57a7 0007 2bb6 0056 0612我的编译或构建步骤有什么问题吗?有人可以提供一些工作的例子,在下面的堆栈很好地工作。
Spring boot 1.5、Hibernate 5、Jibx 1.15、Java8
发布于 2019-10-11 21:41:11
我已经用bcel/jibx的升级版本修复了这个问题。
bcel-6.1
jibx-1.3.1https://stackoverflow.com/questions/57996049
复制相似问题