2

我正在使用 11 g express edition,Eclipse Juno,Java 6

Oracle 已启动并运行,甚至尝试立即关闭和启动,但未收到 SID 侦听器错误

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">

  <persistence-unit name="default" transaction-type="RESOURCE_LOCAL">
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
    <class>com.crspdemo.Employee</class>
    <properties>
      <property name="javax.persistence.jdbc.url" value="jdbc:oracle:thin:@localhost:1521:jsfDatabase"/>
      <property name="javax.persistence.jdbc.password" value="admin"/>
      <property name="javax.persistence.jdbc.driver" value="oracle.jdbc.driver.OracleDriver"/>
      <property name="javax.persistence.jdbc.user" value="system"/>
      <!--<property name="eclipselink.ddl-generation" value="create-tables"/>-->
    </properties>
  </persistence-unit>

</persistence>

错误:

Caused by: javax.persistence.PersistenceException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.2.0.v20110202-r8913): org.eclipse.persistence.exceptions.DatabaseException

内部异常:java.sql.SQLException:侦听器拒绝连接并出现以下错误: ORA-12505,TNS:侦听器当前不知道连接描述符中给出的 SID

Listner.ora

监听器.ora

4

1 回答 1

2

尝试为 XE 使用默认 SID:

<property name="javax.persistence.jdbc.url" value="jdbc:oracle:thin:@localhost:1521:XE"/>
于 2013-02-02T15:21:17.960 回答