You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hugegraph.apache.org by "liming1010 (via GitHub)" <gi...@apache.org> on 2023/11/30 08:54:30 UTC
[I] [Question] MessageBodyWriter not found for media type=application/json [incubator-hugegraph-toolchain]
liming1010 opened a new issue, #540:
URL: https://github.com/apache/incubator-hugegraph-toolchain/issues/540
### Problem Type (问题类型)
rest-api (结果不合预期)
### Before submit
- [X] 我已经确认现有的 [Issues](https://github.com/apache/hugegraph/issues) 与 [FAQ](https://hugegraph.apache.org/docs/guides/faq/) 中没有相同 / 重复问题 (I have confirmed and searched that there are no similar problems in the historical issue and documents)
### Environment (环境信息)
server版本1.0
toolchain 版本1.0
maven
```xml
<dependency>
<groupId>org.apache.hugegraph</groupId>
<artifactId>hugegraph-client</artifactId>
<version>1.0.0</version>
</dependency>
```
### Your Question (问题描述)
使用
```java
hugeClient = HugeClient.builder(properties.getProperty("hugeGraphUrl"), properties.getProperty("graph"))
.configUser("**", "**") // 默认未开启用户权限
.build();
```
连接成功
创建元数据错误:
`schema.propertyKey(value.getHp()).asText().ifNotExist().create();`
error:
```java
`严重: MessageBodyWriter not found for media type=application/json, type=class org.apache.hugegraph.structure.schema.PropertyKey, genericType=class org.apache.hugegraph.structure.schema.PropertyKey.
Exception in thread "main" java.lang.RuntimeException: java.lang.reflect.UndeclaredThrowableException
at com.tpy.commons.HugeFactory.init(HugeFactory.java:33)
at com.tpy.commons.HugeFactory.<init>(HugeFactory.java:18)
at com.tpy.service.HugeService.<init>(HugeService.java:30)
at com.tpy.service.UrlHandle.<init>(UrlHandle.java:29)
at com.tpy.ServiceApplication.main(ServiceApplication.java:17)
Caused by: java.lang.reflect.UndeclaredThrowableException
at jdk.proxy2/jdk.proxy2.$Proxy28.create(Unknown Source)
at com.tpy.commons.HugeFactory.initProperty(HugeFactory.java:44)
at com.tpy.commons.HugeFactory.init(HugeFactory.java:30)
... 4 more
Caused by: java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:118)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at org.apache.hugegraph.structure.schema.BuilderProxy.invoke(BuilderProxy.java:52)
... 7 more
Caused by: org.apache.hugegraph.rest.ClientException: Failed to do request
at org.apache.hugegraph.rest.AbstractRestClient.request(AbstractRestClient.java:200)
at org.apache.hugegraph.rest.AbstractRestClient.post(AbstractRestClient.java:227)
at org.apache.hugegraph.rest.AbstractRestClient.post(AbstractRestClient.java:206)
at org.apache.hugegraph.api.schema.PropertyKeyAPI.create(PropertyKeyAPI.java:48)
at org.apache.hugegraph.driver.SchemaManager.addPropertyKey(SchemaManager.java:85)
at org.apache.hugegraph.driver.SchemaManager.addPropertyKey(SchemaManager.java:80)
at org.apache.hugegraph.structure.schema.PropertyKey$BuilderImpl.create(PropertyKey.java:157)
at org.apache.hugegraph.structure.schema.PropertyKey$BuilderImpl.create(PropertyKey.java:140)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
... 9 more
Caused by: jakarta.ws.rs.ProcessingException: org.glassfish.jersey.message.internal.MessageBodyProviderNotFoundException: MessageBodyWriter not found for media type=application/json, type=class org.apache.hugegraph.structure.schema.PropertyKey, genericType=class org.apache.hugegraph.structure.schema.PropertyKey.
at org.glassfish.jersey.apache.connector.ApacheConnector.apply(ApacheConnector.java:531)
at org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:297)
at org.glassfish.jersey.client.JerseyInvocation.lambda$invoke$0(JerseyInvocation.java:662)
at org.glassfish.jersey.client.JerseyInvocation.call(JerseyInvocation.java:697)
at org.glassfish.jersey.client.JerseyInvocation.lambda$runInScope$3(JerseyInvocation.java:691)
at org.glassfish.jersey.internal.Errors.process(Errors.java:292)
at org.glassfish.jersey.internal.Errors.process(Errors.java:274)
at org.glassfish.jersey.internal.Errors.process(Errors.java:205)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:390)
at org.glassfish.jersey.client.JerseyInvocation.runInScope(JerseyInvocation.java:691)
at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:661)
at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:439)
at org.glassfish.jersey.client.JerseyInvocation$Builder.post(JerseyInvocation.java:345)
at org.apache.hugegraph.rest.AbstractRestClient.lambda$post$1(AbstractRestClient.java:229)
at org.apache.hugegraph.rest.AbstractRestClient.request(AbstractRestClient.java:198)
... 17 more
Caused by: org.glassfish.jersey.message.internal.MessageBodyProviderNotFoundException: MessageBodyWriter not found for media type=application/json, type=class org.apache.hugegraph.structure.schema.PropertyKey, genericType=class org.apache.hugegraph.structure.schema.PropertyKey.
at org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor.aroundWriteTo(WriterInterceptorExecutor.java:224)
at org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:139)
at org.glassfish.jersey.spi.ContentEncoder.aroundWriteTo(ContentEncoder.java:113)
at org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:139)
at org.glassfish.jersey.message.internal.MessageBodyFactory.writeTo(MessageBodyFactory.java:1116)
at org.glassfish.jersey.client.ClientRequest.doWriteEntity(ClientRequest.java:461)
at org.glassfish.jersey.client.ClientRequest.writeEntity(ClientRequest.java:443)
at org.glassfish.jersey.apache.connector.ApacheConnector$1.writeTo(ApacheConnector.java:637)
at org.apache.http.impl.execchain.RequestEntityProxy.writeTo(RequestEntityProxy.java:121)
at org.apache.http.impl.DefaultBHttpClientConnection.sendRequestEntity(DefaultBHttpClientConnection.java:156)
at org.apache.http.impl.conn.CPoolProxy.sendRequestEntity(CPoolProxy.java:152)
at org.apache.http.protocol.HttpRequestExecutor.doSendRequest(HttpRequestExecutor.java:238)
at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:123)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:272)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72)
at org.glassfish.jersey.apache.connector.ApacheConnector.apply(ApacheConnector.java:483)
... 31 more`
```
访问http://192.168.0.183:8080/graphs
返回
{"graphs":["hugegraph"]}
服务ok
### Vertex/Edge example (问题点 / 边数据举例)
_No response_
### Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)
_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: issues-unsubscribe@hugegraph.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org