2014-04-09 2 views
0

DB에 연결하는 데 사용되는 jndi/db 별칭을 사용하고 있습니다. 그 JNDI를 사용하여 최대 절전 모드에서 DB에 연결하는 방법

<property name="hibernate.connection.datasource">jdbc/ASPTADMINDEV</property> 

그리고 resurce.xml 파일

, 나는,

가 나는 특성 아래에서 사용할 때 연결할 수 아니에요 ... 내가 최대 절전 모드를 사용하여 동일한 작업을 수행 할 필요가 잘 작동 .. 그러나 .. 아래), 난

를 오류 얻고있다,이 사용

(
<factories xmi:type="resources.jdbc:DataSource" xmi:id="DataSource_1233129165895" name="Oracle JDBC Driver DataSource" jndiName="jdbc/ASPTADMINDEV" description="New JDBC Datasource" providerType="Oracle JDBC Driver" authMechanismPreference="BASIC_PASSWORD" authDataAlias="ccixdmgr-nprd1-01-nodeMgr/GITPTDEV-ASPTADMIN-ASPTI" manageCachedHandles="false" logMissingTransactionContext="true" diagnoseConnectionUsage="false" relationalResourceAdapter="builtin_rra" statementCacheSize="10" datasourceHelperClassname="com.ibm.websphere.rsadapter.Oracle10gDataStoreHelper"> 
     <propertySet xmi:id="J2EEResourcePropertySet_1233129165915"> 
     <resourceProperties xmi:id="J2EEResourceProperty_1233129165915" name="driverType" type="java.lang.String" value="oci8" description="The type of the driver. The possible values are: thin, oci8." required="false"/> 
     <resourceProperties xmi:id="J2EEResourceProperty_1233129165916" name="oracleLogFileSizeLimit" type="java.lang.Integer" value="0" description="Oracle10g and beyond: The oracleLogFileSizeLimit specifies the maximum number of bytes to be written to any one file. Property is relevant only if trace file is specified. Default is unlimited" required="false"/> 
     <resourceProperties xmi:id="J2EEResourceProperty_1233129165917" name="oracleLogFileCount" type="java.lang.Integer" value="1" description="Oracle10g and beyond: The oracleLogFileCount specifies the number of files to use. Property is relevant only if trace file is specified. Default is 1." required="false"/> 
     <resourceProperties xmi:id="J2EEResourceProperty_1233129165918" name="oracleLogFileName" type="java.lang.String" value="" description="Oracle10g and beyond: The oracleLogFileName indicates which file to write the traces to" required="false"/> 
     <resourceProperties xmi:id="J2EEResourceProperty_1233129165919" name="oracleLogTraceLevel" type="java.lang.String" value="INFO" description="Oracle10g and beyond: The oracleLogTraceLevel specifies which message "> 
......... and so 

} 

오류를 붙여 잊어 버려 .. 제가 여기에 실수를하고있는 중이 야 무엇을 알려 주시기 바랍니다

INFO: JNDI InitialContext properties:{} 
Apr 9, 2014 4:17:19 PM org.hibernate.connection.DatasourceConnectionProvider configure 
SEVERE: Could not find datasource: java:comp/env/jdbc/ASPTADMINDEV 
javax.naming.NameNotFoundException: Name jdbc is not bound in this Context 
Initial SessionFactory creation failed.org.hibernate.HibernateException: Could not find datasource 
    at org.apache.naming.NamingContext.lookup(NamingContext.java:770) 
    at org.apache.naming.NamingContext.lookup(NamingContext.java:140) 

.

어떤 것을 변경해야합니까? 아래 속성을 사용하고 있습니다.

<property name="hibernate.connection.datasource">java:comp/env/jdbc/ASPTADMINDEV</property> 
+0

응용 프로그램 배포 위치 : Tomcat 또는 응용 프로그램 서버 (어느 쪽입니까?)? 예를 들어 데이터 소스가 올바르게 등록되었는지 확인하십시오 (응용 프로그램 서버에서 확인하십시오). –

+0

오, 당신은 코멘트가 있다고 아래에서 말했습니까? 흥미로운 ... 시스템에서 어떤 오류가 발생했는지 정말로 알기를 기대합니까? –

+0

@AndreiI 오류를 붙여 넣는 것을 잊지 마십시오. ;). 나는 TOMCAT 서버에 배포했습니다. 오류 – Arun

답변

0

데이터 원본의 올바른 JNDI 이름을 지정해야한다고 생각합니다.

<property name="hibernate.connection.datasource">java:comp/env/jdbc/ASPTADMINDEV</property> 
+0

위에 던졌습니다.하지만 여전히 던지고있는 오류입니다. DB에 연결할 수 없습니다. – Arun

+0

@Arun 첫 번째 게시물 자체에 관련된 모든 세부 정보를 추가하십시오. 데이터 소스 및 응용 프로그램이 동일한 컨텍스트/셀/노드 등에 있는지 확인하십시오. 나는 websphere에별로 관심이 없습니다. 또한 연결 속성으로 게시물을 업데이트 할 수 있습니다. –

+0

이제는 최대 절전 모드 fw로 간단한 웹 응용 프로그램을 만들었습니다. 최대 절전 모드 구성 파일에 직접가는 URL을 직접 제공하는 db에 연결할 수 있습니다. 하지만, 내가 DB 별칭을 통해 연결을 시도했다. 위의 오류가 발생했습니다. 나는 db.xml에서 db alias, jndi 이름을 언급했다. 이것을 web.xml에 포함시켜야합니까? – Arun

관련 문제