Boa tarde.
Tenho uma aplicação que roda tomcat, estou tendando migrar para o jbos-as-7, e acontece o abaixo:
13:34:01,062 INFO [org.jboss.as.connector] (MSC service thread 1-4) Starting JCA Subsystem (JBoss IronJacamar 1.0.3.Final)
13:34:01,218 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) Bound data source [java:/MysqlDS]
13:34:01,218 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) Bound data source [java:jboss/datasources/ExampleDS]
13:34:01,218 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-4) Bound data source [java:/ContatoPU]
13:34:01,218 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-3) Bound data source [java:jboss/datasources/PostgresDS]
13:34:01,218 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-1) Bound data source [java:/CrudDS]
13:34:01,578 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) Starting deployment of "integrator-1.0.0-SNAPSHOT.war"
13:34:01,593 INFO [org.jboss.as.deployment] (MSC service thread 1-4) Started FileSystemDeploymentService for directory C:\tool\jboss-as-web-7.0.2.Final\standalone\deployments
13:34:07,000 WARN [org.jboss.as.server.deployment] (MSC service thread 1-2) Class Path entry jaxb-api.jar in "/C:/tool/jboss-as-web-7.0.2.Final/bin/content/integrator-1.0.0-SNAPSHOT.war/WEB-INF/lib/jaxb-impl-2.1.3.jar" does not point to a valid jar for a Class-Path reference.
13:34:07,000 WARN [org.jboss.as.server.deployment] (MSC service thread 1-2) Class Path entry activation.jar in "/C:/tool/jboss-as-web-7.0.2.Final/bin/content/integrator-1.0.0-SNAPSHOT.war/WEB-INF/lib/jaxb-impl-2.1.3.jar" does not point to a valid jar for a Class-Path reference.
13:34:07,015 WARN [org.jboss.as.server.deployment] (MSC service thread 1-2) Class Path entry jsr173_1.0_api.jar in "/C:/tool/jboss-as-web-7.0.2.Final/bin/content/integrator-1.0.0-SNAPSHOT.war/WEB-INF/lib/jaxb-impl-2.1.3.jar" does not point to a valid jar for a Class-Path reference.
13:34:07,015 WARN [org.jboss.as.server.deployment] (MSC service thread 1-2) Class Path entry jaxb1-impl.jar in "/C:/tool/jboss-as-web-7.0.2.Final/bin/content/integrator-1.0.0-SNAPSHOT.war/WEB-INF/lib/jaxb-impl-2.1.3.jar" does not point to a valid jar for a Class-Path reference.
13:34:07,312 INFO [org.jboss.as.jpa] (MSC service thread 1-4) added javax.persistence.api, javaee.api, org.jboss.as.jpa, org.javassist dependencies to integrator-1.0.0-SNAPSHOT.war
13:34:07,812 INFO [org.jboss.as.jpa] (MSC service thread 1-4) Deployment has its own Persistence Provider class org.hibernate.ejb.HibernatePersistence
13:34:07,984 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-4) Deploying non-JDBC-compliant driver class com.mysql.jdbc.Driver (version 5.1)
13:34:08,281 INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/integrator-1.0.0-SNAPSHOT]] (MSC service thread 1-1) Initializing Spring root WebApplicationContext
13:34:08,281 INFO [stdout] (MSC service thread 1-1) INFO : org.springframework.web.context.ContextLoader - Root WebApplicationContext: initialization started
13:34:08,312 INFO [stdout] (MSC service thread 1-1) INFO : org.springframework.web.context.support.XmlWebApplicationContext - Refreshing Root WebApplicationContext: startup date [Wed Mar 28 13:34:08 BOT 2012]; root of context hierarchy
13:34:08,343 INFO [stdout] (MSC service thread 1-1) INFO : org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext.xml]
13:34:08,640 INFO [stdout] (MSC service thread 1-1) INFO : org.springframework.context.annotation.ClassPathBeanDefinitionScanner - JSR-250 'javax.annotation.ManagedBean' found and supported for component scanning
13:34:08,640 INFO [stdout] (MSC service thread 1-1) INFO : org.springframework.context.annotation.ClassPathBeanDefinitionScanner - JSR-330 'javax.inject.Named' annotation found and supported for component scanning
13:34:08,843 INFO [stdout] (MSC service thread 1-1) INFO : org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor - JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
13:34:08,890 INFO [stdout] (MSC service thread 1-1) INFO : org.springframework.beans.factory.support.DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@433333: defining beans [entityManagerFactory,contatoDao,contatoController,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,transactionManager,org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping#0,org.springframework.format.support.FormattingConversionServiceFactoryBean#0,org.springframework.validation.beanvalidation.LocalValidatorFactoryBean#0,org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter#0,org.springframework.web.servlet.handler.MappedInterceptor#0,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor]; root of factory hierarchy
13:34:08,906 INFO [stdout] (MSC service thread 1-1) INFO : org.springframework.beans.factory.support.DefaultListableBeanFactory - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@433333: defining beans [entityManagerFactory,contatoDao,contatoController,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,transactionManager,org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping#0,org.springframework.format.support.FormattingConversionServiceFactoryBean#0,org.springframework.validation.beanvalidation.LocalValidatorFactoryBean#0,org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter#0,org.springframework.web.servlet.handler.MappedInterceptor#0,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor]; root of factory hierarchy
13:34:08,906 INFO [stdout] (MSC service thread 1-1) ERROR: org.springframework.web.context.ContextLoader - Context initialization failed
13:34:08,906 INFO [stdout] (MSC service thread 1-1) org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: No persistence unit with name 'ContatoPU' found
13:34:08,921 INFO [stdout] (MSC service thread 1-1) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1412)
13:34:08,921 INFO [stdout] (MSC service thread 1-1) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
13:34:08,921 INFO [stdout] (MSC service thread 1-1) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
13:34:08,921 INFO [stdout] (MSC service thread 1-1) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
13:34:08,921 INFO [stdout] (MSC service thread 1-1) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
13:34:08,921 INFO [stdout] (MSC service thread 1-1) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
13:34:08,921 INFO [stdout] (MSC service thread 1-1) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
13:34:08,921 INFO [stdout] (MSC service thread 1-1) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:557)
13:34:08,921 INFO [stdout] (MSC service thread 1-1) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
13:34:08,921 INFO [stdout] (MSC service thread 1-1) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
13:34:08,921 INFO [stdout] (MSC service thread 1-1) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
13:34:08,921 INFO [stdout] (MSC service thread 1-1) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
13:34:08,921 INFO [stdout] (MSC service thread 1-1) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
13:34:08,921 INFO [stdout] (MSC service thread 1-1) at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3368)
13:34:08,921 INFO [stdout] (MSC service thread 1-1) at org.apache.catalina.core.StandardContext.start(StandardContext.java:3821)
13:34:08,921 INFO [stdout] (MSC service thread 1-1) at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:70)
13:34:08,921 INFO [stdout] (MSC service thread 1-1) at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824)
13:34:08,921 INFO [stdout] (MSC service thread 1-1) at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759)
13:34:08,921 INFO [stdout] (MSC service thread 1-1) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
13:34:08,921 INFO [stdout] (MSC service thread 1-1) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
13:34:08,921 INFO [stdout] (MSC service thread 1-1) at java.lang.Thread.run(Thread.java:619)
13:34:08,921 INFO [stdout] (MSC service thread 1-1) Caused by: java.lang.IllegalArgumentException: No persistence unit with name 'ContatoPU' found
applicationContext.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:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
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-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="persistenceUnitName" value="ContatoPU" />
</bean>
<context:component-scan base-package="br.com.integrator"/>
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory"/>
</bean>
<mvc:annotation-driven/>
<tx:annotation-driven />
<context:annotation-config />
</beans>
persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.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_2_0.xsd">
<persistence-unit name="ContatoPU" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLInnoDBDialect" />
<property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver" />
<property name="hibernate.connection.url" value="jdbc:mysql://localhost/springmvc" />
<property name="hibernate.connection.username" value="root" />
<property name="hibernate.connection.password" value="root" />
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.format_sql" value="true" />
<property name="hibernate.hbm2ddl.auto" value="create" />
</properties>
</persistence-unit>
</persistence>
Alguem poderia me ajudar a resolver esse problema.