請教。在ejb中用DataSource連線資料庫,報錯!
我在ejb中用直連方式沒有問題。
用DataSource就不行,我的code:
public Connection getConnection(){
Connection con = null;
DataSource ds = null;
try{
InitialContext ctx = new InitialContext();
System.out.println("ccccccccccccccccc");
ds = (DataSource)ctx.lookup("java:comp/env/estore");
System.out.println("dddddddddddddddd");
con = ds.getConnection();
System.out.println("eeeeeeeeeeeeeeeeeeeee");
}
catch(Exception e){
e.printStackTrace();
}
return con;
}
執行不到System.out.println("eeeeeeeeeeeeeeeeeeeee");
丟擲的異常:
java.lang.NoClassDefFoundError: weblogic/jdbc/wrapper/PoolConnection
java.sql.SQLException: Cannot obtain connection: driverURL = jdbc:weblogic:pool:estoreConn
ectionPool, props = {enableTwoPhaseCommit=false, jdbcTxDataSource=true, connectionPoolID=e
storeConnectionPool, dataSourceName=estoreDataSource}.
用DataSource就不行,我的code:
public Connection getConnection(){
Connection con = null;
DataSource ds = null;
try{
InitialContext ctx = new InitialContext();
System.out.println("ccccccccccccccccc");
ds = (DataSource)ctx.lookup("java:comp/env/estore");
System.out.println("dddddddddddddddd");
con = ds.getConnection();
System.out.println("eeeeeeeeeeeeeeeeeeeee");
}
catch(Exception e){
e.printStackTrace();
}
return con;
}
執行不到System.out.println("eeeeeeeeeeeeeeeeeeeee");
丟擲的異常:
java.lang.NoClassDefFoundError: weblogic/jdbc/wrapper/PoolConnection
java.sql.SQLException: Cannot obtain connection: driverURL = jdbc:weblogic:pool:estoreConn
ectionPool, props = {enableTwoPhaseCommit=false, jdbcTxDataSource=true, connectionPoolID=e
storeConnectionPool, dataSourceName=estoreDataSource}.
相關文章
- 連線oracle資料庫時,報錯:{dataSource-1} init errorOracle資料庫Error
- 請教資料庫連線問題??急!資料庫
- 請教關於資料庫連線的問題資料庫
- 一個資料庫連線問題!請教高手資料庫
- apusic連線weblogic錯誤,請教!!!Web
- 我想請教jivejdon-2.5 是如何連線資料庫的資料庫
- 請教關於資料庫連線池的設定問題?資料庫
- EJB Finder方法編譯出錯,請教!!!編譯
- ejb client 請教client
- 請關掉你的資料庫連線!並且請使用資料庫連線池資料庫
- 連線資料庫出錯???資料庫
- 請教問題:jive1.2.4資料庫連線問題,謝謝資料庫
- 請問有在Jive中用oracle作資料庫的嗎?Oracle資料庫
- 連線資料庫報錯ORA-12514資料庫
- 連線資料庫報錯 ORA-12514資料庫
- Tomcat配置DataSource,連線池資料來源Tomcat
- 請教,求助tomcat + MS server2K 資料庫連線池問題TomcatServer資料庫
- cacti登陸出現報錯:資料庫無法連線資料庫
- 我的postgresql資料庫報埠錯誤,連線失敗SQL資料庫
- 遠端呼叫EJB。報錯如下。請問是什麼原因?請教banq等dx。謝謝!
- SpringBoot druid配置datasource啟動初始化資料庫連線Spring BootUI資料庫
- Tomcat4_1_30下Oracle DataSource(Oracle 資料庫連線池)配置TomcatOracle資料庫
- 資料庫例項到nomount 使用連線串無法連線到資料庫 報ORA-12528錯誤資料庫
- Java專案連線資料庫Mysql報錯create connection SQLExceptionJava資料庫MySqlException
- 【Spotlight】初次連線資料庫ORA-00904報錯原因資料庫
- 請教Jive資料庫問題資料庫
- 請教benq資料庫設計ENQ資料庫
- 請教ejb釋出問題
- springboot整合Batis,執行報錯,資料庫連線密碼錯誤Spring BootBAT資料庫密碼
- 請教一個使用lucene做全文檢索與資料庫連線時的問題資料庫
- 資料庫連線異常故障報告資料庫
- 在Eclipse中用JDBC連線Sql ServerEclipseJDBCSQLServer
- 用Navicat連線資料庫-資料庫連線(MySQL演示)資料庫MySql
- 請教高手 關於STRUTS DATASOURCE的問題
- 請問,關於資料庫連線的問題。資料庫
- 連線資料庫資料庫
- 資料庫連線資料庫
- 請教高手們,急救!!!怎麼樣在jbuilderx建立ejb元件,UI元件