Jack Bauer sweeps the big sweep

Source: Internet
Author: User

Summary of Bugs

1, HBM primary key generation policy error:

Struts Problem Report

Struts have detected an unhandled exception:

Messages:

    IDs for this class must is manually assigned before calling Save (): Cn.itcast.bos.domain.bc.Standard IDs for this class mu St be manually assigned before calling Save (): Cn.itcast.bos.domain.bc.Standard; Nested exception is org.hibernate.id.IdentifierGenerationException:ids for this class must be manually assigned before CA Lling Save (): Cn.itcast.bos.domain.bc.Standard

File:

Org/hibernate/id/assigned.java

Line number:

53

Stacktraces

Org.springframework.orm.hibernate3.HibernateSystemException:ids for this class must is manually assigned before calling Save (): Cn.itcast.bos.domain.bc.Standard; Nested exception Isorg.hibernate.id.IdentifierGenerationException:ids for this class must bemanually assigned before CAL Ling Save (): Cn.itcast.bos.domain.bc.Standard

Solve:

Reverse-generated PO and HBM, the primary key generation strategy in HBM is assigned. If the primary key is of type string, you will need to modify this to a UUID to fix the error.

2, delayed loading error, reported no session.

Struts Problem Report

Struts have detected an unhandled exception:

Messages:

    Could not initialize proxy-no Session java.lang.reflect.InvocationTargetException Org.apache.struts2.json.JSONException:java.lang.reflect.InvocationTargetException Org.apache.struts2.json.JSONException:org.apache.struts2.json.JSONException: Java.lang.reflect.InvocationTargetException

File:

Org/hibernate/proxy/abstractLazyInitializer.java

Line number:

167

Stacktraces

Org.apache.struts2.json.JSONException:

Org.apache.struts2.json.JSONException:

Org.apache.struts2.json.JSONException:java.lang.reflect.InvocationTargetException

Note Table & #26684; In the red bold word, the first time you see this information, you can guess is lazy loading caused by the session closed,

Workaround: By configuring filter resolution in Web. XML,

Opensessioninviewfilter Org.springframework.orm.hibernate3.support.OpenSessionInViewFilter

Opensessioninviewfilter

3, exception thrown by the data table foreign key:

Struts Problem Report

Struts have detected an unhandled exception:

Messages :

    cannot add or update a child row:a FOREIGN KEY constraint fails (' Mvbos '. ' Bc_subarea ', CONST Raint ' fk_area_region ' FOREIGN KEY (' region_id ') REFERENCES ' bc_region ' (' id ')) Could not execute JDBC batch update Could Not execute JDBC batch update; SQL [Update Mvbos.bc_subarea set decidedzone_id=?, region_id=?, addresskey=?, startnum=?, endnum=?, single=?, position=? where id=?]; constraint [NULL]; Nested exception is org.hibernate.exception.ConstraintViolationException:Could not execute JDBC batch update

File :

com/mysql/jdbc/preparedsta Tement.java

line number :

1 , 666

Cannot add or update a child row:a foreign keyconstraint fails (' Mvbos '. ' Bc_subarea ', CONSTRAINT ' fk_area_region ' foreign KEY (' region_id ') REFERENCES ' bc_region ' (' ID '))

The foreign key of the Bc_subarea table points to the id attribute of the bc_region. In other words, the existence of subarea depends on region, no region there is no subarea, so must first exist region. Can.

Get the reason for the error:

When saving SubArea, the & #20540 of the foreign key in SubArea that points to region, does not exist in the region table.

How to resolve:

See if it is a foreign key input error for SubArea, or create a region data record with a foreign key with an ID equal to SubArea.

4,struts.xml not worthy of result


Noresult defined for action cn.itcast.bos.web.action.subarea.SubareaAction Andresult upload

Cause: The return result upload is defined in action, but the result of receiving upload is not configured in Struts.xml.

Solution: Configure result in Struts.xml.

5, cannot instantiate action. Struts Problem Report

Struts have detected an unhandled exception:

Messages:

    Regionaction Unable to instantiate Action, regionaction, defined ' regionaction_pagequery ' in namespace '/' Regionaction

File:

Org/apache/catalina/loader/webappclassloader.java

Line number:

1,645

Stacktraces

Unable to instantiate action,regionaction, defined for ' Regionaction_pagequery ' in namespace '/' Regionaction

Cause: When spring manages the action, The implementation class for the action needs to be configured in Applicationcontext.xml, which occurs because the ID of the implementation class for this action in spring's core configuration file is #20540 with the class& in Struts.xml; It's inconsistent.

FIX: View Struts.xml The Class property of this action and applicationcontext.xml the ID property of this action is consistent, if not consistent, modify one to make it consistent.

7, primary key generation policy settings improperly generated exception struts problem report

Struts have detected an unhandled exception:

Messages:

    Batch Update returned unexpected row count from Update [0]; Actual row count:0; Expected:1 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

File:

Org/hibernate/jdbc/expectations.java

Line number:

85

Stacktraces

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:Batchupdate returned unexpected row count from Update [0]; Actual row Count:0;expected:1

Resolution: View the primary key generation strategy in the HBM file.

8,tomcat Start times Session Error

Severity: ioexceptionwhile loading persisted sessions: java.io.EOFException

Severity: Exception loading sessions from persistent storage

Solve:

Myth One: The root cause is that the cache set for Tomcat is too small, and the solution is to configure the amount of memory used in the eclipse Tomcat

Statement two: Analysis: Eofexception indicates that the input process unexpectedly reaches the end of the file or the end of the signal, resulting in data from the session failed to obtain. The exception is the problem with Tomcat itself, because there are some active sessions being persisted (shown as temporary files) during Tomcat's last abnormal shutdown, and at reboot, Tomcat tries to recover the persisted data of the session but fails to read the result. This exception does not affect the use of the system.

Workaround: Delete the Tomcat6.0\work\catalina\localhost\peam\sessions.ser. If the server is shut down gracefully, the file is automatically deleted.

I refer to the above method to solve the problem, with the myeclipse6.0,tomcat6.0. Typically, the cache is considered Tomcat, and the entire localhost folder is deleted directly. But the above method is also desirable, under the LocalHost folder, find the project name of the deployment, in the project name has Sessions.ser file, directly deleted. Restart Tomcat for problem resolution.

9,webservice issued an error

Exception in thread "main" com.sun.xml.internal.ws.model.RuntimeModelerException: Runtime Modeler Error: Wrapper class Cn.itcast.ws.jaxws.SayHello is NotFound. Do you run the APT to generate them?

Cause: It is likely that the JDK version is not enough, the recommended version after Jdk1.6u17, it is best to change to 1.7.

Workaround: Upgrade JDK to 1.7.

Johnny Big Sweep

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.