Results 1 to 5 of 5

Thread: Spring 3.1.0.M1 and STS

Threaded View

  1. #1

    Default Spring 3.1.0.M1 and STS

    Hi,

    first of all, apologies for (i) perhaps posting to the wrong place and (ii) possibly not having a clear picture of the issue I'm having (new to spring, STS and maven, but experienced developer).

    In a nutshell- basing a project on this article, I configured my POM to successfully obtain the project dependencies: Spring 3.1.0.M1, Spring Security 3.1.0.RC, and Spring Social 1.0.0.M2 respectively.

    The first issue is that STS reports errors with servlet-context.xml
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:mvc="http://www.springframework.org/schema/mvc"
           xmlns:context="http://www.springframework.org/schema/context"
           xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
    		http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">
    
        <context:property-placeholder location="classpath:config.properties"/>
    
        <context:component-scan base-package="com.example.whatever" />
    
        <!--  	 
            these settings in the mvc namespace cause the IDE issue
         -->
        <mvc:annotation-driven/>
        <mvc:view-controller path="/index.html" view-name="index"/>
        <mvc:view-controller path="/" view-name="index"/>
    	 
        <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
            <property name="prefix" value="/WEB-INF/views/"/>
            <property name="suffix" value=".jsp"/>
        </bean>
    
        <bean class="org.springframework.social.web.connect.ConnectController">
            <constructor-arg value="${application.url}"/>
        </bean>
    </beans>
    The error I get in the IDE is

    Code:
    Error occured processing XML 'tried to access class org.springframework.core.convert.support.ArrayToCollectionConverter from class org.springframework.core.convert.support.DefaultConversionService'. See Error Log for more details
    Unfortunately there are no more details in the error log. I don't want to confuse matters by hazarding a guess right now, so onto the second issue, which is when I start STS spring insight after dragging my project into the servers panel, I get this

    Error creating bean with name 'org.springframework.dao.annotation.
    PersistenceExceptionTranslationPostProcessor#0' defined in class path resource [com/springsource/insight/repo/app-config-db.xml]:
    Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'entityManagerFactory' defined in class path resource [com/springsource/insight/repo/app-config-db.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javax.persistence.spi.PersistenceUnitInfo.getValid ationMode()Ljavax/persistence/ValidationMode;


    the truncated stack looks like this

    Code:
    2011-03-25 15:50:17,787 ERROR [org.springframework.web.context.ContextLoader][main] - Context initialization failed
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#0' defined in class path resource [com/springsource/insight/repo/app-config-db.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [com/springsource/insight/repo/app-config-db.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javax.persistence.spi.PersistenceUnitInfo.getValidationMode()Ljavax/persistence/ValidationMode;
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
    	... more
    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [com/springsource/insight/repo/app-config-db.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javax.persistence.spi.PersistenceUnitInfo.getValidationMode()Ljavax/persistence/ValidationMode;
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
    	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:398)
    	at org.springframework.beans.factory.BeanFactoryUtils.beansOfTypeIncludingAncestors(BeanFactoryUtils.java:266)
    	at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.detectPersistenceExceptionTranslators(PersistenceExceptionTranslationInterceptor.java:139)
    	... more
    Caused by: java.lang.NoSuchMethodError: javax.persistence.spi.PersistenceUnitInfo.getValidationMode()Ljavax/persistence/ValidationMode;
    	at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:617)
    	... more
    25-Mar-2011 15:50:17 org.apache.catalina.core.StandardContext listenerStart
    SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#0' defined in class path resource [com/springsource/insight/repo/app-config-db.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [com/springsource/insight/repo/app-config-db.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javax.persistence.spi.PersistenceUnitInfo.getValidationMode()Ljavax/persistence/ValidationMode;
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
    	... more
    	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [com/springsource/insight/repo/app-config-db.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javax.persistence.spi.PersistenceUnitInfo.getValidationMode()Ljavax/persistence/ValidationMode;
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
    	... more
    Caused by: java.lang.NoSuchMethodError: javax.persistence.spi.PersistenceUnitInfo.getValidationMode()Ljavax/persistence/ValidationMode;
    	at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:617)
    	at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:72)
    	... more
    Can anybody hazard a guess to whats causing this? Is there a conflict going on between Spring 3.0 and Spring 3.1? Does Spring insight server need to be configured to use 3.1? Does the IDE? I really can't figure this out. Would JPA 1/2 collision be an issue?

    I really appreciate any and all feedback. Thanks.
    Last edited by davidfoley; Mar 25th, 2011 at 11:43 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •