Try making the constructor public. By adding a constructor with the default access level, the service class can only be instantiated by a class within the same package.
Dave
-----Original Message-----
From: Hui Deng [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 12:15 PM
To: [EMAIL PROTECTED]
Subject: web service fails to run when has constructor
Hi All,
Haven't find info regards to it, so I post it here.
Just want to be sure that the the java class be
deployed as Web Service should not have default
constructor explicitly. For example, when I deployed
the following service and run, I got error said:
java.lang.IllegalAccessException:
C:Apache Tomcat 4.0webappsaxisWEB-INFclasses>java
samples.userguide.example
3.Client "test me!"
http://localhost:8080/axis/servlet/AxisServlet
java.lang.IllegalAccessException:
samples.userguide.example3.MyService
public class MyService {
static int staticnum = 0;
private boolean state = false;
static int created = 0;
MyService(){
//created++;
}
public String serviceMethod(String arg)
{
....
}
...
}
When I removed the constructor, everything works fine.
Did I miss something?! If it's true, it hard to deploy
any pre-existing classes becasue most of them have
constructors.
Thanks in advanced,
-Hui
__________________________________________________
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards(r)
http://movies.yahoo.com/