Building a cytoscape app from eclipse (maven) using JRI/Rengine

34 views
Skip to first unread message

roosha...@gmail.com

unread,
Jun 13, 2016, 3:23:46 PM6/13/16
to cytoscape-discuss, roosh...@gmail.com
Hello, 
I am working on a project to develop an app that calls an R script that performs computations on a matrix input, but I am having trouble getting to make the connection using Rengine or Rserve. Rengine,JRI,etc are added as dependencies for the package already and the package environment is set up. 
My app is loading on cytoscape when I take out the bits of code that call Rengine/REXP, but when I include that portion of code it is not loading. Could there be some part of the process I am missing? 

//Here is the code: 

public void FastGGM() throws REXPMismatchException{

String filename = "/Users/rmdl/Desktop/FASTGGMfnfile.R";

String title = "Running fastGGM...";

JLabel current = new JLabel(title+" " + filename);

this.add(current);

//code gets this far


int p = 100;

int n = 50;

REXP result = rengine.eval("FSTGGMreturns("+n+","+p+")");


JLabel resultPublished = new JLabel(result.toString());

this.add(resultPublished);


}

Scooter Morris

unread,
Jun 16, 2016, 11:29:38 AM6/16/16
to cytoscape-discuss, roosh...@gmail.com
Hi,
  My off-hand guess is that you are not actually getting the jar files necessary loaded properly.   If you start Cytoscape from the command line, you should be able to get to the OSGi shell (it should say something like "Cytoscape 3.4.0> ".  If you do a list to find your app.  If it's not "Active" try to start it by typing in "start nnn" where nnn is the bundle ID from the left-hand column of the list.   This should give you an error, but I would guess you are getting a "Class not found" error.  Take a look and let us know and we can help figure out what you need to do to get those jars properly loaded.

-- scooter

roosha...@gmail.com

unread,
Jun 16, 2016, 11:46:54 AM6/16/16
to cytoscape-discuss, rma...@andrew.cmu.edu

Hello, 

After running in the Cytoscape shell my error is: 

Error executing command: Error executing command on bundles:

Unable to execute command on bundle 130: Activator start error in bundle org.cytoscape.menuapp.menuapp [130]

Cytoscape 3.4.0> org.cytoscape.app.internal.exception.AppStartupException: Bundle start error

at org.cytoscape.app.internal.manager.BundleApp.start(BundleApp.java:84)

at org.cytoscape.app.internal.manager.AppManager$1.onFileCreate(AppManager.java:461)

at org.cytoscape.app.internal.manager.AppManager$1.onFileChange(AppManager.java:481)

at org.apache.commons.io.monitor.FileAlterationObserver.doMatch(FileAlterationObserver.java:400)

at org.apache.commons.io.monitor.FileAlterationObserver.checkAndNotify(FileAlterationObserver.java:334)

at org.apache.commons.io.monitor.FileAlterationObserver.checkAndNotify(FileAlterationObserver.java:304)

at org.apache.commons.io.monitor.FileAlterationMonitor.run(FileAlterationMonitor.java:182)

at java.lang.Thread.run(Thread.java:745)

Caused by: org.osgi.framework.BundleException: Activator start error in bundle org.cytoscape.menuapp.menuapp [130].

at org.apache.felix.framework.Felix.activateBundle(Felix.java:2196)

at org.apache.felix.framework.Felix.startBundle(Felix.java:2064)

at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:955)

at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:942)

at org.cytoscape.app.internal.manager.BundleApp.start(BundleApp.java:82)

... 7 more

Caused by: java.lang.NoClassDefFoundError: org/rosuda/JRI/Rengine

at org.cytoscape.menuapp.internal.MyControlPanel.<init>(MyControlPanel.java:29)

at org.cytoscape.menuapp.internal.CyActivator.start(CyActivator.java:19)

at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645)

at org.apache.felix.framework.Felix.activateBundle(Felix.java:2146)

... 11 more

Caused by: java.lang.ClassNotFoundException: org.rosuda.JRI.Rengine not found by org.cytoscape.menuapp.menuapp [130]

at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)

at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)

at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)

at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

... 15 more

I see the class not found error at the end, but is there something also I need to add in my CyActivator?

Thanks
Reply all
Reply to author
Forward
0 new messages