You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2021/10/12 17:30:30 UTC

[GitHub] [flink-statefun] neoXfire opened a new pull request #275: Use JDK 8 Optional instead of shaded Optional class from Guava.

neoXfire opened a new pull request #275:
URL: https://github.com/apache/flink-statefun/pull/275


   I got this error on sample project with Flink embedded using `org.apache.flink:statefun-flink-datastream:3.1.0` and `org.apache.flink:flink-clients_2.12:1.14.0`
   
   ```
   Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/flink/shaded/guava18/com/google/common/base/Optional
   	at org.apache.flink.statefun.flink.datastream.StatefulFunctionDataStreamBuilder.build(StatefulFunctionDataStreamBuilder.java:147)
   	at org.example.Main.main(Main.java:50)
   Caused by: java.lang.ClassNotFoundException: org.apache.flink.shaded.guava18.com.google.common.base.Optional
   	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
   	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
   	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
   	... 2 more
   ```
   I bump flink-clients version down to `org.apache.flink:flink-clients_2.12:1.13.2` and there is no error anymore.
   
   I still think using the JDK `Optional` class is more straightforward and less error-prone than importing the shaded Guava class. 
   
   So this is my small PR.


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink-statefun] igalshilman closed pull request #275: Use JDK 8 Optional instead of shaded Optional class from Guava.

Posted by GitBox <gi...@apache.org>.
igalshilman closed pull request #275:
URL: https://github.com/apache/flink-statefun/pull/275


   


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink-statefun] igalshilman commented on pull request #275: Use JDK 8 Optional instead of shaded Optional class from Guava.

Posted by GitBox <gi...@apache.org>.
igalshilman commented on pull request #275:
URL: https://github.com/apache/flink-statefun/pull/275#issuecomment-942680176


   Thank you @neoXfire for your contribution!
   Indeed a JDK optional is the one we should be using, I think that the Guava's one slipped there by mistake, so good catch!
   
   Small note as per, the Flink contribution guide we usually create a JIRA issue to associate with a change, I'll do it this time while merging :-)


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink-statefun] igalshilman commented on pull request #275: Use JDK 8 Optional instead of shaded Optional class from Guava.

Posted by GitBox <gi...@apache.org>.
igalshilman commented on pull request #275:
URL: https://github.com/apache/flink-statefun/pull/275#issuecomment-942681494


   I see that there are also format violations, don't worry about that I'll re-format while merging.


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org