Tag Archives: test

[Solved] error {dataSource-1} init error java.sql.SQLException: com.mysql.cj.jdbc.Driver

error {dataSource-1} init error java.sql.SQLException: com.mysql.cj.jdbc.Driver

July 08, 2019 2:39:14 PM com.alibaba.druid.pool.DruidDataSource error
WARNING:error {dataSource-1} init error java.sql.SQLException: com.mysql.cj.jdbc.Driver
	at com.alibaba.druid.util.JdbcUtils.createDriver(JdbcUtils.java:520)
	at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:583)
	at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:915)
	at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:911)
	at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:98)
	at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:151)
	at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:115)
	at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:78)
	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:598)
	at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:655)
	at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:686)
	at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:698)
	at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:776)
	at edu.haizi.dao.UserDao.login(UserDao.java:17)
	at edu.haizi.test.UserDaoTest.testLogin(UserDaoTest.java:15)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
	at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: java.lang.ClassNotFoundException: com.mysql.cj.jdbc.Driver
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:264)
	at com.alibaba.druid.util.JdbcUtils.createDriver(JdbcUtils.java:518)
	... 36 more

July 08, 2019 2:39:14 PM com.alibaba.druid.pool.DruidDataSource info
MESSAGES:{dataSource-1} inited

org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: com.mysql.cj.jdbc.Driver

	at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:81)
	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:598)
	at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:655)
	at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:686)
	at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:698)
	at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:776)
	at edu.haizi.dao.UserDao.login(UserDao.java:17)
	at edu.haizi.test.UserDaoTest.testLogin(UserDaoTest.java:15)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
	at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: java.sql.SQLException: com.mysql.cj.jdbc.Driver
	at com.alibaba.druid.util.JdbcUtils.createDriver(JdbcUtils.java:520)
	at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:583)
	at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:915)
	at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:911)
	at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:98)
	at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:151)
	at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:115)
	at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:78)
	... 29 more
Caused by: java.lang.ClassNotFoundException: com.mysql.cj.jdbc.Driver
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:264)
	at com.alibaba.druid.util.JdbcUtils.createDriver(JdbcUtils.java:518)
	... 36 more


Process finished with exit code -1

Solution: the version of MySQL under windows is higher than idea, which makes the version incompatible

Modify Maven dependency package

Original version 5.1.9

<dependency>
      <groupId>mysql</groupId>
      <artifactId>mysql-connector-java</artifactId>
      <version>5.1.9</version>
    </dependency>

Modify to a later version

<dependency>
      <groupId>mysql</groupId>
      <artifactId>mysql-connector-java</artifactId>
      <version>8.0.28</version>
    </dependency>

[Solved] Error updating database. Cause: java.sql.SQLException: Incorrect integer value: ‘**‘ for column

### Error updating database. Cause: java.sql.SQLException: Incorrect integer value: ‘**‘ for column

Type Exception Report

Message Request processing failed; nested exception is org.apache.ibatis.exceptions.PersistenceException:

Description The server encountered an unexpected condition that prevented it from completing the request.

Exceptions

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.apache.ibatis.exceptions.PersistenceException: 
### Error updating database.  Cause: java.sql.SQLException: Incorrect integer value: '刘文' for column 'name' at row 1
### The error may exist in com/bjpowernode/dao/StudentDao.xml
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: insert into student(name,age) values(?,?)
### Cause: java.sql.SQLException: Incorrect integer value: '刘文' for column 'name' at row 1
	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1014)
	org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:652)
	org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)


