一个简单的jsp跳转servlet时出了问题 java.lang.IllegalAccessException(代码见附件)

[size=x-large]myeclipse的工程,跳转时报这样的错,[/size]
[size=large]严重: Allocate exception for servlet LookUpUsers
java.lang.IllegalAccessException: Class org.apache.catalina.core.DefaultInstanceManager can not access a member of class com.bank.LookUpUsersServlet with modifiers ""[/size]
at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65)
at java.lang.Class.newInstance0(Class.java:349)
at java.lang.Class.newInstance(Class.java:308)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:119)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1062)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:813)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:135)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:498)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:394)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:284)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:322)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1714)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)

[size=large]像平时一样配置的web.xml,查了半天也没找到原因,谁能帮忙指点,谢过,[/size]

3个回答

你看你的类声明
{modify} class LookUpUsersServlet extends HttpServlet

请在前面加上public

一般这个异常的解释是 "没有访问权限 ",当应用程序要调用一个类,但当前的方法即没有对该类的访问权限便会出现这个异常.把问题描述的更清楚些

恩,看异常解释:你没有权限访问使用默认修饰符的类成员,因为这个类成员是同一个包下面的类才能访问的,看看他有没有提供了访问这个类成员的方法。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问