Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants