Problems adding plugin as a jar

10 views
Skip to first unread message

Franktwis

unread,
Nov 16, 2009, 6:07:57 AM11/16/09
to cytoscape-discuss
Hi all,
I'm so sorry to have to write so much times on this forum, but I have
to complete a work for the end of my stage and I found that your
answers are speeding up my work deleting all problems with my
inexperience with Cytoscape.
Well, I finally complete a first part of my work creating a Graph from
an excel file. It miss only it visualization but I want try to execute
the plugin. I followed the instructions on:
http://74.125.93.132/search?q=cache:qWqNkw3KmE8J:www.cytoscape.org/cg...
and I've:
- create the file plugin.props:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<
#plugin.props

# This props file should be filled out and included in the plugin jar
file. This props file will be used
# to put information into the Plugin Manager about the plugin

# -- The following properties are REQUIRED -- #

# The plugin name that will be displayed to users, white space within
name is not allowed
pluginName=GraphCreator

# Description used to give users information about the plugin such as
what it does.
# Html tags are encouraged for formatting purposes.
pluginDescription=Information about the plugin that will be displayed
to users.<br>Please use html tags for all formatting and do not add
newlines.<p>

# Plugin version number, this must be two numbers separated by a
decimlal. Ex. 0.2, 14.03
pluginVersion=1.0

# Compatible Cytoscape version. If there are more than one version,
seperate by ",".
cytoscapeVersion=2.5

# Category, use one of the categories listed on the http://cytoscape.org/plugins2.php
site
pluginCategory=Network Inference

# -- The following properties are OPTIONAL -- #

# URL to a website that gives more information about your plugin, Ex.
http://my-lab-site.org
projectURL=http://my-lab-site.org/myCytoscapePlugin

# List of authors. Note each author and institution pair are
separated by a : (colon)
# each additional author institution pair must be separated from other
pairs bye a ; (semicolon)
pluginAuthorsInstitutions=Sarah and Victor:ISB;Mike, Kei and Peng:UCSD

# Date this plugin/plugin version was released
releaseDate=November 16, 2009

# If this plugin is never meant to be downloaded except as part of a
plugin (not common) add this property. Default is "no"
themeOnly=no

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

and create the manifest using Eclipse. It is in a folder named META-
INF and its content is:
>>>>>>>>>>>>>>>>>>>>><<
Manifest-Version: 1.0
Main-Class: GraphCreator

<<<<<<<<<<<<<<<<<<<<<
I found that even if I keep the plugin.props file in my .class folder,
Eclipse don't compress it in the jar file. So I made the jar file with
winRar including plugin.props.
But... when I insert my GraphCreator.jar in the plugin folder of
Cytoscape.. and run Cytoscape , nothing happens. My plugin is not in
the plugin menù. What's happen? I'm wrong in some steps?
In the compilation of my java file I have only a series of warning, no
errors.

Franktwis

unread,
Nov 16, 2009, 9:56:06 AM11/16/09
to cytoscape-discuss
I downloaded another time Cytoscape and now when I insert this plugin
I have this error:
The class name is GraphCreator.class and is in the directory:
cytoscape/plugin/GraphCreator

java.lang.NoClassDefFoundError: GraphCreator/GraphCreator (wrong name:
GraphCreator)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at cytoscape.plugin.PluginManager.getPluginClass(PluginManager.java:
970)
at cytoscape.plugin.PluginManager.loadURLPlugins(PluginManager.java:
896)
at cytoscape.plugin.PluginManager.loadPlugins(PluginManager.java:796)
at cytoscape.CytoscapeInit.init(CytoscapeInit.java:259)
at cytoscape.CyMain.<init>(CyMain.java:155)
at cytoscape.CyMain.main(CyMain.java:119)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.exe4j.runtime.LauncherEngine.launch(Unknown Source)
at com.exe4j.runtime.WinLauncher.main(Unknown Source)
> # Category, use one of the categories listed on thehttp://cytoscape.org/plugins2.php
> site
> pluginCategory=Network Inference
>
> # -- The following properties are OPTIONAL -- #
>
> # URL to a website that gives more information about your plugin, Ex.http://my-lab-site.org

Peng-Liang Wang

unread,
Nov 16, 2009, 2:46:43 PM11/16/09
to cytoscap...@googlegroups.com
It seems to me you have problem in your MANIFEST file. You can unjar a core plugin and look at how the MANiFEST looks like. In the MANIFEST file, you need to specify which class is the entry point of your plugin.
 
Peng
 
--

You received this message because you are subscribed to the Google Groups "cytoscape-discuss" group.
To post to this group, send email to cytoscap...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cytoscape-discuss?hl=.



Fengbo Xie

unread,
Nov 17, 2009, 7:17:42 AM11/17/09
to cytoscape-discuss
Do you have a package declaration on top of the GraphCreator.java
source?
It seems you have namespace problem. In Java, it's package.
You should declare GraphCreator in package cytoscape.plugin and put
GraphCreator.class in directory cytoscape/plugin/
And in the MAINFEST.MF

Fengbo Xie

unread,
Nov 17, 2009, 7:23:25 AM11/17/09
to cytoscape-discuss
Not finished in the previous message.

In the MAINFEST.MF, you should provide FQCN (Full Qualified Class
Name, class name with package) as Cytoscape-Plugin, such as:
Cytoscape-Plugin: cytoscape.plugin.GraphCreator

Download a plugin's source code from the subversion and have a look at
its Ant build.xml file.
Using ant to build the plugin jar, do not depend on eclipse or any
other IDE.

Franktwis

unread,
Nov 19, 2009, 3:12:33 AM11/19/09
to cytoscape-discuss
Hi Fengbo,
I've resolved the problem. It was in the manifest file and in my
compression tree folder created by winrar. Now it works. And,
unbelievably, it works also without opening Cytoscape... I have only
to compile with Eclipse and a new instance of Cytoscape object is
created showing me the program window!
Thanks for your answers
Francesco

Fengbo Xie

unread,
Nov 19, 2009, 10:56:15 AM11/19/09
to cytoscape-discuss
You're welcome.
The cytoscape window will start automatically when you invoke one of
the methods that require Cytoscape desktop, such as loading plugins.

I've post a thread that describes how to avoid the GUI:
http://groups.google.com/group/cytoscape-discuss/t/807330355722759b

--
Fengbo Xie Ph.D candidate
Medical Systems Biology Research Center, Tsinghua University

CaptialBio Corporation
18 Life Science ParkWay,
Changping District, Beijing 102206, China
Reply all
Reply to author
Forward
0 new messages