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

         

        "max.andersen@jboss.com" wrote:
        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.


        Ok, I *finally* ran two HQL queries in the HQL editor successfully for the booking project using HSQLDB: "from User" and "from Hotel".

        I'm not sure how/why that lock error was happening but now I actually am able to run simultaneous HQL queries from JBDS and from HSQL DB mgr swing app.

        So now I know that I should be able to get my seam-gen'd project to work with HQL Editor as well b/c the booking project has the same project skeleton/structure.

        I had to learn how HSQLDB works and load/creates tables on startup, etc. but this was a good POC success for my scenario...

        • 46. Re: Hibernate Configurations problem
          asookazian

           

          "max.andersen@jboss.com" wrote:
          "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 ?


          Sorry, don't have a clue. If it happens again, I'll update the thread. As a guess, it's due to the fact that I have four different configurations currently in the Hibernate config view and was messing around with a lot of different settings, etc. Plus I was switching back and forth from Seam and Hibernate perspsectives quite a lot.

          • 47. Re: Hibernate Configurations problem
            asookazian

            I'm still getting the "QuerySyntaxException: ApplicationRole is not mapped" error.

            I just compared the booking project with mine to see if there are any notable differences in terms of impacting the classpath. I noticed that in the Java build path properties, the default output folder is: booking/exploded-archives/jboss-seam-booking.jar for the booking project. I configured mine similarly.

            The funny thing is when I do a CTRL-SHFT-T to open a type, when I search for "Hotel" I see two results, one the source .java file and one from booking/dist/jboss-seam-booking.jar.

            When I do the same procedure (i.e. open type) for my ApplicationRole class, I see only the source file, even though it's in this jar: BETS/exploded-archives/BETS.jar.

            For my BETS hibernate config, Configuration is empty, Session Factory is empty, and the tables are visible in the Database section.

            I'm using default classpath for both classpath config in hibernate configurations.

            Not sure what else to try at this point. I don't understand what else I can do to force Hibernate Tools to see the entity classes. I just added the dist folder to the classpath and that didn't help.

            • 48. Re: Hibernate Configurations problem
              asookazian

              YES it works. I had to do an 'ant deploy' so the packaged jar files would be copied to the dist folder. It doesn't work with exploded jar files, that was the problem!

              • 49. Re: Hibernate Configurations problem
                maxandersen

                My guess is more that when you did ant deploy the META-INF/persistence.xml showed up in the right place.

                • 50. Re: Hibernate Configurations problem
                  asookazian

                   

                  "max.andersen@jboss.com" wrote:
                  My guess is more that when you did ant deploy the META-INF/persistence.xml showed up in the right place.


                  well I just tested your hypothesis and you are correct. It works with explode or deploy as long as persistence.xml is located here:

                  BETS\exploded-archives\BETS.jar\META-INF

                  and you just use the default classpath in the edit launch config properties classpath tab.

                  not sure what happened yesterday that it was missing or unable to locate...


                  • 51. Re: Hibernate Configurations problem
                    asookazian

                    This doc needs to be updated to point out in bold or as a note that your project must be built (i.e. explode/deploy) so that the persistence.xml and .class files for the entity classes are available in the classpath.

                    http://docs.jboss.org/tools/3.0.0.CR2/en/hibernatetools/html_single/index.html#console_conf

                    • 52. Re: Hibernate Configurations problem
                      asookazian

                      BTW, I'm really liking the auto-complete (intelli-sense?) feature in the HQL editor.

                      • 53. Re: Hibernate Configurations problem
                        maxandersen

                        I thought the first line that says "what configuration files, including which classpath are needed to load the POJO's, JDBC drivers etc." says it pretty clear ?

                        • 54. Re: Hibernate Configurations problem
                          asookazian

                          well I guess you're right given that classpath refers to .class files (bytecode) and not source .java files.

                          but it doesn't reference "persistence.xml" in that intro line, that should probly be there...

                          • 55. Re: Hibernate Configurations problem
                            maxandersen

                            configuration files = persistence.xml ;)

                            Anyway - I will remember it the next time I do rev on the docs to make it explicit.

                            • 56. Re: Hibernate Configurations problem
                              asookazian

                              I am experiencing the same problem again for a different project/workspace in JBDS 2.0.0.CR2.

                              org.hibernate.hql.ast.QuerySyntaxException: EquipmentRecovery is not mapped [select er.icomsSiteId from EquipmentRecovery er]


                              I understand that this is a classpath problem (Hibernate Tools can not find my .class files for my entity classes in the classpath). I have tried the 'ant deploy' trick from earlier in this thread, I have tried using exploded-archives rather than bin for default output folder, I have tried adding both bin and exploded-archives (one at a time of course) to the classpath in User Entries for the hibernate configuration. Nothing works.

                              I currently have just done 'ant deploy' so there are EAR, JAR, WAR files in my foo/dist folder. I tried that as well in the classpath.

                              under User Entries (in edit launch config properties --> classpath tab) I have:

                              foo (default classpath)
                              resources -\foo\
                              foo.jar - \foo\exploded-archives\

                              What do I need to do to get Hibernate tools to see my entity classes???

                              yes, project --> build auto is checked.

                              Where is the Hibernate console edit configuration text file saved so I can post it to this thread?

                              • 57. Re: Hibernate Configurations problem
                                asookazian

                                I am seeing 7 errors in the problems tab all related to * is not mapped. Even after I changed the default output folder back to foo/bin. Not sure what's going on...

                                • 58. Re: Hibernate Configurations problem
                                  asookazian

                                  [CODE]Contributor org.jboss.ide.eclipse.as.ui.views.JBossServerView cannot be created.

                                  An exception stack trace is not available.[/CODE]

                                  [CODE]Problems occurred when invoking code from plug-in: "org.eclipse.ui.console".[/CODE]

                                  [CODE]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)

                                  [/CODE]

                                  [CODE]An exception occurred during console notification[/CODE]

                                  [CODE]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)
                                  [/CODE]

                                  • 59. Re: Hibernate Configurations problem
                                    asookazian

                                    in Java build path --> source tab, what is the benefit of using "allow output folders for source folders" and should I try that now?