6 Replies Latest reply on Nov 11, 2005 3:11 PM by drapierwim

    Want to keep my data in the HSQLDB

    drapierwim

      What should I do to keep the bookings in the DB and still have them when JBoss restarts. I also want to make a connection with an external DB viewer so the HSQLDB-standalone mode won't be good I've also read that the preferred way to run HSQLD is in server mode can this be done?

        • 1. Re: Want to keep my data in the HSQLDB
          patrick_ibg

          You need to set up HSQLDB to run standalone (i.e., not within the JBoss JVM)... check the HSQLDB website. Apart from that, you need to configure hibernate to not create-drop your tables everytime your start/stop your application. (I think in the HotelBooking example this setting is specified via persistence.xml.)

          • 2. Re: Want to keep my data in the HSQLDB
            drapierwim

             

            "patrick_ibg" wrote:
            You need to set up HSQLDB to run standalone (i.e., not within the JBoss JVM)


            Is there a way to run it in JBoss?

            • 3. Re: Want to keep my data in the HSQLDB

              Look at hsqldb-ds.xml. It contains alternative mbean definitions that let you make external connections to hypersonic.

              • 4. Re: Want to keep my data in the HSQLDB
                drapierwim

                I've changed the hsqldb.xml to use a tcp connection, so I can also connect to the DB with iReport all works fine except for my tests, my complete project layout is based on the booking example and this is the error I get when running my test.


                [RunInfo] Adding method selector: org.testng.internal.XmlMethodSelector@1c282a1 priority: 10
                [TestMethodWorker 1] 6237616 ADDING [TestClass class ivvo.drapier.logic.test.BookingServiceTest] TO BEFORE MAP
                FAILED: org.jboss.seam.mock.SeamTest.init()
                java.lang.RuntimeException: java.lang.RuntimeException: The xml file:/C:/Documents%20and%20Settings/Wim/Jworkspace/AccountingManager/bin/META-INF/jboss-beans.xml is not well formed!
                at org.jboss.ejb3.embedded.EJB3StandaloneBootstrap.deployXmlResource(EJB3StandaloneBootstrap.java:64)
                at org.jboss.seam.core.Ejb.deploy(Ejb.java:59)
                at org.jboss.seam.core.Ejb.startup(Ejb.java:41)
                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.jboss.seam.util.Reflections.invoke(Reflections.java:13)
                at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:32)
                at org.jboss.seam.Component.callComponentMethod(Component.java:932)
                at org.jboss.seam.Component.callCreateMethod(Component.java:920)
                at org.jboss.seam.Component.newInstance(Component.java:909)
                at org.jboss.seam.Component.getInstance(Component.java:857)
                at org.jboss.seam.contexts.Lifecycle.startup(Lifecycle.java:68)
                at org.jboss.seam.contexts.Lifecycle.endInitialization(Lifecycle.java:48)
                at org.jboss.seam.init.Initialization.init(Initialization.java:62)
                at org.jboss.seam.mock.SeamTest.init(SeamTest.java:158)
                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.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:352)
                at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:282)
                at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:151)
                at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:78)
                at org.testng.TestRunner.privateRun(TestRunner.java:620)
                at org.testng.TestRunner.run(TestRunner.java:503)
                at org.testng.SuiteRunner.privateRun(SuiteRunner.java:200)
                at org.testng.SuiteRunner.run(SuiteRunner.java:126)
                at org.testng.eclipse.runner.RemoteTestNG.run(RemoteTestNG.java:99)
                at org.testng.eclipse.runner.RemoteTestNG.main(RemoteTestNG.java:138)
                Caused by: java.lang.RuntimeException: The xml file:/C:/Documents%20and%20Settings/Wim/Jworkspace/AccountingManager/bin/META-INF/jboss-beans.xml is not well formed!
                at org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer.deploy(BeanXMLDeployer.java:65)
                at org.jboss.ejb3.embedded.EJB3StandaloneBootstrap.deployXmlResource(EJB3StandaloneBootstrap.java:59)
                ... 30 more

                FAILED: ivvo.drapier.logic.test.BookingServiceTest.testJournalPost()
                java.lang.NullPointerException
                at org.jboss.seam.mock.SeamTest$Script.run(SeamTest.java:83)
                at ivvo.drapier.logic.test.BookingServiceTest.testJournalPost(BookingServiceTest.java:45)
                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.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:352)
                at org.testng.internal.Invoker.invokeMethod(Invoker.java:343)
                at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:509)
                at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:90)
                at org.testng.TestRunner.privateRun(TestRunner.java:620)
                at org.testng.TestRunner.run(TestRunner.java:503)
                at org.testng.SuiteRunner.privateRun(SuiteRunner.java:200)
                at org.testng.SuiteRunner.run(SuiteRunner.java:126)
                at org.testng.eclipse.runner.RemoteTestNG.run(RemoteTestNG.java:99)
                at org.testng.eclipse.runner.RemoteTestNG.main(RemoteTestNG.java:138)

                SKIPPED: begin
                SKIPPED: end
                SKIPPED: cleanup

                ===============================================
                ivvo.drapier.logic.test.BookingServiceTest
                Tests run: 5, Failures: 2, Skips: 3
                ===============================================

                Creating C:\Documents and Settings\Wim\Jworkspace\AccountingManager\testng-failures.xml

                ===============================================
                ivvo.drapier.logic.test.BookingServiceTest
                Total tests run: 5, Failures: 2, Skips: 3
                ===============================================



                I also have to mention when I deploy my app and leave out the booking-ds.xml and jboss-beans.xml

                • 5. Re: Want to keep my data in the HSQLDB
                  drapierwim

                  Same output as in previuos post but with log4j treshold to DEBUG

                  [RunInfo] Adding method selector: org.testng.internal.XmlMethodSelector@1c282a1 priority: 10
                  INFO 11-11 20:13:14,296 (Initialization.java:init:58) -initializing Seam
                  INFO 11-11 20:13:14,366 (Component.java:<init>:150) -Component: org.jboss.seam.core.init, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.Init
                  DEBUG 11-11 20:13:14,496 (Component.java:initInitializers:239) -org.jboss.seam.core.init.componentClasses=org.jboss.seam.core.Ejb
                  DEBUG 11-11 20:13:14,496 (Component.java:initInitializers:239) -org.jboss.seam.core.init.managedPersistenceContexts=bookingDatabase
                  INFO 11-11 20:13:14,826 (Component.java:<init>:150) -Component: org.jboss.seam.core.manager, scope: EVENT, type: JAVA_BEAN, class: org.jboss.seam.core.Manager
                  INFO 11-11 20:13:14,876 (Component.java:<init>:150) -Component: facesContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.FacesContext
                  INFO 11-11 20:13:14,907 (Component.java:<init>:150) -Component: eventContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.EventContext
                  INFO 11-11 20:13:14,937 (Component.java:<init>:150) -Component: sessionContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.SessionContext
                  INFO 11-11 20:13:14,957 (Component.java:<init>:150) -Component: statelessContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.StatelessContext
                  INFO 11-11 20:13:14,997 (Component.java:<init>:150) -Component: conversationContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.ConversationContext
                  INFO 11-11 20:13:15,007 (Component.java:<init>:150) -Component: applicationContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.ApplicationContext
                  INFO 11-11 20:13:15,157 (Component.java:<init>:150) -Component: businessProcessContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.BusinessProcessContext
                  DEBUG 11-11 20:13:15,167 (Contexts.java:lookupInStatefulContexts:149) -found in application context: org.jboss.seam.core.init.component
                  DEBUG 11-11 20:13:15,177 (Component.java:newInstance:481) -instantiating Seam component: org.jboss.seam.core.init
                  DEBUG 11-11 20:13:15,177 (Contexts.java:lookupInStatefulContexts:149) -found in application context: org.jboss.seam.core.init.component
                  INFO 11-11 20:13:15,177 (Component.java:<init>:150) -Component: org.jboss.seam.core.ejb, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.Ejb
                  INFO 11-11 20:13:15,207 (Component.java:<init>:150) -Component: bookingDatabase, scope: CONVERSATION, type: JAVA_BEAN, class: org.jboss.seam.core.ManagedPersistenceContext
                  INFO 11-11 20:13:15,227 (Scanner.java:getClasses:72) -scanning: C:\Documents%20and%20Settings\Wim\Jworkspace\AccountingManager\bin
                  DEBUG 11-11 20:13:15,227 (Scanner.java:handleArchive:90) -archive: C:\Documents%20and%20Settings\Wim\Jworkspace\AccountingManager\bin
                  DEBUG 11-11 20:13:15,227 (Contexts.java:lookupInStatefulContexts:149) -found in application context: org.jboss.seam.core.ejb.component
                  DEBUG 11-11 20:13:15,237 (Component.java:newInstance:481) -instantiating Seam component: org.jboss.seam.core.ejb
                  INFO 11-11 20:13:15,237 (Ejb.java:startup:39) -starting the embedded EJB container
                  DEBUG 11-11 20:13:15,287 (KernelFactory.java:assembleNewKernel:68) -Starting JBoss Kernel construction...
                  DEBUG 11-11 20:13:15,487 (KernelFactory.java:assembleNewKernel:94) -Completed JBoss Kernel construction. Duration: 200 milliseconds
                  WARN 11-11 20:13:16,409 (XsdBinder.java:bindGlobalGroup:1097) -NOT HANDLED WILDCARD IN GLOBAL MODEL GROUP
                  INFO 11-11 20:13:17,791 (LocalTxDataSource.java:bindConnectionFactory:102) -Bound datasource to JNDI name 'java:/DefaultDS'
                  INFO 11-11 20:13:18,492 (LocalTxDataSource.java:bindConnectionFactory:102) -Bound datasource to JNDI name 'java:/accountingDatasource'
                  INFO 11-11 20:13:18,552 (JaccHelper.java:initialiseJacc:46) -Initialising JACC Context for deployment: bin
                  [TestMethodWorker 1] 2372025 ADDING [TestClass class ivvo.drapier.logic.test.BookingServiceTest] TO BEFORE MAP
                  FAILED: org.jboss.seam.mock.SeamTest.init()
                  java.lang.RuntimeException: java.util.zip.ZipException: Het systeem kan het opgegeven pad niet vinden
                   at org.jboss.util.file.JarArchiveBrowser.<init>(JarArchiveBrowser.java:40)
                   at org.jboss.util.file.ArchiveBrowser.getBrowser(ArchiveBrowser.java:37)
                   at org.jboss.ejb3.Ejb3Deployment.deployUrl(Ejb3Deployment.java:297)
                   at org.jboss.ejb3.Ejb3Deployment.deploy(Ejb3Deployment.java:275)
                   at org.jboss.ejb3.Ejb3Deployment.create(Ejb3Deployment.java:262)
                   at org.jboss.ejb3.embedded.EJB3StandaloneDeployer.create(EJB3StandaloneDeployer.java:381)
                   at org.jboss.seam.core.Ejb.startup(Ejb.java:51)
                   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.jboss.seam.util.Reflections.invoke(Reflections.java:13)
                   at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:32)
                   at org.jboss.seam.Component.callComponentMethod(Component.java:932)
                   at org.jboss.seam.Component.callCreateMethod(Component.java:920)
                   at org.jboss.seam.Component.newInstance(Component.java:909)
                   at org.jboss.seam.Component.getInstance(Component.java:857)
                   at org.jboss.seam.contexts.Lifecycle.startup(Lifecycle.java:68)
                   at org.jboss.seam.contexts.Lifecycle.endInitialization(Lifecycle.java:48)
                   at org.jboss.seam.init.Initialization.init(Initialization.java:62)
                   at org.jboss.seam.mock.SeamTest.init(SeamTest.java:158)
                   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.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:352)
                   at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:282)
                   at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:151)
                   at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:78)
                   at org.testng.TestRunner.privateRun(TestRunner.java:620)
                   at org.testng.TestRunner.run(TestRunner.java:503)
                   at org.testng.SuiteRunner.privateRun(SuiteRunner.java:200)
                   at org.testng.SuiteRunner.run(SuiteRunner.java:126)
                   at org.testng.eclipse.runner.RemoteTestNG.run(RemoteTestNG.java:99)
                   at org.testng.eclipse.runner.RemoteTestNG.main(RemoteTestNG.java:138)
                  Caused by: java.util.zip.ZipException: Het systeem kan het opgegeven pad niet vinden
                   at java.util.zip.ZipFile.open(Native Method)
                   at java.util.zip.ZipFile.<init>(ZipFile.java:203)
                   at java.util.zip.ZipFile.<init>(ZipFile.java:234)
                   at org.jboss.util.file.JarArchiveBrowser.<init>(JarArchiveBrowser.java:35)
                   ... 34 more
                  
                  FAILED: ivvo.drapier.logic.test.BookingServiceTest.testJournalPost()
                  java.lang.NullPointerException
                   at org.jboss.seam.mock.SeamTest$Script.run(SeamTest.java:83)
                   at ivvo.drapier.logic.test.BookingServiceTest.testJournalPost(BookingServiceTest.java:45)
                   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.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:352)
                   at org.testng.internal.Invoker.invokeMethod(Invoker.java:343)
                   at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:509)
                   at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:90)
                   at org.testng.TestRunner.privateRun(TestRunner.java:620)
                   at org.testng.TestRunner.run(TestRunner.java:503)
                   at org.testng.SuiteRunner.privateRun(SuiteRunner.java:200)
                   at org.testng.SuiteRunner.run(SuiteRunner.java:126)
                   at org.testng.eclipse.runner.RemoteTestNG.run(RemoteTestNG.java:99)
                   at org.testng.eclipse.runner.RemoteTestNG.main(RemoteTestNG.java:138)
                  
                  SKIPPED: begin
                  SKIPPED: end
                  SKIPPED: cleanup
                  
                  ===============================================
                   ivvo.drapier.logic.test.BookingServiceTest
                   Tests run: 5, Failures: 2, Skips: 3
                  ===============================================
                  
                  Creating C:\Documents and Settings\Wim\Jworkspace\AccountingManager\testng-failures.xml
                  
                  ===============================================
                  ivvo.drapier.logic.test.BookingServiceTest
                  Total tests run: 5, Failures: 2, Skips: 3
                  ===============================================
                  
                  


                  • 6. Re: Want to keep my data in the HSQLDB
                    drapierwim

                    I found my problem seems like I will never learn.

                    The reason was, I downloaded the latest eclipse milestone build and had setup a new workspace containing empty spaces that was not a good idea for running my tests with testNG