Category Archives: Error

Vue require Error: node_modules/babel-loader/lib

vue require reports node_modules/babel-loader/lib error
This error is reported in the vue project.
…/…/assets/images/11.png in ./node_modules/cache-loader/dist/cjs.js??ref–12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref–0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/HouseManage/EmergencyPlan.vue?vue&type=script&lang=js&
Most of them are due to problems with the path of the file.
A good check can check out

CUDA error: CUBLAS_STATUS_NOT_INITIALIZED when calling `cublasCreate(handle)`

RuntimeError: [enforce fail at …\c10\core\CPUAllocator.cpp:75] data. DefaultCPUAllocator: not enough memory: you tried to allocate 50331648 bytes. Buy new RAM!
pytorch:RuntimeError: CUDA error: CUBLAS_STATUS_ALLOC_FAILED when calling cublasCreate(handle)
The batchsize is too big, not enough memory, changed from 64 to 8, the device is too bad.

[Solved] Mybatis:Cause: org.apache.ibatis.builder.BuilderException: Error creating document instance.

Error note – M ybatis:Cause : org.apache.ibatis.builder.BuilderException: Error creating document instance.

Project scenario: Problem Description: Cause Analysis: solution:

Project scenario:

prompt: when testing mybatis project, an error is reported: cause: org.apache.ibatis.builder.builderexception: error creating document instance. Cause: com.sun.org.apache.xerces.internal.impl.io.malformedbytesequenceexception: byte 2 of 2-byte UTF-8 sequence is invalid</ font>


Problem Description:

when running mybatis project, the following error will be reported: </ font>

org.apache.ibatis.exceptions.PersistenceException: 
### Error building SqlSession.
### Cause: org.apache.ibatis.builder.BuilderException: Error creating document instance.  Cause: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: 2 字节的 UTF-8 序列的字节 2 无效。

	at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
	at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:80)
	at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:64)
	at MyTest.test(MyTest.java:22)
	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:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
	at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230)
	at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58)
Caused by: org.apache.ibatis.builder.BuilderException: Error creating document instance.  Cause: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: 2 字节的 UTF-8 序列的字节 2 无效。
	at org.apache.ibatis.parsing.XPathParser.createDocument(XPathParser.java:263)
	at org.apache.ibatis.parsing.XPathParser.<init>(XPathParser.java:127)
	at org.apache.ibatis.builder.xml.XMLConfigBuilder.<init>(XMLConfigBuilder.java:81)
	at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:77)
	... 24 more

Cause analysis:

analysis: the main reason for this problem is that the code declared in the XML file is inconsistent with the code saved in the XML file itself
for example, your statement is & lt;?xml version=”1.0″ encoding=”UTF-8″?& gt;<However, it is encoded in ANSI format. Although there is no garbled code, the XML parser cannot parse it
the solution is to reset the consistency between the encoding and declaration when saving XML files</ font>


Solution:

Configure in pom.xml file

	<properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

[Solved] CUDA fails to compile in visual studio and throws error msb3721 and nvcc fatal

Platform: VS2013+CUDA 8.0
Executing “Compile” will pass, but “Executing “Recompile” or “Clean” will report an error.

nvcc fatal : Could not set up the environment for Microsoft Visual Studio using ‘C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/x86_amd64/…/…/…/VC/bin/amd64/vcvars64.bat’
error MSB3721: 命令““C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin\nvcc.exe” -ccbin “C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64” -I”C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\include” -I”C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\include” –keep-dir x64\Release -maxrregcount=0 –machine 64 –compile -DWIN32 -DNDEBUG -D_CONSOLE -D_LIB -D_UNICODE -DUNICODE -Xcompiler “/EHsc /W3 /nologo /O2 /FS /Zi /MD ” -clean”已退出,返回代码为 1。

Guess the reason may be the computer installed at the same time vs2017, vs2019, cuda 10.1 multiple versions caused by the previous only vs2013 and cuda 8.0 when there is no problem
Solution.
Find vcvars64.bat under C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64 and modify this sentence inside.

