我是Apache CXF
的新手。我看到框架提供了自动发现功能,因此我更改了我的工作沙盒Web应用程序的cxf(版本3.1.9
)配置文件cxf.config.xml
:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxrs="http://cxf.apache.org/jaxrs"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd">
<!-- <jaxrs:server id="sec" address="/"> -->
<!-- <jaxrs:serviceBeans> -->
<!-- <bean id="fence" class="edu.pezzati.sec.WebBoundary"/> -->
<!-- <bean id="auth" class="edu.pezzati.sec.SSOIdentityService"/> -->
<!-- </jaxrs:serviceBeans> -->
<!-- <jaxrs:providers> -->
<!-- <ref bean="secjsonprovider"/> -->
<!-- </jaxrs:providers> -->
<!-- </jaxrs:server> -->
<!-- <bean id="secjsonprovider" class="com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider"/> -->
<jaxrs:server id="sec" address="/" basePackages="edu.pezzati.sec"/>
</beans>
正如您所看到的,我评论了jaxrs:server
的先前定义,以便将新功能与自动发现结合使用(作为doc shows)。新配置为我提供了一个我无法获得的堆栈跟踪:
2017-06-14 10:09:07 ERROR ContextLoader:319 - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sec': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: I/O failure during classpath scanning; nested exception is org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn't supported yet: file [/home/pezzati/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/SecurityProofOfConcept/WEB-INF/classes/edu/pezzati/sec/CanAccessImpl.class]; nested exception is java.lang.IllegalArgumentException
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:529)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:628)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4811)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5251)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: I/O failure during classpath scanning; nested exception is org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn't supported yet: file [/home/pezzati/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/SecurityProofOfConcept/WEB-INF/classes/edu/pezzati/sec/CanAccessImpl.class]; nested exception is java.lang.IllegalArgumentException
at org.apache.cxf.jaxrs.spring.JAXRSServerFactoryBeanDefinitionParser$SpringJAXRSServerFactoryBean.setApplicationContext(JAXRSServerFactoryBeanDefinitionParser.java:232)
at org.springframework.context.support.ApplicationContextAwareProcessor.invokeAwareInterfaces(ApplicationContextAwareProcessor.java:117)
at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:92)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:396)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1505)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
... 20 more
Caused by: org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn't supported yet: file [/home/pezzati/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/SecurityProofOfConcept/WEB-INF/classes/edu/pezzati/sec/CanAccessImpl.class]; nested exception is java.lang.IllegalArgumentException
at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:56)
at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:80)
at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:102)
at org.apache.cxf.common.util.SpringClasspathScanner.findClassesInternal(SpringClasspathScanner.java:95)
at org.apache.cxf.common.util.ClasspathScanner.findClasses(ClasspathScanner.java:116)
at org.apache.cxf.common.util.ClasspathScanner.findClasses(ClasspathScanner.java:108)
at org.apache.cxf.common.util.ClasspathScanner.findClasses(ClasspathScanner.java:94)
at org.apache.cxf.jaxrs.spring.JAXRSServerFactoryBeanDefinitionParser$SpringJAXRSServerFactoryBean.setApplicationContext(JAXRSServerFactoryBeanDefinitionParser.java:223)
... 25 more
Caused by: java.lang.IllegalArgumentException
at org.springframework.asm.ClassReader.<init>(Unknown Source)
at org.springframework.asm.ClassReader.<init>(Unknown Source)
at org.springframework.asm.ClassReader.<init>(Unknown Source)
at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:53)
... 32 more
我正在使用Tomcat 8
Java 8
个环境。您可以找到webapp here。我错过了什么?