Category Archives: How to Fix

Failed to execute goal

To summarize, Maven packaging, a project engineering development tool called Idea14, uses JDK version 1.8
1. You need to close the idea before packaging, otherwise part of the files will not be deleted when MVN is clean, and files will also be lost when MVN is package.

2. MVN package packaging ERROR: [ERROR] Failed to execute goal. Org. Apache maven. Plugins: maven – clean – plugin: 2.6.1: clean (default – the clean) on the project
Solutions:
1. The POM configuration for the Maven plug-in is as follows:

<plugin>  
    <groupId>org.apache.maven.plugins</groupId>  
    <artifactId>maven-compiler-plugin</artifactId>  
    <version>3.1</version>  
    <configuration>  
        <verbose>true</verbose>  
        <fork>true</fork>  
        <executable>${JAVA_HOME}/bin/javac</executable>  
    </configuration>  
</plugin>  

${JAVA8_HOME} (${JAVA8_HOME}, ${JAVA8_HOME})

The ${JAVA8_HOME} variable is configured in settings.xml as follows:

<profile>  
            <id>custom-compiler</id>  
            <properties>  
                <JAVA8_HOME>C:\Program Files (x86)\Java\jdk1.8.0_73</JAVA8_HOME>  
            </properties>  
</profile>  

Of course this should be enabled, so the settings.xml file should also have the following configuration:

<activeProfiles>  
        <activeProfile>custom-compiler</activeProfile>  
</activeProfiles>  

Maven has a default repository. M2 repository and a default settings.xml configuration file. This default settings.xml file also adds a JAVA_HOME variable, and the compile is completed. If you are using the MVN package command in the CMD window, you are not using the settings.xml in idea. You are using the settings.xml in E: Tools\ maven \conf. You are using the Settings in E: Tools\ maven \conf. Because there is no default configuration to compile using the 1.8 version of the JDK, the JAVA_HOME could not be found before, resulting in a compilation failure.

Python error: local variable ‘XXXX’ referenced before assignment

Recently, this error was encountered in coding: local variable ‘XXX’ Referenced before assignment, which solved this problem by looking up materials. This blog is very clear, so I collect it for you to view later.


Referenced Before Assignment Local Variable ‘XXX’ Referenced Before Assignment Local Variable ‘XXX’ Referenced Before Assignment Local Variable ‘XXX’ Referenced Before Assignment

[python] view plain copy
xxx = 23  
def PrintFileName(strFileName):   
    if xxx == 23:  
        print strFileName  
        xxx = 24  

PrintFileName("file")  

Error means that the variable ‘XXX’ is not defined before the reference. The global keyword in Python is used to refer to global variables, so I tried it, and it worked: * * * * * * * * * * * * * * * * * * * *

[python] view plain copy
xxx = 23  
def PrintFileName(strFileName):  
    global xxx  
    if xxx == 23:  
        print strFileName  
        xxx = 24  

PrintFileName("file")  

In Python, if you change the value of a variable with the same global name, it will become a local variable. The reference to that variable will be undefined before you change it. If you want to reference a global variable, and if you want to change it, you must include the global keyword.
The original link: http://blog.csdn.net/magictong/article/details/4464024


Added:
defines global variables in the class:

a = 1 
class File(object): 
    def printString(self,str): 
        global a  
        if a == 1:  
            print str  
            a = 24          
f = File()             
f.printString("file")  

The solution of Android package error

Before, when I was working on the company’s APP, the functions had been fully realized and it could also run normally on the mobile phone, but it kept reporting errors when packaging

\build\intermediates\res\ resources-anzhi-debug-ap_ ‘specified for property ‘resourceFile’ does not exist, so I found a lot of information on the web.
Some say that the version of SDK is lower than the version of ADT. It is suggested to upgrade the SDK version. Some say that an option of the Android Studio setting is removed.
Finally on the net or found a solution to the code, now record.
In fact, we only need to modify the build.gradle code

BuildTypes {
release {
does not display the LOG/* * * */confused
/* * * */

/minifyEnabled false Zipalign optimization * * * */
zipAlignEnabled true
Remove useless resource files/* * * */
shrinkResources true
proguardFiles getDefaultProguardFile (‘ proguard – android. TXT), ‘proguard – rules. Pro’
}
The debug {

minifyEnabled false shrinkResources false
proguardFiles getDefaultProguardFile (‘ proguard – android. TXT), ‘proguard – rules. Pro’

}}

ShrinkResources = false Release ShrinkResources = false Interested can go to the Internet to check the reason.

The Android packaging problem is solved.

It’s as simple as that.

Error in @ param in idea2017.3.4 / * * / annotation

I changed a new version of IDEA these two days, and encountered the following situations in the process of writing the code:

When I saw the red bar, I was a little confused — annotate what error it reported, and then look at the top right corner to find two errors

The @param property must be owned by the following method, otherwise an error is reported.
So don’t be careless, don’t be careless!

Import Maven project pom.xml File error

