Compilation of java actions failed

0
I just started getting this error message when building locally. Can anyone help me identify what the issue could be: Buildfile: C:\Documents and Settings\Administrator\My Documents\Disputes-main\deployment\build_core.xml compile: [javac] Compiling 2 source files to C:\Documents and Settings\Administrator\My Documents\Disputes-main\deployment\run\bin [javac] Note: C:\Documents and Settings\Administrator\My Documents\Disputes-main\javasource\com\mendix\core\Core.java uses or overrides a deprecated API. [javac] Note: Recompile with -Xlint:deprecation for details. [javac] Note: C:\Documents and Settings\Administrator\My Documents\Disputes-main\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] 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:activation-1.1-osgi, Jar:antisamy-1.4.4, Jar:antisamy-1.5.3, Jar:axiom-api-1.2.12, Jar:axis2-kernel-1.0, 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-email-1.3.1, Jar:commons-io-2.3, Jar:commons-lang-2.5, Jar:commons-lang-2.6, Jar:commons-logging-1.1, Jar:dom4j-1.6.1, Jar:guava-12.0, Jar:guice-2.0, Jar:javax.xml.stream-1.0, Jar:joda-time-1.6.2, Jar:mail, Jar:nekohtml, Jar:openid4java-0.9.8, 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:org.apache.servicemix.bundles.xerces-2.11.0, Jar:poi-3.8-20120326, Jar:poi-ooxml-3.6-20091214, Jar:poi-ooxml-schemas-3.6-20091214, Jar:replication, Jar:xalan-2.7.1, Jar:xbean, Jar:run] [bnd] 1 Errors [bnd] Classes found in the wrong directory: {disputes/proxies/ACCOUNTAdjustment.class=disputes.proxies.AccountAdjustment, disputes/proxies/ACCOUNTAdjustment$MemberNames.class=disputes.proxies.AccountAdjustment$MemberNames} [bnd] C:\Documents and Settings\Administrator\My Documents\Disputes-main\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:\Documents and Settings\Administrator\My Documents\Disputes-main\deployment\build_core.xml:45: The following error occurred while executing this line: C:\Documents and Settings\Administrator\My Documents\Disputes-main\deployment\run\bndbuild.xml:9: Failed to build jar file: Total time: 17 seconds
asked
5 answers
2

What Chris is a good idea, but I don't think it is your exact problem. The error message says the following: "Errors [bnd] Classes found in the wrong directory: ", as this message is saying I would start by looking in all your javasource folders. These folders may only contain .java files, if you find any *.class files just remove them they are not allowed to be there.
Do the same for the userlib folder, the userlib folder should only contain libraries (
.jar files). You can have txt files in the userlib folder for licensing and reference purposes. But *.java or *.class files are not allowed in the userlib directory.

After reviewing both javasource and userlib, go back to the modeler and press the 'clean deployment directory' button (menu item project), and start you application again.

answered
1

I cleaned the deployment directory and re-downloaded community commons from the appstore and the problem is now resolved.

answered
0

Clean up your userlib. These look suspect: Jar:com.springsource.org.apache.commons.lang-2.5.0, Jar:commons-email-1.3.1, Jar:commons-io-2.3, Jar:commons-lang-2.5, Jar:commons-lang-2.6,

If you only use default appstore modules:

  1. Move the userlib files to temporary directory
  2. Import all modules from appstore again.

if you use custom java-action. Do 1 and 2 and

  1. Move the jars one-by-one back from the temporary directory to the userlib until you have no more java errors. Skip the jars with older versions (e.g. commons-lang-2.5)
answered
0

Java compilation error after attempt to cleanup userlib:

Buildfile: C:\Documents and Settings\Administrator\My Documents\Disputes-main\deployment\build_core.xml

compile: [javac] Compiling 2 source files to C:\Documents and Settings\Administrator\My Documents\Disputes-main\deployment\run\bin [javac] Note: C:\Documents and Settings\Administrator\My Documents\Disputes-main\javasource\com\mendix\core\Core.java uses or overrides a deprecated API. [javac] Note: Recompile with -Xlint:deprecation for details. [javac] Note: C:\Documents and Settings\Administrator\My Documents\Disputes-main\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] 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:activation-1.1-osgi, Jar:antisamy-1.4.4, Jar:antisamy-1.5.3, Jar:axiom-api-1.2.12, Jar:axis2-kernel-1.0, Jar:com.google.guava-14.0.1, Jar:com.springsource.javax.activation-1.1.1, Jar:com.springsource.org.apache.batik.css-1.7.0, Jar:com.springsource.org.apache.commons.lang-2.5.0, Jar:com.sun.mail.javax.mail-1.4.5, Jar:commons-email-1.3.1, Jar:commons-io-2.3, Jar:commons-lang-2.6, Jar:commons-logging-1.1, Jar:dom4j-1.6.1, Jar:guava-12.0, Jar:guice-2.0, Jar:javax.xml.stream-1.0.1, Jar:javax.xml.stream-1.0, Jar:joda-time-1.6.2, Jar:mail, Jar:nekohtml, Jar:openid4java-0.9.8, 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:org.apache.servicemix.bundles.xalan-2.7.1, Jar:org.apache.servicemix.bundles.xerces-2.11.0, Jar:org.apache.servicemix.bundles.xmlbeans-2.5.0, Jar:poi-3.10-FINAL-20140208, Jar:poi-3.8-20120326, Jar:poi-ooxml-3.10-FINAL-20140208, Jar:poi-ooxml-3.6-20091214, Jar:poi-ooxml-schemas-3.10-FINAL-20140208, Jar:poi-ooxml-schemas-3.6-20091214, Jar:replication, Jar:xalan-2.7.1, Jar:xbean, Jar:run] [bnd] 1 Errors [bnd] Classes found in the wrong directory: {disputes/proxies/ACCOUNTAdjustment.class=disputes.proxies.AccountAdjustment, disputes/proxies/ACCOUNTAdjustment$MemberNames.class=disputes.proxies.AccountAdjustment$MemberNames} [bnd] C:\Documents and Settings\Administrator\My Documents\Disputes-main\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:\Documents and Settings\Administrator\My Documents\Disputes-main\deployment\build_core.xml:45: The following error occurred while executing this line: C:\Documents and Settings\Administrator\My Documents\Disputes-main\deployment\run\bndbuild.xml:9: Failed to build jar file:

Total time: 20 seconds

answered
0

Split package, multiple jars provide the same package:com/mendix/core [bnd] Use Import/Export Package directive -split-package

More then one package is using the com/mendix/core scope. Does your application start without any of your custom java libraries in the user lib?

answered