-----------------------------
Please read the FAQ!
<http://java.apache.org/faq/>
-----------------------------
Try this :
public class ordsUserProfile
{
int numletters = 0;
public ordsUserProfile(String s) //Remember to declare constructor as
public!
{
numletters = s.length();
}
}
Cheers
Matthew
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Scott Kuhn
> Sent: Thursday, September 02, 1999 12:09 PM
> To: Java Apache Users
> Subject: RE: Class throws Illegal
>
>
> -----------------------------
> Please read the FAQ!
> <http://java.apache.org/faq/>
> -----------------------------
>
>
>
> Thank you Matthew for responding.
>
>
> My utility class is in fact declared as public. I have made this utility
> class as simple as possible to try to isolate the problem.
> Currently the class looks like this (it's a useless class but illustrates
> the problem.)
>
>
> public class ordsUserProfile
> {
> int numletters = 0;
>
> ordsUserProfile(String s)
> {
> numletters = s.length();
> }
> }
>
> The servlet simply constructs the class:
>
> ordsUserProfile oup = new ordsUserProfile("test_string");
>
> And that's all it takes to get the illegalaccess exception.
>
> Perhaps I need to somehow tell the jserv class loader that this
> is a legal class to load? Is there some config that I don't know
> about? I read the FAQ and didn't see it and also I scoured my
> config files and .properties files too.
>
> Thanks,
> Scott
> [EMAIL PROTECTED]
>
>
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED]]On Behalf Of Matthew
> > Ueckerman
> > Sent: Wednesday, September 01, 1999 8:53 PM
> > To: Java Apache Users
> > Subject: RE: Class throws Illegal
> >
> >
> > -----------------------------
> > Please read the FAQ!
> > <http://java.apache.org/faq/>
> > -----------------------------
> >
> > Dear Scott,
> >
> > I had this problem a while ago as well....
> >
> > Make sure all classes you define and use are declared public, i.e.:
> >
> > public class MyClass
> > {
> > ....
> > }
> >
> > Cheers
> >
> > Matthew
> >
> > > -----Original Message-----
> > > From: [EMAIL PROTECTED]
> > > [mailto:[EMAIL PROTECTED]]On Behalf Of
> Scott Kuhn
> > > Sent: Thursday, September 02, 1999 11:39 AM
> > > To: [EMAIL PROTECTED]
> > > Subject: Class throws Illegal
> > >
> > >
> > > -----------------------------
> > > Please read the FAQ!
> > > <http://java.apache.org/faq/>
> > > -----------------------------
> > >
> > > Hello,
> > >
> > > I am having a problem loading a class from a servlet.
> > > I have had jserv up and running for several
> > > weeks with no problems. However I have created a utility
> > > class for use in several servlets, but when a servlet tries
> > > to instantiate my utility class, an error occurs as shown
> > > from the following excerpt from the jserv log files. Note
> > > my utiliy class is called 'ordsUserProfile' and the constructor
> > > takes a String as its only parameter.
> > >
> > > ----
> > > [01/09/1999 19:54:28:497] (ERROR) ajp11: Servlet Error:
> > > java.lang.IllegalAccessError: ordsUserProfile.<init>
> > > (Ljava/lang/String;)V:
> > > [01/09/1999 19:54:28:498] (ERROR) an error returned handling
> > > request via protocol "ajpv11"
> > >
> > >
> > > [01/09/1999 20:24:19:095 CDT] Servlet-Error:
> java.lang.IllegalAccessError:
> > > ordsUserProfile.<init>(Ljava/lang/String;)V:ordsUserProfile.<init>
> > > (Ljava/lang/String;)V
> > > [01/09/1999 20:24:19:096 CDT] Content-Type: text/html
> > > [01/09/1999 20:24:19:097 CDT]
> > >
> java.lang.IllegalAccessError:ordsUserProfile.<init>(Ljava/lang/String;)V
> > > at java.lang.Throwable.fillInStackTrace(Native Method)
> > > at
> > >
> org.apache.jserv.JServConnection.processRequest(JServConnection.java:341)
> > > at
> org.apache.jserv.JServConnection.run(JServConnection.java:197)
> > > at java.lang.Thread.run(Thread.java:485)
> > >
> > > ----
> > >
> > > My servlets in general construct and load lots of JDK classes,
> > > but this is the first time
> > > I've tried to load a self-created class. I have added the new
> > > class to the classpath so the
> > > JVM is finding it okay, but as soon as the servlet tries to
> > > construct (instantiate) the class
> > > it throws the exception. The JDK documentation of the
> > > IllegalAccessError exception did not help me.
> > >
> > > I am using Apache Jserv v1.0b5 with Apache version 1.3.6 on
> Solaris 2.7.
> > >
> > > Any suggestions for how to debug this would be greatly appreciated!
> > >
> > > Regards,
> > > Scott
> > >
> > >
> > > ---
> > > Scott Kuhn
> > > Application Programmer
> > >
> > >
> > >
> > > --
> > > --------------------------------------------------------------
> > > 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]
> > >
> >
> >
> >
> > --
> > --------------------------------------------------------------
> > 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]
> >
> >
>
>
> --
> --------------------------------------------------------------
> 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]
>
--
--------------------------------------------------------------
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]