0

I have a few questions about my server OSGi & JAX-RS.

I built the server using the configuration of this tuturial:

http://eclipsesource.com/blogs/2014/02/04/step-by-step-how-to-bring-jax-rs-and-osgi-together/

My project compiles without problems in eclipse with these settings.

When I try to arrange it (using MANIFEST.MF) in Virgo, I get the following message:

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

My questions:

  1. Where Virgo takes the target platform?
  2. Why my Manifesto does not want to deploy to Virgo?
  3. What can I do to impossible to deploy my server on Virgo?

Thank you for all the answers.

wojas.
  • 15
  • 6

1 Answers1

0

to 1. Virgo doesn't use a target platform. Please see Virgo Concepts for more details.

to 2. It seems you are trying to deploy the Manifest file alone. You will have to create a bundle first before deploying your application via admin console.

to 3. I migrated the example you mentioned above to Virgo a year ago when I was looking for an example for Dockerizor. There is a short instruction available online.

The generated Dockerfile should give you an impression what has to be done to run your JAX-RS application within Virgo:

  • install Java 7
  • download Virgo Jetty Server 3.6.3.RELEASE

Add JavaSE-1.7 to the profile:

RUN sed -i 's/JavaSE-1.6/JavaSE-1.6,\\\n JavaSE-1.7/' /home/virgo/configuration/java6-server.profile

Switch the Jetty port to 9090:

RUN sed -i 's/8080/9090/' /home/virgo/configuration/config.ini

Add required Jetty bundles to ${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

Add required JAX-RS dependencies to ${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/

Add the packaged example bundle to ${VIRGO_HOME}/repository/usr:

ADD jax-rs.jar /home/virgo/repository/usr/

Tell Virgo to pick up your application:

ADD jax-rs-example.plan /home/virgo/pickup/

Regards, florian

Florian Waibel
  • 221
  • 2
  • 9
  • All files as you write added to virgo. But I have a problem with gradler. I type the following command: gradlew build osgi.rest.example gradler returns me the message: FAILURE: Build failed with an exception. * What went wrong: Project 'osgi.rest.example' not found in root project 'dockerizor' What is wrong? – wojas. Aug 13 '15 at 10:23
  • A blind guess is that you need to change into the examples folder. Could that be? – Florian Waibel Aug 13 '15 at 11:34
  • @wojas Were you able to run the example? – Florian Waibel Nov 09 '15 at 09:45