PDA

View Full Version : Could not load Jdbc Driver com.mysql.jdbc.Driver



Jeb
10-29-2007, 05:05 AM
Hi,
I am new to Pentaho mondrian.
After mondrian(mondrian-2.4.2) installation I got the following error when I cliked the link
http://localhost:8080/mondrian/testpage.jsp?query=mondrian.
I am using mysql 5.x and jdk 1.5

What change should I do in the jsp file to correct this problem,. Thanks in advance
Regards
Jeb

SEVERE: Servlet.service() for servlet jsp threw exception
com.tonbeller.jpivot.olap.model.OlapException: Could not load Jdbc Driver com.mysql.jdbc.Driver
at com.tonbeller.jpivot.mondrian.MondrianModel.initialize(MondrianModel.java:409)
at com.tonbeller.jpivot.olap.model.OlapModelDecorator.initialize(OlapModelDecorator.java:132)
at com.tonbeller.jpivot.tags.OlapModelProxy$MyState.initialize(OlapModelProxy.java:77)
at com.tonbeller.jpivot.tags.StackStateManager.initializeAndShow(StackStateManager.java:76)
at com.tonbeller.jpivot.tags.OlapModelProxy.initializeAndShow(OlapModelProxy.java:160)
at com.tonbeller.jpivot.tags.OlapModelTag.doEndTag(OlapModelTag.java:81)
at org.apache.jsp.WEB_002dINF.queries.mondrian_jsp._jspx_meth_jp_005fmondrianQuery_005f0(mondrian_jsp.java:134)
at org.apache.jsp.WEB_002dINF.queries.mondrian_jsp._jspService(mondrian_jsp.java:73)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:384)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
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.ApplicationDispatcher.invoke(ApplicationDispatcher.java:687)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:590)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:505)
at com.tonbeller.wcf.utils.IncludeTag.doStartTag(IncludeTag.java:59)
at org.apache.jsp.testpage_jsp._jspx_meth_wcf_005finclude_005f0(testpage_jsp.java:286)
at org.apache.jsp.testpage_jsp._jspService(testpage_jsp.java:127)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:384)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.tonbeller.wcf.controller.RequestFilter$MyHandler.normalRequest(RequestFilter.java:139)
at com.tonbeller.wcf.controller.RequestSynchronizer.handleRequest(RequestSynchronizer.java:127)
at com.tonbeller.wcf.controller.RequestFilter.doFilter(RequestFilter.java:263)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
at java.lang.Thread.run(Thread.java:595)

wseyler
10-29-2007, 10:19 AM
This type of exception could be because the mySQL driver jar is not on the classpath. Check your classpath variable and see if there is a reference to the MySQL driver jar.

Bill

meriam86
03-30-2010, 12:03 PM
Hello
I have the same problem and i got this message:

JPivot had an error ...


org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException: org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException: com.tonbeller.jpivot.olap.model.OlapException: Could not load Jdbc Driver com.mysql.jdbc.Driver

org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException: org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException: com.tonbeller.jpivot.olap.model.OlapException: Could not load Jdbc Driver com.mysql.jdbc.Driver at org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:522) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:398) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267) 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 com.tonbeller.wcf.controller.RequestFilter$MyHandler.normalRequest(RequestFilter.java:139) at com.tonbeller.wcf.controller.RequestSynchronizer.handleRequest(RequestSynchronizer.java:127) at com.tonbeller.wcf.controller.RequestFilter.doFilter(RequestFilter.java:263) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 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:286) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Unknown Source)Caused by: javax.servlet.ServletException: javax.servlet.jsp.JspException: org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException: com.tonbeller.jpivot.olap.model.OlapException: Could not load Jdbc Driver com.mysql.jdbc.Driver at org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848) at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781) at org.apache.jsp.testpage_jsp._jspService(testpage_jsp.java:263) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374) ... 20 moreI placed "mysql-connector-java-5.1.12-bin" under TOMCAT/LIB (I don't have the path TOMCAT/COMMON/LIB)but this doesn't work.What should I do?Thanks.

meriam86
04-06-2010, 11:41 AM
This error was caused by the path of JBDC Driver.:)
The correct path is: Tomcat 6.0\webapps\mondrian\WEB-INF\lib

meriam86
04-06-2010, 11:49 AM
Hello, I know this is not the correct forum to post my topic but please if you have an answer to my problem, answer me.:)
I have recently installed mondrian and it's working fine. I write this code to connect and execute MDX request:



import java.io.PrintWriter;
import com.tonbeller.jpivot.chart.ChartComponent.jpivotCategoryURLGenerator;
import com.tonbeller.jpivot.chart.ChartComponent.jpivotPieURLGenerator;
import mondrian.olap.Connection;
import mondrian.olap.DriverManager;
import mondrian.olap.Query;
import mondrian.olap.Result;

public class requete {


public void requete1 (){

String connectString = "Provider=mondrian;" +
"Jdbc=jdbc:mysql://localhost:3306/foodmart?user=root&password=123;" +
"Catalog=file:C:\\Tomcat 6.0\\webapps\\mondrian\\WEB-INF\\queries\\FoodMart.xml;"+
"JdbcDrivers=com.mysql.jdbc.Driver";
System.out.println(connectString);
Connection connection = null;
connection = DriverManager.getConnection(connectString, null);
Query query = connection.parseQuery("SELECT {[Measures].[Unit Sales], [Measures].[Store Cost], [Measures].[Store Sales]} on columns," +
"{([Promotion Media].[All Media], [Product].[All Products])} ON rows "+
"FROM Sales " +
"WHERE ([Time].[1997])");
Result result = connection.execute(query);
result.print(new PrintWriter(System.out,true));
}


public static void main (String[] args){
new requete().requete1();

}
}


Now I want to display the result in the form of bords and Charts.
Is there a java code that allow me to do that?
Thanks.