- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
当尝试在 Glassfish 3.1.2.2 上部署示例 Jersey war 包代码(git 上的 helloworld-osgi-webapp: https://github.com/jersey/jersey-1.x/tree/master/jersey/samples/helloworld-osgi-webapp )时,我收到以下 osgi 错误:
remote failure: Error occurred during deployment: Exception while loading the app:
org.osgi.framework.BundleException: Unresolved constraint in bundle war-bundle [344]:
Unable to resolve 344.0: missing requirement [344.0] osgi.wiring.package; (&(osgi.wiring.package=com.sun.jersey.api.core)(version>=1.18.0)(!(version>=2.0.0))).
Please see server.log for more details.
Command deploy failed
为什么maven felix插件没有在war中嵌入库?
提前感谢,米。
最佳答案
直接原因是在您的应用程序中它没有配置为这样做,而没有这样做的原因是在 OSGi 世界中它不应该这样做。
来自pom它在提供的范围内:
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-servlet</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
<classifier>cobertura</classifier>
它只会嵌入运行时和编译范围:
<Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
并使用 OSGi 标准导入包将 jersey-servlet 依赖项导入为 OSGi 服务:
<Import-Package>com.sun.jersey.api.core,com.sun.jersey.spi.container.servlet,*</Import-Package>
在 OSGi 世界中,依赖项应该部署为单独的 OSGi 包,而不是嵌入到 war 中。这就是你的例子正在做的事情。因此,您应该将 jersey 部署为单独的 OSGi 包。
关于java - 在 glassfish 3.1.2.2 上部署 jersey/helloworld-osgi-webapp 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14939901/
这个问题已经有答案了: What does "Could not find or load main class" mean? (63 个回答) 已关闭 7 年前。 我用java语言编写了一个简单的程
在使用 Expo 的 React Native 项目中,我尝试使用 export 部署以下云函数: 注意:我在 index.js 中使用 Javascript。 export const helloW
解决了“无法找到或加载主类Hello”错误的问题后...运行程序后我再次遇到这个问题(我使用文本板)代码是: class HelloWorld { public static void m
我最初尝试像这样推送我的(有史以来第一次!)git repo: $ git push helloworld 但我得到了这个: To git-smichaels@free5.projectlocker.
全新安装,通过 vue cli 安装 Vue。运行 vue create app并使用基本配置进行设置。 从 Home.vue 中删除 HelloWorld.vue 组件和附带的导入代码。 运行 np
我第一次编程有点问题。我收到消息 可以获取“c:\users\amittler\source\repos\HelloWorld...”吗? 谢谢你的帮助 最佳答案 是的,得到这个就可以了。 您的 ID
好的,我只是无法让 java 运行我的 .class 文件:我按照 Oracle tutorial 中的步骤操作并尝试运行这个程序: class HelloWorldApp { public
我是 Scala 和 SBT 的新手,所以我可能会遗漏一些明显的东西。 我试图在 http://www.scalafx.org/docs/quickstart/ 上编译 HelloWorld 示例 我
这是我的设置: docker pull riot/riotbuild wget https://github.com/RIOT-OS/RIOT/archive/2019.04.zip unzip 20
我一直在尝试创建我的第一个 Jenkins 插件。一切都很好,只是全局配置在 jenkins 服务重新启动后不会保留。 只要服务不重新启动,配置就可以很好地保存。 全局配置果冻文件... Jenki
我尝试从终端运行基本的 HelloWorld.class 文件。 我使用以下输入: Java HelloWorld.class 但它说: Error: Could not find or load "
以下代码取自 http://doc.akka.io/docs/akka/2.2.3/AkkaScala.pdf import akka.actor.Actor object Greeter { c
我带着这样一个微不足道的问题来到 Stack Exchange 感到内疚,但我整个上午都在为它苦苦思索,似乎无处可去。我正在尝试运行 Grails 教程中的简单 HelloWorld 应用程序:htt
好吧,这真的让我很生气。我在我的模拟器和安卓设备上都运行了它。该代码不显示“Helloworld, Android -mykong.com”。我启动应用程序,在模拟器上找到它,单击它,它会转到应用程序
我回到了 c++(我已经好几年没用过它了)来学习 box2d API。 我确切地说我在 Linux 系统 (Ubuntu) 上并且我已经从 this guide 之后的源代码安装了 box2d(2.3
社区成员推荐我分析以下内容,以了解 ARM 架构中发出的系统调用。我怀疑如何在这种结构中获取程序。我已经尝试过 gdb disas 命令,但部分不可见。请帮助。 .data HelloWorldStr
在编译我的 wxWidget HelloWorld 应用程序时,出现以下错误: Warning 1 warning LNK4098: defaultlib 'LIBCMTD' conflicts
我刚刚为我的 eclipse 安装了 c/c++ 开发工具,一切正常,除了当我运行 hello world 程序时控制台中没有打印任何文本,但我没有收到任何错误。我真的很困惑,有人知道这是为什么吗?
我在以下文件夹 C:\Program Files\Java 中安装了 Java 1.7.0。我的操作系统是带有 Service Pack 3 的 Windows XP(2002 版)。 我设置的环境变
前言 讲解Spring之前,我们首先梳理下Spring有哪些知识点可以进行入手源码分析,比如: Spring IOC依赖注入 Spring AOP切面编程 Spri
我是一名优秀的程序员,十分优秀!