Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » EMF and Virgo(Problem while using EMF in Virgo)
EMF and Virgo [message #1052723] Tue, 30 April 2013 12:56 Go to next message
Matteo Cantarelli is currently offline Matteo CantarelliFriend
Messages: 30
Registered: June 2012
Member
I'm trying to use EMF in a Virgo container. In my POM I added the following dependencies:

<dependency>
    <groupId>org.eclipse.emf</groupId>
    <artifactId>org.eclipse.emf.ecore</artifactId>
    <version>2.8.0-v20120911-0500</version>
</dependency>
<dependency>
    <groupId>org.eclipse.emf</groupId>
    <artifactId>org.eclipse.emf.common</artifactId>
    <version>2.8.0-v20120911-0500</version>
</dependency>
<dependency>
    <groupId>org.eclipse.core</groupId>
    <artifactId>org.eclipse.core.runtime</artifactId>
    <version>3.6.0.v20100505</version>
</dependency>


Although when I start my Server I get the following exception:

[2013-04-29 15:29:56.880]  TCP Connection(6)-127.0.0.1 <DE0002E> Installation of bundle 'xxx' version '0.0.1' failed. org.eclipse.virgo.nano.deployer.api.core.DeploymentException: commit failed
    at org.eclipse.virgo.kernel.install.pipeline.stage.resolve.internal.CommitStage.process(CommitStage.java:40)
    at org.eclipse.virgo.kernel.install.pipeline.internal.StandardPipeline.doProcessGraph(StandardPipeline.java:62)
    at org.eclipse.virgo.kernel.install.pipeline.internal.CompensatingPipeline.doProcessGraph(CompensatingPipeline.java:73)
    at org.eclipse.virgo.kernel.install.pipeline.stage.AbstractPipelineStage.process(AbstractPipelineStage.java:41)
    at org.eclipse.virgo.kernel.install.pipeline.internal.StandardPipeline.doProcessGraph(StandardPipeline.java:62)
    at org.eclipse.virgo.kernel.install.pipeline.stage.AbstractPipelineStage.process(AbstractPipelineStage.java:41)
    at org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationDeployer.driveInstallPipeline(PipelinedApplicationDeployer.java:359)
    at org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationDeployer.doInstall(PipelinedApplicationDeployer.java:185)
    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.management.StandardDeployer.deploy(StandardDeployer.java:52)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenReturn(ConvertingMethod.java:167)
    at com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIntrospector.java:96)
    at com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIntrospector.java:33)
    at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:208)
    at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:120)
    at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:264)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:762)
    at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1454)
    at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:74)
    at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1295)
    at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1387)
    at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:818)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:303)
    at sun.rmi.transport.Transport$1.run(Transport.java:159)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
    at java.lang.Thread.run(Thread.java:680)
Caused by: org.osgi.framework.BundleException: Failed to start bundle 'org.eclipse.emf.ecore' version '2.8.0.v20120606-0717'
    at org.eclipse.virgo.kernel.userregion.internal.quasi.StandardQuasiFramework.startBundle(StandardQuasiFramework.java:386)
    at org.eclipse.virgo.kernel.userregion.internal.quasi.StandardQuasiFramework.startBundles(StandardQuasiFramework.java:376)
    at org.eclipse.virgo.kernel.userregion.internal.quasi.StandardQuasiFramework.commit(StandardQuasiFramework.java:365)
    at org.eclipse.virgo.kernel.install.pipeline.stage.resolve.internal.CommitStage.process(CommitStage.java:38)
    ... 41 common frames omitted
Caused by: org.osgi.framework.BundleException: Exception in org.eclipse.emf.ecore.plugin.EcorePlugin$Implementation.start() of bundle org.eclipse.emf.ecore.
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734)
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
    at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:300)
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:292)
    at org.eclipse.virgo.kernel.userregion.internal.quasi.StandardQuasiFramework.startBundle(StandardQuasiFramework.java:384)
    ... 44 common frames omitted
Caused by: java.lang.NullPointerException: null
    at org.eclipse.emf.ecore.plugin.RegistryReader.readRegistry(RegistryReader.java:81)
    at org.eclipse.emf.ecore.plugin.EcorePlugin$Implementation.start(EcorePlugin.java:557)
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
    ... 49 common frames omitted


And I have the feeling the Activator is trying to do something assuming an Eclipse plugin environment while there isn't one. Has anyone used EMF successfully in a Virgo bundle? Thanks!
Re: EMF and Virgo [message #1053568 is a reply to message #1052723] Mon, 06 May 2013 14:45 Go to previous message
GianMaria Romanato is currently offline GianMaria RomanatoFriend
Messages: 72
Registered: July 2009
Member
Hi,

We are using EMF in virgo.

If I remember correctly, I had the feeling that EMF supports two deployment scenarios:


  1. as OSGi bundles in Eclipse
  2. as regular JARs in a JavaSE application



Deployment in an OSGi environment other than Eclipse does not work because activators assume that the container is Eclipse.

To use EMF in Virgo we included the EMF JARs as Bundle-Classpath in a bundle of ours which exports the relevant packages for other bundles.

Attention points:


  • Emf uses a global Package Registry: EPackageRegistryImpl.createGlobalRegistry()
  • EPackageRegistry.getEPackage() seems to rely on the ThreadContext Classloader for certain lookup operations. You may have to change the thread context class loader before invoking that method.


GianMaria.


Developing for Virgo using PDE: http://bit.ly/1w0tTit
Global JNDI in Virgo: http://bit.ly/1to42mn
Hyperic to monitor Virgo: http://bit.ly/W1Fst9
Profile Virgo with JProfiler http://bit.ly/1FBLGCw
Previous Topic:Fragment fails to resolve if listed after host - Virgo Tools on Linux
Next Topic:Virgo 3.6.1 and SpringFramework 3.2.2
Goto Forum:
  


Current Time: Thu Apr 25 05:06:15 GMT 2024

Powered by FUDForum. Page generated in 0.03192 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top