Some jar packages that need to be imported using hibernate

Source: Internet
Author: User
Tags throw exception xml parser ibm developerworks

Reprinted from: http://blog.chinaunix.net/uid-9554081-id-2000837.html

Used to import packages with MyEclipse, and now manually.

I do not know the need to import some of the jar file, resulting in the compilation pass, run throw exception:

Exception in thread "main" Java.lang.NoClassDefFoundError: org/dom4j/documentexception
At Com.sd0707.bank.client.Test.main (test.java:13)

To search on the Internet only to know less into the jar file, just search this article, I think the summary is good, then turn it ready for use!

--------------------------------------------------------------------------------------------------------------- --------------------

Hibernate2.jar:
Hibernate library, the jar package that must be used

Cglib-full-2.0.2.jar
Cglib Library, Hibernate uses it to achieve the dynamic generation of PO bytecode, very core libraries, must use the JAR package

Dom4j-1.4.jar
DOM4J is a Java XML API, similar to Jdom, used to read and write XML files. Dom4j is a very, very good Java XML API that features great performance, power, and extreme ease of use, as well as an open source software that can be found on SourceForge. The IBM Developerworks can find an article on the performance, functionality, and usability of the mainstream Java XML API, and DOM4J is excellent in that respect. I started using dom4j almost two years ago, until now. Now you can see that more and more Java software is using dom4j to read and write XML, especially to mention that even Sun's JAXM is using DOM4J. This is the jar package that must be used and hibernate uses it to read and write the configuration file.

Odmg-3.0.jar
ODMG is an ORM specification, Hibernate implements the ODMG specification, which is a core library that must be used by the jar package.

Commons-collections-2.1.1.jar:
One of the Apache Commons packages contains some Apache-developed collection classes that are more powerful than java.util.*. The jar package that must be used.

Commons-beanutils.jar:
One of the Apache commons packages contains some Bean tool class classes. The jar package that must be used.


* Note: I did not see this package in Hibernate lib, but I saw this package in struts and looked it up on the Internet, which provides easy-to-use Java reflection. I didn't use the bag, and there was no problem (seen here:http://www.blogjava.net/kobe09/archive/2006/06/14/52745.aspx )

Commons-lang-1.0.1.jar
One of the Apache Commons packages, containing some data type tool classes, is an extension of the java.lang.*. The jar package that must be used.

Commons-logging-1.0.4.jar
One of the Apache Commons packages that contains the log functionality that must be used by the jar package.

From the Internet, the above is a required package

Anant-1.5.3.jar
The ant compilation Tool's Jar package is used to compile the hibernate source code. If you are not ready to modify and compile Hibernate source code, then there is no use, optional jar package

Ant-optional-1.5.3.jar
An auxiliary package for Ant.

C3p0-0.8.4.5.jar
C3PO is a database connection pool that hibernate can configure to use the C3PO connection pool. If you are going to use this connection pool, you will need this jar package.

Proxool-0.8.3.jar
is also a connection pool, ibid.

Commons-pool-1.2.jar, Commons-dbcp-1.2.1.jar
DBCP database Connection pool, Apache Jakarta organization developed, TOMCAT4 connection pool is also dbcp.

In fact, hibernate itself has implemented a very very simple database connection pool, plus the top 3, you can actually choose 4 different database connection pools on hibernate, choose which one to look at the personal preferences, but dbcp may be more general. In addition, if Hibernate is used in EJBs, be sure to use the connection pool of app server, not the above 4 connection pools, otherwise the container management transaction will not work.

Connector.jar:
JCA specification, this jar is required if you configure Hibernate as connector on the app server. But in fact, the General app server will definitely bring this package, so it's actually an extra package.

Jaas.jar
Jaas is used for permission validation and is already included in the JDK1.4. So it's actually an extra bag.

Jcs-1.0-dev.jar
If you are going to use JCS in Hibernate, you must include it, otherwise you will not have to.

Jdbc2_0-stdext.jar:
JDBC2.0, the database connection pool will typically be used for the extension package. But the app server is always on, so it's redundant.

Jta.jar:
The JTA specification is required when Hibernate uses JTA, but the app server is always on, so it's redundant.

Junit-3.8.1.jar
The JUnit package is required when you run Hibernate's own test code, otherwise it is not needed.

Xalan-2.4.0.jar, Xerces-2.4.0.jar, Xml-apis.jar:
Xerces is an XML parser, Xalan is a formatter, Xml-apis is actually JAXP. General app Server will bring, JDK1.4 also contains the parser, but not xerces, is crimson, inefficient, but hibernate with XML is just read configuration file, performance is not critical, so is redundant.

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.