Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxy cannot be cast to Locatable native runtime error #443

Closed
antonwiens opened this issue May 19, 2022 · 10 comments
Closed

Proxy cannot be cast to Locatable native runtime error #443

antonwiens opened this issue May 19, 2022 · 10 comments

Comments

@antonwiens
Copy link

I am trying to upgrade to quarkus 2.9.1 and quarkus cxf 1.1.0 and am getting the error below during runtime.

I am using a native build with dependencies to

io.quarkiverse.cxf:quarkus-cxf
io.quarkiverse.cxf:quarkus-cxf-rt-ws-security

Do you have any idea, where this might come from?

java.lang.ClassCastException: com.sun.proxy.$Proxy93 cannot be cast to com.sun.xml.bind.v2.model.annotation.Locatable
        at com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:260)
        at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:73)
        at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:54)
        at com.sun.xml.bind.v2.model.impl.ClassInfoImpl.getBaseClass(ClassInfoImpl.java:198)
        at com.sun.xml.bind.v2.model.impl.RuntimeClassInfoImpl.getBaseClass(RuntimeClassInfoImpl.java:125)
        at com.sun.xml.bind.v2.model.impl.RuntimeClassInfoImpl.getBaseClass(RuntimeClassInfoImpl.java:56)
        at com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:248)
        at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:73)
        at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:54)
        at com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:197)
        at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:68)
        at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:54)
        at com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:345)
        at com.sun.xml.bind.v2.model.impl.TypeRefImpl.calcRef(TypeRefImpl.java:66)
        at com.sun.xml.bind.v2.model.impl.TypeRefImpl.getTarget(TypeRefImpl.java:43)
        at com.sun.xml.bind.v2.model.impl.RuntimeTypeRefImpl.getTarget(RuntimeTypeRefImpl.java:32)
        at com.sun.xml.bind.v2.model.impl.RuntimeTypeRefImpl.getTarget(RuntimeTypeRefImpl.java:25)
        at com.sun.xml.bind.v2.model.impl.ElementPropertyInfoImpl$1.get(ElementPropertyInfoImpl.java:48)
        at com.sun.xml.bind.v2.model.impl.ElementPropertyInfoImpl$1.get(ElementPropertyInfoImpl.java:46)
        at java.util.AbstractList$Itr.next(AbstractList.java:371)
        at com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:245)
        at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:73)
        at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:54)
        at com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:197)
        at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:68)
        at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:54)
        at com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:345)
        at com.sun.xml.bind.v2.model.impl.ElementInfoImpl.<init>(ElementInfoImpl.java:267)
        at com.sun.xml.bind.v2.model.impl.RuntimeElementInfoImpl.<init>(RuntimeElementInfoImpl.java:41)
        at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createElementInfo(RuntimeModelBuilder.java:88)
        at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createElementInfo(RuntimeModelBuilder.java:54)
        at com.sun.xml.bind.v2.model.impl.RegistryInfoImpl.<init>(RegistryInfoImpl.java:83)
        at com.sun.xml.bind.v2.model.impl.ModelBuilder.addRegistry(ModelBuilder.java:387)
        at com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:357)
        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:435)
        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:273)
        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:109)
        at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1126)
        at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:135)
        at java.lang.reflect.Method.invoke(Method.java:566)
        at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:275)
        at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:264)
        at javax.xml.bind.ContextFinder.find(ContextFinder.java:403)
        at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:691)
        at org.apache.cxf.common.jaxb.JAXBContextCache$2.run(JAXBContextCache.java:345)
        at org.apache.cxf.common.jaxb.JAXBContextCache$2.run(JAXBContextCache.java:343)
        at java.security.AccessController.executePrivileged(AccessController.java:145)
        at java.security.AccessController.doPrivileged(AccessController.java:98)
        at org.apache.cxf.common.jaxb.JAXBContextCache.createContext(JAXBContextCache.java:343)
        at org.apache.cxf.common.jaxb.JAXBContextCache.getCachedContextAndSchemas(JAXBContextCache.java:245)
        at org.apache.cxf.jaxb.JAXBDataBinding.createJAXBContextAndSchemas(JAXBDataBinding.java:499)
        at org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:358)
        at org.apache.cxf.service.factory.AbstractServiceFactoryBean.initializeDataBindings(AbstractServiceFactoryBean.java:87)
        at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:469)
        at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.buildServiceFromClass(JaxWsServiceFactoryBean.java:693)
        at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:529)
        at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:262)
        at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:199)
        at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:103)
        at org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:91)
        at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:158)
        at org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:142)
        at io.quarkiverse.cxf.CxfClientProducer.produceCxfClient(CxfClientProducer.java:124)
        at io.quarkiverse.cxf.CxfClientProducer.loadCxfClient(CxfClientProducer.java:59)
        ... 
        at io.quarkus.arc.impl.InstanceImpl.getBeanInstance(InstanceImpl.java:223)
        at io.quarkus.arc.impl.InstanceImpl.getInternal(InstanceImpl.java:209)
        at io.quarkus.arc.impl.InstanceImpl.get(InstanceImpl.java:95)
        ...
        at de.authada.quarkus.config.ConfigChangeHandler.handle(ConfigChangeHandler.kt:68)
        at de.authada.quarkus.config.ConfigRecorder.recordVertxConfig(ConfigRecorder.kt:88)
        at io.quarkus.deployment.steps.ConfigProcessor$record2073021717.deploy_0(Unknown Source)
        at io.quarkus.deployment.steps.ConfigProcessor$record2073021717.deploy(Unknown Source)
        at io.quarkus.runner.ApplicationImpl.doStart(Unknown Source)
        at io.quarkus.runtime.Application.start(Application.java:101)
        at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:103)
        at io.quarkus.runtime.Quarkus.run(Quarkus.java:67)
        at io.quarkus.runtime.Quarkus.run(Quarkus.java:41)
        at io.quarkus.runtime.Quarkus.run(Quarkus.java:120)
        at io.quarkus.runner.GeneratedMain.main(Unknown Source)

@shumonsharif
Copy link
Contributor

I haven't seen that error before, but can look into it if you can provide a reproducer.

@antonwiens
Copy link
Author

i think this is kinda related to GraalVM 22.1 in quarkus 2.9.1.

Creating a reproducer ist kinda hard for me, cause this is using a private service interface.
But i will try to create one.

@shumonsharif
Copy link
Contributor

Yes @antonwiens, I believe you're right. I was able to recreate the issue using Quarkus 2.9.1 as well, using a service/schema I had handy.

I see an open issue in the Quarkus repo that is highly likely related. Let's keep an eye on that one - I'm hoping once they resolve that, it should take care of the errors you are seeing.

@antonwiens
Copy link
Author

Thanks for looking it up. Hope they will fix it soon...

@antonwiens
Copy link
Author

antonwiens commented May 24, 2022

@shumonsharif Could you please provide your reproducer to the open issue in the quarkus repo (quarkusio/quarkus#25325)?

@shumonsharif
Copy link
Contributor

@antonwiens Sorry, but what I have is part of a much larger project and not a simple reproducer for the issue. I'm guessing you didn't have much luck in putting one together, but I should be able to make some time over the next week.

@shumonsharif
Copy link
Contributor

@antonwiens Quarkus 2.10.0.CR1 was released last week, and I believe they may backport the fix for quarkusio/quarkus#25325 to 2.9.x.

Are you able to run some tests with 2.10.0.CR1 to see if this issue is resolved for you? Please keep me posted if not, so we can look further into it.

@antonwiens
Copy link
Author

@antonwiens Quarkus 2.10.0.CR1 was released last week, and I believe they may backport the fix for quarkusio/quarkus#25325 to 2.9.x.

Are you able to run some tests with 2.10.0.CR1 to see if this issue is resolved for you? Please keep me posted if not, so we can look further into it.

I will check it, thanks.

@antonwiens
Copy link
Author

It seems to fix the error with the class cast, but now i am getting an error related to ehcache.

Seems like i am missing the dependency, but i would rather like to remove ehcache is that possible?

Caused by: org.apache.wss4j.common.ext.WSSecurityException: org.ehcache.xml.exceptions.XmlConfigurationException: Error parsing XML configuration at resource:/cxf-ehcache.xml
Original Exception was org.apache.cxf.ws.security.tokenstore.TokenStoreException: org.ehcache.xml.exceptions.XmlConfigurationException: Error parsing XML configuration at resource:/cxf-ehcache.xml
        at org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.getCallback(WSS4JInInterceptor.java:630)
        at org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessageInternal(WSS4JInInterceptor.java:271)
        at org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:213)
        at org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:93)
        at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
        at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:829)
        at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1701)
        at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1570)
        at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1371)
        at org.apache.cxf.metrics.interceptors.CountingOutputStream.close(CountingOutputStream.java:47)
        at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
        at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:671)
        at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:63)
        at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
        at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:528)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:439)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:354)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:312)
        at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
        at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:140)
        ... 43 more
