由于此异常,Android 模拟器和智能手机都无法运行该应用程序,尽管我测试了连接良好,Android 可以使用 Chrome 上的 neo4j 浏览器访问 neo4j 数据库。这是我的 maven 版本、测试代码和错误消息。
implementation 'org.neo4j.driver:neo4j-java-driver:1.4.4';
Android SDK is 9.0(Pie) ,
gradel version is 3.4.2,
and maven-gradle-plugin version is 1.5
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.TextView;
import org.neo4j.driver.v1.*;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Data test = new Data("bolt://holer.cc:50113", "neo4j", "12345");
}
}
class Data implements AutoCloseable{
private Driver driver;
private Session session;
public Data(String uri,String user,String password){
try {
driver = GraphDatabase.driver(uri, AuthTokens.basic(user, password));
session = driver.session();
} catch (Exception e) {
System.err.println(e);
}
}
public void close() throws Exception {
driver.close();
}
}
org.neo4j.driver.v1.exceptions.ServiceUnavailableException:无法处理请求:权限被拒绝