Problems encountered when using the Myeclipse+struts+hibernate test

Source: Internet
Author: User
Tags xml parser

Problems encountered when using the Myeclipse+struts+hibernate test

Because of the work reason, uses the myeclipse+struts1.2+hibernate3.1+ Spring2.0 Framework to write procedures, just at the beginning of the Tomcat6.0 written on the top of the leadership to get Resin3.0, the specific reason is not clear, no way, do it.

MyEclipse automatically generated SSH structure directly to the Resin3.0, the results of the pain began, pop-up error said what

21:13:32,500 ERROR Digester:686-digester.getparser:
Org.xml.sax.saxnotrecognizedexception:http://apache.org/xml/features/validation/dynamic
At Com.caucho.xml.parsers.XmlSAXParserFactory.setFeature (xmlsaxparserfactory.java:94)
At Org.apache.commons.digester.parser.XercesParser.configureXerces (xercesparser.java:185)
At Org.apache.commons.digester.parser.XercesParser.newSAXParser (xercesparser.java:138)

There are other errors, in short, the XML parsing exception, and then after a good many trials concluded that if the individual deployment of Hibernate or spring or struts or spring+struts is not a problem, but as long as the hibernate add in, It's definitely going to go out. Strtus configuration file could not initialize the error, then studied the Hibernate project added to the package file, after research, put a few packets from the inside Delete:

Commons-collections-2.1.1.jar

Duplicate package feature added to struts

Antlr-2.7.5h3.jar

Duplicate package feature added to struts

Commons-logging-1.0.4.jar

Duplicate package feature added to struts

Xerces-2.6.2.jar, Xml-apis.jar

A set of XML parsers

After looking through countless data (of course, through Google and Baidu) to get the conclusion

Need Hibernate2.jar with Hibernate2, Hibernate3 need Hibernate3.jar and Antlr-2.7.5h3.jar

Then join Struts1.2,

Add it to the Resin3.0 to run it and see if it's okay. Hey.. No problem at the moment,

Appendix: Unnecessary class libraries in hibernate

Ant.jar and Optional.jar

Ant uses the

C3p0.jar

A database connection pool

Proxool.jar

A database connection pool

Commons-pool.jar, Commons-dbcp.jar

DBCP database connection pool, wordy, Tomcat has this.

Connector.jar

JCA specification, this jar is required if you configure Hibernate as connector on the app server. However, in fact, the General app Server will certainly bring this package, so it is actually a redundant package.

Jaas.jar

Jaas is used for permission validation and is already included in the JDK1.4.

Jcs.jar

If you are prepared to use JCS in Hibernate, then you must include it, otherwise you won't

Jdbc2_0-stdext.jar

The JDBC2.0 expansion pack, which is generally used by the database connection pool. However, App server will bring

Jta.jar

JTA specification, when hibernate use JTA, but app server will bring

Junit.jar

JUnit packages are needed when you run Hibernate's own test code, otherwise you don't have to

Xalan.jar, Xerces.jar, Xml-apis.jar

Xerces is an XML parser, Xalan is a formatter, and Xml-apis is actually JAXP. General app Server will take, JDK1.4 also contains the parser, but not xerces, is crimson, inefficient, but hibernate with XML is just read configuration files, performance is not critical, so it is redundant. And it is also the root of the evil, which has conflict.

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.