NameNotFoundException: While trying to lookup 'jdbc' only when publishing from Eclipse Kepler but not Indigo

后端 未结 3 975
轻奢々
轻奢々 2020-12-19 06:58

I\'m able to publish my web-app to an Oracle Weblogic 12c (12.1.1) AdminServer from Eclipse Indigo 3.7.2 with oepe 12.1.1.1.1

However, the exact same web-app importe

3条回答
  •  北海茫月
    2020-12-19 07:31

    After a week or so of trial and error / process of elimination I've managed to resolve this issue and get a better understanding of the necessary mappings. As Elliott suspected this was a problem with the JNDI lookup. It was compounded by the fact that it (inadvertently) works as expected when published from Indigo to weblogic 12.1.1 (I'm still unsure why that's the case).

    My initial attempts to resolve this had focused on the mappings in the weblogic.xml. As I was publishing to a weblogic server I was in incorrectly assuming this was referenced when resolving the data source. As it turns out this isn't the case and my configuration didn't require a weblogic.xml resource-description.

    The applicationContext.xml remains the same...

    
     
    
    

    However, the jndiName value of java:comp/env/jdbc/oraclexe maps to the web.xml res-ref-name value jdbc/oraclexe (and not the weblogic.xml res-ref-name as I'd wrongly assumed)...

    The web.xml mapped-name has been amended...

    
     Oracle Weblogic console JDBC Data Source
     jdbc/oraclexe
     javax.sql.DataSource
     Container
     oraclexe
    
    

    ...it's then the mapped-name value oraclexe that maps to the Weblogic console JDBC Data Source JNDI name.

    The resource-description node in the weblogic.xml has now been completely omitted as its not referenced in this particular configuration.

提交回复
热议问题