SUSE mount NFS prompt mount.nfs no such device

    suse11_ sp4_ Tips for mounting NFS_ mount. nfs:No_ such__ device_, How to cooperate with NFS kernel module
    try to load NFSD and test to see if it is normal:
    ?Modprobe NFSD
    If an error is reported when executing the command
    2. Check the log file, Check the memory
    see the following error from the log:
    Mar 30 10:56:17 idc-miyun5 modprobe: fat: error inserting NFS (/ lib/modules/3.0.101-63-default/kernel/FS/NFS/NFS. KO): cannot allocate memory
    have the following call trace prompt:
    Mar 30 13:30:34 idc-miyun5 kernel: [30647348.889920] modprobe: page allocation failure: order:4 , mode:0xd0
    Try the following operation:
    to minimize the cache occupation, you can drop the cache manually_ caches:
    #sync
    #echo 3 >/proc/sys/vm/drop_ Caches
    manually clearing the cache will not affect the normal operation of the application, because the memory of drop cache is the data that the process has not used, and the data in use will not be dropped. However, if the file data in the previous cache needs to be read again later, it is recommended to execute it when the business is not busy current configuration vm.min_ free_ Kbytes = 1048576
    ?Note that Kbytes is used here

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

Flutter development: prompt error parsing localfile when running the project: ‘/ users / xxx / Android / APP / SRC / main / androidmanifest. XML’… Solution

preface

At the beginning of the development of flutter, there are all kinds of problems. At this time, it is a little difficult for the developers who have just contacted the development of flutter. Therefore, in the early stage of the development of flutter, we should accumulate more, consult more and step on more holes, so that we can start to develop the flutter project quickly. This article will share a relatively simple problem encountered in the development of flutter, the error prompted after the operation of flutter packages get.

 
Error message

After running the flutter packages get, the flutter project will prompt the following error prompt:

After executing the command flutter packages get, an error is reported. It is about the Android related prompt in the flutter project

Error parsing LocalFile: '/Users/xxx/xxxxxx/android/app/src/main/AndroidManifest.xml' Please ensure that the android manifest is a valid XML document and try again.

exit code 1

analysis

Through the above error prompt, the editor has told the specific location of the error file, so follow the file path of the prompt and enter the corresponding file to check the specific location of the error. However, after checking, no error is found. After performing the flitter clean, the editor runs the flitter run again, and the error is still reported. The corresponding writing method of the specific file is as follows:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"

    package="com.example.platform_app">

    <uses-permission android:name="android.permission.INTERNET"/>

    <application

        android:name="io.flutter.app.FlutterApplication"

        android:label="platform_app">

        <activity

            android:name=".MainActivity"

            android:launchMode="singleTop"

            android:theme="@style/LaunchTheme"

           android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"

            android:hardwareAccelerated="true"

            android:windowSoftInputMode="adjustResize">

            <intent-filter>

                <action android:name="android.intent.action.MAIN"/>

                <category android:name="android.intent.category.LAUNCHER"/>

            </intent-filter>

        </activity>

        <meta-data

            android:name="flutterEmbedding"

            android:value="2" />

    </application>

</manifest>

Through repeated investigation, we finally found out the problem, label & lt/ manifest> The end tag of is missing one, as shown in the following figure:

 
resolvent

In & gt; And then it was lost android:icon= “@mipmap/ic_ So it should be like this:

<application

    android:name="io.flutter.app.FlutterApplication"

    android:label="platform_app"

    android:icon="@mipmap/ic_launcher">

<activity...

Finally, click save file, run the project again, and no error will be reported directly. The project flutter is successfully started, and the problem is perfectly solved.

 
The above is the whole content of this chapter. Welcome to WeChat official account of the three shopkeeper, “program ape by three shopkeeper”, three shopkeeper’s Sina micro-blog “three shopkeeper 666”, welcome to pay attention!

Three WeChat’s official account:

Sina Weibo of three shopkeepers:

 

