Several problems and solutions encountered during the use of SSH

Source: Internet
Author: User

First, HTTP Status 500-org.springframework.orm.hibernate3.hibernateoptimisticlockingfailureexception:batch update Returned unexpected row count from Update [0]; Actual row count:0; Expected:1; Nested exception is Org.hibernate.StaleStateException:Batch update returned unexpected row count from Update [0]; Actual row count:0; Expected:1

Workaround:

The primary key is deleted early, and it's okay to put it behind the statement.

Reference:

http://blog.csdn.net/ssyan/article/details/7471343

Second, Java.lang.OutOfMemoryError:Java heap space Solution

Workaround:

Causes the Java.lang.OutOfMemoryError:Java heap space exception, which may be caused by the Java stack setting being too small

There are two ways to solve these questions on the Internet:

1. Join at the front of the D:/apache-tomcat-6.0.18/bin/catalina.bat: set java_opts=-xms384m-xmx384m

Note: Only Startup.bat starts Tomcat, the settings will take effect, and if you start the Tomcat service with Windows system services, the settings above will not take effect.
Which means set java_opts=-xms384m-xmx384m doesn't work.

2, modify the startup parameters in Eclilpse, in the VM arguments added-xms384m-xmx384m, set as shown

Problem solving.

However, it turns out that there is still an out-of-memory situation, and Tomcat can only be restarted each time it is run. Problem solving is a bit time consuming.

Reference:

Http://www.cnblogs.com/linjiqin/archive/2011/04/27/2030115.html

Third, java.lang.NullPointerException

Workaround:

NullPointerException the cause of the abnormal??   The so-called null pointer exception is because the property or method is called with null (NULL).   Null means there is no such object, since there is no such object, then to invoke his properties and methods, it will report an exception.   <--mainly for the following reasons: 1, the use of uninitialized variables (although declared) 2, the use of uninitialized objects (although already declared) 3, the use of the keyword or existing class name variable object methods or class names.   This exception is thrown when an application attempts to use null where the object is needed.   <--This scenario includes invoking an instance method of a null object.   A field that accesses or modifies a null object.   Use NULL as an array to get its length.   Use NULL as an array to access or modify its time slice. Throws null as the Throwable value.

Iv. Web page Error: HTTP Status 500-ORG.SPRINGFRAMEWORK.ORM.HIBERNATE3.HIBERNATEJDBCEXCEPTION:JDBC exception on Hibernate data Access Nested exception is org.hibernate.exception.GenericJDBCException:could not insert: [Com.zrdm.domain.Votecontext]

Server error: Servlet.service () for Servlets [default] in context with path [/votesystem] threw exception [org.springframework . orm.hibernate3.HibernateJdbcException: JDBC exception on Hibernate data access; Nested exception is org.hibernate.exception.GenericJDBCException: Could not execute query] with root cause J Ava.sql.SQLException: Illegal mix of collations (gbk_chinese_ci,implicit) and (utf8_general_ci,coercible) for Operation ' LIKE '

Workaround:

The coding problem is not unified. This project uses UTF-8 encoding, but it is mixed with GBK encoding. So the problem is caused. Find all GBK keywords in your project, and then change to UTF-8 to resolve the issue.

V. Referenced file contains errors (HTTP://WWW.OPENSYMPHONY.COM/XWORK/XWORK-VALIDATOR-1.0.2.DTD)

Workaround:

Later, the specification of the Struts2 Checker should be changed to:
<?xml version= "1.0" encoding= "UTF-8"?>
<! DOCTYPE validators Public "-//apache struts//xwork Validator 1.0.2//en" "http://struts.apache.org/dtds/ Xwork-validator-1.0.2.dtd ">

Reference: http://blog.csdn.net/happyjiahan/article/details/6535793

Six, action repeated call

Problem: Using the <s:action> tag, the JSP loads automatically when the action is executed, and the data is repeatedly recycled.

Cause: An action that defines two identical methods but different names.

Solution: Change Ideas http://www.cnblogs.com/HeroZearin/articles/2729987.html

Reference: http://blog.sina.com.cn/s/blog_451f5962010150um.html



Several problems and solutions encountered during the use of SSH

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.