Tag Archives: frame

Springboot thymeleaf Error: Exception processing template “table/dynamic_table”: Error resolving template [common]…

1. Error reporting:

[THYMELEAF][http-nio-8080-exec-3] Exception processing template "table/dynamic_table": Error resolving template [common], template might not exist or might not be accessible by any of the configured Template Resolvers (template: "table/dynamic_table" - line 17, col 10)

2. Occurrence

An error is reported when thymeleaf introduces a public page

3. Reasons for error reporting

Original code:

<div th:replace="common :: #leftmenu"></div>

Error report caused by not adding a path

After modification:

<div th:replace="table/common :: #leftmenu"></div>

[Solved] Mybatis Error: Establishing SSL connection without server‘s identity verification is not recommended.

Mybatis Error: Establishing SSL connection without server‘s identity verification is not recommended.

 

Solution:

(1) You need to explicitly disable SSL by setting usessl = false, or set usessl = true and provide a truststore for server certificate validation
(2) at this time, we only need to set usessl = false on the URL connecting to the database.

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


Complete error reporting:

org.apache.ibatis.exceptions.PersistenceException: 
Error building SqlSession.
Cause: org.apache.ibatis.builder.BuilderException: Error creating document instance.  Cause: org.xml.sax.SAXParseException; lineNumber: 58; columnNumber: 17; 元素类型为 "configuration" 的内容必须匹配 "(properties?,settings?,typeAliases?,typeHandlers?,objectFactory?,objectWrapperFactory?,reflectorFactory?,plugins?,environments?,databaseIdProvider?,mappers?)"。

Solution:

When the above error occurs, it is obvious that the exception occurs when parsing the XML configuration file,
from org.xml.sax.saxparseexception; lineNumber: 30; columnNumber: 17; Content with element type “configuration” must match: (properties?, settings?, typealiases?, typehandlers?, objectfactory?, objectwrapperfactory?, plugins?, environments?, databaseidprovider?, mappers?) “。 It is obvious that the configuration files of mybatis are in order and the number is limited Indicates that there can be no but at most one, but in your own configuration:

Incrrect order:

Correct order:

The connection pool of SSM project database cannot be connected. The project can run normally and the database cannot be connected

Problem description

I use Maven to build an SSM project. The project can run normally, but I can’t connect to the database. If I have connected to the database, I will report an error. The error message is as follows.

org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.AbstractMethodError: org.mybatis.spring.transaction.SpringManagedTransaction.getTimeout()Ljava/lang/Integer;
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:982)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:634)
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
	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:197)
	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:200)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:834)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1415)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.AbstractMethodError: org.mybatis.spring.transaction.SpringManagedTransaction.getTimeout()Ljava/lang/Integer;
	at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:85)
	at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:62)
	at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324)
	at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156)
	at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109)
	at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83)
	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148)
	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141)
	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.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:386)
	at com.sun.proxy.$Proxy10.selectList(Unknown Source)
	at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:205)
	at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:137)
	at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:75)
	at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:53)
	at com.sun.proxy.$Proxy16.getAll(Unknown Source)
	at com.controller.AdminController.login(AdminController.java:23)
	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.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
	at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)
	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97)
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)
	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967)
	... 32 more
[DEBUG] 2021-06-09 19:28:00,962 org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'sqlSessionFactory'

After troubleshooting, I found that after my spring configuration file was compiled by maven, the database connection pool reported an error, which was very popular

but the source code without compilation is not popular

this is very strange. I don’t understand what the problem is. After a meal at Baidu, I found that some predecessors said it might be the jar package version matching problem, so I found an operation in my POM file
the original database connection pool related jar and spring versions are as follows:

<dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-jdbc</artifactId>
      <version>4.3.18.RELEASE</version>
</dependency>
<dependency>
      <groupId>org.mybatis</groupId>
      <artifactId>mybatis</artifactId>
      <version>3.4.1</version>
</dependency>
<dependency>
      <groupId>org.mybatis</groupId>
      <artifactId>mybatis-spring</artifactId>
      <version>1.2.3</version>
</dependency>

The revised version is as follows:

<dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-jdbc</artifactId>
      <version>4.3.18.RELEASE</version>
 </dependency>
 <dependency>
      <groupId>org.mybatis</groupId>
      <artifactId>mybatis</artifactId>
      <version>3.4.1</version>
 </dependency>
<dependency>
      <groupId>org.mybatis</groupId>
      <artifactId>mybatis-spring</artifactId>
      <version>2.0.3</version>
</dependency>

Here, after running the project, connecting to the database, the problem is solved
it’s just the jar package version conflict, which makes me very tired.

solve the problem

Modify jar package version

Error creating bean with name ‘xxcontroller’

Today, when we learn to integrate SSM projects to test whether the framework is available, we will report the above error as soon as we run Maven’s Tomcat,

At the beginning, I thought it was because the service layer annotation was not well written. After checking, I found that there was no error. Finally, in the web.xml It is found that the following param value is wrongly written in the file, and the application in ApplicationContext – *. XML is missing an n.

≪! — load the spring container — & gt;
& lt; context param & gt;
& lt; param name & gt; contextconfiglocation & lt; & param name & gt;
& lt; param value & gt; classpath:spring/applicationContext- *.xml</param-value>
  </context-param>

And less in the transaction aspect

< aop:config>
< aop:advisor advice-ref= “txAdvice”
pointcut=”execution(* cn.itcast .e3 mall.service ..*.*(..))” />
</ aop:config>

Spent a lot of time, finally solved, hope to help you!

Java project cannot import entity class package and service package, controller layer reports error, fix project setup is OK

Frame SSH

The previous packages are all OK. I create a management class of the service layer. When I add a new service, it appears:

Java project cannot import entity class package and service package, controller layer reports an error,

At the beginning, I thought that the package was wrong. I deleted the package in the controller layer and imported it again, but it still couldn’t work,

Check the cause of the error and find out

Then select fix project setup and it will be OK.

Record down, in Baidu did not find the answer, follow-up continuous attention, have to know the reason can leave a message, thank you~~

GoogleIO 2013 Android fast networking framework Volley introduction

Recently, I investigated the Android development framework, looked at XUtils, KjFramework and other frameworks of HTTP modules, I think it is too simple, but simply encapsulate HttpUrlConnenction and Handler, added a callback function, I feel it is better than to write a little bit. Later I found Volley, a relatively reliable Android network request framework, and used it.
Volley is the network communication library on the Android platform, making network communication faster, simpler, and more robust.
is the origin of Volley’s name: a burst or emission of many things or a large amount at once
in Google IO’s speech, the picture is a picture of firing arrows, which is similar to meteor.

in fact, from this picture, we can also see that Volley is particularly suitable for scenarios with small amounts of data but heavy communication.

GoogleIO2013 Android Quick Networking Framework Volley

 Features offered by Volley

Asynchronous download of JSON, images, etc..
Sorting of network requests (scheduling)
Prioritization of network requests
cache
Multi-level cancellation requests
Linkage to Activity and Lifecycle (simultaneous cancellation of all network requests at the end of Activity)