JBoss 7.1.1 无法使用spring 创建web service 客户端(Trying to launch WebService Client fail
JBoss 7.1.1 无法使用spring 创建web service 客户端
3:25:03,928 ERROR [org.quartz.core.JobRunShell] (quartzScheduler_Worker-1) Job DEFAULT.rcdLogTrackerJobDetail threw an unhandled Exception: : java.lang.NoClassDefFoundError: org/springframework/beans/BeansException
at org.jboss.wsf.stack.cxf.client.configuration.JBossWSBusFactory.getSpringBusFactory(JBossWSBusFactory.java:120)
at org.jboss.wsf.stack.cxf.client.configuration.JBossWSBusFactory.createBus(JBossWSBusFactory.java:54)
at org.jboss.wsf.stack.cxf.client.ProviderImpl.setValidThreadDefaultBus(ProviderImpl.java:213)
at org.jboss.wsf.stack.cxf.client.ProviderImpl.createServiceDelegate(ProviderImpl.java:140)
at javax.xml.ws.Service.<init>(Service.java:57) [jboss-jaxws-api_2.2_spec-2.0.0.Final.jar:2.0.0.Final]
.....
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:113) [spring-context-support-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.quartz.core.JobRunShell.run(JobRunShell.java:223) [quartz-1.8.6.jar:]
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549) [quartz-1.8.6.jar:]
Caused by: java.lang.ClassNotFoundException: org.springframework.beans.BeansException from [Module "org.apache.cxf:main" from local module loader @4f2c61fe (roots: /opt/extcomp/jboss-as-7.1.1.Final/modules)]
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)
... 14 more
03:25:03,949 ERROR [org.quartz.core.ErrorLogger] (quartzScheduler_Worker-1) Job (DEFAULT.rcdLogTrackerJobDetail threw an exception.: org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: java.lang.NoClassDefFoundError: org/springframework/beans/BeansException]
at org.quartz.core.JobRunShell.run(JobRunShell.java:234) [quartz-1.8.6.jar:]
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549) [quartz-1.8.6.jar:]
Caused by: java.lang.NoClassDefFoundError: org/springframework/beans/BeansException
at org.jboss.wsf.stack.cxf.client.configuration.JBossWSBusFactory.getSpringBusFactory(JBossWSBusFactory.java:120)
at org.jboss.wsf.stack.cxf.client.configuration.JBossWSBusFactory.createBus(JBossWSBusFactory.java:54)
at org.jboss.wsf.stack.cxf.client.ProviderImpl.setValidThreadDefaultBus(ProviderImpl.java:213)
at org.jboss.wsf.stack.cxf.client.ProviderImpl.createServiceDelegate(ProviderImpl.java:140)
at javax.xml.ws.Service.<init>(Service.java:57) [jboss-jaxws-api_2.2_spec-2.0.0.Final.jar:2.0.0.Final]
.....
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:113) [spring-context-support-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.quartz.core.JobRunShell.run(JobRunShell.java:223) [quartz-1.8.6.jar:]
... 1 more
Caused by: java.lang.ClassNotFoundException: org.springframework.beans.BeansException from [Module "org.apache.cxf:main" from local module loader @4f2c61fe (roots: /opt/extcomp/jboss-as-7.1.1.Final/modules)]
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)
... 14 more
JBoss 捆绑JBossWS-cxf-4.0.2.GA,如果要使用spring 部署webservice 需要更新4.0以上版本(JBoss-cxf-4.1.1.Final)不然会报:
Caused by: java.lang.NoClassDefFoundError: org/springframework/beans/BeansException
at org.jboss.wsf.stack.cxf.client.configuration.JBossWSBusFactory.getSpringBusFactory(JBossWSBus
Factory.java:120
这是一个bug
1.下载jbossws-cxf-4.1.0.Final.zip包 http://jbossws.jboss.org/downloads/latest
2.安装ant http://ant.apache.org/bindownload.cgi 需要配置环境变量
3.解压jbossws-cxf-4.1.0.Final.zip 更改ant.properties.example 名为 ant.properties 并更改内容
执行ant 命令
ant -Dspring=true deploy-jboss711(此时不要运行Jboss服务器不要会buildi失败)
参考文章:
https://carlobertoldi.wordpress.com/2013/03/01/using-spring-on-jboss-7-1-1/
https://developer.jboss.org/wiki/JBossWS-Installation
https://developer.jboss.org/thread/194685?tstart=0