pmlopes / es4x-grpc-graphql

4 stars 0 forks source link

TypeError: Access to host class io.grpc.examples.helloworld.GreeterGrpc #1

Open Xenorage opened 4 years ago

Xenorage commented 4 years ago

I had a previous error: global is not defined, after upgrading to 0.10 and 3.8.4 it was solved.

{
  "name": "es4x-graph-grpc",
  "version": "1.0.0",
  "description": "vertx grpc graphql demo",
  "main": "index.js",
  "scripts": {
    "postinstall": "es4x install",
    "test": "es4x test index.test.js",
    "start": "es4x"
  },
  "dependencies": {
    "@vertx/core": "^3.8.4",
    "@vertx/web-graphql": "^3.8.4"
  },
  "devDependencies": {
    "es4x-pm": "^0.10"
  },
  "mvnDependencies": [
    "io.vertx:vertx-grpc:3.8.4"
  ],
  "author": "",
  "license": "ISC"
}

Now I have a TypeError: Access to host class io.grpc.examples.helloworld.GreeterGrpc is not allowed or does not exist. I found this class in myapp-0.0.1-SNAPSHOT.jar copying this class to node_modules/.lib did not solve the problem. Don't you just add node_modules/.lib to classpath? Where do you set the jars added to classpath? I tried to copy a jar what was created by me to mode_modules/.lib and got the same error message when I tried to use Java.type on it. Or you have to set access to class?

Xenorage commented 4 years ago

So I managed to hack es4x-launcher.cmd in node_modules/.bin "%JAVA_EXE%" -XX:+IgnoreUnrecognizedVMOptions %JVMCI% %JAVA_OPTS% -cp ~dp0es4x-launcher.jar;%~dp0..\.lib\myapp-0.0.1-SNAPSHOT.jar io.reactiverse.es4x.ES4X %* Now I can add jars to classpath, it gives a lot a of debug messages and some exceptions but still running. http://localhost:8080/graphiql/ gives me Resource not found

pmlopes commented 4 years ago

The classpath is set on the runnable jar in the manifest.

But this could be a Windows related issue. I'll try to spin up a VM to test this.