Upgrade to Mendix 5 - Compilation of Java actions failed.

0
I updated an application from Mendix 4 to Mendix 5, following all required steps and finishing the migration wizard. My project has no errors in the business modeler but cannot be built because of the error shown below. I also deployed the project for Eclipse where I get the same behaviour: No errors, but cannot build the application. Please advise. Stack trace: Compilation of Java actions failed. Buildfile: C:\Development\Mendix\project\deployment\build_core.xml compile: [javac] Compiling 2 source files to C:\Development\Mendix\project\deployment\run\bin [javac] Note: C:\Development\Mendix\project\javasource\com\mendix\core\Core.java uses or overrides a deprecated API. [javac] Note: Recompile with -Xlint:deprecation for details. [javac] Note: C:\Development\Mendix\project\javasource\com\mendix\core\Core.java uses unchecked or unsafe operations. [javac] Note: Recompile with -Xlint:unchecked for details. build: [bnd] # addAll 'deployment/run/bnd.bnd' with , [bnd] in default pack? ha [bnd] Warnings [bnd] Split package, multiple jars provide the same package:com/mendix/core [bnd] Use Import/Export Package directive -split-package:=(merge-first|merge-last|error|first) to get rid of this warning [bnd] Package found in [Jar:mxruntime, Jar:run] [bnd] Class path [Jar:biz.aQute.bnd.annotation, Jar:org.scala-lang.scala-library, Jar:json, Jar:logging, Jar:m2ee-api, Jar:mxruntime, Jar:integration, Jar:osgi.cmpn, Jar:webui, Jar:javax.servlet, Jar:antisamy-1.4.4, Jar:antisamy-1.5.3, Jar:clibwrapperjiio, Jar:com.google.guava-14.0.1, Jar:com.springsource.org.apache.batik.css-1.7.0, Jar:com.springsource.org.apache.commons.lang-2.5.0, Jar:commons-lang-2.5, Jar:commons-net-3.1, Jar:dom4j-1.6.1, Jar:edtftpj, Jar:fontbox-1.8.5, Jar:geronimo-stax-api1.0spec-1.0, Jar:jaiimageio, Jar:jakarta-oro-2.0.8, Jar:jempbox-1.8.5, Jar:joda-time-1.6.2, Jar:junit, Jar:mxldap1.2_3.0.0, Jar:nekohtml, Jar:opencsv-2.3, Jar:org.apache.commons.fileupload-1.2.1, Jar:org.apache.commons.io-2.3.0, Jar:org.apache.servicemix.bundles.commons-codec-1.3.0, Jar:pdfbox-1.8.5, Jar:pdfbox-app-1.5.0, Jar:poi-ooxml-3.6-20091214, Jar:poi-ooxml-3.7-20101029, Jar:poi-ooxml-schemas-3.6-20091214, Jar:poi-ooxml-schemas-3.7-20101029, Jar:replication, Jar:spring-ldap-1.2.1, Jar:spring, Jar:xml-apis-ext, Jar:xmlbeans-2.3.0, Jar:run] [bnd] 1 Errors [bnd] The default package '.' is not permitted by the Import-Package syntax. [bnd] This can be caused by compile errors in Eclipse because Eclipse creates [bnd] valid class files regardless of compile errors. [bnd] The following package(s) import from the default package [com.mendix.ldap] [bnd] C:\Development\Mendix\project\deployment\run\bnd.bnd: bnd failed [bnd] at aQute.bnd.ant.BndTask.executeBackwardCompatible(BndTask.java:231) [bnd] at aQute.bnd.ant.BndTask.execute(BndTask.java:115) [bnd] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291) [bnd] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [bnd] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [bnd] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [bnd] at java.lang.reflect.Method.invoke(Method.java:606) [bnd] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) [bnd] at org.apache.tools.ant.Task.perform(Task.java:348) [bnd] at org.apache.tools.ant.Target.execute(Target.java:390) [bnd] at org.apache.tools.ant.Target.performTasks(Target.java:411) [bnd] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1360) [bnd] at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38) [bnd] at org.apache.tools.ant.Project.executeTargets(Project.java:1212) [bnd] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:441) [bnd] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291) [bnd] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [bnd] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [bnd] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [bnd] at java.lang.reflect.Method.invoke(Method.java:606) [bnd] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) [bnd] at org.apache.tools.ant.Task.perform(Task.java:348) [bnd] at org.apache.tools.ant.Target.execute(Target.java:390) [bnd] at org.apache.tools.ant.Target.performTasks(Target.java:411) [bnd] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1360) [bnd] at org.apache.tools.ant.Project.executeTarget(Project.java:1329) [bnd] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) [bnd] at org.apache.tools.ant.Project.executeTargets(Project.java:1212) [bnd] at org.apache.tools.ant.Main.runBuild(Main.java:801) [bnd] at org.apache.tools.ant.Main.startAnt(Main.java:218) [bnd] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280) [bnd] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109) BUILD FAILED C:\Development\Mendix\project\deployment\build_core.xml:45: The following error occurred while executing this line: C:\Development\Mendix\project\deployment\run\bndbuild.xml:9: Failed to build jar file: Total time: 10 seconds
asked
3 answers
1

You have to check your userlib and start cleaning them. First check all the double jar files (same jar but with different versions). If that does not help remove a jar at the time untill the model works. Then you have the culprit and you can add the ones you did remove. But most of the time removing the double ones are all that is needed.

Regards,

Ronald

answered
0

Mendix has quite a few jars in the runtime already. Having the same jar in the userlib of your project can cause Java errors too. Make sure there are no duplicates.

The jars are in C:\Program Files\Mendix\5.x.y\runtime\bundles

answered
0

We have seen this error same om Mendix 6.4.1

After an import of module (without jar files)

The solution that worked in my case:

  • Remove one jar file user lib (commons-codec-1.10.jar, project also contained org.apache.servicemix.bundles.commons-codec-1.3.0.jar)
  • Run, (of course this resulted in an error; because the base 64 encoding was missing)
  • Placed the original Jar file back
  • Run again (Success)

It looks like Mendix was doing things in the wrong order..... But no clue what really happened!

answered