• Post Reply Bookmark Topic Watch Topic
  • New Topic

jacl Incompatible magic value  RSS feed

 
Raul Elizondo
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Anyone experienced this message when adding tcl.lang.* to an applet? The complete message is:

Incompatible magic value 1008813135 in class file tcl/lang/TclException


and i just added into my main method to test so i can use tcl commands in my applets. Both files, tcljava.jar and jacl.jar are in my classpath when compiling. I used both, the sample code from sourceforge
If i do a little class to run it via shell, then i get this message:


The complete error for my applet is:


Any hint or web reference?

Regards,

-=Raul=-
PD. I downloaded the source of jacl and compiled, and donwloaded the binary files, and both show the same errors. Am i missing something?
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm a bit confused. You mention an applet and a main method - but applets don't use the main method. There also seem to be two distinct errors happening (the second of which looks like an ordinary classpath problem).

I think magic value problems typically arise either with corrupt class files (which is unlikely here, if you recompiled everything and the same thing happens), or if the JVM implments on aolder version of Java than the code got compiled with. Which version is the applet JVM? Try compiling with the "-target" switch to make sure the class files match the that version.
 
Raul Elizondo
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ulf,

I am sorry for the confusion, i m still getting familiar with terminology in Java.

Anyway...

There are 2 intances on which i m testing jacl. The first one on a linux console runing it using "java" command (just for testing). And the second one is an applet, on both i m getting errors.

I just tried compiling the file that runs from shell with all different versions in -target as you mentioned, but all of them throws the same error:

Exception in thread "main" java.lang.NoClassDefFoundError: tcl/lang/TclException

regards,

-=Raul=-
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
NoClassDefFoundError has nothing to do with different class versions; it means that some required class is missing. Make sure that it is included in the classpath.
 
Raul Elizondo
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The matter here was adding the current directory in the classpath, via -classpath flag on in the CLASSPATH env variable, for compiling and running in the shell. So an app can run with out problem.

Using an applet, there should be added two arguments in the html applet tag (codebase and archive)
codebase="."
archive="tcljava.jar,jacl.jar"
 
Raul Elizondo
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but now there is a new problem. Using old version of tcljava.jar and jacl.jar, i can make run a simple script using lindex, but they dont have all tcl commands. So when i use the recent versions of those .jars, i get this error:

mytest: init java.lang.NullPointerException
java.lang.NullPointerException
at tcl.lang.CharPointer.<init>{CharPointer.java:88}
at tcl.lang.Interp.eval{Interp.java:2220}
at tcl.lang.Interp.evalResource{Interp.java:2777}
at tcl.lang.Interp.<init>{Interp.java:429}
at mytest.init{mytest.java:10}
at sun.applet.AppletPanel.run{Unknown Source}
at java.lang.Thread.run{Unknown Source}
 
Raul Elizondo
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
and here is the small script:

script of 19 lines

Am i missing something?

regards..

-=Raul=-
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!