1

weblogic と hibernate で私の問題を検索した後、jndi ルックアップで問題が発生することがわかりました。アプリをインストールすると正常に実行されますが、アプリを再デプロイすると次のようになります。

javax.naming.NameNotFoundException: Unable to resolve 'ds_c719_002'. Resolved ''; remaining name 'ds_c719_002'

私の設定ファイル(私はJava設定を使用しています)

    @Bean 
    public DataSource getDatasourceConfiguration() {
        System.out.println("empezando a buscar jndi-------------");
        try {
            Thread.sleep(10000);
        } catch (InterruptedException e1) {

        }
     final JndiDataSourceLookup dsLookup = new JndiDataSourceLookup();
     dsLookup.setResourceRef(true);
     Hashtable<String, String> h = new Hashtable<String, String>(7);
     h.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory"); 

     InitialContext context=null;
    try {
        context = new InitialContext(h);
    } catch (NamingException e) {
        log.error(e);

    }
     DataSource dataSource;
    try {   
        dataSource = (javax.sql.DataSource) context.lookup("ds_c719_002");      
        this.ds=dataSource;
        context.close();
        return dataSource;
    } catch (NamingException e) {
        log.error(e);

    }
return null;
 }

よろしく

4

0 に答える 0