OICGI and Applets: Bad magic number (None Specified)
At 30 MAR 1999 10:53:42AM Anthony Judge wrote:
I am successfully generating html pages, in response to user requests, and passing them back through oicgi. I am moving on to pages with applet calls that supposedly the server (NT4.x with O'Reilly) should honour if I place the classes correctly.
The applet worked well on a desktop test with a browser with the classes and html page in the same directory. I then tried putting the various graph classes that seemed to be called into the cgi-shl location on the NT where the oicgi is located.
I then get a "Bad magic number" error on the browser although viewing the source of the html document it seemed to be the same as the one that had worked locally.
Info on this error from the web:
"This alert can occur, at time of writing, in Netscape browsers when
you've uploaded Java classes as text data rather than as binary raw data. If you upload as binary then the alert should not appear. "
"The first few bytes of class file are supposed to say CAFEBABE in hex. They don't. Most likely the problem is you uploaded your class file to your Web server using FTP ASCII mode instead of BINARY mode which mangled the class file." I had copied the class statements using Explorer which would not have mangled it – I assume.
Whether the cgi process of Revelation would have done so, I am unclear. Is the problem due to using "return html", rather than some other variant (as with vrml pages)? Although clearly the page is html in this case.
Thanks for any insights
At 30 MAR 1999 02:34PM Cameron Purdy wrote:
Anthony,
The Java .class files are not returned using OICGI. They are handled by the web server itself. What you need to do (to start) is create a static HTML page (in the public html directory of your web server) that contains the applet reference, and get that page working (displaying the applet in a browser on another machine).
You probably have to put the classes in the public html directory as well, or whatever directory is the "root http directory". For example, if you have a page called index.html that is referenced using the URL "http://www.mysite.com/index.html", then put the Java classes in the same place as index.html.
Cameron Purdy
Revelation Software
At 31 MAR 1999 10:46AM Anthony Judge wrote:
Thanks Cameron, and apologies for an earlier posting on this topic on the jRev list to which you had already responded.
Following your suggestions, the html page with an applet worked fine as a static page on the server in whatever directory the classes were also located – called by a distant browser. But the generated dynamic version continued to crash, since it could not find the class files. The clue came from the INET log indicating that the applet was being called as though it was passing through oicgi.
The solution was to use the codebase option in the generated page where the applet was called. This was used to point above ("../../") the position of both oicgi and cgi-shl, and therefore was able to locate the applet classes in the relvant directory.
It now works fine.
Thanks