@if not “%WindowsSDK_ExecutablePath_x64%” == “” (
@set “PATH=%WindowsSDK_ExecutablePath_x64%;%PATH%”
)

to

@if not “%WindowsSDK_ExecutablePath_x64%” == “” (
@set “PATH=!WindowsSDK_ExecutablePath_x64!;!PATH!”
)

Error:scalac: Scala compiler JARs not found [How to Solve]

Error:scalac: Scala compiler JARs not found (module 'SparkSql'): C:\Users\***\.m2\repository\org\scala-lang\scala-compiler\2.11.8\scala-compiler-2.11.8.jar

The reason for the problem is that Scala libraries are not added to the project.

To add scala libraries Idea File -> Project Structrue -> Libraries can be added.

The request was rejected because the URL contained a potentially malicious String “;” [How to Solve]

Error message

Errors seen in the browser

Security Question

error
The request was rejected because the URL contained a potentially malicious String “;”

Errors seen from the console

2019-09-09 10:39:30,149 ERROR (DirectJDKLog.java:182)- Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception
org.springframework.security.web.firewall.RequestRejectedException: The request was rejected because the URL contained a potentially malicious String ";"
	at org.springframework.security.web.firewall.StrictHttpFirewall.rejectedBlacklistedUrls(StrictHttpFirewall.java:265)
	at org.springframework.security.web.firewall.StrictHttpFirewall.getFirewalledRequest(StrictHttpFirewall.java:245)
	at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:194)
	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:357)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:270)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:109)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:496)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:748)

Environmental information

***Springboot2.0 + Spring Security ***

Code tracking

We can findorg.springframework.security.web.firewall.StrictHttpFirewall

/**
 * <p>
 * Determines if semicolon is allowed in the URL (i.e. matrix variables). The default
 * is to disable this behavior because it is a common way of attempting to perform
 * <a href="https://www.owasp.org/index.php/Reflected_File_Download">Reflected File Download Attacks</a>.
 * It is also the source of many exploits which bypass URL based security.
 * </p>
 * <p>For example, the following CVEs are a subset of the issues related
 * to ambiguities in the Servlet Specification on how to treat semicolons that
 * led to CVEs:
 * </p>
 * <ul>
 *     <li><a href="https://pivotal.io/security/cve-2016-5007">cve-2016-5007</a></li>
 *     <li><a href="https://pivotal.io/security/cve-2016-9879">cve-2016-9879</a></li>
 *     <li><a href="https://pivotal.io/security/cve-2018-1199">cve-2018-1199</a></li>
 * </ul>
 *
 * <p>
 * If you are wanting to allow semicolons, please reconsider as it is a very common
 * source of security bypasses. A few common reasons users want semicolons and
 * alternatives are listed below:
 * </p>
 * <ul>
 * <li>Including the JSESSIONID in the path - You should not include session id (or
 * any sensitive information) in a URL as it can lead to leaking. Instead use Cookies.
 * </li>
 * <li>Matrix Variables - Users wanting to leverage Matrix Variables should consider
 * using HTTP parameters instead.
 * </li>
 * </ul>
 *
 * @param allowSemicolon should semicolons be allowed in the URL. Default is false
 */
public void setAllowSemicolon(boolean allowSemicolon) {
	if (allowSemicolon) {
		urlBlacklistsRemoveAll(FORBIDDEN_SEMICOLON);
	} else {
		urlBlacklistsAddAll(FORBIDDEN_SEMICOLON);
	}
}

Mentioned here, if you want a semicolon, please reconsider because it is a very common source of security bypass. Here are some common reasons why users need semicolons and alternatives:
Include JSESSIONID in the path-You should not include the session ID (or any sensitive information) in the URL, as it may lead to leakage. Instead, cookies are used.

solution

