Tag Archives: java

Cannot call sendRedirect() after the response has been committed

Cannot call sendredirect() after the response has been committed exception

For the HTTP response, if it has been submitted (redirection, request forwarding, release in the filter), you can’t perform any operation on the response, such as modifying it or submitting it again.

For the submitted response, the method will not end (different from return), it will continue to execute, so if the code that you continue to execute after submitting will still run, the submit response will also cause this error.

For example:

    1. the following code will report an error because it released and submitted the response, and now it operates the response, because the filter release does not return the method, and the method is still executed downward </ OL> instead

        HttpServletRequest httpRequest = (HttpServletRequest) request;
        HttpServletResponse httpResponse = (HttpServletResponse) response;
        boolean boo = "Your judgment conditions";
        if (boo) {
            log.info("enter chain");
            chain.doFilter(request, response);
            //return;
        }
        //This is where the error will be reported because the response was submitted in the above release and now the resposne is being operated
        httpResponse.sendRedirect(TOLOGINURL);

2. The following code will report an error because it is submitted again after redirection, because the redirection will continue


httpResponse.sendRedirect(TOLOGINURL);
//This will report an error because it was committed (redirected) and then committed again
httpResponse.sendRedirect(TOLOGINURL);

The solution is to return after submitting</ Code>, or the check logic will not enter the submit again.

[Solved] java.lang.IllegalStateException: Cannot call sendRedirect() after the response has been committed

Project scenario:

Spring boot project, user-defined filter, intercept requests and process business.


Problem Description:

When you start the project access interface, you call resp.sendRedirect () in the custom filter.


Cause analysis:

After the response has been submitted, the sendredirect() method cannot be called.

In fact, chain. Dofilter (req, resp) is executed; Cannot use sendredirect() of resp object after

So looking at the code, we find that:

...

  HttpServletRequest httpRequest = (HttpServletRequest) request;
  HttpServletResponse httpResponse = (HttpServletResponse) response;
  ....
  boolean flag = getStatus();
  if (flag) {
      ....
      chain.doFilter(request, response);
  }
  httpResponse.sendRedirect(“xxxx”);
...

if the judged flag is true, chain.dofilter (request, response) will be executed, and httpresponse.sendredirect (“XXXX”) </ font> will be executed after execution


Solution:

After chain. Dofilter (request, response), add return to end the current method.

...

  HttpServletRequest httpRequest = (HttpServletRequest) request;
  HttpServletResponse httpResponse = (HttpServletResponse) response;
  ....
  boolean flag = getStatus();
  if (flag) {
      ....
      chain.doFilter(request, response);
      return;
  }
  httpResponse.sendRedirect(“xxxx”);
...

JAVA Connect MYSQL Error: Path does not chain with any of the trust anchors

Connection address:

jdbcUrl=jdbc:mysql://127.0.0.1:3306/test?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true

There is no problem with MySQL 5.5 on windows, but the connection fails on Mac.

Maybe it’s a certificate problem. Just change usessl = true to usessl = false. If you have time, please study SSL connection.

The error information is as follows:

Warning: Exception starting filter JFinalFilter
java.lang.RuntimeException: Plugin start error: com.jfinal.plugin.activerecord.ActiveRecordPlugin. 
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet successfully received from the server was 316 milliseconds ago.  The last packet sent successfully to the server was 309 milliseconds ago.
	at com.jfinal.core.Config.startPlugins(Config.java:116)
	at com.jfinal.core.Config.configJFinal(Config.java:51)
	at com.jfinal.core.JFinal.init(JFinal.java:63)
	at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:49)
	at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:285)
	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:266)
	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)
	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4747)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5389)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1410)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1400)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: com.jfinal.plugin.activerecord.ActiveRecordException: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet successfully received from the server was 316 milliseconds ago.  The last packet sent successfully to the server was 309 milliseconds ago.
	at com.jfinal.plugin.activerecord.TableBuilder.build(TableBuilder.java:55)
	at com.jfinal.plugin.activerecord.ActiveRecordPlugin.start(ActiveRecordPlugin.java:226)
	at com.jfinal.core.Config.startPlugins(Config.java:107)
	... 15 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet successfully received from the server was 316 milliseconds ago.  The last packet sent successfully to the server was 309 milliseconds ago.
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
	at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:989)
	at com.mysql.jdbc.ExportControlled.transformSocketToSSLSocket(ExportControlled.java:203)
	at com.mysql.jdbc.MysqlIO.negotiateSSLConnection(MysqlIO.java:4901)
	at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1659)
	at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1226)
	at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2191)
	at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2222)
	at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2017)
	at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:779)
	at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
	at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:389)
	at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:330)
	at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1461)
	at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1525)
	at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:734)
	at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:1060)
	at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:1056)
	at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:104)
	at com.jfinal.plugin.activerecord.TableBuilder.build(TableBuilder.java:43)
	... 17 more
