I know that there are similar topics upon this issue but none of them helped me to solve the errors...
I am on a Spring 2.5 project using:
1) Maven 3.3.9:
Apache Maven 3.3.9
Maven home: /usr/share/maven
Java version: 1.8.0_131, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-oracle/jre
Default locale: es_AR, platform encoding: UTF-8
OS name: "linux", version: "4.8.0-52-generic", arch: "amd64", family: "unix"
And while running mvn jetty:run I got the following issue:
[ERROR] Nested in org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is java.lang.IllegalStateException: AnnotationTransactionAttributeSource is only available on Java 1.5 and higher:
java.lang.IllegalStateException: AnnotationTransactionAttributeSource is only available on Java 1.5 and higher
I even change the compiler plugin and set it to java 1.6 as this spring version doesnt work with java 8 and things dont work... Does anyone have a clue ?... I am on Eclipse and also change the compliance level and nothing... no success
I think your $JAVA_HOME environment variable is the problem.
It should contain /usr/lib/jvm/java-8-oracle
instead of /usr/lib/jvm/java-8-oracle/jre
Also, I'm guessing your $PATH contains another, older java version.
You can test that by executing java --version on the command line.
Related
Is there an examples of a JHipster Oracle 11g implementation around?
I thought I had everything set up correctly, but still not able to run ./mvnw without the application throwing errors. Unfortunately not a lot is available on the specific error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project cdp: Compilation failure: Compilation failure:
[ERROR] error reading /Users/millera/.m2/repository/io/github/jhipster/jhipster-framework/3.0.3/jhipster-framework-3.0.3.jar; zip END header not found
I initially thought this was an issue with Maven on my system, but it seems to be working for other things, and if I run mvn --version I get back:
Maven home: /usr/local/Cellar/maven/3.6.2/libexec
Java version: 11.0.4, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk-11.0.4.jdk/Contents/Home
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.14.6", arch: "x86_64", family: "mac"
It's an issue with your maven local repository which for some unknown reason has a corrupted jar of jhipster-framework.
Try cleaning it up with rm -rf /Users/millera/.m2/repository/io/github/jhipster and restart your app with ./mvnw.
With SonarQube 6.5, jdk 1.8.0_144 and sonar.maven.plugin 3.3.0.603, running mvn sonar:sonar gives me the following error:
Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.3.0.603:sonar (default-cli) on project tdd: Execution default-cli of goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.3.0.603:sonar failed: A required class was missing while executing org.sonarsource.scanner.maven:sonar-maven-plugin:3.3.0.603:sonar: javax/xml/bind/JAXBException
What am i missing?
Thanks,
Nilesh
I encountered this issue today as well. I recently installed JDK 9.0.1 and had switched the language level of my project over to source and target version 1.9. Executing a clean install triggered this exception. The issue was fixed and released recently in issue 2506 of their JIRA, so updating the sonarjava plugin from the sonarqube instance's administation panel fixed the issue for me.
Run into the same exact problem while running sonar analysis with java-9.
Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T15:39:06-04:00)
Maven home: D:\java\maven\3.5.0\bin\..
Java version: 9, vendor: Oracle Corporation
Java home: D:\java\jdk\1.9.0_181
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
...
[INFO] --- sonar-maven-plugin:3.3.0.603:sonar (default-cli) # _test ---
...
[INFO] SonarQube version: 6.5.0
...
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.3.0.603:sonar (default-cli) on project
maven:sonar-maven-plugin:3.3.0.603:sonar: javax/xml/bind/JAXBException
Same build still works fine with java-8.
Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T15:39:06-04:00)
Maven home: D:\java\maven\3.5.0\bin\..
Java version: 1.8.0_131, vendor: Oracle Corporation
Java home: D:\java\jdk\1.8.0_131\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
...
[INFO] --- sonar-maven-plugin:3.3.0.603:sonar (default-cli) # _test ---
...
[INFO] SonarQube version: 6.5.0
...
[INFO] BUILD SUCCESS
I see same behavior with javax.javaee-api 6.0 7.0 or 8.0 thus problem seems to be not related to project dependencies.
Older org.sonarsource.scanner.maven.sonar-maven-plugin 3.2 version of plugin produces same result thus problem is not related to newer 3.3.0.603 plugin version.
Run only with maven 3.5.0.
Just for sake of it successfully tested with 1.8.0_144 in addition to 1.8.0_131.
Exact version of SonarQube is 6.5.0.27846.
Just a suggestion: make sure you are actually running java-8.
mvn -v
While running a build in Jenkins Maven is complaining about JDK. I know very well that it's some challenge with env variables. I have set JAVA_HOME to JDK installation path but no luck. I have searched the whole web and know that other people have faced this but their solution isn't working for me. Any help would be really appreciated !
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[INFO] 1 error
FYR, my maven version output.
root#zarvis:~# mvn -version
Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T17:27:37+05:30)
Maven home: /usr/local/apache-maven-3.3.3
Java version: 1.7.0_101, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-openjdk-amd64/jre
Default locale: en_IN, platform encoding: UTF-8
OS name: "linux", version: "3.19.0-31-generic", arch: "amd64", family: "unix"
JAVA_HOME is set but not sure why maven appends it with JRE.
root#zarvis:~# echo $JAVA_HOME
/usr/lib/jvm/java-1.7.0-openjdk-amd64
Thanks in advance !
Try adding JDK_HOME to your path
I have recently installed Maven on my windows based laptop. But getting following error when running mvn just to test my installation:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Whoever when running mvn -version I am getting appropriate response:
Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T22:29:23+05:00)
Maven home: C:\apps\Maven
Java version: 1.7.0_25, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.7.0_25\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "x86", family: "windows"
Note that I am getting exactly same error when running mvn install, mvn package, mvn clean or any other Maven target in my maven project, while project doesn't have any dependency for SLF4J.
This error usually means that you have the slf4j-api library in your classpath without an SLF4J binding associated with it. Make sure to have exactly one of these binding jars in your classpath alongside the slf4j-api jar (also make sure the versions are compatible):
slf4j-nop.jar,
slf4j-simple.jar,
slf4j-log4j12.jar,
slf4j-jdk14.jar or
logback-classic.jar
The SLF4J lists all such error codes on its FAQ page. You can find this issue and resolution documented here.
IIRC, this is merely a warning and won't affect your build process - or does it? If you didn't really mean to include the SLF4J libraries in your classpath, they would have been pulled in transitively. Use the mvn dependency:tree or the m2eclipse's Dependency Hierarchy view to find the source of these the SLF4J related libraries and exclude them.
I have a maven project with JavaServerFaces name in intellij . whan I want to run(clean&package) it I encounter with this error:
Error running JavaServerFaces [clean,package]: No valid Maven installation found. Either set the home directory in the configuration dialog or set the M2_HOME environment variable on your system.
but I sure that my maven installation is correct and when check it in cmd I get this massage:
cmd: mvn -version
Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 17:21:
28+0330)
Maven home: J:\maven\apache-maven-3.0.5\bin\..
Java version: 1.7.0_45, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.7.0_45\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "x86", family: "windows"
my MAVEN_HOME:
J:\maven\apache-maven-3.0.5
path: %MAVEN_HOME%\bin
what is problem? please help me. thanks
Change name of MAVEN_HOME variable to M2_HOME or M3_HOME depending on Maven version.