SSH integration exception solution reference

Source: Internet
Author: User

(In my recent project, I had a hard time reporting errors, so I went online and shared my mistakes with you)

1.
Org. hibernate. Id. identifiergenerationexception: IDs for this class must be manually assigned before calling save ():
Cause: the <ID> element configuration is incorrect. The <ID> element lacks the configuration of its child element <generator> </generator>. Solution: The <ID> element maps the primary key field of the corresponding database table, and <generator class = "">, the value of class can be increment, identity, sequence, Hilo, native ...... generally, the value is native.
2.
Java. Lang. illegalargumentexception: ID to load is required for loading
Solution: users user = (users) This. gethibernatetemplate (). Get (users. Class, ID); this method cannot be used if the user name is used as a parameter.
3.
Org. springframework. Dao. invaliddataaccessresourceusageexception: cocould not execute query; Nested exception is org. hibernate. Exception. sqlgrammarexception: cocould not execute Query
Solution: SQL statement errors
4.
Severe: Error starting static Resources
Java. Lang. illegalargumentexception: document base d:/program files/Apache Software Foundation/tomcat 5.0/webapps/tomcat-docs does not exist or is not a readable directory
Severe: Error in resourcestart ()
23:32:25 org. Apache. Catalina. Core. standardcontext start
Severe: Error getconfigured
23:32:25 org. Apache. Catalina. Core. standardcontext start
Severe: context startup failed due to previous errors
23:32:25 org. Apache. Catalina. Core. standardcontext start
Severe: exception during cleanup after start failed
Lifecycleexception: Container standardcontext [/tomcat-docs] has not been started
5. JSF + spring + hibernate
Severe: exception sending context initialized event to listener instance of class org. springframework. Web. Context. contextloaderlistener
Org. springframework. beans. factory. beancreationexception: Error creating bean with name 'datasource 'defined in servletcontext resource [/WEB-INF/applicationcontext. XML]: instantiation of bean failed; Nested exception is Java. lang. noclassdeffounderror: ORG/Apache/commons/pool/impl/genericobjectpool
Caused by: Java. Lang. noclassdeffounderror: ORG/Apache/commons/pool/impl/genericobjectpool
Severe: Error listenerstart
2007-6-8 10:31:55 org. Apache. Catalina. Core. standardcontext start
Severe: context [/shj01] startup failed due to previous errors
2007-6-8 10:31:55 org. Apache. Catalina. Core. applicationcontext log
Scheme: commons-collections.jar commons-dbcp.jar commons-pool.jar under spring-framework-2.0.5/lib/Jakarta-commons loaded to the Project
6.
Severe: exception sending context initialized event to listener instance of class com. Sun. Faces. config. configurelistener
Javax. faces. facesexception: Can't parse configuration file: jar: file:/E: /tools/Apache-Tomcat-6.0.9/Apache-Tomcat-6.0.9/webapps/jsf02/WEB-INF/lib/jsf-impl.jar! /COM/sun/ faces/standard-html-renderkit.xml
Solution: change the location of the tomcat installation file.
7. Spring MVC + hibernate
Severe: standardwrapper. throwable
Org. springframework. beans. factory. beancreationexception: Error creating bean with name 'sessionfactory 'defined in servletcontext resource [/WEB-INF/applicationcontext. XML]: Invocation of init method failed; Nested exception is Java. lang. nosuchmethoderror: Org. objectweb. ASM. classvisitor. visit (iiljava/lang/string; ljava/lang/string; [ljava/lang/string;) V
Caused by: Java. lang. nosuchmethoderror: Org. objectweb. ASM. classvisitor. visit (iiljava/lang/string; ljava/lang/string; [ljava/lang/string;) V
Solution:
These libraries are used in Spring AOP programming:
Asm-2.2.2.jar
Asm-commons-2.2.2.jar
Asm-util-2.2.2.jar
If hibernate uses Lib:
ASM. Jar
Asm-attrs.jar
The asm-2.2.2.jar and ASM. jar have a class conflict !!!
If either of them is used, the following error may occur:
Java. Lang. noclassdeffounderror: ORG/objectweb/ASM/codevisitor
Java. Lang. noclassdeffounderror: ORG/objectweb/ASM/commons/emptyvisitor
Java. Lang. nosuchmethoderror: org. objectweb. ASM. classvisitor. visit ......
Solution:
1. Remove the three lib related to hibernate from the class path.
ASM. Jar
Asm-attrs.jar
Cglib-2.1.3.jar
2. Add the following four libraries in spring
Asm-2.2.2.jar
Asm-commons-2.2.2.jar
Asm-util-2.2.2.jar
Cglib-nodep-2.1_3.jar
8. Spring MVC + hibernate
Exception in thread "Main" org. springframework. Dao. invaliddataaccessresourceusageexception: cocould not execute JDBC batch update; Nested exception is org. hibernate. Exception. sqlgrammarexception: cocould not execute JDBC batch update
Caused by: org. hibernate. Exception. sqlgrammarexception: cocould not execute JDBC batch update
9.
Org. springframework. beans. factory. cannotloadbeanclassexception: error loading class [Org. springframework. transaction. interceptor. transactionproxyfactorybean] for bean with name 'userservice' defined in servletcontext resource [/WEB-INF/applicationcontext. XML]: Problem with class file or dependent class; Nested exception is Java. lang. noclassdeffounderror: ORG/springframework/AOP/framework/abstractsingletonproxyfactorybean
Caused by: Java. Lang. noclassdeffounderror: ORG/springframework/AOP/framework/abstractsingletonproxyfactorybean
Solution: without spring 2.0 AOP Libraries
10.
Org. Apache. Jasper. jasperexception: Unable to compile class for JSP:
Solution: the Java code in the JSP webpage is faulty.
11.
Exception in thread "Main" org. springframework. beans. factory. beancreationexception: Error creating bean with name 'companycontroller' defined in class path resource [COM/Company/test/company-config.xml]: Error setting property values; Nested exception is Org. springframework. beans. notwritablepropertyexception: Invalid property 'methodnameresolver 'of Bean class [COM. company. action. companycontroller] : Bean property 'methodnameresolver 'is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
Caused by: Org. springframework. beans. notwritablepropertyexception: Invalid property 'methodnameresolver 'of Bean class [COM. company. action. companycontroller]: bean property 'methodnameresolver 'isnot writable or has an invalid setter method. does the parameter type of the setter match the return type of the getter?

The controller does not inherit the multiactioncontroller.

12.

Exception in thread "Main" org. springframework. beans. factory. beancreationexception: Error creating bean with name 'turdiffservice' defined in class path resource [COM/expert/test/expert-config.xml]: Error setting property values; Nested exception is Org. springframework. beans. notwritablepropertyexception: Invalid property 'turdifficultdao 'of Bean class [COM. expert. operation. impl. turdiffserimpl]: Be An Property 'turdifficultdao 'is not writable or has an invalid setter method. Did you mean 'trudifficultdao '?
Caused by: Org. springframework. beans. notwritablepropertyexception: Invalid property 'turdifficultdao 'of Bean class [COM. expert. operation. impl. turdiffserimpl]: bean property 'turdifficultdao 'is not writable or has an invalid setter method. did you mean 'trudifficultdao '?
Cause:
When defining turdifficultdao, I wrote an error with a letter and found the error. It was changed, but I didn't change the corresponding one in the get () Set () method.

13.

Exception in thread "Main" org. springframework. beans. factory. beancreationexception: Error creating bean with name 'urlmapping 'defined in class path resource [COM/expert/test/expert-config.xml]: initialization of bean failed; Nested exception is Org. springframework. beans. factory. nosuchbeandefinitionexception: No bean named ''is defined
Caused by: org. springframework. Beans. Factory. nosuchbeandefinitionexception: No bean named ''is defined

Cause:
Create
<Bean id = "urlmapping" class = "org. springframework. Web. servlet. handler. simpleurlhandlermapping">
<Property name = "mappings">
<Props>

<Prop key = ""> </prop>

</Props>
</Property>
</Bean>
No value is assigned to <prop key = ""> </prop>

14.

Org. springframework. Orm. hibernate3.hibernatequeryexception: instruction is not mapped

[From instruction]; Nested exception is org. hibernate. hql. Ast. querysyntaxexception:

Instruction is not mapped [from instruction]
Caused by: org. hibernate. hql. Ast. querysyntaxexception: instruction is not mapped [from

Instruction]
Cause: <value> COM/serializ/instruction. HBM. xml </value> is not added to the data-config.xml.
15.

Java. SQL. sqlexception: Field 'userid' doesn' t have a default value
Cause: Change the primary key of the configuration file to <generator class = "assigned"/> to customize the primary key value, because I did not set the primary key to automatically increase, the default value is affected by <generator class = "native"/> in the configuration file.

16.org. Apache. Jasper. jasperexception: Unable to compile class for JSP

Cause: Java code parentheses on the JSP page are asymmetrical!

 

 

 

17. Error creating bean with name 'sessionfactory'

User reply: Error creating bean with name 'sessionfactory'
User reply: the Java Bean 'userdao 'has a problem,

Cause: severe: Action: NULL
Try again. It may be that the rules of JavaBean are not met.

User reply: Spring configuration file error ~~
User reply: userdao is automatically generated, and spring configuration is certainly OK.
User reply: I have encountered exactly the same problem as you have encountered, and I have not solved it yet. If you have solved it, please let me know. Thank you very much.
Reply: RP
User reply: Reading the error message seems that the setter method in Java Bean is incorrect. We recommend that you check.
User reply: caused by: Java. Lang. noclassdeffounderror: ORG/Apache/commons/pool/impl/genericobjectpool
Some packages are not loaded.
Eclipse is loaded as a data dictionary and needs to be referenced again in Tomcat.
User reply: I wrote about the same issue as you. Now my problem has been solved, and I modified it in the service class, is my service generated using tools? My error is that the Service inherits the hibernatedaosupport class, which is rough

Heart-caused
User reply: I also encountered this error, but I finally found the answer online. You have not imported this package. <bean id = "datasource" class = "org. apache. commons. DBCP. basicdatasource "Destroy-method =

"Close"> in addition to the need for commons-dbcp-1.2-1.jar but also need to commons-pool.jar this package, the next commons-pool.jar package imported into it should be OK, my is solved in this way

User reply: commons-pool.jar:
Http://www.apache.org/dist/commons/pool/commons-pool-current.zip
Commons-dbcp-1.2.1.jar:
Http://archive.apache.org/dist/commons/dbcp/binaries/commons-dbcp-1.2.1.zip

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.