org.apache.ibatis.exceptions.PersistenceException: 
### Error updating database.  Cause: java.sql.SQLException: Incorrect integer value: '刘文' for column 'name' at row 1
### The error may exist in com/bjpowernode/dao/StudentDao.xml
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: insert into student(name,age) values(?,?)
### Cause: java.sql.SQLException: Incorrect integer value: '刘文' for column 'name' at row 1
	org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
	org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:199)
	org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:184)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	java.lang.reflect.Method.invoke(Method.java:498)
	org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:433)
	com.sun.proxy.$Proxy14.insert(Unknown Source)
	org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:278)
	org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:62)
	org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:58)
	com.sun.proxy.$Proxy15.insertStudent(Unknown Source)
	com.bjpowernode.service.impl.StudentServiceImpl.addStudent(StudentServiceImpl.java:19)
	com.bjpowernode.controller.StudentController.addStudent(StudentController.java:26)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	java.lang.reflect.Method.invoke(Method.java:498)
	org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)
	org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)
	org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105)
	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:879)
	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:793)
	org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
	org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040)
	org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943)
	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
	org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:652)
	org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)


java.sql.SQLException: Incorrect integer value: '刘文' for column 'name' at row 1
	com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
	com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
	com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953)
	com.mysql.cj.jdbc.ClientPreparedStatement.execute(ClientPreparedStatement.java:371)
	com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:498)
	org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:47)
	org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:74)
	org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:50)
	org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117)
	org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76)
	org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:197)
	org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:184)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	java.lang.reflect.Method.invoke(Method.java:498)
	org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:433)
	com.sun.proxy.$Proxy14.insert(Unknown Source)
	org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:278)
	org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:62)
	org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:58)
	com.sun.proxy.$Proxy15.insertStudent(Unknown Source)
	com.bjpowernode.service.impl.StudentServiceImpl.addStudent(StudentServiceImpl.java:19)
	com.bjpowernode.controller.StudentController.addStudent(StudentController.java:26)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	java.lang.reflect.Method.invoke(Method.java:498)
	org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)
	org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)
	org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105)
	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:879)
	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:793)
	org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
	org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040)
	org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943)
	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
	org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:652)
	org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
):Note that the full stack information for the main issue can be viewed in the server logs

 

Solution:

The reason is that I mistakenly wrote the name type as int type. Open navicate to find the created table, right-click to find the design table, and change the name type to varchar

 

