连接weblogic9.2数据源问题,高手快了,我快完了!

weblogic.rmi.extensions.RemoteRuntimeException:UnexpectedExceptionatweblogic.jdbc.com... weblogic.rmi.extensions.RemoteRuntimeException: Unexpected Exception
at weblogic.jdbc.common.internal.RmiDataSource_920_WLStub.getConnection(Unknown Source)
at com.accp.dao.JDBCUtil.openConnection(JDBCUtil.java:33)
at com.accp.servlet.Test.doPost(Test.java:79)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Unknown Source)
Caused by: weblogic.rjvm.PeerGoneException: ; nested exception is:
weblogic.utils.NestedException: java.lang.NoClassDefFoundError: com/bea/xml/XmlException
at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:195)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:338)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:252)
... 17 more
Caused by: weblogic.utils.NestedException: java.lang.NoClassDefFoundError: com/bea/xml/XmlException
at weblogic.rjvm.RJVMImpl.gotExceptionReceiving(RJVMImpl.java:919)
at weblogic.rjvm.ConnectionManager.gotExceptionReceiving(ConnectionManager.java:1009)
at weblogic.rjvm.MsgAbbrevJVMConnection.gotExceptionReceiving(MsgAbbrevJVMConnection.java:443)
at weblogic.rjvm.t3.MuxableSocketT3.hasException(MuxableSocketT3.java:373)
at weblogic.socket.SocketMuxer.deliverExceptionAndCleanup(SocketMuxer.java:734)
at weblogic.socket.SocketMuxer.deliverHasException(SocketMuxer.java:687)
at weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java:307)
at weblogic.socket.SocketReaderRequest.run(SocketReaderRequest.java:29)
at weblogic.work.ExecuteRequestAdapter.execute(ExecuteRequestAdapter.java:21)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:145)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:117)
Caused by: java.lang.NoClassDefFoundError: com/bea/xml/XmlException

...后面还有

必有重谢
问题自己解决了,以前就把weblogic.jar放在项目中,这样不行,还缺少一个jrmpclient.jar这样的jar包,但你回答了,答案就给你了
展开
 我来答
zzhiyong8088
2010-05-31
知道答主
回答量:28
采纳率:0%
帮助的人:18.7万
展开全部
是不是配置有问题,建议检查数据源配置
和访问代码。下面的参考一下:
1:首先在weblogic 下配置好数据源jdbc/testDATASource
2: 调用代码:
/**
* 根据数据源名称获取数据库连接对象, 这里将保证只存在一个活动的连接对象
* @param dataSource 数据源名称
*/
protected Connection getConnection(String dataSource) {
try {
//Hashtable has=new Hashtable();
// has.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory ");
// has.put(Context.PROVIDER_URL, "http://192.168.0.166:7001 ");
if (ds == null) {

Context myContext = new InitialContext();//has
ds = (javax.sql.DataSource) myContext.lookup(dataSource);//"java:comp/env/"+
}
//如果conn已经创建并且已经关闭, 则先置null
if (conn != null) {
if (conn.isClosed()) {
conn = null;
}
}
if (conn == null) {
conn = ds.getConnection();
}
}catch (NamingException ne) {
System.out.println("Naming exception occured.");
ne.printStackTrace();
}catch (SQLException se) {
System.out.println("Can't get connection from data source.");
se.printStackTrace();
}catch (Exception e) {
System.out.println("Unknown error in getConnection().");
e.printStackTrace();
}

return conn;
}
3:同时注意 数据库驱动 jar 包 放到 bea\weblogic81\server\lib\目录下
4:注意其他的版本 如jdk 和相关javax冲突问题
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式