当前位置:   article > 正文

java.lang.UnsupportedClassVersionError问题调试

nested exception is java.lang.unsupportedclassversionerror: org/aspectj/weav
[size=large][b]java.lang.UnsupportedClassVersionError: com/sand/mcs/pub/core/Publish : Unsupported major.minor version 51.0[/b][/size] (unable to load class com.sand.mcs.pub.core.Publish)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2908)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1173)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1681)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
at com.sand.smp.server.core.util.CT.<clinit>(CT.java:610)
at com.sand.smp.server.core.svc.MutilChannelHelpSvc.calMonitor(MutilChannelHelpSvc.java:86)
at com.sand.smp.server.core.svc.impl.MutilChannelSvcImpl.walletStatQuery(MutilChannelSvcImpl.java:2869)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:91)
at com.sand.smp.server.core.monitor.MonitorAspect.doAround(MonitorAspect.java:28)
at sun.reflect.GeneratedMethodAccessor127.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)


[size=large][b]看报错信息,是因为使用的jar包版本不对。这个51.0是什么呢?[/b][/size]

  JDK不同的版本,编译出的class文件是不同的。通过查看分析class文件前几个字节,可以找到对应的关系,详细的参考官方,细微的版本之间可能有差异:
J2SE 7 = 51 (0x33 hex),J2SE 6.0 = 50 (0x32 hex),J2SE 5.0 = 49 (0x31 hex),JDK 1.4 = 48 (0x30 hex),JDK 1.3 = 47 (0x2F hex),JDK 1.2 = 46 (0x2E hex),JDK 1.1 = 45 (0x2D hex).


[size=large][b]查看jar包的配置文件:[/b][/size]

[img]http://dl2.iteye.com/upload/attachment/0114/6643/e5b43cb9-ede3-34b2-9a25-1efe3e06aacf.png[/img]

[size=large][b]解决方式:[/b][/size]
修改项目编译jre版本为1.7.0_79,重新打war包发布,问题解决。
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/165981
推荐阅读
相关标签
  

闽ICP备14008679号