Caused by: javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: java.security.cert.CertPathValidatorException: Path does not chain with any of the trust anchors
	at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
	at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1964)
	at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:328)
	at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:322)
	at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1614)
	at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:216)
	at sun.security.ssl.Handshaker.processLoop(Handshaker.java:1052)
	at sun.security.ssl.Handshaker.process_record(Handshaker.java:987)
	at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1072)
	at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1385)
	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1413)
	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1397)
	at com.mysql.jdbc.ExportControlled.transformSocketToSSLSocket(ExportControlled.java:188)
	... 39 more
Caused by: java.security.cert.CertificateException: java.security.cert.CertPathValidatorException: Path does not chain with any of the trust anchors
	at com.mysql.jdbc.ExportControlled$X509TrustManagerWrapper.checkServerTrusted(ExportControlled.java:304)
	at sun.security.ssl.AbstractTrustManagerWrapper.checkServerTrusted(SSLContextImpl.java:985)
	at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1596)
	... 47 more
Caused by: java.security.cert.CertPathValidatorException: Path does not chain with any of the trust anchors
	at sun.security.provider.certpath.PKIXCertPathValidator.validate(PKIXCertPathValidator.java:154)
	at sun.security.provider.certpath.PKIXCertPathValidator.engineValidate(PKIXCertPathValidator.java:80)
	at java.security.cert.CertPathValidator.validate(CertPathValidator.java:292)
	at com.mysql.jdbc.ExportControlled$X509TrustManagerWrapper.checkServerTrusted(ExportControlled.java:297)
	... 49 more

六月 03, 2018 12:36:57 下午 org.apache.catalina.core.StandardContext startInternal
严重: One or more Filters failed to start. Full details will be found in the appropriate container log file
六月 03, 2018 12:36:57 下午 org.apache.catalina.core.StandardContext startInternal
严重: Context [/youpai] startup failed due to previous errors
六月 03, 2018 12:36:57 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesJdbc
警告: The web application [youpai] registered the JDBC driver [com.alibaba.druid.proxy.DruidDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
六月 03, 2018 12:36:57 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesJdbc
警告: The web application [youpai] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
六月 03, 2018 12:36:57 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
警告: The web application [youpai] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 java.lang.Object.wait(Native Method)
 java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143)
 com.mysql.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:64)
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
 java.lang.Thread.run(Thread.java:748)
六月 03, 2018 12:36:57 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
警告: The web application [youpai] appears to have started a thread named [Druid-ConnectionPool-Create-683007923] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 java.net.SocketInputStream.socketRead0(Native Method)
 java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
 java.net.SocketInputStream.read(SocketInputStream.java:171)
 java.net.SocketInputStream.read(SocketInputStream.java:141)
 sun.security.ssl.InputRecord.readFully(InputRecord.java:465)
 sun.security.ssl.InputRecord.read(InputRecord.java:503)
 sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:983)
 sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1385)
 sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1413)
 sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1397)
 com.mysql.jdbc.ExportControlled.transformSocketToSSLSocket(ExportControlled.java:188)
 com.mysql.jdbc.MysqlIO.negotiateSSLConnection(MysqlIO.java:4901)
 com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1659)
 com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1226)
 com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2191)
 com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2222)
 com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2017)
 com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:779)
 com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
 sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
 sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
 sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
 java.lang.reflect.Constructor.newInstance(Constructor.java:423)
 com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
 com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:389)
 com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:330)
 com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1461)
 com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1525)
 com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2100)
