org.apache.axis cannot be resolved to a type且Syntax error on token "enum", class expected错误
2017-06-23 18:36
1531 查看
报org.apache.axis cannot be resolved to a type且Syntax error on token "enum", clas
2015-06-16一位专门负责导数据和单点登录模块的同事最近提交了一些代码,但由于他出差了,代码同步下来却发现报如下的错误:
org.apache.axis cannot be resolved to a type且Syntax error on token "enum", class expected错误
查看出错文件发现代码中凡是出现“oper.setStyle(org.apache.axis.enum.Style.RPC);”和“oper.setUse(org.apache.axis.enum.Use.ENCODED);”的地方MyEclipse都对其进行了报错。
经网上google,才知是org.apache.axis.enum 与JDK1.5版本冲突的解决办法:
问题原因: 在JDK 1.5及其以上版本中,enum都会被JDK认为是系统关键字,不能作为自定义变量使用。而我的JDK是1.6版本的,因此项目在编译时始终无法通过。
准备工作:到网站”http://www.apache.org/dist/ws/axis/1_4/“中下载Axis 1.4,并将重要的*.jar文件导入到项目中去。
解决办法:
方案一:降低JDK的版本1.5以下就ok了。
方案二:采用Axis1.4或以上,将org.apache.axis.enum用org.apache.axis.constants.enum替换。
方案三:
1、将代码“oper.setStyle(org.apache.axis.enum.Style.RPC);”修改为”oper.setStyle(Style.getStyle("rpc"));“;
2、将代码“oper.setUse(org.apache.axis.enum.Use.ENCODED);”修改为“oper.setUse(Use.getUse("encoded")); ”;
3、添加代码”import org.apache.axis.constants.Style;
import org.apache.axis.constants.Use;“
转自:http://www.ithao123.cn/content-8021212.html
注明:本文章属于转载,仅供行业人员学习交流使用,文章版权属于原创作者,在此向原创者致敬,感谢原创作者为大家学习交流提供精品内容。
站方声明:IThao123是为广大互联网从业者免费提供学习交流的平台,如果侵犯了原创著作权,请联系站方删除,给你带来不便,深表歉意。
相关文章推荐
- 报org.apache.axis cannot be resolved to a type且Syntax error on token "enum", class expected错误
- HTTP Status 500 - Unable to compile class for JSP:Syntax error on token "=", @ expected
- JAVA错误:org.apache.jasper.JasperException: java.lang.ClassCastException:org.apache.catalina.util.DefaultAnnotationProcessor cannot be cast to org.apach
- 【明哥报错簿】之【 "javax.servlet.http.HttpServlet" was not found on the Java Build Path || HttpServletRequest/HttpServletResponse cannot be resolved to a type】
- keil(MDK)中出现error: #513: a value of type "int" cannot be assigned to an entity of type "char *",即函数返回值无法赋值给对应变量的错误
- eclipse spket插件 错误 Syntax error on token "(", FunctionExpressionHeader expected after this
- jsp页面 标签中出现的错误Syntax error on token "language", VariableDeclaratorId expected after this token
- 解决 the error "...cannot be resolved to a type.."
- jsp Syntax error on token ",", ) expected 错误
- 错误:Syntax error on token ";", { expected after this token
- The type org.apache.commons.cli.Options cannot be resolved. It is indirectly referenced from required .class files
- The type org.apache.http.HttpEntity cannot be resolved.错误的解决
- 【错误集锦】——"XX cannot be resolved to a type "eclipse报错及解决说明
- "List cannot be resolved to a type"错误的解决方法
- jsp 自定义标签 错误 : Unable to compile class for JSP: ,apache cannot be resolved or is not a field
- The type org.apache.http.Header cannot be resolved. It is indirectly referenced from required .class
- adt "cannot be resolved to a type"错误解决办法
- Eclipse Android开发遇到:"The type org.apache.http.HttpResponse cannot be resolved."问题的解决办法
- SparkR读取CSV格式文件错误java.lang.ClassCastException: java.lang.String cannot be cast to org.apache.spark.u
- java错误提示:Syntax error on token " ", = expected after this token...