Jibx 1.2.5 fails with java 7 - java

I am migrating my project from Java 6 to Java 7. We use JibX extensively in our project. Till now we were using JibX 1.2.2 and everything was working fine.
But due to migration to Java 7 we upgraded from JibX 1.2.2 to JibX 1.2.5. Also we are using jibx-maven-plugin version 1.2.5. But with the upgradation of JibX, we are facing some issues now.
When built with target 1.7 and JibX 1.2.5, JibX is building the jar file but during aspectJ weaving, getting the following error :
[ERROR] Failed to execute goal org.codehaus.mojo:aspectj-maven-plugin:1.4:compile (default) on project gdsmodel-aspects: Compiler errors:
[ERROR] abort ABORT -- (ClassFormatException) Index 12895 into constant pool (size:12371) is invalid
[ERROR] Index 12895 into constant pool (size:12371) is invalid
[ERROR] org.aspectj.apache.bcel.classfile.ClassFormatException: Index 12895 into constant pool (size:12371) is invalid
[ERROR] at org.aspectj.apache.bcel.classfile.ConstantPool.getConstant(ConstantPool.java:66)
[ERROR] at org.aspectj.apache.bcel.classfile.ConstantPool.getConstantUtf8(ConstantPool.java:220)
[ERROR] at org.aspectj.apache.bcel.classfile.Attribute.readAttribute(Attribute.java:111)
[ERROR] at org.aspectj.apache.bcel.classfile.AttributeUtils.readAttributes(AttributeUtils.java:19)
[ERROR] at org.aspectj.apache.bcel.classfile.FieldOrMethod.<init>(FieldOrMethod.java:97)
[ERROR] at org.aspectj.apache.bcel.classfile.Field.<init>(Field.java:82)
[ERROR] at org.aspectj.apache.bcel.classfile.ClassParser.readFields(ClassParser.java:206)
[ERROR] at org.aspectj.apache.bcel.classfile.ClassParser.parse(ClassParser.java:141)
[ERROR] at org.aspectj.weaver.bcel.Utility.makeJavaClass(Utility.java:467)
[ERROR] at org.aspectj.weaver.bcel.UnwovenClassFile.getJavaClass(UnwovenClassFile.java:68)
[ERROR] at org.aspectj.weaver.bcel.BcelWeaver.addClassFile(BcelWeaver.java:455)
[ERROR] at org.aspectj.weaver.bcel.BcelWeaver.addJarFile(BcelWeaver.java:402)
[ERROR] at org.aspectj.ajdt.internal.core.builder.AjBuildManager.initBcelWorld(AjBuildManager.java:893)
[ERROR] at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:249)
[ERROR] at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:185)
[ERROR] at org.aspectj.ajdt.ajc.AjdtCommand.doCommand(AjdtCommand.java:112)
[ERROR] at org.aspectj.ajdt.ajc.AjdtCommand.runCommand(AjdtCommand.java:60)
[ERROR] at org.aspectj.tools.ajc.Main.run(Main.java:371)
[ERROR] at org.aspectj.tools.ajc.Main.runMain(Main.java:248)
[ERROR] at org.codehaus.mojo.aspectj.AbstractAjcCompiler.execute(AbstractAjcCompiler.java:549)
[ERROR] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
[ERROR] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
[ERROR] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
[ERROR] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
[ERROR] at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.lang.reflect.Method.invoke(Method.java:606)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
[ERROR] -> [Help 1]
So I turned on the "verify" flag in jibx-maven-plugin (which specifies "Control flag for verifying generated/modified classes with BCEL.") when jibx fails with the following error :
[exec] [ERROR] Failed to execute goal org.jibx:jibx-maven-plugin:1.2.5:bind (jibx-bind) on project gdsmodel: Invalid this class index 6218 in constant pool in class file com/g2switch/dto/passive/
JiBX_passive_v24_0MungeAdapter -> [Help 1]
Only one thing that I noticed (and is bugging me) is JibX is generating an "JiBX_passive_v24_0MungeAdapter.class" of size almost 14MB and the verification is failing in this class.
[exec] Verification failure on class com.g2switch.dto.passive.JiBX_passive_v24_0MungeAdapter
But keeping every thing same when I just change the target from 1.7 to 1.6 everything works fine [also using JibX 1.2.5].
N.B : We have a project which has many binding files (> 150 and also each file contains huge amount of data). The problem occurs while building this project. But when I include fewer bindings (< 20) then the problem disappears. So is this problem due to the large munge adapter file generated by JibX, when large amount of bindings are involved? If this is the cause then how to solve it?