六月 03, 2018 12:36:57 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
警告: The web application [youpai] appears to have started a thread named [Druid-ConnectionPool-Destroy-683007923] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 java.lang.Thread.sleep(Native Method)
 com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2172)
六月 03, 2018 12:36:57 下午 org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks
严重: The web application [youpai] created a ThreadLocal with key of type [com.jfinal.template.io.WriterBuffer$2] (value [com.jfinal.template.io.WriterBuffer$2@5d2725f4]) and a value of type [com.jfinal.template.io.CharWriter] (value [com.jfinal.template.io.CharWriter@21b9a650]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
六月 03, 2018 12:36:57 下午 org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks
严重: The web application [youpai] created a ThreadLocal with key of type [com.jfinal.template.io.WriterBuffer$3] (value [com.jfinal.template.io.WriterBuffer$3@38a0d534]) and a value of type [com.jfinal.template.io.FastStringWriter] (value []) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
六月 03, 2018 12:36:57 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-nio-2018"]
六月 03, 2018 12:36:57 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-nio-8009"]
六月 03, 2018 12:36:57 下午 org.apache.catalina.startup.Catalina start
信息: Server startup in 9062 ms
六月 03, 2018 12:37:01 下午 org.apache.catalina.loader.WebappClassLoaderBase checkStateForResourceLoading
信息: Illegal access: this web application instance has been stopped already. Could not load []. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
java.lang.IllegalStateException: Illegal access: this web application instance has been stopped already. Could not load []. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
	at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading(WebappClassLoaderBase.java:1372)
	at org.apache.catalina.loader.WebappClassLoaderBase.getResource(WebappClassLoaderBase.java:1042)
	at com.mysql.jdbc.AbandonedConnectionCleanupThread.checkContextClassLoaders(AbandonedConnectionCleanupThread.java:90)
	at com.mysql.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:63)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

Path does not chain with any of the trust anchors [Solved]

Path does not chain with any of the trust anchors exception resolution

Problem statement: JDBC. Url = JDBC: mysql://192.168.23.129:3306/ssmbuild?useSSL=true&amp ; useUnicode=true& Characterencoding = utf8
solution: change usessl = true to usessl = false
reason: according to the requirements of MySQL 5.5.45 +, 5.6.26 + and 5.7.6 +, for data security and maintenance, if you do not set explicit options, you must establish a default SSL connection (true), change it to false and turn it off

[Solved] Java.lang.BootstrapMethodError: call site initialization exception

Causes of the problem:

When we upgrade the version of the company’s Flink, we type the task into a jar package and send it to the Flink cluster to run. Due to the upgrade of the version of the Flink, it has a certain impact on the components.

Question:

When collecting data, ES reported the following error
java.lang.bootstrap method error: call site initialization exception
java.lang.invoke.lambdaconversionexception: invalid receiver type interface org.apache.http.header; not a subtype of implementation type interface org.apache.http.NameValuePair

bug-fix:

In the POM file, HttpCore and httpclient are introduced separately, and then conflicting dependencies are excluded in the introduction of ES. However, this method does not solve my problem. Finally, it is solved by reducing the version of ES dependency, which is reduced from es7.11.1 to es7.2.0.

[Solved] Java.util.linkedhashmap cannot be cast to entity class

Solve the problem of java.util.linkedhashmap cannot be cast to entity class

Background description

When learning about grain mall, openfeign is used for remote call, because an interface returns R < List<· Object>> Type of data, using list <Object> When receiving data, the java.util.linkedhashmap cannot be cast to XXX data conversion exception error occurs. It can be seen that the remote call will convert the data to be converted to LinkedHashMap, but it will not work to convert it to the desired data type.

Solution one

Use typereference in fastjson tool provided by Alibaba to transform.

We add SetData () and GetData () methods to R. when getting data, we use typereference class to indicate the data type. Then convert the map to the JSON string, and then convert the JSON string to the data type we want.

public class R extends HashMap<String, Object> {
	private static final long serialVersionUID = 1L;

	public R setData(Object data){
		put("data",data);
		return this;
	}

