Results 1 to 10 of 13

Thread: ROO: test doesn't work with Oracle DB

Hybrid View

  1. #1
    Join Date
    May 2010
    Posts
    7

    Default 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. #2
    Join Date
    Jun 2008
    Location
    Philadelphia, PA, USA
    Posts
    212

    Default

    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?

  3. #3
    Join Date
    May 2010
    Posts
    7

    Default

    -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

  4. #4
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    2,768

    Default

    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.
    Ben Alex
    Project Founder, Spring UAA, Spring Roo and Spring Security

  5. #5
    Join Date
    May 2010
    Posts
    7

    Default

    Quote 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.

    Quote 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.
    Attached Files Attached Files

  6. #6
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    2,768

    Default

    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. :-)
    Ben Alex
    Project Founder, Spring UAA, Spring Roo and Spring Security

  7. #7
    Join Date
    Jun 2010
    Posts
    2

    Default

    Quote 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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •