Closed. This question needs details or clarity。它当前不接受答案。
                            
                        
                    
                
                            
                                
                
                        
                            
                        
                    
                        
                            想改善这个问题吗?添加详细信息并通过editing this post阐明问题。
                        
                        5年前关闭。
                                                                                            
                
        
我想更新我的javax.ws.rs-api版本21.0-m09,因为它很旧。但是,我看不出在新版本中ClientFactory是否已存在以执行此操作:

// create the client
Client c = ClientFactory.newClient();
String baseuri = main.getBaseRestCrmUri();
WebTarget target = c.target(baseuri);

// test web response
String msg = target.path("hello/Joe").request().get(String.class);
assertEquals("Hello Joe!", msg);


最新版本的ClientFactory发生了什么?

任何帮助将不胜感激。

最佳答案

找到了:)使用此依赖项:

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


然后用ClientFactory代替它:

Client c = ClientFactory.newClient();


使用ClientBuilder执行此操作:

Client c = ClientBuilder.newClient();

07-24 19:40