Announcement Announcement Module
Collapse
No announcement yet.
ROO: test doesn't work with Oracle DB Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • ROO: test doesn't work with Oracle DB

    Hi,

    I try to create my test application with ROO.
    When I use HYPERSONIC_IN_MEMORY DB - application work right.
    When I use ORACLE DB - application doesn't work at all.
    I can't view and insert rows.
    I use next scripts to create my example:

    Example HYPERSONIC_IN_MEMORY DB:
    Code:
    project --topLevelPackage com.springsource.roo.accHyp
    persistence setup --provider HIBERNATE --database HYPERSONIC_IN_MEMORY 
    
    entity --class ~.domain.Account --testAutomatically
    field number --fieldName branchid --notNull --type java.lang.Integer
    field string --fieldName acc --notNull --sizeMin 6
    
    perform tests
    controller all --package ~.web
    perform eclipse
    exit
    Example Oracle DB:
    Code:
    project --topLevelPackage com.springsource.roo.accOra
    persistence setup --provider HIBERNATE --database ORACLE --databaseName zoo --userName 17001 --password 1
    
    entity --class ~.domain.Account --testAutomatically
    field number --fieldName branchid --notNull --type java.lang.Integer
    field string --fieldName acc --notNull --sizeMin 6
    
    perform tests
    controller all --package ~.web
    perform eclipse
    exit

    I use
    Spring Roo 1.0.2.RELEASE [rev 638]
    Spring Roo 1.1.0.M1 [rev 3a0b8a3]
    with practilally the same results.

    How to make my oracle application works???

    Paul

  • #2
    Could you post the exception you are getting?

    My first guess is the primary key generation. Oracle uses sequences which is different than the identity-type keys on some other databases. So maybe the generated ID needs a different generation strategy. Also, do you have create rights on all types of objects in your oracle schema, including sequence?

    Comment


    • #3
      -Internal Error
      Internal Error
      Sorry, we encountered an internal error.


      Details
      -Exception Message
      No entity found for query

      -Exception Stack Trace
      org.hibernate.ejb.QueryImpl.getSingleResult(QueryI mpl.java:270)
      com.springsource.roo.accora.domain.Account_Roo_Ent ity.ajc$interMethod$com_springsource_roo_accora_do main_Account_Roo_Entity$com_springsource_roo_accor a_domain_Account$countAccounts(Account_Roo_Entity. aj:85)
      com.springsource.roo.accora.domain.Account.countAc counts(Account.java:1)
      com.springsource.roo.accora.domain.Account_Roo_Ent ity.ajc$interMethodDispatch1$com_springsource_roo_ accora_domain_Account_Roo_Entity$com_springsource_ roo_accora_domain_Account$countAccounts(Account_Ro o_Entity.aj)
      com.springsource.roo.accora.web.AccountController_ Roo_Controller.ajc$interMethod$com_springsource_ro o_accora_web_AccountController_Roo_Controller$com_ springsource_roo_accora_web_AccountController$list (AccountController_Roo_Controller.aj:49)
      com.springsource.roo.accora.web.AccountController. list(AccountController.java:1)
      sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
      sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
      sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
      java.lang.reflect.Method.invoke(Unknown Source)
      org.springframework.web.bind.annotation.support.Ha ndlerMethodInvoker.invokeHandlerMethod(HandlerMeth odInvoker.java:174)
      org.springframework.web.servlet.mvc.annotation.Ann otationMethodHandlerAdapter.invokeHandlerMethod(An notationMethodHandlerAdapter.java:421)
      org.springframework.web.servlet.mvc.annotation.Ann otationMethodHandlerAdapter.handle(AnnotationMetho dHandlerAdapter.java:409)
      org.springframework.web.servlet.DispatcherServlet. doDispatch(DispatcherServlet.java:771)
      org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:716)
      org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:644)
      org.springframework.web.servlet.FrameworkServlet.d oGet(FrameworkServlet.java:549)
      javax.servlet.http.HttpServlet.service(HttpServlet .java:617)
      javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
      org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:290)
      org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
      org.apache.catalina.core.ApplicationDispatcher.inv oke(ApplicationDispatcher.java:646)
      org.apache.catalina.core.ApplicationDispatcher.pro cessRequest(ApplicationDispatcher.java:436)
      org.apache.catalina.core.ApplicationDispatcher.doF orward(ApplicationDispatcher.java:374)
      org.apache.catalina.core.ApplicationDispatcher.for ward(ApplicationDispatcher.java:302)
      org.tuckey.web.filters.urlrewrite.NormalRewrittenU rl.doRewrite(NormalRewrittenUrl.java:195)
      org.tuckey.web.filters.urlrewrite.RuleChain.handle Rewrite(RuleChain.java:159)
      org.tuckey.web.filters.urlrewrite.RuleChain.doRule s(RuleChain.java:141)
      org.tuckey.web.filters.urlrewrite.UrlRewriter.proc essRequest(UrlRewriter.java:90)
      org.tuckey.web.filters.urlrewrite.UrlRewriteFilter .doFilter(UrlRewriteFilter.java:417)
      org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:235)
      org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
      org.springframework.web.filter.HiddenHttpMethodFil ter.doFilterInternal(HiddenHttpMethodFilter.java:7 7)
      org.springframework.web.filter.OncePerRequestFilte r.doFilter(OncePerRequestFilter.java:76)
      org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:235)
      org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
      org.springframework.web.filter.CharacterEncodingFi lter.doFilterInternal(CharacterEncodingFilter.java :88)
      org.springframework.web.filter.OncePerRequestFilte r.doFilter(OncePerRequestFilter.java:76)
      org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:235)
      org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
      org.springframework.orm.jpa.support.OpenEntityMana gerInViewFilter.doFilterInternal(OpenEntityManager InViewFilter.java:113)
      org.springframework.web.filter.OncePerRequestFilte r.doFilter(OncePerRequestFilter.java:76)
      org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:235)
      org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
      org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:233)
      org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:191)
      com.springsource.insight.collection.tcserver.reque st.HttpRequestOperationCollectionValve.invoke(Http RequestOperationCollectionValve.java:80)
      org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:128)
      org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102)
      org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109)
      org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:293)
      org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:849)
      org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:583)
      org.apache.tomcat.util.net.JIoEndpoint$SocketProce ssor.run(JIoEndpoint.java:379)
      java.util.concurrent.ThreadPoolExecutor$Worker.run Task(Unknown Source)
      java.util.concurrent.ThreadPoolExecutor$Worker.run (Unknown Source)
      java.lang.Thread.run(Unknown Source)

      Home | Language: | Theme: standard | alt

      Comment


      • #4
        Do the tables look OK in the database (ie that Hibernate created)? Did the "create" use case work on the web (I noticed this error is with the list use case)?

        It's difficult for us to help with these bugs given they related to a commercial database. Hopefully someone using Oracle can assist.

        Comment


        • #5
          Originally posted by Ben Alex View Post
          Do the tables look OK in the database (ie that Hibernate created)? Did the "create" use case work on the web (I noticed this error is with the list use case)?
          "Create" works fine - table ACCOUNT and sequence HIBERNATE_SEQUENCE was created in database automatically by Hibernate.

          Originally posted by Ben Alex View Post
          It's difficult for us to help with these bugs given they related to a commercial database. Hopefully someone using Oracle can assist.
          You can freelly download Oracle XE from here
          http://www.oracle.com/technology/sof.../xe/index.html
          and try my script:
          Code:
          project --topLevelPackage com.springsource.roo.accOra
          persistence setup --provider HIBERNATE --database ORACLE --userName scott --password tiger
          database properties set --key database.url --value jdbc:oracle:thin:@beta:1521:zoo
          database properties list
          
          entity --class ~.domain.Account --testAutomatically
          field number --fieldName branchid --notNull --type java.lang.Integer
          field string --fieldName acc --notNull --sizeMin 6
          
          logging setup --level DEBUG
          perform tests
          
          controller all --package ~.web
          perform eclipse
          exit
          I get errors when I execute "perform tests" command - see attached files.

          Comment


          • #6
            Normally we wouldn't be able to help with this, but given Alan is about to start on database reverse engineering anyway, he'll need to mess around with Oracle to make sure it works properly. So if you log a bug at https://jira.springsource.org/browse/ROO we can take a look into this for you as part of that. Please include your script and link where we can download Oracle. It's only 220 Mb, which is nice. Last time I looked it took 3 CD ISO images. :-)

            Comment


            • #7
              Originally posted by Ben Alex View Post
              Normally we wouldn't be able to help with this, but given Alan is about to start on database reverse engineering anyway, he'll need to mess around with Oracle to make sure it works properly. So if you log a bug at https://jira.springsource.org/browse/ROO we can take a look into this for you as part of that. Please include your script and link where we can download Oracle. It's only 220 Mb, which is nice. Last time I looked it took 3 CD ISO images. :-)
              I create a bug issue
              https://jira.springsource.org/browse/ROO-900
              If I can be of any help - feel free to contact

              Comment


              • #8
                There was a bug relating to the unit tests failing, but this occurred with other databases as well - see ROO-946. After this fix is applied I can't reproduce the problem with Oracle in ROO-900, as the unit tests pass OK and the generated web app also works with my local instance of Oracle XE (Western European).
                Last edited by Alan Stewart; Jun 2nd, 2010, 02:00 AM.

                Comment


                • #9
                  Just to verify Alan's fix, as some people still seem to have problems with Oracle DB examples.

                  * With old Roo Version (1.1.0.M2 [rev 2f0bcd0]) it didnt work for me.
                  * I updated to Roo Version (1.1.0.M2 [rev d126db9]) which includes Alan's fix, and now everything works fine. Tests and application run with Oracle XE :-)

                  Thanks Alan!

                  Comment


                  • #10
                    Originally posted by Nils Schmidt View Post
                    Just to verify Alan's fix, as some people still seem to have problems with Oracle DB examples.

                    * With old Roo Version (1.1.0.M2 [rev 2f0bcd0]) it didnt work for me.
                    * I updated to Roo Version (1.1.0.M2 [rev d126db9]) which includes Alan's fix, and now everything works fine. Tests and application run with Oracle XE :-)

                    Thanks Alan!
                    I can't find next commands for ROO 1.1.0.M2:
                    - logging setup --level DEBUG
                    - controller all --package ~.web

                    What is the right script for creating simple application for Oracle?

                    Comment


                    • #11
                      I have no problems in finding the two commands. Did all the pervious commands executed correctly?

                      I used the same script as posted above, but I did not include "perform test" and "perform eclipse" as I usually run them directly from command line. Anyways this should not make a difference.

                      Comment


                      • #12
                        Originally posted by Nils Schmidt View Post
                        I have no problems in finding the two commands. Did all the pervious commands executed correctly?

                        I used the same script as posted above, but I did not include "perform test" and "perform eclipse" as I usually run them directly from command line. Anyways this should not make a difference.
                        Please, give me your "command line". Because I did "perform eclipse" and run application from STS

                        Comment


                        • #13
                          Originally posted by krimple View Post
                          Could you post the exception you are getting?

                          My first guess is the primary key generation. Oracle uses sequences which is different than the identity-type keys on some other databases. So maybe the generated ID needs a different generation strategy. Also, do you have create rights on all types of objects in your oracle schema, including sequence?
                          If we want the front end to create the oracle database objects, then the minimum privileges that the oracle user requires are:
                          connect, create table and create sequence

                          I had the same sequence error on the tests until I added create sequence privilege to the user.

                          Comment

                          Working...
                          X