yangwwei
2017-02-15 20:19
异常的一部分------------------------------------------------------------------------------
Loading properties file from class path resource [jdbc.properties]
[DEBUG] 2017-02-15 19:09:53 - Adding [localProperties] PropertySource with lowest search precedence
[DEBUG] 2017-02-15 19:09:53 - Searching for key 'jdbc.driverClass' in [environmentProperties]
[DEBUG] 2017-02-15 19:09:53 - Searching for key 'jdbc.driverClass' in [servletConfigInitParams]
[DEBUG] 2017-02-15 19:09:53 - Searching for key 'jdbc.driverClass' in [servletContextInitParams]
[DEBUG] 2017-02-15 19:09:53 - Searching for key 'jdbc.driverClass' in [jndiProperties]
[DEBUG] 2017-02-15 19:09:53 - Looking up JNDI object with name [java:comp/env/jdbc.driverClass]
[DEBUG] 2017-02-15 19:09:53 - Converted JNDI name [java:comp/env/jdbc.driverClass] not found - trying original name [jdbc.driverClass]. javax.naming.NameNotFoundException: Name [jdbc.driverClass] is not bound in this Context. Unable to find [jdbc.driverClass].
[DEBUG] 2017-02-15 19:09:53 - Looking up JNDI object with name [jdbc.driverClass]
[DEBUG] 2017-02-15 19:09:53 - JNDI lookup for name [jdbc.driverClass] threw NamingException with message: Name [jdbc.driverClass] is not bound in this Context. Unable to find [jdbc.driverClass].. Returning null.
[DEBUG] 2017-02-15 19:09:53 - Searching for key 'jdbc.driverClass' in [systemProperties]
[DEBUG] 2017-02-15 19:09:53 - Searching for key 'jdbc.driverClass' in [systemEnvironment]
[DEBUG] 2017-02-15 19:09:53 - Could not find key 'jdbc.driverClass' in any property source. Returning [null]
[DEBUG] 2017-02-15 19:09:53 - Searching for key 'jdbc.driverClass' in [localProperties]
[DEBUG] 2017-02-15 19:09:53 - Found key 'jdbc.driverClass' in [localProperties] with type [String] and value 'com.mysql.jdbc.Driver'
[DEBUG] 2017-02-15 19:09:53 - Searching for key 'jdbc.url' in [environmentProperties]
[DEBUG] 2017-02-15 19:09:53 - Searching for key 'jdbc.url' in [servletConfigInitParams]
[DEBUG] 2017-02-15 19:09:53 - Searching for key 'jdbc.url' in [servletContextInitParams]
[DEBUG] 2017-02-15 19:09:53 - Searching for key 'jdbc.url' in [jndiProperties]
[DEBUG] 2017-02-15 19:09:53 - Looking up JNDI object with name [java:comp/env/jdbc.url]
[DEBUG] 2017-02-15 19:09:53 - Converted JNDI name [java:comp/env/jdbc.url] not found - trying original name [jdbc.url]. javax.naming.NameNotFoundException: Name [jdbc.url] is not bound in this Context. Unable to find [jdbc.url].
[DEBUG] 2017-02-15 19:09:53 - Looking up JNDI object with name [jdbc.url]
[DEBUG] 2017-02-15 19:09:53 - JNDI lookup for name [jdbc.url] threw NamingException with message: Name [jdbc.url] is not bound in this Context. Unable to find [jdbc.url].. Returning null.
[DEBUG] 2017-02-15 19:09:53 - Searching for key 'jdbc.url' in [systemProperties]
[DEBUG] 2017-02-15 19:09:53 - Searching for key 'jdbc.url' in [systemEnvironment]
[DEBUG] 2017-02-15 19:09:53 - Could not find key 'jdbc.url' in any property source. Returning [null]
[DEBUG] 2017-02-15 19:09:53 - Searching for key 'jdbc.url' in [localProperties]
[DEBUG] 2017-02-15 19:09:53 - Found key 'jdbc.url' in [localProperties] with type [String] and value 'jdbc:mysql://localhost:3306/ssh_employee'
[DEBUG] 2017-02-15 19:09:53 - Searching for key 'jdbc.username' in [environmentProperties]
[DEBUG] 2017-02-15 19:09:53 - Searching for key 'jdbc.username' in [servletConfigInitParams]
[DEBUG] 2017-02-15 19:09:53 - Searching for key 'jdbc.username' in [servletContextInitParams]
[DEBUG] 2017-02-15 19:09:53 - Searching for key 'jdbc.username' in [jndiProperties]
[DEBUG] 2017-02-15 19:09:53 - Looking up JNDI object with name [java:comp/env/jdbc.username]
[DEBUG] 2017-02-15 19:09:53 - Converted JNDI name [java:comp/env/jdbc.username] not found - trying original name [jdbc.username]. javax.naming.NameNotFoundException: Name [jdbc.username] is not bound in this Context. Unable to find [jdbc.username].
[DEBUG] 2017-02-15 19:09:53 - Looking up JNDI object with name [jdbc.username]
[DEBUG] 2017-02-15 19:09:53 - JNDI lookup for name [jdbc.username] threw NamingException with message: Name [jdbc.username] is not bound in this Context. Unable to find [jdbc.username].. Returning null.
[DEBUG] 2017-02-15 19:09:53 - Searching for key 'jdbc.username' in [systemProperties]
[DEBUG] 2017-02-15 19:09:53 - Searching for key 'jdbc.username' in [systemEnvironment]
[DEBUG] 2017-02-15 19:09:53 - Could not find key 'jdbc.username' in any property source. Returning [null]
[DEBUG] 2017-02-15 19:09:53 - Searching for key 'jdbc.username' in [localProperties]
[DEBUG] 2017-02-15 19:09:53 - Found key 'jdbc.username' in [localProperties] with type [String] and value 'root'
[DEBUG] 2017-02-15 19:09:53 - Searching for key 'jdbc.password' in [environmentProperties]
[DEBUG] 2017-02-15 19:09:53 - Searching for key 'jdbc.password' in [servletConfigInitParams]
[DEBUG] 2017-02-15 19:09:53 - Searching for key 'jdbc.password' in [servletContextInitParams]
[DEBUG] 2017-02-15 19:09:53 - Searching for key 'jdbc.password' in [jndiProperties]
[DEBUG] 2017-02-15 19:09:53 - Looking up JNDI object with name [java:comp/env/jdbc.password]
[DEBUG] 2017-02-15 19:09:53 - Converted JNDI name [java:comp/env/jdbc.password] not found - trying original name [jdbc.password]. javax.naming.NameNotFoundException: Name [jdbc.password] is not bound in this Context. Unable to find [jdbc.password].
[DEBUG] 2017-02-15 19:09:53 - Looking up JNDI object with name [jdbc.password]
[DEBUG] 2017-02-15 19:09:53 - JNDI lookup for name [jdbc.password] threw NamingException with message: Name [jdbc.password] is not bound in this Context. Unable to find [jdbc.password].. Returning null.
[DEBUG] 2017-02-15 19:09:53 - Searching for key 'jdbc.password' in [systemProperties]
jdbc.properties----------------------------------------------------------------------------------
jdbc.driverClass=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/ssh_employee
jdbc.username=root
jdbc.password=root
applicationContext.xml部分--------------------------------------------------------------------
<!-- 引入外部属性文件 -->
<context:property-placeholder location="classpath:jdbc.properties"/>
<!-- 配置连接池 -->
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
<property name="driverClass" value="${jdbc.driverClass}"></property>
<property name="jdbcUrl" value="${jdbc.url}"></property>
<property name="user" value="${jdbc.username}"></property>
<property name="password" value="${jdbc.password}"></property>
</bean>
web.xml部分-----------------------------------------------------------------------------
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml</param-value>
</context-param>
<context:property-placeholder location="classpath:jdbc.properties" ignore-unresolvable="true"/>
bean里面配置的属性property的name要与class类里面的属性名字一致
路径没写对
基于SSH实现员工管理系统之案例实现篇
50212 学习 · 323 问题
相似问题