Announcement Announcement Module
Collapse
No announcement yet.
jPetStore cannont make a jdbc connection Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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

    Comment


    • #3
      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.

      Comment


      • #4
        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

        Comment


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

          Comment

          Working...
          X