	//Reversal with fastjson
	public <T> T getData(TypeReference<T> typeReference){
		Object data = get("data");//Default is map type
		if(Objects.isNull(data)){
			return null;
		}
		String s = JSON.toJSONString(data);
		T t = JSON.parseObject("",typeReference);
		return t;
	}

Caller

        R r = wareFeignService.getSkusHasStock(skuIdList);//Remote calls
        TypeReference<List<SkuHasStockVo>> typeReference = new TypeReference<List<SkuHasStockVo>>() {
        };// Declare the internal class, specifying the type
        List<SkuHasStockVo> data = r.getData(typeReference);//get data for remote calls

reflection

This problem also occurred when using resttemplate remote call before. This problem was solved before, and the solution steps were not recorded. This time, the solution steps will be recorded to prevent the next step.

Supplementary solution 2

Recently, when reviewing the previous project code, I found a similar problem when using resttemplate remote call mentioned in my thinking. The solution at the time was this.

	import com.alibaba.fastjson.JSON;
	import com.alibaba.fastjson.JSONObject;
	
	//remote call, return the specified collection, but this collection can not be used directly, because he is a LinkedHashMap.
	List<InnerControl> remoteList = restTemplate.getForObject("url", List.class);
	remoteList = transToList(remoteList);// After the conversion, you will be able to use this collection normally.
	
	// Define a method to convert the LinkedHashMap type to the data type we want
	private List<InnerControl> transToList(List<InnerControl> list){
		String jsonStr = JSON.toJSONString(list);//still use the json conversion tool provided by alibaba.
		return JSONObject.parseArray(jsonStr, InnerControl.class);
	}

IDEA springboot can recognize POM files, but suddenly it can’t reference mven dependencies. Strange things, inexplicable solutions

Foreword: today I open idea 2020.3 and find that all the spring boot projects can’t find all the dependencies. These projects were started normally yesterday

then I subconsciously thought that my Maven settings were wrong, but I checked and found that there was no problem with Maven configuration, and idea also recognized the pom.xml file. After reloading Maven dependencies several times, it still couldn’t work. Emmmmm, I think it may be caused by idea cache, right?The entire project was reloaded, but still not. Then I went to Baidu. There were not many solutions on Baidu and what I did above. I put on a mask of pain. I’m just a rookie. How can I meet this kind of thing?T.T.


Suddenly, I noticed that the red dot of idea event log was flashing, and I click to see

It said that there was something wrong with my plug-in, emmmmm. I don’t know why it suddenly went wrong, so I unloaded the plug-in, restarted the idea, and returned to normal. My God, what’s the situation?

Log content of event log

2021-07-08 09:44:26,967 [  59955]  ERROR - penapi.project.DumbServiceImpl - IntelliJ IDEA 2020.3.2  Build #IU-203.7148.57 
2021-07-08 09:44:26,967 [  59955]  ERROR - penapi.project.DumbServiceImpl - JDK: 11.0.9.1; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o. 
2021-07-08 09:44:26,967 [  59955]  ERROR - penapi.project.DumbServiceImpl - OS: Windows 10 
2021-07-08 09:44:26,968 [  59956]  ERROR - penapi.project.DumbServiceImpl - Plugin to blame: RestfulToolkit version: 2.0.9 
2021-07-08 09:44:26,968 [  59956]  ERROR - penapi.project.DumbServiceImpl - Last Action:  
2021-07-08 09:44:27,072 [  60060]  ERROR - penapi.project.DumbServiceImpl - Error executing task com.intellij.util.DisposeAwareRunnable@51a99ed3 
java.lang.NoClassDefFoundError: Could not initialize class com.zhaow.restful.common.ToolkitIcons
	at com.zhaow.restful.navigator.RestServicesNavigator.initToolWindow(RestServicesNavigator.java:118)
	at com.zhaow.restful.navigator.RestServicesNavigator.lambda$initComponent$0(RestServicesNavigator.java:105)
	at com.intellij.util.DisposeAwareRunnable.run(DisposeAwareRunnable.java:72)
	at com.intellij.openapi.project.DumbServiceImpl.doRun(DumbServiceImpl.java:399)
	at com.intellij.openapi.project.DumbServiceImpl.updateFinished(DumbServiceImpl.java:391)
	at com.intellij.openapi.project.TrackedEdtActivityService$TrackedEdtActivity.run(TrackedEdtActivityService.java:100)
	at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:216)
	at com.intellij.openapi.application.TransactionGuardImpl.access$200(TransactionGuardImpl.java:24)
	at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:199)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:822)
	at com.intellij.openapi.application.impl.ApplicationImpl.lambda$invokeLater$4(ApplicationImpl.java:324)
	at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:85)
	at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:134)
	at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:47)
	at com.intellij.openapi.application.impl.FlushQueue$FlushNow.run(FlushQueue.java:190)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:976)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:843)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:454)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:773)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:453)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:822)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:501)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
