gpt4 book ai didi

maven - maven-bundle-plugin 中的内部错误。嵌入错误 : Opening resource

转载 作者:行者123 更新时间:2023-12-04 18:20:47 29 4
gpt4 key购买 nike

我一直在使用 Maven 构建 OSGi 项目时遇到问题。我开始收到一个奇怪的错误。

我想某些资源已损坏。但我不知道是哪一个。我试图删除 .m2/repository。但问题仍然存在。关于如何解决此问题的任何想法?

[ERROR] An internal error occurred
java.io.IOException: Opening resource
at aQute.lib.osgi.AbstractResource.getLocalBytes(AbstractResource.java:35)
at aQute.lib.osgi.AbstractResource.write(AbstractResource.java:46)
at aQute.lib.osgi.Jar.writeResource(Jar.java:445)
at aQute.lib.osgi.Jar.write(Jar.java:224)
at aQute.lib.osgi.Jar.write(Jar.java:192)
at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:362)
at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:264)
at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:255)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: java.util.UnknownFormatConversionException: Conversion = '�'
at java.util.Formatter.checkText(Formatter.java:2519)
at java.util.Formatter.parse(Formatter.java:2501)
at java.util.Formatter.format(Formatter.java:2430)
at java.util.Formatter.format(Formatter.java:2383)
at java.lang.String.format(String.java:2781)
at aQute.lib.osgi.Processor.formatArrays(Processor.java:1273)
at aQute.lib.osgi.Processor.warning(Processor.java:116)
at aQute.lib.osgi.Macro.replace(Macro.java:144)
at aQute.lib.osgi.Macro.process(Macro.java:71)
at aQute.lib.osgi.Macro.process(Macro.java:58)
at aQute.lib.osgi.Macro.process(Macro.java:53)
at aQute.lib.osgi.Macro.process(Macro.java:964)
at aQute.lib.osgi.PreprocessResource.getBytes(PreprocessResource.java:25)
at aQute.lib.osgi.AbstractResource.getLocalBytes(AbstractResource.java:31)
... 26 more
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Internal error in maven-bundle-plugin

Embedded error: Opening resource
Conversion = '�'
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Internal error in maven-bundle-plugin
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Internal error in maven-bundle-plugin
at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:412)
at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:264)
at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:255)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
... 17 more
Caused by: java.io.IOException: Opening resource
at aQute.lib.osgi.AbstractResource.getLocalBytes(AbstractResource.java:35)
at aQute.lib.osgi.AbstractResource.write(AbstractResource.java:46)
at aQute.lib.osgi.Jar.writeResource(Jar.java:445)
at aQute.lib.osgi.Jar.write(Jar.java:224)
at aQute.lib.osgi.Jar.write(Jar.java:192)
at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:362)
... 21 more
Caused by: java.util.UnknownFormatConversionException: Conversion = '�'
at java.util.Formatter.checkText(Formatter.java:2519)
at java.util.Formatter.parse(Formatter.java:2501)
at java.util.Formatter.format(Formatter.java:2430)
at java.util.Formatter.format(Formatter.java:2383)
at java.lang.String.format(String.java:2781)
at aQute.lib.osgi.Processor.formatArrays(Processor.java:1273)
at aQute.lib.osgi.Processor.warning(Processor.java:116)
at aQute.lib.osgi.Macro.replace(Macro.java:144)
at aQute.lib.osgi.Macro.process(Macro.java:71)
at aQute.lib.osgi.Macro.process(Macro.java:58)
at aQute.lib.osgi.Macro.process(Macro.java:53)
at aQute.lib.osgi.Macro.process(Macro.java:964)
at aQute.lib.osgi.PreprocessResource.getBytes(PreprocessResource.java:25)
at aQute.lib.osgi.AbstractResource.getLocalBytes(AbstractResource.java:31)
... 26 more

根据要求,maven-bundle-plugin 配置:

<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Import-Package>*</Import-Package>
<Export-Package>org.opennaas.extensions.idb.*;version="${project.version}"</Export-Package>
<Meta-Persistence>META-INF/persistence.xml</Meta-Persistence>
</instructions>
</configuration>
</plugin>

最佳答案

问题实际上是编码问题。可能与 persistence.xml 文件有关。我将我所有的文本文件重新保存在资源目录下,它又开始工作了

关于maven - maven-bundle-plugin 中的内部错误。嵌入错误 : Opening resource,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10736456/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com