使用tomcat自带连接池抛出异常
failure when connect apache commons dbcp
javax.naming.NameNotFoundException: Name comp is not bound in this Context
at org.apache.naming.NamingContext.lookup(NamingContext.java:770)
at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
at org.apache.naming.SelectorContext.lookup(SelectorContext.java:152)
at javax.naming.InitialContext.lookup(Unknown Source)
使用tomcat提供的连接池爆出这么个错误,可以检查tomcat配置文件(context.xml,server.xml,/conf\Catalina\localhost\xxx.xml),
该属性是否为 false,改为true之后顺利启动。