Flink sql 异常踩坑帖

本文总结了Flink SQL开发中遇到的一些问题,包括静态接口方法需要-jvm-1.8目标、Java和Scala代码打包冲突、Yarn per-job模式报错、Janino编译器错误、Scala版本不匹配以及签名文件错误,并提供了相应的解决方案链接。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.Static methods in interface require -target:jvm-1.8

解决方案:在pom中修改,参考:https://blog.csdn.net/YongDaiMe/article/details/108586263,在scala打包插件中增加-target :jvm-1.8配置。

<plugin>
    <groupId>net.alchim31.maven</groupId>
    <artifactId>scala-maven-plugin</artifactId>
    <executions>
        <execution>
            <id>scala-compile-first</id>
            <phase>process-resources</phase>
            <goals>
                <goal>add-source</goal>
                <goal>compile</goal>
            </goals>
            <configuration>
                <addScalacArgs>-target:jvm-1.8</addScalacArgs>
            </configuration>
        </execution>
        <execution>
            <id>scala-test-compile</id>
            <phase>test-compile</phase>
            <goals>
                <goal>testCompile</goal>
            </goals>
        </execution>
    </executions>
</plugin>

2、java和scala代码同时开发遇到打包java代码丢失问题,同步增加java和scala两个打包插件

参考:https://cloud.tencent.com/developer/article/1613727

<build>
	<plugins>
		<plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-shade-plugin</artifactId>
			<version>2.3</version>
			<executions>
				<execution>
					<phase>package</phase>
					<goals>
						<goal>shade</goal>
					</goals>
					<configuration>
						<artifactSet>
							<excludes>
								<exclude>org.apache.flink:*</exclude>
								<exclude>org.slf4j:*</exclude>
								<exclude>log4j:*</exclude>
							</excludes>
						</artifactS
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值