1 2 3 4 5 Previous Next 64 Replies Latest reply on Jul 27, 2009 3:32 AM by maxandersen Go to original post
      • 30. Re: Hibernate Configurations problem
        asookazian

         

        "max.andersen@jboss.com" wrote:
        Is the project build so the classes are actually available on the classpath ?


        the project was not built. the build auto was not checked in project menu.

        • 31. Re: Hibernate Configurations problem
          maxandersen

          Ok - and did that then help ?

          • 32. Re: Hibernate Configurations problem
            asookazian

             

            "vyemialyanchyk" wrote:
            asookazian, which is type of your Hibernate CC? it seems "Core".
            open Edit Configuration dialog and change it to "JPA" - this should help.

            also I saw your persistence.xml doesn't contains "Managed Classes" - this is not a reason of HCC exception - just little hint.


            it's JPA. this issue has been resolved for the workshop demo app. there were no .class files available (they weren't built yet after revengr). I will attempt to resolve it for my app now.

            related thread: http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4217116#4217116

            • 33. Re: Hibernate Configurations problem
              asookazian

               

              "max.andersen@jboss.com" wrote:
              Ok - and did that then help ?



              i'm looking into this now for my app (the workshop app HQL editor is working now).

              • 34. Re: Hibernate Configurations problem
                asookazian

                So my .class files for the entity classes for my BETS project exist here:

                \BETS\classes\model\com\cox\bets\entity

                The default classpath doesn't work. I added \BETS\classes to the classpath and \BETS\classes\model and that doesn't work either.

                When I rebuild config and expand Configuration, nothing.

                So it works for the workshop WAR two project example, but not for my seam-gen'd one folder EAR project.

                Must this project be converted to the 4 project WTP-style in order to use the HQL editor?

                • 35. Re: Hibernate Configurations problem
                  maxandersen

                  one folder EAR project ?

                  Just make sure the classes are in the classpath and META-INF/persistence.xml is there (otherwise JPA does not know which entities to load)

                  • 36. Re: Hibernate Configurations problem
                    asookazian

                     

                    "max.andersen@jboss.com" wrote:
                    one folder EAR project ?


                    that means one high-level folder per project rather than 4 high level folders (maxTest, maxTest-test, maxTest-ear, maxTest-ejb).

                    like I said before, when you run 'seam setup' and then 'seam create-project', the project skeleton generated is based on a single high-level folder design rather than the 4 WTP-style design...

                    • 37. Re: Hibernate Configurations problem
                      maxandersen

                      Yes, and as said before - just make sure the classpath has the entities and persistence.xml; hibernate console configuration/editor does not need anything else.

                      • 38. Re: Hibernate Configurations problem
                        asookazian

                        no matter what I add to the classpath as a folder that contains the entity .class files for my project, it still doesn't work.

                        attempting to reproduce with booking example (which is similar to my project structure).

                        • 39. Re: Hibernate Configurations problem
                          asookazian

                          Ok, so now these are the errors I'm getting with the booking project:

                          eclipse.buildId=M20090107-0800
                          java.version=1.5.0_17
                          java.vendor=Sun Microsystems Inc.
                          BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
                          Command-line arguments: -os win32 -ws win32 -arch x86
                          
                          
                          Error
                          Wed Mar 11 13:32:20 PDT 2009
                          org.hibernate.exception.JDBCConnectionException: Getting database metadata
                          
                          org.hibernate.exception.JDBCConnectionException: Getting database metadata
                          at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:74)
                          at org.hibernate.cfg.reveng.dialect.AbstractMetaDataDialect.getMetaData(AbstractMetaDataDialect.java:64)
                          at org.hibernate.cfg.reveng.dialect.AbstractMetaDataDialect.caseForSearch(AbstractMetaDataDialect.java:163)
                          at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect.getTables(JDBCMetaDataDialect.java:22)
                          at org.hibernate.cfg.reveng.JDBCReader.processTables(JDBCReader.java:476)
                          at org.hibernate.cfg.reveng.JDBCReader.readDatabaseSchema(JDBCReader.java:74)
                          at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter$2.execute(LazyDatabaseSchemaWorkbenchAdapter.java:114)
                          at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:64)
                          at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.readDatabaseSchema(LazyDatabaseSchemaWorkbenchAdapter.java:105)
                          at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.getChildren(LazyDatabaseSchemaWorkbenchAdapter.java:61)
                          at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:105)
                          at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:234)
                          at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
                          Caused by: java.sql.SQLException: The database is already in use by another process: org.hsqldb.persist.NIOLockFile@b14f5d0b[file =C:\java\jbdevstudio-2.0.0.CR2\jboss-eap\jboss-as\server\default\data\hypersonic.lck, exists=true, locked=false, valid=false, fl =null]: java.lang.Exception: java.io.IOException: The process cannot access the file because another process has locked a portion of the file : C:\java\jbdevstudio-2.0.0.CR2\jboss-eap\jboss-as\server\default\data\hypersonic.lck
                          at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
                          at org.hsqldb.jdbc.jdbcConnection.<init>(Unknown Source)
                          at org.hsqldb.jdbcDriver.getConnection(Unknown Source)
                          at org.hsqldb.jdbcDriver.connect(Unknown Source)
                          at org.hibernate.console.FakeDelegatingDriver.connect(FakeDelegatingDriver.java:40)
                          at java.sql.DriverManager.getConnection(DriverManager.java:525)
                          at java.sql.DriverManager.getConnection(DriverManager.java:140)
                          at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110)
                          at org.hibernate.cfg.reveng.dialect.AbstractMetaDataDialect.getConnection(AbstractMetaDataDialect.java:122)
                          at org.hibernate.cfg.reveng.dialect.AbstractMetaDataDialect.getMetaData(AbstractMetaDataDialect.java:61)
                          ... 11 more
                          


                          Previously, I had started the HSQL manager from the web console after I started JBoss AS from the IDE. Subsequently, I restarted JBDS, JBoss is not running. I still am getting that lock error. I have no clue what is locking it as I have only one JVM running (java.exe) as per my windows task mgr.

                          NOTE: The hibernate-console.properties did not exist when I imported the booking project as a java project. It created a blank hibernate.properties for me so then I had to go copy the contents and tweak settings from my other project. This properties file should not be blank, at minimum it should prompt the user to fill out a form in a wizard or copy it from somewhere. I was getting "Could not locate TransactionManager" error but now that's fixed.

                          • 40. Re: Hibernate Configurations problem
                            asookazian

                            I do see Booking, Hotel, and User under configuration and session factory. I don't see anything under Database due to the error...

                            • 41. Re: Hibernate Configurations problem
                              asookazian

                              Ok, so I tried to open the locked file using TextPad and it failed due to the lock. I closed JBDS and then I opened the file.

                              So now what?

                              • 42. Re: Hibernate Configurations problem
                                asookazian

                                what does this mean?

                                eclipse.buildId=M20090107-0800
                                java.version=1.5.0_17
                                java.vendor=Sun Microsystems Inc.
                                BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
                                Command-line arguments: -os win32 -ws win32 -arch x86
                                
                                
                                Error
                                Wed Mar 11 13:51:46 PDT 2009
                                An exception occurred during console notification
                                
                                org.eclipse.swt.SWTException: Device is disposed
                                at org.eclipse.swt.SWT.error(SWT.java:3777)
                                at org.eclipse.swt.SWT.error(SWT.java:3695)
                                at org.eclipse.swt.SWT.error(SWT.java:3666)
                                at org.eclipse.swt.widgets.Display.error(Display.java:1180)
                                at org.eclipse.swt.widgets.Display.asyncExec(Display.java:648)
                                at org.eclipse.ui.internal.console.ConsoleDropDownAction.consolesRemoved(ConsoleDropDownAction.java:150)
                                at org.eclipse.ui.internal.console.ConsoleManager$ConsoleNotifier.run(ConsoleManager.java:154)
                                at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
                                at org.eclipse.ui.internal.console.ConsoleManager$ConsoleNotifier.notify(ConsoleManager.java:174)
                                at org.eclipse.ui.internal.console.ConsoleManager.fireUpdate(ConsoleManager.java:262)
                                at org.eclipse.ui.internal.console.ConsoleManager.removeConsoles(ConsoleManager.java:244)
                                at org.eclipse.ui.console.ConsolePlugin.stop(ConsolePlugin.java:175)
                                at org.eclipse.osgi.framework.internal.core.BundleContextImpl$3.run(BundleContextImpl.java:1050)
                                at java.security.AccessController.doPrivileged(Native Method)
                                at org.eclipse.osgi.framework.internal.core.BundleContextImpl.stop(BundleContextImpl.java:1046)
                                at org.eclipse.osgi.framework.internal.core.BundleHost.stopWorker(BundleHost.java:457)
                                at org.eclipse.osgi.framework.internal.core.AbstractBundle.suspend(AbstractBundle.java:531)
                                at org.eclipse.osgi.framework.internal.core.Framework.suspendBundle(Framework.java:1104)
                                at org.eclipse.osgi.framework.internal.core.StartLevelManager.decFWSL(StartLevelManager.java:655)
                                at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:312)
                                at org.eclipse.osgi.framework.internal.core.StartLevelManager.shutdown(StartLevelManager.java:257)
                                at org.eclipse.osgi.framework.internal.core.SystemBundle.suspend(SystemBundle.java:236)
                                at org.eclipse.osgi.framework.internal.core.Framework.shutdown(Framework.java:678)
                                at org.eclipse.osgi.framework.internal.core.Framework.close(Framework.java:576)
                                at org.eclipse.osgi.framework.internal.core.OSGi.close(OSGi.java:41)
                                at org.eclipse.core.runtime.adaptor.EclipseStarter.shutdown(EclipseStarter.java:424)
                                at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:200)
                                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                at java.lang.reflect.Method.invoke(Method.java:585)
                                at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
                                at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
                                at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
                                
                                


                                • 43. Re: Hibernate Configurations problem
                                  maxandersen

                                  if you are using hsql in-memory then only one process can access the database at one time.

                                  you should at least use a hsql server if you want concurrent access.

                                  • 44. Re: Hibernate Configurations problem
                                    maxandersen

                                     

                                    "asookazian" wrote:
                                    what does this mean?


                                    That eclipse called some action on an ui where the widget were already disposed.

                                    What did you do to get that error ?