Results 1 to 6 of 6

Thread: The specified target '--type' does not exist or can not be found. Please create this

  1. #1

    Default The specified target '--type' does not exist or can not be found. Please create this

    When i run following command in Roo:

    Code:
    field reference --fieldName icon --type java.awt.image.BufferedImage
    I am getting following error

    Code:
    The specified target '--type' does not exist or can not be found. Please create this type first.
    How can i fix this? Shouldn't roo know the standard java classes?

  2. #2
    Join Date
    Dec 2005
    Posts
    929

    Default

    The --type option is used to reference an existing entity in your own project, not some arbitrary class. As per the field help, "The Java type of the entity to reference"
    Alan Stewart
    Spring Roo Committer
    twitter @alankstewart

  3. #3

    Default

    Quote Originally Posted by Alan Stewart View Post
    The --type option is used to reference an existing entity in your own project, not some arbitrary class. As per the field help, "The Java type of the entity to reference"
    Thanks for the reply but in this case how can i add my field? Do i need to edit the source code myself? If so, i dont think that this is a good design decision.

  4. #4
    Join Date
    Dec 2005
    Posts
    929

    Default

    The "field reference" command is used to create a many-to-one or one-to-one relationship to another entity.

    If you want to add your awt field, perhaps use the field other command, eg

    Code:
    roo> field other --class ~.domain.Foo --fieldName icon --type java.awt.image.BufferedImage
    Alan
    Alan Stewart
    Spring Roo Committer
    twitter @alankstewart

  5. #5

    Default

    Quote Originally Posted by Alan Stewart View Post
    The "field reference" command is used to create a many-to-one or one-to-one relationship to another entity.

    If you want to add your awt field, perhaps use the field other command, eg

    Code:
    roo> field other --class ~.domain.Foo --fieldName icon --type java.awt.image.BufferedImage
    Alan
    Thanks for the answer but it is not working. I am getting this exception

    Code:
    org.hibernate.MappingException: Could not determine type for: java.awt.image.BufferedImage, at table: project, for columns: [org.hibernate.mapping.Column(icon)]

  6. #6
    Join Date
    Dec 2005
    Posts
    929

    Default

    So this is now a Hibernate issue, not a Roo issue?

    Can you try EclipseLink and OpenJPA as the provider?
    Alan Stewart
    Spring Roo Committer
    twitter @alankstewart

Posting Permissions

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