gpt4 book ai didi

web-services - 使用maven在grails中运行测试用例时违反加载程序约束

转载 作者:行者123 更新时间:2023-12-02 14:54:30 25 4
gpt4 key购买 nike

我正在使用 maven 在 grails 中运行测试用例,并获得了以下堆栈跟踪。

我有以下冲突。

loader constraint violation: when resolving field "DATETIME" the class loader (instance of org/codehaus/groovy/grails/cli/support/GrailsRootLoader) of the referring class, javax/xml/datatype/DatatypeConstants, and the class loader (instance of <bootloader>) for the field's resolved type, javax/xml/namespace/QName, have different Class objects for that type

java.lang.LinkageError: loader constraint violation: when resolving field "DATETIME" the class loader (instance of org/codehaus/groovy/grails/cli/support/GrailsRootLoader) of the referring class, javax/xml/datatype/DatatypeConstants, and the class loader (instance of <bootloader>) for the field's resolved type, javax/xml/namespace/QName, have different Class objects for that type
at com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl.<clinit>(RuntimeBuiltinLeafInfoImpl.java:224)
at com.sun.xml.bind.v2.model.impl.RuntimeTypeInfoSetImpl.<init>(RuntimeTypeInfoSetImpl.java:61)
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createTypeInfoSet(RuntimeModelBuilder.java:127)
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createTypeInfoSet(RuntimeModelBuilder.java:79)
at com.sun.xml.bind.v2.model.impl.ModelBuilder.<init>(ModelBuilder.java:152)
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.<init>(RuntimeModelBuilder.java:87)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:422)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:286)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:139)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:117)
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:211)
at javax.xml.bind.ContextFinder.find(ContextFinder.java:372)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:522)
at com.sun.xml.ws.spi.ProviderImpl$2.run(ProviderImpl.java:220)
at com.sun.xml.ws.spi.ProviderImpl$2.run(ProviderImpl.java:218)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.xml.ws.spi.ProviderImpl.getEPRJaxbContext(ProviderImpl.java:217)
at com.sun.xml.ws.spi.ProviderImpl.<clinit>(ProviderImpl.java:88)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at javax.xml.ws.spi.FactoryFinder.newInstance(FactoryFinder.java:36)
at javax.xml.ws.spi.FactoryFinder.find(FactoryFinder.java:95)
at javax.xml.ws.spi.Provider.provider(Provider.java:82)
at javax.xml.ws.Service.<init>(Service.java:56)
at javax.xml.ws.Service.create(Service.java:698)
at com.j2.api.fax.myaccount.client.MyaccountClient$1.makeObject(MyaccountClient.java:28)
at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1148)
at com.j2.api.fax.myaccount.client.MyaccountClient.authenticateByPhoneNumber(MyaccountClient.java:66)
at com.j2.api.fax.myaccount.client.MyaccountClient$authenticateByPhoneNumber.call(Unknown Source)
at com.j2.helpers.LoginHelper.authenticateCustomerByPhoneNumber(LoginHelper.groovy:86)
at com.j2.helpers.LoginHelper$authenticateCustomerByPhoneNumber.call(Unknown Source)
at com.j2.spa.MobileService.login(MobileService.groovy:508)
at com.j2.spa.MobileService$login.call(Unknown Source)
at com.j2.spa.MobileController$_closure7.doCall(MobileController.groovy:109)
at com.j2.spa.MobileController$_closure7.call(MobileController.groovy)
at MobileControllerTests.testLogin_Failure_UsernameNotFound(MobileControllerTests.groovy:42)

我已经尝试了很多,但无法解决它。

任何帮助都非常感谢..
谢谢

最佳答案

我遇到了类似的问题,解决方案是排除 stax-api 模块。我正在使用具有以下配置的 Gradle:

configurations {
compile.exclude module: 'stax-api'}

如果您使用的是maven,我认为它是相似的。希望能帮助到你。

关于web-services - 使用maven在grails中运行测试用例时违反加载程序约束,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12278431/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com