Common errors in SSH integration

Source: Internet
Author: User
Tags ssh jboss
1, error message: Java.lang.IllegalStateException:BeanFactory not initialized or already closed-call ' refresh ' before accessing is Ans via the ApplicationContext

Probably look at the error message: Beanfactory is not instantiated or has been closed for a simple reason: applicationcontext ctx = new Classpathxmlapplicationcontext (); Spring instantiates beanfactory by default to Classpath to look for files named Applicationcontext.xml . But that is the reason for this error: ApplicationContext CTX = new Classpathxmlapplicationcontext ("Applicationcontext.xml");   If so, there will be no such mistake. 2, Java.lang.noclassdeffounderror:javax/transaction/transactionmanager Import a Jta.jar 3, Org.springframework.beans.factory.BeanCreationException:Error creating Bean with Name ' sessionfactory ' defined in ServletContext resource [/web-inf/hibernatesessionfactory.xml]: Initialization of Bean failed; Nested exception is Java.lang.noclassdeffounderror:org/hibernate/cache/cacheprovider

Original: <bean id= "Sessionfactory"
Class= "Org.springframework.orm. hibernate3. Annotation. Annotationsessionfactorybean ">

Change to: <bean id= "Sessionfactory"
Class= "Org.springframework.orm. hibernate4. Localsessionfactorybean ">

Problem solved, found that can be used normally 4, Java.lang.noclassdeffounderror:org/jboss/logging/basiclogger missing a jar package Jboss-logging.jar/HTTP/ MVNREPOSITORY.COM/ARTIFACT/ORG.JBOSS.LOGGING/JBOSS-LOGGING/3.1.0.CR1 5, java.lang.noclassdeffounderror:javax/ Persistence/entity Java.lang.noclassdeffounderror:javax/persistence/attributeconverter 1) When using the Hibernate3, The Discovery program compiles and always throws a Java.lang.noclassdeffounderror:javax/persistence/entitylisteners exception at run time. The lookup is due to a missing Ejb3-persistence.jar package.

Simply add Ejb3-persistence.jar to the class library and the exception will not occur.

What is not understood here is Hibernate3, why not put Ejb3-persistence.jar directly into the class library of their own needs, rather than let the user find, to add.

Attachment is Ejb3-persistence.jar

If you need the full Hibernate3 of the relevant jar package, please go to http://javapub.iteye.com/blog/867943 download 2) hibernate requires JPA support, Import the JPA jar package (Hibernate-jpa-2.0-api-1.0.1.final.jar).

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.