Erro Sping 3.0.5 + Hibernate 4 + Vraptor [RESOLVIDO]

Pessoal, alguem sabe o que pode ser? Já coloquei o jar do ehcache e nada:

[code]
13:38:36,964 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/Eplus]] (MSC service thread 1-2) Exception starting filter vraptor: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘transactionManager’ defined in class path resource [applicationContext.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: Lorg/hibernate/cache/CacheProvider;
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527) [org.springframework.beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) [org.springframework.beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) [org.springframework.beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) [org.springframework.beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288) [org.springframework.beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) [org.springframework.beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580) [org.springframework.beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895) [org.springframework.context-3.0.5.RELEASE.jar:3.0.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425) [org.springframework.context-3.0.5.RELEASE.jar:3.0.5.RELEASE]
at br.com.caelum.vraptor.ioc.spring.SpringBasedContainer.start(SpringBasedContainer.java:106) [vraptor-3.4.1.jar:]
at br.com.caelum.vraptor.ioc.spring.SpringProvider.start(SpringProvider.java:87) [vraptor-3.4.1.jar:]
at br.com.caelum.vraptor.VRaptor.init(VRaptor.java:108) [vraptor-3.4.1.jar:]
at br.com.caelum.vraptor.VRaptor.init(VRaptor.java:102) [vraptor-3.4.1.jar:]
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:447) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3269) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3865) [jbossweb-7.0.13.Final.jar:]
at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.7.0_05]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_05]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_05]
Caused by: java.lang.NoClassDefFoundError: Lorg/hibernate/cache/CacheProvider;
at java.lang.Class.getDeclaredFields0(Native Method) [rt.jar:1.7.0_05]
at java.lang.Class.privateGetDeclaredFields(Unknown Source) [rt.jar:1.7.0_05]
at java.lang.Class.getDeclaredFields(Unknown Source) [rt.jar:1.7.0_05]
at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findPersistenceMetadata(PersistenceAnnotationBeanPostProcessor.java:372) [org.springframework.orm-3.0.5.RELEASE.jar:3.0.5.RELEASE]
at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessMergedBeanDefinition(PersistenceAnnotationBeanPostProcessor.java:320) [org.springframework.orm-3.0.5.RELEASE.jar:3.0.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyMergedBeanDefinitionPostProcessors(AbstractAutowireCapableBeanFactory.java:798) [org.springframework.beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:493) [org.springframework.beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) [org.springframework.beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) [org.springframework.beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) [org.springframework.beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288) [org.springframework.beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) [org.springframework.beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322) [org.springframework.beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106) [org.springframework.beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1325) [org.springframework.beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086) [org.springframework.beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517) [org.springframework.beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
… 21 more
Caused by: java.lang.ClassNotFoundException: org.hibernate.cache.CacheProvider from [Module “deployment.Eplus.war:main” from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
… 38 more

13:38:37,028 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-2) Error filterStart
13:38:37,028 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-2) Context [/Eplus] startup failed due to previous errors
13:38:37,060 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.web.deployment.default-host./Eplus: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./Eplus: JBAS018040: Failed to start context
at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:95)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.7.0_05]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_05]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_05]

13:38:37,067 INFO [org.jboss.as] (MSC service thread 1-2) JBAS015951: Admin console listening on http://127.0.0.1:9990
13:38:37,068 ERROR [org.jboss.as] (MSC service thread 1-2) JBAS015875: JBoss AS 7.1.1.Final "Brontes" started (with errors) in 14894ms - Started 325 of 404 services (2 services failed or missing dependencies, 76 services are passive or on-demand)
13:38:37,281 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015870: Deploy of deployment "Eplus.war" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.web.deployment.default-host./Eplus" => "org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./Eplus: JBAS018040: Failed to start context"}}
13:38:37,793 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015877: Stopped deployment Eplus.war in 515ms
13:38:37,795 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report
JBAS014777: Services which failed to start: service jboss.web.deployment.default-host./Eplus: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./Eplus: JBAS018040: Failed to start context[/code]

nested exception is java.lang.NoClassDefFoundError: Lorg/hibernate/cache/CacheProvider

É bem provável que o jar necessário não esteja no diretório WEB-INF/lib da aplicação.

[quote=natanaelv]nested exception is java.lang.NoClassDefFoundError: Lorg/hibernate/cache/CacheProvider

É bem provável que o jar necessário não esteja no diretório WEB-INF/lib da aplicação.[/quote]

Você também pode verificar senão tem os jars tanto em sua classpath quanto na pasta do servidor , pode estar havendo algum confronto de versão entre estes jars…

Já tem os jars ehcache-core-2.4.3.jar e hibernate-ehcache-4.1.7.Final.jar na lib da aplicação e do war. Séra esse o jar correto mesmo?

e os jars do hibernate, estão todos lá?

Tirei um print dos meus jars:


Olha a burrada:

<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory" /> </bean> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"> <property name="configLocation"> <value>classpath:/hibernate.cfg.xml</value> </property> </bean>

Estou usando o Hibernate 4 e não o 3 heehehehe, vou baixar um spring mais recente, pra ver se ele tem a biblioteca org.springframework.orm.hibernate4

Blz deu certo mais eu tive que tirar essa parte, pois a classe AnnotationSessionFactoryBean não existe na versão 4:

<?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:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd"> <tx:annotation-driven /> <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory" /> </bean> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"> <property name="configLocation"> <value>classpath:/hibernate.cfg.xml</value> </property> </bean> </beans>

Como meu applicationContext.xml pode ficar?

Ajustando o hibernate.cfg.xml:

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name="hibernate.connection.username"> root </property> <property name="hibernate.connection.password"> 32324424 </property> <property name="hibernate.connection.url"> jdbc:mysql://localhost/eplus </property> <property name="hibernate.connection.driver_class"> com.mysql.jdbc.Driver </property> <property name="hibernate.dialect"> org.hibernate.dialect.MySQL5InnoDBDialect </property> <property name="hibernate.hbm2ddl.auto">update</property> <property name="show_sql">true</property> <property name="format_sql">true</property> <property name="hibernate.cache.provider_class">net.sf.ehcache.hibernate.Provider</property> <property name="hibernate.current_session_context_class">thread</property> <mapping class="br.com.eplus.model.Usuario"/> </session-factory> </hibernate-configuration>

E applicantionContext.xml:

<?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:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd"> <tx:annotation-driven /> <bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory" /> </bean> <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"> <property name="configLocation"> <value>classpath:hibernate.cfg.xml</value> </property> </bean> </beans>

Agora é gerado:

[code]02:41:23,163 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/Eplus]] (MSC service thread 1-2) Exception starting filter vraptor: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘transactionManager’ defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.service.UnknownUnwrapTypeException: Cannot unwrap to requested type [javax.sql.DataSource]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455) [org.springframework.beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) [org.springframework.beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) [org.springframework.beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) [org.springframework.beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) [org.springframework.beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) [org.springframework.beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) [org.springframework.beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:609) [org.springframework.beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) [org.springframework.context-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:469) [org.springframework.context-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at br.com.caelum.vraptor.ioc.spring.SpringBasedContainer.start(SpringBasedContainer.java:106) [vraptor-3.4.1.jar:]
at br.com.caelum.vraptor.ioc.spring.SpringProvider.start(SpringProvider.java:87) [vraptor-3.4.1.jar:]
at br.com.caelum.vraptor.VRaptor.init(VRaptor.java:108) [vraptor-3.4.1.jar:]
at br.com.caelum.vraptor.VRaptor.init(VRaptor.java:102) [vraptor-3.4.1.jar:]
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:447) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3269) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3865) [jbossweb-7.0.13.Final.jar:]
at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.7.0_05]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_05]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_05]
Caused by: org.hibernate.service.UnknownUnwrapTypeException: Cannot unwrap to requested type [javax.sql.DataSource]
at org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl.unwrap(DriverManagerConnectionProviderImpl.java:91) [hibernate-core-4.1.7.Final.jar:4.1.7.Final]
at org.springframework.orm.hibernate4.SessionFactoryUtils.getDataSource(SessionFactoryUtils.java:101) [org.springframework.orm-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.orm.hibernate4.HibernateTransactionManager.afterPropertiesSet(HibernateTransactionManager.java:264) [org.springframework.orm-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514) [org.springframework.beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452) [org.springframework.beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
… 22 more

02:41:23,188 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-2) Error filterStart
02:41:23,188 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-2) Context [/Eplus] startup failed due to previous errors
02:41:23,221 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.web.deployment.default-host./Eplus: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./Eplus: JBAS018040: Failed to start context
at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:95)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.7.0_05]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_05]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_05]

02:41:23,233 INFO [org.jboss.as] (MSC service thread 1-2) JBAS015951: Admin console listening on http://127.0.0.1:9990
02:41:23,234 ERROR [org.jboss.as] (MSC service thread 1-2) JBAS015875: JBoss AS 7.1.1.Final "Brontes" started (with errors) in 16744ms - Started 325 of 404 services (2 services failed or missing dependencies, 76 services are passive or on-demand)
02:41:23,440 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015870: Deploy of deployment "Eplus.war" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.web.deployment.default-host./Eplus" => "org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./Eplus: JBAS018040: Failed to start context"}}
02:41:23,738 INFO [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015877: Stopped deployment Eplus.war in 296ms
02:41:23,740 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report
JBAS014777: Services which failed to start: service jboss.web.deployment.default-host./Eplus: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./Eplus: JBAS018040: Failed to start context

02:41:23,744 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014671: Failed services" => {"jboss.web.deployment.default-host./Eplus" => "org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./Eplus: JBAS018040: Failed to start context"}}}}[/code]

dá uma olhada na doc do spring e veja se eles tem uma versão dessa classe pra hibernate4…

Bom como não encontrei nada com o hibernate 4, voltei pro 3 mesmo:

[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:tx=“http://www.springframework.org/schema/tx
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">

&lt;tx:annotation-driven /&gt;  

&lt;bean id="transactionManager"  
    class="org.springframework.orm.hibernate3.HibernateTransactionManager"&gt;  
    &lt;property name="sessionFactory" ref="sessionFactory" /&gt;  
&lt;/bean&gt;  
      
&lt;bean id="sessionFactory"  
    class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"&gt;  
    &lt;property name="configLocation"&gt;  
        &lt;value&gt;classpath:/hibernate.cfg.xml&lt;/value&gt;  
    &lt;/property&gt;     
&lt;/bean&gt;  

</beans> [/code]

tive depois que criar um interface para resolver as dependencias(Spring me obriga =/):

[code]@Component
public class HibernateUsuarioDao implements UsuarioDAO
{
private final Session session;

public HibernateUsuarioDao(Session session)
{
	this.session=session;
}

@Transactional
public void salvar(Usuario usuario) throws EplusException
{
	try
	{
		ApplicationLog.info(this, "Salvando novo usuário");
		session.save(usuario);
		//transaction.commit();
	}
	catch(Exception e)
	{
		//transaction.rollback();
		throw new EplusException(this, e);
	}		
}	

}[/code]

Incluindo todos os jars minhas transações são controladas pelo spring :smiley: