name jndi is not bound in this context
项目是常用的,换了个电脑就报错了,求解答……com.web.db.SqlData-DataSourceisnull,getitagaincom.web.db.SqlDat...
项目是常用的,换了个电脑就报错了,求解答……
com.web.db.SqlData - DataSource is null, get it again com.web.db.SqlData - SqlData.getConn NamingException:Name cmsJNDI is not bound in this Contextjava.lang.NullPointerException at com.web.db.SqlData.executeQuery(SqlData.java:481) at com.web.framework.security.ipfilter.impl.IpFilterImpl.getIpFilterInfoList(IpFilterImpl.java:175) at com.web.framework.security.ipfilter.impl.IpFilterImpl.filterIp(IpFilterImpl.java:211) at org.apache.jsp.wcm.login_jsp._jspService(login_jsp.java:85) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.web.commons.SessionFilter.doFilter(SessionFilter.java:245) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.web.tools.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:66) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 展开
com.web.db.SqlData - DataSource is null, get it again com.web.db.SqlData - SqlData.getConn NamingException:Name cmsJNDI is not bound in this Contextjava.lang.NullPointerException at com.web.db.SqlData.executeQuery(SqlData.java:481) at com.web.framework.security.ipfilter.impl.IpFilterImpl.getIpFilterInfoList(IpFilterImpl.java:175) at com.web.framework.security.ipfilter.impl.IpFilterImpl.filterIp(IpFilterImpl.java:211) at org.apache.jsp.wcm.login_jsp._jspService(login_jsp.java:85) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.web.commons.SessionFilter.doFilter(SessionFilter.java:245) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.web.tools.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:66) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 展开
2个回答
展开全部
你在tomcat文件中的server.xml或者context.xml有没有配置Resource 标签中的name字段?
<Resource name="" auth="Container" type="javax.sql.DataSource"
maxActive="1000" maxIdle="30" maxWait="1000" username=""
password="" driverClassName=""
url="" removeAbandoned="true"
removeAbandonedTimeout="60" logAbandoned="true" />
在spring的配置中作如下引用:
<jee:jndi-lookup id="dataSource" jndi-name=""
proxy-interface="javax.sql.DataSource" lookup-on-startup="false" />
<bean id="dalClient" class="">
<!-- 定义默义的数据源 -->
<property name="defaultDataSource" ref="dataSource" />
</bean>
更多追问追答
追问
没有用Spring
tomcat是原来机器上的tomcat,在原来的机器上还能用,但是,换了台机器,就不行了
追答
tomcat和机器有什么关系.......你的错在于数据源配置有误,web容器找不到该资源的JNDI的命名(Resource 中的name属性)
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询