Summary of issues arising from ssm addition, deletion, modification, and query, and ssm addition, deletion, and modification
1.org. springframework. beans. factory. beanCreationException: Error creating bean with name 'org. mybatis. spring. mapper. mapperScannerConfigurer # 0' defined in class path resource [applicationContext. xml]: Initialization of bean failed; nested exception is org. springframework. beans. conversionNotSupportedException: Failed to convert property value of type [java. lang. string] to required type [org. apache. ibatis. session. sqlSessionFactory] for property 'sqlsessionfactory '; nested exception is java. lang. illegalStateException: Cannot convert value of type [java. lang. string] to required type [org. apache. ibatis. session. sqlSessionFactory] for property 'sqlsessionfactory ': no matching editors or conversion strategy found
Caused by: org. springframework. beans. conversionNotSupportedException: Failed to convert property value of type [java. lang. string] to required type [org. apache. ibatis. session. sqlSessionFactory] for property 'sqlsessionfactory '; nested exception is java. lang. illegalStateException: Cannot convert value of type [java. lang. string] to required type [org. apache. ibatis. session. sqlSessionFactory] for property 'sqlsessionfactory ': no matching editors or conversion strategy found
Caused by: java. lang. illegalStateException: Cannot convert value of type [java. lang. string] to required type [org. apache. ibatis. session. sqlSessionFactory] for property 'sqlsessionfactory ': no matching editors or conversion strategy found
Possible causes: 1) @ RequestMapping (value = "/userlogin", method = RequestMethod. POST)
2) <! -- Configure the ing interface --> property name = "sqlSessionFactoryBeanName"
2.org.apache.ibatis.exe cutor. executorException: A query was run and no Result Maps were found for the Mapped Statement 'com. blog. mapper. blogMapper. findAllBlog '. it's likely that neither a Result Type nor a Result Map was specified.
Solution: Check the configuration file of mybatis and find that the resultType attribute is missing.
The error message is as follows: <select id = "ID" parameterType = "java. util. Map">
The correct configuration should be <select id = "ID" parameterType = "java. util. Map" resultType = "java. util. Map">
In conclusion, all queries in mybatis must return the value of resultType or resultMap. Otherwise, the above error is reported.
3. java. lang. NullPointerException
At com. blog. service. impl. BlogServiceImpl. findAllBlog (BlogServiceImpl. java: 31)
At com. blog. controller. BlogController. findAllBlog (BlogController. java: 27)
Solution: a null pointer exception occurs. The dependency may not be determined. Check whether @ Autowired is added to the property.
4. java. lang. IllegalArgumentException: Invalid character found in method name. HTTP method names must be tokens
Severe: Servlet. service () for servlet [springmvc] in context with path [/blog] threw exception [Request processing failed; nested exception is org. mybatis. spring. myBatisSystemException: nested exception is org. apache. ibatis. binding. bindingException: Parameter 'username' not found. available parameters are [arg1, arg0, param1, param2] with root cause
Org. apache. ibatis. binding. BindingException: Parameter 'username' not found. Available parameters are [arg1, arg0, param1, param2]
Solution: the query parameters are not specified. For example, to query User find (String username, String password) based on the User name and password, write it as // to query the User name and password.
User find (@ Param ("username") String username, @ Param ("password") String password );
5. java. lang. NoSuchMethodException: com. opensymphony. xwork2.ActionSupport. login ()
Solution: dependency in applicationContext. xml is not injected.
6. Caused by: java. lang. IllegalArgumentException: 'sessionfactory 'or 'hibernatetemplate' is required
Solution: The dependency dao in applicationContext. xml does not contain the master sessionFactory.
7. Caused by: Action class [userAction] not found-action
Solution: in fact, the lack of package struts2-sping-plugin 2.0.1.jar
8. When using the c3p0 data source, the following database attributes are: driverClass, jdbcUrl, user, password
When using the springjdbc data source, the following database attributes are: driverClassName, url, username, password