質問編集履歴
2
TestDtoとテスト実行クラスを掲載
title
CHANGED
File without changes
|
body
CHANGED
@@ -71,6 +71,44 @@
|
|
71
71
|
}
|
72
72
|
}
|
73
73
|
```
|
74
|
+
|
75
|
+
```
|
76
|
+
import javax.xml.bind.annotation.XmlRootElement;
|
77
|
+
|
78
|
+
@XmlRootElement
|
79
|
+
public class TestDto {
|
80
|
+
public String detailCode;
|
81
|
+
public String telNumber;
|
82
|
+
public TestDto(){
|
83
|
+
|
84
|
+
}
|
85
|
+
public TestDto(String detailCode,String telNumber){
|
86
|
+
this.detailCode=detailCode;
|
87
|
+
this.telNumber=telNumber;
|
88
|
+
}
|
89
|
+
|
90
|
+
}
|
91
|
+
|
92
|
+
import java.util.HashMap;
|
93
|
+
import java.util.Map;
|
94
|
+
|
95
|
+
public class RestTest {
|
96
|
+
public static void main(String[] args) throws URISyntaxException{
|
97
|
+
String uri="";
|
98
|
+
Map<String, String> entity=new HashMap<String, String>();
|
99
|
+
entity.put("serviceKubun", "1");
|
100
|
+
entity.put("telNumber", "0312345678");
|
101
|
+
entity.put("systemidentifier", "ABC");
|
102
|
+
Map<String,Map<String,String>> parent = new HashMap<String,Map<String,String>>();
|
103
|
+
parent.put("request", entity);
|
104
|
+
String method="POST";
|
105
|
+
RestClient client=new RestClient();
|
106
|
+
Object json=client.sendRequest(uri, method, parent);
|
107
|
+
}
|
108
|
+
|
109
|
+
}
|
110
|
+
|
111
|
+
```
|
74
112
|
エラーログ
|
75
113
|
```
|
76
114
|
重大: A message body reader for Java class *******.rest.TestDto, and Java type class ********.rest.TestDto, and MIME media type application/json; charset=utf-8 was not found [月 8 08 13:26:17 JST 2016]
|
1
エラーログの掲載
title
CHANGED
File without changes
|
body
CHANGED
@@ -70,4 +70,41 @@
|
|
70
70
|
}
|
71
71
|
}
|
72
72
|
}
|
73
|
+
```
|
74
|
+
エラーログ
|
75
|
+
```
|
76
|
+
重大: A message body reader for Java class *******.rest.TestDto, and Java type class ********.rest.TestDto, and MIME media type application/json; charset=utf-8 was not found [月 8 08 13:26:17 JST 2016]
|
77
|
+
重大: The registered message body readers compatible with the MIME media type are:
|
78
|
+
application/json; charset=utf-8 ->
|
79
|
+
com.sun.jersey.json.impl.provider.entity.JSONJAXBElementProvider$App
|
80
|
+
com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider$App
|
81
|
+
com.sun.jersey.json.impl.provider.entity.JSONListElementProvider$App
|
82
|
+
*/* ->
|
83
|
+
com.sun.jersey.core.impl.provider.entity.FormProvider
|
84
|
+
com.sun.jersey.core.impl.provider.entity.StringProvider
|
85
|
+
com.sun.jersey.core.impl.provider.entity.ByteArrayProvider
|
86
|
+
com.sun.jersey.core.impl.provider.entity.FileProvider
|
87
|
+
com.sun.jersey.core.impl.provider.entity.InputStreamProvider
|
88
|
+
com.sun.jersey.core.impl.provider.entity.DataSourceProvider
|
89
|
+
com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$General
|
90
|
+
com.sun.jersey.core.impl.provider.entity.ReaderProvider
|
91
|
+
com.sun.jersey.core.impl.provider.entity.DocumentProvider
|
92
|
+
com.sun.jersey.core.impl.provider.entity.SourceProvider$StreamSourceReader
|
93
|
+
com.sun.jersey.core.impl.provider.entity.SourceProvider$SAXSourceReader
|
94
|
+
com.sun.jersey.core.impl.provider.entity.SourceProvider$DOMSourceReader
|
95
|
+
com.sun.jersey.json.impl.provider.entity.JSONJAXBElementProvider$General
|
96
|
+
com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$General
|
97
|
+
com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$General
|
98
|
+
com.sun.jersey.core.impl.provider.entity.XMLRootObjectProvider$General
|
99
|
+
com.sun.jersey.core.impl.provider.entity.EntityHolderReader
|
100
|
+
com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider$General
|
101
|
+
com.sun.jersey.json.impl.provider.entity.JSONListElementProvider$General
|
102
|
+
[月 8 08 13:26:17 JST 2016]
|
103
|
+
com.sun.jersey.api.client.ClientHandlerException: A message body reader for Java class ***.rest.TestDto, and Java type class *****.rest.TestDto, and MIME media type application/json; charset=utf-8 was not found
|
104
|
+
at com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:630)
|
105
|
+
at com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:586)
|
106
|
+
at ***.rest.RestClient.sendRequest(RestClient.java:54)
|
107
|
+
at ***.rest.RestTest.main(RestTest.java:28)
|
108
|
+
|
109
|
+
|
73
110
|
```
|