ShawnJim opened a new issue, #5268:
URL: https://github.com/apache/shenyu/issues/5268

   ### Is there an existing issue for this?
   
   - [X] I have searched the existing issues
   
   ### Current Behavior
   
   throw error when registering with Eureka. 
   error log:
   ```
   Exception in thread "main" com.sun.jersey.api.client.ClientHandlerException: 
A message body writer for Java class com.netflix.appinfo.InstanceInfo, and Java 
type class com.netflix.appinfo.InstanceInfo, and MIME media type 
application/json was not found
        at 
com.sun.jersey.api.client.RequestWriter$RequestEntityWriterImpl.<init>(RequestWriter.java:199)
        at 
com.sun.jersey.api.client.RequestWriter.getRequestEntityWriter(RequestWriter.java:248)
        at 
com.sun.jersey.client.apache4.ApacheHttpClient4Handler.getHttpEntity(ApacheHttpClient4Handler.java:262)
        at 
com.sun.jersey.client.apache4.ApacheHttpClient4Handler.getUriHttpRequest(ApacheHttpClient4Handler.java:206)
        at 
com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:157)
        at com.sun.jersey.api.client.Client.handle(Client.java:652)
        at com.sun.jersey.api.client.WebResource.handle(WebResource.java:682)
        at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)
        at 
com.sun.jersey.api.client.WebResource$Builder.post(WebResource.java:570)
        at 
com.netflix.discovery.shared.transport.jersey.AbstractJerseyEurekaHttpClient.register(AbstractJerseyEurekaHttpClient.java:57)
        at 
org.apache.shenyu.registry.eureka.EurekaInstanceRegisterRepository.persistInstance(EurekaInstanceRegisterRepository.java:71)
        at org.apache.shenyu.registry.eureka.MainTest.main(MainTest.java:36)
   ```
   
   ### Expected Behavior
   
   Register normally.
   
![image](https://github.com/apache/shenyu/assets/32192263/9417fe09-d9d9-44e3-b069-aaa44f02549c)
   
   
   ### Steps To Reproduce
   
   On the master branch, run the test case code.
   
   ``` java
   public static void main(final String[] args) {
           EurekaInstanceRegisterRepository eurekaInstanceRegisterRepository = 
new EurekaInstanceRegisterRepository();
           RegisterConfig config = new RegisterConfig();
           config.setServerLists("http://localhost:8761/eureka/";);
           eurekaInstanceRegisterRepository.init(config);
           InstanceEntity instanceEntity = new InstanceEntity("shenyu", 
"127.0.0.1", 12345);
           eurekaInstanceRegisterRepository.persistInstance(instanceEntity);
           while (true) {
               try {
                   Thread.sleep(1000);
               } catch (InterruptedException e) {
                   e.printStackTrace();
               }
           }
       }
   ```
   
   ### Environment
   
   ```markdown
   ShenYu version(s): 2.6.0
   ```
   
   
   ### Debug logs
   
   _No response_
   
   ### Anything else?
   
   _No response_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to