《JSP项目开发全程实录》第一章 都市供求信息网 配置问题
发表在JavaWeb图书答疑 2014-01-15
是否精华
版块置顶:
我电脑上的是JDK1.7,SQL2005,Tomcat6,配置后localhost:8080能正常打开,但按录像把第一章源代码放好Tomcat 6.0\webapps\01,就不能正常打开页面,出面HTTP Status 500的问题,另外,录像中SQL需要的Jar包是有一个mssqlserver.jar,但明日网上下载的Jar包中的是sqljdbc.jar,原光盘代码中有的是sqljdbc4.jar,到底是何问题,求解答,谢谢!

以下是错误提示代码:
HTTP Status 500 -
type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Filter execution threw an exception
root cause

java.lang.NoClassDefFoundError: Could not initialize class com.yxq.action.IndexAction
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
java.lang.reflect.Constructor.newInstance(Unknown Source)
java.lang.Class.newInstance(Unknown Source)
com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:123)
com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:154)
com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:143)
com.opensymphony.xwork2.ObjectFactory.buildAction(ObjectFactory.java:113)
com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:275)
com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:365)
com.opensymphony.xwork2.DefaultActionInvocation.access$000(DefaultActionInvocation.java:38)
com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:83)
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
com.opensymphony.xwork2.DefaultActionInvocation.<init>(DefaultActionInvocation.java:74)
com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:189)
org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:41)
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:494)
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.29 logs.
分享到:
精彩评论 4
无语_mrkj
学分:3155 LV11
2014-01-20
沙发
请问您购买的JSP项目开发全程实例是第几版?封面是什么颜色的?出现这个异常信息有两种可能,一种是Jar包没有放置正确,另一种可能是数据库连接失败。
您使用的是Struts 2.0的Jar包吗?
视频中介绍的Jar包是连接SQL Server 2000数据库的,如果您使用的是SQL Server 2005数据库,那么应该是sqljdbc4.jar。
fszengj
学分:0 LV1
TA的每日心情
奋斗
2020-06-12 09:36:32
2014-01-20
板凳
书是第3版的,白色封面。光盘带的是sqljdbc4.jar,都是放在\WebRoot\WEB-INF\lib文件夹内。并且重新编译过也是不行。
都是以下的错误提示。
HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Filter execution threw an exception
root cause

java.lang.ExceptionInInitializerError
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
java.lang.reflect.Constructor.newInstance(Unknown Source)
java.lang.Class.newInstance(Unknown Source)
com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:123)
com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:154)
com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:143)
com.opensymphony.xwork2.ObjectFactory.buildAction(ObjectFactory.java:113)
com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:275)
com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:365)
com.opensymphony.xwork2.DefaultActionInvocation.access$000(DefaultActionInvocation.java:38)
com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:83)
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
com.opensymphony.xwork2.DefaultActionInvocation.<init>(DefaultActionInvocation.java:74)
com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:189)
org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:41)
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:494)
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)
root cause

java.lang.NullPointerException
com.yxq.dao.DB.getRs(DB.java:61)
com.yxq.dao.OpDB.OpGetListBox(OpDB.java:23)
com.yxq.action.IndexAction.<clinit>(IndexAction.java:47)
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
java.lang.reflect.Constructor.newInstance(Unknown Source)
java.lang.Class.newInstance(Unknown Source)
com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:123)
com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:154)
com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:143)
com.opensymphony.xwork2.ObjectFactory.buildAction(ObjectFactory.java:113)
com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:275)
com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:365)
com.opensymphony.xwork2.DefaultActionInvocation.access$000(DefaultActionInvocation.java:38)
com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:83)
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
com.opensymphony.xwork2.DefaultActionInvocation.<init>(DefaultActionInvocation.java:74)
com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:189)
org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:41)
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:494)
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.29 logs.
fszengj
学分:0 LV1
TA的每日心情
奋斗
2020-06-12 09:36:32
2014-01-20
地板
lib文件夹里就以下几个jar包:
commons-logging-1.0.4.jar
freemarker-2.3.8.jar
ognl-2.6.11.jar
sqljdbc4.jar
struts2-core-2.0.11.jar
xwork-2.0.4.jar
无语_mrkj
学分:3155 LV11
2014-01-21
4L
应该是数据库没有连接成功。请问您的SQL Server 2005数据库的登录用户是否为sa 密码为空,也就是没有密码。
另外,SQL Server的服务名是否为localhost?SQL Server配置管理器中的TCP/IP协议是否启用,并且设置的端口号是否全是1433?
首页上一页 1 下一页尾页 4 条记录 1/1页
手机同步功能介绍
友情提示:以下图书配套资源能够实现手机同步功能
明日微信公众号
明日之星 明日之星编程特训营
客服热线(每日9:00-17:00)
400 675 1066
mingrisoft@mingrisoft.com
吉林省明日科技有限公司Copyright ©2007-2022,mingrisoft.com, All Rights Reserved长春市北湖科技开发区盛北大街3333号长春北湖科技园项目一期A10号楼四、五层
吉ICP备10002740号-2吉公网安备22010202000132经营性网站备案信息 营业执照