Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.xml.ws.Endpoint]: Factory method 'endpoint' threw exception; nested exception is java.lang.NoClassDefFoundError: org/apache/cxf/frontend/ServerFactoryBean at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE] at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:622) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE] ... 19 common frames omitted Caused by: java.lang.NoClassDefFoundError: org/apache/cxf/frontend/ServerFactoryBean at java.lang.ClassLoader.defineClass1(Native Method) ~[na:1.8.0_301] at java.lang.ClassLoader.defineClass(ClassLoader.java:756) ~[na:1.8.0_301] at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) ~[na:1.8.0_301] at java.net.URLClassLoader.defineClass(URLClassLoader.java:468) ~[na:1.8.0_301] at java.net.URLClassLoader.access$100(URLClassLoader.java:74) ~[na:1.8.0_301] at java.net.URLClassLoader$1.run(URLClassLoader.java:369) ~[na:1.8.0_301] at java.net.URLClassLoader$1.run(URLClassLoader.java:363) ~[na:1.8.0_301] at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_301] at java.net.URLClassLoader.findClass(URLClassLoader.java:362) ~[na:1.8.0_301] at java.lang.ClassLoader.loadClass(ClassLoader.java:418) ~[na:1.8.0_301] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355) ~[na:1.8.0_301] at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[na:1.8.0_301] at org.apache.cxf.jaxws.EndpointImpl.<init>(EndpointImpl.java:164) ~[cxf-rt-frontend-jaxws-3.4.4.jar:3.4.4] at org.apache.cxf.jaxws.EndpointImpl.<init>(EndpointImpl.java:157) ~[cxf-rt-frontend-jaxws-3.4.4.jar:3.4.4] at org.apache.cxf.jaxws.EndpointImpl.<init>(EndpointImpl.java:171) ~[cxf-rt-frontend-jaxws-3.4.4.jar:3.4.4] at org.apache.cxf.jaxws.EndpointImpl.<init>(EndpointImpl.java:178) ~[cxf-rt-frontend-jaxws-3.4.4.jar:3.4.4]
时间: 2023-10-16 20:09:54 浏览: 167
Caused by: java.lang.ClassNotFoundException: org.apache.commons.collections.Transformer异常
5星 · 资源好评率100%
根据错误信息显示,它无法找到org/apache/cxf/frontend/ServerFactoryBean类,这表明您的应用程序缺少CXF的JAR文件。您可以通过将以下依赖项添加到Maven POM文件中来解决此问题:
```xml
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-core</artifactId>
<version>3.3.6</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>3.3.6</version>
</dependency>
```
如果您不使用Maven,则需要手动下载这些JAR文件并将其添加到您的类路径中。
阅读全文