@SpringBootApplication
public class Application {

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }

    @Bean
    public HttpFirewall allowUrlSemicolonHttpFirewall() {
        StrictHttpFirewall firewall = new StrictHttpFirewall();
        firewall.setAllowSemicolon(true);
        return firewall;
    }
}

If the security restriction is released, the error will not be encountered, and it is not suitable for applications with very high security requirements.

POI Export Excel Error: HTTP Status 500 – Request processing failed; nested exception is java.lang.NullPointerException

Today, when using POI to do an Excel export, a null pointer error is always reported. Later, after I carefully searched through the log, I found the real problem;

The error is as follows:

HTTP Status 500 – Request processing failed; nested exception is java.lang.NullPointerException


type Exception report

message Request processing failed; nested exception is java.lang.NullPointerException

description The server encountered an internal error that prevented it from fulfilling this request.

exception

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.NullPointerException
	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:973)
	org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
	org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	com.bool.filter.RequestFilter.doFilterInternal(RequestFilter.java:37)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108)
	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108)
	com.bool.filter.CorsFilter.doFilter(CorsFilter.java:31)

 

root cause

java.lang.NullPointerException
	java.io.ByteArrayInputStream.<init>(ByteArrayInputStream.java:106)
	com.bool.controller.DetectionController.historyRecordDownkoad(DetectionController.java:264)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	java.lang.reflect.Method.invoke(Method.java:606)
	org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215)
	org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)
	org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:749)
	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:690)
	org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83)
	org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:945)
	org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:876)
	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)
	org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
	org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	com.bool.filter.RequestFilter.doFilterInternal(RequestFilter.java:37)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108)
	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108)
	com.bool.filter.CorsFilter.doFilter(CorsFilter.java:31)

 

note The full stack trace of the root cause is available in the Apache Tomcat/7.0.77 logs.

However, this is not the problem; when I debugged, I found another cause of the error;

java.lang.IllegalArgumentException: The workbook already contains a sheet with this name

The workbook already contains a piece of this name;

Okay, I found the problem.

solution:

Just modify the sheet page name in the export template;

[Solved] java.lang.ClassNotFoundException: org.apache.ibatis.session.SqlSession

Report an error

java.lang.ClassNotFoundException: org.apache.ibatis.session.SqlSession

or

java.lang.ClassNotFoundException: org.mybatis.spring.SqlSessionFactoryBean

 

Obviously, it is because the class cannot be found: the SqlSession class or SqlSessionFactoryBean cannot be found

 

Solution:

Forget to add mybatis dependency and mybatis-spring when integrating ssm

 

<dependency> 
  <groupId>org.mybatis</groupId> 
  <artifactId>mybatis-spring</artifactId> 
  <version>${mybatis-spring.version}</version> 
</dependency>
<dependency> 
  <groupId>org.mybatis</groupId> 
  <artifactId>mybatis</artifactId> 
  <version>${mybatis.version}</version> 
</dependency>The 

version used is:

<mybatis.version>3.4.1</mybatis.version> 
<mybatis-spring.version>1.3.0</mybatis-spring.version>

How to Solve ceph-deploy Error (Three Errors)

carried out:

ceph-deploy mon create-initial

Error:

[ceph_deploy][ERROR] KeyNotFoundError: Could not find keyring file: /etc/ceph/ceph.client.admin.keyring on host node1

[ceph_deploy][ERROR] KeyNotFoundError: Could not find keyring file: /etc/ceph/ceph.client.admin.keyring on host node2

[ceph_deploy][ERROR] KeyNotFoundError: Could not find keyring file: /etc/ceph/ceph.client.admin.keyring on host node3

solve:

ceph auth get-or-create client.admin mon’allow *’mds’allow *’osd’allow *’–o /etc/ceph/ceph.client.admin.keyring

or

ceph-create-keys –id node1

ceph-create-keys –id node2

ceph-create-keys –id node3

Error 2:

[ceph_deploy.mon][ERROR]Some monitors have still not reached quorum:

[ceph_deploy.mon][ERROR]node1

solve:

