Announcement Announcement Module
Collapse
No announcement yet.
"orcl" namespace - error defining ONS-configuration Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • "orcl" namespace - error defining ONS-configuration

    I'm trying to follow the Spring Data JDBC Extensions - Reference Documentation examples for configuring our Oracle 11g RAC database with FCF, section 2.1.
    Spring Data JDBC Extensions - Reference Documentation

    I am unable to configure the application so that it configures ONS correctly, I keep getting: "Hostport list can not be empty, at least one hostort should be specified"

    Here is my 'applicationContext-dataSource.xml':
    Code:
    <!-- NOTE:  url, username, password defined in orcl.properties and don't need to be specified here -->           
        <orcl:pooling-datasource 
        	id="cimDataSource"
            connection-properties-prefix="conn"
            connection-cache-properties-prefix="cache"
            properties-location="classpath:META-INF/spring/properties/orcl.properties"
            fast-connection-failover-enabled="true"
            ONS-configuration="dbrac11gdev05:6150,dbrac11gdev06:6150"
            />
    For reference, the conn.url in the orcl.properties file is:
    Code:
    jdbc:oracle:thin:@(description=(address_list=(address=(host=dbrac11gdev05)(protocol=tcp)(port=1532)) \
    (address=(host=dbrac11gdev06)(protocol=tcp)(port=1532)))(connect_data=(service_name=CAS11DEV)))
    I keep getting the following ONSException:
    Code:
    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [META-INF/spring/applicatio
    vocation of init method failed; nested exception is oracle.ons.ONSException: Hostport list can not be empty, at least one host:port should be specified
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
            at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
            at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
            at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
            at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
            at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:398)
            at org.springframework.beans.factory.BeanFactoryUtils.beansOfTypeIncludingAncestors(BeanFactoryUtils.java:275)
            at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.detectPersistenceExceptionTranslators(PersistenceExceptionTranslationInterceptor.java:139)
            at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.<init>(PersistenceExceptionTranslationInterceptor.java:79)
            at org.springframework.dao.annotation.PersistenceExceptionTranslationAdvisor.<init>(PersistenceExceptionTranslationAdvisor.java:70)
            at org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor.setBeanFactory(PersistenceExceptionTranslationPostProcessor.java:99)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeAwareMethods(AbstractAutowireCapableBeanFactory.java:1439)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1408)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
            ... 38 more
    Caused by: oracle.ons.ONSException: Hostport list can not be empty, at least one host:port should be specified
            at oracle.ons.ONS.onsSetup(ONS.java:306)
            at oracle.ons.ONS.<init>(ONS.java:429)
            at oracle.jdbc.pool.OracleConnectionCacheManager$1.run(OracleConnectionCacheManager.java:245)
            at java.security.AccessController.doPrivileged(Native Method)
            at oracle.jdbc.pool.OracleConnectionCacheManager.createCache(OracleConnectionCacheManager.java:237)
            at oracle.jdbc.pool.OracleConnectionCacheManager.createCache(OracleConnectionCacheManager.java:167)
            at oracle.jdbc.pool.OracleDataSource.cacheInitialize(OracleDataSource.java:427)
            at orac
    le.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:402)
            at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:189)
            at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:165)
            at org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider.getConnection(InjectedDataSourceConnectionProvider.java:71)
            at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:114)
            at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2163)
            at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2159)
            at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1383)
            at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:954)
            at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:892)
            at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:74)
            at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:225)
            at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:308)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
    What am I missing?

  • #2
    I had exactly the same problem. I figured this out by reading some Oracle documentation on ONS and UCP. The Spring documentation is wrong, format for specifying nodes in ONSconfig is (using your hostnames):
    Code:
    ONS-configuration="nodes=dbrac11gdev05:6150,dbrac11gdev06:6150"
    P.S. I'm sorry for necroposting, but it's just I couldn't find the solution on the internet, so thought this might be helpful for future reference.
    Last edited by AlexCzar; Feb 27th, 2013, 03:16 AM.

    Comment

    Working...
    X