Loading ...
Sorry, an error occurred while loading the content.
 

Re: [riojug] Re: JPA + Spring

Expand Messages
  • Sergio Amim
    Declarei, sendo que existem momentos que ele reclamava que não existia Classe Mapeada, mas eu definia os pacotes corretamente como exemplos na web. Estou
    Message 1 of 4 , Apr 30 11:09 AM
      Declarei, sendo que existem momentos que ele reclamava que não existia Classe Mapeada, mas eu definia  os pacotes corretamente como exemplos na web.

      Estou achando que existe algum bug ainda para essa integração Spring 2 + JPA...por enquanto vou ficar no Hibernate com Annotation.

      Vlw T+

      On 4/27/07, fabiolnmiranda <fabio.ita04@...> wrote:

      Vc declarou o PersistenceUnit no arquivo META-INF/persistence.xml?
      Segue um exemplo desse arquivo.

      Abs
      Fábio.

      <?xml version="1.0" encoding="UTF-8"?>
      <persistence version="1.0"
      xmlns="http://java.sun.com/xml/ns/persistence"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
      http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">

      <persistence-unit name="default" transaction-type="RESOURCE_LOCAL">
      <non-jta-data-source>java:comp/env/jdbc/default</non-jta-data-source>

      <properties>
      <property name="hibernate.show_sql" value="true" />
      <property name="hibernate.dialect"
      value="org.hibernate.dialect.MySQLInnoDBDialect"/>
      </properties>
      </persistence-unit>

      </persistence>



      --- In riojug@yahoogroups.com, "Sergio Amim" <sergioamim@...> wrote:
      >
      > Boa tarde amigos! estou com mais um problema cabeludo!!!
      >
      > Este é um projeto de exemplo q tem ai na Net sendo q fiz
      alterações para
      > minha realidade!
      > Em anexo segue o arquivo applicationContext.xml do projeto. (se
      não puder
      > anexo por favor me avisem, apesar que este é Minusculo)
      >
      > Abaixo a Stacktrace
      >
      > Stack Resumida:
      > java.lang.IllegalStateException: No persistence units parsed from
      > persistence.xml}
      >
      >
      > e a Stack Full
      > org.springframework.beans.factory.BeanCreationException: Error
      creating bean
      > with name 'restaurantDao' defined in URL
      > [file:/C:/java/work5/jpa/web/WEB-
      INF/classes/applicationContext.xml]: Cannot
      > resolve reference to bean 'entityManagerFactory' while setting
      bean property
      > 'entityManagerFactory'; nested exception is
      > org.springframework.beans.factory.BeanCreationException: Error
      creating bean
      > with name 'entityManagerFactory' defined in URL
      > [file:/C:/java/work5/jpa/web/WEB-
      INF/classes/applicationContext.xml]:
      > Invocation of init method failed; nested exception is
      > java.lang.IllegalStateException: No persistence units parsed from
      > {classpath*:META-INF/persistence.xml}
      > Caused by:
      org.springframework.beans.factory.BeanCreationException: Error
      > creating bean with name 'entityManagerFactory' defined in URL
      > [file:/C:/java/work5/jpa/web/WEB-
      INF/classes/applicationContext.xml]:
      > Invocation of init method failed; nested exception is
      > java.lang.IllegalStateException: No persistence units parsed from
      > {classpath*:META-INF/persistence.xml}
      > Caused by: java.lang.IllegalStateException: No persistence units
      parsed from
      > {classpath*:META-INF/persistence.xml}
      > at
      >
      org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitMan
      ager.obtainDefaultPersistenceUnitInfo
      > (DefaultPersistenceUnitManager.java:335)
      > at
      >
      org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.de
      terminePersistenceUnitInfo
      > (LocalContainerEntityManagerFactoryBean.java:241)
      > at
      >
      org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.cr
      eateNativeEntityManagerFactory
      > (LocalContainerEntityManagerFactoryBean.java:195)
      > at
      >
      org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPro
      pertiesSet
      > (AbstractEntityManagerFactoryBean.java:251)
      > at
      >
      org.springframework.beans.factory.support.AbstractAutowireCapableBean
      Factory.invokeInitMethods
      > (AbstractAutowireCapableBeanFactory.java:1175)
      > at
      >
      org.springframework.beans.factory.support.AbstractAutowireCapableBean
      Factory.initializeBean
      > (AbstractAutowireCapableBeanFactory.java:1145)
      > at
      >
      org.springframework.beans.factory.support.AbstractAutowireCapableBean
      Factory.createBean
      > (AbstractAutowireCapableBeanFactory.java:427)
      > at
      >
      org.springframework.beans.factory.support.AbstractBeanFactory$1.getOb
      ject(
      > AbstractBeanFactory.java:251)
      > at
      >
      org.springframework.beans.factory.support.DefaultSingletonBeanRegistr
      y.getSingleton
      > (DefaultSingletonBeanRegistry.java:144)
      > at
      org.springframework.beans.factory.support.AbstractBeanFactory.getBean
      > (AbstractBeanFactory.java:248)
      > at
      org.springframework.beans.factory.support.AbstractBeanFactory.getBean
      > (AbstractBeanFactory.java:160)
      > at
      >
      org.springframework.beans.factory.support.BeanDefinitionValueResolver
      .resolveReference
      > (BeanDefinitionValueResolver.java:261)
      > at
      >
      org.springframework.beans.factory.support.BeanDefinitionValueResolver
      .resolveValueIfNecessary
      > (BeanDefinitionValueResolver.java:109)
      > at
      >
      org.springframework.beans.factory.support.AbstractAutowireCapableBean
      Factory.applyPropertyValues
      > (AbstractAutowireCapableBeanFactory.java:1073)
      > at
      >
      org.springframework.beans.factory.support.AbstractAutowireCapableBean
      Factory.populateBean
      > (AbstractAutowireCapableBeanFactory.java:835)
      > at
      >
      org.springframework.beans.factory.support.AbstractAutowireCapableBean
      Factory.createBean
      > (AbstractAutowireCapableBeanFactory.java:423)
      > at
      >
      org.springframework.beans.factory.support.AbstractBeanFactory$1.getOb
      ject(
      > AbstractBeanFactory.java:251)
      > at
      >
      org.springframework.beans.factory.support.DefaultSingletonBeanRegistr
      y.getSingleton
      > (DefaultSingletonBeanRegistry.java:144)
      > at
      org.springframework.beans.factory.support.AbstractBeanFactory.getBean
      > (AbstractBeanFactory.java:248)
      > at
      org.springframework.beans.factory.support.AbstractBeanFactory.getBean
      > (AbstractBeanFactory.java:160)
      > at
      >
      org.springframework.beans.factory.support.DefaultListableBeanFactory.
      preInstantiateSingletons
      > (DefaultListableBeanFactory.java:279)
      > at
      >
      org.springframework.context.support.AbstractApplicationContext.refres
      h(
      > AbstractApplicationContext.java:360)
      > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      > at sun.reflect.NativeMethodAccessorImpl.invoke(
      > NativeMethodAccessorImpl.java:39)
      > at sun.reflect.DelegatingMethodAccessorImpl.invoke(
      > DelegatingMethodAccessorImpl.java:25)
      > at java.lang.reflect.Method.invoke(Method.java:585)
      > at org.springframework.test.jpa.AbstractJpaTests.runBare(
      > AbstractJpaTests.java:214)
      > at junit.framework.TestResult$1.protect(TestResult.java:106)
      > at junit.framework.TestResult.runProtected(TestResult.java:124)
      > at junit.framework.TestResult.run(TestResult.java:109)
      > at junit.framework.TestCase.run(TestCase.java:118)
      > at junit.framework.TestSuite.runTest(TestSuite.java:208)
      > at junit.framework.TestSuite.run(TestSuite.java:203)
      > at
      org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(
      > JUnit3TestReference.java:128)
      > at org.eclipse.jdt.internal.junit.runner.TestExecution.run(
      > TestExecution.java:38)
      > at
      org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
      > RemoteTestRunner.java:460)
      > at
      org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
      > RemoteTestRunner.java:673)
      > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(
      > RemoteTestRunner.java:386)
      > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
      > RemoteTestRunner.java:196)
      >
      >
      >
      > --
      > Sergio Amim Junior
      >




      --
      Sergio Amim Junior
    • Filipe Fumaux
      Se foi o mesmo projeto que eu peguei, tenta usar o javaAgent com TimeWeaver. ... -- Ass.: Filipe Fumaux Se foi o mesmo projeto que eu peguei, tenta usar o
      Message 2 of 4 , May 7, 2007
        Se foi o mesmo projeto que eu peguei, tenta usar o javaAgent com TimeWeaver.

        Em 30/04/07, Sergio Amim <sergioamim@... > escreveu:

        Declarei, sendo que existem momentos que ele reclamava que não existia Classe Mapeada, mas eu definia  os pacotes corretamente como exemplos na web.

        Estou achando que existe algum bug ainda para essa integração Spring 2 + JPA...por enquanto vou ficar no Hibernate com Annotation.

        Vlw T+



        On 4/27/07, fabiolnmiranda < fabio.ita04@...> wrote:

        Vc declarou o PersistenceUnit no arquivo META-INF/persistence.xml?
        Segue um exemplo desse arquivo.

        Abs
        Fábio.

        <?xml version="1.0" encoding="UTF-8"?>
        <persistence version="1.0"
        xmlns="http://java.sun.com/xml/ns/persistence"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
        http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">

        <persistence-unit name="default" transaction-type="RESOURCE_LOCAL">
        <non-jta-data-source>java:comp/env/jdbc/default</non-jta-data-source>

        <properties>
        <property name="hibernate.show_sql" value="true" />
        <property name="hibernate.dialect"
        value="org.hibernate.dialect.MySQLInnoDBDialect"/>
        </properties>
        </persistence-unit>

        </persistence>



        --- In riojug@yahoogroups.com, "Sergio Amim" <sergioamim@...> wrote:
        >
        > Boa tarde amigos! estou com mais um problema cabeludo!!!
        >
        > Este é um projeto de exemplo q tem ai na Net sendo q fiz
        alterações para
        > minha realidade!
        > Em anexo segue o arquivo applicationContext.xml do projeto. (se
        não puder
        > anexo por favor me avisem, apesar que este é Minusculo)
        >
        > Abaixo a Stacktrace
        >
        > Stack Resumida:
        > java.lang.IllegalStateException: No persistence units parsed from
        > persistence.xml}
        >
        >
        > e a Stack Full
        > org.springframework.beans.factory.BeanCreationException: Error
        creating bean
        > with name 'restaurantDao' defined in URL
        > [file:/C:/java/work5/jpa/web/WEB-
        INF/classes/applicationContext.xml]: Cannot
        > resolve reference to bean 'entityManagerFactory' while setting
        bean property
        > 'entityManagerFactory'; nested exception is
        > org.springframework.beans.factory.BeanCreationException: Error
        creating bean
        > with name 'entityManagerFactory' defined in URL
        > [file:/C:/java/work5/jpa/web/WEB-
        INF/classes/applicationContext.xml]:
        > Invocation of init method failed; nested exception is
        > java.lang.IllegalStateException: No persistence units parsed from
        > {classpath*:META-INF/persistence.xml}
        > Caused by:
        org.springframework.beans.factory.BeanCreationException: Error
        > creating bean with name 'entityManagerFactory' defined in URL
        > [file:/C:/java/work5/jpa/web/WEB-
        INF/classes/applicationContext.xml]:
        > Invocation of init method failed; nested exception is
        > java.lang.IllegalStateException: No persistence units parsed from
        > {classpath*:META-INF/persistence.xml}
        > Caused by: java.lang.IllegalStateException: No persistence units
        parsed from
        > {classpath*:META-INF/persistence.xml}
        > at
        >
        org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitMan
        ager.obtainDefaultPersistenceUnitInfo
        > (DefaultPersistenceUnitManager.java:335)
        > at
        >
        org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.de
        terminePersistenceUnitInfo
        > (LocalContainerEntityManagerFactoryBean.java:241)
        > at
        >
        org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.cr
        eateNativeEntityManagerFactory
        > (LocalContainerEntityManagerFactoryBean.java:195)
        > at
        >
        org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPro
        pertiesSet
        > (AbstractEntityManagerFactoryBean.java:251)
        > at
        >
        org.springframework.beans.factory.support.AbstractAutowireCapableBean
        Factory.invokeInitMethods
        > (AbstractAutowireCapableBeanFactory.java:1175)
        > at
        >
        org.springframework.beans.factory.support.AbstractAutowireCapableBean
        Factory.initializeBean
        > (AbstractAutowireCapableBeanFactory.java:1145)
        > at
        >
        org.springframework.beans.factory.support.AbstractAutowireCapableBean
        Factory.createBean
        > (AbstractAutowireCapableBeanFactory.java:427)
        > at
        >
        org.springframework.beans.factory.support.AbstractBeanFactory$1.getOb
        ject(
        > AbstractBeanFactory.java:251)
        > at
        >
        org.springframework.beans.factory.support.DefaultSingletonBeanRegistr
        y.getSingleton
        > (DefaultSingletonBeanRegistry.java:144)
        > at
        org.springframework.beans.factory.support.AbstractBeanFactory.getBean
        > (AbstractBeanFactory.java:248)
        > at
        org.springframework.beans.factory.support.AbstractBeanFactory.getBean
        > (AbstractBeanFactory.java:160)
        > at
        >
        org.springframework.beans.factory.support.BeanDefinitionValueResolver
        .resolveReference
        > (BeanDefinitionValueResolver.java:261)
        > at
        >
        org.springframework.beans.factory.support.BeanDefinitionValueResolver
        .resolveValueIfNecessary
        > (BeanDefinitionValueResolver.java:109)
        > at
        >
        org.springframework.beans.factory.support.AbstractAutowireCapableBean
        Factory.applyPropertyValues
        > (AbstractAutowireCapableBeanFactory.java:1073)
        > at
        >
        org.springframework.beans.factory.support.AbstractAutowireCapableBean
        Factory.populateBean
        > (AbstractAutowireCapableBeanFactory.java:835)
        > at
        >
        org.springframework.beans.factory.support.AbstractAutowireCapableBean
        Factory.createBean
        > (AbstractAutowireCapableBeanFactory.java:423)
        > at
        >
        org.springframework.beans.factory.support.AbstractBeanFactory$1.getOb
        ject(
        > AbstractBeanFactory.java:251)
        > at
        >
        org.springframework.beans.factory.support.DefaultSingletonBeanRegistr
        y.getSingleton
        > (DefaultSingletonBeanRegistry.java:144)
        > at
        org.springframework.beans.factory.support.AbstractBeanFactory.getBean
        > (AbstractBeanFactory.java:248)
        > at
        org.springframework.beans.factory.support.AbstractBeanFactory.getBean
        > (AbstractBeanFactory.java:160)
        > at
        >
        org.springframework.beans.factory.support.DefaultListableBeanFactory.
        preInstantiateSingletons
        > (DefaultListableBeanFactory.java:279)
        > at
        >
        org.springframework.context.support.AbstractApplicationContext.refres
        h(
        > AbstractApplicationContext.java:360)
        > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        > at sun.reflect.NativeMethodAccessorImpl.invoke(
        > NativeMethodAccessorImpl.java:39)
        > at sun.reflect.DelegatingMethodAccessorImpl.invoke(
        > DelegatingMethodAccessorImpl.java:25)
        > at java.lang.reflect.Method.invoke(Method.java:585)
        > at org.springframework.test.jpa.AbstractJpaTests.runBare(
        > AbstractJpaTests.java:214)
        > at junit.framework.TestResult$1.protect(TestResult.java:106)
        > at junit.framework.TestResult.runProtected(TestResult.java:124)
        > at junit.framework.TestResult.run(TestResult.java:109)
        > at junit.framework.TestCase.run(TestCase.java:118)
        > at junit.framework.TestSuite.runTest(TestSuite.java:208)
        > at junit.framework.TestSuite.run(TestSuite.java:203)
        > at
        org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(
        > JUnit3TestReference.java:128)
        > at org.eclipse.jdt.internal.junit.runner.TestExecution.run(
        > TestExecution.java:38)
        > at
        org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
        > RemoteTestRunner.java:460)
        > at
        org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
        > RemoteTestRunner.java:673)
        > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(
        > RemoteTestRunner.java:386)
        > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
        > RemoteTestRunner.java:196)
        >
        >
        >
        > --
        > Sergio Amim Junior
        >




        --
        Sergio Amim Junior




        --
        Ass.: Filipe Fumaux
      Your message has been successfully submitted and would be delivered to recipients shortly.