It can’t be solved for the time being, I have solved the error 3 after starting from the beginning:

————————————————– ———————————–

Implementation: rbd list 

Error 3: 

2018-08-19 10:31:08.047481 7f1f6c1d7700 0 – 192.168.4.1:0/3336722177 >> 192.168.4.2:6804/9634 pipe(0x55db04d46b20 sd=4 :0 s=1 pgs=0 cs=0 l=1 c=0x55db04d45db0).fault

Troubleshooting:

[root@node1 ceph-cluster]# ll /dev/vdb{1,2}
brw-rw—-. 1 root disk 252, 17 Aug 19 10:24 /dev/vdb1
brw-rw—-. 1 root disk 252, 18 Aug 19 10:24 /dev/vdb2

The problem is: the owner of /dev/vdb1 /dev/vdb2 is not ceph

solve:

[root@node1 ceph-cluster]# ll /dev/vdb{1,2}
brw-rw—-. 1 ceph ceph 252, 17 Aug 19 10:24 /dev/vdb1
brw-rw—-. 1 ceph ceph 252, 18 Aug 19 10:24 /dev/vdb2

chown ceph.ceph /dev/vdb{1,2}

[root@node1 ceph-cluster]# ll /dev/vdb{1,2}
brw-rw—-. 1 ceph ceph 252, 17 Aug 19 10:24 /dev/vdb1
brw-rw—-. 1 ceph ceph 252, 18 Aug 19 10:24 /dev/vdb2

[root@node1 ceph-cluster]# ceph-deploy osd activate node1:/dev/vdc1 node1:/dev/vdd1

[root@node1 ceph-cluster]# ceph-deploy osd activate node2:/dev/vdc1 node2:/dev/vdd1

[root@node1 ceph-cluster]# ceph-deploy osd activate node3:/dev/vdc1 node3:/dev/vdd1

Spark-shell startup error: Yarn application has already ended! It might have been killed or unable to launch application master

spark-shell does not support yarn cluster, start it in yarn client mode

spark-shell --master=yarn --deploy-mode=client

Start the log, the error message is as follows

 

Among them, “Neither spark.yarn.jars nor spark.yarn.archive is set, falling back to uploading libraries under SPARK_HOME” is just a warning. The official explanation is as follows:

Roughly speaking: if spark.yarn.jars and spark.yarn.archive are not configured, all jars under $SPAR_HOME/jars will be packaged into a zip file and uploaded to each work partition, so the packaging and distribution is automatically completed. It doesn’t matter to configure these two parameters.

 

“Yarn application has already ended! It might have been killed or unable to launch application master”, this is an exception, open the mr management page, mine is http://192.168.128.130/8088,

The focus is on the red box, the actual value of 2.2g of virtual memory exceeds the upper limit of 2.1g. That is to say, the virtual memory exceeds the limit, so the contratrainer is killed, the work is done in the container, the container is killed, and it is a fart.

solution

yarn-site.xml adds configuration:

2 configurations can choose one

1 <!--The following configuration is added to solve the problem of error reporting when spark-shell runs in yarn client mode. It is estimated that spark-summit will also have this problem. The problem can be solved by configuring only one of the two configurations. Of course, there is no problem with both configurations -->
 2 <!-- Whether the virtual memory setting is effective, if the actual virtual memory is greater than the set value, spark may report an error when running in client mode, " Yarn application has already ended! It might have been killed or unable to l " -->
 3 <property>
 4      <name>yarn.nodemanager.vmem-check-enabled</name>
 5      <value> false </value>
 6      <description>Whether virtual memory limits will be enforced for containers</description>
 7 </property>
 8 <!--Configure the value of virtual memory/physical memory, the default is 2.1 ,
<property>
 10      <name>yarn.nodemanager.vmem-pmem-ratio</name>
 11      <value> 4 </value>
 12      <description>Ratio between virtual memory to physical memory when setting memory limits for containers</description>
 13 </property>

 

After modification, start hadoop and spark-shell.