Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Reading geo-fire locations in gae does not work #40

@Rainking80

Description

@Rainking80

I had a conversation with the firebase support and was asked to put my issue into this channel. He was able to replicate the issue with a condensed code sample of mine. He also said it might be related to #11.

My situation:
I have a google app engine running with java. I want to read and write locations with my app engine. Writing a location is working quiet well (but callback is not working). When I try to read locations from the firebase database I see an exception in my app engine log.

This is the exception:

Uncaught exception from servlet java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "modifyThreadGroup") at ...

this is my gradle build:

dependencies {
    appengineSdk 'com.google.appengine:appengine-java-sdk:1.9.40'
    compile 'com.google.firebase:firebase-server-sdk:[3.0.0,)'
    compile 'javax.servlet:servlet-api:2.5'
    compile 'com.firebase:geofire-java:2.0.0'
    compile 'com.google.appengine:appengine-api-1.0-sdk:1.9.40'
    compile 'org.apache.httpcomponents:httpclient:4.5.2'
}

this is the call from my java servlet which throws the exception:

DatabaseReference ref = FirebaseDatabase.getInstance().getReference("places/");
GeoFire geoFire = new GeoFire(ref);
geoFire.setLocation("firebase-hq", new GeoLocation(37.7853889, -122.4056973));
//geoFire.removeLocation("firebase-hq");

GeoQuery geoQuery = geoFire.queryAtLocation(new GeoLocation(37.7832, -122.4056), 0.6);

geoQuery.addGeoQueryEventListener(new GeoQueryEventListener() {
    @Override
    public void onKeyEntered(String key, GeoLocation location) {
        System.out.println(String.format("Key %s entered the search area at [%f,%f]", key, location.latitude, location.longitude));
    }

    @Override
    public void onKeyExited(String key) {
        System.out.println(String.format("Key %s is no longer in the search area", key));
    }

    @Override
    public void onKeyMoved(String key, GeoLocation location) {
        System.out.println(String.format("Key %s moved within the search area to [%f,%f]", key, location.latitude, location.longitude));
    }

    @Override
    public void onGeoQueryReady() {
        System.out.println("All initial data has been loaded and events have been fired!");
    }

    @Override
    public void onGeoQueryError(DatabaseError error) {
        System.err.println("There was an error with this query: " + error);
    }
});

Comment from firebase-support:

It appears that this issue only affects geofire-java and not the Firebase SDK per se.

Kind regards,
Tino

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions