jduo commented on issue #347:
URL: https://github.com/apache/arrow-cookbook/issues/347#issuecomment-2049687334

   When using the unshaded flight-core artifact I add grpc dependencies 
explicitly:
   ```
           <dependency>
               <groupId>io.grpc</groupId>
               <artifactId>grpc-api</artifactId>
               <version>1.63.0</version>
           </dependency>
           <dependency>
               <groupId>io.grpc</groupId>
               <artifactId>grpc-netty</artifactId>
               <version>1.63.0</version>
           </dependency>
           <dependency>
               <groupId>io.grpc</groupId>
               <artifactId>grpc-stub</artifactId>
               <version>1.63.0</version>
           </dependency>
           <dependency>
               <groupId>io.grpc</groupId>
               <artifactId>grpc-protobuf</artifactId>
               <version>1.63.0</version>
           </dependency>
   ```
   
   and this leads to the following error:
   ```
   Exception java.lang.IllegalAccessError: class 
org.apache.arrow.flight.impl.Flight$FlightDescriptor tried to access method 
'com.google.protobuf.LazyStringArrayList 
com.google.protobuf.LazyStringArrayList.emptyList()' 
(org.apache.arrow.flight.impl.Flight$FlightDescriptor and 
com.google.protobuf.LazyStringArrayList are in unnamed module of loader 'app')
         at Flight$FlightDescriptor.<init> (Flight.java:7034)
         at Flight$FlightDescriptor.<clinit> (Flight.java:7738)
         at FlightServiceGrpc.getGetFlightInfoMethod 
(FlightServiceGrpc.java:106)
         at FlightServiceGrpc.getServiceDescriptor (FlightServiceGrpc.java:1180)
         at FlightServiceGrpc.bindService (FlightServiceGrpc.java:1059)
         at FlightServiceGrpc$FlightServiceImplBase.bindService 
(FlightServiceGrpc.java:558)
         at FlightBindingService.bindService (FlightBindingService.java:96)
         at ServerInterceptors.intercept (ServerInterceptors.java:93)
         at FlightServer$Builder.build (FlightServer.java:306)
         at (#39:4)
   ```
   
   I'm looking into this. However it's worth noting that using 
dependency:build-classpath doesn't separate out JARs that should go on the 
module-path (ie JPMS modules) vs. JARs that should go on the classpath.
   
   jshell requires you to explicitly put JARs that are to be used as JPMS 
modules on the module-path parameter. Everything put on the classpath goes into 
the unnamed module, which is why in the error above, FlightDescriptor is being 
shown as part of the unnamed module instead of the org.apache.flight.core 
module.
   
   This differs from running tests from maven, where maven inspects JAR 
metadata to figure out if they support JPMS or not.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to