org.jibx: maven-jibx-plugin:1.2.1 - Error reading path - apache

I am trying to execute a goal using maven-jibx-plugin version 1.2.1, but I am getting the following error:
[ERROR] Failed to execute goal org.jibx:maven-jibx-plugin:1.2.1:bind (default) on project XoXcertExIm: Error loading class java.lang.CharSequence: Error reading
path java/lang/CharSequence.class for class java.lang.CharSequence -> [Help 1]
I am using Maven 3.2.5, Java versions 1.8.0_11, and windows 7 as the OS.

There is an issue on Jibx to support Java 8 see Issue here
There is a Workaround in this comment that you can try.

I had the same problem...
Workaround was as easy as include newer "bcel" dependency to the plugin "maven-jibx-plugin":
<plugin>
<groupId>org.jibx</groupId>
<artifactId>jibx-maven-plugin</artifactId>
<version>1.2.6</version>
<dependencies>
<!-- Workaround to avoid error compiling with JDK 1.8 -->
<dependency>
<groupId>org.apache.bcel</groupId>
<artifactId>bcel</artifactId>
<version>6.0-SNAPSHOT</version>
</dependency>
</dependencies>
</plugin>
You should include a new Maven repository definition in your "settings.xml" to get the new dependency:
<repository>
<id>apache-snapshots-repo</id>
<url>https://repository.apache.org/content/repositories/snapshots</url>
<releases><enabled>false</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
Regards

Related

Maven Kotlin plugin with JDK 17 not working

Upgraded Kotlin from 1.5 to 1.8 today: build fails in JDK 17 due to:
java.lang.reflect.InaccessibleObjectException: Unable to make field protected java.io.OutputStream java.io.FilterOutputStream.out accessible: module java.base does not "opens java.io" to unnamed module #2ba9f986
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:178)
at java.base/java.lang.reflect.Field.setAccessible(Field.java:172)
at com.intellij.util.io.IOUtil.syncStream(IOUtil.java:217)
tried to add the following to my Maven configuration:
<plugin>
<artifactId>kotlin-maven-plugin</artifactId>
<groupId>org.jetbrains.kotlin</groupId>
<version>${kotlin.version}</version>
<configuration>
<jvmTarget>${java.version}</jvmTarget>
<args>
<arg>"--add-opens java.base/java.io=ALL-UNNAMED"</arg>
</args>
</configuration>
</plugin>
but the problem is still there.
Official documentation does not seem to provide any info on this. Online search did not find much, apart from something about Gradle
Is there any Maven-plugin configuration to fix it? (ie build Kotlin 1.8 on JDK 17) or is that not supported?
For our Kotlin project build with Maven, We have the following file .mvn/jvm.config in the project folder. The content should be as follows:
--add-opens=java.base/java.lang=ALL-UNNAMED
--add-opens=java.base/java.io=ALL-UNNAMED

Exception in deserializing avro object in map reduce

I am trying to run a map reduce job which takes an avro file as input and does some processing. I followed the sample program apache has given us here
http://avro.apache.org/docs/1.7.6/mr.html
But I keep on running into this exception
java.lang.Exception: java.lang.NoSuchMethodError: org.apache.avro.generic.GenericData.createDatumWriter(Lorg/apache/avro/Schema;)Lorg/apache/avro/io/DatumWriter;
at org.apache.hadoop.mapred.LocalJobRunner$Job.runTasks(LocalJobRunner.java:462)
at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:522)
Caused by: java.lang.NoSuchMethodError: org.apache.avro.generic.GenericData.createDatumWriter(Lorg/apache/avro/Schema;)Lorg/apache/avro/io/DatumWriter;
Any idea on what I may be doing wrong? I have specified my pom configs in the bottom. Also I am using MapR version 4.
<repositories>
<repository>
<id>MapR</id>
<url>http://repository.mapr.com/maven/.</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-core</artifactId>
<version>1.2.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.avro</groupId>
<artifactId>avro</artifactId>
<version>1.7.6</version>
</dependency>
<dependency>
<groupId>org.apache.avro</groupId>
<artifactId>avro-mapred</artifactId>
<version>1.7.6</version>
<classifier>hadoop2</classifier>
</dependency>
</dependencies>
Common cause of such errors is this:
Your software was compiled against 1.7.6 version of avro, but in runtime, classes from older version were probably loaded.
Make sure that 1.7.6 is the actual version of your avro artifacts in your runtime classpath. Print out the classpath at the start of your mapper. If you're using oozie, the classpath jars are listed in launcher job output.
The first avro jar you see in the classpath is the one that will be used to load the classes, so if it isn't 1.7.6, that's the problem.
You can force your classpath artifacts to come first in the task's classpath by setting mapreduce.job.user.classpath.first configuration property to true.
Also you have another error in your pom that may very well cause you problems, maybe the very ones you're seeing. You are using avro-mapred artifact compiled for hadoop2 while the hadoop artifact you're depending on is that of hadoop1. These should not be compatible. If you're using hadoop1, loose the hadoop2 classifier on avro-mapred, and if you're using hadoop2, remove hadoop-core and put hadoop-mapreduce-client-core instead.
I have solved this by injecting the right Avro jar in bootstrap action, as described here:
https://stackoverflow.com/a/40235289/3487888

