hsqlServer = new Server(); hangs plugin loading code

18 views
Skip to first unread message

Greg

unread,
May 3, 2012, 12:29:21 AM5/3/12
to cytoscape-discuss
I have a plugin that I am trying to embed an HSQLDB database server
within. I'm encountering the most bizzarre thing I've ever seen. I
call a function that I've named testSQL(). Within that function I try
to create the server object as in the subject line above. When the
line in the subject executes the code stops running. Oddly enough if
I put this "hsqlServer = new Server()" code within a try/finally block
the finally clause executes but nothing further seems to happen. The
plugin blocks right there. I've used catch blocks to catch any
exception and there are none. I've never seen this behavior before in
Java. If a constructor fails you get an exception is my
understanding. The code works perfectly fine when run as a standalone
program, just not when called from a Cytoscape plugin. Anybody know
what is going on here?

Alexander Pico

unread,
May 3, 2012, 4:29:11 PM5/3/12
to cytoscap...@googlegroups.com
Hi Greg,

This is a mystery, indeed. It doesn't make any sense. I asked a couple other plugin developers who have worked extensively with connecting to databases and they are stumped as well.

Perhaps, try a new approach: Find an open source plugin that does something similar and look at the code.

- Alex
> --
> 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.
> To unsubscribe from this group, send email to cytoscape-disc...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/cytoscape-discuss?hl=en.
>

Greg

unread,
May 8, 2012, 12:08:40 AM5/8/12
to cytoscape-discuss
One thing I thought of is this. Does cytoscape somehow "eat"
exceptions thrown by plugins. I just assumed they would print out to
the command line where I start cytoscape. If it is eating exceptions,
where do I look for the log or whatever that shows what happened.

Greg

unread,
May 8, 2012, 2:24:34 AM5/8/12
to cytoscape-discuss
Problem Solved!!!! I looked at the jar file with the unzip utility and
noticed that the hsqldb stuff was nowhere to be found.  I added the
hsqldb class tree and it works.  It still bothers me though.  You
would think this would be a perfect place for a "Class Not Found"
exception.  I mean it wasn't finding the damn class.  Does java just
leap off into space then?  Oh well, that was the trick.  Put all your
third party stuff in the jar.  I was using Ant to automate the build
and didn't realize it wasn't including the needed classes in the jar
though they were in the classpath so that the code compiled just fine.

On May 3, 1:29 pm, Alexander Pico <ap...@gladstone.ucsf.edu> wrote:

Alexander Pico

unread,
May 8, 2012, 12:28:04 PM5/8/12
to cytoscap...@googlegroups.com
Thanks for posting the solution! Right, third party jars need to be unjared and the classes included in your pluggin jar.

In my experience this usually does lead to a Class Not Found error. This case was strange in the lack of error trail.

- Alex
Reply all
Reply to author
Forward
0 new messages