質問編集履歴
2
TestDtoとテスト実行クラスを掲載
test
CHANGED
File without changes
|
test
CHANGED
@@ -144,6 +144,82 @@
|
|
144
144
|
|
145
145
|
```
|
146
146
|
|
147
|
+
|
148
|
+
|
149
|
+
```
|
150
|
+
|
151
|
+
import javax.xml.bind.annotation.XmlRootElement;
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
@XmlRootElement
|
156
|
+
|
157
|
+
public class TestDto {
|
158
|
+
|
159
|
+
public String detailCode;
|
160
|
+
|
161
|
+
public String telNumber;
|
162
|
+
|
163
|
+
public TestDto(){
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
}
|
168
|
+
|
169
|
+
public TestDto(String detailCode,String telNumber){
|
170
|
+
|
171
|
+
this.detailCode=detailCode;
|
172
|
+
|
173
|
+
this.telNumber=telNumber;
|
174
|
+
|
175
|
+
}
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
}
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
import java.util.HashMap;
|
184
|
+
|
185
|
+
import java.util.Map;
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
public class RestTest {
|
190
|
+
|
191
|
+
public static void main(String[] args) throws URISyntaxException{
|
192
|
+
|
193
|
+
String uri="";
|
194
|
+
|
195
|
+
Map<String, String> entity=new HashMap<String, String>();
|
196
|
+
|
197
|
+
entity.put("serviceKubun", "1");
|
198
|
+
|
199
|
+
entity.put("telNumber", "0312345678");
|
200
|
+
|
201
|
+
entity.put("systemidentifier", "ABC");
|
202
|
+
|
203
|
+
Map<String,Map<String,String>> parent = new HashMap<String,Map<String,String>>();
|
204
|
+
|
205
|
+
parent.put("request", entity);
|
206
|
+
|
207
|
+
String method="POST";
|
208
|
+
|
209
|
+
RestClient client=new RestClient();
|
210
|
+
|
211
|
+
Object json=client.sendRequest(uri, method, parent);
|
212
|
+
|
213
|
+
}
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
}
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
```
|
222
|
+
|
147
223
|
エラーログ
|
148
224
|
|
149
225
|
```
|
1
エラーログの掲載
test
CHANGED
File without changes
|
test
CHANGED
@@ -143,3 +143,77 @@
|
|
143
143
|
}
|
144
144
|
|
145
145
|
```
|
146
|
+
|
147
|
+
エラーログ
|
148
|
+
|
149
|
+
```
|
150
|
+
|
151
|
+
重大: 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]
|
152
|
+
|
153
|
+
重大: The registered message body readers compatible with the MIME media type are:
|
154
|
+
|
155
|
+
application/json; charset=utf-8 ->
|
156
|
+
|
157
|
+
com.sun.jersey.json.impl.provider.entity.JSONJAXBElementProvider$App
|
158
|
+
|
159
|
+
com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider$App
|
160
|
+
|
161
|
+
com.sun.jersey.json.impl.provider.entity.JSONListElementProvider$App
|
162
|
+
|
163
|
+
*/* ->
|
164
|
+
|
165
|
+
com.sun.jersey.core.impl.provider.entity.FormProvider
|
166
|
+
|
167
|
+
com.sun.jersey.core.impl.provider.entity.StringProvider
|
168
|
+
|
169
|
+
com.sun.jersey.core.impl.provider.entity.ByteArrayProvider
|
170
|
+
|
171
|
+
com.sun.jersey.core.impl.provider.entity.FileProvider
|
172
|
+
|
173
|
+
com.sun.jersey.core.impl.provider.entity.InputStreamProvider
|
174
|
+
|
175
|
+
com.sun.jersey.core.impl.provider.entity.DataSourceProvider
|
176
|
+
|
177
|
+
com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$General
|
178
|
+
|
179
|
+
com.sun.jersey.core.impl.provider.entity.ReaderProvider
|
180
|
+
|
181
|
+
com.sun.jersey.core.impl.provider.entity.DocumentProvider
|
182
|
+
|
183
|
+
com.sun.jersey.core.impl.provider.entity.SourceProvider$StreamSourceReader
|
184
|
+
|
185
|
+
com.sun.jersey.core.impl.provider.entity.SourceProvider$SAXSourceReader
|
186
|
+
|
187
|
+
com.sun.jersey.core.impl.provider.entity.SourceProvider$DOMSourceReader
|
188
|
+
|
189
|
+
com.sun.jersey.json.impl.provider.entity.JSONJAXBElementProvider$General
|
190
|
+
|
191
|
+
com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$General
|
192
|
+
|
193
|
+
com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$General
|
194
|
+
|
195
|
+
com.sun.jersey.core.impl.provider.entity.XMLRootObjectProvider$General
|
196
|
+
|
197
|
+
com.sun.jersey.core.impl.provider.entity.EntityHolderReader
|
198
|
+
|
199
|
+
com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider$General
|
200
|
+
|
201
|
+
com.sun.jersey.json.impl.provider.entity.JSONListElementProvider$General
|
202
|
+
|
203
|
+
[月 8 08 13:26:17 JST 2016]
|
204
|
+
|
205
|
+
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
|
206
|
+
|
207
|
+
at com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:630)
|
208
|
+
|
209
|
+
at com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:586)
|
210
|
+
|
211
|
+
at ***.rest.RestClient.sendRequest(RestClient.java:54)
|
212
|
+
|
213
|
+
at ***.rest.RestTest.main(RestTest.java:28)
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
```
|