Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Uses violation
Uses violation [message #760803] Mon, 05 December 2011 10:28 Go to next message
Jean-Pierre Bergamin is currently offline Jean-Pierre BergaminFriend
Messages: 51
Registered: March 2011
Location: Zürich, CH
Member
Hello virgo users

I'm facing a "Uses violation" error that I do not understand and hope that someone can give some tipps how to get things up and running.

We created a "super-bundle" of the neo4j database that contains all internal dependencies as jar files and exports org.neo4j.* and some other packages. A second bundle (org.springframework.data.neo4j) uses this "super-bundle", but cannot be resolved due to these uses violations:

Caused by: org.eclipse.virgo.kernel.osgi.framework.UnableToSatisfyBundleDependenciesException: Unable to satisfy dependencies of bundle 'org.springframework.data.neo4j' at version '2.0.0.BUILD-SNAPSHOT': Cannot resolve: org.springframework.data.neo4j
    Resolver report:
        Uses violation: <Import-Package: org.neo4j.kernel.impl.persistence; version="0.0.0"> in bundle <org.springframework.data.neo4j_2.0.0.BUILD-SNAPSHOT[1323077690980]>
             Resolver reported uses conflict for import
        Uses violation: <Import-Package: org.neo4j.index.impl.lucene; version="0.0.0"> in bundle <org.springframework.data.neo4j_2.0.0.BUILD-SNAPSHOT[1323077690980]>
             Resolver reported uses conflict for import
        Uses violation: <Import-Package: org.neo4j.kernel; version="0.0.0"> in bundle <org.springframework.data.neo4j_2.0.0.BUILD-SNAPSHOT[1323077690980]>
             Resolver reported uses conflict for import
        Uses violation: <Import-Package: org.neo4j.kernel.impl.transaction; version="0.0.0"> in bundle <org.springframework.data.neo4j_2.0.0.BUILD-SNAPSHOT[1323077690980]>
             Resolver reported uses conflict for import
        Uses violation: <Import-Package: org.neo4j.kernel.impl.nioneo.store; version="0.0.0"> in bundle <org.springframework.data.neo4j_2.0.0.BUILD-SNAPSHOT[1323077690980]>
             Resolver reported uses conflict for import
        Uses violation: <Import-Package: org.neo4j.kernel.impl.core; version="0.0.0"> in bundle <org.springframework.data.neo4j_2.0.0.BUILD-SNAPSHOT[1323077690980]>
             Resolver reported uses conflict for import


I cannot understand why these violations show up. I walked through the imports of both bundles, but could not find any conflicts.

Our client bundle imports the neo4j super-bundle with Import-Bundle. When I deploy this one, I get the following message that I cannot understand neither:
Detected Import-Bundle of bundle 'org.neo4j.neo4j-osgi-bundle' version '0.1.0.SNAPSHOT' which exports packages that are exported by the system bundle: consider importing the packages explicitly. For example, use Import-Package: org.neo4j.cypher.javacompat,scala.annotation.unchecked,org.apache.lucene.util,many many more...

Why does virgo think that this bundle exports the same packages as the system bundle?

I'd really appreciate any hints how to solve this.

The two bundles I was talking about can be found in the pickup directory of the following zip file. It also contains the repository/usr directory with all dependencies:
http://dl.dropbox.com/u/11739559/neo4j-bundle.zip

We are using Virgo 3.0.1.


Best regards,
James
Re: Uses violation [message #760901 is a reply to message #760803] Mon, 05 December 2011 14:41 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
Please could you post the content of lib/java6-server.profile?
Re: Uses violation [message #760934 is a reply to message #760901] Mon, 05 December 2011 16:19 Go to previous messageGo to next message
Jean-Pierre Bergamin is currently offline Jean-Pierre BergaminFriend
Messages: 51
Registered: March 2011
Location: Zürich, CH
Member
Hi Glyn

It's the standard one that comes with virgo:


org.osgi.framework.system.packages = \
javax.accessibility,\
javax.activation,\
javax.activation;version="1.1.1",\
javax.activity,\
javax.annotation,\
javax.annotation;version="1.0.0",\
javax.annotation.processing,\
javax.crypto,\
javax.crypto.interfaces,\
javax.crypto.spec,\
javax.imageio,\
javax.imageio.event,\
javax.imageio.metadata,\
javax.imageio.plugins.bmp,\
javax.imageio.plugins.jpeg,\
javax.imageio.spi,\
javax.imageio.stream,\
javax.jws,\
javax.jws;version="2.0",\
javax.jws.soap,\
javax.jws.soap;version="2.0",\
javax.lang.model,\
javax.lang.model.element,\
javax.lang.model.type,\
javax.lang.model.util,\
javax.management,\
javax.management.loading,\
javax.management.modelmbean,\
javax.management.monitor,\
javax.management.openmbean,\
javax.management.relation,\
javax.management.remote,\
javax.management.remote.rmi,\
javax.management.timer,\
javax.naming,\
javax.naming.directory,\
javax.naming.event,\
javax.naming.ldap,\
javax.naming.spi,\
javax.net,\
javax.net.ssl,\
javax.print,\
javax.print.attribute,\
javax.print.attribute.standard,\
javax.print.event,\
javax.rmi,\
javax.rmi.CORBA,\
javax.rmi.ssl,\
javax.script,\
javax.script;version="1.1",\
javax.security.auth,\
javax.security.auth.callback,\
javax.security.auth.kerberos,\
javax.security.auth.login,\
javax.security.auth.spi,\
javax.security.auth.x500,\
javax.security.cert,\
javax.security.sasl,\
javax.sound.midi,\
javax.sound.midi.spi,\
javax.sound.sampled,\
javax.sound.sampled.spi,\
javax.sql,\
javax.sql.rowset,\
javax.sql.rowset.serial,\
javax.sql.rowset.spi,\
javax.swing,\
javax.swing.border,\
javax.swing.colorchooser,\
javax.swing.event,\
javax.swing.filechooser,\
javax.swing.plaf,\
javax.swing.plaf.basic,\
javax.swing.plaf.metal,\
javax.swing.plaf.multi,\
javax.swing.plaf.synth,\
javax.swing.table,\
javax.swing.text,\
javax.swing.text.html,\
javax.swing.text.html.parser,\
javax.swing.text.rtf,\
javax.swing.tree,\
javax.swing.undo,\
javax.tools,\
javax.transaction,\
javax.transaction;version="1.0.1",\
javax.transaction;version="1.1.0",\
javax.transaction.xa,\
javax.transaction.xa;version="1.0.1",\
javax.transaction.xa;version="1.1.0",\
javax.xml,\
javax.xml;version="1.0.1",\
javax.xml.bind,\
javax.xml.bind;version="2.0",\
javax.xml.bind.annotation,\
javax.xml.bind.annotation;version="2.0",\
javax.xml.bind.annotation.adapters,\
javax.xml.bind.annotation.adapters;version="2.0",\
javax.xml.bind.attachment,\
javax.xml.bind.attachment;version="2.0",\
javax.xml.bind.helpers,\
javax.xml.bind.helpers;version="2.0",\
javax.xml.bind.util,\
javax.xml.bind.util;version="2.0",\
javax.xml.crypto,\
javax.xml.crypto;version="1.0",\
javax.xml.crypto.dom,\
javax.xml.crypto.dom;version="1.0",\
javax.xml.crypto.dsig,\
javax.xml.crypto.dsig;version="1.0",\
javax.xml.crypto.dsig.dom,\
javax.xml.crypto.dsig.dom;version="1.0",\
javax.xml.crypto.dsig.keyinfo,\
javax.xml.crypto.dsig.keyinfo;version="1.0",\
javax.xml.crypto.dsig.spec,\
javax.xml.crypto.dsig.spec;version="1.0",\
javax.xml.datatype,\
javax.xml.namespace,\
javax.xml.parsers,\
javax.xml.soap,\
javax.xml.soap;version="1.3.0",\
javax.xml.stream,\
javax.xml.stream;version="1.0.1",\
javax.xml.stream.events,\
javax.xml.stream.events;version="1.0.1",\
javax.xml.stream.util,\
javax.xml.stream.util;version="1.0.1",\
javax.xml.transform,\
javax.xml.transform.dom,\
javax.xml.transform.sax,\
javax.xml.transform.stax,\
javax.xml.transform.stream,\
javax.xml.validation,\
javax.xml.ws,\
javax.xml.ws;version="2.1.1",\
javax.xml.ws.handler,\
javax.xml.ws.handler;version="2.1.1",\
javax.xml.ws.handler.soap,\
javax.xml.ws.handler.soap;version="2.1.1",\
javax.xml.ws.http,\
javax.xml.ws.http;version="2.1.1",\
javax.xml.ws.soap,\
javax.xml.ws.soap;version="2.1.1",\
javax.xml.ws.spi,\
javax.xml.ws.spi;version="2.1.1",\
javax.xml.xpath,\
org.ietf.jgss,\
org.omg.CORBA,\
org.omg.CORBA_2_3,\
org.omg.CORBA_2_3.portable,\
org.omg.CORBA.DynAnyPackage,\
org.omg.CORBA.ORBPackage,\
org.omg.CORBA.portable,\
org.omg.CORBA.TypeCodePackage,\
org.omg.CosNaming,\
org.omg.CosNaming.NamingContextExtPackage,\
org.omg.CosNaming.NamingContextPackage,\
org.omg.Dynamic,\
org.omg.DynamicAny,\
org.omg.DynamicAny.DynAnyFactoryPackage,\
org.omg.DynamicAny.DynAnyPackage,\
org.omg.IOP,\
org.omg.IOP.CodecFactoryPackage,\
org.omg.IOP.CodecPackage,\
org.omg.Messaging,\
org.omg.PortableInterceptor,\
org.omg.PortableInterceptor.ORBInitInfoPackage,\
org.omg.PortableServer,\
org.omg.PortableServer.CurrentPackage,\
org.omg.PortableServer.POAManagerPackage,\
org.omg.PortableServer.POAPackage,\
org.omg.PortableServer.portable,\
org.omg.PortableServer.ServantLocatorPackage,\
org.omg.SendingContext,\
org.omg.stub.java.rmi,\
org.w3c.dom,\
org.w3c.dom.bootstrap,\
org.w3c.dom.css,\
org.w3c.dom.events,\
org.w3c.dom.html,\
org.w3c.dom.ls,\
org.w3c.dom.ranges,\
org.w3c.dom.stylesheets,\
org.w3c.dom.traversal,\
org.w3c.dom.views ,\
org.xml.sax,\
org.xml.sax.ext,\
org.xml.sax.helpers
org.osgi.framework.bootdelegation = \
org.eclipse.virgo.osgi.extensions.*,\
org.eclipse.virgo.osgi.launcher.*,\
org.eclipse.virgo.kernel.authentication,\
com.sun.*,\
javax.xml.*,\
org.apache.xerces.jaxp.*,\
org.w3c.*,\
org.xml.*,\
sun.*
org.osgi.framework.executionenvironment = \
OSGi/Minimum-1.0,\
OSGi/Minimum-1.1,\
J2SE-1.3,\
J2SE-1.4,\
J2SE-1.5,\
JavaSE-1.6
osgi.java.profile.name = Virgo-Kernel-Java6



Regards,
James
Re: Uses violation [message #760936 is a reply to message #760934] Mon, 05 December 2011 16:23 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
Thanks James. I'm grabbing the zip and will take a look when I have a spare few minutes. (I'm "rippling" some changes up at the moment, so I can't launch Virgo without spoiling my day.)
Re: Uses violation [message #760948 is a reply to message #760936] Mon, 05 December 2011 17:09 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
I may have found a clue to the first problem by eye-balling the manifests. The Neo4j bundle exports org.neo4j.kernel.impl.transaction with a uses constraint on javax.transaction and javax.transaction.xa, but Neo4j does not appear to import (or export) these packages. This is a toxic combination as any bundle, such as the Spring Data Neo4j bundle, that imports org.neo4j.kernel.impl.transaction and javax.transaction/javax.transaction.xa will hit a uses constraint violation because it can't possibly wire to the same version of the javax.transaction/javax.transaction.xa packages as the Neo4j bundle. So it looks like the Neo4j bundle manifest is faulty and needs correcting.

(I am guessing the second problem is related although I haven't gone into that yet and the diagnostics are misleading, which looks like a bug in Virgo on the face of it.)
icon14.gif  Re: Uses violation [message #761116 is a reply to message #760948] Mon, 05 December 2011 23:18 Go to previous messageGo to next message
Jean-Pierre Bergamin is currently offline Jean-Pierre BergaminFriend
Messages: 51
Registered: March 2011
Location: Zürich, CH
Member
Glyn Normington wrote on Mon, 05 December 2011 12:09
I may have found a clue to the first problem by eye-balling the manifests. The Neo4j bundle exports org.neo4j.kernel.impl.transaction with a uses constraint on javax.transaction and javax.transaction.xa, but Neo4j does not appear to import (or export) these packages. This is a toxic combination as any bundle, such as the Spring Data Neo4j bundle, that imports org.neo4j.kernel.impl.transaction and javax.transaction/javax.transaction.xa will hit a uses constraint violation because it can't possibly wire to the same version of the javax.transaction/javax.transaction.xa packages as the Neo4j bundle. So it looks like the Neo4j bundle manifest is faulty and needs correcting.

(I am guessing the second problem is related although I haven't gone into that yet and the diagnostics are misleading, which looks like a bug in Virgo on the face of it.)


...
Started bundle 'org.springframework.data.neo4j' version '2.0.0.BUILD-SNAPSHOT'.
...

... Shocked

Ahhh. javax.transaction was indeed the bad guy. The jar "geronimo-jta_1.1_spec-1.1.1.jar" that has been included in the neo4j bundle *is* an implementation of javax.transaction. I have not noticed that. Sad
After excluding this dependency so that it is not included in the jar anymore, I can successfully start all bundles - including our client bundle. And the message that the neo4j bundle is exporting packages that also the system bundle does also disappeared - although this message should not have been shown since the neo4j bundle actually did not export the packages. But this seems to be a minor issue for me now.

Thank you very much for pointing me to the right direction. I could have "eye-balling the manifests" for another couple of hours without noticing this inconsistency. You could sometimes lend me an eye ball... or two... Smile


Best regards,
James
Re: Uses violation [message #761367 is a reply to message #761116] Tue, 06 December 2011 11:11 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
Hi James

Glad you are sorted. I'm following up to see if the original diagnostics can be improved. Running on a development build of Virgo Tomcat Server I seem to be missing at least one package:

Cannot resolve: org.springframework.data.neo4j
Resolver report:
An Import-Package could not be resolved. Resolver error data <Import-Package: org.springframework.data.annotation; version="[1.0.0,2.0.0)">. Caused by missing constraint in bundle <org.springframework.data.neo4j_2.0.0.BUILD-SNAPSHOT>
constraint: <Import-Package: org.springframework.data.annotation; version="[1.0.0,2.0.0)">
An Import-Package could not be resolved. Resolver error data <Import-Package: org.springframework.aop.framework; version="[3.0.6,4.0.0)">. Caused by missing constraint in bundle <org.springframework.data.commons_1.2.0.BUILD-SNAPSHOT>
constraint: <Import-Package: org.springframework.aop.framework; version="[3.0.6,4.0.0)">

Did you also upgrade Spring to 3.0.6?

Regards,
Glyn
Re: Uses violation [message #761528 is a reply to message #761367] Tue, 06 December 2011 15:46 Go to previous messageGo to next message
Jean-Pierre Bergamin is currently offline Jean-Pierre BergaminFriend
Messages: 51
Registered: March 2011
Location: Zürich, CH
Member
Oh yes. We had to upgrade to Spring 3.0.6 by putting the spring libs into the repository/ext folder. Shell I make you the ext folder available?
Re: Uses violation [message #763307 is a reply to message #761528] Fri, 09 December 2011 14:42 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
(Sorry for the delay in responding - somehow I got unsubscribed from this thread).

Nah, that's ok, but thanks for confirming. I can grab Spring 3.0.6 no problem.
Re: Uses violation [message #763357 is a reply to message #760803] Fri, 09 December 2011 16:25 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
Raised https://bugs.eclipse.org/bugs/show_bug.cgi?id=366218 to cover the basic insufficiency of the resolution diagnostics in this case.
Re: Uses violation [message #763382 is a reply to message #763357] Fri, 09 December 2011 17:04 Go to previous message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
Raised https://bugs.eclipse.org/bugs/show_bug.cgi?id=366224 to over the system bundle export overlap issue.
Previous Topic:ClassNotFoundException for javax.crypto class
Next Topic:Virgo Scripts with cygwin support
Goto Forum:
  


Current Time: Tue Apr 16 07:03:47 GMT 2024

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

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

Back to the top