Results 1 to 10 of 10

Thread: Strange error with database reverse engineer and mysql

Hybrid View

  1. #1
    Join Date
    Mar 2012
    Posts
    6

    Default Strange error with database reverse engineer and mysql

    I was able to use the dbre with roo 1.1.5 and 1.2.0.M1 however when I try 1.2.0.RELEASE, 1.2.1.RELEASE it always fails with the the following error message (I removed the package name):
    Compilation unit package '*' unexpected for type 'java.lang'

    This is the command that I used:
    database reverse engineer --schema no-schema-required --activeRecord false --package ~.database

    The annoying part is that it works just fine if I drop back to 1.2.0.M1, it just doesn't work with any newer release. Although to be accurate, even though it runs through the dbre process just fine on 1.2.0.M1 I have to go in and manually modify the dbre.xml to fix an issue with TEXT fields. Could this be the issue creating the mysterious error message?

  2. #2
    Join Date
    Dec 2005
    Posts
    929

    Default

    You can log a Jira issue for us to look at. Please make sure you attach your dbre.xml file and if possible the MySQL schema DDL.
    Thanks
    Alan Stewart
    Spring Roo Committer
    twitter @alankstewart

  3. #3
    Join Date
    Oct 2011
    Posts
    13

    Default let me continue

    Hi team, sorry for my English.
    I was working on sts2.7.2 early, today I downloaded 2.9.0 release and have a lot of strange problems.
    I can't create any project as before.
    database reverse doesn't work with me at all. I'm having same message "Compilation unit package unexpected for type 'java.lang'"

    Let me attach project backup and database structure here.carroza.sql.ziptest4_2012-03-13_05:55:43.zip

    Also, if I use project structure (src packages) as 2 level (uz.test), spring roo dowsn't work at all inside STS, but work from console
    But if I will use 3 levels (uz.test.testit) - it works both console and STS.

    Please take a look, if I have to create JIRA issue, I will do so.

  4. #4
    Join Date
    Oct 2011
    Posts
    13

    Default

    Seems I have too much problems
    I installed ubuntu 11.10 64bit, openjdk-6 (sun-version is also installed)
    And for STS 2.9.0 I have an error "Project facet grails.app has not been defined. It is used in plugin com.springsource.sts.server.tc.core", which prevents project creation.

    Can anybody explain, how I can upgrade STS to 2.9.1M2 version?

  5. #5
    Join Date
    Oct 2011
    Posts
    13

    Default

    and one more thing,
    on STS 2.7.2, roo console - database reverse doesn't do anything, but if I run roo from console - it successfully created all files!

  6. #6
    Join Date
    Oct 2011
    Posts
    13

    Default

    I don't want to create a new thread, so let me continue posting here

    Here is another thing I found, it related with ROO 1.2.1 version:
    ROO generates a database table class and some aspect files. By default it generates for ID column code in *_Roo_Jpa_Entity.aj like
    Code:
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "id")
    private Long Favorite.id;
    If I move this code to the class file (just to change GenerationType.AUTO to GenerationType.IDENTITY), Roo:
    1. removes this annotations only from original *_Roo_Jpa_Entity.aj
    2. creates *_Roo_JavaBean.aj and writes there getId() and setId() methods

    But, both methods still exists in *_Roo_Jpa_Entity.aj! So we have an error. To fix it I have to move both methods to the class, where an annotation has been moved.

    And if I later edit entity class file and remove from there getId() and setId() methods, Roo adds boths methods to *_Roo_Jpa_Entity.aj and also creates *_Roo_JavaBean.aj. SO no way just to move annotation, I have to move methods too.

    In Roo 1.1.5 version of STS 2.7.2 this problem didn't exists. Think it is an issue too..
    Last edited by shvaber; Mar 14th, 2012 at 02:44 AM.

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
  •