Does anyone have a GluonFX codebase with successful native builds after including application logging? - gluonfx

I started using LogBack logging library in my GluonFX app.
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.6</version>
</dependency>
It's fine during mvn gluonfx:run but my build fails with mvn gluonfx:build.
Here's an excerpt of my stacktrace. I'll change logging libraries if someone can tell me what's working for them.
Exception raised in scope ForkJoinPool-2-worker-3.ClosedWorldAnalysis.AnalysisGraphBuilderPhase: org.graalvm.compiler.java.BytecodeParser$BytecodeParserError: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved type during parsing: sun.reflect.Reflection. To diagnose the issue you can use the --allow-incomplete-classpath option. The missing type is then reported at run time when it is accessed the first time.
Caused by: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved type during parsing: sun.reflect.Reflection. To diagnose the issue you can use the --allow-incomplete-classpath option. The missing type is then reported at run time when it is accessed the first time.

Related

Flink-orc: Could not find any format factory for identifier 'orc' in the classpath

I need to save the table result to orc on S3, and this is how I do it:
tEnv.createTemporaryTable("my_output_table", TableDescriptor.forConnector("filesystem")
.schema(outputSchema)
.option("path", s3OutputPath)
.format(FormatDescriptor.forFormat("orc").build())
.build());
finalResultToInsert.executeInsert("my_output_table");
However, during runtime it throws error of
Caused by: org.apache.flink.table.api.ValidationException: Could not find any format factory for identifier 'orc' in the classpath.
at org.apache.flink.table.filesystem.FileSystemTableSink.<init>(FileSystemTableSink.java:128) ~[flink-table_2.12-1.14.2.jar:1.14.2]
at org.apache.flink.table.filesystem.FileSystemTableFactory.createDynamicTableSink(FileSystemTableFactory.java:87) ~[flink-table_2.12-1.14.2.jar:1.14.2]
at org.apache.flink.table.factories.FactoryUtil.createTableSink(FactoryUtil.java:179) ~[flink-table_2.12-1.14.2.jar:1.14.2]
at org.apache.flink.table.planner.delegation.PlannerBase.getTableSink(PlannerBase.scala:394) ~[flink-table_2.12-1.14.2.jar:1.14.2]
......
I have already included the relevant dependency
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-orc_2.11</artifactId>
<version>1.14.2</version>
</dependency>
And in the generated jar file I can see the flink orc classes:
org/apache/flink/orc/
org/apache/flink/orc/AbstractOrcFileInputFormat.class
org/apache/flink/orc/OrcFileFormatFactory$1.class
org/apache/flink/orc/OrcFilters$LessThanEquals.class
org/apache/flink/orc/AbstractOrcFileInputFormat$OrcVectorizedReader.class
org/apache/flink/orc/OrcFilters$Not.class
org/apache/flink/orc/OrcFileFormatFactory.class
org/apache/flink/orc/OrcColumnarRowSplitReader.class
org/apache/flink/orc/OrcColumnarRowSplitReader$ColumnBatchGenerator.class
org/apache/flink/orc/AbstractOrcFileInputFormat$OrcReaderBatch.class
org/apache/flink/orc/OrcFilters$In.class
......
So I really don't understand why it still can not find it in the classpath.
A side note, in the project I also include flink-avro dependency and if I change the output format from orc to avro it just works fine.
Also, I am running the job on AWS EMR. The EMR release is 6.6.0 which has Flink version of 1.14.2. https://docs.aws.amazon.com/emr/latest/ReleaseGuide/emr-660-release.html
Could anyone help with that? Thanks a lot!
If I'm not mistaken, ORC requires Hadoop. So you should also add org.apache.hadoop:hadoop-common and potentially other Hadoop dependencies too.
Ok, looks like I resolved the problem by placing
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-orc_2.11</artifactId>
<version>1.14.2</version>
</dependency>
To the top of the dependencies section in Maven pom, and it worked.
I think it is just due to the order of class loading, so put it in front might resolve the conflicts during the class loading for flink-orc dependency since it will be loaded first.

Building flink from source---error of resolving dependencies

