简体   繁体   English

java.lang.ClassNotFoundException:javax.ws.rs.ProcessingException

[英]java.lang.ClassNotFoundException: javax.ws.rs.ProcessingException

I'm writing an Apache Camel Spring Boot application to consume and produce to an AMQP/JMS broker.我正在编写一个 Apache Camel Spring Boot 应用程序来消费和生产到 AMQP/JMS 代理。 I can successfully run the application via IntelliJ, but when I try to run the application via command line, I get the ProcessingException.我可以通过 IntelliJ 成功运行应用程序,但是当我尝试通过命令行运行应用程序时,我得到了 ProcessingException。 When I include javax.ws.rs-api version 2.0.1 in my pom file, I then get当我在我的 pom 文件中包含 javax.ws.rs-api 版本 2.0.1 时,我得到

java.lang.ClassNotFoundException: javax.ws.rs.client.ClientException java.lang.ClassNotFoundException: javax.ws.rs.client.ClientException

I've tried several different versions of javax.ws.rs-api and Apache CXF without success.我尝试了几个不同版本的 javax.ws.rs-api 和 Apache CXF,但都没有成功。 I cant figure out the dependency issue.我无法弄清楚依赖问题。 Here is my pom.xml这是我的 pom.xml

    <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <groupId>com.mycompany.asean</groupId>
    <artifactId>ats-fixm-adapter</artifactId>
    <name>ATS to FIXM Adapter</name>
    <version>0.0.1-SNAPSHOT</version>

    <properties>
        <maven.compiler.plugin.version>3.3</maven.compiler.plugin.version>
        <compiler.source>1.8</compiler.source>
        <compiler.target>1.8</compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <spring.boot-version>1.5.14.RELEASE</spring.boot-version>
        <camel.project.version>2.21.1</camel.project.version>
        <solace.version>7.1.2.248</solace.version>
        <camel-spring-boot.version>2.15.1</camel-spring-boot.version>
        <jms-producer.version>1.0.0-SNAPSHOT</jms-producer.version>
        <dozer.version>5.4.0</dozer.version>
        <saxon.version>9.5.1-4</saxon.version>
        <fixm.version>4.0.6-SNAPSHOT</fixm.version>
        <gufi.version>3.2.2.GEMS</gufi.version>
        <prometheus.version>0.0.26</prometheus.version>
        <jaxb-utils.version>3.1.1-SNAPSHOT</jaxb-utils.version>
        <joda-time.version>2.1</joda-time.version>
        <cxf.version>3.0.15</cxf.version>
        <maven.scm.gitexe.version>1.9.4</maven.scm.gitexe.version>
        <spring.messaging.version>5.0.6.RELEASE</spring.messaging.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <!-- Spring Boot BOM -->
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>${spring.boot-version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <!-- Camel BOM -->
            <dependency>
                <groupId>org.apache.camel</groupId>
                <artifactId>camel-spring-boot-dependencies</artifactId>
                <version>${camel.project.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <!-- Metrics -->
        <dependency>
            <groupId>io.prometheus</groupId>
            <artifactId>simpleclient</artifactId>
            <version>${prometheus.version}</version>
        </dependency>
        <dependency>
            <groupId>io.prometheus</groupId>
            <artifactId>simpleclient_common</artifactId>
            <version>${prometheus.version}</version>
        </dependency>
        <dependency>
            <groupId>io.prometheus</groupId>
            <artifactId>simpleclient_hotspot</artifactId>
            <version>${prometheus.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-jetty</artifactId>
        </dependency>
        <!-- JMS Producer -->
        <dependency>
            <groupId>com.mycompany.iihv.jmsproducer</groupId>
            <artifactId>jms-producer</artifactId>
            <version>${jms-producer.version}</version>
        </dependency>

        <!-- FIXM -->
        <dependency>
            <groupId>com.mycompany.mydept.fo.foxs</groupId>
            <artifactId>fixm</artifactId>
            <version>${fixm.version}</version>
        </dependency>
        <!-- GUFI Client -->
        <dependency>
            <groupId>com.mycompany.mydept.fo.gufi</groupId>
            <artifactId>gufi-client</artifactId>
            <version>${gufi.version}</version>
        </dependency>
        <dependency>
            <groupId>com.mycompany.mydept.fo.gufi</groupId>
            <artifactId>gufi-core</artifactId>
            <version>${gufi.version}</version>
        </dependency>
        <!-- JAX-B -->
        <dependency>
            <groupId>com.mycompany.mydept.fo</groupId>
            <artifactId>jaxb-utils</artifactId>
            <version>${jaxb-utils.version}</version>
        </dependency>
        <!-- Joda Time for DateTime calculations -->
        <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
            <version>${joda-time.version}</version>
        </dependency>

        <!-- Spring Boot -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-tomcat</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-undertow</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-actuator</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-messaging</artifactId>
            <version>${spring.messaging.version}</version>
        </dependency>

        <!-- Solace -->
        <dependency>
            <groupId>com.solacesystems</groupId>
            <artifactId>sol-common</artifactId>
            <version>${solace.version}</version>
        </dependency>
        <dependency>
            <groupId>com.solacesystems</groupId>
            <artifactId>sol-jcsmp</artifactId>
            <version>${solace.version}</version>
        </dependency>
        <dependency>
            <groupId>com.solacesystems</groupId>
            <artifactId>sol-jms</artifactId>
            <version>${solace.version}</version>
        </dependency>

        <!-- Camel -->
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-spring-boot-starter</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-stream-starter</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-spring</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-jms</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-saxon</artifactId>
        </dependency>

        <!-- CXF -->
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-rs-client</artifactId>
            <version>${cxf.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>javax.ws.rs</groupId>
                    <artifactId>javax.ws.rs-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-transports-http-hc</artifactId>
            <version>${cxf.version}</version>
        </dependency>

        <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>javax.ws.rs-api</artifactId>
            <version>2.0.1</version>
        </dependency>

        <!-- Dozer -->
        <dependency>
            <groupId>net.sf.dozer</groupId>
            <artifactId>dozer</artifactId>
            <version>${dozer.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-log4j12</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>log4j</groupId>
                    <artifactId>log4j</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!-- Saxon (for XSLT 2.0) -->
        <dependency>
            <groupId>net.sf.saxon</groupId>
            <artifactId>Saxon-HE</artifactId>
            <version>${saxon.version}</version>
        </dependency>

        <!-- test -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-test-spring</artifactId>
            <version>${camel.project.version}</version>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven.compiler.plugin.version}</version>
                <configuration>
                    <source>${compiler.source}</source>
                    <target>${compiler.target}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>${spring.boot-version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.camel</groupId>
                <artifactId>camel-maven-plugin</artifactId>
                <version>${camel.project.version}</version>
                <!-- allows to fail if not all routes are fully covered during testing -->
                <!--
                        <configuration>
                          <failOnError>true</failOnError>
                        </configuration>
                -->
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>jdk9+-build</id>
            <activation>
                <jdk>[9,)</jdk>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <argLine>--add-modules java.xml.bind --add-opens java.base/java.lang=ALL-UNNAMED</argLine>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>

Here is part of the corresponding stack traces.这是相应堆栈跟踪的一部分。

Caused by: java.lang.NoClassDefFoundError: javax/ws/rs/client/ClientException
    at java.lang.Class.getDeclaredMethods0 (Native Method)
    at java.lang.Class.privateGetDeclaredMethods (Class.java:2701)
    at java.lang.Class.getDeclaredMethods (Class.java:1975)
    at org.springframework.util.ReflectionUtils.getDeclaredMethods (ReflectionUtils.java:613)
    at org.springframework.util.ReflectionUtils.doWithMethods (ReflectionUtils.java:524)
    at org.springframework.util.ReflectionUtils.doWithMethods (ReflectionUtils.java:510)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors (AutowiredAnnotationBeanPostProcessor.java:247)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineConstructorsFromBeanPostProcessors (AbstractAutowireCapableBeanFactory.java:1126)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance (AbstractAutowireCapableBeanFactory.java:1099)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean (AbstractAutowireCapableBeanFactory.java:513)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean (AbstractAutowireCapableBeanFactory.java:483)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject (AbstractBeanFactory.java:312)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton (DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (AbstractBeanFactory.java:308)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean (AbstractBeanFactory.java:197)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference (BeanDefinitionValueResolver.java:351)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary (BeanDefinitionValueResolver.java:108)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues (AbstractAutowireCapableBeanFactory.java:1537)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean (AbstractAutowireCapableBeanFactory.java:1284)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean (AbstractAutowireCapableBeanFactory.java:553)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean (AbstractAutowireCapableBeanFactory.java:483)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject (AbstractBeanFactory.java:312)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton (DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (AbstractBeanFactory.java:308)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean (AbstractBeanFactory.java:197)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference (BeanDefinitionValueResolver.java:351)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary (BeanDefinitionValueResolver.java:108)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues (AbstractAutowireCapableBeanFactory.java:1537)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean (AbstractAutowireCapableBeanFactory.java:1284)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean (AbstractAutowireCapableBeanFactory.java:553)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean (AbstractAutowireCapableBeanFactory.java:483)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject (AbstractBeanFactory.java:312)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton (DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (AbstractBeanFactory.java:308)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean (AbstractBeanFactory.java:197)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons (DefaultListableBeanFactory.java:761)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization (AbstractApplicationContext.java:867)
    at org.springframework.context.support.AbstractApplicationContext.refresh (AbstractApplicationContext.java:543)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh (EmbeddedWebApplicationContext.java:122)
    at org.springframework.boot.SpringApplication.refresh (SpringApplication.java:693)
    at org.springframework.boot.SpringApplication.refreshContext (SpringApplication.java:360)
    at org.springframework.boot.SpringApplication.run (SpringApplication.java:303)
    at org.springframework.boot.SpringApplication.run (SpringApplication.java:1118)
    at org.springframework.boot.SpringApplication.run (SpringApplication.java:1107)
    at com.mycompany.mydept.adapter.ats.ATSFIXMCamelApplication.main (ATSFIXMCamelApplication.java:21)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.springframework.boot.maven.AbstractRunMojo$LaunchRunner.run (AbstractRunMojo.java:527)
    at java.lang.Thread.run (Thread.java:748)
Caused by: java.lang.ClassNotFoundException: javax.ws.rs.client.ClientException
    at java.net.URLClassLoader.findClass (URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass (ClassLoader.java:424)
    at java.lang.ClassLoader.loadClass (ClassLoader.java:357)
    at java.lang.Class.getDeclaredMethods0 (Native Method)
    at java.lang.Class.privateGetDeclaredMethods (Class.java:2701)
    at java.lang.Class.getDeclaredMethods (Class.java:1975)
    at org.springframework.util.ReflectionUtils.getDeclaredMethods (ReflectionUtils.java:613)
    at org.springframework.util.ReflectionUtils.doWithMethods (ReflectionUtils.java:524)
    at org.springframework.util.ReflectionUtils.doWithMethods (ReflectionUtils.java:510)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors (AutowiredAnnotationBeanPostProcessor.java:247)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineConstructorsFromBeanPostProcessors (AbstractAutowireCapableBeanFactory.java:1126)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance (AbstractAutowireCapableBeanFactory.java:1099)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean (AbstractAutowireCapableBeanFactory.java:513)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean (AbstractAutowireCapableBeanFactory.java:483)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject (AbstractBeanFactory.java:312)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton (DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (AbstractBeanFactory.java:308)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean (AbstractBeanFactory.java:197)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference (BeanDefinitionValueResolver.java:351)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary (BeanDefinitionValueResolver.java:108)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues (AbstractAutowireCapableBeanFactory.java:1537)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean (AbstractAutowireCapableBeanFactory.java:1284)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean (AbstractAutowireCapableBeanFactory.java:553)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean (AbstractAutowireCapableBeanFactory.java:483)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject (AbstractBeanFactory.java:312)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton (DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (AbstractBeanFactory.java:308)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean (AbstractBeanFactory.java:197)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference (BeanDefinitionValueResolver.java:351)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary (BeanDefinitionValueResolver.java:108)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues (AbstractAutowireCapableBeanFactory.java:1537)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean (AbstractAutowireCapableBeanFactory.java:1284)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean (AbstractAutowireCapableBeanFactory.java:553)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean (AbstractAutowireCapableBeanFactory.java:483)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject (AbstractBeanFactory.java:312)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton (DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (AbstractBeanFactory.java:308)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean (AbstractBeanFactory.java:197)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons (DefaultListableBeanFactory.java:761)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization (AbstractApplicationContext.java:867)
    at org.springframework.context.support.AbstractApplicationContext.refresh (AbstractApplicationContext.java:543)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh (EmbeddedWebApplicationContext.java:122)
    at org.springframework.boot.SpringApplication.refresh (SpringApplication.java:693)
    at org.springframework.boot.SpringApplication.refreshContext (SpringApplication.java:360)
    at org.springframework.boot.SpringApplication.run (SpringApplication.java:303)
    at org.springframework.boot.SpringApplication.run (SpringApplication.java:1118)
    at org.springframework.boot.SpringApplication.run (SpringApplication.java:1107)
    at com.mycompany.mydept.adapter.ats.ATSFIXMCamelApplication.main (ATSFIXMCamelApplication.java:21)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.springframework.boot.maven.AbstractRunMojo$LaunchRunner.run (AbstractRunMojo.java:527)
    at java.lang.Thread.run (Thread.java:748)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE

As per your above pom.xml file the version of javax.ws.rs-api is 2.0.1 which does not have javax.ws.rs.client.ClientException (verify yourself) hence you getting java.lang.ClassNotFoundException better use some other version which has this Class like you can try below version which has ClientException class in it :根据您上面的 pom.xml 文件, javax.ws.rs-api的版本是2.0.1 ,它没有javax.ws.rs.client.ClientException (验证自己)因此你得到 java.lang.ClassNotFoundException 更好地使用一些其他具有此类的版本,例如您可以尝试以下具有ClientException类的版本:

<!-- https://mvnrepository.com/artifact/javax.ws.rs/javax.ws.rs-api -->
<dependency>
    <groupId>javax.ws.rs</groupId>
    <artifactId>javax.ws.rs-api</artifactId>
    <version>2.0-m10</version>
</dependency>

Also I think you should edit your question heading as :另外我认为您应该将问题标题编辑为:

java.lang.ClassNotFoundException: javax.ws.rs.client.ClientException java.lang.ClassNotFoundException: javax.ws.rs.client.ClientException

Add the below dependency in your pom.在你的 pom.xml 中添加以下依赖项。

 <dependency>
    <groupId>javax.ws.rs</groupId>
    <artifactId>javax.ws.rs-api</artifactId>
    <version>2.0</version>
</dependency>

<dependency>
    <groupId>org.glassfish.jersey.core</groupId>
    <artifactId>jersey-common</artifactId>
</dependency>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 CXF:java.lang.ClassNotFoundException:javax.ws.rs.MessageProcessingException - CXF: java.lang.ClassNotFoundException: javax.ws.rs.MessageProcessingException java.lang.ClassNotFoundException:javax.ws.rs.MessageProcessingException - java.lang.ClassNotFoundException: javax.ws.rs.MessageProcessingException Tomcat 7.0 服务无法启动 ClassNotFoundException: javax.ws.rs.ProcessingException - Tomcat 7.0 service fails to start with ClassNotFoundException: javax.ws.rs.ProcessingException REST JAX-RS javax.ws.rs.ProcessingException: - REST JAX-RS javax.ws.rs.ProcessingException: Java REST 客户端 - javax.ws.rs.ProcessingException:javax/xml/bind/annotation/XmlTransient - Java REST Client - javax.ws.rs.ProcessingException: javax/xml/bind/annotation/XmlTransient 通过Jersey发送请求时javax.ws.rs.ProcessingException - javax.ws.rs.ProcessingException while sending request through Jersey 球衣javax.ws.rs.ProcessingException:已连接 - Jersey javax.ws.rs.ProcessingException: Already connected 在 Springboot 中重写 Docusign 方法引发了 javax.ws.rs.ProcessingException - Rewrite Docusign methods in Springboot raised javax.ws.rs.ProcessingException javax.ws.rs.ProcessingException:java.net.SocketException:服务器中的文件意外结束 - javax.ws.rs.ProcessingException : java.net.SocketException: Unexpected end of file from server 泽西岛客户端抛出javax.ws.rs.ProcessingException:java.net.ConnectException:无法连接到/127.0.0.1(端口8080) - Jersey client throws javax.ws.rs.ProcessingException: java.net.ConnectException : failed to connect to /127.0.0.1 (port 8080)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM