-
@ronsigal Hi Ron, After spending some time on learning the 02:31:34,972 WARN [org.jboss.as.dependency.private] (MSC service thread 1-7) WFLYSRV0018: Deployment "deployment.grpcToRest.example.grpc-1.0.0.Final-SNAPSHOT.war" is using a private module ("org.wildfly.extension.grpc") which may be changed or removed in future versions without notice.
02:31:34,972 WARN [org.jboss.as.dependency.private] (MSC service thread 1-7) WFLYSRV0018: Deployment "deployment.grpcToRest.example.grpc-1.0.0.Final-SNAPSHOT.war" is using a private module ("io.grpc") which may be changed or removed in future versions without notice.
...
02:31:35,167 INFO [org.wildfly.extension.grpc] (ServerService Thread Pool -- 80) WFLYGRPC0003: gRPC server for grpcToRest.example-1.0.0.Final-SNAPSHOT.war listening on localhost:9555
...
02:31:36,195 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 81) WFLYUT0021: Registered web context: '/grpcToRest.example.grpc-1.0.0.Final-SNAPSHOT' for server 'default-server'
...
02:31:36,242 INFO [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0010: Deployed "grpcToRest.example.grpc-1.0.0.Final-SNAPSHOT.war" (runtime-name : "grpcToRest.example.grpc-1.0.0.Final-SNAPSHOT.war") Here is the screenshot of the WildFly output: However if I tried to access the service it returns ➤ curl http://localhost:8080/grpcToRest.example.grpc-1.0.0-SNAPSHOT/grpcToJakartaRest/grpcserver/context 02:43:08
...
<html><head><title>Error</title></head><body>404 - Not Found</body></html> Using the test case produced the same result: I'm not sure what's wrong in my local setup. Could you please give some suggestions on how to troubleshooting the problem? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 14 comments 10 replies
-
@liweinan This is slightly off topic, but it would be great if we could avoid having to first invoke that context endpoint. If you've got time to experiment feel free to have a look so we can avoid that :) |
Beta Was this translation helpful? Give feedback.
-
@jamezp Yes sir! |
Beta Was this translation helpful? Give feedback.
-
@ronsigal In addition I have another question: In the generated <servlet>
<servlet-name>GreetServlet</servlet-name>
<servlet-class>
dev.resteasy.grpc.bridge.runtime.servlet.GrpcHttpServletDispatcher
</servlet-class>
</servlet> However I can't find this class anywhere, am I missing anything? |
Beta Was this translation helpful? Give feedback.
-
@ronsigal Thanks for the great answers! I'll follow up the instructions and give back my findings here :D |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
@ronsigal In addition, while playing with the example, the manual step to edit the TestCase and adding the test scope dependencies creates some obstacles to follow up, maybe the test case and the dependencies could be generated correctly in the archetype generation step(and the testcase can be marked as |
Beta Was this translation helpful? Give feedback.
-
@ronsigal Nice idea! Parsing the resources and generate the test according to the resources is the ultimate solution IMHO. At the first step, maybe I can try to use a JBang plugin to setup the current test file and the dependencies into correct shape, so the example user and run a single Maven command to make the example run. If I make any progress on this topic, I'll report it here :D |
Beta Was this translation helpful? Give feedback.
-
@liweinan, I suspect that the test can be hard coded in the archetype. For example, consider
in resteasy-grpc/testsuite/grpc-tests/src/test/java/org/jboss/resteasy/test/grpc/AbstractGrpcToJakartaRESTTest.java. |
Beta Was this translation helpful? Give feedback.
-
I don't know much about jBang, but anything you can do to make things simpler has to be a good thing. |
Beta Was this translation helpful? Give feedback.
-
@ronsigal okay! I'm going on learning the implementation of the bridge project, and I have a question on this method: @Path("start")
@GET
public String startGRPC(@Context HttpServletRequest request) throws Exception {
servletContext = request.getServletContext();
final Greet_Server server = new Greet_Server();
new Thread() {
@SuppressWarnings({"deprecation", "removal"})
public void run() {
try {
if (System.getSecurityManager() == null) {
server.start();
} else {
AccessController.doPrivileged((PrivilegedExceptionAction<Void>) () -> {server.start(); return null;});
}
logger.info("started gRPC server on port " + PORT);
server.blockUntilShutdown();
} catch (Exception e) {
e.printStackTrace();
}
}
}.start();
return "Starting gRPC server on port " + PORT;
} If the above method is called multiple times, there will be multiple instances be created and it will cause problem right? |
Beta Was this translation helpful? Give feedback.
-
@ronsigal Now I understand :D Thanks! |
Beta Was this translation helpful? Give feedback.
-
@ronsigal In order to go on writing my blog post on the usage of the |
Beta Was this translation helpful? Give feedback.
-
Sure, @liweinan, do whatever you need to do. |
Beta Was this translation helpful? Give feedback.
-
I'm trying to remember if there is a reference to grpc-bridge-example somewhere that needs to be updated with a new version ... |
Beta Was this translation helpful? Give feedback.
Ok, I've found some problems in grpc-bridge-example, in README.md and GreetingTest. It's embarrassing because I thought I went through everything at least twice. I suppose I read through this one but didn't actually work through the instructions. I should probably work through the rest of the documentation. In any case, I've submitted a pull request (#151) which seems to work. @liweinan, could you try again? Thanks!!