Questions tagged [jsonrpc4j]

This project aims to provide the facility to easily implement JSON-RPC for the java programming language. jsonrpc4j uses the Jackson library to convert java objects to and from json objects (and other things related to JSON-RPC).

JSON-RPC for Java

This project aims to provide the facility to easily implement JSON-RPC for the java programming language. jsonrpc4j uses the Jackson library to convert java objects to and from json objects (and other things related to JSON-RPC).

Features Include:

  • Streaming server (InputStream \ OutputStream)
  • HTTP Server (HttpServletRequest \ HttpServletResponse)
  • Portlet Server (ResourceRequest \ ResourceResponse)
  • Socket Server (StreamServer)
  • Integration with the Spring Framework (RemoteExporter)
  • Streaming client
  • HTTP client
  • Dynamic client proxies
  • Annotations support
  • Custom error resolving
  • Composite services

Maven

This project is built with Maven. Be sure to check the pom.xml for the dependencies if you're not using maven. If you're already using spring you should have most (if not all) of the dependencies already - outside of maybe the Jackson Library. Jsonrpc4j is available from the maven central repo. Add the following to your pom.xml if you're using maven:

In <dependencies>:

<!-- jsonrpc4j -->
<dependency>
    <groupId>com.github.briandilley.jsonrpc4j</groupId>
    <artifactId>jsonrpc4j</artifactId>
    <version>1.1</version>
</dependency>

JSON-RPC specification

The official source for the JSON-RPC 2.0 specification. The guys over at json-rpc google group seem to be fairly active, so you can ask clarifying questions there.

Streaming server and client

Jsonrpc4j comes with a streaming server and client to support applications of all types (not just HTTP). The JsonRpcClient and JsonRpcServer have simple methods that take InputStreams and OutputStreams. Also in the library is a JsonRpcHttpClient which extends the JsonRpcClient to add HTTP support.

Spring Framework

jsonrpc4j provides a RemoteExporter to expose java services as JSON-RPC over HTTP without requiring any additional work on the part of the programmer. The following example explains how to use the JsonServiceExporter within the Spring Framework.

11 questions
2
votes
1 answer

How do I pass objects as parameters using the jsonrpc4j client?

I'm trying to write a Kotlin client that uses jsonrpc4j (https://github.com/briandilley/jsonrpc4j) to talk to a server running on an Android device. This is the server I'm using: https://github.com/xiaocong/android-uiautomator-server Calling methods…
fejd
  • 2,545
  • 1
  • 16
  • 39
1
vote
0 answers

How can I throw jsonrpc error object with user defined code, message and data from spring boot project

How can I throw jsonrpc error object with user defined code, message and data from spring boot project? I tried below code, unfortunately passed code and data are not getting inside error. But I am getting passed message. I have mentioned my code…
Rojan
  • 11
  • 2
1
vote
1 answer

jsonrpc4j null on JSON serialization

I'm getting a null error from jsonrpc4j in the class CleengAPI.java below from which the method rpc.listCustomers(publisherToken, offset, limit); is called to serialize the following customer JSON list which is downloaded correctly by jsonrpc4j and…
conteh
  • 1,544
  • 1
  • 17
  • 39
1
vote
1 answer

Best library to implement jsonrpc 2.0 in java with bidirectional support

I am in search of a library to implement jsonrpc 2.0 in java with bidirecional support. I have found these two (JJsonRpc, jsonrpc4j) some recommendation of which one is better?
1
vote
2 answers

Logging JSON-RPC calls using jsonrpc4j

I'm sure that if you have used jsonrpc4j (outside a spring container) you will recognise the following standard pattern. public class MyServletJsonRpc extends HttpServlet { private MyService myService; private JsonRpcServer jsonRpcServer; …
David Newcomb
  • 10,639
  • 3
  • 49
  • 62
0
votes
1 answer

Application fails on run in a new release of SpringBoot 3.0.0

I'm using jsonrpc4j library to handle my jsonrpc api. After migrating to new release of SpringBoot 3.0.0 it builds, but fails on run with an error of RemoteExporter: ERROR 22396 --- [ main] o.s.boot.SpringApplication :…
r2r
  • 13
  • 5
0
votes
0 answers

Doen't receive request with rpc server on spring-boot

There is project on spring-boot and need to implement json-rpc intregration Choosen jsonrpc4j lib for implementation and user instruction from here But when try to send message from postman, there is nothing in logs and nothig reactions from…
Roberto
  • 1,288
  • 5
  • 23
  • 47
0
votes
1 answer

Java jsonrpc4j jsonRpcServer NoClassDefFoundError (Eclipse)

I want to create a basic JSON-RPC server over TCP. To do this I found the project https://github.com/briandilley/jsonrpc4j. When I tried to create in Eclipse a basic Maven project using the jsonRpcServer (see App.java), the exception…
davidvb
  • 11
  • 2
0
votes
0 answers

jsonrpc4j:java.net.SocketException: Unexpected end of file from server

this is my code, i want to use jsonrpc4j(1.0 version) to get the OVSDB message public static void main(String[] args) throws Throwable { JsonRpcHttpClient jsonRpcHttpClient = new JsonRpcHttpClient(new URL("http://192.168.1.177:6632")); …
Smile
  • 17
  • 7
0
votes
0 answers

JsonParseException on Jsonrpc4j client

I'm trying to create a client with jsonrpc4, but I always have a JsonParseException error. I've tried many things, simple client.invoke and dynamic proxy, but it doesn't work and I don't understand why. Here is my code public static void…
Magali Jz
  • 13
  • 6
0
votes
1 answer

JSONRPC format different between Jsonrpc4j and go's rpc/jsonrpc

I was meet a problem when I tried used net/jsonrpc package to build a server and a Java client with jsonrpc4j The problem is jsonrpc4j is when error happen, golang`s method will return error and encoding to json. I got this json object in…
Venser Lin
  • 13
  • 4