SpringCloud GateWay Failed to instantiate [org.springframework.cloud.gateway.discovery.DiscoveryL…

Recently, the company needs to rebuild the system permission framework. I use gateway as the gateway.

I have to admit that gateway configuration is really good. In the past, when using nginx, I had to configure a lot of messy things, now I don’t need to configure certificates

There was no problem when the project was running, but when the jar package was run alone after packaging, it encountered this problem. After looking for it all afternoon, a netizen told me that as long as you use the gateway gateway, you will encounter this problem.

resolvent:

Add configuration in the POM file of gateway

<dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-validation</artifactId>
</dependency>

Perfect solution

Condahttperror:HTTP000 Connection Failed for URL https://repo.anaconda.com/pkgs/main/win-6

CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pkgs/main/win-64/repodata.json>
Elapsed: -

An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.

Solution:
Win + R

then find

and replace it with

channels:
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
show_channel_urls: true
ssl_verify: false

Solve chrome running error unknown error: cannot get automation extension

phenomenon

Today, I changed the default browser to chrome. As a result, an error was reported as soon as the script was run. The specific error message is as follows.

FAILED CONFIGURATION: @BeforeClass beforeClass
org.openqa.selenium.WebDriverException: unknown error: cannot get automation extension
from unknown error: page could not be found: chrome-extension://aapnijgdinlhnhlmodcfapnahmbfebeb/_generated_background_page.html
  (Session info: chrome=59.0.3071.115)
  (Driver info: chromedriver=2.27.440174 (e97a722caafc2d3a8b807ee115bfb307f7d2cfd9),platform=Windows NT 6.1.7601 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 10.12 seconds
Build info: version: '2.41.0', revision: '3192d8a6c4449dc285928ba024779344f5423c58', time: '2014-03-27 11:29:39'
System info: host: 'admin2-PC', ip: '10.2.16.2', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_17'
Session ID: a2cffef46bdbde6af4e7ec75998d2bd9
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{platform=XP, acceptSslCerts=true, javascriptEnabled=true, browserName=chrome, chrome={userDataDir=C:\MyTemp\scoped_dir6928_24278, chromedriverVersion=2.27.440174 (e97a722caafc2d3a8b807ee115bfb307f7d2cfd9)}, networkConnectionEnabled=false, unexpectedAlertBehaviour=, rotatable=false, locationContextEnabled=true, mobileEmulationEnabled=false, version=59.0.3071.115, pageLoadStrategy=normal, takesHeapSnapshot=true, databaseEnabled=false, cssSelectorsEnabled=true, handlesAlerts=true, browserConnectionEnabled=false, nativeEvents=true, webStorageEnabled=true, hasTouchScreen=false, applicationCacheEnabled=false, takesScreenshot=true}]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:193)
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:595)
    at org.openqa.selenium.remote.RemoteWebDriver$RemoteWebDriverOptions$RemoteWindow.maximize(RemoteWebDriver.java:825)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:108)
    at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:523)
    at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:224)
    at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:146)
    at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:166)
    at org.testng.internal.TestMethodWorker.run (TestMethodWorker.java: 105 )
    at org.testng.TestRunner.privateRun (TestRunner.java: 744 )
    at org.testng.TestRunner.run (TestRunner.java: 602 )
    at org.testng.SuiteRunner.runTest (SuiteRunner.java: 380 )
    at org.testng.SuiteRunner.runSequentially (SuiteRunner.java: 375 )
    at org.testng.SuiteRunner.privateRun (SuiteRunner.java: 340 )
    at org.testng.SuiteRunner.run (SuiteRunner.java: 289 )
    at org.testng.SuiteRunnerWorker.runSuite (SuiteRunnerWorker.java: 52 )
    at org.testng.SuiteRunnerWorker.run (SuiteRunnerWorker.java: 86 )
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1301)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1226)
    at org.testng.TestNG.runSuites(TestNG.java:1144)
    at org.testng.TestNG.run(TestNG.java:1115)
    at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:132)
    at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:230)
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:76)

 

After searching for a long time, I found out that my version of chromedriver.exe was too old, and it was fine after upgrading to the latest version. There is a small problem here. The version rule of Selenium is the major version number + the minor version number, so:

  • 2.1 is much earlier than 2.10
  • 2.9 is earlier than 2.10

The chronological order of each version, from newest to oldest, is:

  • 2.19>2.10>2.9>2.1
    http://selenium-release.storage.googleapis.com/index.html
  • Chrome Driver:
    http://chromedriver.storage.googleapis.com/index.html
  • PhantomJS Driver:
    http://phantomjs.org/download.html

[Maven] Pom.xml error: Cannot detect Web Project version.

The newly created maven project reports the following error:

