0
回答
jboss容器分离后启动时报出java.lang.ClassCastException
利用AWS快速构建适用于生产的无服务器应用程序,免费试用12个月>>>   

在做一个jboss容器分离的,已经新建了profile目录,而且deploy下我也确定只有一个ear发布包和一个数据源的xml配置。但是在启动的时候还是报出以下的问题

11:40:17,822 ERROR [AbstractKernelController] Error installing to Start: name=persistence.unit:unitName=dcBackEnd-beta-1.0.0.HEAD.ear/dcBackEnd-1.0.0
jar#dcBackEnd-ejbPU state=Create
java.lang.ClassCastException: org.hibernate.ejb.HibernatePersistence cannot be cast to javax.persistence.spi.PersistenceProvider
        at org.jboss.jpa.deployment.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:300)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59)
        at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:150)
        at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
        at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:241)
        at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47)
        at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:109)
        at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:70)
        at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:221)
        at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54)
        at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42)
        at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
        at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
        at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
        at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
        at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
        at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
        at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:774)
        at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:540)
        at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:121)
        at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:51)
        at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
        at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
        at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
        at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
        at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
        at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)
        at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210)
        at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
        at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
        at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
        at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
        at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
        at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
        at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
        at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)
        at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
        at org.jboss.system.server.profileservice.repository.ProfileDeployAction.install(ProfileDeployAction.java:70)
        at org.jboss.system.server.profileservice.repository.AbstractProfileAction.install(AbstractProfileAction.java:53)
        at org.jboss.system.server.profileservice.repository.AbstractProfileService.install(AbstractProfileService.java:361)
        at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
        at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
        at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
        at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
        at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
        at org.jboss.system.server.profileservice.repository.AbstractProfileService.activateProfile(AbstractProfileService.java:306)
        at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:271)
        at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)
        at org.jboss.Main.boot(Main.java:221)
        at org.jboss.Main$1.run(Main.java:556)
        at java.lang.Thread.run(Thread.java:745)
11:40:17,983 INFO  [STDOUT] load properties file:base.properties
11:40:17,983 INFO  [STDOUT] load properties file:constants.properties
11:40:17,983 INFO  [STDOUT] load properties file:resource_message.properties
11:40:17,983 INFO  [STDOUT] load properties file:msgengine_client.properties
11:40:17,983 INFO  [STDOUT] 2015-07-06 11:40:17 983[INFO]com.tom.ule.dcBackEnd.util.DBDataContainer.init(DBDataContainer.java:209):constants refresh
requence is 1 hour!
11:40:17,983 INFO  [STDOUT] 2015-07-06 11:40:17 983[INFO]com.tom.ule.dcBackEnd.util.DBDataContainer.init(DBDataContainer.java:211):loading constants
uccess!
11:40:17,983 INFO  [STDOUT] 2015-07-06 11:40:17 983[INFO]com.tom.ule.dcBackEnd.util.JBossStartUp.start(JBossStartUp.java:48):hold 20s......
11:40:19,010 ERROR [STDERR] SLF4J: slf4j-api 1.6.x (or later) is incompatible with this binding.
11:40:19,010 ERROR [STDERR] SLF4J: Your binding is version 1.5.5 or earlier.
11:40:19,010 ERROR [STDERR] SLF4J: Upgrade your binding to version 1.6.x. or 2.0.x
11:40:19,010 ERROR [STDERR] Exception in thread "Timer-3"
11:40:19,010 ERROR [STDERR] java.lang.NoSuchMethodError: org.slf4j.impl.StaticLoggerBinder.getSingleton()Lorg/slf4j/impl/StaticLoggerBinder;
11:40:19,010 ERROR [STDERR]     at org.slf4j.LoggerFactory.bind(LoggerFactory.java:121)
11:40:19,010 ERROR [STDERR]     at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:111)
11:40:19,010 ERROR [STDERR]     at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:268)
11:40:19,010 ERROR [STDERR]     at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:241)
11:40:19,010 ERROR [STDERR]     at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:254)
11:40:19,010 ERROR [STDERR]     at org.hibernate.cfg.Configuration.<clinit>(Configuration.java:197)
11:40:19,010 ERROR [STDERR]     at org.hibernate.ejb.Ejb3Configuration.<clinit>(Ejb3Configuration.java:133)
11:40:19,011 ERROR [STDERR]     at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:55)
11:40:19,011 ERROR [STDERR]     at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:52)
11:40:19,011 ERROR [STDERR]     at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:34)
11:40:19,011 ERROR [STDERR]     at com.tom.ule.dcBackEnd.util.EntityManageFactory.getEntityManagerFactory(EntityManageFactory.java:13)
11:40:19,011 ERROR [STDERR]     at com.tom.ule.dcBackEnd.dao.OrderSysbookJpaController.getEntityManager(OrderSysbookJpaController.java:39)
11:40:19,011 ERROR [STDERR]     at com.tom.ule.dcBackEnd.dao.OrderSysbookJpaController.loadSysbook(OrderSysbookJpaController.java:282)
11:40:19,027 ERROR [STDERR]     at com.tom.ule.dcBackEnd.util.DBDataContainer.loadOrderSysbook(DBDataContainer.java:275)
11:40:19,027 ERROR [STDERR]     at com.tom.ule.dcBackEnd.util.DBDataContainer.run(DBDataContainer.java:217)
11:40:19,027 ERROR [STDERR]     at java.util.TimerThread.mainLoop(Timer.java:555)
11:40:19,027 ERROR [STDERR]     at java.util.TimerThread.run(Timer.java:505)
11:40:37,990 INFO  [STDOUT] 2015-07-06 11:40:37 990[INFO]com.tom.ule.dcBackEnd.util.JBossStartUp.start(JBossStartUp.java:50):release!
11:40:38,072 ERROR [ProfileServiceBootstrap] Failed to load profile: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):

目前我搜索这个问题网上说法是其中项目lib下的jar包和jboss自带的jar包冲突,但是我将jboss下client目录下的jar包都删除了,启动后还是报这个错,现在不知道具体什么原因该怎么解决了。


                                                                    有遇到过同类问题并解决的朋友帮忙下,谢谢

举报
forestgelu
发帖于2年前 0回/278阅
顶部