Related

GWT application fails with IllegalArgumentException in org.objectweb.asm.ClassVisitor

We have a larger GWT application that used to be built with GWT v2.8.0. I am trying to upgrade it to GWT v2.9.0.
Compilation and packaging etc. all works fine, but when I try to start it (via maven using the goal gwt:run) I get the below error and stacktrace.
Any idea anyone, what is causing this and if and how one can fix this?
I am using an AdopOpenJDK v8.0.292.10 (hotspot) as runtime.
[INFO] --- gwt-maven-plugin:2.9.0:run (default-cli) # myapp-web ---
[INFO] create exploded Jetty webapp in D:\Projects\myapp-web\target\myapp
[INFO] Super Dev Mode starting up
[INFO] workDir: C:\Users\mms\AppData\Local\Temp\gwt-codeserver-3584342502042631589.tmp
[INFO] Loading Java files in com.example.myapp.MyApp.
[ERROR] java.lang.IllegalArgumentException
[ERROR] at org.objectweb.asm.ClassVisitor.<init>(Unknown Source)
[ERROR] at org.objectweb.asm.ClassVisitor.<init>(Unknown Source)
[ERROR] at com.google.gwt.dev.javac.BytecodeSignatureMaker$CompileDependencyVisitor.<init>(BytecodeSignatureMaker.java:59)
[ERROR] at com.google.gwt.dev.javac.BytecodeSignatureMaker.visitCompileDependenciesInBytecode(BytecodeSignatureMaker.java:227)
[ERROR] at com.google.gwt.dev.javac.BytecodeSignatureMaker.getCompileDependencySignature(BytecodeSignatureMaker.java:209)
[ERROR] at com.google.gwt.dev.javac.CompiledClass.getSignatureHash(CompiledClass.java:166)
[ERROR] at com.google.gwt.dev.javac.Dependencies$Ref.<init>(Dependencies.java:41)
[ERROR] at com.google.gwt.dev.javac.Dependencies$Ref.<init>(Dependencies.java:36)
[ERROR] at com.google.gwt.dev.javac.Dependencies.resolve(Dependencies.java:100)
[ERROR] at com.google.gwt.dev.javac.CompilationStateBuilder$CompileMoreLater.compile(CompilationStateBuilder.java:349)
[ERROR] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:532)
[ERROR] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:464)
[ERROR] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:423)
[ERROR] at com.google.gwt.dev.codeserver.Recompiler.initWithoutPrecompile(Recompiler.java:213)
[ERROR] at com.google.gwt.dev.codeserver.Outbox.maybePrecompile(Outbox.java:89)
[ERROR] at com.google.gwt.dev.codeserver.Outbox.<init>(Outbox.java:61)
[ERROR] at com.google.gwt.dev.codeserver.CodeServer.makeOutboxTable(CodeServer.java:192)
[ERROR] at com.google.gwt.dev.codeserver.CodeServer.start(CodeServer.java:151)
[ERROR] at com.google.gwt.dev.codeserver.CodeServer.main(CodeServer.java:104)
[ERROR] at com.google.gwt.dev.codeserver.CodeServer.main(CodeServer.java:55)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.lang.reflect.Method.invoke(Method.java:498)
[ERROR] at com.google.gwt.dev.shell.SuperDevListener.runCodeServer(SuperDevListener.java:112)
[ERROR] at com.google.gwt.dev.shell.SuperDevListener.start(SuperDevListener.java:91)
[ERROR] at com.google.gwt.dev.DevMode.ensureCodeServerListener(DevMode.java:666)
[ERROR] at com.google.gwt.dev.DevModeBase.doStartup(DevModeBase.java:785)
[ERROR] at com.google.gwt.dev.DevMode.doStartup(DevMode.java:551)
[ERROR] at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:888)
[ERROR] at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:705)
[ERROR] at com.google.gwt.dev.DevMode.main(DevMode.java:432)
Firstly I would make sure you have deleted any GWT caching files/directories. Look in C:\Users\mms\AppData\Local\Temp\ for any files/folders starting with gwt.
Another possibility is that you have dependencies in your project that are using an older version of the asm.jar library that is incompatible with the GWT compiler.
In more detail, com.google.gwt:gwt-dev:2.9.0 is built against org.ow2.asm:7.1 . Check that your project does not have a dependency on ASM that is earlier than 7. (Note that this could be a transitive dependency.)

