I created a project with JHipster 6.0.0-beta.0 and java version "11.0.2" 2019-01-15 LTS
I get the following error.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project mx: Fatal error compiling: java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException: javax.xml.bind.JAXBException -> [Help 1]
Any suggestions how to solve it?
The solution is:
Add the following under <!-- For JPA static metamodel generation -->
<path>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>${jaxb-runtime.version}</version>
</path>
In your pom.xml what is the value of balise Java. Version
Related
I am trying to build nuxeo source code & noticing below build issue. I noticed similar reported issue here. Has anyone faced similar issue?
Build error:
[exec] Transform Dart2JS on nuxeo_api_playground|web/index.web_components.bootstrap.dart threw error: type 'PrefixElementX' is not a subtype of type 'MemberEntity' in type cast where
An Ant BuildException has occured: The following error occurred while executing this line:
[ERROR] /Users/kalava/Documents/Work/DAM/NuxeoOpenSource/nuxeo/addons/nuxeo-api-playground/src/main/dart/build.xml:9: exec returned: 65
[ERROR] around Ant part ...... # 4:278 in /Users/kalava/Documents/Work/DAM/NuxeoOpenSource/nuxeo/addons/nuxeo-api-playground/target/antrun/build-main.xml
Do you have the proper Dart version, as documented at https://doc.nuxeo.com/corg/installing-dart-and-related-tools/? Currently Nuxeo build requires Dart 1.23.x.
I try to work with spark-sql but I had the following errors :
error: missing or invalid dependency detected while loading class file
'package.class'. Could not access term annotation in package
org.apache.spark, because it (or its dependencies) are missing. Check
your build definition for missing or conflicting dependencies. (Re-run
with -Ylog-classpath to see the problematic classpath.) A full
rebuild may help if 'package.class' was compiled against an
incompatible version of org.apache.spark. warning: Class
org.apache.spark.annotation.InterfaceStability not found - continuing
with a stub. error: missing or invalid dependency detected while
loading class file 'SparkSession.class'. Could not access term
annotation in package org.apache.spark, because it (or its
dependencies) are missing. Check your build definition for missing or
conflicting dependencies. (Re-run with -Ylog-classpath to see the
problematic classpath.) A full rebuild may help if
'SparkSession.class' was compiled against an incompatible version of
org.apache.spark.
My configuration :
Scala 2.11.8
Spark-core_2.11-2.1.0
Spark-sql_2.11-2.1.0
Note: I use SparkSession.
After dig into the error message, I know how to solve this kind of errors.
For example:
Error - Symbol 'term org.apache.spark.annotation' is missing... A full rebuild may help if 'SparkSession.class' was compiled against an incompatible version of org.apache.spark
Open SparkSession.class, search "import org.apache.spark.annotation.", you will find import org.apache.spark.annotation.{DeveloperApi, Experimental, InterfaceStability}. It's sure that these classes is missing in classpath. You'll need to find the artifact which conclude these classes.
So open https://search.maven.org and search with c:"DeveloperApi" AND g:"org.apache.spark", you will find the missing artifact is spark-tags as #Prakash answered.
In my situation, just add dependencies spark-catalyst and spark-tags in pom.xml works.
But it's weird that why maven not auto resolve transitive dependencies here?
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_2.11</artifactId>
<version>2.2.0</version>
<scope>provided</scope>
</dependency>
If I use the above depencency, only spark-core_2.11-2.2.0.jar is in maven dependency; While if I change version to 2.1.0 or 2.3.0, all transitive dependencies will be there.
You need to include following artifacts to avoid the dependency issues.
spark-unsafe_2.11-2.1.1
spark-tags_2.11-2.1.1
When Icreate my project EMF and my project sirius,I have this error:
My version:
Eclips version: Oxygen Release Milestone 5 (4.7.0 M5)
Sirius version: 4.1
An error has occurred. See error log for more details.
org.eclipse.sirius.ui.properties.internal.TransactionalEditingDomainContextAdapter.unregisterModelChangeListener()V
Incompatible version of eclips .
My problem is a similar to that at:
maven compilation failure
But no solutions there have worked.
I have two maven projects: A is a dependency of B. I can successfully compile, test, package, and install A on both Windows 7 (my development machine) and Linux (AWS EC2 instance). I can also compile, test, package, and install B on Windows 7. When I try to compile B on Linux, however, maven presents a "cannot find symbol" error:
# mvn clean package install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building xxxxx-api Maven Webapp 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) # xxxxx-api ---
[INFO] Deleting /secure-mnt/xxxxx-api/target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # xxxxx-api ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 5 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.0:compile (default-compile) # xxxxx-api ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 20 source files to /secure-mnt/xxxxx-api/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /secure-mnt/xxxxx-api/src/main/java/com/company/util/Logging.java:[21,13] cannot find symbol
symbol: class CryptoLogging
[ERROR] /secure-mnt/xxxxx-api/src/main/java/com/company/util/Logging.java:[32,39] cannot find symbol
symbol: method getLogger(java.lang.String)
location: class com.company.util.Logging
[INFO] 2 errors
.....
I have identical versions of Java (1.7.0_25) and Maven (3.0.5) installed on both systems, and both are using the same source code versions from Git.
Running mvn dependency:list shows no warnings. The Project A jar is in the local m2 repository on the Linux server, and does have the classes and methods available.
It seems as though Maven is not making the Java compiler aware of the Project A jar on Linux, but I do not understand why. Could Maven be failing to specify the Java classpath correctly?
Does anyone have suggestions of things to try or test?
In case it is relevant:
# mvn -version
Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 13:51:28+0000)
Maven home: /usr/local/apache-maven/apache-maven-3.0.5
Java version: 1.7.0_25, vendor: Oracle Corporation
Java home: /usr/java/jdk1.7.0_25/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.4.48-45.46.amzn1.x86_64", arch: "i386", family: "unix"
Since I am sure someone will ask to see the POM, here is the relevant portion for Project B. There is nothing special about the dependencies at all:
<dependencies>
<!-- For Project A. -->
<dependency>
<groupId>com.company.projectA</groupId>
<artifactId>company-projectA</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<!-- For RESTful services. -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.2.2</version>
</dependency>
<!-- For testing. -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
</dependencies>
Thanks greatly for any help.
After further research, this turned out not to be a maven problem at all. Some files had incorrect UNIX permissions, which somehow resulted in the misleading error. After making sure all the working directories had been chown'd and chmod'd properly, the build worked.
I have installed OpenJDK as mentored below. But i still keep getting this error. I have set the right PATH in bash_profile.
Can someone help me out of this?
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler- plugin:2.3.2:compile (default-compile) on project poker-protocol: Compilation failure
[ERROR] Unable to locate the Javac Compiler in:
[ERROR] /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/../lib/tools.jar
[ERROR] Please ensure you are using JDK 1.4 or above and
[ERROR] not a JRE (the com.sun.tools.javac.Main class is required).
[ERROR] In most cases you can change the location of your Java
[ERROR] installation by setting the JAVA_HOME environment variable.
[ERROR] -> [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/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :poker-protocol
In my bash_profile i have this:
JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre
export M2_HOME=/usr/local/apache-maven-3.0.4
export PATH=${M2_HOME}/bin:${PATH}:$JAVA_HOME/bin
Can someone help me out?
You have installed the Java runtime, but to develop Java applications you need the JDK, hence you must install the OpenJDK devel package,in your case java-1.6.0-openjdk-devel-1.6.0.0.x86_64.
Not so sure about that but in my case i have set it this way :
export JAVA_HOME=/usr/lib/jvm/jdk1.7.0_11/
export PATH=$JAVA_HOME/bin:$PATH
I have done this in bash.bashrc
Try adding export before providing the variable name. Another thing i discovered even thought am not using openjdk, is that the tool.jar is not locate in the jre directory but under jdk directory.
Hope this helps.
you need to install the java-1.6.0-openjdk-devel installing the java-1.6.0-openjdk just installs JRE .