我使用Java连接MySQL和Json将数据发送到android,当我通过URL地址从Java发送数据到json:
http://192.168.1.221:9999/rentalcar_service/category/getAllManufacturer
Run Code Online (Sandbox Code Playgroud)
一切都很好,但是当我在Android中解析数据时,我收到了一个错误结果,如下所示:
private static final String URL_MANUFACTURERS = "http://192.168.1.221:9999/rentalcar_service/category/getAllManufacturer";
Run Code Online (Sandbox Code Playgroud)
logcat的:
W/System.err: Caused by: android.system.ErrnoException: isConnected failed: ECONNREFUSED (Connection refused)
W/System.err: at libcore.io.IoBridge.isConnected(IoBridge.java:223)
W/System.err: ... 25 more
I/MemoryCache: cache size=0 length=4
W/System.err: java.net.ConnectException: failed to connect to localhost/127.0.0.1 (port 9999) after 30000ms: isConnected failed: ECONNREFUSED (Connection refused)
W/System.err: at libcore.io.IoBridge.isConnected(IoBridge.java:234)
W/System.err: at libcore.io.IoBridge.connectErrno(IoBridge.java:171)
W/System.err: at libcore.io.IoBridge.connect(IoBridge.java:122)
Run Code Online (Sandbox Code Playgroud)
(192.168.1.221)IP地址是我的PC,如果我从192.168.1.221更改为localhost,我仍然会收到同样的错误.
如何解决这个问题?非常感谢 !
我正在使用Spring MVC和Spring Data JPA,并且面临jar版本的异常。
这是我的pom:
<properties>
<spring.version>4.2.4.RELEASE</spring.version>
<hibernate.version>4.3.8.Final</hibernate.version>
<mysql.version>5.1.10</mysql.version>
<junit-version>4.11</junit-version>
<servlet-api-version>3.1.0</servlet-api-version>
<spring-security-version>4.0.4.RELEASE</spring-security-version>
<spring-data-solr.verion>1.2.0.RELEASE</spring-data-solr.verion>
<springbatch.version>3.0.6.RELEASE</springbatch.version>
<jsp-version>2.1</jsp-version>
<jstl-version>1.2</jstl-version>
<java.version>1.7</java.version>
<liquibase.version>3.1.1</liquibase.version>
<spring.data.jpa.version>1.10.3.RELEASE</spring.data.jpa.version>
<spring.social.version>1.1.0.RELEASE</spring.social.version>
</properties>
Run Code Online (Sandbox Code Playgroud)
这是我的课:
import org.springframework.data.jpa.repository.JpaRepository;
public interface RoleRepository extends JpaRepository<Role, Long> {
}
Run Code Online (Sandbox Code Playgroud)
我在Eclipse上收到一条错误警告,并显示以下消息:
The type org.springframework.data.repository.query.QueryByExampleExecutor cannot be resolved. It is indirectly referenced from required .class files
Run Code Online (Sandbox Code Playgroud)
看来我的Spring数据jpa jar版本不正确,但是我不知道找到正确的版本。我的春季版本:4.2.4.RELEASE是最新的
如何解决这个错误?非常感谢 !