Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] bundle-classpath resolution error with tycho

I would also answer it that way. You shouldn't rely on external libraries in OSGi bundles. You can never be sure that on another client there is the external library with the necessary version at the specified location.

A good practice for OSGi bundles is to package the third-party library JAR into your plugin. This way you avoid issues for clients if they do not have the library installed in the necessary version.


On Thu, Oct 10, 2013 at 6:12 PM, Jeff MAURY <jeffmaury@xxxxxxxxxxxxx> wrote:


On Thu, Oct 10, 2013 at 6:07 PM, Stéphane Bouchet <sbouchet@xxxxxxxxx> wrote:
i found several use of it from eclipse platform team:

i cannot consider that a standard, but seems to be at least supported by PDE.


2013/10/10 Jeff MAURY <jeffmaury@xxxxxxxxxxxxx>
According to the Tycho code, it does not seems to be supported.
I don't think this should be difficult to resolve.
However, I'm wondering how this external prefix is standard ?

Jeff


On Thu, Oct 10, 2013 at 5:44 PM, Stéphane Bouchet <sbouchet@xxxxxxxxx> wrote:
oh yes, sorry there is the full stack : 

[ERROR] Internal error: java.lang.RuntimeException: IOException while extracting 'external:$ant.home$/lib/ant.jar' from C:\Users\sbouchet\.m2\repository\p2\osgi\bundle\integration.eclipse.rcp\1.0.0\integration.eclipse.rcp-1.0.0.jar: La syntaxe du nom de fichier, de r�pertoire ou de volume est incorrecte -> [Help 1]

org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: IOException while extracting 'external:$ant.home$/lib/ant.jar' from C:\Users\sbouchet\.m2\repository\p2\osgi\bundle\integration.eclipse.rcp\1.0.0\integration.eclipse.rcp-1.0.0.jar

       at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:168)

       at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)

       at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)

       at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)

       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

       at java.lang.reflect.Method.invoke(Method.java:606)

       at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)

       at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)

       at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)

       at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)

Caused by: java.lang.RuntimeException: IOException while extracting 'external:$ant.home$/lib/ant.jar' from C:\Users\sbouchet\.m2\repository\p2\osgi\bundle\integration.eclipse.rcp\1.0.0\integration.eclipse.rcp-1.0.0.jar

       at org.eclipse.tycho.core.osgitools.DefaultBundleReader.getEntry(DefaultBundleReader.java:164)

       at org.eclipse.tycho.core.osgitools.OsgiBundleProject.getNestedJarOrDir(OsgiBundleProject.java:439)

       at org.eclipse.tycho.core.osgitools.OsgiBundleProject.getBundleClasspath(OsgiBundleProject.java:405)

       at org.eclipse.tycho.core.osgitools.OsgiBundleProject.resolveClassPath(OsgiBundleProject.java:193)

       at org.eclipse.tycho.core.resolver.DefaultTychoDependencyResolver.resolveProject(DefaultTychoDependencyResolver.java:122)

       at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead(TychoMavenLifecycleParticipant.java:82)

       at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:274)

       at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)

       ... 11 more


Caused by: java.io.IOException: La syntaxe du nom de fichier, de r�pertoire ou de volume est incorrecte

       at java.io.WinNTFileSystem.canonicalize0(Native Method)

       at java.io.Win32FileSystem.canonicalize(Win32FileSystem.java:414)

       at java.io.File.getCanonicalPath(File.java:618)

       at org.eclipse.tycho.core.osgitools.DefaultBundleReader.getEntry(DefaultBundleReader.java:150)


2013/10/10 Jeff MAURY <jeffmaury@xxxxxxxxxxxxx>
If you can't move, would be nice to know the name of the file on which the error happened.

Jeff


On Thu, Oct 10, 2013 at 5:26 PM, Stéphane Bouchet <sbouchet@xxxxxxxxx> wrote:
No, i don't.
all my development and build is made under windows. i can try to make a very little example ?


2013/10/10 Jeff MAURY <jeffmaury@xxxxxxxxxxxxx>
Sees to be Windows related, did you try on Linux ?

Jeff


On Thu, Oct 10, 2013 at 4:38 PM, Stéphane Bouchet <sbouchet@xxxxxxxxx> wrote:
Hi,

using tycho 0.18.0, i am trying to build a plugin that have a dependency to a third party plugin having a bundle-classpath with some external nested jars.

the Bundle-Classpath of this third-party plugin is Bundle-ClassPath: external:$ant.home$/lib/ant.jar

but tycho does not resolve it, despite the -Dant.home="c:/ant" used in command line.
the exception is :

Caused by: java.io.IOException: La syntaxe du nom de fichier, de rpertoire ou de volume est incorrecte

       at java.io.WinNTFileSystem.canonicalize0(Native Method)

       at java.io.Win32FileSystem.canonicalize(Win32FileSystem.java:414)

       at java.io.File.getCanonicalPath(File.java:618)

       at org.eclipse.tycho.core.osgitools.DefaultBundleReader.getEntry(DefaultBundleReader.java:150)


Of course, i cannot modify this third party plugin to point to absolute or relative nested jar.

any help appreciated, 

cheers,

PS : i found this thread[1] using this technique, too but not sure if the plugin is built with tycho.

[1]http://www.codetrails.com/blog/osgi-ify-your-tools-jar


_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/tycho-user




--
Jeff MAURY


"Legacy code" often differs from its suggested alternative by actually working and scaling.
 - Bjarne Stroustrup

http://www.jeffmaury.com
http://riadiscuss.jeffmaury.com
http://www.twitter.com/jeffmaury

_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/tycho-user



_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/tycho-user




--
Jeff MAURY


"Legacy code" often differs from its suggested alternative by actually working and scaling.
 - Bjarne Stroustrup

http://www.jeffmaury.com
http://riadiscuss.jeffmaury.com
http://www.twitter.com/jeffmaury

_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/tycho-user



_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/tycho-user




--
Jeff MAURY


"Legacy code" often differs from its suggested alternative by actually working and scaling.
 - Bjarne Stroustrup

http://www.jeffmaury.com
http://riadiscuss.jeffmaury.com
http://www.twitter.com/jeffmaury

_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/tycho-user



_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/tycho-user




--
Jeff MAURY


"Legacy code" often differs from its suggested alternative by actually working and scaling.
 - Bjarne Stroustrup

http://www.jeffmaury.com
http://riadiscuss.jeffmaury.com
http://www.twitter.com/jeffmaury

_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/tycho-user



Back to the top