C ­ snotfoundexception occurs when hibernate2 is deployed to weblogic.

Source: Internet
Author: User
The company decided to enable seam to develop a new project, so I migrated hibernate2 to weblogic.
Classnotfoundexception: org. hibernate. hql. Ast. hqltoken error WebLogic exits abnormally.
If you encounter this problem, refer to this article:
Http://www.cityaway.net /? P = 38
The full text of this article is as follows:
Appears during running
Classnotfoundexception: org. hibernate. hql. Ast. hqltoken error WebLogic exits unexpectedly.
Cause:
Hibernate3.0 uses the new anlr-based hql/SQL query translator in the hibernate configuration file
Hibernate. query. factory_class attribute is used to select a query translator.
(1) Select the query translator of hibernate3.0:
Hibernate. query. factory_class =
Org. hibernate. hql. Ast. astquerytranslatorfactory
(2) Select the query translator for hibernate2.1.
Hibernate. query. factory_class =
Org. hibernate. hql. Classic. classicquerytranslatorfactory
To use the 3.0 batch update and delete functions, you can only select (1). Otherwise, you cannot explain the batch update statements. When using this function, you may not be able to enter Chinese characters. Select (2) to support data loss.
But it cannot explain the batch update statement.
Anlr is required in hibernate3. However, this package already contains the antrl class library in weblogic. jar, and some class loading errors will occur and cannot be found.
Hibernate3.jar in war or ear.
After this error occurs, anlr will call system. Exit (), so that WebLogic will stop the service.
Solution:
1. Add the property hibernate. query. factory_class to the hibernate. properties file. The property value is
Org. hibernate. hql. Classic. classicquerytranslatorfactory to solve the problem.
However, some functions may be faulty, such
However, this system may cause problems in batch deletion and update. This system does not use
2. antlr-2.7.5H3.jar to WebLogic pre_classpath: Open C:/Bea with WinRAR or WinZip
/Weblogic81/Server/lib/weblogic. Jar Delete the anlr directory inside, and then put the antlr-2.7.5H3.jar
In the same directory of weblogic. Jar (Note: no strict tests have been performed after replacement, and I do not know whether there are any sequelae)
3. 1. Copy the package antlr-2.7.5H3.jar in hibernate3 to % wl_home %/Server/lib.
3. 2. Modify % mydomain %/startweblogic. CMD:
Add the following sentence before set classpath:
Set pre_classpath = % wl_home %/Server/lib/antlr-2.7.5H3.jar;
Add the following sentence after set classpath:
Set classpath = % pre_classpath %; % classpath %
Everything is OK!
 

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.