Compilation of Jave actions failed

0
I added smtp, ldap, community commons and Encryption modules to my project. When I click run locally, I got errors regarding compilation of Java action. Buildfile: C:\Users\dqian\OneDrive - Crown Equipment Corporation\User_Data\Documents\Mendix\ITRequest-main_2\deployment\build_core.xml compile:     [javac] Compiling 208 source files to C:\Users\dqian\OneDrive - Crown Equipment Corporation\User_Data\Documents\Mendix\ITRequest-main_2\deployment\run\bin     [javac] C:\Users\dqian\OneDrive - Crown Equipment Corporation\User_Data\Documents\Mendix\ITRequest-main_2\javasource\ldap\LdapActionListener.java:6: error: package org.apache.commons.lang does not exist     [javac] import org.apache.commons.lang.StringEscapeUtils;     [javac]                               ^     [javac] C:\Users\dqian\OneDrive - Crown Equipment Corporation\User_Data\Documents\Mendix\ITRequest-main_2\javasource\smtpemailmodule\mail\EmailModule.java:12: error: package com.mendix.util.classloading does not exist     [javac] import com.mendix.util.classloading.Runner;     [javac]                                    ^     [javac] C:\Users\dqian\OneDrive - Crown Equipment Corporation\User_Data\Documents\Mendix\ITRequest-main_2\javasource\communitycommons\actions\GetImageDimensions.java:37: error: cannot find symbol     [javac]   BufferedImage bimg = ImageIO.read(Core.getImage(getContext(), this.ImageParameter1.getMendixObject(), false));     [javac]                                                                     ^     [javac]   symbol: variable ImageParameter1     [javac] C:\Users\dqian\OneDrive - Crown Equipment Corporation\User_Data\Documents\Mendix\ITRequest-main_2\javasource\ldap\LdapActionListener.java:68: error: cannot find symbol     [javac]   String escapedUsername = StringEscapeUtils.escapeXml(username);     [javac]                            ^     [javac]   symbol:   variable StringEscapeUtils     [javac]   location: class LdapActionListener     [javac] C:\Users\dqian\OneDrive - Crown Equipment Corporation\User_Data\Documents\Mendix\ITRequest-main_2\javasource\ldap\actions\ImportLdapGroups_Group.java:46: error: cannot find symbol     [javac]    Result result = ImportUserRecord.runImportGroupsByGroup(this.LdapServerParameter1);     [javac]                                                                ^     [javac]   symbol: variable LdapServerParameter1     [javac] C:\Users\dqian\OneDrive - Crown Equipment Corporation\User_Data\Documents\Mendix\ITRequest-main_2\javasource\ldap\actions\ImportLdapGroups_Path.java:44: error: cannot find symbol     [javac]    Result result = ImportUserRecord.runImportGroups(this.LdapServerParameter1);     [javac]                                                         ^     [javac]   symbol: variable LdapServerParameter1     [javac] C:\Users\dqian\OneDrive - Crown Equipment Corporation\User_Data\Documents\Mendix\ITRequest-main_2\javasource\smtpemailmodule\mail\EmailModule.java:130: error: cannot find symbol     [javac]   new Runner<Object>()     [javac]       ^     [javac]   symbol:   class Runner     [javac]   location: class EmailModule     [javac] Note: Some input files use or override a deprecated API.     [javac] Note: Recompile with -Xlint:deprecation for details.     [javac] 7 errors BUILD FAILED C:\Users\dqian\OneDrive - Crown Equipment Corporation\User_Data\Documents\Mendix\ITRequest-main_2\deployment\build_core.xml:29: Compile failed; see the compiler error output for details. Total time: 4 seconds  
asked
2 answers
2

Hi David, today I had one of your errors, after importing LDAP and (neccesary/dependant) CommunityCommons in a new 7.16 project :

Compilation of Java actions failed. Details:

\javasource\ldap\LdapActionListener.java:68: error: cannot find symbol [javac] String escapedUsername = StringEscapeUtils.escapeXml(username); [javac] ^ [javac] symbol: variable StringEscapeUtils [javac] location: class LdapActionListener

 

I changed the following java action '\javasource\ldap\LdapActionListener.java' on row 6 to 'import org.apache.commons.lang3.StringEscapeUtils;' (it was 'import org.apache.commons.lang.StringEscapeUtils;').

Now my project can be compiled/run.

I reckon you already found the solution but wanted to post mine for others who are looking to solve this error.

answered
0

Did you check the documentation of the community commons:

In version 6.1 several libraries (jar files in the userlib folder of your project) have been updated. pdfbox-1.8.5.jar currently causes a compile error in your project when it's still present. Make sure to remove old libraries from the userlib folder in your project!

Regards,

Ronald

 

answered