pecker-io / karate-grpc

gRPC Testing Made Simple by Karate
https://pecker-io.github.io/karate-grpc/
MIT License
47 stars 31 forks source link

getting Read descriptor path failed #20

Open RahulNautiyal3110 opened 3 years ago

RahulNautiyal3110 commented 3 years ago

org.graalvm.polyglot.PolyglotException: Read descriptor path failed: /Users/rahulnautiyal/Documents/target/generated-resources/protobuf/descriptor-sets/karate-grpc.protobin

anything to resolve it

pom structure

com.intuit.karate karate-junit5 ${karate.version} test com.github.thinkerou karate-grpc-core 1.0.1 com.github.thinkerou karate-grpc-proto 1.0.1 com.google.protobuf protobuf-java 3.2.0
<build>
    <testResources>
        <testResource>
            <directory>src/test/java</directory>
            <excludes>
                <exclude>**/*.java</exclude>
            </excludes>
        </testResource>
    </testResources>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>${maven.compiler.version}</version>
            <configuration>
                <encoding>UTF-8</encoding>
                <source>${java.version}</source>
                <target>${java.version}</target>
                <compilerArgument>-Werror</compilerArgument>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>${maven.surefire.version}</version>
            <configuration>
                <argLine>-Dfile.encoding=UTF-8</argLine>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.xolstice.maven.plugins</groupId>
            <artifactId>protobuf-maven-plugin</artifactId>
            <version>0.5.0</version>
            <configuration>
                <protocArtifact>com.google.protobuf:protoc:3.5.1</protocArtifact>
                <pluginId>grpc-java</pluginId>
                <pluginArtifact>io.grpc:protoc-gen-grpc-java:1.12.0</pluginArtifact>
                <writeDescriptorSet>true</writeDescriptorSet>
                <descriptorSetFileName>karate-grpc.protobin</descriptorSetFileName>
                <descriptorSetOutputDirectory>${user.home}/.karate-grpc/protobuf-descriptor-sets/</descriptorSetOutputDirectory>
                <protoSourceRoot>${project.basedir}/java/proto</protoSourceRoot>
            </configuration>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>compile</goal>
                        <goal>compile-custom</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>kr.motd.maven</groupId>
            <artifactId>os-maven-plugin</artifactId>
            <version>1.6.1</version>
            <executions>
                <execution>
                    <phase>initialize</phase>
                    <goals>
                        <goal>detect</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
s3naid commented 3 years ago

This is the path to karate-grpc.protobin:

<descriptorSetOutputDirectory>${user.home}/.karate-grpc/protobuf-descriptor-sets/</descriptorSetOutputDirectory>

Change this to your path and it should work

iwakura-lain commented 2 years ago

hi,have you solved the problem yet?i met same problem