-----------------------------
Please read the FAQ!
<http://java.apache.org/faq/>
-----------------------------
Thanks to those who helped me with this. It is working now.
It turned out, I originally did not have the constructor declared
as public even though the CLASS was. This problem was correctly
pointed out to me by Matthew Ueckerman, but at the time I didn't
realize it had worked because after I tried it, I failed to restart apache.
I did not think I needed to restart apache because I had touched the timestamp
of the servlet which was loading the utility class. I assumed that this would
cause the servlet to be reloaded and therefore cause the utility class to be reloaded.
Apparantly this is not the case. After restarting Apache and getting the class
reloaded,
it works fine.
I guess jserv loads non-servlet classes and keeps them loaded even if the servlet that
loaded
them is reloaded, which is probably good for efficiency.
Scott
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Dipankar
> Chakrabarti
> Sent: Thursday, September 02, 1999 7:10 AM
> To: Java Apache Users
> Subject: Re:RE: Class throws Illegal
>
>
> -----------------------------
> Please read the FAQ!
> <http://java.apache.org/faq/>
> -----------------------------
>
> Dear Scott,
>
> I have tried with these following codes, which are in
> line to your problem.
>
> It is working fine here.
>
> Please provide the code for Servlet you are running.
>
> The Servlet Code:
>
>
> import java.io.*;
> import javax.servlet.*;
> import javax.servlet.http.*;
> public class MyCheckSrvlt extends HttpServlet
> {
>
> MyCheck mchk = new MyCheck("sttt");
> String hello = mchk.RetCheck();
> public void doGet(HttpServletRequest req,
> HttpServletResponse res)
> throws ServletException, IOException
> {
> res.setContentType("text/html");
> PrintWriter out = res.getWriter();
> out.println("<HTML><HEAD><TITLE>Hello
> Client!</TITLE>"+"</HEAD><BODY>") ;
> out.println("Servlet calls jni");
> out.println("<br>Servlet Return!!"+hello+"<br>");
> out.println("<br>"+"hello"+"<br>");
> out.println("</BODY></HTML>");
> out.close();
> }
> }
>
> MyCheck Class:
> public class MyCheck
> {
> int numletters = 0;
>
> public MyCheck(String s)
> {
> numletters = s.length();
> }
> public String RetCheck()
> {
> String s1 = new String("HASA");
> return s1;
> }
> }
>
> Hope your classpath and repositories are deifned
> properly and the Servlet is in the repository path and
> the accessing class is in the classpath.
>
> Regards,
>
> Dipankar
>
> > > -----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!
> > >
> > > -----------------------------
> > >
> > >
> > >
> > > 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]
> > >
>
> --- Java Apache Users
> <[EMAIL PROTECTED]> wrote:
> > -----------------------------
> > Please read the FAQ!
> > <http://java.apache.org/faq/>
> > -----------------------------
> >
>
> ===
>
> DIPANKAR CHAKRABARTI
> Have a Nice Time............
> __________________________________________________
> Do You Yahoo!?
> Bid and sell for free at http://auctions.yahoo.com
>
>
> --
> --------------------------------------------------------------
> 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]