1 Cannot detect Web Project version. Please specify version of Web Project through <version> configuration property of war plugin. Eg: <plugin> <artifactId>maven-
 2   war-plugin</artifactId> <configuration> <version> 3.0 </ version> </configuration> </plugin>

Just add the following code in the pom.xml file:

1   < build > 
2        < plugins > 
3            < plugin > 
4                < artifactId > maven-war-plugin </ artifactId > 
5                < configuration > 
6                    < version > 3.0 </ version > 
7                </ configuration > 
8            </ plugin > 
9        < / plugins > 
10    </ build >

The following situations may also occur:

After adding the following code to the pom.xml file, the error is not eliminated, and the corresponding place in the .setting folder has been set, then

Copy the pom.xml file in a good maven project and use it to replace the pom.xml file.

For example: the complete pom.xml file:

< project xmlns ="http://maven.apache.org/POM/4.0.0" xmlns:xsi ="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation ="http:/ /maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" > 
  < modelVersion > 4.0.0 </ modelVersion > 
  < groupId > com.agen. per </ groupId > 
  < artifactId > performance </ artifactId > 
  < version > 0.0.1-SNAPSHOT </ version >
  < packaging> war </ packaging > 
  < build > 
      < plugins > 
          < plugin > 
              < artifactId > maven-war-plugin </ artifactId > 
              < configuration > 
                  < version > 3.0 </ version > 
              </ configuration > 
          </ plugin > 
      </ plugins > 
  </ build >
  
      < properties > 
        < project .build.sourceEncoding > UTF-8 </ project.build.sourceEncoding > 
        < spring .version > 4.1.4.RELEASE </ spring.version > 
        < hibernate .version > 4.3.8.Final </ hibernate .version > 
    </ properties >
    
  < dependencies > 
      <!-- https://mvnrepository.com/artifact/javax.persistence/persistence-api --> 
    < dependency > 
        < groupId > javax.persistence </ groupId > 
        < artifactId > persistence-api </ artifactId > 
        < version > 1.0 </ version > 
    </ dependency > 
      <!-- Encryption operation --> 
        < dependency > 
            < groupId > commons-codec </ groupId> 
            < artifactId > commons-codec </ artifactId > 
            < version > 1.10 </ version > 
        </ dependency >
          
          <!-- https://mvnrepository.com/artifact/dom4j/dom4j --> 
        < dependency > 
            < groupId > dom4j </ groupId > 
            < artifactId > dom4j </ artifactId > 
            < version > 1.6.1 </ version > 
        < / dependency >

          
      <!-- WeChat Development Kit -->
        
        <!-- https://mvnrepository.com/artifact/com.github.binarywang/weixin-java-common --> 
        < dependency > 
            < groupId > com.github.binarywang </ groupId > 
            < artifactId > weixin-java- common </ artifactId > 
            < version > 2.2.0 </ version > 
        </ dependency > 
        <!-- https://mvnrepository.com/artifact/com.github.binarywang/weixin-java-mp --> 
        < dependency > 
            < groupId > com.github.binarywang</ groupId > 
            < artifactId > weixin-java-mp </ artifactId > 
            < version > 2.2.0 </ version > 
        </ dependency >
        
        <!-- https://mvnrepository.com/artifact/com.github.abj351r7/wechat-java-sdk --> 
        < dependency > 
            < groupId > com.github.abj351r7 </ groupId > 
            < artifactId > wechat-java- sdk </ artifactId > 
            < version > 1.0.1 </ version > 
        </ dependency >
        
        <!-- junit --> 
        < dependency > 
            < groupId > junit </ groupId > 
            < artifactId > junit </ artifactId > 
            < version > 4.12 </ version > 
            < scope > test </ scope > 
        </ dependency >

        <!-- https://mvnrepository.com/artifact/com.github.pagehelper/pagehelper --> 
        < dependency > 
            < groupId > com.github.pagehelper </ groupId > 
            < artifactId > pagehelper </ artifactId > 
            < version > 4.1.4 </ version > 
        </ dependency >
        
        <!-- spring --> 
        < dependency > 
            < groupId > org.springframework </ groupId > 
            < artifactId > spring-core </ artifactId > 
            < version > ${spring.version} </ version > 
        </ dependency >

        < dependency > 
            < groupId > org.springframework </ groupId > 
            < artifactId > spring-beans </ artifactId > 
            < version > ${spring.version} </ version > 
        </ dependency >

        < dependency > 
            < groupId > org.springframework </ groupId > 
            < artifactId > spring-context </ artifactId > 
            < version > ${spring.version} </ version > 
        </ dependency >

        < dependency > 
            < groupId > org.springframework </ groupId > 
            < artifactId > spring-tx </ artifactId > 
            < version > ${spring.version} </ version > 
        </ dependency >

        < dependency > 
            < groupId > org.springframework </ groupId > 
            < artifactId > spring-web </ artifactId > 
            < version > ${spring.version} </ version > 
        </ dependency >

        < dependency > 
            < groupId > org.springframework </ groupId > 
            < artifactId > spring-test </ artifactId > 
            < version > ${spring.version} </ version > 
            < scope > test </ scope > 
        </ dependency >

        <!-- Use SpringMVC to configure --> 
        < dependency > 
            < groupId > org.springframework </ groupId > 
            < artifactId > spring-webmvc </ artifactId > 
            < version > ${spring.version} </ version > 
        </ dependency > 
        <!-- spring cglib proxy --> 
        < dependency > 
            < groupId > cglib </ groupId > 
            < artifactId >cglib</ artifactId > 
            < version > 2.2.2 </ version > 
        </ dependency > 
        <!--When relational database integration requires configuration such as hibernate jpa, etc .--> 
        < dependency > 
            < groupId > org.springframework </ groupId > 
            < artifactId > spring-orm </ artifactId > 
            < version > ${spring.version} </ version > 
        </ dependency >

        <!-- hibernate --> 
        < dependency > 
            < groupId > org.hibernate </ groupId > 
            < artifactId > hibernate-core </ artifactId > 
            < version > ${hibernate.version} </ version > 
        </ dependency >

        < dependency > 
            < groupId > org.hibernate </ groupId > 
            < artifactId > hibernate-ehcache </ artifactId > 
            < version > ${hibernate.version} </ version > 
        </ dependency >

        <!-- Secondary cache ehcache --> 
        < dependency > 
            < groupId > net.sf.ehcache </ groupId > 
            < artifactId > ehcache </ artifactId > 
            < version > 2.9.0 </ version > 
        </ dependency >

        <!-- log4j --> 
        < dependency > 
            < groupId > log4j </ groupId > 
            < artifactId > log4j </ artifactId > 
            < version > 1.2.17 </ version > 
        </ dependency >

        <!-- mysql connection --> 
        < dependency > 
            < groupId > mysql </ groupId > 
            < artifactId > mysql-connector-java </ artifactId > 
            < version > 5.1.34 </ version > 
        </ dependency >

        <!-- c3p0 data source --> 
        < dependency > 
            < groupId > com.mchange </ groupId > 
            < artifactId > c3p0 </ artifactId > 
            < version > 0.9.5-pre10 </ version > 
        </ dependency >

        <!-- json -->

        <!-- No. 1 --> 
        < dependency > 
            < groupId > com.fasterxml.jackson.core </ groupId > 
            < artifactId > jackson-core </ artifactId > 
            < version > 2.8.1 </ version > 
        </ dependency > 
        <!-- No. 2 --> 
        < dependency > 
            < groupId > com.fasterxml.jackson.core </ groupId > 
            < artifactId >jackson-annotations</ artifactId > 
            < version > 2.8.1 </ version > 
        </ dependency >

        <!-- No. 3 --> 
        < dependency > 
            < groupId > com.fasterxml.jackson.core </ groupId > 
            < artifactId > jackson-databind </ artifactId > 
            < version > 2.8.1 </ version > 
            < exclusions > 
                < exclusion > 
                    < artifactId > jackson-core </ artifactId > 
                    < groupId > com.fasterxml.jackson.core </ groupId >
                </ exclusion > 
                < exclusion > 
                    < artifactId > jackson-annotations </ artifactId > 
                    < groupId > com.fasterxml.jackson.core </ groupId > 
                </ exclusion > 
            </ exclusions > 
        </ dependency >

        <!-- No. 4 --> 
        < dependency > 
            < groupId > com.google.code.gson </ groupId > 
            < artifactId > gson </ artifactId > 
            < version > 2.7 </ version > 
        </ dependency > 
        <!-- No. 5 --> 
        < dependency > 
            < groupId > net.sf.json-lib </ groupId > 
            < artifactId > json-lib </ artifactId> 
            < version > 2.4 </ version > 
            < classifier > jdk15 </ classifier > 
        </ dependency > 
        <!-- No. 5 json-lib also needs the following dependency packages --> 
        < dependency > 
            < groupId > commons-lang </ groupId > 
            < artifactId > commons-lang </ artifactId > 
            < version > 2.5 </ version > 
        </ dependency >
        <dependency > 
            < groupId > commons-beanutils </ groupId > 
            < artifactId > commons-beanutils </ artifactId > 
            < version > 1.9.2 </ version > 
        </ dependency > 
        < dependency > 
            < groupId > commons-collections </ groupId > 
            < artifactId > commons-collections </ artifactId > 
            < version >3.2.1 </version > 
        </ dependency > 
        < dependency > 
            < groupId > commons-logging </ groupId > 
            < artifactId > commons-logging </ artifactId > 
            < version > 1.2 </ version > 
        </ dependency >
        
        <!-- aop --> 
        < dependency > 
            < groupId > org.aspectj </ groupId > 
            < artifactId > aspectjweaver </ artifactId > 
            < version > 1.8.4 </ version > 
        </ dependency >

        <!-- servlet --> 
        < dependency > 
            < groupId > javax.servlet </ groupId > 
            < artifactId > servlet-api </ artifactId > 
            < version > 3.0-alpha-1 </ version > 
            < scope > provided </ scope > 
        </ dependency >

        < dependency > 
            < groupId > javax.servlet </ groupId > 
            < artifactId > jstl </ artifactId > 
            < version > 1.2 </ version > 
        </ dependency > 
        <!-- Merge operation of guava collection -->         
        < dependency > 
            < groupId > com.google.guava </ groupId > 
            < artifactId > guava </ artifactId > 
            <version> 19.0 </ version > 
        </ dependency > 
        < dependency > 
            < groupId > com.google.guava </ groupId > 
            < artifactId > guava-collections </ artifactId > 
            < version > r03 </ version > 
        </ dependency >
        
        <!-- File upload --> 
        < dependency > 
            < groupId > commons-fileupload </ groupId > 
            < artifactId > commons-fileupload </ artifactId > 
            < version > 1.3.1 </ version > 
        </ dependency >

  </ dependencies > 
