Newbie: Exception: java.lang.ClassNotFoundException: jalview.bin.JalviewLite

Dear all,

I am trying to implement the jalview applet and keep getting this error:

java.lang.ClassNotFoundException: jalview.bin.JalviewLite
  at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
  at java.lang.ClassLoader.loadClass(Unknown Source)
  at java.lang.ClassLoader.loadClass(Unknown Source)
  at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
  at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
  at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown
Source)
  at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection
failed:http://bisc.cse.ucsc.edu/jalview/bin/JalviewLite.class
  at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
  at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
  at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
  at java.security.AccessController.doPrivileged(Native Method)
  ... 7 more
Exception: java.lang.ClassNotFoundException: jalview.bin.JalviewLite

This is the page I am trying it:

http://bisc.cse.ucsc.edu/testjview.html

And this is the source code:

<html>
<head><title>JalView Test</title></head>
<body>

      Click the Javascript buttons below to interact with the Applet
      instance on the page.<br>
      View the source in your browser to see how it has been done.<br>

      <applet code="jalview.bin.JalviewLite" width="140" height="35"
         archive="cgi-bin/jalviewApplet.jar" name="Jalview">
      </applet>
</body>
</html>

I am not very experienced with either Java nor applets.

-rwxrwxr-x jalviewApplet.jar

Any suggestions more than welcome!

Many thanks,
Thomas

Hello Thomas.

Sorry to hear your having problems with getting the applet going:
Thomas Juettemann wrote:

Caused by: java.io.IOException: open HTTP connection
failed:http://bisc.cse.ucsc.edu/jalview/bin/JalviewLite.class

This is generated by the applet launcher trying to retrieve the java classes directory, after failing to retrieve the archive at the given path.

Your applet tag looks fine. I think there may be a problem with the configuration of your web server, meaning the cgi-bin directory is not actually served externally. Remember, the archive parameter has to resolve to a URL that the browser can use to retrieve the jalviewApplet.jar archive, and http://bisc.cse.ucsc.edu/cgi-bin/jalviewApplet.jar does not work.

There is actually no reason to put jalviewApplet.jar in the cgi-bin directory, since it is a client side resource. Try changing the archive parameter to "jalviewApplet.jar", and copy the jalviewApplet.jar file to the same directory on the web server as your testjview.html page.

hope this helps!
Jim

···

--
-------------------------------------------------------------------
J. B. Procter (ENFIN/VAMSAS) Barton Bioinformatics Research Group
Phone/Fax:+44(0)1382 388734/345764 http://www.compbio.dundee.ac.uk
The University of Dundee is a Scottish Registered Charity, No. SC015096.

Hi James,

many thanks for your reply. I have the applet working now, but it is
not displaying the alignment, it concatenates all sequences.
Are there special requirements for the FASTA format?
Testpage:

http://bisc.cse.ucsc.edu/testjview.html

The input file can found here:

http://bisc.cse.ucsc.edu/models/BiscHet/P15303-P20606/P15303-1M2O_A.muscle.out.fasta

Many thanks,
Thomas

···

On Tue, Aug 4, 2009 at 02:36, James Procter<jimp@compbio.dundee.ac.uk> wrote:

Hello Thomas.

Sorry to hear your having problems with getting the applet going:
Thomas Juettemann wrote:

Caused by: java.io.IOException: open HTTP connection
failed:http://bisc.cse.ucsc.edu/jalview/bin/JalviewLite.class

This is generated by the applet launcher trying to retrieve the java classes
directory, after failing to retrieve the archive at the given path.

Your applet tag looks fine. I think there may be a problem with the
configuration of your web server, meaning the cgi-bin directory is not
actually served externally. Remember, the archive parameter has to resolve
to a URL that the browser can use to retrieve the jalviewApplet.jar archive,
and http://bisc.cse.ucsc.edu/cgi-bin/jalviewApplet.jar does not work.

There is actually no reason to put jalviewApplet.jar in the cgi-bin
directory, since it is a client side resource. Try changing the archive
parameter to "jalviewApplet.jar", and copy the jalviewApplet.jar file to the
same directory on the web server as your testjview.html page.

hope this helps!
Jim

--
-------------------------------------------------------------------
J. B. Procter (ENFIN/VAMSAS) Barton Bioinformatics Research Group
Phone/Fax:+44(0)1382 388734/345764 http://www.compbio.dundee.ac.uk
The University of Dundee is a Scottish Registered Charity, No. SC015096.

G'day, Thomas.

Thomas Juettemann wrote:

many thanks for your reply. I have the applet working now, but it is

well done!

not displaying the alignment, it concatenates all sequences.

:frowning:

The input file can found here:

http://bisc.cse.ucsc.edu/models/BiscHet/P15303-P20606/P15303-1M2O_A.muscle.out.fasta

I think the problem is that Jalview is confusing the >P1; lines as the beginning of a PIR file, rather than a FASTA file - and trying to parse it with the PIR parser - since this expects a '*' terminator, the whole alignment is appended to the first sequence.

The quick fix would be to remove 'P1;' from the file. There's no way to force jalview to use a certain parser (although there is one very strident supporter of this), but I'll add this as a bug and it will probably be fixed for the next release.

Jim.

···

--
-------------------------------------------------------------------
J. B. Procter (ENFIN/VAMSAS) Barton Bioinformatics Research Group
Phone/Fax:+44(0)1382 388734/345764 http://www.compbio.dundee.ac.uk
The University of Dundee is a Scottish Registered Charity, No. SC015096.

Hello James,

thanks again for your advice. Your hint together with Sean Moore's
that a semicolon (= programming character) in the comment line is not
a good idea took care of that problem. The alignment file is later
used for MODELLER, it was easier to already include the P1; at that
stage.
I hope you will be able to help me with one last question: I tried to
embed Jalview in the webpage, using

<param name="embedded" value="true">

I get the message that it successfully loaded the file, but can't see
the alignment.

Thanks to everyone for their patience and help.

Cheers,
Thomas

···

On Wed, Aug 12, 2009 at 01:25, James Procter<jimp@compbio.dundee.ac.uk> wrote:

G'day, Thomas.

Thomas Juettemann wrote:

many thanks for your reply. I have the applet working now, but it is

well done!

not displaying the alignment, it concatenates all sequences.

:frowning:

The input file can found here:

http://bisc.cse.ucsc.edu/models/BiscHet/P15303-P20606/P15303-1M2O_A.muscle.out.fasta

I think the problem is that Jalview is confusing the >P1; lines as the
beginning of a PIR file, rather than a FASTA file - and trying to parse it
with the PIR parser - since this expects a '*' terminator, the whole
alignment is appended to the first sequence.

The quick fix would be to remove 'P1;' from the file. There's no way to
force jalview to use a certain parser (although there is one very strident
supporter of this), but I'll add this as a bug and it will probably be fixed
for the next release.

Jim.

--
-------------------------------------------------------------------
J. B. Procter (ENFIN/VAMSAS) Barton Bioinformatics Research Group
Phone/Fax:+44(0)1382 388734/345764 http://www.compbio.dundee.ac.uk
The University of Dundee is a Scottish Registered Charity, No. SC015096.

Hi Thomas.

Thomas Juettemann wrote:

thanks again for your advice. Your hint together with Sean Moore's
that a semicolon (= programming character) in the comment line is not
a good idea took care of that problem.

great!

The alignment file is later
used for MODELLER, it was easier to already include the P1; at that
stage.

I thought that might be the case. You could always pass the modeller PIR directly to Jalview - it will read it.

I hope you will be able to help me with one last question: I tried to
embed Jalview in the webpage, using

<param name="embedded" value="true">

I get the message that it successfully loaded the file, but can't see
the alignment.

Set the applet width and height attrubutes to something sensible (500 and 400 perhaps) and you should have a bit more luck!

Here's an example:
http://www.compbio.dundee.ac.uk/user/ws-dev1/jalview/release/applet/embedded.html

Have fun!
Jim.

···

--
-------------------------------------------------------------------
J. B. Procter (ENFIN/VAMSAS) Barton Bioinformatics Research Group
Phone/Fax:+44(0)1382 388734/345764 http://www.compbio.dundee.ac.uk
The University of Dundee is a Scottish Registered Charity, No. SC015096.

Hi James,

one of these painful errors. I thought that it had something to do
with the size, but I was playing with the param windowWidth &
windowHeight.

One lives and learns... :wink:

Thanks again for all your support!

Cheers,
Thomas

···

On Wed, Aug 12, 2009 at 09:54, James Procter<jimp@compbio.dundee.ac.uk> wrote:

Hi Thomas.

Thomas Juettemann wrote:

thanks again for your advice. Your hint together with Sean Moore's
that a semicolon (= programming character) in the comment line is not
a good idea took care of that problem.

great!

The alignment file is later
used for MODELLER, it was easier to already include the P1; at that
stage.

I thought that might be the case. You could always pass the modeller PIR
directly to Jalview - it will read it.

I hope you will be able to help me with one last question: I tried to
embed Jalview in the webpage, using

<param name="embedded" value="true">

I get the message that it successfully loaded the file, but can't see
the alignment.

Set the applet width and height attrubutes to something sensible (500 and
400 perhaps) and you should have a bit more luck!

Here's an example:
http://www.compbio.dundee.ac.uk/user/ws-dev1/jalview/release/applet/embedded.html

Have fun!
Jim.

--
-------------------------------------------------------------------
J. B. Procter (ENFIN/VAMSAS) Barton Bioinformatics Research Group
Phone/Fax:+44(0)1382 388734/345764 http://www.compbio.dundee.ac.uk
The University of Dundee is a Scottish Registered Charity, No. SC015096.