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

Create Folder returns Bad Request #294

Open
NicoTexas opened this issue May 5, 2017 · 4 comments
Open

Create Folder returns Bad Request #294

NicoTexas opened this issue May 5, 2017 · 4 comments

Comments

@NicoTexas
Copy link

NicoTexas commented May 5, 2017

Trying to create a simple folder as superuser

        ClientFolder folder = new ClientFolder();
        
        folder.setUri("/public/test")
                .setLabel("test Folder")
                .setDescription("test folder description")
                .setPermissionMask(0)
                .setCreationDate("2017-01-24 16:27:47")
                .setUpdateDate("2017-01-24 16:27:47")
                .setVersion(0);

        OperationResult<ClientResource> result = getJasperSession()
                .resourcesService()
                .resource(folder.getUri())
                .createOrUpdate(folder);

Returns
com.jaspersoft.jasperserver.jaxrs.client.core.exceptions.BadRequestException: Bad Request

I am using version 6.3.0

Also, is there a way to get more info than this in the response?

@TanyaEf
Copy link
Contributor

TanyaEf commented May 7, 2017 via email

@NicoTexas
Copy link
Author

NicoTexas commented May 11, 2017

Ok, I found out how to turn on the http logs
This is the error I got
2 < 400
2 < Cache-Control: private
2 < Connection: close
2 < Content-Type: application/errorDescriptor+json
2 < Date: Thu, 11 May 2017 21:54:52 GMT
2 < Expires: Thu, 01 Jan 1970 00:00:00 UTC
2 < P3P: CP="ALL"
2 < Server: Apache-Coyote/1.1
2 < Transfer-Encoding: chunked
{"message":"The value "2014-01-24 16:27:47" for parameter "creationDate" is invalid.","errorCode":"illegal.parameter.value.error","parameters":["creationDate","2017-01-24 16:27:47"]}

I tried to change that with the date straight from the doc 2014-01-24 16:27:47 and got same error.

The correct format is
2017-05-04T12:18:47

@TanyaEf
Copy link
Contributor

TanyaEf commented May 12, 2017

try not to set this parameter at all, it's set automatically by server(as well as update date and version)

@NicoTexas
Copy link
Author

Indeed, it works when not set but documentation example date format is wrong.
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants