1 Reply Latest reply on Sep 14, 2015 3:43 AM by swarna latha

    Can't find a persistence unit named null in subdeployment while upgarade Jboss from 5.1.GA to 7.1.1.final

    swarna latha Newbie

      Hi,

      Project : web dynamic project using Java EE perspective.

      Now i am working on jboss upgrade 5.1.1 GA to Jboss-as-7.1.1.final.

      application is working fine in 5 version means am able to generate EAR with out issues. but when i am trying to generate EAR using with Jboss-as-7.1.1.final..

       

      Getting below exceptions:

      12:24:01,896 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.deployment.subunit."TourIndiaEAR.ear"."TourIndia.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."TourIndiaEAR.ear"."TourIndia.war".INSTALL: Failed to process phase INSTALL of subdeployment "TourIndia.war" of deployment "TourIndiaEAR.ear"

          at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

          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(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_55]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_55]

          at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_55]

      Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011047: Component class com.tourindia.Tia12SitesHome for component Tia12SitesHome has errors:

      JBAS011440: Can't find a persistence unit named null in subdeployment "TourIndia.war" of deployment "TourIndiaEAR.ear"

          at org.jboss.as.ee.component.deployers.ModuleJndiBindingProcessor$1.handle(ModuleJndiBindingProcessor.java:169)

          at org.jboss.as.ee.component.ClassDescriptionTraversal.run(ClassDescriptionTraversal.java:54)

          at org.jboss.as.ee.component.deployers.ModuleJndiBindingProcessor.processClassConfigurations(ModuleJndiBindingProcessor.java:162)

          at org.jboss.as.ee.component.deployers.ModuleJndiBindingProcessor.deploy(ModuleJndiBindingProcessor.java:155)

          at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

          ... 5 more

       

      12:24:02,134 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015870: Deploy of deployment "TourIndiaEAR.ear" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.deployment.subunit.\"TourIndiaEAR.ear\".\"TourIndia.war\".INSTALL" => "org.jboss.msc.service.StartException in service jboss.deployment.subunit.\"TourIndiaEAR.ear\".\"TourIndia.war\".INSTALL: Failed to process phase INSTALL of subdeployment \"TourIndia.war\" of deployment \"TourIndiaEAR.ear\""}}

      12:24:02,156 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015877: Stopped deployment TourIndia.war in 22ms

      12:24:02,184 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015877: Stopped deployment TourIndiaEAR.ear in 52ms

      12:24:02,187 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report

      JBAS014777:   Services which failed to start:      service jboss.deployment.subunit."TourIndiaEAR.ear"."TourIndia.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."TourIndiaEAR.ear"."TourIndia.war".INSTALL: Failed to process phase INSTALL of subdeployment "TourIndia.war" of deployment "TourIndiaEAR.ear"

       

      12:24:02,193 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.deployment.subunit.\"TourIndiaEAR.ear\".\"TourIndia.war\".INSTALL" => "org.jboss.msc.service.StartException in service jboss.deployment.subunit.\"TourIndiaEAR.ear\".\"TourIndia.war\".INSTALL: Failed to process phase INSTALL of subdeployment \"TourIndia.war\" of deployment \"TourIndiaEAR.ear\""}}}}

       

       

      I went through with google to resolve the issue...they are talking about persistence.xml file...but in my project have not the persistence.xml file....in my project have "hibernate.cfg.xml" file...

       

      But i created persistence.xml file and placed into TourIndiaEAR->EarContent->META-INF.....when i placed there "JBAS011440: Can't find a persistence unit named null in subdeployment "TourIndia.war" of deployment "TourIndiaEAR.ear"" this exception is removed...

       

      used persistence.xml

      <?xml version="1.0" encoding="UTF-8"?>

      <persistence 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"

          version="2.0">

          <persistence-unit name="accessControlDatabase">

              <provider>org.hibernate.ejb.HibernatePersistence</provider>

              <jta-data-source>java:jboss/datasources/ExampleDS</jta-data-source>

              <properties>

                  <property name="hibernate.hbm2ddl.auto" value="create-drop" />

              </properties>

          </persistence-unit>

      </persistence>

       

       

      Now i got different exceptions: Plese find the attached log file.......

      03:34:21,084 ERROR [stderr] (MSC service thread 1-4) org.hibernate.service.classloading.spi.ClassLoadingException: Specified JDBC Driver oracle.jdbc.driver.OracleDriver class not found

      03:34:21,085 ERROR [stderr] (MSC service thread 1-4)     at org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl.configure(DriverManagerConnectionProviderImpl.java:107)

      03:34:21,086 ERROR [stderr] (MSC service thread 1-4)     at org.hibernate.service.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:75)

      03:34:21,087 ERROR [stderr] (MSC service thread 1-4)     at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:159)

      03:34:21,087 INFO  [org.hibernate.service.jdbc.connections.internal.ConnectionProviderInitiator] (MSC service thread 1-1) HHH000130: Instantiating explicit connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider

      03:34:21,088 ERROR [stderr] (MSC service thread 1-4)     at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:131)

      03:34:21,088 ERROR [stderr] (MSC service thread 1-4)     at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.buildJdbcConnectionAccess(JdbcServicesImpl.java:223)

      03:34:21,089 ERROR [stderr] (MSC service thread 1-4)     at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:89)

      03:34:21,090 ERROR [stderr] (MSC service thread 1-4)     at org.hibernate.service.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:75)

      03:34:21,090 ERROR [stderr] (MSC service thread 1-4)     at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:159)

      03:34:21,091 ERROR [stderr] (MSC service thread 1-4)     at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:131)

      03:34:21,092 ERROR [stderr] (MSC service thread 1-4)     at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:73)

      03:34:21,092 ERROR [stderr] (MSC service thread 1-4)     at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2279)

      03:34:21,093 ERROR [stderr] (MSC service thread 1-4)     at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2275)

      03:34:21,093 ERROR [stderr] (MSC service thread 1-4)     at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1744)

      03:34:21,094 ERROR [stderr] (MSC service thread 1-4)     at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1784)

      03:34:21,095 ERROR [stderr] (MSC service thread 1-4)     at com.tourindia.Startsession.openSession(Startsession.java:19)

      03:34:21,095 ERROR [stderr] (MSC service thread 1-4)     at com.tourindia.MapAppWebServices.<init>(MapAppWebServices.java:126)

      03:34:21,096 ERROR [stderr] (MSC service thread 1-4)     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

      03:34:21,096 ERROR [stderr] (MSC service thread 1-4)     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)

      03:34:21,097 ERROR [stderr] (MSC service thread 1-4)     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

      03:34:21,098 ERROR [stderr] (MSC service thread 1-4)     at java.lang.reflect.Constructor.newInstance(Constructor.java:526)

      03:34:21,098 ERROR [stderr] (MSC service thread 1-4)     at java.lang.Class.newInstance(Class.java:374)

      03:34:21,099 ERROR [stderr] (MSC service thread 1-4)     at org.jboss.wsf.stack.cxf.configuration.NonSpringBusHolder.newInstance(NonSpringBusHolder.java:170)

      03:34:21,099 ERROR [stderr] (MSC service thread 1-4)     at org.jboss.wsf.stack.cxf.configuration.NonSpringBusHolder.configure(NonSpringBusHolder.java:96)

      03:34:21,100 ERROR [stderr] (MSC service thread 1-4)     at org.jboss.wsf.stack.cxf.deployment.aspect.BusDeploymentAspect.startDeploymentBus(BusDeploymentAspect.java:113)

      03:34:21,100 ERROR [stderr] (MSC service thread 1-4)     at org.jboss.wsf.stack.cxf.deployment.aspect.BusDeploymentAspect.start(BusDeploymentAspect.java:66)

      03:34:21,101 ERROR [stderr] (MSC service thread 1-4)     at org.jboss.as.webservices.deployers.AspectDeploymentProcessor.deploy(AspectDeploymentProcessor.java:74)

      03:34:21,102 ERROR [stderr] (MSC service thread 1-4)     at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113)

      03:34:21,102 ERROR [stderr] (MSC service thread 1-4)     at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)

      03:34:21,103 ERROR [stderr] (MSC service thread 1-4)     at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)

      03:34:21,103 ERROR [stderr] (MSC service thread 1-4)     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

      03:34:21,104 ERROR [stderr] (MSC service thread 1-4)     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

      03:34:21,105 ERROR [stderr] (MSC service thread 1-4)     at java.lang.Thread.run(Thread.java:744)

      03:34:21,105 ERROR [stderr] (MSC service thread 1-4) Caused by: org.hibernate.service.classloading.spi.ClassLoadingException: Unable to load class [oracle.jdbc.driver.OracleDriver]

      03:34:21,106 ERROR [stderr] (MSC service thread 1-4)     at org.hibernate.service.classloading.internal.ClassLoaderServiceImpl.classForName(ClassLoaderServiceImpl.java:141)

      03:34:21,107 ERROR [stderr] (MSC service thread 1-4)     at org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl.configure(DriverManagerConnectionProviderImpl.java:104)

      03:34:21,107 ERROR [stderr] (MSC service thread 1-4)     ... 31 more

      03:34:21,108 ERROR [stderr] (MSC service thread 1-4) Caused by: java.lang.ClassNotFoundException: Could not load requested class : oracle.jdbc.driver.OracleDriver

      03:34:21,109 ERROR [stderr] (MSC service thread 1-4)     at org.hibernate.service.classloading.internal.ClassLoaderServiceImpl$1.findClass(ClassLoaderServiceImpl.java:99)

      03:34:21,109 ERROR [stderr] (MSC service thread 1-4)     at java.lang.ClassLoader.loadClass(ClassLoader.java:425)

      03:34:21,110 ERROR [stderr] (MSC service thread 1-4)     at java.lang.ClassLoader.loadClass(ClassLoader.java:358)

      03:34:21,110 ERROR [stderr] (MSC service thread 1-4)     at java.lang.Class.forName0(Native Method)

      03:34:21,111 ERROR [stderr] (MSC service thread 1-4)     at java.lang.Class.forName(Class.java:270)

      03:34:21,111 ERROR [stderr] (MSC service thread 1-4)     at org.hibernate.service.classloading.internal.ClassLoaderServiceImpl.classForName(ClassLoaderServiceImpl.java:138)

      03:34:21,112 ERROR [stderr] (MSC service thread 1-4)     ... 32 more

      03:34:21,151 INFO  [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (MSC service thread 1-4) Creating Service {http://tourindia.com/}MapAppWebServicesService from class com.tourindia.MapAppWebServices

      03:34:21,382 INFO  [org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl] (Finalizer) HHH000030: Cleaning up connection pool [null]

      03:34:21,405 INFO  [org.hibernate.dialect.Dialect] (MSC service thread 1-1) HHH000400: Using dialect: org.hibernate.dialect.H2Dialect

      03:34:21,411 WARN  [org.hibernate.dialect.H2Dialect] (MSC service thread 1-1) HHH000431: Unable to determine H2 database version, certain features may not work

      03:34:21,414 INFO  [org.hibernate.engine.jdbc.internal.LobCreatorBuilder] (MSC service thread 1-1) HHH000423: Disabling contextual LOB creation as JDBC driver reported JDBC version [3] less than 4

      03:34:21,425 INFO  [org.hibernate.engine.transaction.internal.TransactionFactoryInitiator] (MSC service thread 1-1) HHH000268: Transaction strategy: org.hibernate.engine.transaction.internal.jta.CMTTransactionFactory

      03:34:21,434 INFO  [org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory] (MSC service thread 1-1) HHH000397: Using ASTQueryTranslatorFactory

      03:34:21,472 ERROR [org.hibernate.AssertionFailure] (MSC service thread 1-1) HHH000099: an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session): java.lang.ClassNotFoundException: com.tourindia.Tia12EnterpriseMoreOptions from [Module "org.hibernate:main" from local module loader @7e2ac92f (roots: /software/jboss-as-7.1.1.Final/modules)]

      03:34:21,474 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC00001: Failed to start service jboss.persistenceunit."TourIndiaEAR.ear#accessControlDatabase": org.jboss.msc.service.StartException in service jboss.persistenceunit."TourIndiaEAR.ear#accessControlDatabase": Failed to start service

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1767) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_55]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_55]

          at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_55]

      Caused by: javax.persistence.PersistenceException: [PersistenceUnit: accessControlDatabase] Unable to build EntityManagerFactory

          at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:914)

          at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:889)

          at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:73)

          at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:162)

          at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.start(PersistenceUnitServiceImpl.java:85)

          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]

          ... 3 more

      Caused by: org.hibernate.HibernateException: Error applying BeanValidation relational constraints

          at org.hibernate.cfg.beanvalidation.BeanValidationIntegrator.applyRelationalConstraints(BeanValidationIntegrator.java:219)

          at org.hibernate.cfg.beanvalidation.BeanValidationIntegrator.integrate(BeanValidationIntegrator.java:126)

          at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:301)

          at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1746)

          at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:84)

          at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:904)

          ... 9 more

      Caused by: java.lang.reflect.InvocationTargetException

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_55]

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_55]

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_55]

          at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_55]

          at org.hibernate.cfg.beanvalidation.BeanValidationIntegrator.applyRelationalConstraints(BeanValidationIntegrator.java:208)

          ... 14 more

      Caused by: org.hibernate.AssertionFailure: Entity class not found

          at org.hibernate.cfg.beanvalidation.TypeSafeActivator.applyDDL(TypeSafeActivator.java:134)

          ... 19 more

       

      Please help me...

      Thanks in advance...