community.borland.com

Article #25405: How to test HTML Applets / InterClient without using a web browser on NT

Problem:
Getting various errors when trying to use applets 
without a webserver
----
The customer is trying to test his InterClient Applet in an
HTML file without using a webserver.  He is just loading the
HTML file as a file from the Netscape browser.  He emailed
me the following information:

The problem I am having is how do I get Netscape to find the 
required interclient classes to test using a localhost. 

Location of files:

  Project class files:
      c:JBuildermyclassesBayerTrack*.class

  HTML file:
      c:JBuildermyclassesBayerTrackBayerTrack.html

  interclient.jar file:
      c:JBuildermyclassesBayerTrackinterclient.jar

Contents of the Applet Tag of the HTML file:

  <APPLET
    ARCHIVE  = "interclient.jar"
    CODEBASE = "."
    CODE     = "BayerTrack.BayerTrack.class"
    NAME     = "BayerTrack"
    WIDTH    = 700
    HEIGHT   = 420
    HSPACE   = 0
    VSPACE   = 0
    ALIGN    = middle
  >
  </APPLET>

Results from the Netscape Java Console:

  java.lang.ClassNotFoundException: interbase.interclient.Driver

Netscape does not seem to find the contents of the jar file, 
although it does find the jar file.

If I copy the interclient classes (I leave the jar file located 
as indicated above) to the directory:

  c:JBuildermyclassesinterbaseinterclient

I get the following response from the NetScape Java console:

  # Security Exception: checkpropsaccess.key 
  # Security Exception: Couldn't connect to 'localhost' with origin from
'local-classpath-classes'.
  interbase.interclient.BadInstallationException: Your security manager   
  does NOT  allow socket connections to localhost on port 3060.
  See API documentation for class
interbase.interclient.BadInstallationException.



Solution:
The following are the results from my tests:

======================================

Test 1:
-------

Config:
-------

CLASSPATH:	Does not include 'interclient.jar'
Local DIR:	Does contain 'interclient.jar'

Results:
--------

In the Java Console:
--------------------
# Starting applet: GetTitlesApplet, appletID=9974400, contextID=4
# Loading classes from downloaded archive file: #	
file:/D|/temp/interclient.jar
# Applet GetTitlesApplet loaded
# Security Exception: checkpropsaccess.key
# Applet GetTitlesApplet initialized
# Applet GetTitlesApplet running

In the Netscape Browser:
------------------------
InterClient Driver Not Found
Could NOT make connection to database
URL: jdbc:interbase://localhost/d:/temp/solvent.gdb
Error: No suitable driver

========================================
Test 2:
-------

Config:
-------

CLASSPATH:	Does include 'interclient.jar'
Local DIR:	Does contain 'interclient.jar'

Results:
--------

In the Java Console:
--------------------
# startApplet: contextID=4 appletID=9026656 
   newFrameMWContext=8833808
# Starting applet: GetTitlesApplet, appletID=9026656, 
   contextID=4
# Loading classes from downloaded archive file: 
# file:/D|/temp/interclient.jar
# Applet GetTitlesApplet loaded
# Security Exception: checkpropsaccess.key
# Security Exception: Couldn't connect to 'localhost' with 
   origin from 
#'local-classpath-classes'.
# Applet GetTitlesApplet initialized
# Applet GetTitlesApplet running

In the Netscape Browser:
------------------------
Could NOT make connection to database
URL: jdbc:interbase://localhost/d:/temp/solvent.gdb	
Error: Your security manager does NOT allow socket 
connections to localhost on port 3060. See API 
documentation for class  
interbase.interclient.BadInstallationException.

===================================

Test 3:
-------

Config:
-------

CLASSPATH:       Does include 'interclient.jar'
Local DIR:            Does NOT contain 'interclient.jar'

Results:
--------

In the Java Console:
--------------------
# Starting applet: GetTitlesApplet, appletID=9975936, contextID=4
# Unable to load archive file:/D|/temp/interclient.jar:
# java.io.IOException: Netscape is unable to find the file or 
# directory named: /D|/temp/interclient.jar
# Check the name and try again.
# Applet GetTitlesApplet loaded
# Security Exception: checkpropsaccess.key
# Security Exception: Couldn't connect to 'localhost' 
    with origin from 
# 'local-classpath-classes'.
# Applet GetTitlesApplet initialized
# Applet GetTitlesApplet running

In the Netscape Browser:
------------------------
Could NOT make connection to database
URL: jdbc:interbase://localhost/d:/temp/solvent.gdb	
Error:  Your security manager does NOT allow 
socket connections	to localhost on port 3060.
See API documentation for class 
interbase.interclient.BadInstallationException.

===================================== 
Test 3:
-------

Config:
-------

CLASSPATH:    IS REMOVED FROM THE MACHINE
Local DIR:         Does contain 'interclient.jar'

Results:
--------

In the Java Console:
--------------------
Too much stuff.  Basically it works and loads all the correct
Classes.

In the Netscape Browser:
------------------------
No errors and when you click the button it fetches all the 
records.

============================================ 

Last Modified: 01-MAY-02