Results 1 to 3 of 3
  1. #1
    shomid is offline Member
    Join Date
    Aug 2011
    Posts
    20
    Rep Power
    0

    Lightbulb Jar file does not work with database (Hibernate)

    I have created an application using hibernate... It works fine with database when I run it through Netbeans. But when I build application (using Clean and Build tool) it does not work with database.

    Error:

    Java Code:
    WARNING: SQL Error: 40000, SQLState: 08001
    May 21, 2010 4:25:11 PM org.hibernate.util.JDBCExceptionReporter logExceptions
    SEVERE: java.net.ConnectException : Error connecting to server localhost on port
    1527 with message Connection refused: connect.
    Exception in thread "AWT-EventQueue-0"    
    org.hibernate.exception.JDBCConnectionException: **Cannot open connection**
    at org.hibernate.exception.SQLStateConverter.convert( SQLStateConverter.java:74)
    at org.hibernate.exception.JDBCExceptionHelper.conver t(JDBCExceptionHelper.java:43)
    at org.hibernate.exception.JDBCExceptionHelper.conver t(JDBCExceptionHelper.java:29)
    at org.hibernate.jdbc.ConnectionManager.openConnectio n(ConnectionManager.java:426)
    at org.hibernate.jdbc.ConnectionManager.getConnection (ConnectionManager.java:144)
    at org.hibernate.jdbc.AbstractBatcher.prepareQuerySta tement(AbstractBatcher.java:139)
    at org.hibernate.loader.Loader.prepareQueryStatement( Loader.java:1547)
    at org.hibernate.loader.Loader.doQuery(Loader.java:67 3)
    at org.hibernate.loader.Loader.doQueryAndInitializeNo nLazyCollections(Loader.java:236)
    at org.hibernate.loader.Loader.doList(Loader.java:222 0)
    at org.hibernate.loader.Loader.listIgnoreQueryCache(L oader.java:2104)
    at org.hibernate.loader.Loader.list(Loader.java:2099)
    at org.hibernate.loader.hql.QueryLoader.list(QueryLoa der.java:378)
    at org.hibernate.hql.ast.QueryTranslatorImpl.list(Que ryTranslatorImpl.java:338)
    at org.hibernate.engine.query.HQLQueryPlan.performLis t(HQLQueryPlan.java:172)
    at org.hibernate.impl.SessionImpl.list(SessionImpl.ja va:1121)
    at org.hibernate.impl.QueryImpl.list(QueryImpl.java:7 9)
    at ajmalispatientdatamanager.StartPage.searchMethod(S tartPage.java:852)
    at ajmalispatientdatamanager.StartPage.SearchBtnActio nPerformed(StartPage.java:599)
    at ajmalispatientdatamanager.StartPage.access$900(Sta rtPage.java:33)
    at ajmalispatientdatamanager.StartPage$8.actionPerfor med(StartPage.java:382)
    at javax.swing.AbstractButton.fireActionPerformed(Unk nown Source)
    at javax.swing.AbstractButton$Handler.actionPerformed (Unknown Source)
    at javax.swing.DefaultButtonModel.fireActionPerformed (Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at javax.swing.plaf.basic.BasicButtonListener.mouseRe leased(Unknown Source)
    at java.awt.Component.processMouseEvent(Unknown Source)
    at javax.swing.JComponent.processMouseEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent( Unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent(U nknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unkno wn Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilter s(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(U nknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarch y(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    Caused by: java.sql.SQLNonTransientConnectionException: java.net.ConnectException :   
    Error connecting to server localhost on port 1527 with message Connection refused: 
    connect.
    at org.apache.derby.client.am.SQLExceptionFactory40.g etSQLException(Unknown Source)
    at org.apache.derby.client.am.SqlException.getSQLExce ption(Unknown Source)
    at org.apache.derby.jdbc.ClientDriver.connect(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at org.hibernate.connection.DriverManagerConnectionPr   
    ovider.getConnection(DriverManagerConnectionProvid er.java:110)
    at org.hibernate.jdbc.ConnectionManager.openConnectio n(ConnectionManager.java:423)
     ... 42 more
    Caused by: org.apache.derby.client.am.DisconnectException: java.net.ConnectException : 
    Error connecting to server localhost on port 1527 with message Connection refused:   
    connect.
    at org.apache.derby.client.net.NetAgent.<init>(Unknow n Source)
    at org.apache.derby.client.net.NetConnection.newAgent _(Unknown Source)
    at org.apache.derby.client.am.Connection.<init>(Unkno wn Source)
    at org.apache.derby.client.net.NetConnection.<init>(U nknown Source)
    at org.apache.derby.client.net.NetConnection40.<init> (Unknown Source)
    at org.apache.derby.client.net.ClientJDBCObjectFactor yImpl40.newNetConnection(Unknown 
    Source)
    ... 47 more
    Caused by: java.net.ConnectException: Connection refused: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(Unknown Source)
    at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.SocksSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.<init>(Unknown Source)
    at java.net.Socket.<init>(Unknown Source)
    at javax.net.DefaultSocketFactory.createSocket(Unknow n Source)
    at org.apache.derby.client.net.OpenSocketAction.run(U nknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    ... 53 more
    Please Help Me.

  2. #2
    doWhile is online now Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,641
    Rep Power
    7

Similar Threads

  1. Database Query using Hibernate
    By javababy in forum Web Frameworks
    Replies: 0
    Last Post: 08-02-2011, 12:54 PM
  2. Jar file does not work with database (Hibernate)
    By nonabhai in forum NetBeans
    Replies: 9
    Last Post: 05-21-2010, 01:08 PM
  3. File upload into database using Hibernate
    By liljejalil in forum JDBC
    Replies: 1
    Last Post: 02-28-2010, 04:11 AM
  4. Hibernate with multiple database
    By Marty in forum JDBC
    Replies: 3
    Last Post: 12-23-2008, 01:57 PM
  5. can hibernate work with Oracle 10g
    By javadev in forum JDBC
    Replies: 4
    Last Post: 07-08-2007, 09:47 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
  •