glassfish 中不能将spring的配置文件放在META-INF下

本文讨论了在glassfish服务器环境下,将META-INF/application*.xml文件放入项目中导致Spring Bean加载失败的问题。经研究发现,glassfish服务器将路径进行了特殊转换。

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

如题,如果将META-INF/application*.xml 则会报加载springbean失败,跟踪spring代码发现,glassfish将meta-inf转换为 bind:12.0:1/META-INF 。

不知道为何?呵呵

sbt:spark-app> assembly [warn] multiple main classes detected: run 'show discoveredMainClasses' to see the list [error] 37 error(s) were encountered during the merge: [error] stack trace is suppressed; run last assembly for the full output [error] (assembly) [error] Deduplicate found different file contents in the following: [error] Jar name = protobuf-java-3.19.6.jar, jar org = com.google.protobuf, entry target = google/protobuf/api.proto [error] Jar name = spark-core_2.12-3.5.0.jar, jar org = org.apache.spark, entry target = google/protobuf/api.proto [error] Deduplicate found different file contents in the following: [error] Jar name = protobuf-java-3.19.6.jar, jar org = com.google.protobuf, entry target = google/protobuf/field_mask.proto [error] Jar name = spark-core_2.12-3.5.0.jar, jar org = org.apache.spark, entry target = google/protobuf/field_mask.proto [error] Deduplicate found different file contents in the following: [error] Jar name = commons-logging-1.1.3.jar, jar org = commons-logging, entry target = org/apache/commons/logging/Log.class [error] Jar name = jcl-over-slf4j-2.0.7.jar, jar org = org.slf4j, entry target = org/apache/commons/logging/Log.class [error] Deduplicate found different file contents in the following: [error] Jar name = protobuf-java-3.19.6.jar, jar org = com.google.protobuf, entry target = google/protobuf/struct.proto [error] Jar name = spark-core_2.12-3.5.0.jar, jar org = org.apache.spark, entry target = google/protobuf/struct.proto [error] Deduplicate found different file contents in the following: [error] Jar name = commons-logging-1.1.3.jar, jar org = commons-logging, entry target = org/apache/commons/logging/impl/NoOpLog.class [error] Jar name = jcl-over-slf4j-2.0.7.jar, jar org = org.slf4j, entry target = org/apache/commons/logging/impl/NoOpLog.class [error] Deduplicate found different file contents in the following: [error] Jar name = arrow-format-11.0.0.jar, jar org = org.apache.arrow, entry target = arrow-git.properties [error] Jar name = arrow-memory-core-11.0.0.jar, jar org = org.apache.arrow, entry target = arrow-git.properties [error] Jar name = arrow-memory-netty-11.0.0.jar, jar org = org.apache.arrow, entry target = arrow-git.properties [error] Jar name = arrow-vector-11.0.0.jar, jar org = org.apache.arrow, entry target = arrow-git.properties [error] Deduplicate found different file contents in the following: [error] Jar name = javax.inject-1.jar, jar org = javax.inject, entry target = javax/inject/Singleton.class [error] Jar name = jakarta.inject-2.6.1.jar, jar org = org.glassfish.hk2.external, entry target = javax/inject/Singleton.class [error] Deduplicate found different file contents in the following: [error] Jar name = protobuf-java-3.19.6.jar, jar org = com.google.protobuf, entry target = google/protobuf/duration.proto [error] Jar name = spark-core_2.12-3.5.0.jar, jar org = org.apache.spark, entry target = google/protobuf/duration.proto [error] Deduplicate found different file contents in the following: [error] Jar name = javax.inject-1.jar, jar org = javax.inject, entry target = javax/inject/Named.class [error] Jar name = jakarta.inject-2.6.1.jar, jar org = org.glassfish.hk2.external, entry target = javax/inject/Named.class [error] Deduplicate found different file contents in the following: [error] Jar name = javax.inject-1.jar, jar org = javax.inject, entry target = javax/inject/Inject.class [error] Jar name = jakarta.inject-2.6.1.jar, jar org = org.glassfish.hk2.external, entry target = javax/inject/Inject.class [error] Deduplicate found different file contents in the following: [error] Jar name = commons-logging-1.1.3.jar, jar org = commons-logging, entry target = org/apache/commons/logging/LogFactory.class [error] Jar name = jcl-over-slf4j-2.0.7.jar, jar org = org.slf4j, entry target = org/apache/commons/logging/LogFactory.class [error] Deduplicate found different file contents in the following: [error] Jar name = commons-logging-1.1.3.jar, jar org = commons-logging, entry target = org/apache/commons/logging/LogConfigurationException.class [error] Jar name = jcl-over-slf4j-2.0.7.jar, jar org = org.slf4j, entry target = org/apache/commons/logging/LogConfigurationException.class [error] Deduplicate found different file contents in the following: [error] Jar name = jakarta.annotation-api-1.3.5.jar, jar org = jakarta.annotation, entry target = javax/annotation/security/DenyAll.class [error] Jar name = jsr250-api-1.0.jar, jar org = javax.annotation, entry target = javax/annotation/security/DenyAll.class [error] Deduplicate found different file contents in the following: [error] Jar name = protobuf-java-3.19.6.jar, jar org = com.google.protobuf, entry target = google/protobuf/timestamp.proto [error] Jar name = spark-core_2.12-3.5.0.jar, jar org = org.apache.spark, entry target = google/protobuf/timestamp.proto [error] Deduplicate found different file contents in the following: [error] Jar name = jakarta.annotation-api-1.3.5.jar, jar org = jakarta.annotation, entry target = javax/annotation/Generated.class [error] Jar name = jsr250-api-1.0.jar, jar org = javax.annotation, entry target = javax/annotation/Generated.class [error] Deduplicate found different file contents in the following: [error] Jar name = protobuf-java-3.19.6.jar, jar org = com.google.protobuf, entry target = google/protobuf/source_context.proto [error] Jar name = spark-core_2.12-3.5.0.jar, jar org = org.apache.spark, entry target = google/protobuf/source_context.proto [error] Deduplicate found different file contents in the following: [error] Jar name = protobuf-java-3.19.6.jar, jar org = com.google.protobuf, entry target = google/protobuf/empty.proto [error] Jar name = spark-core_2.12-3.5.0.jar, jar org = org.apache.spark, entry target = google/protobuf/empty.proto [error] Deduplicate found different file contents in the following: [error] Jar name = jakarta.annotation-api-1.3.5.jar, jar org = jakarta.annotation, entry target = javax/annotation/Resource.class [error] Jar name = jsr250-api-1.0.jar, jar org = javax.annotation, entry target = javax/annotation/Resource.class [error] Deduplicate found different file contents in the following: [error] Jar name = jakarta.annotation-api-1.3.5.jar, jar org = jakarta.annotation, entry target = javax/annotation/security/RolesAllowed.class [error] Jar name = jsr250-api-1.0.jar, jar org = javax.annotation, entry target = javax/annotation/security/RolesAllowed.class [error] Deduplicate found different file contents in the following: [error] Jar name = jakarta.annotation-api-1.3.5.jar, jar org = jakarta.annotation, entry target = javax/annotation/PreDestroy.class [error] Jar name = jsr250-api-1.0.jar, jar org = javax.annotation, entry target = javax/annotation/PreDestroy.class [error] Deduplicate found different file contents in the following: [error] Jar name = protobuf-java-3.19.6.jar, jar org = com.google.protobuf, entry target = google/protobuf/descriptor.proto [error] Jar name = spark-core_2.12-3.5.0.jar, jar org = org.apache.spark, entry target = google/protobuf/descriptor.proto [error] Deduplicate found different file contents in the following: [error] Jar name = commons-logging-1.1.3.jar, jar org = commons-logging, entry target = org/apache/commons/logging/impl/SimpleLog.class [error] Jar name = jcl-over-slf4j-2.0.7.jar, jar org = org.slf4j, entry target = org/apache/commons/logging/impl/SimpleLog.class [error] Deduplicate found different file contents in the following: [error] Jar name = jakarta.annotation-api-1.3.5.jar, jar org = jakarta.annotation, entry target = javax/annotation/security/DeclareRoles.class [error] Jar name = jsr250-api-1.0.jar, jar org = javax.annotation, entry target = javax/annotation/security/DeclareRoles.class [error] Deduplicate found different file contents in the following: [error] Jar name = protobuf-java-3.19.6.jar, jar org = com.google.protobuf, entry target = google/protobuf/wrappers.proto [error] Jar name = spark-core_2.12-3.5.0.jar, jar org = org.apache.spark, entry target = google/protobuf/wrappers.proto [error] Deduplicate found different file contents in the following: [error] Jar name = javax.inject-1.jar, jar org = javax.inject, entry target = javax/inject/Qualifier.class [error] Jar name = jakarta.inject-2.6.1.jar, jar org = org.glassfish.hk2.external, entry target = javax/inject/Qualifier.class [error] Deduplicate found different file contents in the following: [error] Jar name = jakarta.annotation-api-1.3.5.jar, jar org = jakarta.annotation, entry target = javax/annotation/security/PermitAll.class [error] Jar name = jsr250-api-1.0.jar, jar org = javax.annotation, entry target = javax/annotation/security/PermitAll.class [error] Deduplicate found different file contents in the following: [error] Jar name = protobuf-java-3.19.6.jar, jar org = com.google.protobuf, entry target = google/protobuf/any.proto [error] Jar name = spark-core_2.12-3.5.0.jar, jar org = org.apache.spark, entry target = google/protobuf/any.proto [error] Deduplicate found different file contents in the following: [error] Jar name = jakarta.annotation-api-1.3.5.jar, jar org = jakarta.annotation, entry target = javax/annotation/Resources.class [error] Jar name = jsr250-api-1.0.jar, jar org = javax.annotation, entry target = javax/annotation/Resources.class [error] Deduplicate found different file contents in the following: [error] Jar name = jakarta.annotation-api-1.3.5.jar, jar org = jakarta.annotation, entry target = javax/annotation/Resource$AuthenticationType.class [error] Jar name = jsr250-api-1.0.jar, jar org = javax.annotation, entry target = javax/annotation/Resource$AuthenticationType.class [error] Deduplicate found different file contents in the following: [error] Jar name = jackson-core-2.15.2.jar, jar org = com.fasterxml.jackson.core, entry target = META-INF/versions/9/module-info.class [error] Jar name = jackson-databind-2.15.2.jar, jar org = com.fasterxml.jackson.core, entry target = META-INF/versions/9/module-info.class [error] Jar name = jackson-datatype-jsr310-2.13.4.jar, jar org = com.fasterxml.jackson.datatype, entry target = META-INF/versions/9/module-info.class [error] Jar name = gson-2.10.1.jar, jar org = com.google.code.gson, entry target = META-INF/versions/9/module-info.class [error] Jar name = log4j-api-2.20.0.jar, jar org = org.apache.logging.log4j, entry target = META-INF/versions/9/module-info.class [error] Jar name = parquet-jackson-1.12.3.jar, jar org = org.apache.parquet, entry target = META-INF/versions/9/module-info.class [error] Jar name = jcl-over-slf4j-2.0.7.jar, jar org = org.slf4j, entry target = META-INF/versions/9/module-info.class [error] Jar name = slf4j-api-2.0.7.jar, jar org = org.slf4j, entry target = META-INF/versions/9/module-info.class [error] Jar name = xz-1.9.jar, jar org = org.tukaani, entry target = META-INF/versions/9/module-info.class [error] Deduplicate found different file contents in the following: [error] Jar name = protobuf-java-3.19.6.jar, jar org = com.google.protobuf, entry target = google/protobuf/type.proto [error] Jar name = spark-core_2.12-3.5.0.jar, jar org = org.apache.spark, entry target = google/protobuf/type.proto [error] Deduplicate found different file contents in the following: [error] Jar name = jakarta.annotation-api-1.3.5.jar, jar org = jakarta.annotation, entry target = javax/annotation/PostConstruct.class [error] Jar name = jsr250-api-1.0.jar, jar org = javax.annotation, entry target = javax/annotation/PostConstruct.class [error] Deduplicate found different file contents in the following: [error] Jar name = netty-all-4.1.96.Final.jar, jar org = io.netty, entry target = META-INF/io.netty.versions.properties [error] Jar name = netty-buffer-4.1.96.Final.jar, jar org = io.netty, entry target = META-INF/io.netty.versions.properties [error] Jar name = netty-codec-http2-4.1.96.Final.jar, jar org = io.netty, entry target = META-INF/io.netty.versions.properties [error] Jar name = netty-codec-http-4.1.96.Final.jar, jar org = io.netty, entry target = META-INF/io.netty.versions.properties [error] Jar name = netty-codec-socks-4.1.96.Final.jar, jar org = io.netty, entry target = META-INF/io.netty.versions.properties [error] Jar name = netty-codec-4.1.96.Final.jar, jar org = io.netty, entry target = META-INF/io.netty.versions.properties [error] Jar name = netty-common-4.1.96.Final.jar, jar org = io.netty, entry target = META-INF/io.netty.versions.properties [error] Jar name = netty-handler-proxy-4.1.96.Final.jar, jar org = io.netty, entry target = META-INF/io.netty.versions.properties [error] Jar name = netty-handler-4.1.96.Final.jar, jar org = io.netty, entry target = META-INF/io.netty.versions.properties [error] Jar name = netty-resolver-4.1.96.Final.jar, jar org = io.netty, entry target = META-INF/io.netty.versions.properties [error] Jar name = netty-transport-classes-epoll-4.1.96.Final.jar, jar org = io.netty, entry target = META-INF/io.netty.versions.properties [error] Jar name = netty-transport-classes-kqueue-4.1.96.Final.jar, jar org = io.netty, entry target = META-INF/io.netty.versions.properties [error] Jar name = netty-transport-native-epoll-4.1.96.Final.jar, jar org = io.netty, entry target = META-INF/io.netty.versions.properties [error] Jar name = netty-transport-native-epoll-4.1.96.Final.jar, jar org = io.netty, entry target = META-INF/io.netty.versions.properties [error] Jar name = netty-transport-native-epoll-4.1.96.Final.jar, jar org = io.netty, entry target = META-INF/io.netty.versions.properties [error] Jar name = netty-transport-native-kqueue-4.1.96.Final.jar, jar org = io.netty, entry target = META-INF/io.netty.versions.properties [error] Jar name = netty-transport-native-kqueue-4.1.96.Final.jar, jar org = io.netty, entry target = META-INF/io.netty.versions.properties [error] Jar name = netty-transport-native-unix-common-4.1.96.Final.jar, jar org = io.netty, entry target = META-INF/io.netty.versions.properties [error] Jar name = netty-transport-4.1.96.Final.jar, jar org = io.netty, entry target = META-INF/io.netty.versions.properties [error] Deduplicate found different file contents in the following: [error] Jar name = javax.inject-1.jar, jar org = javax.inject, entry target = javax/inject/Scope.class [error] Jar name = jakarta.inject-2.6.1.jar, jar org = org.glassfish.hk2.external, entry target = javax/inject/Scope.class [error] Deduplicate found different file contents in the following: [error] Jar name = log4j-1.2-api-2.20.0.jar, jar org = org.apache.logging.log4j, entry target = META-INF/org/apache/logging/log4j/core/config/plugins/Log4j2Plugins.dat [error] Jar name = log4j-core-2.20.0.jar, jar org = org.apache.logging.log4j, entry target = META-INF/org/apache/logging/log4j/core/config/plugins/Log4j2Plugins.dat [error] Deduplicate found different file contents in the following: [error] Jar name = javax.inject-1.jar, jar org = javax.inject, entry target = javax/inject/Provider.class [error] Jar name = jakarta.inject-2.6.1.jar, jar org = org.glassfish.hk2.external, entry target = javax/inject/Provider.class [error] Deduplicate found different file contents in the following: [error] Jar name = jakarta.annotation-api-1.3.5.jar, jar org = jakarta.annotation, entry target = javax/annotation/security/RunAs.class [error] Jar name = jsr250-api-1.0.jar, jar org = javax.annotation, entry target = javax/annotation/security/RunAs.class [error] Total time: 5 s, completed 2025年7月12日 下午12:56:20 [error] server failed to start on local:sbt-server-8814d8f5c3747ce114fe. java.io.IOException: Could not create lock for \\.\pipe\sbt-server-8814d8f5c3747ce114fe_lock, error 5 sbt:spark-app>
最新发布
07-13
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值