在通过文件上传之后,运行java程序,突然发现这么一个错误:java.lang.ClassFormatError: Unknown constant tag 0 in class file,通过网上查找,很多人认为是要重新编译,可是按照这个方法重新编译之后还是得到同样的结果!百思不得其解!

最后通过:

Maybe it's yet to appear, but I found (and replied) that it was due to an SCP file transfer (of a binary 'class' file) in ascii mode from Windows to Unix.

(1) I did a hex dump of the files on their respective computers, and the two copies of the same class file differed.

(2) I did the transfer again in binary mode and the class file now works. (and, the two files no longer differ.)
      获得答案,就是在上传类文件的时候使用了ASCII的模式,而java编译之后的类文件是需要采用binary模式的,改变上传文件的模式之后问题获得了解决!

java.lang.ClassFormatError: Unknown constant tag 0 in class file的更多相关文章

  1. java.lang.ClassFormatError Duplicate field name&signature in class file XXXXXX【转】

    本文转载自:https://blog.csdn.net/ylchou/article/details/7739742 2012-7-5 15:06:25org.apache.catalina.core ...

  2. java.lang.ClassFormatError

    Error occurred during initialization of VMjava.lang.ClassFormatError: Unknown constant tag 26 in cla ...

  3. java.lang.ClassFormatError: Illegal UTF8 string in constant pool in class file Server/Request

    Linux服务器上,将本地编译好的文件上传后,Tomcat启动时报错: Exception in thread "Thread-2" java.lang.ClassFormatEr ...

  4. java.lang.ClassFormatError: Extra bytes at the end of class file

    在精简JRE过程中,将rt.jar中类通过FileInputStream,FileOutputStream进行拷贝操作出错: java.lang.ClassFormatError: Extra byt ...

  5. IZ65534: 'JAVA.LANG.CLASSFORMATERROR' ERROR FOR A VALID IDENTIFIER

    PAR status Closed as program error. Error description Error Message: The java class could not be loa ...

  6. java.lang.IllegalStateException: Unknown Priority XXXX 的解决方法

    异常信息: java.lang.IllegalStateException: Unknown Priority SYS_ERR_SMS at org.apache.log4j.Category.pri ...

  7. spring运行时没有问题,在单元测试时,出现java.lang.ClassFormatError错误

    Caused by: java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstrac ...

  8. 阿里巴巴 fastjson-1.2.12.jar json解析异常java.lang.ClassFormatError: Invalid method Code length 66865 in class file com/alibaba/fastjson/serializer/ASMSerializer_6_UserKdlb

    承接上篇:fastjson反序列化LocalDateTime失败的问题java.time.format.DateTimeParseException: Text '2019-05-24 13:52:1 ...

  9. spark模型error java.lang.IllegalArgumentException: Row length is 0

    failure: Lost task 18.3 in stage 17.0 (TID 59784,XXXXX, executor 19): java.lang.IllegalArgumentExcep ...

随机推荐

  1. .net C# 格式化时间

    1.HtmlEncode="False" 2.DataFormatString="{0:d}" C#格式化日期时间 DateTime dt = DateTime ...

  2. 在3D中两条射线的相交性检测

    摘自[3D数学基础: 图形与游戏开发] 考虑在3D中两条以参数形式定义的射线: \(\vec{r_1}(t_1)=\vec{p_1}+t_1\vec{d_1}\) \(\vec{r_2}(t_2)=\ ...

  3. scrapy的UA池和代理池

    一.下载中间件(Downloader Middlewares) 框架图如下 下载中间件(Downloader Middlewares)位于scrapy引擎和下载器之间的一层组件. - 作用: (1)引 ...

  4. No operations allowed after connection closed--转

    https://www.jianshu.com/p/1626d41572f2 Spring boot的单数据源配置比较简单,只需要在application.properties配置相关的jdbc连接的 ...

  5. 2 我们的C#学习方法

    在这里我们借鉴了一种行之有效的学习编程语言的方法,并在此基础上进行了相应的改良.我们在培训新人中使用后,发现这种学习方法是非常有效的. 你通过做以下几个步骤来一步步学习C#语言. 1. 搞懂每一个我们 ...

  6. activity间传递参数

    传递值对象 值对象可以理解为自定义的数据类型对象. 为了完成这个知识点的讲解,先来创建一个User类型的类,它有name和age两个属性,然后请添加getter/setter方法,构造方法等基本方法. ...

  7. centos7下手动制作trove镜像

    获取镜像 [root@bldattet1 ~]#  wget http://mirrors.aliyun.com/centos/7.5.1804/isos/x86_64/CentOS-7-x86_64 ...

  8. CSS——行内元素的margin与padding

    行内元素: 1.margin:0 20px:只可以定义左右. 2.pading:20px 20px 20px 20px:上下左右都有效 例如span: <!DOCTYPE html> &l ...

  9. XML——读与写

    XML写入 private static void writeXml() { using (XmlTextWriter xml = new XmlTextWriter(@"C:\Users\ ...

  10. 【译】x86程序员手册18-6.3.1描述符保存保护参数

    6.3 Segment-Level Protection 段级保护 All five aspects of protection apply to segment translation: 段转换时会 ...