关于Struts的一个javaWeb项目,运行的时候报错了,求大师指点啊,急急急!在线等,新手 5
错误信息:HTTPStatus500-typeExceptionreportmessagedescriptionTheserverencounteredaninterna...
错误信息:
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error that prevented
it from fulfilling this request.
exception java.lang.NullPointerException
java.util.concurrent.ConcurrentHashMap.hash(Unknown Source)
java.util.concurrent.ConcurrentHashMap.putIfAbsent(Unknown Source)
java.lang.ClassLoader.getClassLoadingLock(Unknown Source)
java.lang.ClassLoader.loadClass(Unknown Source)
java.lang.ClassLoader.loadClass(Unknown Source)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1639)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1569)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
java.lang.Thread.run(Unknown Source)运行登录界面后,点击登录,就会报错!是代码问题,还是配置文件出了问题啊?
LoginAction 代码
public class LoginAction extends Action {
/**
* 处理客户端请求
*/
@Override
public ActionForward execute(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response)throws Exception
{
//得到客户的的提交数据
LoginForm lf = (LoginForm)form;
//业务调用
if(lf.getUserName().equals("admin") &&lf.getPassWord().equals("admin"))
{
//用户名密码验证成功,跳转到成功页面
return mapping.findForward("success");
}
else
{
//用户名密码错误,跳转到失败页面
return mapping.findForward("failling");
}
}
} 展开
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error that prevented
it from fulfilling this request.
exception java.lang.NullPointerException
java.util.concurrent.ConcurrentHashMap.hash(Unknown Source)
java.util.concurrent.ConcurrentHashMap.putIfAbsent(Unknown Source)
java.lang.ClassLoader.getClassLoadingLock(Unknown Source)
java.lang.ClassLoader.loadClass(Unknown Source)
java.lang.ClassLoader.loadClass(Unknown Source)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1639)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1569)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
java.lang.Thread.run(Unknown Source)运行登录界面后,点击登录,就会报错!是代码问题,还是配置文件出了问题啊?
LoginAction 代码
public class LoginAction extends Action {
/**
* 处理客户端请求
*/
@Override
public ActionForward execute(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response)throws Exception
{
//得到客户的的提交数据
LoginForm lf = (LoginForm)form;
//业务调用
if(lf.getUserName().equals("admin") &&lf.getPassWord().equals("admin"))
{
//用户名密码验证成功,跳转到成功页面
return mapping.findForward("success");
}
else
{
//用户名密码错误,跳转到失败页面
return mapping.findForward("failling");
}
}
} 展开
3个回答
展开全部
是你的代码问题,空指针异常,你看看哪个变量没有实例化,就是没有new出来就直接用了。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
lf应该是null值 未完全实例化
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询