XXL-JOB使用问题总结

问题一:XXL-JOB的服务器端和用户端版本必须保持一致,不然会报错

问题二: 由于xxl-job使用的一些依赖包与原有项目中的依赖包存在版本冲突造成java.lang.NoClassDefFoundError错误

本人实际遇到问题:

1、报错信息如下,造成该问题原因,由于hessian包版本如项目中其他包存在冲突造成,解决方案,移除xxl-job自带的hessian

添加更低版本的包。

Exception in thread "xxl-job, executor ExecutorRegistryThread" 

java.lang.NoClassDefFoundError: com/caucho/hessian/io/Hessian2Output
	at com.xxl.rpc.serialize.impl.HessianSerializer.serialize

(HessianSerializer.java:21)
	at com.xxl.rpc.remoting.net.impl.netty_http.client.NettyHttpConnectClient.send

(NettyHttpConnectClient.java:101)
	at com.xxl.rpc.remoting.net.common.ConnectClient.asyncSend(ConnectClient.java:45)
	at com.xxl.rpc.remoting.net.impl.netty_http.client.NettyHttpClient.asyncSend

(NettyHttpClient.java:18)
	at com.xxl.rpc.remoting.invoker.reference.XxlRpcReferenceBean$1.invoke

(XxlRpcReferenceBean.java:216)
	at com.sun.proxy.$Proxy206.registry(Unknown Source)
	at com.xxl.job.core.thread.ExecutorRegistryThread$1.run

(ExecutorRegistryThread.java:48)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: com.caucho.hessian.io.Hessian2Output
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

解决方案代码

	
            com.xuxueli
            xxl-job-core
            2.1.1-RELEASE
            
	            
	                 com.caucho
		    		 hessian
	            
       		
        
        
		    com.caucho
		    hessian
		    4.0.53
		

2、报错信息,造成原因netty版本与项目中包冲突,解决方案引入新的包

Exception in thread "xxl-job, executor ExecutorRegistryThread" 

java.lang.NoClassDefFoundError: com/caucho/hessian/io/Hessian2Output
	at com.xxl.rpc.serialize.impl.HessianSerializer.serialize

(HessianSerializer.java:21)
	at com.xxl.rpc.remoting.net.impl.netty_http.client.NettyHttpConnectClient.send

(NettyHttpConnectClient.java:101)
	at com.xxl.rpc.remoting.net.common.ConnectClient.asyncSend(ConnectClient.java:45)
	at com.xxl.rpc.remoting.net.impl.netty_http.client.NettyHttpClient.asyncSend

(NettyHttpClient.java:18)
	at com.xxl.rpc.remoting.invoker.reference.XxlRpcReferenceBean$1.invoke

(XxlRpcReferenceBean.java:216)
	at com.sun.proxy.$Proxy206.registry(Unknown Source)
	at com.xxl.job.core.thread.ExecutorRegistryThread$1.run

(ExecutorRegistryThread.java:48)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: com.caucho.hessian.io.Hessian2Output
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

解决方案:

        
	      io.netty
	      netty-all
	      4.1.36.Final
	    
	    
	      com.corundumstudio.socketio
	      netty-socketio
	      1.7.17
	    

 

 

你可能感兴趣的:(Bug修复记录)