急救,winXP+MSSQL2000+Weblogic8.1
使用JDBC连接缓冲池和代码连接都出现相同的错误如下:
Error 500--Internal Server Error
java.lang.NoClassDefFoundError
at com.microsoft.jdbc.base.BaseExceptions.(Unknown Source)
at com.microsoft.jdbc.base.BaseDriver.setupExceptionHandling(Unknown Source)
at com.microsoft.jdbc.base.BaseDriver.connect(Unknown Source)
at weblogic.management.console.utils.JDBC.testConnection(JDBC.java:143)
at weblogic.management.console.actions.mbean.JDBCConnectionPoolTestAction.prePerform(JDBCConnectionPoolTestAction.java:122)
at weblogic.management.console.actions.mbean.DoMBeanWizardAction.perform(DoMBeanWizardAction.java:215)
at weblogic.management.console.actions.internal.ActionServlet.doAction(ActionServlet.java:182)
at weblogic.management.console.actions.internal.ActionServlet.doPost(ActionServlet.java:86)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1072)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:348)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6981)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3892)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2766)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
说明:1,使用代码连接的代码如下:
<%@ page import="java.sql.*"%>
<%Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
String url = "jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=EASDB";
String user ="sa";
String password = "";
Connection conn = DriverManager.getConnection(url,user,password);
Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
%>
2,环境变量的classpath值如下:D:\Program Files\Java\jdk1.5.0_06\lib\tools.jar;D:\Program Files\Java\jdk1.5.0_06\lib\dt.jar;%WL_HOME%\server\lib\msbase.jar;%WL_HOME%\server\lib\ msutil.jar;%WL_HOME%\server\lib\mssqlserver.jar;%CATALINA_HOME%\common\lib\servlet.jar;
WL_HOME=D:\bea\weblogic81;
高手们快帮看看到底是什么问题啊?
[解决办法]
你有没有把驱动的jar放进WEB-INF/lib目录下?
[解决办法]
SQL Server需要打SP4补丁
另外尝试把msbase.jar和msutil.jar也加入试试看