Problem with adding jxl.jar !

440 views
Skip to first unread message

Yasmine Bahri

unread,
Oct 21, 2014, 7:01:57 AM10/21/14
to cytoscap...@googlegroups.com
Hi all,

I'm developing a Cytoscape 3 bundle app which uses an external package called "jxl.jar" () that I add it to the class path of my project but when I add the app to cytoscape it failed to load.
I need to use the jxl package to import some informations from an excel document.
I think that I have to add the new package to the dependency of the pom.xml. I write the following lines baut I got an error : missing artifactId for org.jxl:jxl:2.6.12 !
                
                <dependency>
<groupId>org.jxl</groupId>
<artifactId>jxl</artifactId>
<version>2.6.12</version>
</dependency>

Any help please  ?

piet molenaar

unread,
Oct 21, 2014, 7:13:33 AM10/21/14
to Cytoscape-Discuss
Hi,
Following the hints from Jason, Samad and Tim (somewhere in the discuss thread) I succeeded in including the jars by also modifying the the configuration of the maven bundle plugin: in my case for the apache math lib and mysql connector:

<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.3.7</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${bundle.symbolicName}</Bundle-SymbolicName>
<Bundle-Version>${project.version}</Bundle-Version>
<Export-Package>${bundle.namespace}</Export-Package>
<Private-Package>${bundle.namespace}.internal.*</Private-Package>
<Bundle-Activator>${bundle.namespace}.internal.CyActivator</Bundle-Activator>
<Import-Package>
         com.mysql.jdbc;version:=5.1.30,*;resolution:=optional,
        org.apache.commons.math3;version:=3.0;resolution:=optional
        </Import-Package>
<Embed-Dependency>
mysql-connector-java;inline=true,
commons-math3;inline=true
</Embed-Dependency>
</instructions>
</configuration>
</plugin>

Furthermore you have to add the dependencies and set these to optional:

<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.30</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-math3</artifactId>
<version>3.0</version>
<optional>true</optional>
</dependency>

Hope this helps!
Piet



--
You received this message because you are subscribed to the Google Groups "cytoscape-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-disc...@googlegroups.com.
To post to this group, send email to cytoscap...@googlegroups.com.
Visit this group at http://groups.google.com/group/cytoscape-discuss.
For more options, visit https://groups.google.com/d/optout.



--
Piet Molenaar
piet...@gmail.com
Department of Oncogenomics, M1-131
Academic Medical Center
University of Amsterdam
Meibergdreef 9
1105 AZ Amsterdam
the Netherlands

tel (+31) 20-5666592
fax (+31) 20-6918626

Yasmine Bahri

unread,
Oct 21, 2014, 1:07:47 PM10/21/14
to cytoscap...@googlegroups.com
Thank you Piet but it deosn't work for me :( and I got the following error :

ArtifactDescriptorException: Failed to read artifact descriptor for org.jxl:jxl:jar:2.6.12: ArtifactResolutionException: Failure to transfer org.jxl:jxl:pom:2.6.12 from http://code.cytoscape.org/nexus/content/repositories/releases/ was cached in the local repository, resolution will not be reattempted until the update interval of cytoscape_releases has elapsed or updates are forced. Original error: Could not transfer artifact org.jxl:jxl:pom:2.6.12 from/to cytoscape_releases (http://code.cytoscape.org/nexus/content/repositories/releases/): code.cytoscape.org pom.xml /CerebralCy3.1 line 1 Maven Dependency Problem

piet molenaar

unread,
Oct 22, 2014, 6:15:14 AM10/22/14
to Cytoscape-Discuss
Hi,
I'm not sure whether you use an IDE (like eclipse that I'm using) but I think you'd have to add a maven repository where the jar can be loaded from. In eclipse this can be done through the interface that automagically adds the maven repository:

    <repository>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <id>central</id>
      <name>Central Repository</name>
    </repository>

Not sure whether your jar is in there though.
Piet

Stefano Schivo

unread,
Nov 10, 2014, 5:51:40 AM11/10/14
to cytoscap...@googlegroups.com
Oh my god, thank you so much: I have been hitting my head against maven for a couple of painful days before finding your illuminating post!
Indeed, also the "optional" thing is important. Finally I can include the jar of the libraries on which I depend directly in the app package =)
Thank you again!

Igor Rodchenkov

unread,
Nov 10, 2014, 10:51:16 AM11/10/14
to cytoscap...@googlegroups.com
Great! Here are my two cents:

Here is that discussion topic (but such questions have been answered many time before that as well): https://groups.google.com/forum/#!topic/cytostaff/J2Itp7VLnMM

and the tutorial (by Samad): http://wiki.cytoscape.org/HowToAddLibraryDependencies

Also, ";inline=true" is not a must and even hurts some projects (I had such case).

Best,
Igor R. 
Reply all
Reply to author
Forward
0 new messages