TthinkModell / dynnetwork

Automatically exported from code.google.com/p/dynnetwork
0 stars 0 forks source link

SAX Parser Class Error #1

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Loading application in Cytoscape 3.0.0-M5

What is the expected output? What do you see instead?

Cannot find the SAX parser class, and throws:

    java.lang.reflect.InvocationTargetException
    sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    org.cytoscape.app.internal.AppLoaderTask.run(AppLoaderTask.java:59)
    org.cytoscape.work.internal.task.JDialogTaskManager$TaskThread.run(JDialogTaskManager.java:220)
    java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
    java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    java.util.concurrent.FutureTask.run(FutureTask.java:138)
    java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    java.lang.Thread.run(Thread.java:662)
    java.lang.NoClassDefFoundError: org/xml/sax/helpers/DefaultHandler
    org.cytoscape.dyn.DynNetworkApp.(DynNetworkApp.java:18)
    sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    org.cytoscape.app.internal.AppLoaderTask.run(AppLoaderTask.java:59)
    org.cytoscape.work.internal.task.JDialogTaskManager$TaskThread.run(JDialogTaskManager.java:220)
    java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
    java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    java.util.concurrent.FutureTask.run(FutureTask.java:138)
    java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    java.lang.Thread.run(Thread.java:662)
    java.lang.ClassNotFoundException: org.xml.sax.helpers.DefaultHandler
    java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    java.security.AccessController.doPrivileged(Native Method)
    java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    org.cytoscape.dyn.DynNetworkApp.(DynNetworkApp.java:18)
    sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    org.cytoscape.app.internal.AppLoaderTask.run(AppLoaderTask.java:59)
    org.cytoscape.work.internal.task.JDialogTaskManager$TaskThread.run(JDialogTaskManager.java:220)
    java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
    java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    java.util.concurrent.FutureTask.run(FutureTask.java:138)
    java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    java.lang.Thread.run(Thread.java:662) 

Original issue reported on code.google.com by xani...@gmail.com on 19 May 2012 at 9:46

GoogleCodeExporter commented 8 years ago
From Jason:

You mean 3.0.0-M5-SNAPSHOT, right?  I'm assuming you're building against the 
latest sources.  This is happening because of a loophole we recently closed 
which allowed simple apps to bypass OSGi's class loading rules and access 
pretty much anything on any bundle's classpath.  So before, XML parsing was 
working because one of the core bundles depended on a SAX parser.  Now that you 
can't access that, you need to explicitly declare a dependency on a SAX parser 
implementation (and possibly the API too).  As soon as you start depending on 
third party libraries, that's when you really should transition over to making 
a bundle app.  It's not very hard if you use Maven.  You'll need to restructure 
your project a little (i.e. move all your source into /src/main/java, instead 
of just /src) and create a POM file (I can provide this, or use 
samples/sample02/pom.xml as a template).  If you want to stick to the simple 
app route, things will get hairy.  Basically, you'll need to figure out the 
transitive closure of your dependencies (i.e. the JARs you directly depend on 
and the JARs they depend on, recursively), unpack all those JARs and repack 
them all plus your class files into a single JAR.  Maven can do this for you 
easily, but if you're going to switch to Maven, you might as well make bundle 
apps.

Original comment by xani...@gmail.com on 22 May 2012 at 7:17

GoogleCodeExporter commented 8 years ago
converted application to bundle (as documented in the instructions)

Original comment by xani...@gmail.com on 23 May 2012 at 10:40