Skip to content

Can't save current user as object in User Pointer column (Parse4J) #85

@SeloSlav

Description

@SeloSlav

Anybody else have a similar problem?

ParseUser currentUser = ParseUser.currentUser;

ParseObject sentRequest = new ParseObject("Request");
sentRequest.put("author", currentUser);
try {
 sentRequest.save();
} catch (org.parse4j.ParseException e) {
 e.printStackTrace();
}

pom.xml: I'm using the latest SNAPSHOT build as my Parse4J dependency.

    <dependency>
        <groupId>com.github.thiagolocatelli</groupId>
        <artifactId>parse4j</artifactId>
        <version>1.5-SNAPSHOT</version>
    </dependency>

Exception:

ParseException [code=111, error=schema mismatch for Request.author; expected Pointer<_User> but got Pointer<users>]
	at org.parse4j.command.ParseResponse.getParseError(ParseResponse.java:122)
	at org.parse4j.command.ParseResponse.getException(ParseResponse.java:78)
	at org.parse4j.ParseObject.save(ParseObject.java:486)
	at com.test.automation.controller.RequestController.createRequestObject(RequestController.java:119)
	at com.test.automation.controller.RequestController.saveRequest(RequestController.java:89)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)

What's going wrong here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions