| Author |
exception in connection with sql server 2008
|
chain singh
Ranch Hand
Joined: Feb 28, 2012
Posts: 116
|
|
hello,
i am making a connection with sqlserver 2008 at different host and my application is deploy on jboss 5.0 eap server with linux os,
exception is
org.apache.jasper.JasperException: An exception occurred processing JSP page /index.jsp at line 23
20:
21: try {
22: Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
23: Connection connection = DriverManager.getConnection(connectionUrl, "user", "pass");
24: out.print("Connection is Successfull.......");
25: } catch (SQLException ex) {
26: out.print(ex);
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:498)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
root cause
javax.servlet.ServletException: java.lang.NoClassDefFoundError: com/microsoft/sqlserver/jdbc/TDSReaderMark
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:852)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)
org.apache.jsp.index_jsp._jspService(index_jsp.java:89)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
root cause
java.lang.NoClassDefFoundError: com/microsoft/sqlserver/jdbc/TDSReaderMark
com.microsoft.sqlserver.jdbc.TDSReader.mark(IOBuffer.java:3798)
com.microsoft.sqlserver.jdbc.SQLServerConnection.processEnvChange(SQLServerConnection.java:1961)
com.microsoft.sqlserver.jdbc.TDSTokenHandler.onEnvChange(tdsparser.java:168)
com.microsoft.sqlserver.jdbc.TDSParser.parse(tdsparser.java:64)
com.microsoft.sqlserver.jdbc.SQLServerConnection.sendLogon(SQLServerConnection.java:2529)
com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(SQLServerConnection.java:1905)
com.microsoft.sqlserver.jdbc.SQLServerConnection.access$000(SQLServerConnection.java:41)
com.microsoft.sqlserver.jdbc.SQLServerConnection$LogonCommand.doExecute(SQLServerConnection.java:1893)
com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:4575)
com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1400)
com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1045)
com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:817)
com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:700)
com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:842)
java.sql.DriverManager.getConnection(Unknown Source)
java.sql.DriverManager.getConnection(Unknown Source)
org.apache.jsp.index_jsp._jspService(index_jsp.java:73)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
how i can resolve this problem of driver com/microsoft/sqlserver/jdbc/TDSReaderMark
please help me
thank you
|
 |
Stanley Mungai
Ranch Hand
Joined: Dec 09, 2011
Posts: 155
|
|
|
Could you please Post the Part of the code for Connection/ May be this will be more clear?
|
Give a beggar a fish; feed him for a day. Teach him how to fish; Feed him for a lifetime.
|
 |
chain singh
Ranch Hand
Joined: Feb 28, 2012
Posts: 116
|
|
this is code which i deployed on linux
<% String connectionUrl = "jdbc:sqlserver://10.144.0.33:1433;" +
"databaseName=employee;";
try {
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
Connection connection = DriverManager.getConnection(connectionUrl, "user", "pass$123");
out.print("Connection is Successfull.......");
} catch (SQLException ex) {
out.print(ex);
out.print("Connection is Failed.......");
}
catch(NoClassDefFoundError e)
{
out.print(e);
}
%>
|
 |
chain singh
Ranch Hand
Joined: Feb 28, 2012
Posts: 116
|
|
thank you for your reply
is sqlserver jdbc driver is same for window or linux os
|
 |
 |
|
|
subject: exception in connection with sql server 2008
|
|
|