You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Mikael Byström <mi...@gmail.com> on 2010/01/04 05:19:51 UTC
newbie: Eclipse Java EE 1.2.1 and Derby 10.5.3: DataSource invalid
Hi,
I followed this article: "Creating Database Web Applications with
Eclipse" <http://www.eclipse.org/articles/article.php?file=Article-
EclipseDbWebapps/index.html> using Eclipse Java EE 1.2.1.20090918-0703
Apache Derby 10.5.3 and jakarta-taglibs-standard-1.1.2 to the letter,
except using later versions of Eclipse and Derby. All this running in
Apache Tomcat 5.5.28 under builtin J2SE-05 of OS X 10.5 (Leopard).
At "Testing the Application" when I run the demo.jsp on Server I get the
following root cause error:
javax.servlet.ServletException: Unable to get connection, DataSource
invalid: "org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot load
JDBC driver class 'org.apache.derby.jdbc.ClientDriver'"
org.apache.jasper.runtime.PageContex
tImpl.doHandlePageException(PageContextImpl.java:841)
org.apache.jasper.runtime.PageContex
tImpl.handlePageException(PageContextImpl.java:774)
org.apache.jsp.demo_jsp._jspService(demo_jsp.java:101)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.jasper.servlet.JspServlet
Wrapper.service(JspServletWrapper.java:331)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
possibly indicating some problem with the jdbc driver. However if I
startup "ij" I can use the connection string:
connect 'jdbc:derby://localhost:1527/sample';
which is the same DB URL as in my context.xml file and I can then
execute SQL commands within that connection.
I'm not a newbie to core java, but I am new to both the Eclipse Java EE
app and Derby. Any pointers in finding start points for analyzing these
errors or a better approach for creating a database connection reliably
in Eclipse Java EE with derby would be most helpful.
/MB
Re: newbie: Eclipse Java EE 1.2.1 and Derby 10.5.3: DataSource
invalid
Posted by MB <di...@gmail.com>.
Dag H. Wanvik said:
>this is an Eclipse issue as far as I can see: The Derby client driver
>is not on the classpath for some reason, so
>org.apache.derby.jdbc.ClientDriver cant be found. I suggest you ask
>some Eclipse experts.
Thanks, this is quite possible, but as far as I could gather the proper
JAR-file driver was on the classpath. But most likely I have made a
mistake somewhere. However, for now I moved to MySQL, where I had a
similar problem with the driver placed of my JRE extension folder, but
that problem I could resolve. I'll return to Derby later and reanalyze
the situation before I ask at the Eclipse forums.
It seems to me that Derby Embedded at the publication server could be a
very interesting solution for my current small scale web project.
Thanks for your input.
/MB
Re: newbie: Eclipse Java EE 1.2.1 and Derby 10.5.3: DataSource invalid
Posted by "Dag H. Wanvik" <Da...@Sun.COM>.
Hi Mikael,
this is an Eclipse issue as far as I can see: The Derby client driver
is not on the classpath for some reason, so
org.apache.derby.jdbc.ClientDriver cant be found. I suggest you ask
some Eclipse experts.
Dag
Mikael Byström <mi...@gmail.com> writes:
> Hi,
>
> I followed this article: "Creating Database Web Applications with
> Eclipse" <http://www.eclipse.org/articles/article.php?file=Article-
> EclipseDbWebapps/index.html> using Eclipse Java EE 1.2.1.20090918-0703
> Apache Derby 10.5.3 and jakarta-taglibs-standard-1.1.2 to the letter,
> except using later versions of Eclipse and Derby. All this running in
> Apache Tomcat 5.5.28 under builtin J2SE-05 of OS X 10.5 (Leopard).
>
> At "Testing the Application" when I run the demo.jsp on Server I get the
> following root cause error:
> javax.servlet.ServletException: Unable to get connection, DataSource
> invalid: "org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot load
> JDBC driver class 'org.apache.derby.jdbc.ClientDriver'"
> org.apache.jasper.runtime.PageContex
> tImpl.doHandlePageException(PageContextImpl.java:841)
> org.apache.jasper.runtime.PageContex
> tImpl.handlePageException(PageContextImpl.java:774)
> org.apache.jsp.demo_jsp._jspService(demo_jsp.java:101)
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
> org.apache.jasper.servlet.JspServlet
> Wrapper.service(JspServletWrapper.java:331)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
>
>
> possibly indicating some problem with the jdbc driver. However if I
> startup "ij" I can use the connection string:
> connect 'jdbc:derby://localhost:1527/sample';
> which is the same DB URL as in my context.xml file and I can then
> execute SQL commands within that connection.
>
> I'm not a newbie to core java, but I am new to both the Eclipse Java EE
> app and Derby. Any pointers in finding start points for analyzing these
> errors or a better approach for creating a database connection reliably
> in Eclipse Java EE with derby would be most helpful.
>
> /MB
>
--
Dag H. Wanvik, staff engineer
Sun Microsystems, Java Core and Desktop - Java DB/Derby
Haakon VII gt. 7b, N-7485 Trondheim, Norway
Tel: x43496/+47 73842196, Fax: +47 73842101
Sun IM: dw136674, Yahoo IM: dag_h_wanvik