maven-surefire-plugin Crashes after Upgrading to springboot-starter-parent:2.1.8.RELEASE

I'm trying to upgrade the dependencies for a Java application that my team maintains. The application is based on SpringBoot and used to declare spring-boot-starter-parent:1.5.6.RELEASE as its parent.
After the upgrade, the application declares spring-boot-starter-parent:2.1.8.RELEASE as its parent. Here's the diff of my pom.xml file:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
- <version>1.5.6.RELEASE</version>
+ <version>2.1.8.RELEASE</version>
<relativePath/>
</parent>
Now mvn -X clean test now fails with the following exception:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project scimapi: There are test failures.
[ERROR]
[ERROR] Please refer to C:\Users\musikpolice\Documents\git\scimapi\target\surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
[ERROR] Command was cmd.exe /X /C ""C:\Program Files\Java\jdk1.8.0_191\jre\bin\java" -jar C:\Users\musikpolice\AppData\Local\Temp\surefire4062831518056119279\surefirebooter1476719102492403846.jar C:\Users\musikpolice\AppData\Local\Temp\surefire4062831518056119279 2019-10-01T11-33-46_847-jvmRun1 surefire6827784388561767102tmp surefire_04733578287828383905tmp"
[ERROR] Process Exit Code: 0
[ERROR] Crashed tests:
[ERROR] com.mycompany.scim.controllers.SomeControllerTest
[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
[ERROR] Command was cmd.exe /X /C ""C:\Program Files\Java\jdk1.8.0_191\jre\bin\java" -jar C:\Users\musikpolice\AppData\Local\Temp\surefire4062831518056119279\surefirebooter1476719102492403846.jar C:\Users\musikpolice\AppData\Local\Temp\surefire4062831518056119279 2019-10-01T11-33-46_847-jvmRun1 surefire6827784388561767102tmp surefire_04733578287828383905tmp"
[ERROR] Process Exit Code: 0
[ERROR] Crashed tests:
[ERROR] com.mycompany.scim.controllers.SomeControllerTest
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:669)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:282)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:245)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1183)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:1011)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:857)
[ERROR] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
[ERROR] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
[ERROR] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
[ERROR] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:954)
[ERROR] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
[ERROR] at org.apache.maven.cli.MavenCli.main(MavenCli.java:192)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.lang.reflect.Method.invoke(Method.java:498)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
The C:\Users\musikpolice\Documents\git\scimapi\target\surefire-reports directory mentioned in the test output does not exist. I cannot find the dump files referenced in the output either.
My Maven/Java versions are as follows:
Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-17T14:33:14-04:00)
Maven home: C:\ProgramData\chocolatey\lib\maven\apache-maven-3.5.4\bin\..
Java version: 1.8.0_191, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk1.8.0_191\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
I am not explicitly declaring a version of the maven-surefire-plugin in the Builds > Plugins section of pom.xml, but adding an explicit reference to version 2.22.2 of that plugin did not resolve the problem.
It's worth noting that adding an #Ignored annotation to com.mycompany.scim.controllers.SomeControllerTest doesn't fix the problem - the next test in line just fails in the same way.
Interestingly, the code compiles and all tests pass in IntelliJ. I only run into this issue when running the build with Maven, which tells me that the problem is likely some mismatched versions of elements in my toolchain, but I don't really know what else to troubleshoot.

