Neo4j in Android using REST -
i have been trying use neo4j in android app. wrote following code should response server.
button mbutton; edittext medittext; private static final string server_root_uri = "http://localhost:7474/db/data/"; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); mbutton=(button)findviewbyid(r.id.mybutton); medittext=(edittext)findviewbyid(r.id.mytext); mbutton.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { webresource resource= client.create() .resource(server_root_uri); clientresponse response=resource.get(clientresponse.class); string s=(string.format("get on [%s], status code [%d]", server_root_uri, response.getstatus() )); medittext.settext(s); response.close(); } }); }
but when run following error:
06-25 21:05:54.706 17180-17180/com.example.atleastic.neo4japplication1 w/system.err﹕ @ com.example.atleastic.neo4japplication1.mainactivity$1.onclick(mainactivity.java:35) 06-25 21:05:54.706 17180-17180/com.example.atleastic.neo4japplication1 w/system.err﹕ @ android.app.activitythread.main(activitythread.java:5409) 06-25 21:05:54.707 17180-17180/com.example.atleastic.neo4japplication1 w/system.err﹕ @ com.android.internal.os.zygoteinit.main(zygoteinit.java:606) 06-25 21:05:54.707 17180-17180/com.example.atleastic.neo4japplication1 w/system.err﹕ @ dalvik.system.nativestart.main(native method) 06-25 21:05:54.709 17180-17180/com.example.atleastic.neo4japplication1 e/androidruntime﹕ fatal exception: main java.lang.verifyerror: com/sun/jersey/core/impl/provider/entity/mimemultipartprovider @ java.lang.class.getdeclaredconstructors(native method) @ java.lang.class.getconstructors(class.java:498) @ com.sun.jersey.core.spi.component.componentconstructor.getinstance(componentconstructor.java:174) @ com.sun.jersey.core.spi.component.providerfactory.__getcomponentprovider(providerfactory.java:166) @ com.sun.jersey.core.spi.component.providerfactory.getcomponentprovider(providerfactory.java:137) @ com.sun.jersey.core.spi.component.providerservices.getcomponent(providerservices.java:256) @ com.sun.jersey.core.spi.component.providerservices.getservices(providerservices.java:160) @ com.sun.jersey.core.spi.factory.messagebodyfactory.initreaders(messagebodyfactory.java:176) @ com.sun.jersey.core.spi.factory.messagebodyfactory.init(messagebodyfactory.java:162) @ com.sun.jersey.api.client.client.init(client.java:342) @ com.sun.jersey.api.client.client.access$000(client.java:118) @ com.sun.jersey.api.client.client$1.f(client.java:191) @ com.sun.jersey.api.client.client$1.f(client.java:187) @ com.sun.jersey.spi.inject.errors.processwitherrors(errors.java:193) @ com.sun.jersey.api.client.client.<init>(client.java:187) @ com.sun.jersey.api.client.client.<init>(client.java:159) @ com.sun.jersey.api.client.client.create(client.java:669) @ com.example.atleastic.neo4japplication1.mainactivity$1.onclick(mainactivity.java:35) @ android.view.view.performclick(view.java:4222) @ android.view.view$performclick.run(view.java:17620) @ android.os.handler.handlecallback(handler.java:800) @ android.os.handler.dispatchmessage(handler.java:100) @ android.os.looper.loop(looper.java:194) @ android.app.activitythread.main(activitythread.java:5409) @ java.lang.reflect.method.invokenative(native method) @ java.lang.reflect.method.invoke(method.java:525) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:839) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:606) @ dalvik.system.nativestart.main(native method)
some appreciated.
Comments
Post a Comment