首页上一页 1 下一页尾页 3 条记录 1/1页
jsp项目开发全程实录(欣想电子商城)
发表在JavaWeb图书答疑
2010-03-18
是否精华
是
否
版块置顶:
是
否
// 获取单个商品信息
public TbGoods getGoods(Long id) {
return (TbGoods) getHibernateTemplate().get(TbGoods.class, id);
}
我导入这个项目就有很多错咯,然后导了些包进去就剩下这个错误
不能编译 500错误
这个是类DAO的错误
getHibernateTemplate().get(TbGoods.class, id); 这个显示错误
编译错误的显示:
javax.servlet.ServletException: Servlet.init() for servlet dispatcher threw exception
org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:670)
org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:637)
org.apache.jsp.index_jsp._jspService(index_jsp.java:45)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/config/dao-config.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'driverClassName' threw exception; nested exception is org.springframework.jdbc.CannotGetJdbcConnectionException: Could not load JDBC driver class [com.microsoft.jdbc.sqlserver.SQLServerDriver]; nested exception is java.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1130)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:862)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:423)
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:291)
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:332)
org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:266)
org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:236)
org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
javax.servlet.GenericServlet.init(GenericServlet.java:211)
org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:670)
org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:637)
org.apache.jsp.index_jsp._jspService(index_jsp.java:45)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'driverClassName' threw exception; nested exception is org.springframework.jdbc.CannotGetJdbcConnectionException: Could not load JDBC driver class [com.microsoft.jdbc.sqlserver.SQLServerDriver]; nested exception is java.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver
org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:104)
org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:59)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1127)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:862)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:423)
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:291)
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:332)
org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:266)
org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:236)
org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
javax.servlet.GenericServlet.init(GenericServlet.java:211)
org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:670)
org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:637)
org.apache.jsp.index_jsp._jspService(index_jsp.java:45)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
public TbGoods getGoods(Long id) {
return (TbGoods) getHibernateTemplate().get(TbGoods.class, id);
}
我导入这个项目就有很多错咯,然后导了些包进去就剩下这个错误
不能编译 500错误
这个是类DAO的错误
getHibernateTemplate().get(TbGoods.class, id); 这个显示错误
编译错误的显示:
javax.servlet.ServletException: Servlet.init() for servlet dispatcher threw exception
org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:670)
org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:637)
org.apache.jsp.index_jsp._jspService(index_jsp.java:45)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/config/dao-config.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'driverClassName' threw exception; nested exception is org.springframework.jdbc.CannotGetJdbcConnectionException: Could not load JDBC driver class [com.microsoft.jdbc.sqlserver.SQLServerDriver]; nested exception is java.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1130)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:862)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:423)
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:291)
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:332)
org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:266)
org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:236)
org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
javax.servlet.GenericServlet.init(GenericServlet.java:211)
org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:670)
org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:637)
org.apache.jsp.index_jsp._jspService(index_jsp.java:45)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'driverClassName' threw exception; nested exception is org.springframework.jdbc.CannotGetJdbcConnectionException: Could not load JDBC driver class [com.microsoft.jdbc.sqlserver.SQLServerDriver]; nested exception is java.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver
org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:104)
org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:59)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1127)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:862)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:423)
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:291)
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:332)
org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:266)
org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:236)
org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
javax.servlet.GenericServlet.init(GenericServlet.java:211)
org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:670)
org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:637)
org.apache.jsp.index_jsp._jspService(index_jsp.java:45)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)