2021-07-08 09:44:27,072 [  60060]  ERROR - penapi.project.DumbServiceImpl - IntelliJ IDEA 2020.3.2  Build #IU-203.7148.57 
2021-07-08 09:44:27,072 [  60060]  ERROR - penapi.project.DumbServiceImpl - JDK: 11.0.9.1; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o. 
2021-07-08 09:44:27,073 [  60061]  ERROR - penapi.project.DumbServiceImpl - OS: Windows 10 
2021-07-08 09:44:27,073 [  60061]  ERROR - penapi.project.DumbServiceImpl - Plugin to blame: RestfulToolkit version: 2.0.9 
2021-07-08 09:44:27,073 [  60061]  ERROR - penapi.project.DumbServiceImpl - Last Action:  
2021-07-08 09:44:34,619 [  67607]   INFO - dea.updater.SdkComponentSource - File C:\Users\cuiliangyun\.android\repositories.cfg could not be loaded. 
2021-07-08 09:44:34,628 [  67616]   INFO - dea.updater.SdkComponentSource - Downloading https://dl.google.com/android/repository/addons_list-3.xml 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 7月 08, 2021 9:44:35 上午 net.sourceforge.pmd.lang.rule.AbstractRuleChainVisitor visitAll 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 警告: Exception applying rule PackageNamingRule on file D:/我的/我的项目/myproject-sso/src/main/java/com/example/sso/SsoApplication.java, continuing with next rule 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - java.lang.RuntimeException: org.jaxen.UnresolvableException: No Such Function matches 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at net.sourceforge.pmd.lang.rule.xpath.JaxenXPathRuleQuery.evaluate(JaxenXPathRuleQuery.java:73) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at net.sourceforge.pmd.lang.rule.XPathRule.evaluate(XPathRule.java:114) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at net.sourceforge.pmd.lang.java.rule.JavaRuleChainVisitor.visit(JavaRuleChainVisitor.java:42) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at net.sourceforge.pmd.lang.rule.AbstractRuleChainVisitor.visitAll(AbstractRuleChainVisitor.java:96) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at net.sourceforge.pmd.RuleChain.apply(RuleChain.java:67) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at net.sourceforge.pmd.RuleSets.apply(RuleSets.java:140) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at com.alibaba.p3c.idea.pmd.SourceCodeProcessor.processSource(SourceCodeProcessor.kt:220) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at com.alibaba.p3c.idea.pmd.SourceCodeProcessor.processSourceCode(SourceCodeProcessor.kt:65) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at com.alibaba.p3c.idea.pmd.AliPmdProcessor.processFile(AliPmdProcessor.kt:75) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at com.alibaba.p3c.idea.inspection.AliPmdInspectionInvoker.doInvoke(AliPmdInspectionInvoker.kt:62) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at com.alibaba.p3c.idea.inspection.AliPmdInspectionInvoker$Companion.invokeInspection(AliPmdInspectionInvoker.kt:125) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at com.alibaba.p3c.idea.inspection.AliPmdInspection.checkFile(AliPmdInspection.kt:71) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at PackageNamingRuleInspection.checkFile(DelegatePmdInspection.kt:47) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at com.intellij.codeInspection.LocalInspectionTool$1.visitFile(LocalInspectionTool.java:145) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at com.intellij.psi.impl.source.PsiJavaFileBaseImpl.accept(PsiJavaFileBaseImpl.java:475) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at com.intellij.codeInspection.InspectionEngine.acceptElements(InspectionEngine.java:66) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at com.intellij.codeInspection.InspectionEngine.createVisitorAndAcceptElements(InspectionEngine.java:57) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.runToolOnElements(LocalInspectionsPass.java:298) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$visitPriorityElementsAndInit$3(LocalInspectionsPass.java:267) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at com.intellij.util.AstLoadingFilter.forceAllowTreeLoading(AstLoadingFilter.java:156) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at com.intellij.util.AstLoadingFilter.forceAllowTreeLoading(AstLoadingFilter.java:148) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$visitPriorityElementsAndInit$4(LocalInspectionsPass.java:266) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:127) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:116) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$visitPriorityElementsAndInit$5(LocalInspectionsPass.java:266) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:136) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:149) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1132) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at com.intellij.concurrency.ApplierCompleter.lambda$wrapInReadActionAndIndicator$1(ApplierCompleter.java:92) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:658) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:610) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:65) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at com.intellij.concurrency.ApplierCompleter.wrapInReadActionAndIndicator(ApplierCompleter.java:104) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at com.intellij.concurrency.ApplierCompleter.lambda$compute$0(ApplierCompleter.java:83) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:172) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:183) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at com.intellij.concurrency.ApplierCompleter.compute(ApplierCompleter.java:83) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at com.intellij.concurrency.JobLauncherImpl.invokeConcurrentlyUnderProgress(JobLauncherImpl.java:61) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at com.intellij.concurrency.JobLauncher.invokeConcurrentlyUnderProgress(JobLauncher.java:48) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.visitPriorityElementsAndInit(LocalInspectionsPass.java:270) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.inspect(LocalInspectionsPass.java:193) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.collectInformationWithProgress(LocalInspectionsPass.java:115) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doCollectInformation(ProgressableTextEditorHighlightingPass.java:84) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:56) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$1(PassExecutorService.java:400) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1137) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$2(PassExecutorService.java:393) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:658) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:610) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:65) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:392) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$run$0(PassExecutorService.java:368) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:172) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:183) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:366) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:188) 
2021-07-08 09:44:35,022 [  68010]   INFO -                         STDERR - 	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290) 
2021-07-08 09:44:35,023 [  68011]   INFO -                         STDERR - 	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020) 
2021-07-08 09:44:35,023 [  68011]   INFO -                         STDERR - 	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656) 
2021-07-08 09:44:35,023 [  68011]   INFO -                         STDERR - 	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594) 
2021-07-08 09:44:35,023 [  68011]   INFO -                         STDERR - 	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183) 
2021-07-08 09:44:35,023 [  68011]   INFO -                         STDERR - Caused by: org.jaxen.UnresolvableException: No Such Function matches 
2021-07-08 09:44:35,023 [  68011]   INFO -                         STDERR - 	at org.jaxen.SimpleFunctionContext.getFunction(SimpleFunctionContext.java:127) 
2021-07-08 09:44:35,023 [  68011]   INFO -                         STDERR - 	at org.jaxen.ContextSupport.getFunction(ContextSupport.java:242) 
2021-07-08 09:44:35,023 [  68011]   INFO -                         STDERR - 	at org.jaxen.Context.getFunction(Context.java:216) 
2021-07-08 09:44:35,023 [  68011]   INFO -                         STDERR - 	at org.jaxen.expr.DefaultFunctionCallExpr.evaluate(DefaultFunctionCallExpr.java:176) 
2021-07-08 09:44:35,023 [  68011]   INFO -                         STDERR - 	at org.jaxen.expr.DefaultFunctionCallExpr.evaluateParams(DefaultFunctionCallExpr.java:195) 
2021-07-08 09:44:35,023 [  68011]   INFO -                         STDERR - 	at org.jaxen.expr.DefaultFunctionCallExpr.evaluate(DefaultFunctionCallExpr.java:179) 
2021-07-08 09:44:35,023 [  68011]   INFO -                         STDERR - 	at org.jaxen.expr.DefaultPredicate.evaluate(DefaultPredicate.java:95) 
2021-07-08 09:44:35,023 [  68011]   INFO -                         STDERR - 	at org.jaxen.expr.PredicateSet.applyPredicate(PredicateSet.java:269) 
2021-07-08 09:44:35,023 [  68011]   INFO -                         STDERR - 	at org.jaxen.expr.PredicateSet.evaluatePredicates(PredicateSet.java:244) 
2021-07-08 09:44:35,023 [  68011]   INFO -                         STDERR - 	at org.jaxen.expr.DefaultNameStep.evaluate(DefaultNameStep.java:215) 
2021-07-08 09:44:35,023 [  68011]   INFO -                         STDERR - 	at org.jaxen.expr.DefaultLocationPath.evaluate(DefaultLocationPath.java:140) 
2021-07-08 09:44:35,023 [  68011]   INFO -                         STDERR - 	at org.jaxen.expr.DefaultXPathExpr.asList(DefaultXPathExpr.java:102) 
2021-07-08 09:44:35,023 [  68011]   INFO -                         STDERR - 	at org.jaxen.BaseXPath.selectNodesForContext(BaseXPath.java:677) 
2021-07-08 09:44:35,023 [  68011]   INFO -                         STDERR - 	at org.jaxen.BaseXPath.selectNodes(BaseXPath.java:216) 
2021-07-08 09:44:35,023 [  68011]   INFO -                         STDERR - 	at net.sourceforge.pmd.lang.rule.xpath.JaxenXPathRuleQuery.evaluate(JaxenXPathRuleQuery.java:69) 
2021-07-08 09:44:35,023 [  68011]   INFO -                         STDERR - 	... 60 more 
2021-07-08 09:44:35,023 [  68011]   INFO -                         STDERR -  

