Results 1 to 5 of 5

Thread: jPetStore cannont make a jdbc connection

  1. #1
    Join Date
    Sep 2004
    Location
    North Carolina
    Posts
    38

    Default jPetStore cannont make a jdbc connection

    I opened the jPetStore example application.
    ran "ant all". This seemed to go fine.
    copied the dist/jpetstore.war file to Tomcat's webapps directory.
    ran "db/hsqldb>server".
    started the app in my browser and the main screen comes up.
    When I try and go to any specific pet, I get the following error.


    type Exception report

    message

    description The server encountered an internal error () that prevented it from fulfilling this request.

    exception

    org.springframework.jdbc.CannotGetJdbcConnectionEx ception: Could not get JDBC connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Connection is broken: Connection refused: connect)
    org.springframework.jdbc.datasource.DataSourceUtil s.getConnection(DataSourceUtils.java:147)
    org.springframework.jdbc.datasource.DataSourceTran sactionManager.doBegin(DataSourceTransactionManage r.java:155)
    org.springframework.transaction.support.AbstractPl atformTransactionManager.getTransaction(AbstractPl atformTransactionManager.java:269)
    org.springframework.transaction.interceptor.Transa ctionAspectSupport.createTransactionIfNecessary(Tr ansactionAspectSupport.java:200)
    org.springframework.transaction.interceptor.Transa ctionInterceptor.invoke(TransactionInterceptor.jav a:49)
    org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :138)
    org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:152)
    $Proxy0.getCategory(Unknown Source)
    org.springframework.samples.jpetstore.web.spring.V iewCategoryController.handleRequest(ViewCategoryCo ntroller.java:31)
    org.springframework.web.servlet.mvc.SimpleControll erHandlerAdapter.handle(SimpleControllerHandlerAda pter.java:44)
    org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:495)
    org.springframework.web.servlet.FrameworkServlet.s ervice(FrameworkServlet.java:321)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:802)



    I am assuming that HSQLDB did not start properly. How do I determine this and am I running the start up command incorrectly?

  2. #2
    Join Date
    Aug 2004
    Location
    Montréal, Canada
    Posts
    845

    Default

    joegaber,

    I tried the same steps like you and everything went smooth.
    When you call server (you must be inside db/hsqldb) you should receive
    Code:
    Opening database: jpetstore
    HSQLDB server 1.7.1 is running
    Use SHUTDOWN to close normally. Use [Ctrl]+[C] to abort abruptly
    Sun Sep 12 22:29:31 EDT 2004 Listening for connections ...
    To verify if HSQLDB is working correctly, change to directory db/hsqldb and call manager. Then use the following parameters to connect to your database:
    Code:
    Type: HSQL Database Engine Server
    Driver: org.hsqldb.jdbcDriver
    URL: jdbc:hsqldb:hsql://localhost:9002
    User: sa
    Password:
    HTH
    Omar Irbouh

    Spring Modules Team
    http://irbouh.blogspot.com/

  3. #3
    Join Date
    Oct 2004
    Posts
    1

    Default manager not working

    Hello,

    I'm having the same problem. Look to my prompt output:

    Code:
    [alan@lavoisier:hsqldb]$ pwd
    /home/alan/Libs/Spring/samples/jpetstore/db/hsqldb
    [alan@lavoisier:hsqldb]$ ./server.sh
    Opening database: jpetstore
    HSQLDB server 1.7.1 is running
    Use SHUTDOWN to close normally. Use [Ctrl]+[C] to abort abruptly
    Wed Oct 20 16:07:10 EDT 2004 Listening for connections ...
    And in other console:

    Code:
    [alan@lavoisier:hsqldb]$ ./manager.sh
    Exception in thread "main" java.lang.NoClassDefFoundError: org/hsqldb/util/DatabaseManager
    Any help?
    Best Regards.

  4. #4
    Join Date
    Apr 2007
    Posts
    1

    Default

    try to execute command in server.sh directly

    Code:
     java -cp ../../../../lib/hsqldb/hsqldb.jar org.hsqldb.Server -database jpetstore
    --
    tested OK on Xubuntu dapper

  5. #5
    Join Date
    Sep 2006
    Location
    UK
    Posts
    8,424

    Default

    This is a pretty old post, but the JAR must either not be on the classpath or it doesn't contain the named class.

Similar Threads

  1. Replies: 9
    Last Post: Nov 3rd, 2010, 08:06 PM
  2. stale Oracle processes
    By compostellas in forum Data
    Replies: 7
    Last Post: Jun 27th, 2005, 12:14 PM
  3. Replies: 6
    Last Post: May 25th, 2005, 01:56 AM
  4. Replies: 0
    Last Post: Apr 6th, 2005, 08:24 AM
  5. Replies: 2
    Last Post: Dec 6th, 2004, 04:07 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •