5

I am deploying my application to Tomcat 6.0.20.

Application uses Hibernate as ORM, Spring, and JSF for web-tier.

I also made simple runner from main() method to test Spring-Hibernate collaboration. And it does work fine and hibernate.cfg.xml is parsed pretty well.

I can append some code or full stack trace but I'm not sure that it's necessary because Google says that it's typical problem and it's easy to recognize it from the title. Unfortunately, I couldn't find the solution..

So, who knows how to fix this problem?

3 Answers 3

13

Make sure you don't have two different dom4j jars on your classpath.

Sign up to request clarification or add additional context in comments.

2 Comments

like one in the tomcat system classpath and one in your webapp.
@bmargulies: Right. We mustn't put hibernate jars in Tomcat. Do put it in web app lib.
8

I solved it by excluding dom4j from hibernate entitymanager.

Also make sure you do mvn clean before.

    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-entitymanager</artifactId>
        <version>4.1.5.SP1</version>
        <scope>compile</scope>
        <exclusions> 
            <exclusion>
                <groupId>dom4j</groupId>
                <artifactId>dom4j</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

Comments

2

I solved by adding dom4j to my pom.xml and making the scope provided

<dependency>
    <groupId>dom4j</groupId>
    <artifactId>dom4j</artifactId>
    <version>1.6.1</version>
    <scope>provided</scope>
</dependency>

1 Comment

It worked for me too. my configuration is spring 3.6.3.2.11.RELEASE Hibernate 3.6.10.Final running in jboss-eap-4.3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.