【scala】编译build报错 “xxx is not an enclosing class“

java 复制代码
  private[sources] val creationTimeMs: Long = {
    val session = SparkSession.getActiveSession.orElse(SparkSession.getDefaultSession)
    require(session.isDefined)

private[xxx]是访问权限控制在xxxx包的意思。

解决办法:

把[sources]删掉,或者改成和包名一致即可。

相关推荐
一点程序18 小时前
基于SpringBoot的选课调查系统
java·spring boot·后端·选课调查系统
怪兽源码20 小时前
基于SpringBoot的选课调查系统
java·spring boot·后端·选课调查系统
csdn_aspnet21 小时前
ASP.NET Core 中的依赖注入
后端·asp.net·di·.net core
昊坤说不出的梦1 天前
【实战】监控上下文切换及其优化方案
java·后端
疯狂踩坑人1 天前
【Python版 2026 从零学Langchain 1.x】(二)结构化输出和工具调用
后端·python·langchain
橘子师兄1 天前
C++AI大模型接入SDK—ChatSDK封装
开发语言·c++·人工智能·后端
@ chen1 天前
Spring事务 核心知识
java·后端·spring
一点技术1 天前
基于SpringBoot的选课调查系统
java·spring boot·后端·选课调查系统
RANCE_atttackkk1 天前
Springboot+langchain4j的RAG检索增强生成
java·开发语言·spring boot·后端·spring·ai·ai编程
好好研究1 天前
Spring Boot - Thymeleaf模板引擎
java·spring boot·后端·thymeleaf