0

I am having issue when start web application with Jetty, but when i start it with Tomcat-07 there is no such issue,

Error :

org.springframework.beans.factory.BeanCreationException:  
Error creating bean with name    
'hbmSessionFactory' defined in ServletContext resource 
[/WEB-INF/applicationContext.xml]:
Invocation of init method failed; nested exception is java.lang.NoSuchMethodError:   
javax.persistence.OneToMany.orphanRemoval()Z  

What can be the reason ?

Thanks,

<properties>
    <org.springframework.version>3.0.5.RELEASE</org.springframework.version>
    <slf4j.version>1.5.6</slf4j.version><cxf.version>2.3.3</cxf.version>
    <ehcacheVersion>2.4.2</ehcacheVersion><toolkitVersion>3.3.0</toolkitVersion>
</properties><dependencies>        
    <dependency><groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId><version>${org.springframework.version}</version>
    </dependency><dependency>
        <groupId>org.springframework</groupId><artifactId>spring-expression</artifactId>
        <version>${org.springframework.version}</version>
    </dependency><dependency>
        <groupId>org.springframework</groupId><artifactId>spring-beans</artifactId>
        <version>${org.springframework.version}</version>
    </dependency><dependency>
        <groupId>org.springframework</groupId><artifactId>spring-aop</artifactId>
        <version>${org.springframework.version}</version>
    </dependency><dependency>
        <groupId>org.springframework</groupId><artifactId>spring-context</artifactId>
        <version>${org.springframework.version}</version>
    </dependency><dependency>
        <groupId>org.springframework</groupId><artifactId>spring-context-support</artifactId>
        <version>${org.springframework.version}</version>
    </dependency><dependency>
        <groupId>org.springframework</groupId><artifactId>spring-tx</artifactId>
        <version>${org.springframework.version}</version>
    </dependency><dependency>
        <groupId>org.springframework</groupId><artifactId>spring-jdbc</artifactId>
        <version>${org.springframework.version}</version>
    </dependency><dependency>
        <groupId>org.springframework</groupId><artifactId>spring-orm</artifactId>
        <version>${org.springframework.version}</version>
    </dependency><dependency>
        <groupId>org.springframework</groupId><artifactId>spring-oxm</artifactId>
        <version>${org.springframework.version}</version>
    </dependency><dependency>
        <groupId>org.springframework</groupId><artifactId>spring-web</artifactId>
        <version>${org.springframework.version}</version>
    </dependency><dependency>
        <groupId>org.springframework</groupId><artifactId>spring-webmvc</artifactId>
        <version>${org.springframework.version}</version>
    </dependency><dependency>
        <groupId>org.springframework</groupId><artifactId>spring-webmvc-portlet</artifactId>
        <version>${org.springframework.version}</version>
    </dependency><dependency>
        <groupId>org.springframework</groupId><artifactId>spring-test</artifactId>
        <version>${org.springframework.version}</version><scope>test</scope>
    </dependency><dependency>
        <groupId>javax.servlet</groupId><artifactId>servlet-api</artifactId>
        <version>2.5</version><type>jar</type><scope>compile</scope>
    </dependency><dependency>
        <groupId>javax.servlet</groupId><artifactId>jstl</artifactId>
        <version>1.2</version>
    </dependency><dependency>
        <groupId>taglibs</groupId><artifactId>standard</artifactId>
        <version>1.1.2</version>
    </dependency><dependency>
        <groupId>javax.transaction</groupId><artifactId>jta</artifactId>
        <version>1.1</version>
    </dependency><dependency>
        <groupId>org.aspectj</groupId><artifactId>aspectjrt</artifactId>
        <version>1.6.2</version>
    </dependency><dependency>
        <groupId>commons-io</groupId><artifactId>commons-io</artifactId>
        <version>2.0</version>
    </dependency><dependency>
        <groupId>commons-dbcp</groupId><artifactId>commons-dbcp</artifactId>
        <version>1.2.2</version>
    </dependency><dependency>
        <groupId>commons-pool</groupId><artifactId>commons-pool</artifactId>
        <version>1.4</version>
    </dependency><dependency>
        <groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId>
        <version>5.1.18</version>
    </dependency><dependency>
        <groupId>org.hibernate</groupId><artifactId>hibernate-entitymanager</artifactId>
        <version>3.5.5-Final</version>
    </dependency><dependency>
        <groupId>org.hibernate.java-persistence</groupId><artifactId>jpa-api</artifactId>
        <version>2.0-cr-1</version>
    </dependency><dependency>
        <groupId>javax.ws.rs</groupId><artifactId>jsr311-api</artifactId>
        <version>0.11</version>
    </dependency><dependency>
        <groupId>javax.validation</groupId><artifactId>validation-api</artifactId>
        <version>1.0.0.GA</version>
    </dependency><dependency>
        <groupId>org.hibernate</groupId><artifactId>hibernate-validator</artifactId>
        <version>4.0.2.GA</version>
    </dependency><dependency>
        <groupId>javax.annotation</groupId><artifactId>jsr250-api</artifactId>
        <version>1.0</version><scope>provided</scope>
    </dependency></dependencies>  

Thanks for the reply ,All the dependencies are loading properly, mvn clean compile package war:war also working fine,and that war file doesn't have any issues with Tomcat-7, but having above error with jetty ?

user1573690
  • 361
  • 1
  • 7
  • 21

1 Answers1

1

I think its because this method just doesn't exist in the interface of OneToMany of jar that you have in your classpath. It should be something relatively new (JPA 2) and you might have jars of jpa-1 in your classpath. So try to figure out the versions of your jars and post here. Probably we'll be able to say whats missing there.

Look here for example: Link 1

Or here: Link 2

Hope this helps

Community
  • 1
  • 1
Mark Bramnik
  • 39,963
  • 4
  • 57
  • 97