Caused by: org.apache.cxf.ws.security.tokenstore.TokenStoreException: org.ehcache.xml.exceptions.XmlConfigurationException: Error parsing XML configuration at resource:/cxf-ehcache.xml
        at org.apache.cxf.ws.security.tokenstore.EHCacheTokenStore.<init>(EHCacheTokenStore.java:82)
        at org.apache.cxf.ws.security.tokenstore.EHCacheTokenStoreFactory.newTokenStore(EHCacheTokenStoreFactory.java:45)
        at org.apache.cxf.ws.security.tokenstore.TokenStoreUtils.getTokenStore(TokenStoreUtils.java:58)
        at org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.getCallback(WSS4JInInterceptor.java:688)
        at org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.getCallback(WSS4JInInterceptor.java:628)
        ... 62 more
Caused by: org.ehcache.xml.exceptions.XmlConfigurationException: Error parsing XML configuration at resource:/cxf-ehcache.xml
        at org.ehcache.xml.XmlConfiguration.<init>(XmlConfiguration.java:124)
        at org.apache.cxf.ws.security.tokenstore.EHCacheTokenStore.<init>(EHCacheTokenStore.java:69)
        ... 66 more
Caused by: java.nio.file.NoSuchFileException: /project/lib/org.ehcache.ehcache-3.9.6.jar
        at sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:55)
        at sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:149)
        at sun.nio.fs.LinuxFileSystemProvider.readAttributes(LinuxFileSystemProvider.java:99)
        at java.nio.file.Files.readAttributes(Files.java:1764)
        at java.util.zip.ZipFile$Source.get(ZipFile.java:1259)
        at java.util.zip.ZipFile$CleanableResource.<init>(ZipFile.java:733)
        at java.util.zip.ZipFile$CleanableResource.get(ZipFile.java:850)
        at java.util.zip.ZipFile.<init>(ZipFile.java:248)
        at java.util.zip.ZipFile.<init>(ZipFile.java:177)
        at java.util.jar.JarFile.<init>(JarFile.java:350)
        at sun.net.www.protocol.jar.URLJarFile.<init>(URLJarFile.java:103)
        at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:72)
        at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:99)
        at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:125)
        at sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:155)
        at java.net.URL.openStream(URL.java:1165)
        at org.ehcache.xml.ConfigurationParser.<init>(ConfigurationParser.java:158)
        at org.ehcache.xml.XmlConfiguration.<init>(XmlConfiguration.java:114)
        ... 67 more

@shumonsharif
Copy link
Contributor

Thanks @antonwiens, closing this issue for now, based on the original exception you had logged and that it has been addressed.

Regarding ehcache, you can take a look at the notes here regarding how and why ehcache is used. It should certainly be possible to run without ehcache, though I would suggest you start a discussion in case you need some help with getting that set up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants