我对我的服务器OSGi& JAX-RS。
我使用这个tuturial的配置构建了服务器:
http://eclipsesource.com/blogs/2014/02/04/step-by-step-how-to-bring-jax-rs-and-osgi-together/
我的项目使用这些设置在eclipse中编译没有问题。
当我尝试在处女座中安排它(使用MANIFEST.MF)时,我收到以下消息:
Date: 2015-08-12
Time: 10:43:35 CEST
Cause: error
Exception:
java.lang.RuntimeException: org.eclipse.virgo.nano.deployer.api.core.DeploymentException: Cannot determine the artifact identity of the file 'C:\Users\...\Desktop\VIRGO-~1.REL\work\org.eclipse.virgo.apps.admin.web.UploadServlet\MANIFEST.MF': uri='file:/C:/Users/.../Desktop/VIRGO-~1.REL/work/org.eclipse.virgo.apps.admin.web.UploadServlet/MANIFEST.MF': uri='file:/C:/Users/.../Desktop/VIRGO-~1.REL/work/org.eclipse.virgo.apps.admin.web.UploadServlet/MANIFEST.MF'
at org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationDeployer.doInstall(PipelinedApplicationDeployer.java:168)
at org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationDeployer.install(PipelinedApplicationDeployer.java:140)
at org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationDeployer.deploy(PipelinedApplicationDeployer.java:253)
at org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationDeployer.deploy(PipelinedApplicationDeployer.java:118)
at org.eclipse.virgo.kernel.deployer.management.StandardDeployer.deploy(StandardDeployer.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275)
at com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenReturn(ConvertingMethod.java:193)
at com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenReturn(ConvertingMethod.java:175)
at com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIntrospector.java:117)
at com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIntrospector.java:54)
at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:237)
at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:138)
at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:252)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at org.eclipse.virgo.management.console.UploadServlet.doDeployment(UploadServlet.java:132)
at org.eclipse.virgo.management.console.UploadServlet.doPost(UploadServlet.java:98)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:598)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:486)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:486)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:233)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1065)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:413)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:999)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
at org.eclipse.jetty.server.Server.handle(Server.java:350)
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:454)
at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:900)
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:954)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:851)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:606)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:46)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:603)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:538)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.RuntimeException: org.eclipse.virgo.nano.deployer.api.core.DeploymentException: Cannot determine the artifact identity of the file 'C:\Users\...\Desktop\VIRGO-~1.REL\work\org.eclipse.virgo.apps.admin.web.UploadServlet\MANIFEST.MF': uri='file:/C:/Users/.../Desktop/VIRGO-~1.REL/work/org.eclipse.virgo.apps.admin.web.UploadServlet/MANIFEST.MF'
at org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationDeployer.determineIdentity(PipelinedApplicationDeployer.java:210)
at org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationDeployer.doInstall(PipelinedApplicationDeployer.java:160)
... 52 more
Caused by: java.lang.RuntimeException: org.eclipse.virgo.nano.deployer.api.core.DeploymentException: Cannot determine the artifact identity of the file 'C:\Users\...\Desktop\VIRGO-~1.REL\work\org.eclipse.virgo.apps.admin.web.UploadServlet\MANIFEST.MF'
at org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationDeployer.determineIdentity(PipelinedApplicationDeployer.java:347)
at org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationDeployer.determineIdentity(PipelinedApplicationDeployer.java:208)
... 53 more
我的问题:
感谢您的所有答案。
答案 0 :(得分:0)
到1.处女座没有使用目标平台。有关详细信息,请参阅Virgo Concepts。
到2.您似乎正在尝试单独部署Manifest文件。在通过管理控制台部署应用程序之前,您必须先创建一个包。
到3.一年前,当我在寻找Dockerizor的示例时,我将上面提到的示例迁移到了Virgo。网上有一个简短的instruction。
生成的Dockerfile应该让您了解在Virgo中运行JAX-RS应用程序需要做些什么:
将JavaSE-1.7添加到配置文件中:
RUN sed -i 's/JavaSE-1.6/JavaSE-1.6,\\\n JavaSE-1.7/' /home/virgo/configuration/java6-server.profile
将Jetty端口切换为9090:
RUN sed -i 's/8080/9090/' /home/virgo/configuration/config.ini
将所需的Jetty包添加到$ {VIRGO_HOME} / repository / ext
RUN curl -L -o /home/virgo/repository/ext/org.eclipse.equinox.http.jetty_3.0.1.v20121109-203239.jar http://archive.eclipse.org/equinox/drops/R-3.8.2-201302041200/org.eclipse.equinox.http.jetty_3.0.1.v20121109-203239.jar
RUN curl -L -o /home/virgo/repository/ext/org.eclipse.equinox.http.servlet_1.1.300.v20120912-130548.jar http://archive.eclipse.org/equinox/drops/R-3.8.2-201302041200/org.eclipse.equinox.http.servlet_1.1.300.v20120912-130548.jar
RUN curl -L -o /home/virgo/repository/ext/com.google.gson_2.1.0.v201303041604.jar http://download.eclipse.org/tools/orbit/downloads/drops/R20140114142710/repository/plugins/com.google.gson_2.1.0.v201303041604.jar
将所需的JAX-RS依赖项添加到$ {VIRGO_HOME} / repository / usr
ADD publisher-4.1.jar /home/virgo/repository/usr/
ADD provider-gson-2.0.jar /home/virgo/repository/usr/
ADD jersey-all-2.10.1.jar /home/virgo/repository/usr/
ADD gson-2.2.4.jar /home/virgo/repository/usr/
将打包的示例包添加到$ {VIRGO_HOME} / repository / usr:
ADD jax-rs.jar /home/virgo/repository/usr/
告诉处女座拿起你的申请表:
ADD jax-rs-example.plan /home/virgo/pickup/
此致 弗洛里安