</ project >

Dyf Spring boot startup error: NoSuchBeanDefinitionException

When starting springboot, autowired automatically injects an error,

2017-05-26 15:23:05.761  WARN 46372 --- [           main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'mongoTest': Unsatisfied dependency expressed through field 'mongoDaoTest'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'mongo.MongoDaoTest' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
2017-05-26 15:23:05.764  INFO 46372 --- [           main] o.apache.catalina.core.StandardService   : Stopping service Tomcat
2017-05-26 15:23:05.789  INFO 46372 --- [           main] utoConfigurationReportLoggingInitializer : 

Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2017-05-26 15:23:05.891 ERROR 46372 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

Field mongoDaoTest in mongo.MongoTest required a bean of type 'mongo.MongoDaoTest' that could not be found.


Action:

Consider defining a bean of type 'mongo.MongoDaoTest' in your configuration.

 

Will prompt injection failure, you can try to replace @EnableAutoConfiguration annotation with @SpringBootApplication;

@SpringBootApplication annotation effect is equivalent to @Configuration, @EnableAutoConfiguration and @ComponentScan these three annotations are used together, so do not add @EnableAutoConfiguration to the Controller 

Crop the cropper image .toBlob() error: $(“#image”).cropper(‘getCroppedCanvas’).toBlob( function (blob){})

Problem Description:

  When cropping images using cropper.js, call the toBlob() method to report an error

$("#image").cropper('getCroppedCanvas').toBlob( function (blob){})

  Error message:

Uncaught TypeError: $(…).cropper(…).toBlob is not a function

 

Solution:

    /* Use binary method to process dataUrl */ 
    function processData(dataUrl) {
         var binaryString = window.atob(dataUrl.split(',')[1 ]);
         var arrayBuffer = new ArrayBuffer(binaryString.length);
         var intArray = new Uint8Array(arrayBuffer);
         for ( var i = 0, j = binaryString.length; i <j; i++ ) {
            intArray[i] = binaryString.charCodeAt(i);
        }

        var data = [intArray],
            blob;

        try {
            blob = new Blob(data);
        } catch (e) {
            window.BlobBuilder = window.BlobBuilder || 
                window.WebKitBlobBuilder || 
                window.MozBlobBuilder ||
                window.MSBlobBuilder;
            if (e.name ==='TypeError' && window.BlobBuilder) {
                 var builder = new BlobBuilder();
                builder.append(arrayBuffer);
                blob = builder.getBlob(imgType); // imgType is the upload file type, that is, file.type 
            } else {
                console.log( 'The version is too low to support uploading pictures' );
            }
        }
        return blob;
    }

Finally call the code:

    $('#cutBtn').click( function () {
         var data = $('#image').cropper('getCroppedCanvas' , {
                width: 300, // length and width after cropping 
                height: 300
            }),
            blob = processData(data.toDataURL());

        var formData = new FormData();
        formData.append( 'uploadImg' , blob);
        $.ajax({
            url: '/path/to/upload' ,
            method: "POST" ,
            data: formData,
            processData: false ,
            contentType: false ,
            success: function () {
                console.log( 'Upload success' );
            },
            error: function () {
                console.log( 'Upload error' );
            }
        });
    });

cropper.js usage documentation 

https://github.com/fengyuanchen/cropperjs/blob/master/README.md

Git under Windows reports an error: warning: LF will be replaced by CRLF in ××××.××

 

Git under Windows reports an error:

warning: LF will be replaced by CRLF in ××××.××(file name)
The file will have its original line ending in your working directory.

translation:
LF will be replaced by CRLF in the xxx.xx file.
In the working directory, this file will keep its original newline character. (Line ending: end of line, newline)

 annotation:

          LF: Line feed wrap

          CRLF: Carriage Return Line Feed Carriage Return Line Feed

 

1. Under different operating systems, the methods of handling end-of-line characters are different :

  Windows: CRLF (representing two characters with carriage return and line feed at the end of the sentence, that is, “\r\n” line feed under windows)

       Under unix: LF (represents the end of a sentence, only use line breaks)

       Mac: CR (represents only carriage return)

2. Handling “line ending” under Git

  core.autocrlf is the variable responsible for processing line ending in git. You can set 3 values: true, false, and inout.

(1) Set to true [config –global core.autocrlf  true ]

          When set to true, it means that whenever you add a file to the git repository, git will treat it as a text file.

   It will turn crlf into LF.

(2) Set to false [config –global core.autocrlf  false ]

     When set to false, line endings will not be converted. The text file remains as it is.

(3) When set to input, when adding a file git warehouse, git programs crlf to lf. When someone checks the code, it is still the lf way. Therefore, do not use this setting under the window operating system.

 


 

In summary, the reasons for the above warning are:

  The line break in windows is CRLF, and the line break in Linux is LF (using the Git command line Git Bash, which is actually equivalent to the linux environment), so this error message will appear when you execute the git add xxx.xx operation!

Solution: (Note: The warehouse will be deleted! The warehouse will be deleted! The warehouse will be deleted!)

  <1>Delete .git 【rm -rf .git

  <2>Disable automatic conversion, and set it soon: git config –global core.autocrlf  false

         Re-initialize and perform the add operation:

  <3>【git init

  <4> 【git add xxx.xx

Regarding Pyhton regular error: sre_constants.error: nothing to repeat at position

Wrong regular expression

1. \b followed by the quantity

Wrongly written \d to \b, embarrassing!

1
>>> pattern = re.compile(r'123\b*hello')

Output:

Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "E:\Anacoda3\Lib\re.py", line 233, in compile
    return _compile(pattern, flags)
  File "E:\Anacoda3\Lib\re.py", line 301, in _compile
    p = sre_compile.compile(pattern, flags)
  File "E:\Anacoda3\Lib\sre_compile.py", line 562, in compile
    p = sre_parse.parse(p, flags)
  File "E:\Anacoda3\Lib\sre_parse.py", line 856, in parse
    p = _parse_sub(source, pattern, flags & SRE_FLAG_VERBOSE, False)
  File "E:\Anacoda3\Lib\sre_parse.py", line 415, in _parse_sub
    itemsappend(_parse(source, state, verbose))
  File "E:\Anacoda3\Lib\sre_parse.py", line 615, in _parse
    source.tell() - here + len(this))
sre_constants.error: nothing to repeat at position 2

Reason for error: Since \b is a word boundary, * means that it appears any number of times, that is, a word can only have one boundary, and it cannot appear any number of times, so this error will be reported