[Solved] Error: Failure while executing; `tar –extract –no-same-owner –file /Users/wangchuangyan/Library/C

Mac run brew install npm error:
Error: Failure while executing; tar --extract --no-same-owner --file /Users/wangchuangyan/Library/Caches/Homebrew/downloads/01840f175b09e7eb3d4ca7f11492bb1bee74fa7569a41a884c7ffb3418e11a02--libuv-1.41.0.catalina.bottle.tar.gz --directory /private/tmp/d20210708-6134-w2f3oo exited with

1. Here’s the output:
tar: Error opening archive: Failed to open ‘/Users/wangchuangyan/Library/Caches/Homebrew/downloads/01840f175b09e7eb3d4ca7f11492bb1bee74fa7569a41a884c7ffb3418e11a02–libuv-1.41.0.catalina.bottle.tar.gz’
It means that the libuv file cannot be opened
Solution: manually install brew install libuv

A little bug of CSDN blog

Recently, when editing the blog, I found a small flaw in CSDN, which should not be a bug, but if I don’t pay attention, it may also bring a lot of trouble to users.

Hyperlinks are sometimes used when editing blogs. When adding hyperlinks, the interface of CSDN is as follows:

Users can enter their own link address in the link address column, but please note that the “http://” field is selected by default, that is, if you copy a link address and want to paste it into this column, you will erase the “http://” field, leaving only your own pasted address.

And in practice, the probability is very high.

What’s the difference between HTTP and no HTTP?

From the perspective of users, they don’t want to make a difference, but in practice, there is a big difference between HTTP and no http.

There is no HTTP at the beginning. The browser will treat the link as a relative address by default, that is, the address relative to the current address“ blog.csdn.net/waitig1992/article/details/ ”Add the address you entered after this address.

But most users don’t want this result. They just want the browser to jump to the link they input, which leads to the lack of user experience.

Some people will say: those who publish articles on CSDN are all technical giants. They should know these problems and can avoid them by themselves. They can modify them by themselves.

But all things can’t be solved by users themselves. Moreover, with the fierce competition, some small details may determine the success or failure of the enterprise.

And not everyone has noticed.

On the contrary, baidu space noticed this detail, its hyperlink input box does not have “http://”, but automatically detects changes after users edit. As shown in the figure:

After editing, it will automatically detect and modify, and add “http://”, as shown in the figure:

In this way, users don’t have to care whether they write “http://”, but can focus more on their own articles.

That’s the details.

Appendix:

This link has “http://” blog.csdn.net/waitig1992

There is no http:// blog.csdn.net/waitig1992

You can click to see the difference;

I hope CSDN official can pay attention to this problem, and I will also send email feedback.

Finally, I wish CSDN more and more fire, you can all think of it!

[error] error handling of IntelliJ idea

ClassNotFoundExceptionEmpty test suitejavalangNoClassDefFoundError


ClassNotFoundException

Error report:
once IntelliJ idea is running, it will report an error, and no class can be found
in the system java.lang.ClassNotFoundException

Solution:
open project structures (ALT + Ctrl + Shift + s) to check whether the directory set by project – out and module – path – out exists.
Generally, the module – path – out is set under the target directory, but if there is no target directory at the first run, it must be generated by Maven build, so either change the out path or run Maven build first.


Empty test suite

Error:
JUnit running times cannot find the test group
process finished with exit code 1
class not found:“ XXX.XXXTest ”Empty test suite.

Solution:
Run Maven test and download relevant jar packages

java.lang.NoClassDefFoundError

Error:
minaserver logger – & gt; error{ ContextLoader.java:336 }-Context initialization failed java.lang.NoClassDefFoundError : Lcom/cebbank/gage/dao/UserDao;

Solution:
if you want to change the project name, remember to delete all the configuration files (. IML,. Idea, etc.) and leave only the folder and folder of the project code pom.xml File, and then re import the Maven project.

Mysql start slave error 1201 (HY000)

After MySQL replication is configured, an error is reported when starting slave as follows:

mysql> start slave;
ERROR 1201 (HY000): Could not initialize master info structure; more error messages can be found in the MySQL error log
mysql>

Looking for it on the Internet, it turns out that there are two files to delete. It is estimated that it was generated yesterday when other people failed in the test.

/var/lib/mysql/ master.info
/var/lib/mysql/relay- log.info

Just delete it.

mysql> start slave;
Query OK, 0 rows affected (0.01 sec)

mysql>

Refer to the following documents:

http://blog.sina.com.cn/s/blog_ 51d3553f0100j5m2.html

Solve the previous one bean.xml “Error while downloading” in < bean > tag http://www.springframework.org/schema/beans/sprin…

In the XML file, the error in the header is as follows

At the beginning of the query, it was said that “& lt;?XML version =” 1.0 “encoding =” UTF-8 “?& gt;” was missing in the header, but I didn’t have this problem, which may be encountered by someone.

And this error does not affect the operation of the project, of course, it may be that I did not notice or did not write the relevant reference code.

Now I know that the original reason is that the tool is relatively new and may lack tags. Just add the & lt; XML body & gt; tag

That’s good

 

Reproduced in: https://www.cnblogs.com/zhangyuanbo/p/11250563.html

[mybatis] error: malformed ognl expression: name! = null and name! = ‘”

1、 Questions

Malformed ognl expression: name! = null and name! = ‘
report an error;
malformed means abnormal;

2、 Solutions and reasons

It turned out to be* Mapper.xml In the document:

<if test ="userId ! null">

The equals sign is missing; the SQL in the automatically generated mybatis file is missing an equals sign

<if test ="userId != null">

Moreover, there should be no space between exclamation mark and equal sign;

The problem that the content extra data in the notification cannot be updated

Recently younger brother when writing a find out about the background data processing service within the PendingIntent NotificationManager to send the Notification of the Intent of the Extra data cannot update, unable to get even, after tests found that the same ID Notification first Intent can only be stored data, even if use the NotificationManager. Cancel also of no help.
Found after examined the related API, use the PendingIntent. GetActivity (mContext, 0, mActivity, 0); After the Notification is opened, the target Activity cannot retrieve any additional data from getIntent(). Set the flag of the getActivity function to either pendingintent.flag_update_current or pendingintent.flag_cancel_current according to the API.
Also put a PendingIntent, getActivity function can be used in several flag value meaning:

0:

Default value, if the described PendingIntent already exists, then keep it without change.

FLAG_CANCEL_CURRENT:

For use with a Flag with the getActivity (Context, int, Intent, int) , getBroadcast (Context, int, Intent, int) , and getService (Context, int, Intent, int) : if the described PendingIntent already exists, the current one is canceled before generating a new one. You can use this to retrieve a new PendingIntent when you are only changing the extra data in the Intent; By canceling the previous pending intent, this ensures that only entities given the new data will be able to launch it. If this assurance is not an issue, consider FLAT_Update_current

Constant Value: 268435456 (0 x10000000)

FLAG_NO_CREATE:

For use with a Flag with the getActivity (Context, int, Intent, int) , getBroadcast (Context, int, Intent, int) , and getService (Context, int, Intent, int) : if the described PendingIntent does not already exist, then simply return null instead of creating it.

Constant Value: 536870912 (0 x20000000)

FLAG_ONE_SHOT:

For use with a Flag with the getActivity (Context, int, Intent, int) , getBroadcast (Context, int, Intent, int) , and getService (Context, int, Intent, int) : This PendingIntent can only be used once. If set, after send()

FLAG_UPDATE_CURRENT:

For use with a Flag with the getActivity (Context, int, Intent, int) , getBroadcast (Context, int, Intent, int) , and getService (Context, int, Intent, int) : if the described PendingIntent already exists, then keep it but its replace its extra data with what is in this new Intent. This can be used if you are creating intents where only the extras change, and don't care that any entities that received your previous PendingIntent will be able to launch it with your new extras even if they are not explicitly given to it.

Constant Value: 134217728 (0 x08000000)

In Linux shell script, about the commonly used flag [- EQ, GT..] in test and if judgment

1. Determine the “document type” of a document, such as test-e filename whether it exists or not

-e Whether the “Document” exists (commonly used)

-f whether the “Document” exists and is a file (commonly used)

-d whether this “document” exists and is a directory (commonly used)

-b Whether the Document exists and is a Block Device

-c Whether this Document exists and is a Character Device

-s whether this “document” exists and is a Socket file

-p Whether the “Document” exists and is a FIFO (PIPE) file

-l Whether the Document exists and is a link file


-r checks if the document exists and has “readable” permissions

-w checks if the document exists and has the permission to be writable

-x checks if the document exists and has “executable” permissions

-u checks if the document name exists and has the property “SUID”

-g checks if the document name exists and has the attribute “SGID”

-k checks if the document name exists and has a “Sticky bit” property

-s checks if the document exists and is a “non-blank file”

>
>
>
>
>
>
>
>

-nt (newer than) determines whether file1 is newer than file2

-ot (older than) determines whether file1 is older than file2

-ef determines whether file1 and file2 are the same file, which can be used to determine the hard link. The key is to determine if both files point to the same inode

4. About the comparison between two integers, for example test n1 -eq n2

-Eq equals two values.

-Ne is not equal.

-gt n1 is greater than n2 (greater than)

-lt n1 is less than n2 (less than)

-e e n1 is greater than or equal to n2 (greater than or equal)

-le n1 is less than or equal to n2.

5

The test-z string determines if the string is empty and returns true for empty

Test-n string determines that the string is not null and returns false for null

= test -r filename -a-x filename
= test -r filename -a-x filename

– A (and) is both true! Test-r file-a-x file = test-r file-a-x file = test-r file-a-x file = test-r file-a-x file = test-r file-a-x file = test-r file-a-x file = test-r file-a-x file

-O (OR) Either is true! Test-r file-o-x file = test-r file-o-x file = test-r file-o-x file = test-r file-o-x file = test-r file-o-x file = test-r file-o-x file = test-r file-o-x file

! Inverse state, such as test! -x file. Returns true if file does not have x