Error decoding percent encoded characters

I want to build a project and the following error occurs.
My colleagues can build it without any problem.
The error occurs since I've got a new laptop.
Does somebody has any idea?
>[INFO]
Loading source files for package xxx...
Loading source files for package xxx...
Loading source files for package xxx...
Constructing Javadoc information...
Standard Doclet version 1.8.0_151
Building tree for all the packages and classes...
Generating C:\Eigene Dateien\Documents\workspace\xxx.html...
1 error
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.042 s
[INFO] Finished at: 2018-03-09T09:56:09+01:00
[INFO] Final Memory: 43M/326M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.10.3:jar (attach-javadocs) on project xxx: MavenReportException: Error while generating Javadoc:
[ERROR] Exit code: 1 - java.lang.IllegalArgumentException: Error decoding percent encoded characters
[ERROR] at sun.net.www.ParseUtil.decode(ParseUtil.java:216)
[ERROR] at sun.misc.URLClassPath$FileLoader.<init>(URLClassPath.java:1241)
[ERROR] at sun.misc.URLClassPath$3.run(URLClassPath.java:560)
[ERROR] at sun.misc.URLClassPath$3.run(URLClassPath.java:555)
[ERROR] at java.security.AccessController.doPrivileged(Native Method)
[ERROR] at sun.misc.URLClassPath.getLoader(URLClassPath.java:554)
[ERROR] at sun.misc.URLClassPath.getLoader(URLClassPath.java:519)
[ERROR] at sun.misc.URLClassPath.getNextLoader(URLClassPath.java:484)
[ERROR] at sun.misc.URLClassPath.access$100(URLClassPath.java:65)
[ERROR] at sun.misc.URLClassPath$1.next(URLClassPath.java:266)
[ERROR] at sun.misc.URLClassPath$1.hasMoreElements(URLClassPath.java:277)
[ERROR] at java.net.URLClassLoader$3$1.run(URLClassLoader.java:601)
[ERROR] at java.net.URLClassLoader$3$1.run(URLClassLoader.java:599)
[ERROR] at java.security.AccessController.doPrivileged(Native Method)
[ERROR] at java.net.URLClassLoader$3.next(URLClassLoader.java:598)
[ERROR] at java.net.URLClassLoader$3.hasMoreElements(URLClassLoader.java:623)
[ERROR] at sun.misc.CompoundEnumeration.next(CompoundEnumeration.java:45)
[ERROR] at sun.misc.CompoundEnumeration.hasMoreElements(CompoundEnumeration.java:54)
[ERROR] at java.util.ServiceLoader$LazyIterator.hasNextService(ServiceLoader.java:354)
[ERROR] at java.util.ServiceLoader$LazyIterator.hasNext(ServiceLoader.java:393)
[ERROR] at java.util.ServiceLoader$1.hasNext(ServiceLoader.java:474)
[ERROR] at javax.xml.parsers.FactoryFinder$1.run(FactoryFinder.java:293)
[ERROR] at java.security.AccessController.doPrivileged(Native Method)
[ERROR] at javax.xml.parsers.FactoryFinder.findServiceProvider(FactoryFinder.java:289)
[ERROR] at javax.xml.parsers.FactoryFinder.find(FactoryFinder.java:267)
[ERROR] at javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:127)
[ERROR] at com.sun.tools.doclets.internal.toolkit.builders.LayoutParser.parseXML(LayoutParser.java:89)
[ERROR] at com.sun.tools.doclets.internal.toolkit.builders.ClassBuilder.build(ClassBuilder.java:120)
[ERROR] at com.sun.tools.doclets.formats.html.HtmlDoclet.generateClassFiles(HtmlDoclet.java:189)
[ERROR] at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.generateClassFiles(AbstractDoclet.java:194)
[ERROR] at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.startGeneration(AbstractDoclet.java:139)
[ERROR] at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.start(AbstractDoclet.java:82)
[ERROR] at com.sun.tools.doclets.formats.html.HtmlDoclet.start(HtmlDoclet.java:80)
[ERROR] at com.sun.tools.doclets.standard.Standard.start(Standard.java:39)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.lang.reflect.Method.invoke(Method.java:498)
[ERROR] at com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:310)
[ERROR] at com.sun.tools.javadoc.DocletInvoker.start(DocletInvoker.java:189)
[ERROR] at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:366)
[ERROR] at com.sun.tools.javadoc.Start.begin(Start.java:219)
[ERROR] at com.sun.tools.javadoc.Start.begin(Start.java:205)
[ERROR] at com.sun.tools.javadoc.Main.execute(Main.java:64)
[ERROR] at com.sun.tools.javadoc.Main.main(Main.java:54)
Command line was: C:\java\jdk1.8.0_151\jre\..\bin\javadoc.exe #options #packages
When I skip creating javaDoc with maven.javadoc.skip and edit the build-plugins maven-deploy-plugin and maven-javadoc-plugin it will be build successful.

Multiple extra source directories in Maven [Compile Error] in Eclipse

i'm working on a "complex"/"well-structured" Maven Project, and in particular i'm working on a single internal Module of the project. I'm against a COMPILE ERROR because it seems that it doesn't find the Java Classes from an external source already linked from the Menu (right-clicking on the project) ->Build Path->Link Source.
This is a bunch of essential errors taken from the Console when i Run-> mvn : compile
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project optimizer: Compilation failure: Compilation failure:
[ERROR] /Users/Ste/Desktop/eclip/workspace/planner/src/main/java/eu/planner/Module.java:[24,19] package jmetal.core does not exist
[ERROR] /Users/Ste/Desktop/eclip/workspace/planner/src/main/java/eu/planner/Module.java:[35,29] cannot find symbol
[ERROR] symbol: class Variable
[ERROR] /Users/Ste/Desktop/eclip/workspace/planner/src/main/java/eu/planner/Module.java:[39,11] cannot find symbol
[ERROR] symbol: class Problem
[ERROR] location: class eu.planner.Module
[INFO] 100 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 45.090 s
[INFO] Finished at: 2015-05-02T10:46:45+01:00
[INFO] Final Memory: 21M/219M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project optimizer: Compilation failure: Compilation failure:
[ERROR] /Users/Ste/Desktop/eclip/workspace/planner/src/main/java/eu/planner/heuristics/SVariable.java:[234,9] method does not override or implement a method from a supertype
[ERROR] /Users/Ste/Desktop/eclip/workspace/planner/src/main/java/eu/planner/heuristics/SVariable.java:[237,24] cannot find symbol
[ERROR] symbol: variable super
[ERROR] location: class eu.planner.heuristics.SVariable
[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
Adding the -X it shows the DEBUG, but nothing strange. It just add at the end this information:
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project optimizer: Compilation failure
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.compiler.CompilationFailureException: Compilation failure
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:858)
at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:129)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
[ERROR]
[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
I also tried to add in the POM of the Module i'm working on, this build helper taken from here http://mojo.codehaus.org/build-helper-maven-plugin/usage.html (without success):
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<phase>generate-sources</phase>
<goals><goal>add-source</goal></goals>
<configuration>
<sources>
<source>/Users/Ste/Desktop/externalFolderWithJavaClasses<source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
Where plugin element is in /project/build/plugins and NOT in /project/build/pluginManagement/plugins.
I checked my target/classes folder of the project and it is empty.
I'm not importing files from any other projects. Just linked a folder from my filesystem.
The path you see in the screenshot is different from what you see in Compile Error because at the beginning i thought to not show my real path.
Here 2 Screenshot:
Does anyone understand what is wrong? Thank you so much
P.S. I'm using a Mac OS X x64, Eclipse Luna, and the project is Pulled from a GitHub repository if for someone this information is fundamental.
Your problem makes sense in a way. Originally, you added a source folder to your project through Eclipse, but not through maven. And when you tried to compile your maven sources, maven barfed since it couldn't find the folder you added through Eclipse.
It's a little surprising that you're still getting the same error when you use the build-helper-maven-plugin. Since that is the proper way of adding extra source folders. I think you just need to run mvn clean verify and all should be good again.
Inside of Eclipse, make sure to run Maven -> Update project... and your project should also have the proper source folders on it.

AD authentication java class for Fitnesse

How can I create ldap-authentation-${version}.jar file described here?
https://github.com/timander/fitnesse-ldap-authenticator
I am so lost.
I am trying to enable Active Directory authentication for Fitnesse test.
Any help is appreciated.
Thanks,
Ali
Ok Tim I attempted it and now I am running in some issues. First build failure issue was solved after changing the version in pom.xml from 20100303 to 20131110. Now the second build is failing because of this:
"
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project fitnesse-ldap-authenticator: Compilation failure: Compilation failure:
[ERROR] c:\Users\araza\Documents\GitHub\fitnesse-ldap-authenticator\src\main\java\fitnesse\authentication\LDAPAuthenticator.java:[26,16] error: isAuthenticated(String,String) in LDAPAuthenticator cannot override isAuthenticated(String,String) in Authenticator
[ERROR]
[ERROR] could not parse error message: overridden method does not throw Exception
[ERROR] c:\Users\araza\Documents\GitHub\fitnesse-ldap-authenticator\src\main\java\fitnesse\authentication\LDAPAuthenticator.java:3: warning: LdapCtxFactory is internal proprietary API and may be removed in a future release
[ERROR] import javax.naming.AuthenticationException;
[ERROR] ^
[ERROR]
[ERROR] c:\Users\araza\Documents\GitHub\fitnesse-ldap-authenticator\src\main\java\fitnesse\authentication\LdapContextFactory.java:[12,26] LdapCtxFactory is internal proprietary API and may be removed in a future release"
Ok, I made some progress and this is what I am getting now:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project fitnesse-ldap-authenticator: Compilation failure
[ERROR] /c:/Users/araza/Documents/GitHub/fitnesse-ldap-authenticator/src/main/java/fitnesse/authentication/LDAPAuthenticator.java:[26,24] isAuthenticated(java.lang.String,java.lang.String) in fitnesse.authentication.LDAPAuthenticator cannot override isAuthenticated(java.lang.String,java.lang.String) in fitnesse.authentication.Authenticator
[ERROR] overridden method does not throw java.lang.Exception
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project fitnesse-ldap-authenticator: Compilation failure
c:/Users/araza/Documents/GitHub/fitnesse-ldap-authenticator/src/main/java/fitnesse/authentication/LDAPAuthenticator.java:[26,24] isAuthenticated(java.lang.String,java.lang.String) in fitnesse.authentication.LDAPAuthenticator cannot override isAuthenticated(java.lang.String,java.lang.String) in fitnesse.authentication.Authenticator
overridden method does not throw java.lang.Exception
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.compiler.CompilationFailureException: Compilation failure
-
c:/Users/araza/Documents/GitHub/fitnesse-ldap-authenticator/src/main/java/fitnesse/authentication/LDAPAuthenticator.java:[26,24] isAuthenticated(java.lang.String,java.lang.String) in fitnesse.authentication.LDAPAuthenticator cannot override isAuthenticated(java.lang.String,java.lang.String) in fitnesse.authentication.Authenticator
overridden method does not throw java.lang.Exception
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:858)
at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:129)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
I assumed knowledge of Git and Maven when I created the FitNesse LDAP Authenticator. To build a jar file:
Use Git to check out the code
Run Maven to create a jar file (mvn package)
The jar will be in the target directory where you checked out the code

Categories

Resources