Когда Java моделирует HTTP -запрос, ошибку, код и данные ошибки сообщаются следующим образом:
Configuration.xml
<?xml version="1.0" encoding="UTF-8"?><system> <!--Request url--> <category name="url" description="Indicator URL related configuration"> <item name="volumenormUrl" value="10.150.33.154:8080/getInfo/getUser" description="Temporary URL address"></item> </category></system>
Код Java
String url = configuration.getString ("url.volumenorMurl"); try {log.info ("==================== {}", url); String responseString = httputil.doget (url); log.info ("crmloginurl responseString {} {}", url, responseString); return jsonresponse.success (); } catch (wxexception e) {log.error ("crmlogin fail ... {}, e = {}", e.getmessage (), e); e.printstacktrace (); вернуть jsonResponse.failure ("Fail"); }Код ошибки:
java.lang.illegalargumentException: незаконной характер в названии схемы в индексе 0: 10.150.33.154:8080/getinfo/getuserat java.net.uri.create (uri.java:852) на org.apache.http.client.methods.httpget. com.foundersc.ifc.service.base.http.httputil.doget (httputil.java:30) на com.foundersc.ifc.volumenorm.controller.test.getnorm (test.java:29) на sun.reflect.nativemethodaccorsirempl.invoke0 (Native ath sun.reflect.nativemethodacccessorimpl.invoke (nativemethodaccessorimpl.java:62) на sun.reflect.delegatingmethodaccessorimpl.invoke (делегирование Methodaccessorimpl.java:43) на java.lang.reflect.method org.springframework.web.method.support.invocableHandlerMethod.invoke (endocableHandlermethod.java:215) на org.springframework.web.method.support.invocablehandhothod.invokeforRequest (endocableHandlerm. org.springframework.web.servlet.mvc.method.annotation.servletinvocablehandlermethod.invokeandhandle (ServletinvocableHandlerMethod.java:104) в org.springframework.web.servlet.mvc.method.annotation.requestmappingHandlerAdapter.invokehandlemethod (requestMappingHandlerAdapter.java:781) на org.springframework.web.servlet.mvc.method.annotation.requestmappingHandlerAdapter.handleinternal (requestMappingHandlerAdapter.java:721) на org.springframework.web.servlet.mvc.method.abstracthandlermethodadapter.handle (Abstracthandlermethodapter.java:83) на org.springframework.web.servlet.dispatcherservlet.dodispatch (dispatcherservlet.java:943) org.springframework.web.servlet.dispatcherservlet.doservice (dispatcherservlet.java:877) на org.springframework.web.servlet.frameworkservlet.processsrequest (frameworkservlet.java:966) в org.springframework.web.servlet.frameworkservlet.doget (frameworkservlet.java:857) на javax.servlet.http.httpservlet.service (httpservlet.java:707) у org.springframework.web.servlet.frameworkservlet.service (FrameworkServlet.java:842) на javax.servlet.http.httpservlet.service (httpservlet.java:820) в org.mortbay.jetty.servlet.servletholder.handle (Servletholder.java:511) по адресу org.mortbay.jetty.servlet.servlethandler $ cachedchain.dofilter (ServleThandler.java:1166) org.springframework.web.filter.characterencodingfilter.dofilterInternal (harexEncodingfilter.java:88) на org.springframework.web.filter.onceperquestfilter.dofilter (oneperrequestfilter.java:107 org.mortbay.jetty.servlet.servlethandler $ cachedchain.dofilter (servlethandler.java:1157) на org.mortbay.jetty.servlet.servlethandler.handle (servlethandler.java:388) в org.mortbay.jetty.security.securityhandler.handle (SecurityHandler.java:216) на org.mortbay.jetty.servlet.sessionHandler.handle (SessionHandler.java:182) на org.mortbay.jetty.handler.contexthandler.handler (contexthranler.j.jetty.handler.hontexthandler.handler (contexthray.jhandler. org.mortbay.jetty.webapp.webappcontext.handle (webappcontext.java:418) на org.mortbay.jetty.handler.contexthandlercollection.handle (contexthandlercollection.java:230) org.mortbay.jetty.handler.handlercollection.handle (handlercollection.java:114) на org.mortbay.jetty.handler.handlerwrapper.handle (HandlerWrapper.java:152) на org.mortbay.jett org.mortbay.jetty.httpconnection.handlereQuest (httpconnection.java:542) по адресу org.mortbay.jetty.httpconnection $ requesthandler.headercomplete (httpconnection.java:923) org.mortbay.jetty.httpparser.parsenext (httpparser.java:547) на org.mortbay.jetty.httpparser.parseaavailable (httpparser.java:212) в org.mortbay.jetty.httpconnection.handle (httpconnection.java:404) на org.mortbay.io.nio.selectchannelendpoint.run (selectchannelendpoint.java:409) org.mortbay.thread.queuedthreadpool $ poolthread.run (queuedthreadpool.java:582), вызванная: java.net.urisyntaxexexcept java.net.uri $ parser.fail (uri.java:2848) по адресу java.net.uri $ parser.checkchars (uri.java:3021) на java.net.uri $ parser.checkchar (uri.java:3031) на java.uri $ parser.те. java.net.uri. <init> (uri.java:588) на java.net.uri.create (uri.java:850) .. 41 Moredisconnected от Target VM, адрес: '127.0.0.1:65013', транспорт: 'Сокет -процесс, законченное с кодом Exit -1
Я искал Байду и нашел много бесполезных статей. Позже я искал на Бинге и нашел основную причину. Я должен http: // перед значением в configuration.xml, в противном случае я сообщу об ошибке ~ Все отказались от Байду, что слишком обмануто.