When save next event, spring data neo4j delete previous relationships - neo4j
I have a problem with save node in cascade. I have a 3 #NodeEntity: Event, Tag, UserNeo. When I save next event, the previous relationship was deleted between user and events, and also between events and tag. Sometimes this relations are saved. I don't know what I doing wrong.
Neo4j dependency
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-neo4j</artifactId>
<version>4.2.0.BUILD-SNAPSHOT</version>
</dependency>
Event.java
#NodeEntity(label = "Event")
public class Event {
#GraphId
private Long id;
#Property(name = "title")
private String title;
#Property(name = "short_description")
private String shortDescription;
#Property(name = "long_description")
private String longDescription;
#Property(name = "address")
private String address;
#Property(name = "lat")
private double lat;
#Property(name = "lon")
private double lon;
#Property(name = "time")
#DateLong
private Date time;
#Property(name = "nuts")
private int nuts;
#Property(name = "created_by")
private String createdBy;
#Property(name = "created_date")
#DateLong
private Date createdDate;
#Property(name = "modified_by")
private String modifiedBy;
#Property(name = "modified_date")
#DateLong
private Date modifiedDate;
#Property(name = "deleted_date")
#DateLong
private Date deletedDate = null;
#Relationship(type = "TAGGED", direction = Relationship.OUTGOING)
private Set<Tag> tagSet = new HashSet<>();
#Relationship(type = "JOINED_IN", direction = Relationship.INCOMING)
private Set<UserNeo> joinedUsers = new HashSet<>();
#Relationship(type = "ORGANIZED", direction = Relationship.INCOMING)
private Set<UserNeo> organizedUsers;
// getters and setters
UserNeo.java
#NodeEntity(label = "User")
public class UserNeo {
#GraphId
private Long id;
#Property(name = "first_name")
private String firstName;
#Property(name = "last_name")
private String lastName;
#Property(name = "email")
private String email;
#Property(name = "vip")
private boolean vip;
#Property(name = "nuts")
private int nuts;
#Property(name = "current_lat")
private double currentLat;
#Property(name = "current_lon")
private double currentLon;
#Property(name = "created_date")
#DateLong
private Date createdDate;
#Property(name = "deleted_date")
#DateLong
private Date deletedDate;
#Relationship(type = "JOINED_IN", direction = Relationship.OUTGOING)
private List<Event> joinEvents;
#Relationship(type = "ORGANIZED", direction = Relationship.OUTGOING)
private List<Event> organizeEvents;
// getters and setters
Tag.java
#NodeEntity(label = "Tag")
public class Tag {
#GraphId
private Long id;
#Property(name = "tag")
private String tag;
#Relationship(type = "TAGGED", direction = Relationship.INCOMING)
private Set<Event> events = new HashSet<>();
// getters and setters
My service method to save nodes
public Event createEvent(EventDTO event){
Set<Tag> tags = new HashSet<>(event.getTagSet().size());
Iterator it = event.getTagSet().iterator();
while(it.hasNext()){
String tag = it.next().toString();
Tag resultTag = tagRepository.findByName(tag);
if(resultTag != null){
tags.add(resultTag);
}else {
Tag newTag = new Tag(tag);
newTag = tagRepository.save(newTag);
tags.add(newTag);
}
}
UserNeo userNeo = userNeoRepository.findByEmail("sunday1601#gmail.com");
Set<UserNeo> userNeos = new HashSet<>();
userNeos.add(userNeo);
Event createEvent = new `Event(event.getTitle(),event.getShortDescription(),event.getLongDescription(),`
event.getAddress(),event.getLat(),event.getLon(),event.getTime(),event.getNuts(),
event.getCreatedBy(), new Timestamp(new Date().getTime()),null,null);
createEvent.setTagSet(tags);
createEvent.setOrganizedUsers(userNeos);
Event save = eventRepository.save(createEvent);
return save;
}
When I save in short time, then delete previous relationship. And when I watch in neo4j browser I have a two the same event node.
This is log from jhipster
2016-07-14 22:04:42.863 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.MetaData : looking for concrete class to resolve label: User
2016-07-14 22:04:42.863 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.MetaData : concrete class found: com.mycompany.myapp.domain.UserNeo. comparing with what's already been found previously...
2016-07-14 22:04:42.863 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.MetaData : User resolving class: com.mycompany.myapp.domain.UserNeo
2016-07-14 22:04:42.863 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.GraphEntityMapper : Unable to find property: address on class: com.mycompany.myapp.domain.UserNeo for writing
2016-07-14 22:04:42.864 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.EntityGraphMapper : context-init: ($3153)-[:ORGANIZED]->($2108)
2016-07-14 22:04:42.864 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.EntityGraphMapper : context-init: ($2108)-[:TAGGED]->($2098)
2016-07-14 22:04:42.864 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.EntityGraphMapper : context-init: ($2108)-[:TAGGED]->($2100)
2016-07-14 22:04:42.864 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.EntityGraphMapper : context initialised with 3 relationships
2016-07-14 22:04:42.864 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.EntityGraphMapper : visiting: Event{id=null, title='Event 47', shortDescription='Opis krotki short', longDescription='Opis długi long', address='address 5', lat=50.000452, lon=20.957071, time=Sun Jun 18 01:07:34 CEST 2017, nuts=17, createdBy='Michal Niedziela', createdDate=2016-07-14 22:04:42.863, modifiedBy='null', modifiedDate=null, deletedDate=1970-01-01 01:00:00.0, tagSet=[Tag{id=2100, tag='Rock'}, Tag{id=2098, tag='Festiwal'}, Tag{id=3231, tag='Plaża'}], joinedUsers=[], organizedUsers=[UserNeo{id=3153, firstName='Michal', lastName='Niedziela', email='sunday1601#gmail.com', vip=false, nuts=100, currentLat=50.028797, currentLon=21.000123, createdDate=Tue Jul 12 11:07:55 CEST 2016, deletedDate=null, joinEvents=null, organizeEvents=null}]}
2016-07-14 22:04:42.864 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.EntityGraphMapper : Event{id=null, title='Event 47', shortDescription='Opis krotki short', longDescription='Opis długi long', address='address 5', lat=50.000452, lon=20.957071, time=Sun Jun 18 01:07:34 CEST 2017, nuts=17, createdBy='Michal Niedziela', createdDate=2016-07-14 22:04:42.863, modifiedBy='null', modifiedDate=null, deletedDate=1970-01-01 01:00:00.0, tagSet=[Tag{id=2100, tag='Rock'}, Tag{id=2098, tag='Festiwal'}, Tag{id=3231, tag='Plaża'}], joinedUsers=[], organizedUsers=[UserNeo{id=3153, firstName='Michal', lastName='Niedziela', email='sunday1601#gmail.com', vip=false, nuts=100, currentLat=50.028797, currentLon=21.000123, createdDate=Tue Jul 12 11:07:55 CEST 2016, deletedDate=null, joinEvents=null, organizeEvents=null}]} has changed
2016-07-14 22:04:42.866 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.EntityGraphMapper : mapping references declared by: Event{id=null, title='Event 47', shortDescription='Opis krotki short', longDescription='Opis długi long', address='address 5', lat=50.000452, lon=20.957071, time=Sun Jun 18 01:07:34 CEST 2017, nuts=17, createdBy='Michal Niedziela', createdDate=2016-07-14 22:04:42.863, modifiedBy='null', modifiedDate=null, deletedDate=1970-01-01 01:00:00.0, tagSet=[Tag{id=2100, tag='Rock'}, Tag{id=2098, tag='Festiwal'}, Tag{id=3231, tag='Plaża'}], joinedUsers=[], organizedUsers=[UserNeo{id=3153, firstName='Michal', lastName='Niedziela', email='sunday1601#gmail.com', vip=false, nuts=100, currentLat=50.028797, currentLon=21.000123, createdDate=Tue Jul 12 11:07:55 CEST 2016, deletedDate=null, joinEvents=null, organizeEvents=null}]}
2016-07-14 22:04:42.866 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.EntityGraphMapper : mapping reference type: TAGGED
2016-07-14 22:04:42.866 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.EntityGraphMapper : linking to entity Tag{id=2100, tag='Rock'} in one direction
2016-07-14 22:04:42.867 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.EntityGraphMapper : visiting: Tag{id=2100, tag='Rock'}
2016-07-14 22:04:42.867 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.EntityGraphMapper : Tag{id=2100, tag='Rock'}, has not changed
2016-07-14 22:04:42.867 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.EntityGraphMapper : mapping references declared by: Tag{id=2100, tag='Rock'}
2016-07-14 22:04:42.867 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.EntityGraphMapper : context-del: (2100)<-[:TAGGED]-()
2016-07-14 22:04:42.867 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.EntityGraphMapper : mapping reference type: TAGGED
2016-07-14 22:04:42.867 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.EntityGraphMapper : trying to map relationship between Event{id=null, title='Event 47', shortDescription='Opis krotki short', longDescription='Opis długi long', address='address 5', lat=50.000452, lon=20.957071, time=Sun Jun 18 01:07:34 CEST 2017, nuts=17, createdBy='Michal Niedziela', createdDate=2016-07-14 22:04:42.863, modifiedBy='null', modifiedDate=null, deletedDate=1970-01-01 01:00:00.0, tagSet=[Tag{id=2100, tag='Rock'}, Tag{id=2098, tag='Festiwal'}, Tag{id=3231, tag='Plaża'}], joinedUsers=[], organizedUsers=[UserNeo{id=3153, firstName='Michal', lastName='Niedziela', email='sunday1601#gmail.com', vip=false, nuts=100, currentLat=50.028797, currentLon=21.000123, createdDate=Tue Jul 12 11:07:55 CEST 2016, deletedDate=null, joinEvents=null, organizeEvents=null}]} and Tag{id=2100, tag='Rock'}
2016-07-14 22:04:42.867 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.EntityGraphMapper : context-new: (-250914077)-[-1950378672:TAGGED]->(2100)
2016-07-14 22:04:42.867 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.EntityGraphMapper : linking to entity Tag{id=2098, tag='Festiwal'} in one direction
2016-07-14 22:04:42.867 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.EntityGraphMapper : visiting: Tag{id=2098, tag='Festiwal'}
2016-07-14 22:04:42.867 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.EntityGraphMapper : Tag{id=2098, tag='Festiwal'}, has not changed
2016-07-14 22:04:42.872 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.EntityGraphMapper : mapping references declared by: Tag{id=2098, tag='Festiwal'}
2016-07-14 22:04:42.872 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.EntityGraphMapper : context-del: (2098)<-[:TAGGED]-()
2016-07-14 22:04:42.872 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.EntityGraphMapper : mapping reference type: TAGGED
2016-07-14 22:04:42.872 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.EntityGraphMapper : trying to map relationship between Event{id=null, title='Event 47', shortDescription='Opis krotki short', longDescription='Opis długi long', address='address 5', lat=50.000452, lon=20.957071, time=Sun Jun 18 01:07:34 CEST 2017, nuts=17, createdBy='Michal Niedziela', createdDate=2016-07-14 22:04:42.863, modifiedBy='null', modifiedDate=null, deletedDate=1970-01-01 01:00:00.0, tagSet=[Tag{id=2100, tag='Rock'}, Tag{id=2098, tag='Festiwal'}, Tag{id=3231, tag='Plaża'}], joinedUsers=[], organizedUsers=[UserNeo{id=3153, firstName='Michal', lastName='Niedziela', email='sunday1601#gmail.com', vip=false, nuts=100, currentLat=50.028797, currentLon=21.000123, createdDate=Tue Jul 12 11:07:55 CEST 2016, deletedDate=null, joinEvents=null, organizeEvents=null}]} and Tag{id=2098, tag='Festiwal'}
2016-07-14 22:04:42.873 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.EntityGraphMapper : context-new: (-250914077)-[-1648969869:TAGGED]->(2098)
2016-07-14 22:04:42.873 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.EntityGraphMapper : linking to entity Tag{id=3231, tag='Plaża'} in one direction
2016-07-14 22:04:42.873 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.EntityGraphMapper : visiting: Tag{id=3231, tag='Plaża'}
2016-07-14 22:04:42.873 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.EntityGraphMapper : Tag{id=3231, tag='Plaża'}, has not changed
2016-07-14 22:04:42.873 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.EntityGraphMapper : mapping references declared by: Tag{id=3231, tag='Plaża'}
2016-07-14 22:04:42.873 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.EntityGraphMapper : context-del: (3231)<-[:TAGGED]-()
2016-07-14 22:04:42.873 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.EntityGraphMapper : mapping reference type: TAGGED
2016-07-14 22:04:42.873 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.EntityGraphMapper : trying to map relationship between Event{id=null, title='Event 47', shortDescription='Opis krotki short', longDescription='Opis długi long', address='address 5', lat=50.000452, lon=20.957071, time=Sun Jun 18 01:07:34 CEST 2017, nuts=17, createdBy='Michal Niedziela', createdDate=2016-07-14 22:04:42.863, modifiedBy='null', modifiedDate=null, deletedDate=1970-01-01 01:00:00.0, tagSet=[Tag{id=2100, tag='Rock'}, Tag{id=2098, tag='Festiwal'}, Tag{id=3231, tag='Plaża'}], joinedUsers=[], organizedUsers=[UserNeo{id=3153, firstName='Michal', lastName='Niedziela', email='sunday1601#gmail.com', vip=false, nuts=100, currentLat=50.028797, currentLon=21.000123, createdDate=Tue Jul 12 11:07:55 CEST 2016, deletedDate=null, joinEvents=null, organizeEvents=null}]} and Tag{id=3231, tag='Plaża'}
2016-07-14 22:04:42.873 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.EntityGraphMapper : context-new: (-250914077)-[-1054618601:TAGGED]->(3231)
2016-07-14 22:04:42.873 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.EntityGraphMapper : mapping reference type: ORGANIZED
2016-07-14 22:04:42.873 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.EntityGraphMapper : linking to entity UserNeo{id=3153, firstName='Michal', lastName='Niedziela', email='sunday1601#gmail.com', vip=false, nuts=100, currentLat=50.028797, currentLon=21.000123, createdDate=Tue Jul 12 11:07:55 CEST 2016, deletedDate=null, joinEvents=null, organizeEvents=null} in one direction
2016-07-14 22:04:42.873 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.EntityGraphMapper : visiting: UserNeo{id=3153, firstName='Michal', lastName='Niedziela', email='sunday1601#gmail.com', vip=false, nuts=100, currentLat=50.028797, currentLon=21.000123, createdDate=Tue Jul 12 11:07:55 CEST 2016, deletedDate=null, joinEvents=null, organizeEvents=null}
2016-07-14 22:04:42.874 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.EntityGraphMapper : UserNeo{id=3153, firstName='Michal', lastName='Niedziela', email='sunday1601#gmail.com', vip=false, nuts=100, currentLat=50.028797, currentLon=21.000123, createdDate=Tue Jul 12 11:07:55 CEST 2016, deletedDate=null, joinEvents=null, organizeEvents=null}, has not changed
2016-07-14 22:04:42.874 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.EntityGraphMapper : mapping references declared by: UserNeo{id=3153, firstName='Michal', lastName='Niedziela', email='sunday1601#gmail.com', vip=false, nuts=100, currentLat=50.028797, currentLon=21.000123, createdDate=Tue Jul 12 11:07:55 CEST 2016, deletedDate=null, joinEvents=null, organizeEvents=null}
2016-07-14 22:04:42.874 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.EntityGraphMapper : context-del: (3153)-[:JOINED_IN]->()
2016-07-14 22:04:42.874 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.EntityGraphMapper : context-del: (3153)-[:ORGANIZED]->()
2016-07-14 22:04:42.874 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.EntityGraphMapper : trying to map relationship between Event{id=null, title='Event 47', shortDescription='Opis krotki short', longDescription='Opis długi long', address='address 5', lat=50.000452, lon=20.957071, time=Sun Jun 18 01:07:34 CEST 2017, nuts=17, createdBy='Michal Niedziela', createdDate=2016-07-14 22:04:42.863, modifiedBy='null', modifiedDate=null, deletedDate=1970-01-01 01:00:00.0, tagSet=[Tag{id=2100, tag='Rock'}, Tag{id=2098, tag='Festiwal'}, Tag{id=3231, tag='Plaża'}], joinedUsers=[], organizedUsers=[UserNeo{id=3153, firstName='Michal', lastName='Niedziela', email='sunday1601#gmail.com', vip=false, nuts=100, currentLat=50.028797, currentLon=21.000123, createdDate=Tue Jul 12 11:07:55 CEST 2016, deletedDate=null, joinEvents=null, organizeEvents=null}]} and UserNeo{id=3153, firstName='Michal', lastName='Niedziela', email='sunday1601#gmail.com', vip=false, nuts=100, currentLat=50.028797, currentLon=21.000123, createdDate=Tue Jul 12 11:07:55 CEST 2016, deletedDate=null, joinEvents=null, organizeEvents=null}
2016-07-14 22:04:42.874 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.EntityGraphMapper : context-new: (3153)-[-1646367736:ORGANIZED]->(-250914077)
2016-07-14 22:04:42.874 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.EntityGraphMapper : mapping reference type: JOINED_IN
2016-07-14 22:04:42.874 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.EntityGraphMapper : context-del: ($3153)-[null:ORGANIZED]->($2108)
2016-07-14 22:04:42.874 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.EntityGraphMapper : flushing end node of: ($3153)-[:ORGANIZED]->($2108)
2016-07-14 22:04:42.874 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.EntityGraphMapper : flushing start node of: ($3153)-[:ORGANIZED]->($2108)
2016-07-14 22:04:42.874 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.EntityGraphMapper : context-del: ($2108)-[null:TAGGED]->($2098)
2016-07-14 22:04:42.874 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.EntityGraphMapper : flushing end node of: ($2108)-[:TAGGED]->($2098)
2016-07-14 22:04:42.874 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.EntityGraphMapper : flushing end node of: ($2108)-[:TAGGED]->($2100)
2016-07-14 22:04:42.874 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.context.EntityGraphMapper : context-del: ($2108)-[null:TAGGED]->($2100)
2016-07-14 22:04:42.875 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.session.Neo4jSession : Thread 41: beginTransaction()
2016-07-14 22:04:42.875 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.session.Neo4jSession : Thread 41: Neo4jSession identity: org.neo4j.ogm.session.delegates.TransactionsDelegate#32786293
2016-07-14 22:04:42.875 DEBUG 26162 --- [nio-8080-exec-5] o.n.ogm.drivers.http.driver.HttpDriver : Thread 41: POST http://localhost:7474/db/data/transaction
2016-07-14 22:04:42.875 INFO 26162 --- [nio-8080-exec-5] o.n.o.drivers.http.request.HttpRequest : Thread 41: POST http://localhost:7474/db/data/transaction HTTP/1.1
2016-07-14 22:04:42.876 DEBUG 26162 --- [nio-8080-exec-5] o.n.o.drivers.http.request.HttpRequest : Thread 41: HttpResponse HttpResponseProxy{HTTP/1.1 201 Created [Date: Thu, 14 Jul 2016 20:04:42 GMT, Location: http://localhost:7474/db/data/transaction/531, Content-Type: application/json, Access-Control-Allow-Origin: *, Content-Length: 150, Server: Jetty(9.2.9.v20150224)] ResponseEntityProxy{[Content-Type: application/json,Content-Length: 150,Chunked: false]}}
2016-07-14 22:04:42.881 DEBUG 26162 --- [nio-8080-exec-5] o.n.ogm.drivers.http.driver.HttpDriver : Thread 41: {"commit":"http://localhost:7474/db/data/transaction/531/commit","results":[],"transaction":{"expires":"Thu, 14 Jul 2016 20:05:42 +0000"},"errors":[]}
2016-07-14 22:04:42.882 DEBUG 26162 --- [nio-8080-exec-5] o.n.ogm.drivers.http.driver.HttpDriver : Thread 41: Connection released
2016-07-14 22:04:42.884 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.session.Neo4jSession : Thread 41: Transaction, tx id: org.neo4j.ogm.drivers.http.transaction.HttpTransaction#39e7461a
2016-07-14 22:04:42.884 DEBUG 26162 --- [nio-8080-exec-5] o.n.ogm.drivers.http.driver.HttpDriver : Thread 41: request url http://localhost:7474/db/data/transaction/531
2016-07-14 22:04:42.884 INFO 26162 --- [nio-8080-exec-5] o.n.o.drivers.http.request.HttpRequest : Thread 41: request {"statements":[{"statement":"UNWIND {rows} as row CREATE (n:`Event`) SET n=row.props RETURN row.nodeRef as ref, ID(n) as id, row.type as type","parameters":{"rows":[{"nodeRef":-250914077,"type":"node","props":{"short_description":"Opis krotki short","deleted_date":0,"address":"address 5","nuts":17,"lon":20.957071,"created_date":1468526682863,"time":1497740854000,"long_description":"Opis długi long","title":"Event 47","created_by":"Michal Niedziela","lat":50.000452}}]},"resultDataContents":["row"],"includeStats":false}]}
2016-07-14 22:04:42.885 INFO 26162 --- [nio-8080-exec-5] o.n.o.drivers.http.request.HttpRequest : Thread 41: POST http://localhost:7474/db/data/transaction/531 HTTP/1.1
2016-07-14 22:04:42.889 DEBUG 26162 --- [nio-8080-exec-5] o.n.o.drivers.http.request.HttpRequest : Thread 41: HttpResponse HttpResponseProxy{HTTP/1.1 200 OK [Date: Thu, 14 Jul 2016 20:04:42 GMT, Content-Type: application/json, Access-Control-Allow-Origin: *, Content-Length: 247, Server: Jetty(9.2.9.v20150224)] ResponseEntityProxy{[Content-Type: application/json,Content-Length: 247,Chunked: false]}}
2016-07-14 22:04:42.889 DEBUG 26162 --- [nio-8080-exec-5] o.n.o.d.h.response.AbstractHttpResponse : Thread 41: Releasing HttpResponse
2016-07-14 22:04:42.889 DEBUG 26162 --- [nio-8080-exec-5] o.n.ogm.session.request.RequestExecutor : to create: nodeEntity -250914077:2109
2016-07-14 22:04:42.889 DEBUG 26162 --- [nio-8080-exec-5] o.n.ogm.drivers.http.driver.HttpDriver : Thread 41: request url http://localhost:7474/db/data/transaction/531
2016-07-14 22:04:42.890 INFO 26162 --- [nio-8080-exec-5] o.n.o.drivers.http.request.HttpRequest : Thread 41: request {"statements":[{"statement":"UNWIND {rows} as row MATCH (startNode) WHERE ID(startNode) = row.startNodeId MATCH (endNode) WHERE ID(endNode) = row.endNodeId MERGE (startNode)-[rel:`TAGGED`]->(endNode) RETURN row.relRef as ref, ID(rel) as id, row.type as type","parameters":{"rows":[{"startNodeId":2109,"relRef":-1054618601,"type":"rel","endNodeId":3231},{"startNodeId":2109,"relRef":-1648969869,"type":"rel","endNodeId":2098},{"startNodeId":2109,"relRef":-1950378672,"type":"rel","endNodeId":2100}]},"resultDataContents":["row"],"includeStats":false},{"statement":"UNWIND {rows} as row MATCH (startNode) WHERE ID(startNode) = row.startNodeId MATCH (endNode) WHERE ID(endNode) = row.endNodeId MERGE (startNode)-[rel:`ORGANIZED`]->(endNode) RETURN row.relRef as ref, ID(rel) as id, row.type as type","parameters":{"rows":[{"startNodeId":3153,"relRef":-1646367736,"type":"rel","endNodeId":2109}]},"resultDataContents":["row"],"includeStats":false},{"statement":"UNWIND {rows} as row MATCH (startNode) WHERE ID(startNode) = row.startNodeId MATCH (endNode) WHERE ID(endNode) = row.endNodeId MATCH (startNode)-[rel:`ORGANIZED`]->(endNode) DELETE rel","parameters":{"rows":[{"startNodeId":3153,"endNodeId":2108}]},"resultDataContents":["row"],"includeStats":false},{"statement":"UNWIND {rows} as row MATCH (startNode) WHERE ID(startNode) = row.startNodeId MATCH (endNode) WHERE ID(endNode) = row.endNodeId MATCH (startNode)-[rel:`TAGGED`]->(endNode) DELETE rel","parameters":{"rows":[{"startNodeId":2108,"endNodeId":2098},{"startNodeId":2108,"endNodeId":2100}]},"resultDataContents":["row"],"includeStats":false}]}
2016-07-14 22:04:42.891 INFO 26162 --- [nio-8080-exec-5] o.n.o.drivers.http.request.HttpRequest : Thread 41: POST http://localhost:7474/db/data/transaction/531 HTTP/1.1
2016-07-14 22:04:42.895 DEBUG 26162 --- [nio-8080-exec-5] o.n.o.drivers.http.request.HttpRequest : Thread 41: HttpResponse HttpResponseProxy{HTTP/1.1 200 OK [Date: Thu, 14 Jul 2016 20:04:42 GMT, Content-Type: application/json, Access-Control-Allow-Origin: *, Content-Length: 505, Server: Jetty(9.2.9.v20150224)] ResponseEntityProxy{[Content-Type: application/json,Content-Length: 505,Chunked: false]}}
2016-07-14 22:04:42.895 DEBUG 26162 --- [nio-8080-exec-5] o.n.o.d.h.response.AbstractHttpResponse : Thread 41: Releasing HttpResponse
2016-07-14 22:04:42.896 DEBUG 26162 --- [nio-8080-exec-5] o.n.ogm.session.request.RequestExecutor : to (maybe) create: relEntity -1054618601:461
2016-07-14 22:04:42.896 DEBUG 26162 --- [nio-8080-exec-5] o.n.ogm.session.request.RequestExecutor : to (maybe) create: relEntity -1648969869:462
2016-07-14 22:04:42.896 DEBUG 26162 --- [nio-8080-exec-5] o.n.ogm.session.request.RequestExecutor : to (maybe) create: relEntity -1950378672:463
2016-07-14 22:04:42.896 DEBUG 26162 --- [nio-8080-exec-5] o.n.ogm.session.request.RequestExecutor : to (maybe) create: relEntity -1646367736:464
2016-07-14 22:04:42.897 INFO 26162 --- [nio-8080-exec-5] o.n.o.drivers.http.request.HttpRequest : Thread 41: POST http://localhost:7474/db/data/transaction/531/commit HTTP/1.1
2016-07-14 22:04:42.908 DEBUG 26162 --- [nio-8080-exec-5] o.n.o.drivers.http.request.HttpRequest : Thread 41: HttpResponse HttpResponseProxy{HTTP/1.1 200 OK [Date: Thu, 14 Jul 2016 20:04:42 GMT, Content-Type: application/json, Access-Control-Allow-Origin: *, Content-Length: 26, Server: Jetty(9.2.9.v20150224)] ResponseEntityProxy{[Content-Type: application/json,Content-Length: 26,Chunked: false]}}
2016-07-14 22:04:42.909 DEBUG 26162 --- [nio-8080-exec-5] o.n.ogm.drivers.http.driver.HttpDriver : Thread 41: {"results":[],"errors":[]}
2016-07-14 22:04:42.909 DEBUG 26162 --- [nio-8080-exec-5] o.n.ogm.drivers.http.driver.HttpDriver : Thread 41: Connection released
2016-07-14 22:04:42.909 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.transaction.Transaction : Thread 41: Commit transaction extent: 0
2016-07-14 22:04:42.909 DEBUG 26162 --- [nio-8080-exec-5] org.neo4j.ogm.transaction.Transaction : Thread 41: Committed
2016-07-14 22:04:42.909 DEBUG 26162 --- [nio-8080-exec-5] o.n.ogm.session.request.RequestExecutor : creating new node id: 2109
2016-07-14 22:04:42.909 DEBUG 26162 --- [nio-8080-exec-5] c.m.myapp.aop.logging.LoggingAspect : Exit: com.mycompany.myapp.service.EventService.createEvent() with result = Event{id=2109, title='Event 47', shortDescription='Opis krotki short', longDescription='Opis długi long', address='address 5', lat=50.000452, lon=20.957071, time=Sun Jun 18 01:07:34 CEST 2017, nuts=17, createdBy='Michal Niedziela', createdDate=2016-07-14 22:04:42.863, modifiedBy='null', modifiedDate=null, deletedDate=1970-01-01 01:00:00.0, tagSet=[Tag{id=2100, tag='Rock'}, Tag{id=2098, tag='Festiwal'}, Tag{id=3231, tag='Plaża'}], joinedUsers=[], organizedUsers=[UserNeo{id=3153, firstName='Michal', lastName='Niedziela', email='sunday1601#gmail.com', vip=false, nuts=100, currentLat=50.028797, currentLon=21.000123, createdDate=Tue Jul 12 11:07:55 CEST 2016, deletedDate=null, joinEvents=null, organizeEvents=null}]}
2016-07-14 22:04:42.909 DEBUG 26162 --- [nio-8080-exec-5] c.m.myapp.aop.logging.LoggingAspect : Exit: com.mycompany.myapp.web.rest.EventResources.createEvent() with result = <200 OK,Event{id=2109, title='Event 47', shortDescription='Opis krotki short', longDescription='Opis długi long', address='address 5', lat=50.000452, lon=20.957071, time=Sun Jun 18 01:07:34 CEST 2017, nuts=17, createdBy='Michal Niedziela', createdDate=2016-07-14 22:04:42.863, modifiedBy='null', modifiedDate=null, deletedDate=1970-01-01 01:00:00.0, tagSet=[Tag{id=2100, tag='Rock'}, Tag{id=2098, tag='Festiwal'}, Tag{id=3231, tag='Plaża'}], joinedUsers=[], organizedUsers=[UserNeo{id=3153, firstName='Michal', lastName='Niedziela', email='sunday1601#gmail.com', vip=false, nuts=100, currentLat=50.028797, currentLon=21.000123, createdDate=Tue Jul 12 11:07:55 CEST 2016, deletedDate=null, joinEvents=null, organizeEvents=null}]},{}>
When you add tags to the event, it looks like the Tag does not contain a reference back to the Event? This could be one of the reasons the event-tag relationships are deleted i.e. your object references inconsistent with what is expected in the graph.
In case you want to define relationship in only one of the entities, you may use Session.clear after saving of tag so that tag is not tracked by session and does not get automatically saved after change to event.
https://docs.spring.io/spring-data/neo4j/docs/5.0.0.M1/reference/html/#reference.architecture.session
Related
Detox test not able to run
I've been trying to run a Detox test for our mobile app this whole day, but haven't been able to. Relevant npm versions I use: "detox": "^17.14.6", "jest": "^26.6.3", "jest-circus": "^26.6.3", "jest-cli": "^26.6.3", detoxrc.json { "testRunner": "jest", "runnerConfig": "e2e/config.json", "configurations": { "ios.sim.debug": { "binaryPath": "ios/build/Build/Products/Debug-iphonesimulator/Test.app", "build": "xcodebuild -workspace ios/Test.xcworkspace -scheme Test -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build", "type": "ios.simulator", "device": { "type": "iPhone 11 Pro" } } } } test.e2e.js describe('Overview', () => { beforeEach(async () => { await device.reloadReactNative(); }); it('should open the overviewTab', async () => { await expect(element(by.id('overviewTab'))).toBeVisible(); }); }); It errors in a timeout: Overview ✕ should open the overviewTab (120006 ms) ● Overview › should open the overviewTab thrown: "Exceeded timeout of 120000 ms for a hook. Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test." 1 | describe('Overview', () => { > 2 | beforeEach(async () => { | ^ 3 | await device.reloadReactNative(); 4 | }); 5 | at test.e2e.js:2:3 at Object.<anonymous> (test.e2e.js:1:1) When I run detox test --loglevel trace this is the whole log: kevin#ip-192-168-0-203 mobile-app % detox test --loglevel trace detox[9009] INFO: [test.js] loglevel="trace" useCustomLogger=true DETOX_START_TIMESTAMP=1608416281857 reportSpecs=true jest --config e2e/config.json --testNamePattern '^((?!:android:).)*$' --maxWorkers 1 e2e detox[9010] TRACE: [Detox.js/DETOX_CREATE] created a Detox instance with config: {"artifactsConfig":{"rootDir":"artifacts/ios.sim.debug.2020-12-19 22-18-01Z","plugins":{"log":{"enabled":false,"keepOnlyFailedTestsArtifacts":false},"screenshot":{"enabled":true,"shouldTakeAutomaticSnapshots":false,"keepOnlyFailedTestsArtifacts":false},"video":{"enabled":false,"keepOnlyFailedTestsArtifacts":false},"instruments":{"enabled":false,"keepOnlyFailedTestsArtifacts":false},"timeline":{"enabled":false}},"pathBuilder":{"_rootDir":"artifacts/ios.sim.debug.2020-12-19 22-18-01Z"}},"behaviorConfig":{"init":{"reinstallApp":true,"exposeGlobals":true,"launchApp":true},"cleanup":{"shutdownDevice":false}},"cliConfig":{"loglevel":"trace","useCustomLogger":"true"},"deviceConfig":{"binaryPath":"ios/build/Build/Products/Debug-iphonesimulator/Test.app","build":"xcodebuild -workspace ios/Test.xcworkspace -scheme Test -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build","type":"ios.simulator","device":{"type":"iPhone 11 Pro"}},"runnerConfig":{"testRunner":"jest","runnerConfig":"e2e/config.json","specs":"e2e"},"sessionConfig":{"autoStart":true,"server":"ws://localhost:62012","sessionId":"e836caba-d171-3480-4931-9ee02f21322b","debugSynchronization":false},"errorBuilder":{"filepath":"/Users/kevin/Projects/test/mobile-app/.detoxrc.json","contents":{"testRunner":"jest","runnerConfig":"e2e/config.json","configurations":{"ios.sim.debug":{"binaryPath":"ios/build/Build/Products/Debug-iphonesimulator/Test.app","build":"xcodebuild -workspace ios/Test.xcworkspace -scheme Test -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build","type":"ios.simulator","device":{"type":"iPhone 11 Pro"}}}},"configurationName":"ios.sim.debug"}} detox[9010] INFO: [DetoxServer.js] server listening on localhost:62012... detox[9010] DEBUG: [AsyncWebSocket.js/WEBSOCKET_OPEN] opened web socket to: ws://localhost:62012 detox[9010] TRACE: [AsyncWebSocket.js/WEBSOCKET_SEND] {"type":"login","params":{"sessionId":"e836caba-d171-3480-4931-9ee02f21322b","role":"tester"},"messageId":0} detox[9010] DEBUG: [DetoxServer.js/LOGIN] role=tester, sessionId=e836caba-d171-3480-4931-9ee02f21322b detox[9010] DEBUG: [DetoxServer.js/LOGIN_SUCCESS] role=tester, sessionId=e836caba-d171-3480-4931-9ee02f21322b detox[9010] TRACE: [AsyncWebSocket.js/WEBSOCKET_MESSAGE] {"type":"loginSuccess","params":{"sessionId":"e836caba-d171-3480-4931-9ee02f21322b","role":"tester"},"messageId":0} detox[9010] DEBUG: [exec.js/EXEC_CMD, #0] applesimutils --list --byType "iPhone 11 Pro" detox[9010] TRACE: [exec.js/EXEC_SUCCESS, #0] [ { "os" : { "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Library\/Developer\/CoreSimulator\/Profiles\/Runtimes\/iOS.simruntime", "buildversion" : "18C61", "runtimeRoot" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Library\/Developer\/CoreSimulator\/Profiles\/Runtimes\/iOS.simruntime\/Contents\/Resources\/RuntimeRoot", "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-14-3", "version" : "14.3", "isAvailable" : true, "name" : "iOS 14.3" }, "dataPath" : "\/Users\/kevin\/Library\/Developer\/CoreSimulator\/Devices\/ED9068B9-5E52-404E-B689-ABA33E32E0A1\/data", "logPath" : "\/Users\/kevin\/Library\/Logs\/CoreSimulator\/ED9068B9-5E52-404E-B689-ABA33E32E0A1", "udid" : "ED9068B9-5E52-404E-B689-ABA33E32E0A1", "isAvailable" : true, "deviceType" : { "minRuntimeVersion" : 851968, "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Library\/Developer\/CoreSimulator\/Profiles\/DeviceTypes\/iPhone 11 Pro.simdevicetype", "maxRuntimeVersion" : 4294967295, "name" : "iPhone 11 Pro", "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-11-Pro", "productFamily" : "iPhone" }, "deviceTypeIdentifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-11-Pro", "state" : "Booted", "name" : "iPhone 11 Pro" } ] detox[9010] DEBUG: [exec.js/EXEC_CMD, #1] applesimutils --list --byId ED9068B9-5E52-404E-B689-ABA33E32E0A1 --maxResults 1 detox[9010] TRACE: [exec.js/EXEC_SUCCESS, #1] [ { "os" : { "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Library\/Developer\/CoreSimulator\/Profiles\/Runtimes\/iOS.simruntime", "buildversion" : "18C61", "runtimeRoot" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Library\/Developer\/CoreSimulator\/Profiles\/Runtimes\/iOS.simruntime\/Contents\/Resources\/RuntimeRoot", "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-14-3", "version" : "14.3", "isAvailable" : true, "name" : "iOS 14.3" }, "dataPath" : "\/Users\/kevin\/Library\/Developer\/CoreSimulator\/Devices\/ED9068B9-5E52-404E-B689-ABA33E32E0A1\/data", "logPath" : "\/Users\/kevin\/Library\/Logs\/CoreSimulator\/ED9068B9-5E52-404E-B689-ABA33E32E0A1", "udid" : "ED9068B9-5E52-404E-B689-ABA33E32E0A1", "isAvailable" : true, "deviceType" : { "minRuntimeVersion" : 851968, "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Library\/Developer\/CoreSimulator\/Profiles\/DeviceTypes\/iPhone 11 Pro.simdevicetype", "maxRuntimeVersion" : 4294967295, "name" : "iPhone 11 Pro", "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-11-Pro", "productFamily" : "iPhone" }, "deviceTypeIdentifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-11-Pro", "state" : "Booted", "name" : "iPhone 11 Pro" } ] detox[9010] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onBootDevice({ coldBoot: false, deviceId: 'ED9068B9-5E52-404E-B689-ABA33E32E0A1', type: 'iPhone 11 Pro' }) detox[9010] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onBeforeUninstallApp({ deviceId: 'ED9068B9-5E52-404E-B689-ABA33E32E0A1', bundleId: 'io.test.ios-dev' }) detox[9010] DEBUG: [exec.js/EXEC_CMD, #2] /usr/bin/xcrun simctl uninstall ED9068B9-5E52-404E-B689-ABA33E32E0A1 io.test.ios-dev detox[9010] DEBUG: [exec.js/EXEC_TRY, #2] Uninstalling io.test.ios-dev... detox[9010] TRACE: [exec.js/EXEC_SUCCESS, #2] detox[9010] DEBUG: [exec.js/EXEC_SUCCESS, #2] io.test.ios-dev uninstalled detox[9010] DEBUG: [exec.js/EXEC_CMD, #3] /usr/bin/xcrun simctl install ED9068B9-5E52-404E-B689-ABA33E32E0A1 "/Users/kevin/Projects/test/mobile-app/ios/build/Build/Products/Debug-iphonesimulator/Test.app" detox[9010] DEBUG: [exec.js/EXEC_TRY, #3] Installing /Users/kevin/Projects/test/mobile-app/ios/build/Build/Products/Debug-iphonesimulator/Test.app... detox[9010] TRACE: [exec.js/EXEC_SUCCESS, #3] detox[9010] DEBUG: [exec.js/EXEC_SUCCESS, #3] /Users/kevin/Projects/test/mobile-app/ios/build/Build/Products/Debug-iphonesimulator/Test.app installed detox[9010] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onBeforeTerminateApp({ deviceId: 'ED9068B9-5E52-404E-B689-ABA33E32E0A1', bundleId: 'io.test.ios-dev' }) detox[9010] DEBUG: [exec.js/EXEC_CMD, #4] /usr/bin/xcrun simctl terminate ED9068B9-5E52-404E-B689-ABA33E32E0A1 io.test.ios-dev detox[9010] DEBUG: [exec.js/EXEC_TRY, #4] Terminating io.test.ios-dev... detox[9010] TRACE: [exec.js/EXEC_SUCCESS, #4] detox[9010] DEBUG: [exec.js/EXEC_SUCCESS, #4] io.test.ios-dev terminated detox[9010] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onTerminateApp({ deviceId: 'ED9068B9-5E52-404E-B689-ABA33E32E0A1', bundleId: 'io.test.ios-dev' }) detox[9010] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onBeforeLaunchApp({ bundleId: 'io.test.ios-dev', deviceId: 'ED9068B9-5E52-404E-B689-ABA33E32E0A1', launchArgs: { detoxServer: 'ws://localhost:62012', detoxSessionId: 'e836caba-d171-3480-4931-9ee02f21322b' } }) detox[9010] DEBUG: [exec.js/EXEC_CMD, #5] SIMCTL_CHILD_DYLD_INSERT_LIBRARIES="/Users/kevin/Library/Detox/ios/1027ad4db0a05cf5e2f8569ce0a4fb6f1ac16bcb/Detox.framework/Detox" /usr/bin/xcrun simctl launch ED9068B9-5E52-404E-B689-ABA33E32E0A1 io.test.ios-dev --args -detoxServer "ws://localhost:62012" -detoxSessionId "e836caba-d171-3480-4931-9ee02f21322b" -detoxDisableHierarchyDump "YES" detox[9010] DEBUG: [exec.js/EXEC_TRY, #5] Launching io.test.ios-dev... detox[9010] TRACE: [exec.js/EXEC_SUCCESS, #5] io.test.ios-dev: 9047 detox[9010] DEBUG: [exec.js/EXEC_CMD, #6] /usr/bin/xcrun simctl get_app_container ED9068B9-5E52-404E-B689-ABA33E32E0A1 io.test.ios-dev detox[9010] TRACE: [exec.js/EXEC_SUCCESS, #6] /Users/kevin/Library/Developer/CoreSimulator/Devices/ED9068B9-5E52-404E-B689-ABA33E32E0A1/data/Containers/Bundle/Application/CA9DB8EE-74C0-4BE1-9F2C-0FF3CC4D9AB0/Test.app detox[9010] INFO: [AppleSimUtils.js] io.test.ios-dev launched. To watch simulator logs, run: /usr/bin/xcrun simctl spawn ED9068B9-5E52-404E-B689-ABA33E32E0A1 log stream --level debug --style compact --predicate 'process == "Test"' detox[9047] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onLaunchApp({ bundleId: 'io.test.ios-dev', deviceId: 'ED9068B9-5E52-404E-B689-ABA33E32E0A1', launchArgs: { detoxServer: 'ws://localhost:62012', detoxSessionId: 'e836caba-d171-3480-4931-9ee02f21322b', detoxDisableHierarchyDump: 'YES' }, pid: 9047 }) detox[9010] TRACE: [AsyncWebSocket.js/WEBSOCKET_SEND] {"type":"isReady","params":{},"messageId":-1000} detox[9010] TRACE: [DetoxServer.js/MESSAGE] role=tester action=isReady (sessionId=e836caba-d171-3480-4931-9ee02f21322b) detox[9010] DEBUG: [DetoxServer.js/CANNOT_FORWARD] role=testee not connected, cannot fw action (sessionId=e836caba-d171-3480-4931-9ee02f21322b) detox[9010] DEBUG: [DetoxServer.js/LOGIN] role=testee, sessionId=e836caba-d171-3480-4931-9ee02f21322b detox[9010] DEBUG: [DetoxServer.js/LOGIN_SUCCESS] role=testee, sessionId=e836caba-d171-3480-4931-9ee02f21322b detox[9010] TRACE: [DetoxServer.js/MESSAGE] role=testee action=ready (sessionId=e836caba-d171-3480-4931-9ee02f21322b) detox[9010] TRACE: [AsyncWebSocket.js/WEBSOCKET_MESSAGE] {"type":"ready","params":{},"messageId":-1000} detox[9010] TRACE: [AsyncWebSocket.js/WEBSOCKET_SEND] {"type":"waitForActive","params":{},"messageId":1} detox[9010] TRACE: [DetoxServer.js/MESSAGE] role=tester action=waitForActive (sessionId=e836caba-d171-3480-4931-9ee02f21322b) detox[9010] TRACE: [DetoxServer.js/MESSAGE] role=testee action=waitForActiveDone (sessionId=e836caba-d171-3480-4931-9ee02f21322b) detox[9010] TRACE: [DetoxServer.js/MESSAGE] role=testee action=ready (sessionId=e836caba-d171-3480-4931-9ee02f21322b) detox[9010] TRACE: [AsyncWebSocket.js/WEBSOCKET_MESSAGE] {"type":"waitForActiveDone","params":{},"messageId":1} detox[9010] TRACE: [AsyncWebSocket.js/WEBSOCKET_MESSAGE] {"type":"ready","messageId":-1000,"params":{}} detox[9047] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onAppReady({ deviceId: 'ED9068B9-5E52-404E-B689-ABA33E32E0A1', bundleId: 'io.test.ios-dev', pid: 9047 }) detox[9010] INFO: at e2e/test.e2e.js:21:11 bafke ROOT_DESCRIBE_BLOCK[9010] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onRunDescribeStart({ name: 'ROOT_DESCRIBE_BLOCK' }) Overview[9010] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onRunDescribeStart({ name: 'Overview' }) detox[9010] INFO: Overview is assigned to ED9068B9-5E52-404E-B689-ABA33E32E0A1 {"type":"iPhone 11 Pro"} detox[9010] INFO: Overview: should open the overviewTab detox[9010] TRACE: [Detox.js/DETOX_BEFORE_EACH] running test: "Overview should open the overviewTab" detox[9010] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onTestStart({ title: 'should open the overviewTab', fullName: 'Overview should open the overviewTab', status: 'running', invocations: 1 }) detox[9010] TRACE: [AsyncWebSocket.js/WEBSOCKET_SEND] {"type":"reactNativeReload","params":{},"messageId":-1000} detox[9010] TRACE: [DetoxServer.js/MESSAGE] role=tester action=reactNativeReload (sessionId=e836caba-d171-3480-4931-9ee02f21322b) detox[9010] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onHookFailure({ error: 'Exceeded timeout of 120000 ms for a hook.\n' + 'Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test.', hook: 'beforeEach' }) detox[9010] TRACE: [Detox.js/DETOX_AFTER_EACH] failed test: "Overview should open the overviewTab" detox[9010] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onTestDone({ title: 'should open the overviewTab', fullName: 'Overview should open the overviewTab', status: 'failed', invocations: 1, timedOut: true }) detox[9010] WARN: [Client.js/PENDING_REQUESTS] App has not responded to the network requests below: (id = -1000) reactNativeReload: {} That might be the reason why the test "Overview should open the overviewTab" has timed out. detox[9010] INFO: Overview: should open the overviewTab [FAIL] Overview[9010] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onRunDescribeFinish({ name: 'Overview' }) ROOT_DESCRIBE_BLOCK[9010] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onRunDescribeFinish({ name: 'ROOT_DESCRIBE_BLOCK' }) detox[9010] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onBeforeCleanup() detox[9010] TRACE: [AsyncWebSocket.js/WEBSOCKET_SEND] {"type":"cleanup","params":{"stopRunner":true},"messageId":-49642} detox[9010] TRACE: [DetoxServer.js/MESSAGE] role=tester action=cleanup (sessionId=e836caba-d171-3480-4931-9ee02f21322b) detox[9010] TRACE: [DetoxServer.js/MESSAGE] role=testee action=cleanupDone (sessionId=e836caba-d171-3480-4931-9ee02f21322b) detox[9010] TRACE: [AsyncWebSocket.js/WEBSOCKET_MESSAGE] {"params":{},"type":"cleanupDone","messageId":-49642} detox[9010] DEBUG: [DetoxServer.js/DISCONNECT] role=tester, sessionId=e836caba-d171-3480-4931-9ee02f21322b detox[9010] DEBUG: [DetoxServer.js/DISCONNECT] role=testee, sessionId=e836caba-d171-3480-4931-9ee02f21322b detox[9010] DEBUG: [DetoxServer.js/CANNOT_FORWARD] role=tester not connected, cannot fw action (sessionId=e836caba-d171-3480-4931-9ee02f21322b) detox[9010] DEBUG: [DetoxServer.js/WS_CLOSE] Detox server connections terminated gracefully FAIL e2e/test.e2e.js (133.272 s) Overview ✕ should open the overviewTab (120006 ms) ● Overview › should open the overviewTab thrown: "Exceeded timeout of 120000 ms for a hook. Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test." 1 | describe('Overview', () => { > 2 | beforeEach(async () => { | ^ 3 | await device.reloadReactNative(); 4 | }); 5 | at test.e2e.js:2:3 at Object.<anonymous> (test.e2e.js:1:1) detox[9009] ERROR: [cli.js] Error: Command failed: jest --config e2e/config.json --testNamePattern '^((?!:android:).)*$' --maxWorkers 1 e2e Edit I managed to get some more info by using detox test --debug-synchronization 200 from the Synchronization troubleshooting and that resulted in constant logs of detox[12636] INFO: [actions.js] Sync WXRunLoopIdlingResource: React Native thread is busy. detox[12636] INFO: [actions.js] Sync Dispatch Queue: com.apple.main-thread and one log about a call to firebase logging that wasn't getting fulfilled. When I also use --loglevel trace I get this log constantly: detox[12636] INFO: [actions.js] Sync WXRunLoopIdlingResource: React Native thread is busy. detox[12636] INFO: [actions.js] Sync Dispatch Queue: com.apple.main-thread detox[12636] TRACE: [AsyncWebSocket.js/WEBSOCKET_SEND] {"type":"currentStatus","params":{},"messageId":15} detox[12636] TRACE: [DetoxServer.js/MESSAGE] role=tester action=currentStatus (sessionId=d7428263-4169-e8b4-756d-cc5b3c3d0f73) detox[12636] TRACE: [DetoxServer.js/MESSAGE] role=testee action=currentStatusResult (sessionId=d7428263-4169-e8b4-756d-cc5b3c3d0f73) detox[12636] TRACE: [AsyncWebSocket.js/WEBSOCKET_MESSAGE] {"type":"currentStatusResult","params":{"state":"busy","resources":[{"name":"WXRunLoopIdlingResource","info":{"runLoop":"<CFRunLoop 0x600000c7c700 [0x7fff8002e8c0]>{wakeup port = 0x5a17, stopped = false, ignoreWakeUps = true, \ncurrent mode = (none),\ncommon modes = <CFBasicHash 0x600003e18f30 [0x7fff8002e8c0]>{type = mutable set, count = 1,\nentries =>\n\t2 : <CFString 0x7fff801ab7e8 [0x7fff8002e8c0]>{contents = \"kCFRunLoopDefaultMode\"}\n}\n,\ncommon mode items = <CFBasicHash 0x600003e1bcf0 [0x7fff8002e8c0]>{type = mutable set, count = 4,\nentries =>\n\t0 : <CFRunLoopSource 0x60000057ae80 [0x7fff8002e8c0]>{signalled = No, valid = Yes, order = 0, context = <CFRunLoopSource context>{version = 0, info = 0x60000322ab60, callout = __NSThreadPerformPerform (0x7fff208581ee)}}\n\t2 : <CFRunLoopSource 0x600000519ec0 [0x7fff8002e8c0]>{signalled = No, valid = Yes, order = 0, context = <CFRunLoopSource context>{version = 0, info = 0x60000320e470, callout = __NSThreadPerformPerform (0x7fff208581ee)}}\n\t3 : <CFRunLoopSource 0x600000564a80 [0x7fff8002e8c0]>{signalled = Yes, valid = Yes, order = 0, context = <CFRunLoopSource context>{version = 0, info = 0x114fc0000, callout = _ZN3WTF7RunLoop11performWorkEPv (0x7fff32220270)}}\n\t4 : <CFRunLoopTimer 0x6000005600c0 [0x7fff8002e8c0]>{valid = Yes, firing = No, interval = 0, tolerance = 0, next fire date = 630235923 (486.399006 # 357970975424457), callout = _ZZN3WTF7RunLoop9TimerBase5startENS_7SecondsEbEN3$_18__invokeEP16__CFRunLoopTimerPv (0x7fff32220bb0 / 0x7fff32220bb0) (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/JavaScriptCore.framework/JavaScriptCore), context = <CFRunLoopTimer context 0x114ff65a0>}\n}\n,\nmodes = <CFBasicHash 0x600003e1bdb0 [0x7fff8002e8c0]>{type = mutable set, count = 2,\nentries =>\n\t0 : <CFRunLoopMode 0x600000b044e0 [0x7fff8002e8c0]>{name = kCFRunLoopCommonModes, port set = 0xc307, queue = 0x600001e13a80, source = 0x600001e12c00 (not fired), timer port = 0xc503, \n\tsources0 = (null),\n\tsources1 = (null),\n\tobservers = (null),\n\ttimers = (null),\n\tcurrently 630235437 (357484576475625) / soft deadline in: 1.84463866e+10 sec (# -1) / hard deadline in: 1.84463866e+10 sec (# -1)\n},\n\n\t2 : <CFRunLoopMode 0x600000b6cdd0 [0x7fff8002e8c0]>{name = kCFRunLoopDefaultMode, port set = 0x13a0f, queue = 0x600001e3e800, source = 0x600001e3db00 (not fired), timer port = 0x13c27, \n\tsources0 = <CFBasicHash 0x600003e1a7c0 [0x7fff8002e8c0]>{type = mutable set, count = 0,\nentries =>\n}\n,\n\tsources1 = <CFBasicHash 0x600003e1bea0 [0x7fff8002e8c0]>{type = mutable set, count = 0,\nentries =>\n}\n,\n\tobservers = (\n \"<CFRunLoopObserver 0x600000112b20 [0x7fff8002e8c0]>{valid = Yes, activities = 0xe7, repeats = Yes, order = 0, callout = _runLoopObserverWithBlockContext (0x7fff2038c504), context = <CFRunLoopObserver context 0x600003ec0090>}\"\n),\n\ttimers = <CFArray 0x600001455f20 [0x7fff8002e8c0]>{type = mutable-small, count = 1, values = (\n\t0 : <CFRunLoopTimer 0x6000005600c0 [0x7fff8002e8c0]>{valid = Yes, firing = No, interval = 0, tolerance = 0, next fire date = 630235923 (486.398864 # 357970975424457), callout = _ZZN3WTF7RunLoop9TimerBase5startENS_7SecondsEbEN3$_18__invokeEP16__CFRunLoopTimerPv (0x7fff32220bb0 / 0x7fff32220bb0) (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/JavaScriptCore.framework/JavaScriptCore), context = <CFRunLoopTimer context 0x114ff65a0>}\n)},\n\tcurrently 630235437 (357484576488240) / soft deadline in: 486.398936 sec (# 357970975424457) / hard deadline in: 486.398936 sec (# 357970975424457)\n},\n\n}\n}\n","prettyPrint":"React Native thread is busy."}},{"name":"Dispatch Queue","info":{"queue":"<OS_dispatch_queue_main: com.apple.main-thread[0x7fff86d30c80] = { xref = -2147483648, ref = -2147483648, sref = 1, target = com.apple.root.default-qos.overcommit[0x7fff86d31100], width = 0x1, state = 0x001ffe9000000300, dirty, in-flight = 0, thread = 0x303 }>","prettyPrint":"com.apple.main-thread"}}],"messageId":15},"messageId":15} So I'm going to continue to check out where this might be coming from. I tried adding logs from the very beginning of the source code, but nothing seems to be coming through though.
JWT expired at 2020-05-13T07:50:39Z. Current time: 2020-05-16T21:29:41Z. I got this error after expiration of my jwt as log error says
My log error This is.. Anything more if needed then please comment below. I think this is the issue i am getting for expiration time. But i want to know how to solve this type of issue if get in future. How to basically solve this issue. can i create jwt token everytime after time expiration? . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v2.2.2.RELEASE) 2020-05-16 21:29:23.574 INFO 5924 --- [ main] .j.a.SpringSecurityJwtExampleApplication : Starting SpringSecurityJwtExampleApplication on S-PC with PID 5924 (D:\eclipse-workspace\spring-security-jwt-example-master\target\classes started by S in D:\eclipse-workspace\spring-security-jwt-example-master) 2020-05-16 21:29:23.592 INFO 5924 --- [ main] .j.a.SpringSecurityJwtExampleApplication : No active profile set, falling back to default profiles: default 2020-05-16 21:29:25.301 INFO 5924 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode. 2020-05-16 21:29:25.461 INFO 5924 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 140ms. Found 1 JPA repository interfaces. 2020-05-16 21:29:26.478 INFO 5924 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2020-05-16 21:29:27.421 INFO 5924 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 9002 (http) 2020-05-16 21:29:27.440 INFO 5924 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2020-05-16 21:29:27.441 INFO 5924 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.29] 2020-05-16 21:29:27.721 INFO 5924 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2020-05-16 21:29:27.721 INFO 5924 --- [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 4002 ms 2020-05-16 21:29:28.065 INFO 5924 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting... 2020-05-16 21:29:28.071 WARN 5924 --- [ main] com.zaxxer.hikari.util.DriverDataSource : Registered driver with driverClassName=com.mysql.jdbc.Driver was not found, trying direct instantiation. Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary. 2020-05-16 21:29:29.294 INFO 5924 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed. 2020-05-16 21:29:29.438 INFO 5924 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default] 2020-05-16 21:29:29.596 INFO 5924 --- [ main] org.hibernate.Version : HHH000412: Hibernate Core {5.4.9.Final} 2020-05-16 21:29:29.953 INFO 5924 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.0.Final} 2020-05-16 21:29:30.264 INFO 5924 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQL8Dialect 2020-05-16 21:29:31.640 INFO 5924 --- [ main] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform] 2020-05-16 21:29:31.689 INFO 5924 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default' 2020-05-16 21:29:32.511 WARN 5924 --- [ main] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning 2020-05-16 21:29:32.959 INFO 5924 --- [ main] o.s.s.web.DefaultSecurityFilterChain : Creating filter chain: any request, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter#47eaf55c, org.springframework.security.web.context.SecurityContextPersistenceFilter#994544, org.springframework.security.web.header.HeaderWriterFilter#1d944fc0, org.springframework.security.web.authentication.logout.LogoutFilter#2c16677c, com.javatechie.jwt.api.filter.JwtFilter#65859b44, org.springframework.security.web.savedrequest.RequestCacheAwareFilter#6f0c45f4, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter#3335afcf, org.springframework.security.web.authentication.AnonymousAuthenticationFilter#2c0798bd, org.springframework.security.web.session.SessionManagementFilter#7548e1fb, org.springframework.security.web.access.ExceptionTranslationFilter#30cafd13, org.springframework.security.web.access.intercept.FilterSecurityInterceptor#1f39269d] 2020-05-16 21:29:33.324 INFO 5924 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor' 2020-05-16 21:29:34.331 INFO 5924 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 9002 (http) with context path '' 2020-05-16 21:29:34.335 INFO 5924 --- [ main] .j.a.SpringSecurityJwtExampleApplication : Started SpringSecurityJwtExampleApplication in 12.188 seconds (JVM running for 13.014) 2020-05-16 21:29:40.858 INFO 5924 --- [nio-9002-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet' 2020-05-16 21:29:40.859 INFO 5924 --- [nio-9002-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet' 2020-05-16 21:29:40.880 INFO 5924 --- [nio-9002-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 21 ms 2020-05-16 21:29:41.080 ERROR 5924 --- [nio-9002-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception io.jsonwebtoken.ExpiredJwtException: JWT expired at 2020-05-13T07:50:39Z. Current time: 2020-05-16T21:29:41Z, a difference of 308342064 milliseconds. Allowed clock skew: 0 milliseconds. at io.jsonwebtoken.impl.DefaultJwtParser.parse(DefaultJwtParser.java:385) ~[jjwt-0.9.1.jar:0.9.1] at io.jsonwebtoken.impl.DefaultJwtParser.parse(DefaultJwtParser.java:481) ~[jjwt-0.9.1.jar:0.9.1] at io.jsonwebtoken.impl.DefaultJwtParser.parseClaimsJws(DefaultJwtParser.java:541) ~[jjwt-0.9.1.jar:0.9.1] at com.javatechie.jwt.api.util.JwtUtil.extractAllClaims(JwtUtil.java:32) ~[classes/:na] at com.javatechie.jwt.api.util.JwtUtil.extractClaim(JwtUtil.java:28) ~[classes/:na] at com.javatechie.jwt.api.util.JwtUtil.extractUsername(JwtUtil.java:20) ~[classes/:na] at com.javatechie.jwt.api.filter.JwtFilter.doFilterInternal(JwtFilter.java:38) ~[classes/:na] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.2.1.RELEASE.jar:5.2.1.RELEASE] at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116) ~[spring-security-web-5.2.1.RELEASE.jar:5.2.1.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.2.1.RELEASE.jar:5.2.1.RELEASE] at org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:92) ~[spring-security-web-5.2.1.RELEASE.jar:5.2.1.RELEASE] at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:77) ~[spring-security-web-5.2.1.RELEASE.jar:5.2.1.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.2.1.RELEASE.jar:5.2.1.RELEASE] at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105) ~[spring-security-web-5.2.1.RELEASE.jar:5.2.1.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.2.1.RELEASE.jar:5.2.1.RELEASE] at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56) ~[spring-security-web-5.2.1.RELEASE.jar:5.2.1.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.2.1.RELEASE.jar:5.2.1.RELEASE] at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:215) ~[spring-security-web-5.2.1.RELEASE.jar:5.2.1.RELEASE] at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178) ~[spring-security-web-5.2.1.RELEASE.jar:5.2.1.RELEASE] at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:358) ~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE] at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:271) ~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.29.jar:9.0.29] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.29.jar:9.0.29] at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.29.jar:9.0.29] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.29.jar:9.0.29] at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.29.jar:9.0.29] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.29.jar:9.0.29] at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.29.jar:9.0.29] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.29.jar:9.0.29] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) ~[tomcat-embed-core-9.0.29.jar:9.0.29] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-9.0.29.jar:9.0.29] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:526) [tomcat-embed-core-9.0.29.jar:9.0.29] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) [tomcat-embed-core-9.0.29.jar:9.0.29] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [tomcat-embed-core-9.0.29.jar:9.0.29] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) [tomcat-embed-core-9.0.29.jar:9.0.29] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [tomcat-embed-core-9.0.29.jar:9.0.29] at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:367) [tomcat-embed-core-9.0.29.jar:9.0.29] at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) [tomcat-embed-core-9.0.29.jar:9.0.29] at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:860) [tomcat-embed-core-9.0.29.jar:9.0.29] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1591) [tomcat-embed-core-9.0.29.jar:9.0.29] at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-9.0.29.jar:9.0.29] at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.8.0_251] at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.8.0_251] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-9.0.29.jar:9.0.29] at java.lang.Thread.run(Unknown Source) [na:1.8.0_251] This is my JwtUtil class. I have created a time limit of expiration of 10 hours. package com.sushovan.jwt.security.jwtutil; //import java.security.Signature; import java.util.Date; import java.util.HashMap; import java.util.Map; import java.util.function.Function; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.stereotype.Service; import io.jsonwebtoken.Claims; import io.jsonwebtoken.Jwts; import io.jsonwebtoken.SignatureAlgorithm; #Service public class MyJwtUtil { private String secret = "sushovan"; public <T> T extractClaims(String token, Function<Claims,T> claimResolver) { final Claims claims = extractAllClaims(token); return claimResolver.apply(claims); } private Claims extractAllClaims(String token) { return Jwts.parser().setSigningKey(secret).parseClaimsJws(token).getBody(); } public String extractUserName(String token) { return extractClaims(token, Claims::getSubject); } public Date extractexpiration(String token) { return extractClaims(token, Claims::getExpiration); } private Boolean isTokenExpired(String token) { return extractexpiration(token).before(new Date()); } public String generateToken(String username) { Map<String,Object> claims = new HashMap<>(); return createToken(claims, username); } private String createToken(Map<String, Object> claims, String subject) { return Jwts.builder().setClaims(claims).setSubject(subject).setIssuedAt(new Date(System.currentTimeMillis())) .setExpiration(new Date(System.currentTimeMillis() + 1000 * 60 * 60 * 10)) .signWith(SignatureAlgorithm.HS256, secret).compact(); } public Boolean validateToken(String token, UserDetails userDetails) { final String username = extractUserName(token); return (username.equals(userDetails.getUsername()) && !isTokenExpired(token)); } }
logstash Twitter error when geo_enable=true
I am trying to connect logstash to twitter. All the twitter that user.geo_enabled=false parsed ok, but of the other hand if user.geo_enabled=true I receive this error: Failed action. {:status=>400, :action=>["index", {:_id=>nil, :_index=>"twitter", :_type=>"logs", :_routing=>nil}, #<LogStash::Event:0xb1b69ba #metadata_accessors=#<LogStash::Util::Accessors:0x74b553ef #store={}, #lut={}>, #cancelled=false, #data={"created_at"=>"Wed Jul 06 16:15:26 +0000 2016", "id"=>750724847626493953, "id_str"=>"750724847626493953", "text"=>"#HillaryClinton I would never vote for you", "source"=>"Twitter for Android", "truncated"=>false, "in_reply_to_status_id"=>nil, "in_reply_to_status_id_str"=>nil, "in_reply_to_user_id"=>1339835893, "in_reply_to_user_id_str"=>"1339835893", "in_reply_to_screen_name"=>"HillaryClinton", "user"=>{"id"=>772001468, "id_str"=>"772001468", "name"=>"charles c hutchison", "screen_name"=>"49_mail", "location"=>nil, "url"=>nil, "description"=>nil, "protected"=>false, "verified"=>false, "followers_count"=>8, "friends_count"=>99, "listed_count"=>0, "favourites_count"=>8, "statuses_count"=>176, "created_at"=>"Tue Aug 21 18:22:06 +0000 2012", "utc_offset"=>nil, "time_zone"=>nil, "geo_enabled"=>true, "lang"=>"en", "contributors_enabled"=>false, "is_translator"=>false, "profile_background_color"=>"C0DEED", "profile_background_image_url"=>"http://abs.twimg.com/images/themes/theme1/bg.png", "profile_background_image_url_https"=>"https://abs.twimg.com/images/themes/theme1/bg.png", "profile_background_tile"=>false, "profile_link_color"=>"0084B4", "profile_sidebar_border_color"=>"C0DEED", "profile_sidebar_fill_color"=>"DDEEF6", "profile_text_color"=>"333333", "profile_use_background_image"=>true, "profile_image_url"=>"http://abs.twimg.com/sticky/default_profile_images/default_profile_0_normal.png", "profile_image_url_https"=>"https://abs.twimg.com/sticky/default_profile_images/default_profile_0_normal.png", "default_profile"=>true, "default_profile_image"=>true, "following"=>nil, "follow_request_sent"=>nil, "notifications"=>nil}, "geo"=>{"type"=>"Point", "coordinates"=>[#<BigDecimal:6d26d63b,'0.384274583E2',9(12)>, #<BigDecimal:43f314b6,'-0.823958636E2',9(12)>]}, "coordinates"=>{"type"=>"Point", "coordinates"=>[#<BigDecimal:669bf464,'-0.823958636E2',9(12)>, #<BigDecimal:3d160aa5,'0.384274583E2',9(12)>]}, "place"=>{"id"=>"e4197a23034fa912", "url"=>"https://api.twitter.com/1.1/geo/id/e4197a23034fa912.json", "place_type"=>"city", "name"=>"Huntington", "full_name"=>"Huntington, WV", "country_code"=>"US", "country"=>"United States", "bounding_box"=>{"type"=>"Polygon", "coordinates"=>[[[#<BigDecimal:4feaddd3,'-0.82530433E2',8(12)>, #<BigDecimal:5438cd7c,'0.38375981E2',8(12)>], [#<BigDecimal:413b49ac,'-0.82530433E2',8(12)>, #<BigDecimal:58a6101d,'0.38439347E2',8(12)>], [#<BigDecimal:445e692e,'-0.82349236E2',8(12)>, #<BigDecimal:5f332e20,'0.38439347E2',8(12)>], [#<BigDecimal:46c19531,'-0.82349236E2',8(12)>, #<BigDecimal:71e183de,'0.38375981E2',8(12)>]]]}, "attributes"=>{}}, "contributors"=>nil, "is_quote_status"=>false, "retweet_count"=>0, "favorite_count"=>0, "entities"=>{"hashtags"=>[], "urls"=>[], "user_mentions"=>[{"screen_name"=>"HillaryClinton", "name"=>"Hillary Clinton", "id"=>1339835893, "id_str"=>"1339835893", "indices"=>[0, 15]}], "symbols"=>[]}, "favorited"=>false, "retweeted"=>false, "filter_level"=>"low", "lang"=>"en", "timestamp_ms"=>"1467821726124", "#version"=>"1", "#timestamp"=>"2016-07-06T16:15:26.000Z"}, #metadata={}, #accessors=#<LogStash::Util::Accessors:0x40cb306f #store={"created_at"=>"Wed Jul 06 16:15:26 +0000 2016", "id"=>750724847626493953, "id_str"=>"750724847626493953", "text"=>"#HillaryClinton I would never vote for you", "source"=>"Twitter for Android", "truncated"=>false, "in_reply_to_status_id"=>nil, "in_reply_to_status_id_str"=>nil, "in_reply_to_user_id"=>1339835893, "in_reply_to_user_id_str"=>"1339835893", "in_reply_to_screen_name"=>"HillaryClinton", "user"=>{"id"=>772001468, "id_str"=>"772001468", "name"=>"charles c hutchison", "screen_name"=>"49_mail", "location"=>nil, "url"=>nil, "description"=>nil, "protected"=>false, "verified"=>false, "followers_count"=>8, "friends_count"=>99, "listed_count"=>0, "favourites_count"=>8, "statuses_count"=>176, "created_at"=>"Tue Aug 21 18:22:06 +0000 2012", "utc_offset"=>nil, "time_zone"=>nil, "geo_enabled"=>true, "lang"=>"en", "contributors_enabled"=>false, "is_translator"=>false, "profile_background_color"=>"C0DEED", "profile_background_image_url"=>"http://abs.twimg.com/images/themes/theme1/bg.png", "profile_background_image_url_https"=>"https://abs.twimg.com/images/themes/theme1/bg.png", "profile_background_tile"=>false, "profile_link_color"=>"0084B4", "profile_sidebar_border_color"=>"C0DEED", "profile_sidebar_fill_color"=>"DDEEF6", "profile_text_color"=>"333333", "profile_use_background_image"=>true, "profile_image_url"=>"http://abs.twimg.com/sticky/default_profile_images/default_profile_0_normal.png", "profile_image_url_https"=>"https://abs.twimg.com/sticky/default_profile_images/default_profile_0_normal.png", "default_profile"=>true, "default_profile_image"=>true, "following"=>nil, "follow_request_sent"=>nil, "notifications"=>nil}, "geo"=>{"type"=>"Point", "coordinates"=>[#<BigDecimal:6d26d63b,'0.384274583E2',9(12)>, #<BigDecimal:43f314b6,'-0.823958636E2',9(12)>]}, "coordinates"=>{"type"=>"Point", "coordinates"=>[#<BigDecimal:669bf464,'-0.823958636E2',9(12)>, #<BigDecimal:3d160aa5,'0.384274583E2',9(12)>]}, "place"=>{"id"=>"e4197a23034fa912", "url"=>"https://api.twitter.com/1.1/geo/id/e4197a23034fa912.json", "place_type"=>"city", "name"=>"Huntington", "full_name"=>"Huntington, WV", "country_code"=>"US", "country"=>"United States", "bounding_box"=>{"type"=>"Polygon", "coordinates"=>[[[#<BigDecimal:4feaddd3,'-0.82530433E2',8(12)>, #<BigDecimal:5438cd7c,'0.38375981E2',8(12)>], [#<BigDecimal:413b49ac,'-0.82530433E2',8(12)>, #<BigDecimal:58a6101d,'0.38439347E2',8(12)>], [#<BigDecimal:445e692e,'-0.82349236E2',8(12)>, #<BigDecimal:5f332e20,'0.38439347E2',8(12)>], [#<BigDecimal:46c19531,'-0.82349236E2',8(12)>, #<BigDecimal:71e183de,'0.38375981E2',8(12)>]]]}, "attributes"=>{}}, "contributors"=>nil, "is_quote_status"=>false, "retweet_count"=>0, "favorite_count"=>0, "entities"=>{"hashtags"=>[], "urls"=>[], "user_mentions"=>[{"screen_name"=>"HillaryClinton", "name"=>"Hillary Clinton", "id"=>1339835893, "id_str"=>"1339835893", "indices"=>[0, 15]}], "symbols"=>[]}, "favorited"=>false, "retweeted"=>false, "filter_level"=>"low", "lang"=>"en", "timestamp_ms"=>"1467821726124", "#version"=>"1", "#timestamp"=>"2016-07-06T16:15:26.000Z"}, #lut={"in-reply-to"=>[{"created_at"=>"Wed Jul 06 16:15:26 +0000 2016", "id"=>750724847626493953, "id_str"=>"750724847626493953", "text"=>"#HillaryClinton I would never vote for you", "source"=>"Twitter for Android", "truncated"=>false, "in_reply_to_status_id"=>nil, "in_reply_to_status_id_str"=>nil, "in_reply_to_user_id"=>1339835893, "in_reply_to_user_id_str"=>"1339835893", "in_reply_to_screen_name"=>"HillaryClinton", "user"=>{"id"=>772001468, "id_str"=>"772001468", "name"=>"charles c hutchison", "screen_name"=>"49_mail", "location"=>nil, "url"=>nil, "description"=>nil, "protected"=>false, "verified"=>false, "followers_count"=>8, "friends_count"=>99, "listed_count"=>0, "favourites_count"=>8, "statuses_count"=>176, "created_at"=>"Tue Aug 21 18:22:06 +0000 2012", "utc_offset"=>nil, "time_zone"=>nil, "geo_enabled"=>true, "lang"=>"en", "contributors_enabled"=>false, "is_translator"=>false, "profile_background_color"=>"C0DEED", "profile_background_image_url"=>"http://abs.twimg.com/images/themes/theme1/bg.png", "profile_background_image_url_https"=>"https://abs.twimg.com/images/themes/theme1/bg.png", "profile_background_tile"=>false, "profile_link_color"=>"0084B4", "profile_sidebar_border_color"=>"C0DEED", "profile_sidebar_fill_color"=>"DDEEF6", "profile_text_color"=>"333333", "profile_use_background_image"=>true, "profile_image_url"=>"http://abs.twimg.com/sticky/default_profile_images/default_profile_0_normal.png", "profile_image_url_https"=>"https://abs.twimg.com/sticky/default_profile_images/default_profile_0_normal.png", "default_profile"=>true, "default_profile_image"=>true, "following"=>nil, "follow_request_sent"=>nil, "notifications"=>nil}, "geo"=>{"type"=>"Point", "coordinates"=>[#<BigDecimal:6d26d63b,'0.384274583E2',9(12)>, #<BigDecimal:43f314b6,'-0.823958636E2',9(12)>]}, "coordinates"=>{"type"=>"Point", "coordinates"=>[#<BigDecimal:669bf464,'-0.823958636E2',9(12)>, #<BigDecimal:3d160aa5,'0.384274583E2',9(12)>]}, "place"=>{"id"=>"e4197a23034fa912", "url"=>"https://api.twitter.com/1.1/geo/id/e4197a23034fa912.json", "place_type"=>"city", "name"=>"Huntington", "full_name"=>"Huntington, WV", "country_code"=>"US", "country"=>"United States", "bounding_box"=>{"type"=>"Polygon", "coordinates"=>[[[#<BigDecimal:4feaddd3,'-0.82530433E2',8(12)>, #<BigDecimal:5438cd7c,'0.38375981E2',8(12)>], [#<BigDecimal:413b49ac,'-0.82530433E2',8(12)>, #<BigDecimal:58a6101d,'0.38439347E2',8(12)>], [#<BigDecimal:445e692e,'-0.82349236E2',8(12)>, #<BigDecimal:5f332e20,'0.38439347E2',8(12)>], [#<BigDecimal:46c19531,'-0.82349236E2',8(12)>, #<BigDecimal:71e183de,'0.38375981E2',8(12)>]]]}, "attributes"=>{}}, "contributors"=>nil, "is_quote_status"=>false, "retweet_count"=>0, "favorite_count"=>0, "entities"=>{"hashtags"=>[], "urls"=>[], "user_mentions"=>[{"screen_name"=>"HillaryClinton", "name"=>"Hillary Clinton", "id"=>1339835893, "id_str"=>"1339835893", "indices"=>[0, 15]}], "symbols"=>[]}, "favorited"=>false, "retweeted"=>false, "filter_level"=>"low", "lang"=>"en", "timestamp_ms"=>"1467821726124", "#version"=>"1", "#timestamp"=>"2016-07-06T16:15:26.000Z"}, "in-reply-to"], "type"=>[{"created_at"=>"Wed Jul 06 16:15:26 +0000 2016", "id"=>750724847626493953, "id_str"=>"750724847626493953", "text"=>"#HillaryClinton I would never vote for you", "source"=>"Twitter for Android", "truncated"=>false, "in_reply_to_status_id"=>nil, "in_reply_to_status_id_str"=>nil, "in_reply_to_user_id"=>1339835893, "in_reply_to_user_id_str"=>"1339835893", "in_reply_to_screen_name"=>"HillaryClinton", "user"=>{"id"=>772001468, "id_str"=>"772001468", "name"=>"charles c hutchison", "screen_name"=>"49_mail", "location"=>nil, "url"=>nil, "description"=>nil, "protected"=>false, "verified"=>false, "followers_count"=>8, "friends_count"=>99, "listed_count"=>0, "favourites_count"=>8, "statuses_count"=>176, "created_at"=>"Tue Aug 21 18:22:06 +0000 2012", "utc_offset"=>nil, "time_zone"=>nil, "geo_enabled"=>true, "lang"=>"en", "contributors_enabled"=>false, "is_translator"=>false, "profile_background_color"=>"C0DEED", "profile_background_image_url"=>"http://abs.twimg.com/images/themes/theme1/bg.png", "profile_background_image_url_https"=>"https://abs.twimg.com/images/themes/theme1/bg.png", "profile_background_tile"=>false, "profile_link_color"=>"0084B4", "profile_sidebar_border_color"=>"C0DEED", "profile_sidebar_fill_color"=>"DDEEF6", "profile_text_color"=>"333333", "profile_use_background_image"=>true, "profile_image_url"=>"http://abs.twimg.com/sticky/default_profile_images/default_profile_0_normal.png", "profile_image_url_https"=>"https://abs.twimg.com/sticky/default_profile_images/default_profile_0_normal.png", "default_profile"=>true, "default_profile_image"=>true, "following"=>nil, "follow_request_sent"=>nil, "notifications"=>nil}, "geo"=>{"type"=>"Point", "coordinates"=>[#<BigDecimal:6d26d63b,'0.384274583E2',9(12)>, #<BigDecimal:43f314b6,'-0.823958636E2',9(12)>]}, "coordinates"=>{"type"=>"Point", "coordinates"=>[#<BigDecimal:669bf464,'-0.823958636E2',9(12)>, #<BigDecimal:3d160aa5,'0.384274583E2',9(12)>]}, "place"=>{"id"=>"e4197a23034fa912", "url"=>"https://api.twitter.com/1.1/geo/id/e4197a23034fa912.json", "place_type"=>"city", "name"=>"Huntington", "full_name"=>"Huntington, WV", "country_code"=>"US", "country"=>"United States", "bounding_box"=>{"type"=>"Polygon", "coordinates"=>[[[#<BigDecimal:4feaddd3,'-0.82530433E2',8(12)>, #<BigDecimal:5438cd7c,'0.38375981E2',8(12)>], [#<BigDecimal:413b49ac,'-0.82530433E2',8(12)>, #<BigDecimal:58a6101d,'0.38439347E2',8(12)>], [#<BigDecimal:445e692e,'-0.82349236E2',8(12)>, #<BigDecimal:5f332e20,'0.38439347E2',8(12)>], [#<BigDecimal:46c19531,'-0.82349236E2',8(12)>, #<BigDecimal:71e183de,'0.38375981E2',8(12)>]]]}, "attributes"=>{}}, "contributors"=>nil, "is_quote_status"=>false, "retweet_count"=>0, "favorite_count"=>0, "entities"=>{"hashtags"=>[], "urls"=>[], "user_mentions"=>[{"screen_name"=>"HillaryClinton", "name"=>"Hillary Clinton", "id"=>1339835893, "id_str"=>"1339835893", "indices"=>[0, 15]}], "symbols"=>[]}, "favorited"=>false, "retweeted"=>false, "filter_level"=>"low", "lang"=>"en", "timestamp_ms"=>"1467821726124", "#version"=>"1", "#timestamp"=>"2016-07-06T16:15:26.000Z"}, "type"]}>>], :response=>{"create"=>{"_index"=>"twitter", "_type"=>"logs", "_id"=>"AVXA_h0IgT1Xitpna0uT", "status"=>400, "error"=>{"type"=>"mapper_parsing_exception", "reason"=>"failed to parse", "caused_by"=>{"type"=>"illegal_state_exception", "reason"=>"Mixing up field types: class org.elasticsearch.index.mapper.core.DoubleFieldMapper$DoubleFieldType != class org.elasticsearch.index.mapper.geo.BaseGeoPointFieldMapper$GeoPointFieldType on field coordinates.coordinates"}}}}, :level=>:warn} I think that the relevent line is {"create"=>{"_index"=>"twitter", "_type"=>"logs", "_id"=>"AVXA_h0IgT1Xitpna0uT", "status"=>400, "error"=>{"type"=>"mapper_parsing_exception", "reason"=>"failed to parse", "caused_by"=>{"type"=>"illegal_state_exception", "reason"=>"Mixing up field types: class org.elasticsearch.index.mapper.core.DoubleFieldMapper$DoubleFieldType != class org.elasticsearch.index.mapper.geo.BaseGeoPointFieldMapper$GeoPointFieldType on field coordinates.coordinates"}}}}, :level=>:warn} my template is : { "template": "twitter", "order": 1, "settings": { "number_of_shards": 1 }, "mappings": { "tweet": { "_all": { "enabled": false }, "properties": { "coordinates": { "properties": { "coordinates": { "type": "geo_point" }, "type": { "type": "string" } } } } } } } What can be the problem?? thanks.
The problem is that the field coordinates.coordinates in ES expect a type of data which is not the type received. A solution would be to modify the template, removing the coordinates type. Then you delete your index and reindex your data. In that case the expected type of coordinates.coordinates will be dependent on the data inserted. That should resolve the problem.
Print a particular object from json in ruby
How do I print only the text from the json. I am working on ruby on rails app. tweets = JSON.parse(response.body) tweets.each do |tweet| "#{tweet["text"]}" end I tried the above code bt it displays the whole json. Response.body : [{"created_at"=>"Mon Jun 09 02:49:17 +0000 2014", "id"=>475831972812423168, "id_str"=>"475831972812423168", "text"=>"#debalec #DIST1", "source"=>"https://dev.twitter.com/docs/tfw\" rel=\"nofollow\">Twitter for Websites", "truncated"=>false, "in_reply_to_status_id"=>nil, "in_reply_to_status_id_str"=>nil, "in_reply_to_user_id"=>2551123651, "in_reply_to_user_id_str"=>"2551123651", "in_reply_to_screen_name"=>"debalec", "user"=>{"id"=>1551421092, "id_str"=>"1551421092", "name"=>"The Third", "screen_name"=>"thethird", "location"=>"", "description"=>"", "url"=>nil, "entities"=>{"description"=>{"urls"=>[]}}, "protected"=>false, "followers_count"=>12, "friends_count"=>199, "listed_count"=>0, "created_at"=>"Thu Jun 27 20:24:56 +0000 2013", "favourites_count"=>54, "utc_offset"=>nil, "time_zone"=>nil, "geo_enabled"=>false, "verified"=>false, "statuses_count"=>82, "lang"=>"en", "contributors_enabled"=>false, "is_translator"=>false, "is_translation_enabled"=>false, "profile_background_color"=>"59BEE4", "profile_background_image_url"=>"http://pbs.twimg.com/profile_background_images/378800000083038715/7b1cad0896d22d75b85f5f86fc69b59f.jpeg", "profile_background_image_url_https"=>"https://pbs.twimg.com/profile_background_images/378800000083038715/7b1cad0896d22d75b85f5f86fc69b59f.jpeg", "profile_background_tile"=>false, "profile_image_url"=>"http://abs.twimg.com/sticky/default_profile_images/default_profile_4_normal.png", "profile_image_url_https"=>"https://abs.twimg.com/sticky/default_profile_images/default_profile_4_normal.png", "profile_link_color"=>"8FCAE0", "profile_sidebar_border_color"=>"4BB7DF", "profile_sidebar_fill_color"=>"191F22", "profile_text_color"=>"4BB7DF", "profile_use_background_image"=>true, "default_profile"=>false, "default_profile_image"=>true, "following"=>false, "follow_request_sent"=>false, "notifications"=>false}, "geo"=>nil, "coordinates"=>nil, "place"=>nil, "contributors"=>nil, "retweet_count"=>0, "favorite_count"=>0, "entities"=>{"hashtags"=>[{"text"=>"DIST1", "indices"=>[10, 16]}], "symbols"=>[], "urls"=>[], "user_mentions"=>[{"screen_name"=>"debalec", "name"=>"DebaElec", "id"=>2551123651, "id_str"=>"2551123651", "indices"=>[0, 8]}]}, "favorited"=>false, "retweeted"=>false, "lang"=>"und"}, {"created_at"=>"Fri Jun 06 22:41:39 +0000 2014", "id"=>475044876841938944, "id_str"=>"475044876841938944", "text"=>"hi #debalec", "source"=>"http://twitter.com/download/android\" rel=\"nofollow\">Twitter for Android", "truncated"=>false, "in_reply_to_status_id"=>nil, "in_reply_to_status_id_str"=>nil, "in_reply_to_user_id"=>nil, "in_reply_to_user_id_str"=>nil, "in_reply_to_screen_name"=>nil, "user"=>{"id"=>1551421092, "id_str"=>"1551421092", "name"=>"the third", "screen_name"=>"the third", "location"=>"", "description"=>"", "url"=>nil, "entities"=>{"description"=>{"urls"=>[]}}, "protected"=>false, "followers_count"=>12, "friends_count"=>199, "listed_count"=>0, "created_at"=>"Thu Jun 27 20:24:56 +0000 2013", "favourites_count"=>54, "utc_offset"=>nil, "time_zone"=>nil, "geo_enabled"=>false, "verified"=>false, "statuses_count"=>82, "lang"=>"en", "contributors_enabled"=>false, "is_translator"=>false, "is_translation_enabled"=>false, "profile_background_color"=>"59BEE4", "profile_background_image_url"=>"http://pbs.twimg.com/profile_background_images/378800000083038715/7b1cad0896d22d75b85f5f86fc69b59f.jpeg","profile_background_image_url_https"=>"https://pbs.twimg.com/profile_background_images/378800000083038715/7b1cad0896d22d75b85f5f86fc69b59f.jpeg", "profile_background_tile"=>false,"profile_image_url"=>"http://abs.twimg.com/sticky/default_profile_images/default_profile_4_normal.png","profile_image_url_https"=>"https://abs.twimg.com/sticky/default_profile_images/default_profile_4_normal.png", "profile_link_color"=>"8FCAE0", "profile_sidebar_border_color"=>"4BB7DF", "profile_sidebar_fill_color"=>"191F22", "profile_text_color"=>"4BB7DF", "profile_use_background_image"=>true, "default_profile"=>false, "default_profile_image"=>true, "following"=>false, "follow_request_sent"=>false, "notifications"=>false}, "geo"=>nil, "coordinates"=>nil, "place"=>nil, "contributors"=>nil, "retweet_count"=>0, "favorite_count"=>0, "entities"=>{"hashtags"=>[], "symbols"=>[], "urls"=>[], "user_mentions"=>[{"screen_name"=>"debalec", "name"=>"DebaElec", "id"=>2551123651, "id_str"=>"2551123651", "indices"=>[3, 11]}]}, "favorited"=>false, "retweeted"=>false, "lang"=>"und"}]
Use map instead of each: tweets = JSON.parse(response.body) tweets.map do |tweet| tweet["text"] end And there is no need to interpolate tweet["text"].
One problem here is that you're using quotes within quotes. Forgot to escape? Another issue is that you're not printing anything. Merely returning the text in a loop does nothing and would always return the tweets object when the loop is complete. So, here you go: tweets = JSON.parse(response.body) tweets.each do |tweet| puts tweet["text"] end Update: Well, I guess the quotes within quotes won't be a problem here as long as you use string interpolation. But it's still not the preferred way. I'd rather go with "#{tweet['text']}".
QuickBlox Chat: can't perform video call
I'm developing a video chat application with quickblox. And I have a trouble with performing video call. There are logs of two instances of application started in one time: Sep 11 16:43:40 iPod-touch DimChat[3823] <Warning>: QBChat/didConnect Sep 11 16:43:40 iPod-touch DimChat[3823] <Warning>: -[QBChat xmppStreamDidAuthenticate:] -> user: 290427, supportsStartTLS: 1, isSecure: 0 Sep 11 16:43:40 iPod-touch DimChat[3823] <Warning>: -[QBChat xmppStream:didSendPresence:] -> Presence: <presence/> Sep 11 16:43:40 iPod-touch DimChat[3823] <Warning>: -[QBChat xmppStream:didSendIQ:] -> IQ: <iq type="get" id="561006823"><query xmlns="jabber:iq:roster"/></iq> Sep 11 16:43:41 iPod-touch DimChat[3823] <Warning>: -[QBChat xmppStream:didReceiveIQ:] -> <iq xmlns="jabber:client" id="561006823" type="result" to="290427-3936#chat.quickblox.com/tigase-3171"><query xmlns="jabber:iq:roster"/></iq> Sep 11 16:44:00 iPod-touch DimChat[3823] <Warning>: -[QBChat xmppStream:didSendPresence:] -> Presence: <presence/> Sep 11 16:44:18 iPod-touch wifid[14] <Error>: WiFi:[400596258.779212]: Disable WoW requested by "UserEventAgent" Sep 11 16:44:18 iPod-touch DimChat[3823] <Warning>: QBChat/didDisconnect, error: Error Domain=GCDAsyncSocketErrorDomain Code=7 "Socket closed by remote peer" UserInfo=0x1ed273e0 {NSLocalizedDescription=Socket closed by remote peer} Sep 11 16:44:20 iPod-touch DimChat[3823] <Warning>: -[QBChat sendPresence] -> return. You have to be logged in in order to use Chat API The second instance which calls the first one: 2013-09-11 16:43:46.408 DimChat[55216:b10f] QBChat/didConnect 2013-09-11 16:43:47.053 DimChat[55216:a207] -[QBChat xmppStreamDidAuthenticate:] -> user: 503867, supportsStartTLS: 1, isSecure: 0 2013-09-11 16:43:47.053 DimChat[55216:a207] -[QBChat xmppStream:didSendIQ:] -> IQ: <iq type="get" id="561006823"><query xmlns="jabber:iq:roster"/></iq> 2013-09-11 16:43:47.053 DimChat[55216:a207] -[QBChat xmppStream:didSendPresence:] -> Presence: <presence/> 2013-09-11 16:43:47.215 DimChat[55216:b10f] -[QBChat xmppStream:didReceiveIQ:] -> <iq xmlns="jabber:client" id="561006823" type="result" to="503867-3936#chat.quickblox.com/tigase-3170"><query xmlns="jabber:iq:roster"/></iq> 2013-09-11 16:43:56.295 DimChat[55216:b10f] -[QBVideoChat init] -> 2013-09-11 16:43:56.295 DimChat[55216:b10f] -[QBVideoChat orientatioDidChange:] -> LandscapeLeft 2013-09-11 16:43:56.296 DimChat[55216:b10f] -[QBVideoChat callUser:conferenceType:customParameters:] -> VideoChat configuration: { kQBVideoChatBadConnectionTimeout = 5; kQBVideoChatCallTimeout = 15; kQBVideoChatFrameQualityPreset = AVCaptureSessionPresetLow; kQBVideoChatP2PTimeout = "1.5"; kQBVideoChatTURNServerEndPoint = "turnserver.quickblox.com"; kQBVideoChatVideoFramesPerSecond = 10; kQBVideoChatWriteQueueMaxAudioOperationsThreshold = 25; kQBVideoChatWriteQueueMaxVideoOperationsThreshold = 25; } 2013-09-11 16:43:56.296 DimChat[55216:b10f] -[QBChat xmppStream:didSendMessage:] -> Message: <message id="282475249" type="qbvideochat_call" to="290427-3936#chat.quickblox.com" from="503867-3936#chat.quickblox.com"><body>1</body></message> 2013-09-11 16:43:58.297 DimChat[55216:b10f] -[QBChat xmppStream:didSendMessage:] -> Message: <message id="1622650073" type="qbvideochat_call" to="290427-3936#chat.quickblox.com" from="503867-3936#chat.quickblox.com"><body>1</body></message> 2013-09-11 16:44:00.298 DimChat[55216:b10f] -[QBChat xmppStream:didSendMessage:] -> Message: <message id="984943658" type="qbvideochat_call" to="290427-3936#chat.quickblox.com" from="503867-3936#chat.quickblox.com"><body>1</body></message> 2013-09-11 16:44:02.300 DimChat[55216:b10f] -[QBChat xmppStream:didSendMessage:] -> Message: <message id="1144108930" type="qbvideochat_call" to="290427-3936#chat.quickblox.com" from="503867-3936#chat.quickblox.com"><body>1</body></message> 2013-09-11 16:44:04.300 DimChat[55216:b10f] -[QBChat xmppStream:didSendMessage:] -> Message: <message id="470211272" type="qbvideochat_call" to="290427-3936#chat.quickblox.com" from="503867-3936#chat.quickblox.com"><body>1</body></message> 2013-09-11 16:44:06.302 DimChat[55216:b10f] -[QBChat xmppStream:didSendMessage:] -> Message: <message id="101027544" type="qbvideochat_call" to="290427-3936#chat.quickblox.com" from="503867-3936#chat.quickblox.com"><body>1</body></message> 2013-09-11 16:44:07.065 DimChat[55216:b10f] -[QBChat xmppStream:didSendPresence:] -> Presence: <presence/> 2013-09-11 16:44:08.303 DimChat[55216:b10f] -[QBChat xmppStream:didSendMessage:] -> Message: <message id="1457850878" type="qbvideochat_call" to="290427-3936#chat.quickblox.com" from="503867-3936#chat.quickblox.com"><body>1</body></message> 2013-09-11 16:44:10.303 DimChat[55216:b10f] -[QBChat xmppStream:didSendMessage:] -> Message: <message id="1458777923" type="qbvideochat_call" to="290427-3936#chat.quickblox.com" from="503867-3936#chat.quickblox.com"><body>1</body></message> 2013-09-11 16:44:11.304 DimChat[55216:b10f] -[QBVideoChat finishCallWithStatus:customParameters:] -> kStopVideoChatCallStatus_OpponentDidNotAnswer 2013-09-11 16:44:11.305 DimChat[55216:b10f] -[QBVideoChat deinitialization] -> 2013-09-11 16:44:11.305 DimChat[55216:b10f] -[QBVideoChat releaseVideoCapture] -> 2013-09-11 16:44:11.306 DimChat[55216:b10f] -[QBVideoChat releaseAudioCapture] -> 2013-09-11 16:44:11.306 DimChat[55216:b10f] -[QBVideoChat releaseSocketConnection] -> 2013-09-11 16:44:11.306 DimChat[55216:b10f] -[QBChat xmppStream:didSendMessage:] -> Message: <message id="2007237709" type="qbvideochat_stopCall" to="290427-3936#chat.quickblox.com" from="503867-3936#chat.quickblox.com"><body>kStopVideoChatCallStatus_OpponentDidNotAnswer</body></message> 2013-09-11 16:44:25.264 DimChat[55216:b10f] QBChat/didDisconnect, error: Error Domain=GCDAsyncSocketErrorDomain Code=7 "Socket closed by remote peer" UserInfo=0x9ca1260 {NSLocalizedDescription=Socket closed by remote peer} 2013-09-11 16:44:27.074 DimChat[55216:b10f] -[QBChat sendPresence] -> return. You have to be logged in in order to use Chat API Actually the problem is that the first instance didn't receive incoming call. I checked the video chat example from quickblox's github. It works with my users/passwords, so I have a mistake in my code, but I really don't know where I should search it. As you can see both instances have the same problem: "Socket closed by remote peer". But this problem happens after call timeout, so it isn't a cause of main problem.
Finally I've found the solution. The problem was in QBVideoChat object. I thought that QBChat will send me the signal when another user calls me and then I'll create the QBVideoChat object and present it's view on screen. The sad truth is that QBChat don't send any video relations signals before I create QBVideoChat. So I have to create it at program's start in order to receive chatDidReceiveCallRequestFromUser signal.