----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files.  Don't make us guess your problem!!!
----------------------------------------------------------------



Sorry if this is a re-post. Not sure if it worked the 1st time.



Hi -

I'm having a servlet problem. The following is a clip from my
jserv log file:

[23/11/1999 14:03:28:439] (ERROR) ajp11: Servlet Error: java.lang.IllegalAccessE
rror: ords_constants.connectionStrings: ords_constants.connectionStrings

As you see I am getting this IllegalAccessError. It occurs whenever I try to acess
an array that I declare inside a constants class called ords_constants. Here is a
snippet from ords_constants.java:

------------ snippet ---------------
public class ords_constants
{  
   final static int testint = 13;
   final static  String crShareDirectory          = "/usr/local/ords/ords_share/";
   final static  String psrShareDirectory         = "/usr/local/ords/psr_share/";
   final static  String deadLetterDirectory       = "/usr/local/ords/dead_letter_box/";
   final static  String confDirectory             = "/usr/local/ords/conf/";
   final static  String calloutDirectory          = "/usr/local/ords/callout/";
   final static  String outboxDirectory           = "/usr/local/ords/outbox/";
   final static  String updateDirectory           = "/usr/local/ords/update/";
   final static  String outboxLockfileName= "outbox.lock";
   final static  int    maxOutboxLockAttempts = 10;  // how many times the outbox 
processor will attempt to grab the lock
   final static  int    outboxLockedSleepyTime = 5000;  // how many milliseconds to 
sleep before retry if outbox is locked.
   final static  String msgLineDelimiter  = ":";
   final static  String messageTrailer    = ".";
   final static  String msgResponsePrefix = "R";
   final static  int    maxMessageLines = 16;
   final static  int    listenerPort = 13213;
   final static  int    socketTimeout = 13000; // number of milliseconds to wait on a 
socket connection
   final static  int    linkTimeout = 7000;    // number of milliseconds to wait on a 
socket creation  
   final static  boolean debug = true;        // Turn system wide debugging on/off
   
   // Database connection strings
   final static String[] connectionStrings = {"jdbc:oracle:thin:@asteroids:1521:vcdb", 
"jdbc:oracle:thin:@digdug:1521:nidb"};

-------- end of snippet ----------------

The IllegalAccessError occurs when I try to access the connectionStrings array from a 
servlet.
for example, the following line of code causes the error.

String s = ords_constants.connectionStrings[0];

The error only occurs if this line of code is in a servlet. If the code is in a 
utility class
which is instantiated by a servlet, then all is well! From within the servlet I can 
access other
members of the ords_constants class with no problem, it's only the array of strings 
that causes the error.
I've tried changing the name of the array, changing the strings inside the array, but 
no luck.

Any suggestions for how to debug this would be greatly appreciated. My boss is getting 
mad... :)

Regards,
S. Kuhn



----------------------------------
Scott Kuhn
Application Programmer
VirtualColor
847.357.9426 x105




--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/main/mail.html>
Problems?:           [EMAIL PROTECTED]

Reply via email to