-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Hibernate, JPA, Remote Connection issue and HSQL
PostPosted: Tue Aug 10, 2010 2:32 pm 
Newbie

Joined: Tue May 18, 2010 5:28 pm
Posts: 8
Hello, I have been having some issues retrieving and saving data from/to a remote HSQL server on a client machine. I am connected to the HSQL server now. My issue now seems to reside with hibernate and JPA, and I was hoping someone here would be gracious enough to help me out a bit. =) I believe it has something to do with my persistence.xml file so I will post that here:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
  <persistence-unit name="MacCleanSoftServer" transaction-type="RESOURCE_LOCAL">
    <provider>org.hibernate.ejb.HibernatePersistence</provider>
    <class>Entities.Customer</class>
    <class>Entities.Address</class>
    <class>Entities.Orders</class>
    <class>TEST.Person</class>
    <class>Entities.ClothesList</class>
    <class>Entities.Employee</class>
    <properties>
      <property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
      <property name="hibernate.connection.username" value="sa"/>
      <property name="hibernate.connection.password" value=""/>
      <property name="hibernate.connection.url" value="jdbc:hsqldb:hsql://192.168.0.196/xdb"/>
    </properties>
  </persistence-unit>
</persistence>


On the machine running the server it seems to accept the connection just fine without any issues, but when it tries to build the session factory I get this:

Code:
Aug 10, 2010 1:15:40 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Default entity-mode: pojo
Aug 10, 2010 1:15:40 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Named query checking : enabled
Aug 10, 2010 1:15:40 PM org.hibernate.impl.SessionFactoryImpl <init>
INFO: building session factory
Aug 10, 2010 1:15:40 PM org.hibernate.impl.SessionFactoryObjectFactory addInstance
INFO: Not binding factory to JNDI, no JNDI name configured


I do not get this problem with my server machine, so I'm assuming it has something to do with the remote connection? Anyways. If anyone can provide some insight I would greatly appreciate it. Thanks so much in advance!


Top
 Profile  
 
 Post subject: Re: Hibernate, JPA, Remote Connection issue and HSQL
PostPosted: Fri Aug 13, 2010 2:19 pm 
Newbie

Joined: Tue May 18, 2010 5:28 pm
Posts: 8
Here's a bit more information: It doesn't throw an exception until I try to execute a query and the exception I get is the following:


Code:
SEVERE: Table not found in statement [select customer0_.CUSTOMER_ID as CUSTOMER2_0_, customer0_.CREATE_TIME as CREATE3_0_, customer0_.UPDATE_TIME as UPDATE4_0_, customer0_.version as version0_, customer0_.ADDRESS as ADDRESS0_, customer0_.FIRST_NAME as FIRST6_0_, customer0_.LAST_NAME as LAST7_0_, customer0_.PRICE_LIST as PRICE8_0_, customer0_.SALES_TAX as SALES9_0_, customer0_.TELEPHONE as TELEPHONE0_, customer0_.ACCESS as ACCESS0_, customer0_.IS_MANAGER as IS12_0_, customer0_.PASSWORD as PASSWORD0_, customer0_.TIME_SHEET as TIME14_0_, customer0_.USERNAME as USERNAME0_, customer0_.DTYPE as DTYPE0_ from CUSTOMER customer0_]
Exception in thread "AWT-EventQueue-0" javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query
        at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:637)
        at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:74)
        at Forms.Login.jButton1MouseClicked(Login.java:204)
        at Forms.Login.access$100(Login.java:38)
        at Forms.Login$2.mouseClicked(Login.java:100)
        at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:253)
        at java.awt.Component.processMouseEvent(Component.java:6270)
        at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
        at java.awt.Component.processEvent(Component.java:6032)
        at java.awt.Container.processEvent(Container.java:2041)
        at java.awt.Component.dispatchEventImpl(Component.java:4630)
        at java.awt.Container.dispatchEventImpl(Container.java:2099)
        at java.awt.Component.dispatchEvent(Component.java:4460)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4247)
        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
        at java.awt.Container.dispatchEventImpl(Container.java:2085)
        at java.awt.Window.dispatchEventImpl(Window.java:2478)
        at java.awt.Component.dispatchEvent(Component.java:4460)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: org.hibernate.exception.SQLGrammarException: could not execute query
        at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
        at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
        at org.hibernate.loader.Loader.doList(Loader.java:2223)
        at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
        at org.hibernate.loader.Loader.list(Loader.java:2099)
        at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
        at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
        at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
        at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
        at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
        at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:65)
        ... 24 more
Caused by: java.sql.SQLException: Table not found in statement [select customer0_.CUSTOMER_ID as CUSTOMER2_0_, customer0_.CREATE_TIME as CREATE3_0_, customer0_.UPDATE_TIME as UPDATE4_0_, customer0_.version as version0_, customer0_.ADDRESS as ADDRESS0_, customer0_.FIRST_NAME as FIRST6_0_, customer0_.LAST_NAME as LAST7_0_, customer0_.PRICE_LIST as PRICE8_0_, customer0_.SALES_TAX as SALES9_0_, customer0_.TELEPHONE as TELEPHONE0_, customer0_.ACCESS as ACCESS0_, customer0_.IS_MANAGER as IS12_0_, customer0_.PASSWORD as PASSWORD0_, customer0_.TIME_SHEET as TIME14_0_, customer0_.USERNAME as USERNAME0_, customer0_.DTYPE as DTYPE0_ from CUSTOMER customer0_]
        at org.hsqldb.jdbc.Util.throwError(Unknown Source)
        at org.hsqldb.jdbc.jdbcPreparedStatement.<init>(Unknown Source)
        at org.hsqldb.jdbc.jdbcConnection.prepareStatement(Unknown Source)
        at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:505)
        at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:423)
        at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
        at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547)
        at org.hibernate.loader.Loader.doQuery(Loader.java:673)
        at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
        at org.hibernate.loader.Loader.doList(Loader.java:2220)
        ... 32 more


Anyone, Anyone, Bueller, Bueller? lol


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.