Solution: uninstall the error reporting plug-in, restart idea, and it will return to normal
I’m a rookie, and I don’t understand why this is OK?

[Solved] Java Error: Must declare a named package because this compilation unit is associated to the named module

Using the latest version of eclipse, you may encounter such a problem (error report)

“Must declare a named package because this compilation unit is associated to the named module ‘xxx'”
the reason for this is that in the latest version of eclipse, the package needs to be defined while defining a class.

How to define a package:

In the eclipse menu bar, select File – & gt; New-> Class command, in the Import dialog box, find the package, and then name it( The position of the red line cannot be empty)

Solve the problem of springboot and unit test starting applicationrunner

During the execution of unit test, applicationrunner was started unexpectedly, resulting in the initialization of netty server and the failure of unit test execution.

Solution: by setting the profile of bean corresponding to applicationrunner

Add notes to corresponding components:

@Profile(“! test”)

Add notes to unit tests:

@ActiveProfiles(“test”)

Spring boot does not take effect when using @ size to verify a single set parameter of the control layer

Spring boot does not take effect when using @ size to verify a single set parameter of the control layer

1. Problem description

In the figure below, there is a type of List & lt; String> method parameter, when using @ size to mark the verification quantity, it is found that no exception is thrown

2. Solution

You need to add the @ validated annotation on the control class, and restart the project

The web application [ROOT] appears to have started a thread named [RxIoScheduler-1 (Evictor)] but ha

Start the project and report an error;

1. First, check the code and check the GIT submission record. It is found that the code with error prompt is old code. If there is no change in the near future, the error report caused by colleague code error will be ruled out. The focus is on the local system and system configuration;

2. Check the error information

The key is these two sentences,

nested exception is java.lang.IllegalArgumentException: Property ‘sqlSessionFactory’ or ‘sqlSessionTemplate’ are required

The web application [ROOT] appears to have started a thread named [RxIoScheduler-1 (Evictor)] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:

3. Throw it to Baidu, check the solutions, and find that there are many solutions. Some solutions try, but they are invalid, while others are inconsistent with the system, and finally give up looking for solutions online;

4. Restart idea and clear the cache; Restart the computer is invalid; It is invalid to modify the JDK configuration;

5. When checking the Maven configuration, it is found that two update packages are not downloaded successfully. Add the jar package to the local, re import, restart the project, and start successfully;

The mountains and rivers are heavy, and there is no way out