Skip to content
This repository has been archived by the owner on Dec 11, 2024. It is now read-only.

attachment can not be null #148

Open
rkimaoui opened this issue Apr 1, 2016 · 1 comment
Open

attachment can not be null #148

rkimaoui opened this issue Apr 1, 2016 · 1 comment
Assignees
Milestone

Comments

@rkimaoui
Copy link

rkimaoui commented Apr 1, 2016

Hello,

When i save Message class without setting file, i get this error:

 [elasticsearch[Dominic Petros][transport_client_worker][T#5]{New I/O worker #5}] ERROR grails.plugins.elasticsearch.index.IndexRequestQueue - Failed bulk item: MapperParsingException[No content is provided.]

file nullable: true doesn't seem to work.

Here is my code:

class Message {
String text
String file

    static transients = ['file']

static searchable = {
        only = [ "file", "text" ]
        file attachment: true
    }

def setEncodedData(String str){
        file=str
    }

static mapping = {
        id column: "ID_MSG", generator: "identity"
        version false
           text type: 'text'
    }

static constraints = {
        file nullable: true
    }
}

Thx in advance !

@puneetbehl
Copy link
Collaborator

Which version of Grails and plugin are you using? Also, it would be great if you could create sample grails application describing the problem over GitHub.

@puneetbehl puneetbehl self-assigned this Jan 17, 2018
@puneetbehl puneetbehl added this to the 2.4.0.RC2 milestone Jan 17, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants