MyEclipse SSH三大框架用tomcat链接数据库报错
MyEclipse10+Struts1+Hibernate+Spring+Tomcat6.0+Oracle11g启动tomcat时报错:ORA-12505,TNS:lis...
MyEclipse 10 + Struts 1 + Hibernate + Spring + Tomcat6.0 + Oracle 11g 启动tomcat时报错:ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
application.xml配置
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
<property name="driverClass" value="oracle.jdbc.driver.OracleDriver">
</property>
<property name="jdbcUrl" value="jdbc:oracle:thin:127.0.0.1:1521:hlxk"></property>
<property name="user" value="userss"></property>
<property name="password" value="userss"></property>
<property name="maxPoolSize" value="40" />
<property name="minPoolSize" value="1" />
<property name="initialPoolSize" value="5" />
<property name="maxIdleTime" value="20" />
</bean>
listener.ora中相关配置:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = D:\app\Administrator\product\11.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:D:\app\Administrator\product\11.2.0\dbhome_1\bin\oraclr11.dll")
)
(SID_DESC =
(SID_NAME = hlxk)
(ORACLE_HOME = D:\app\Administrator\product\11.2.0\dbhome_1)
(PROGRAM = hlxk)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
)
)
ADR_BASE_LISTENER = D:\app\Administrator
数据库实例名:hlxk 展开
application.xml配置
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
<property name="driverClass" value="oracle.jdbc.driver.OracleDriver">
</property>
<property name="jdbcUrl" value="jdbc:oracle:thin:127.0.0.1:1521:hlxk"></property>
<property name="user" value="userss"></property>
<property name="password" value="userss"></property>
<property name="maxPoolSize" value="40" />
<property name="minPoolSize" value="1" />
<property name="initialPoolSize" value="5" />
<property name="maxIdleTime" value="20" />
</bean>
listener.ora中相关配置:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = D:\app\Administrator\product\11.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:D:\app\Administrator\product\11.2.0\dbhome_1\bin\oraclr11.dll")
)
(SID_DESC =
(SID_NAME = hlxk)
(ORACLE_HOME = D:\app\Administrator\product\11.2.0\dbhome_1)
(PROGRAM = hlxk)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
)
)
ADR_BASE_LISTENER = D:\app\Administrator
数据库实例名:hlxk 展开
4个回答
展开全部
freedomwang987说的是对的SID 有问题,但不是struts配置文件
我的携唤是
(SID_DESC =
(GLOBAL_DBNAME = ORCL)<---
(ORACLE_HOME = C:\oracle\product\10.2.0\db_1)
(SID_NAME = ORCL)<芹隐源嫌态---
)
你的是
(SID_DESC =
(SID_NAME = hlxk)<---
(ORACLE_HOME = D:\app\Administrator\product\11.2.0\dbhome_1)
(PROGRAM = hlxk)<---
)
我的携唤是
(SID_DESC =
(GLOBAL_DBNAME = ORCL)<---
(ORACLE_HOME = C:\oracle\product\10.2.0\db_1)
(SID_NAME = ORCL)<芹隐源嫌态---
)
你的是
(SID_DESC =
(SID_NAME = hlxk)<---
(ORACLE_HOME = D:\app\Administrator\product\11.2.0\dbhome_1)
(PROGRAM = hlxk)<---
)
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
SID 有问题 可能是你的struts配置文件有错
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询