I am trying to build Apache Flink from the source. I am strictly following
the instructions given #github flink page. https://github.com/apache/flink
I am facing the error for resolving the dependencies for project
flink-mapr-fs.
Firstly, I tried using latest maven, and afterward, as per instruction at
the flink github page https://github.com/apache/flink
https://github.com/apache/flink , I also tried via maven 3.1.1, but the
same error.
In addition, I tried for flink 1.8.0 and 1.7.2 as well but the same problem exist. The detail of error is as below:
[ERROR] Failed to execute goal on project flink-mapr-fs: Could not resolve dependencies for project org.apache.flink:flink-mapr-fs:jar:1.7.2: Could not transfer artifact com.mapr.hadoop:maprfs:jar:5.2.1-mapr from/to mapr-releases (http://repository.mapr.com/maven/): GET request of: com/mapr/hadoop/maprfs/5.2.1-mapr/maprfs-5.2.1-mapr.jar from mapr-releases failed: Premature end of Content-Length delimited message body (expected: 49411916; received: 39845888 -> [Help 1]

How do I fix this AbstractMethodError when I try to get Pellet working with OWL API?

I'm getting this error:
Exception in thread "main" java.lang.AbstractMethodError
at org.semanticweb.owlapi.OWLAPIServiceLoaderModule.lambda$loadFactories$1(OWLAPIServiceLoaderModule.java:97)
at java.util.ArrayList.forEach(Unknown Source)
at org.semanticweb.owlapi.OWLAPIServiceLoaderModule.loadFactories(OWLAPIServiceLoaderModule.java:95)
at org.semanticweb.owlapi.OWLAPIServiceLoaderModule.configure(OWLAPIServiceLoaderModule.java:52)
at com.google.inject.AbstractModule.configure(AbstractModule.java:62)
at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:340)
at com.google.inject.spi.Elements.getElements(Elements.java:110)
at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:138)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:104)
at com.google.inject.Guice.createInjector(Guice.java:99)
at com.google.inject.Guice.createInjector(Guice.java:73)
at com.google.inject.Guice.createInjector(Guice.java:62)
at org.semanticweb.owlapi.apibinding.OWLManager.createInjector(OWLManager.java:104)
at org.semanticweb.owlapi.apibinding.OWLManager.getOWLDataFactory(OWLManager.java:63)
at OntController.<init>(OntController.java:86)
at Driver.main(Driver.java:9)
whenever I try to use OWLManager, i.e. df = OWLManager.getOWLDataFactory(); or manager = OWLManager.createOWLOntologyManager();.
I've noticed that this error started appearing ever since I imported Pellet via maven. This is the dependency tag in my pom.xml:
<dependency>
<groupId>com.github.ansell.pellet</groupId>
<artifactId>pellet-owlapiv3</artifactId>
<version>2.3.3</version>
</dependency>
Is there a way to get Pellet and the latest version of OWL API working? I'm not sure how to resolve this error.
You are running Pellet with OWLAPI 5. Pellet has no releases compatible with owlapi 5, you need to use the latest Openllet release.

Oracle JavaMail IMAP provider not compatible with Java 9?

I get a compile error from maven when building a project under Java 9 that uses the Oracle JavaMail IMAP provider:
... cannot access com.sun.mail.util.ReadableMime
[ERROR] class file for com.sun.mail.util.ReadableMime not found
(ReadableMime is an interface implemented by IMAPMessage)
It works under Java 8.
The dependencies are:
<dependency>
<groupId>javax.mail</groupId>
<artifactId>javax.mail-api</artifactId>
<version>1.6.0</version>
</dependency>
<dependency>
<groupId>com.sun.mail</groupId>
<artifactId>imap</artifactId>
<version>1.6.0</version>
</dependency>
Neither javax.mail-api nor imap include a com.sun.mail.util package, but it seems to be no longer part (if it ever officially was) of the JRE.
So, I guess this is a bug in the Oracle imap provider that pops up now in the presence of Jigsaw, or am I missing something?
Interestingly, the Eclipse compiler doesn't complain.
Thanks to EJP:
com.sun.mail:imap works with com.sun.mail:javax.mail, but not with javax.mail:javax.mail-api.
The latter does not include the com.sun.mail.util package.
com.sun.mail:imap does not declare any Maven dependency, but de facto it has a compile dependency to com.sun.mail:javax.mail.

Maven surefire report's filename has redundant spaces when the tests are written using cucumber

I am using maven-surefire-plugin version 2.16 along with tests written using cucumber. The .xml and .txt reports do come up fine in the sure-fire reports folder. The text within the the .xml and .txt file along with the names has a lot of extra spaces that is proportional to the number of step definitions executed cumulatively. Also the filename has a number of spaces proportional to number of steps executed. In case I run a lot of tests then the file simply does not save with the following exception
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.16:test (default-test) on project **:
Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.16:test failed: org.apache.maven.surefire.util.NestedRuntimeException: null;
nested exception is org.apache.maven.surefire.report.ReporterException:
Unable to create file for report: /Users/kgupta2/git/$$$$$$$$/target/surefire-reports/Scenario: Using $$$$$ .txt (File name too long);
nested exception is java.io.FileNotFoundException: /Users/kgupta2/git/$$$$$$$$/target/surefire-reports/Scenario: Using $$$$$$$$ .txt (File name too long)
-> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
Clearly the filename becomes long and I have verified that it is proportional to the number of steps executed. I am running cucumber using JUnit.
Here is my configuration for maven-surefire-plugin
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.16</version>
<configuration>
<testSourceDirectory>${project.basedir}/src/test/java</testSourceDirectory>
<includes>
<include>**/CucumberJunitRun.java</include>
</includes>
</configuration>
<dependencies>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit47</artifactId>
<version>2.16</version>
</dependency>
</dependencies>
</plugin>
I am unable to understand why these additional spaces pop up.
I got this to work. It was an issue with incorrect configuration of plugins. Since I was using JUnit to run my cucumber tests, I went ahead and removed all references of TestNG from my pom and that got it to work magically. Some references of TestNG were coming from my parent pom. Just checked that my effective pom had some dependency of testNG. Really do not have a great clue as to why this was happening. But the correct configuration fixed a bunch of other errors that were creeping in

Resources