-----------------------------
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]