Hi All,
Thank you very much for all the help for the previous questions. Sadly I am
stuck again.
Here is my code (Same code given at Biomart Central)
package cosmicAccess;
import org.biomart.api.factory.*;
import org.biomart.api.Portal;
import org.biomart.api.Query;
/*
* This is a runnable Java class that executes the query.
* Please adapt this code as needed, and DON'T forget to change the xmlPath.
*/
public class accessCosmic {
public static void main(String[] args) throws Exception {
String xmlPath = "C:/cosmicRegistry.xml"; // Needs to be changed
MartRegistryFactory factory = new XmlMartRegistryFactory(xmlPath,
null);
Portal portal = new Portal(factory, null);
Query query = new Query(portal);
query.setProcessor("TSV");
query.setClient("biomartclient");
query.setLimit(-1);
query.setHeader(true);
Query.Dataset ds = query.addDataset("COSMIC54", "COSMIC54_config");
ds.addFilter("sample_source", "primary");
ds.addFilter("tumour_source", "primary");
ds.addFilter("site_primary", "cervix");
ds.addAttribute("id_sample");
ds.addAttribute("tumour_source");
ds.addAttribute("id_gene");
ds.addAttribute("accession_number");
ds.addAttribute("pubmed_pmid");
// Print to System.out, but you can pass in any java.io.OutputStream
query.getResults(System.out);
System.exit(0);
}
}
Here is the Registry file in C:/cosmicRegistry.xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- <!DOCTYPE MartRegistry> -->
<MartRegistry>
<MartURLLocation
database="cosp"
default="1"
displayName="COSMIC (SANGER UK)"
host="www.sanger.ac.uk"
includeDatasets=""
martUser=""
name="CosmicMart"
path="/genetics/CGP/cosmic/biomart/martservice"
port="80"
redirect="1"
serverVirtualSchema="default"
visible="1"
/>
</MartRegistry>
When I run this I get this error.
Exception in thread "main" java.lang.NoClassDefFoundError:
net/infonode/docking/View
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at
org.biomart.api.factory.XmlMartRegistryFactory.<init>(XmlMartRegistryFactory.java:23)
at cosmicAccess.accessCosmic.main(accessCosmic.java:21)
at owlextract.Main.main(Main.java:26)
Caused by: java.lang.ClassNotFoundException: net.infonode.docking.View
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 15 more
Java Result: 1
BUILD SUCCESSFUL (total time: 2 seconds)
I am running this in windows 7 environment. I have added the biomart0.8.jre
as a lib to my Netbeans project. I compiled it using Ant.
I will be grateful if anyone can point me to the error. Thank you very much
for all the support and the great tool.
Regards,
Manjula
--
* <http://lk.linkedin.com/in/manjulapra>
*
*This communication (including any attachments) is intended for the use of
the intended recipient only and may contain information that is
confidential, privileged or legally protected. Any unauthorized use or
dissemination of this communication is strictly prohibited. If you have
received this communication in error, please immediately notify
[email protected] by return e-mail message and delete all copies of the
original communication. Thank you for your cooperation.*
_______________________________________________
Users mailing list
[email protected]
https://lists.biomart.org/mailman/listinfo/users