building maven flex project with flex mojo depending on apache sdk fail

I have a mavenized flex project wich builds fine with adobe sdke 4.6.
Now , i'm trying to compile it with apache recent sdk .
I mavenized the sdk and copied the dependencies in local repo .
the apache version that i mavenized is : 4.13.0.20140701 .
my pom is as below :
<properties>
<flexmojos.version>7.0.1</flexmojos.version>
<flex.version>4.13.0.20140701</flex.version>
<flash.version>11.1</flash.version>
</properties>
<build>
<sourceDirectory>src/main/flex</sourceDirectory>
<plugins>
<plugin>
<groupId>net.flexmojos.oss</groupId>
<artifactId>flexmojos-maven-plugin</artifactId>
<version>${flexmojos.version}</version>
<extensions>true</extensions>
<configuration>
<debug>true</debug>
<sourceFile>ComptaFlex.mxml</sourceFile>
<services>${basedir}/src/main/flex/services/services-config.xml</services>
<compilerWarnings>
<warn-no-constructor>false</warn-no-constructor>
</compilerWarnings>
</configuration>
<dependencies>
<!-- This handles a bug in maven which causes problems with flex resources -->
<dependency>
<groupId>net.flexmojos.oss</groupId>
<artifactId>flexmojos-threadlocaltoolkit-wrapper</artifactId>
<version>${flexmojos.version}</version>
</dependency>
<!-- Without this FM will use the compiler configured in its master
pom, which will result in version conflicts -->
<dependency>
<groupId>org.apache.flex</groupId>
<artifactId>compiler</artifactId>
<version>4.13.0.20140701</version>
<type>pom</type>
</dependency>
</dependencies>
</plugin>
<plugin>
I got maven compile error as :
xmojos.oss:flexmojos-flex-compiler:jar:7.0.1 -> net.flexmojos.oss:flexmojos-generator-internal-compiler-iface:jar:7.0.1 -> org.apache.flex:compiler:pom:4.12.1.20140427: Failed to read artifact descriptor for org.apache.flex:compiler:pom:4.12.1.20140427: Could not transfer artifact org.apache.
it seems that flex mojo always use a default apache version and ignores mine provided . how could i force flexmojo build with my given version .
Flexmojos-maven-plugin version 7.0.x is built using FDK 4.12.1.20140427. This FDK declared as dependency to this maven plugin.
You need firstly mavenize FDK 4.12.1.20140427 and put it to you maven repository. Only after that you can mavenize other versions of FDK.
A dirty work around is to change flexmojo-parent pom file : and edit by hand :
<flex.version>4.13.0.20140701</flex.version>
until flexmojo developpers comes with a better response .
I have written quite a bit of documentation lately, please check-out at: https://cwiki.apache.org/confluence/display/FLEX/Preparing+FDKs+for+Maven+builds
The short version:
We have created a maven extension that should automatically download and install Flex SDKs as they are referenced in the maven build. Also Flexmojos 7.1.0-SNAPSHOT has been updated to no longer contain a reference to any FDK artifact. Also we now use 3-segment versions such as: 4.14.1

SmartGwt 2.4 with Maven on Eclipse

Could Smartgwt 2.4 be usable with maven.
I take “Missing artifact com.smartgwt:smartgwt:jar:2.4:compile” error When give smartgwt version “2.4″. “2.0″ is ok but 2.2 and above gives error.
dependency;
<dependency>
<groupId>com.smartgwt</groupId>
<artifactId>smartgwt</artifactId>
<version>2.4</version>
</dependency>
repo;
<repository>
<id>smartclient</id>
<name>smartclient.com</name>
<url>http://www.smartclient.com/maven2</url>
</repository>
Download the desired version of smartgwt.jar and smargwt-skins.jar and upload them to your own repository, such as nexus (http://nexus.sonatype.org/) and configure maven to use the resources from that repository as well.

Problem with JBoss dependencies in Maven

I have code dependant on some JBoss provided libraries. I have added to my POM following dependency:
...
<repository>
<id>jboss</id>
<url>http://repository.jboss.org/nexus/content/groups/public-jboss/</url>
</repository>
...
<dependency>
<groupId>org.jboss.jbossas</groupId>
<artifactId>jboss-as-client</artifactId>
<version>6.0.0.Final</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
And I receive following error
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: org.jboss.aspects:jboss-transaction-aspects
Reason: Failed to build model from file 'C:\Users\User\.m2\repository\org\jboss\
aspects\jboss-transaction-aspects\1.0.0.GA\jboss-transaction-aspects-1.0.0.GA.po
m'.
Error: 'no more data available - expected end tags </dependency></dependencies><
/project> to close start tag <dependency> from line 48 and start tag <dependenci
es> from line 45 and start tag <project> from line 1, parser stopped on END_TAG
seen ...<groupId>org.jboss</groupId>\n ... #50:5' for project org.jboss.aspec
ts:jboss-transaction-aspects
I couldn't "google" it out. Any ideas?
It seems either your dependencies tags are not matching, or you don't have them.