首页 > 其他分享 >无效重复类定义错误:Invalid duplicate class definition of class xxxx

无效重复类定义错误:Invalid duplicate class definition of class xxxx

时间:2023-07-18 17:36:15浏览次数:28  
标签:definition OrderFixFile UTF 编码 BOM xxxx class

Description

startup failed:
/xxxx/OrderFixFile.groovy: 5: Invalid duplicate class definition of class OrderFixFile : The source /xxxx/OrderFixFile.groovy contains at least two definitions of the class OrderFixFile.
One of the classes is an explicit generated class using the class statement, the other is a class generated from the script body based on the file name. Solutions are to change the file name or to change the class name.

Reason

由于该类的文件编码为UTF-8 with BOM,需要将文件编码改为UTF-8。选中编码错误的文件->File->File Properties->Remove BOM即可

image

BOM解释

BOM(byte order mark)是为 UTF-16 和 UTF-32 准备的,用于标记字节序(byte order)。
「UTF-8」和「带 BOM 的 UTF-8」的区别就是有没有 BOM。即文件开头有没有 U+FEFF。
通常BOM是用来标示Unicode纯文本字节流的,用来提供一种方便的方法让文本处理程序识别读入的.txt文件是哪个Unicode编码(UTF-8,UTF-16BE,UTF-16LE)。微软在 UTF-8 中使用 BOM 是因为这样可以把 UTF-8 和 ASCII 等编码明确区分开,但这样的文件在 Windows 之外的操作系统里会带来问题。

防止再次出现,可以在全局设置文件默认编码为UTF-8

image

标签:definition,OrderFixFile,UTF,编码,BOM,xxxx,class
From: https://www.cnblogs.com/colfish/p/17563592.html

相关文章

  • 【Spring】条件装配 @ConditionalOnClass @ConditionalOnBean
    @ConditionalOnClass 是SpringFramework提供的一个注解,用于在应用程序上下文加载过程中根据类的存在与否来决定是否创建或配置某个bean。通常情况下,当应用程序上下文加载时,Spring会根据配置文件或注解等方式定义的bean定义来创建对象,并将其加入到bean集合中。然而,有时......
  • 使用docker安装的tomcat部署activiti-app.war、activiti-admin.war失败(ClassNotFound
    背景一直以来习惯用docker配置一些本地学习环境,许多教程配置activiti的方式都是通过复制activiti的war包部署在tomcat中,我尝试了一下通过docker的方式遇到了一些不易察觉的错误。使用方式描述使用docker安装tomcat9.0dockerrun-d-p8080:8080--nametomcattomcat:9.0复......
  • python中的@classmethod和@staticmethod的作用
    classA(object):bar=1deffunc1(self):print("foo")@classmethoddeffunc2(cls):print("func2")print(cls.bar)cls().func1()A.func2()@classmethod的作用实际时可以在class内部实例化class。作用就是比u输......
  • class文件的加载过程
    1、在加载class文件的时候,JVM会先加载类中的所有静态成员(方法,变量,静态代码块)都加载到方法区class文件的所处静态区中2、当把所有的静态成员加载完成之后,开始给类中的所有静态成员变量进行默认初始化3、当类中的所有静态成员变量默认初始化之后,接着开始给所有静态成员变量显示赋......
  • spark SLF4J: Class path contains multiple SLF4J bindings.
    解决"sparkSLF4J:ClasspathcontainsmultipleSLF4Jbindings."问题1.概述当在Spark应用程序中出现"sparkSLF4J:ClasspathcontainsmultipleSLF4Jbindings."错误时,这意味着在类路径上存在多个SLF4J绑定。SLF4J是一个日志框架,用于在应用程序中记录日志。这个......
  • Angular Component Class 里的成员什么时候应该用 readonly 修饰
    在Angular中,Component类是用来定义组件的基本结构和行为的。在Component类中,成员的修饰符起着控制访问权限和可变性的作用。readonly关键字是一种修饰符,用于声明只读成员,即一旦初始化后就不能再修改其值。使用readonly关键字对成员进行修饰可以带来以下几个好处:防止误......
  • 4.内部属性[[Class]]是什么
    4.内部属性[[Class]]是什么?所有typeof返回值为"object"的对象(如数组)都包含一个内部属性[[Class]](我们可以把它看作一个内部的分类,而非传统的面向对象意义上的类)。这个属性无法直接访问,一般通过Object.prototype.toString(..)来查看。例如:Object.prototyp......
  • cpp class constructor initialize list and override cout
    //book.h#pragmaonce#include<iostream>classbook{public:intidx;std::uint64_tid;std::stringauthor;std::stringcontent;std::stringcomment;std::stringisbn;std::stringsummary;std::stringtopic;boo......
  • 配置问题-Error creating bean with name 'user' defined in class path resource [be
    正在学习IoC使用的jdk版本为jdk17依赖为:<dependencies><dependency><groupId>org.springframework</groupId><artifactId>spring-core</artifactId><version>6.0.6</version></dependen......
  • maven打包repackage failed: Unable to find main class
    maven打包提示这个问题。原因:主项目pomxml文件中,不需要<build>打包的配置,只需要在有入口类的模块pom.xml配置好<build><build><finalName>${project.artifactId}</finalName><plugins><plugin><groupId>org.......