jboss容器分离后启动时报出java.lang.ClassCastException

问题描述

jboss容器分离后启动时报出java.lang.ClassCastException

在做一个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)

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

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

解决方案

包冲突吧,自己检查检查,项目重新编译一下

时间: 2024-11-01 05:32:22

jboss容器分离后启动时报出java.lang.ClassCastException的相关文章

oracle 11g-win8 安装oracle11g时报出java.lang.nullpointerexception

问题描述 win8 安装oracle11g时报出java.lang.nullpointerexception win8 安装oracle11g时报出java.lang.nullpointerexception,无法进入安装界面,求解决! 谢谢 解决方案 你之前有安装过JDK之类的吗? 1.先检查一下你下载的包的验证一下有没错误,MD5值等 2.看看一些环境变量有没有问题关于JAVA的一些变量 3.重新建一个用户,用户名不要带特殊字符.比如test等加到管理员组,再这个帐户下安装试试

使用collect函数时出现java.lang.ClassCastException: cannot assign instance of

问题描述 我输入的是一个csv文件,每行内容如下HX332780,14/7/5,OTHEROFFENSE,PROBATIONVIOLATION,PARKINGLOT/GARAGE(NON.RESID.),Y,N,1113HX332854,14/7/5,OTHEROFFENSE,HARASSMENTBYTELEPHONE,APARTMENT,N,N,1533HX332743,14/7/5,CRIMINALDAMAGE,TOVEHICLE,STREET,N,N,1021HX332735,14/7/5

spring-Spring 启动报错java.lang.IllegalStateException

问题描述 Spring 启动报错java.lang.IllegalStateException java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: Root WebApplicationContext: startup date [Tue Nov 03 09:21:01 CS

地方-报出java.lang.ClassNotFoundException

问题描述 报出java.lang.ClassNotFoundException Servlet.service() for servlet [tomcat.com.MyTestServlet] in context with path [/MyTest] threw exception [Servlet execution threw an exception] with root cause java.lang.ClassNotFoundException: net.sf.json.JSONO

iterator-最后一句的输出应该怎么写才会有键值对输出? java.lang.ClassCastException

问题描述 最后一句的输出应该怎么写才会有键值对输出? java.lang.ClassCastException public class Student { private String name; private String sex; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getSex() { return se

ehcache-EHCache报出java.lang.IllegalMonitorStateException异常

问题描述 EHCache报出java.lang.IllegalMonitorStateException异常 我写的代码如下所示,其中EHCacheService.putIn是封装了EHCache的put函数,key=1,一直key++. import java.util.concurrent.Callable; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import j

DRP问题集结(一)-Tomcat无法启动,报错java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory

             问题一:  Tomcat无法启动,报错java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory           问题二:[Error]JavaWeb: 严重: Failed to initialize end point associated with ProtocolHandler ["http-bio-8080"]           问题三:The APR based Apa

求高手解答 java.lang.ClassCastException: org.quartz.simpl.SimpleThreadPool

问题描述 使用quartz的时候,启动程序就抛出如下异常,不知道问题出在那,求解决...严重:Spring容器初始化过程中出现异常[wrzs_core]org.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'getScheduling':Invocationofinitmethodfailed;nestedexceptionisorg.quartz.SchedulerException:T

java.lang.ClassCastException

问题描述 调用下面方法后,publicvoidsave(CapestransientInstance){log.debug("savingCapesinstance");try{getHibernateTemplate().save(transientInstance);log.debug("savesuccessful");}catch(RuntimeExceptionre){log.error("savefailed",re);throwre