非常感谢大家,现在我将配置文件修改了一下并且将tomcat重新配置之后感觉好了一些 但是程序还是不能运行,出现了一个警告:警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:TestWeb' did not find a matching property.还有两个错误: 1、Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/config/ApplicationContext.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Name jdbc is not bound in this Context Caused by: javax.naming.NameNotFoundException: Name jdbc is not bound in this Context2、Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/config/ApplicationContext.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Name jdbc is not bound in this Context Caused by: javax.naming.NameNotFoundException: Name jdbc is not bound in this Context我现在也正在查这些问题的原因,希望大家能够帮助,在下不胜感激!
你要是用JNDI数据源,对应的JndiName是java:comp/env/数据源名字
我的项目现在还是没能搭建成功,出现了两个警告: 1、No rules found matching 'Server/Context' 2、Setting property 'source' to 'org.eclipse.jst.jee.server:TestWeb' did not find a matching property 以上两个警告导致我的项目没有成功运行,我的项目名称是TestWebtomcat的配置文件如下context.xml: <Resource auth="Container" driverClassName="oracle.jdbc.driver.OracleDriver" maxActive="100" maxIdle="30" maxWait="10000" name="jdbc/app" password="root" type="javax.sql.DataSource" url="jdbc:oracle:thin:@172.19.1.183:1521:TEST" username="LOTTE"/>我的数据库已经测试成功,用户名、密码和URL都很正确server.xml: 不知道该如何配置,这个文件还需不需要配置呢项目文件--》ApplicationContext.xml: <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiName"> <value>java:comp/env/jdbc/app</value> </property> </bean>web.xml: 该文件还需要如何配置吗? 目前我已经研究了两天,但是还是没有解决,最近非常着急,不知道该怎么办,希望大家能够帮助!
2,数据库中的驱动和url是不是在下面目录中一致的?
tomcat\apache-tomcat-6.0.28\conf\Catalina\localhost
这里面的配置文件对比一下!
非常感谢,不过用户名和密码我已经试过了,而且使用JDBC可以成功连接我觉得可能是配置的问题,但我却不知道配置出现了什么问题
但是程序还是不能运行,出现了一个警告:警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:TestWeb' did not find a matching property.还有两个错误:
1、Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/config/ApplicationContext.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
Caused by: javax.naming.NameNotFoundException: Name jdbc is not bound in this Context2、Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/config/ApplicationContext.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
Caused by: javax.naming.NameNotFoundException: Name jdbc is not bound in this Context我现在也正在查这些问题的原因,希望大家能够帮助,在下不胜感激!
1、No rules found matching 'Server/Context'
2、Setting property 'source' to 'org.eclipse.jst.jee.server:TestWeb' did
not find a matching property
以上两个警告导致我的项目没有成功运行,我的项目名称是TestWebtomcat的配置文件如下context.xml:
<Resource auth="Container"
driverClassName="oracle.jdbc.driver.OracleDriver" maxActive="100"
maxIdle="30" maxWait="10000" name="jdbc/app" password="root"
type="javax.sql.DataSource"
url="jdbc:oracle:thin:@172.19.1.183:1521:TEST" username="LOTTE"/>我的数据库已经测试成功,用户名、密码和URL都很正确server.xml:
不知道该如何配置,这个文件还需不需要配置呢项目文件--》ApplicationContext.xml:
<bean id="dataSource"
class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName">
<value>java:comp/env/jdbc/app</value>
</property>
</bean>web.xml:
该文件还需要如何配置吗?
目前我已经研究了两天,但是还是没有解决,最近非常着急,不知道该怎么办,希望大家能够帮助!