Importing Maven project POM file error:

Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:2.5:resources failed: Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failure to transfer commons-cli:commons-cli:jar:1.0 from http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact commons-cli:commons-cli:jar:1.0 from/to central (http://repo.maven.apache.org/maven2): connection timed out to http://repo.maven.apache.org/maven2/commons-cli/commons-cli/1.0/commons-cli-1.0.jar (org.apache.maven.plugins:maven-resources-plugin:2.5:resources:default-resources:process-resources)


code> c>userprofile %\.m2\repository
for/r> in (*. LastUpdated) do del % I
and>ect maven-> Update the project.

Using JSON to report errors

Jar, commons-logging-1.1.1.jar, ezmorph-1.0.4.jar, commons-lang3-3.2.jar, commons-beanutils-1.8.0.jar, commons-logging-1.1.1.jar, commons-beanutils-1.8.0.jar, commons-lang3-3.2.jar, commons-beanutils-1.8.0.jar, commons-logging-1.1.1.jar, ezmorph-1.0.0.jar, commons-lang3-3.2.jar
After the introduction of the above quote will be an error: Java lang. ClassNotFoundException: org.apache.com mons. Lang. Exception. Nestable. The commons-lang3-3.2.jar and the lower version of the commons-lang3-2.4. jar package have different names, so the class cannot be found. So change commons-lang3-3.2.jar to commons-lang-2.4.jar to work.

Analysis of the causes of errors in G + + compilation “was not declared in this scope”“

When compiling the program, prompt: “Was not declared in this scope”.

This is the simplest case ~ but I often make the mistake (basic is also the reason of this a few of the most likely)

in addition, the Internet was also pointed out the following reasons can cause the prompt error:
2. A dependency error occurred when header files #include each other. For example, the header file forms a circular dependency,

/***file a ****/
#ifndef FILE_A_
#define FILE_A_
#include <file b>
#endif 


/****file b ***/
#ifndef FILE_B_
#define FILE_B_
#include <file a>
#endif 

If variables, functions, and classes in file A are used in file B, then #ifndef and #define are used in file B, and #include <; file a> Unable to execute #include 3. Header file name when accidentally and header files in the library name repetition, and in the program using the library of the header file.
so, will cause the macro name repetition, there must be a header file for # # ifndef lost effect. Was not decleared in this scope?The header file was not decleared in this scope

“Unexpected syntax error: unexpected identifier”.

preface

opened a new project, the front end to write their own, when debugging the page, click the button, the background reaction, the front is not displayed. I keep reporting errors.

Process:
When debugging with IE, the error is:

——— “Uncaught SyntaxError: Unexpected Identifier” cause of error?

Firefox debug, the error is:

———-SyntaxError: missing : after property id
or
———- prompts me that the CSS style package for bootstarp cannot be found

Results:

However…

there has been no see “Uncaught SyntaxError: Unexpected identifier” mean.
JS report error, JS has error………….

Self-summary:
After this kind of situation, go to see their JS is not less comma ah, less semicolon what…
Why different browsers prompt the error, because different browsers to the code is not the same…
Don’t doubt, it must be your own fault, ha ha ha

Analysis and solution of common errors in ArcEngine development

This paper enumerates several common error reporting in ArcEngine development process, analyzes the reason of error reporting and expounds the solution.
[Error 1] :
“ArcGIS Version Not specified. You must CallRunTimeManager.Bind before creating any ArcGIS Components.”

The solution: the main function of the entrance of the program to add binding software license version of the code “. ESRI ArcGIS. RuntimeManager. Bind (. ESRI ArcGIS. ProductCode. EngineOrDesktop);” .

>
An error “HRESULT: 0 x80040258”

Solution:
IWorkspacepWorkspace =pWorkspaceFactory.OpenFromFile(pShpPath,0);  
For example, pShpPath is just the path name. For example, C:\\AAA will not report an error. If you use the full path name C:\\AAA\ bbb.shp, you will report an error.

>
An error “HRESULT: 0 x80040228”

Solution: Add a License control to the form.

>
Drag an ArcGIS control into the form and report an error

Solution:
Open ArcGIS License Server Administrator10.1 and start License Service.

>

An error “HRESULT: 0 x80040351”

Solution: pFeatureWorkspace. OpenFeatureClass () the parameters of the brackets should be “samplepoint. SHP” rather than an absolute path, modify the absolute path to the file name.

>

Error “Exception from HRESULT:0x80040207”
Solutions:
When queryFilter.whereClause is used to query shapefile layers, it is found that the queryFilter.whereClause statement is used to query shapefile layers. Open ArcGIS and compare the following differences between the two formats of attribute query:
1. Shapefile field names are in double quotes such as “fieldName” and GDB is in [fieldName] format;
2. The fuzzy query shapefile with like ‘% A %’ and GDB USES like ‘* A *’;
3. The non-character field of shapefile does not support fuzzy query but GDB format supports;

>
. Use the statement “ESRI ArcGIS. Geometry. IPointpoint = new ESRI. ArcGIS. Geometry. PointClass ();”
=
=
=
=

Solution: Select Esri.ArcGIS.Geometry from the Solution Reference, right-click the menu to view the Properties, and change “Embedded Interop Type” from True to False.

LR11 load correct script, error: – 27778 solution

1. Error message:
Action.c(269): Error -27778: SSL protocol error when attempting to connect with host “https://www.yilonghc.cn”
2. Solutions:
Within the Virtual User Generator, vuser–>; run-time settings –> preferences–> In Advanced, check Wininet Replay Instead of Sockets.
(PS: Currently, I check this box every time I play back the script, otherwise this error message will be returned each time. I don’t know if it can be set at one time.