java.net.UnknownHostException: src="https运行报错

用InputStream解析url 但是运行时报错
URL url = new URL("http://"+matcher2.group());
URLConnection con = url.openConnection();
con.setConnectTimeout(120*1000);
InputStream is = con.getInputStream();
下面是报错
java.net.UnknownHostException: src="https
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at sun.net.NetworkClient.doConnect(NetworkClient.java:175)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:463)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:558)
at sun.net.www.http.HttpClient.(HttpClient.java:242)
at sun.net.www.http.HttpClient.New(HttpClient.java:339)
at sun.net.www.http.HttpClient.New(HttpClient.java:357)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1220)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1156)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1050)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:984)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1564)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)

url

3个回答

你拼接出来的url应该有问题。地址不对

 RL url = new URL("http://"+matcher2.group());
qq_40838030
从小我就黑 但是去掉http://就报java.net.MalformedURLException: no protocol: src="http://wx.1myhb.com/travel/public/ueditor/themes/default/images/spacer.gif"这个错误了 所以我才拼接的
大约一年之前 回复

这个没什么原因,就是地址错了,你看报错是报的src="https",这是什么鬼?你那里有https?错误要找准,

weixin_43180362
weixin_43180362 同问
大约一年之前 回复
zhangpan_soft
zhangpan_soft 回复qq_40838030: 你把整个代码粘贴出来让我看看
大约一年之前 回复
qq_40838030
从小我就黑 我现在更换地址链接www.baidu.com都报这个异常 我直接写的代码 没有进行其他的 还需要额外的配置么?
大约一年之前 回复

你是http连接https吧,需要使用客户端完全信任服务端,否则客户端需要服务端给证书

xcgh
xcgh 百度测试不了,我试过有拦截,你可以试试知乎,但是如果是windows好一些,linux客户需要有完全信任服务端的代码
大约一年之前 回复
qq_40838030
从小我就黑 我现在更换地址链接www.baidu.com都报这个异常 我直接写的代码 没有进行其他的 还需要额外的配置么?
大约一年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
java.net.UnknownHostException
java.net.UnknownHostException异常复现的问题(迫使出现这个异常)rnLinux32 OS:rnrnjava.net.UnknownHostException: [color=#FF0000]tdy218[/color]:[color=#FF0000]tdy218[/color] //tdy218为我的主机名(运行hostname的输出结果)rnat java.net.InetAddress.getLocalHost(InetAddress.java :1308)rnrn开始我一直在看/etc/hosts文件(/etc/sysconfig/network保持默认),并且不断的修改有关主机名对应IP的位置rn[code=Java]rn127.0.0.1 localhost.localdomain localhostrn192.168.1.18 tdy218rn[/code]rn后来保持etc/hosts文件为原始状态,修改/etc/sysconfig/networkrn[code=Java]rnNETWORKING=yesrnHOSTNAME=tdy218 rn[/code]rn但是怎么改都没发生异常,失望!~rn这两种方式均可使hostname命令显示主机名为:tdy218rn但是后来我又搜搜网上的有关这个异常信息,我就发现我忽视了一个问题,那就是权限的问题,可能/etc/sysconfig/network和/etc/hosts都禁止普通用户访问,于是我rn#ls -l /etc/sysconfig/networkrn显示-rw-r--r-- 也就是所有用户都有读的权限。rn#ls -l /etc/hostsrn同样显示-rw-r--r-- 也就是所有用户都有读的权限。rnrn于是我通过chmod命令将这两个文件对普通用户去掉所有的权限rn#chmod 600 /etc/sysconfig/networkrn#ls -l /etc/sysconfig/networkrn显示-rw------- root用户保留读写权限,普通用户去掉所有的权限。rn#chmod 600 /etc/hostsrn#ls -l /etc/hostsrn显示-rw------- root用户保留读写权限,普通用户去掉所有的权限。rnrn结果在[color=#FF0000]普通用户下运行[/color]测试程序,依旧没报错!rn郁闷!rn测试结果表明,InetAddress类getLocalHost()方法时与那两个文件无关!但rnjava.net.UnknownHostException: [color=#FF0000]tdy218[/color]:[color=#FF0000]tdy218[/color] //tdy218为我的主机名(运行hostname的输出结果)rn的出现,却是怪事儿!rn是否与系统上其他的文件有关?rn测试程序:rn[code=Java]rnimport java.net.InetAddress;rnpublic class getLocalHostExceptionrn public static void main(String tdy218[])rn rn tryrn rn rn String ip = InetAddress.getLocalHost().getHostAddress();rn String hostname = InetAddress.getLocalHost().getHostName();rn System.out.println("getLocalHost()返回:"+InetAddress.getLocalHost());rn System.out.println("HostName:"+hostname+"\n"+"IP:"+ip);rn rn catch(Exception e)rn rn System.out.println(e.getMessage()); rn rn rnrn[/code]rnrnrn或许该测试程序不够接近异常,或许...rn大家能否提出一个解决办法或者思路看看这个问题该咋办.rn
java.net.UnknownHostException: java.sun.com
web.xml不能解析rn好像是根据这句话rnrn去sun的网站去下载http://java.sun.com/dtd/web-app_2_3.dtdrn我要是断了网rn就不能运行rnjava.net.UnknownHostException: java.sun.comrn有什么好的解决方法没有
java.net.UnknownHostException: www.google.com.hk
各位大侠,我解析google天气,怎么提示这个错误rn我的解析url是:String wathers="http://www.google.com.hk/ig/api?&hl=zh-cn&ie=utf-8&oe=utf-8&weather="+cityrn有谁告诉我,是怎么回事,直接输入路径能够在浏览器中得到xml(webservice)
java.net.UnknownHostException: hostname
用jsp连接mysql数据库时出现了这样的错误,怎么解决?nncom.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception: nn** BEGIN NESTED EXCEPTION ** nnjava.net.UnknownHostExceptionnMESSAGE: hostnamennSTACKTRACE:nnjava.net.UnknownHostException: hostname
java.net.UnknownHostException: smtp.sina.com
用javamail开发的邮件,windows测试通过rnsetting mail server:mail.smtp.host = smtp.sina.comrnprepar to get Obj of MIME!rncreate MIME Obj!rnsetting smtp identity:mail.smtp.auth = truernsetting email subject!rnsetting email content!rnsetting sender!rnsending ....rnsuccess!rnrn***************linux 下报:rnprepar to get Obj of MIME?rncreate MIME Obj?rnsetting smtp identity?mail.smtp.auth = truernsetting email subject?rnsetting email content?rnsetting sender?rnsending ....rnfail?javax.mail.MessagingException: Unknown SMTP host: smtp.sina.com;rnnested exception is:java.net.UnknownHostException: smtp.sina.com异常,说明下:DNS成功解析,sendmail 服务已开启,25端口也开着,自上周二万网升级后,邮件就再也没发出去过。原先好好的。各位同仁,有没有遇到过这种情况?一起分享下解决方案!谢谢了。
java.net.UnknownHostException: 172.29.24.xxx
JSch jsch = new JSch(); rn Session sshSession = jsch.getSession(this.username, this.host, this.port); rn logger.debug(MySFTP.class + "Session created."); rnrn sshSession.setPassword(password); rn Properties sshConfig = new Properties(); rn sshConfig.put("StrictHostKeyChecking", "no"); rn sshSession.setConfig(sshConfig); rn sshSession.connect(); rn logger.debug(MySFTP.class + " Session connected."); rnrn logger.debug(MySFTP.class + " Opening Channel."); rn Channel channel = sshSession.openChannel("sftp"); rn channel.connect(); rn this.sftp = (ChannelSftp) channel; rn logger.debug(MySFTP.class + " Connected to " + this.host + "."); rnrnrnrn连接成功的,第二天却报错,请各位看看
java.net.UnknownHostException: Host is unresolved异常
[code=Java]rnpublic void createXmlResource(String city, OutputStream out) rn BufferedReader br;rn try rn URL url = new URL("http://www.google.com/ig/api?weather=北京");rn HttpURLConnection conn = (HttpURLConnection) url.openConnection();rn conn.setDoInput(true);rn conn.connect();rn br = new BufferedReader(new InputStreamReader(conn.getInputStream()));rn OutputStreamWriter file_writer = new OutputStreamWriter(out);rn String str = null;rn while ((str = br.readLine()) != null) rn file_writer.write(str);rn rn br.close();rn file_writer.close();rn catch (Exception e) rn e.printStackTrace();rn rn rn[/code]rn结果conn.connect();这一句 抛出了 rnjava.net.UnknownHostException: Host is unresolved: www.google.com:80 rn在AndroidManifest.xml中我也写了 rn希望知道的同学告诉我真相啊
运行报错
运行中断,显示“FPS.exe中的0x77661884处未处理的异常:0xC0000005:读取位置0xfff7ffff时发生访问冲突”,请问这是什么意思啊?谢谢rnrn在main函数里调用这个tridag(u,data_out_b,lambda,m);就出错,不用这句话就好了rnrn下面是代码,rn[code=C/C++]#includern#includern#includern#define PI 3.1415926rnusing namespace std;rnvoid lu_lower(double d[],double e[],double b[],double x[],int n)rnrn x[0]=b[0]/d[0];rn int count;rn for(count=1;count<=n-1;count++)rn rn x[count]=(b[count]-e[count-1]*x[count-1])/d[count];rn rnrnvoid lu_upper(double d[],double e[],double b[], double x[],int n)rnrn x[n-1]=b[n-1]/d[n-1];rn int count;rn for(count=n-2;count>=0;count--)rn rn x[count]=(b[count]-e[count]*x[count+1])/d[count];rn rnrnvoid tridag(double u[],double r[],double lambda,int n)rnrn double d[10];//按照实际情况调整rn double e[9];rn double temp[10];rn d[0]=sqrt(lambda);rn e[0]=-1/d[0];rn int count;rn for(count=1;count<=n-2;count++)rn rn d[count]=sqrt((lambda-d[count-1]*d[count-1]));rn e[count]=-1/d[count];rn rn d[n-1]=sqrt((lambda-d[n-2]*d[n-2]));rn lu_lower(d,e,r,temp,n);rn lu_upper(d,e,temp,u,n);rnrnint main()//最终结果在temp里,把它拉成一维看就行rnrn int m=10;//FFT的维数,符号和书上统一rn int dm=2*m;//把N化成2N,才能用FFT求解rn int p=1;//符号和书上统一rn double data_out_b[10];rn double u[10];//追赶法的解向量rn int count;rn int count1;rn double lambda;rn double temp[1][10]=1,2,3,4,5,6,7,8,9,10;//存放b的数据,一共有m*p个,p行m列rnrnrnrn rn fftw_complex *in;rn fftw_complex *out;rn fftw_plan plan;rn in=(fftw_complex*) fftw_malloc(sizeof(fftw_complex)*dm);rn out=(fftw_complex*) fftw_malloc(sizeof(fftw_complex)*dm);rn plan=fftw_plan_dft_1d(dm,in,out,FFTW_FORWARD,FFTW_ESTIMATE);rn rnrnrn for(count=1;count<=p;count++)rn rn lambda=4-cos(p*PI/(m+1));rn rn **in=0;*(*in+1)=0;rn for(count1=1;count1<=m;count1++)rn rn in++;rn **in=temp[count-1][count1-1];rn *(*in+1)=0;rn rn for(count1=1;count1<=m-1;count1++)rn rn in++;rn **in=0;rn *(*in+1)=0;rn rn in=in-m;rnrn fftw_execute(plan);rnrnrn for(count1=1;count1<=m;count1++)rn rn out++;rn data_out_b[count1-1]=(**out);rn rn out=out-m;rn rnrn tridag(u,data_out_b,lambda,m);rnrnrnrn for(count1=1;count1<=m;count1++)rn rn in++;rn **in=u[count1-1];rn *(*in+1)=0;rn rnrnrnrnrn fftw_execute(plan);rnrnrnrnrn for(count1=1;count1<=m;count1++)rn rn out++;rn temp[count-1][count1-1]=(**out);rn rn rn int countm,countp;rn for(countp=1;countp<=p;countp++)rn rn for(countm=1;countm<=m;countm++)rn rn cout<
运行报错!
在网上下载的源码运行报错为"错误 1 在应用程序级别之外使用注册为 allowDefinition='MachineToApplication' 的节是错误的。如果在 IIS 中没有将虚拟目录配置为应用程序,则可能导致此错误。 E:\源码区\b2b\web\web.config 15 rn"rnrn请问如何处理啊!rn我运行的工具是vs2005
运行报错~~!
以下代码前段时间还可以使用,但今天运行就报错:rnrn Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Clickrn Dim DS As System.Data.DataSetrn Dim MyCommand As System.Data.OleDb.OleDbDataAdapterrn Dim MyConnection As System.Data.OleDb.OleDbConnectionrn MyConnection = New System.Data.OleDb.OleDbConnection("Provider=SQLOLEDB;uid=as;pwd=098765;server=10.1.1.5;database=dataDC")rnrn MyCommand = New System.Data.OleDb.OleDbDataAdapter("SELECT AGNAME02 as 部门, AGNAME01 as 组, Agnt_name as 姓名, Agnt_num as 编码, Agnt_type 职级, Agnt_DTEAPP as 入司时间, Agnt_DTETRM 离职时间, Agnt_AGMVTY as 状态 FROM dim_Agent WHERE Agnt_num LIKE '" & TextBox1.Text & "%'", MyConnection)rn '根据textbox1.text内容查询rn DS = New System.Data.DataSetrn MyCommand.Fill(DS)rn Me.DataGrid1.DataSource = DS.Tables(0)rn MyConnection.Close()rn End Subrnrn报错显示:rn未处理的“System.InvalidOperationException”类型的异常出现在 system.data.dll 中。rn其他信息: 未在本地计算机上注册“SQLOLEDB”提供程序。rnrn-----------------------------rn偶没有做任何改动呀,为什么就忽然用不起了,请高手指点指点,谢谢rn
调用InetAddress.getAllByName()出现 java.net.UnknownHostException
nslookup默认服务器为unknown,但明明已经改了dnsrnping这些域名的时候出现请求找不到主机rnhosts里也加了主机名和ip地址rn// 我要疯掉了,求求帮我看一下到底哪里有问题吧
java 异常java.net.UnknownHostException
package app21;nnimport java.io.BufferedReader;nimport java.io.IOException;nimport java.io.InputStreamReader;nimport java.io.OutputStream;nimport java.io.PrintWriter;nimport java.net.Socket;nnpublic class SocketTest1 nn public static void main(String[] args) n String host = "www.baidu.com";n String protocol = "https";n try n Socket socket = new Socket(protocol + "://" + host, 80);n OutputStream os = socket.getOutputStream();n boolean autoflush = true;n PrintWriter out = new PrintWriter(os, autoflush);n BufferedReader in = new BufferedReader(n new InputStreamReader(socket.getInputStream()));n // 将一个HTTP请求发送到Web服务器n out.println("GET / HTTP/1.1");n out.println("Host: " + host + ":80");n out.println("Connection: Close");n out.println();n n // 读取响应信息n boolean loop = true;n StringBuilder sb = new StringBuilder(8096);n while (loop) n if (in.ready()) n int i = 0;n while (i != -1) n i = in.read();n sb.append((char) i);n n loop = false;n n n n // 将响应信息显示到out控制台n System.out.println(sb.toString());n socket.close();n catch (IOException e) n e.printStackTrace();n nn nnnnnn异常信息:njava.net.UnknownHostException: https://www.baidu.comn at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184)n at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)n at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)n at java.net.Socket.connect(Socket.java:589)n at java.net.Socket.connect(Socket.java:538)n at java.net.Socket.(Socket.java:434)n at java.net.Socket.(Socket.java:211)n at app21.SocketTest1.main(SocketTest1.java:16)n
Caused by: java.net.UnknownHostException: openapi.alipay.com
Caused by: java.net.UnknownHostException: openapi.alipay.com
httpclient 使用报错java.net.UnknownHostException
下了一个httpclient-4.1.1.jar,写了最简单的例子,跑起来却报错,大家看看,这是为啥呢?rnrn[code=Java] HttpResponse response = null;rn DefaultHttpClient httpclient = new DefaultHttpClient();rn //HttpPost httppost = new HttpPost("http://www.baidu.com");rn HttpGet httpget = new HttpGet("http://www.baidu.com/");rn try rn response = httpclient.execute(httpget);rn catch (ClientProtocolException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn catch (IOException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn [/code]rnrn报如下错误rn05-04 02:01:03.005: WARN/System.err(361): java.net.UnknownHostException: www.baidu.comrn05-04 02:01:03.015: WARN/System.err(361): at java.net.InetAddress.lookupHostByName(InetAddress.java:513)rn05-04 02:01:03.015: WARN/System.err(361): at java.net.InetAddress.getAllByNameImpl(InetAddress.java:278)rn05-04 02:01:03.025: WARN/System.err(361): at java.net.InetAddress.getAllByName(InetAddress.java:242)rn05-04 02:01:03.034: WARN/System.err(361): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:136)rn05-04 02:01:03.034: WARN/System.err(361): at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)rn05-04 02:01:03.034: WARN/System.err(361): at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)rn05-04 02:01:03.054: WARN/System.err(361): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:348)rn05-04 02:01:03.054: WARN/System.err(361): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)rn05-04 02:01:03.065: WARN/System.err(361): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)rn05-04 02:01:03.065: WARN/System.err(361): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)rn05-04 02:01:03.074: WARN/System.err(361): at com.http.test.main.onCreate(main.java:26)rn05-04 02:01:03.074: WARN/System.err(361): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)rn05-04 02:01:03.074: WARN/System.err(361): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)rn05-04 02:01:03.084: WARN/System.err(361): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)rn05-04 02:01:03.094: WARN/System.err(361): at android.app.ActivityThread.access$2300(ActivityThread.java:125)rn05-04 02:01:03.094: WARN/System.err(361): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)rn05-04 02:01:03.094: WARN/System.err(361): at android.os.Handler.dispatchMessage(Handler.java:99)rn05-04 02:01:03.104: WARN/System.err(361): at android.os.Looper.loop(Looper.java:123)rn05-04 02:01:03.104: WARN/System.err(361): at android.app.ActivityThread.main(ActivityThread.java:4627)rn05-04 02:01:03.104: WARN/System.err(361): at java.lang.reflect.Method.invokeNative(Native Method)rn05-04 02:01:03.115: WARN/System.err(361): at java.lang.reflect.Method.invoke(Method.java:521)rn05-04 02:01:03.115: WARN/System.err(361): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)rn05-04 02:01:03.125: WARN/System.err(361): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)rn05-04 02:01:03.125: WARN/System.err(361): at dalvik.system.NativeStart.main(Native Method)rnrn
nested exception is :java.net.UnknownHostException 错误
调用别人的接口,出现了错误.大家帮看看 这个是什么错误rn;nested exception is: java.net.UnknownHostException:service.test.xx.comrn先谢谢了,这个比较急,我一直在线等...........
为什么会提示java.net.UnknownHostException:
为什么提示java.net.UnknownHostException:rn我页面上使用强标签 和 struts来 引用的 URL ..URL地址是xx.com 这样的rn我拿到把URL拿到IE上可以访问的..没有任何错误rn为什么 一运行整个工程就 提示找不到 了rn错误提示告诉在一个页面上rnrn找到相应的静态代码是这样的rnrn out.write(" 骁扮?rn out.write(" \r\n");rn out.write(" \r\n");rn out.write("\r\n");rn out.write(" \r\n");rn out.write("\r\n");rn out.write("\r\n");rn out.write(" 驽?>>\r\n");rn [color=#FF6600] JspWriter out = _jspx_page_context.getOut();[/color]rn红色部分出的问题rnrn服务器是群集的!!rn请高人指点一二 在线等
rath.msnm.NotificationProcessor:java.net.UnknownHostException: messenger.hotmail.com
最近我在学习MSN Messager java模拟客户端程序的编制rn运行时抛出以下异常,请大家帮我看看rnrnrath.msnm.NotificationProcessor:rnjava.net.UnknownHostException: messenger.hotmail.comrn at java.net.PlainSocketImpl.connect(Unknown Source)rn at java.net.SocksSocketImpl.connect(Unknown Source)rn at java.net.Socket.connect(Unknown Source)rn at java.net.Socket.connect(Unknown Source)rn at java.net.Socket.(Unknown Source)rn at java.net.Socket.(Unknown Source)rn at rath.msnm.AbstractProcessor.makeConnection(AbstractProcessor.java:150)rn at rath.msnm.AbstractProcessor.run(AbstractProcessor.java:355)
httpclient post提交报java.net.UnknownHostException
我做了个简单的httpclient post 提交rn不知为何总报java.net.UnknownHostException异常。rnrn[code=Java]rnurl="http://www.dianpin.com";rn CityDetails citys = new CityDetails();rn // String targetRequest=citys.getCityDetails();rn String targetRequest = "aaa";rn HttpClient httpClient = new HttpClient();rn httpClient.getHostConfiguration().setHost(url);rn // 创建POST方法的实例rn PostMethod postMethod = new PostMethod();rn // 使用系统提供的默认的恢复策略rn postMethod.getParams().setParameter(HttpMethodParams.RETRY_HANDLER,rn new DefaultHttpMethodRetryHandler());rn postMethod.setRequestHeader( "User-Agent", "fake"); rn // 填入各个表单域的值rn NameValuePair[] data = new NameValuePair("request", targetRequest) ;rn // 将表单的值放入postMethod中rn postMethod.setRequestBody(data);rn try rn // 执行postMethodrn int statusCode = httpClient.executeMethod(postMethod);rn // HttpClient对于要求接受后继服务的请求,象POST和PUT等不能自动处理转发rn // 301或者302rn if (statusCode == HttpStatus.SC_MOVED_PERMANENTLYrn || statusCode == HttpStatus.SC_MOVED_TEMPORARILY) rn // 从头中取出转向的地址rn Header locationHeader = postMethodrn .getResponseHeader("location");rn String location = null;rn if (locationHeader != null) rn location = locationHeader.getValue();rn System.outrn .println("The page was redirected to:" + location);rnrn else rn System.err.println("Location field value is null.");rn rnrn rn if (statusCode != HttpStatus.SC_OK) rn System.err.println("Method failed: "rn + postMethod.getStatusLine());rn rn // 读取内容rn byte[] responseBody = postMethod.getResponseBody();rn // 处理内容rn String str = new String(responseBody);rn //writeXML(str);rn System.out.println(str);rnrn catch (HttpException e) rn // 发生致命的异常,可能是协议不对或者返回的内容有问题rn System.out.println("Please check your provided http address!");rn e.printStackTrace();rn catch (IOException e) rn // 发生网络异常rn e.printStackTrace();rn finally rn // 释放连接rn postMethod.releaseConnection();rn rn rn[/code]rnrnurl换成我自己localhost:8081/ssh2/hello.actionrn也不行,但是在ie里面输入这个地址是可以运行的。rn请问,这个问题如何解决,是由什么原因造成的
jboss启动提示java.net.unknownhostexception:www.w3.org
在linux下启动jboss提示java.net.unknownhostexception:www.w3.orgrn现在我修改了rn/etc/hostsrn加入了192.168.192.128 www.ws.org之后在启动JBOSSrn错误提示又改成java.net.connectException: connection refused.rn望大虾指点rn
linux条件下抓取网页报java.net.UnknownHostException
在linux环境下,比如使用htmlparser等这样的系统来抓取网页(只是为了具体说明),刚开始抓取都没有问题,但系统运行一段时间后,所有的网页抓取全部失效,也就是不管抓取任何一个网页都会失败报错,比如:rnrnorg.htmlparser.util.ParserException: Chaos reigns within. Reflect, repent and enter the correct URL. Order shall return.;rnjava.net.UnknownHostException: xxxxxx.comrn at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)rn at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)rn at java.net.Socket.connect(Socket.java:529)rn at java.net.Socket.connect(Socket.java:478)rn at sun.net.NetworkClient.doConnect(NetworkClient.java:163)rn at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)rn at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)rn at sun.net.www.http.HttpClient.(HttpClient.java:233)rn at sun.net.www.http.HttpClient.New(HttpClient.java:306)rn at sun.net.www.http.HttpClient.New(HttpClient.java:323)rn at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:860)rn at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:801)rn at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:726)rn at org.htmlparser.http.ConnectionManager.openConnection(ConnectionManager.java:643)rn at org.htmlparser.http.ConnectionManager.openConnection(ConnectionManager.java:841)rn at org.htmlparser.Parser.setResource(Parser.java:422)rn at org.htmlparser.Parser.(Parser.java:331)rn at org.htmlparser.Parser.(Parser.java:345)rn这个时候重启应用服务比如tomcat等也没效,除非是将服务器重启,抓取功能才会恢复正常,但同样的是,运行一段时间后会再次出现上面说的问题,请问,这是怎么回事呢?rn
java.net.UnknownHostException: Invalid hostname for server: loaclhost
[code=java]2013-12-31 23:13:04,432 INFO org.apache.hadoop.mapred.JobTracker: STARTUP_MSG: rn/************************************************************rnSTARTUP_MSG: Starting JobTrackerrnSTARTUP_MSG: host = localhost/127.0.0.1rnSTARTUP_MSG: args = []rnSTARTUP_MSG: version = 1.1.2rnSTARTUP_MSG: build = https://svn.apache.org/repos/asf/hadoop/common/branches/branch-1.1 -r 1440782; compiled by 'hortonfo' on Thu Jan 31 02:03:24 UTC 2013rn************************************************************/rn2013-12-31 23:13:04,612 INFO org.apache.hadoop.metrics2.impl.MetricsConfig: loaded properties from hadoop-metrics2.propertiesrn2013-12-31 23:13:04,624 INFO org.apache.hadoop.metrics2.impl.MetricsSourceAdapter: MBean for source MetricsSystem,sub=Stats registered.rn2013-12-31 23:13:04,625 INFO org.apache.hadoop.metrics2.impl.MetricsSystemImpl: Scheduled snapshot period at 10 second(s).rn2013-12-31 23:13:04,625 INFO org.apache.hadoop.metrics2.impl.MetricsSystemImpl: JobTracker metrics system startedrn2013-12-31 23:13:04,682 INFO org.apache.hadoop.metrics2.impl.MetricsSourceAdapter: MBean for source QueueMetrics,q=default registered.rn2013-12-31 23:13:15,532 INFO org.apache.hadoop.metrics2.impl.MetricsSourceAdapter: MBean for source ugi registered.rn2013-12-31 23:13:15,533 WARN org.apache.hadoop.metrics2.impl.MetricsSystemImpl: Source name ugi already exists!rn2013-12-31 23:13:15,534 INFO org.apache.hadoop.security.token.delegation.AbstractDelegationTokenSecretManager: Updating the current master key for generating delegation tokensrn2013-12-31 23:13:15,537 INFO org.apache.hadoop.mapred.JobTracker: Scheduler configured with (memSizeForMapSlotOnJT, memSizeForReduceSlotOnJT, limitMaxMemForMapTasks, limitMaxMemForReduceTasks) (-1, -1, -1, -1)rn2013-12-31 23:13:15,537 INFO org.apache.hadoop.util.HostsFileReader: Refreshing hosts (include/exclude) listrn2013-12-31 23:13:15,541 INFO org.apache.hadoop.security.token.delegation.AbstractDelegationTokenSecretManager: Starting expired delegation token remover thread, tokenRemoverScanInterval=60 min(s)rn2013-12-31 23:13:15,545 INFO org.apache.hadoop.security.token.delegation.AbstractDelegationTokenSecretManager: Updating the current master key for generating delegation tokensrn2013-12-31 23:13:15,546 INFO org.apache.hadoop.mapred.JobTracker: Starting jobtracker with owner as hunirn2013-12-31 23:13:15,555 FATAL org.apache.hadoop.mapred.JobTracker: java.net.UnknownHostException: Invalid hostname for server: loaclhostrn at org.apache.hadoop.ipc.Server.bind(Server.java:236)rn at org.apache.hadoop.ipc.Server$Listener.(Server.java:302)rn at org.apache.hadoop.ipc.Server.(Server.java:1488)rn at org.apache.hadoop.ipc.RPC$Server.(RPC.java:560)rn at org.apache.hadoop.ipc.RPC.getServer(RPC.java:521)rn at org.apache.hadoop.mapred.JobTracker.(JobTracker.java:2181)rn at org.apache.hadoop.mapred.JobTracker.(JobTracker.java:1889)rn at org.apache.hadoop.mapred.JobTracker.(JobTracker.java:1883)rn at org.apache.hadoop.mapred.JobTracker.startTracker(JobTracker.java:312)rn at org.apache.hadoop.mapred.JobTracker.startTracker(JobTracker.java:303)rn at org.apache.hadoop.mapred.JobTracker.startTracker(JobTracker.java:298)rn at org.apache.hadoop.mapred.JobTracker.main(JobTracker.java:4791)rnrn2013-12-31 23:13:15,555 INFO org.apache.hadoop.mapred.JobTracker: SHUTDOWN_MSG: rn/************************************************************rnSHUTDOWN_MSG: Shutting down JobTracker at localhost/127.0.0.1rn************************************************************/[/code]rnrnhosts文件:rn[img=https://img-bbs.csdn.net/upload/201401/01/1388560873_74019.png][/img]rninterfaces文件:rn[img=https://img-bbs.csdn.net/upload/201401/01/1388560924_390238.png][/img]
WebService调用出现 java.net.UnknownHostException异常?
我采用Axis技术访问另外一个服务商提供的webService,调用时出现了java.net.UnknownHostException异常rnrn访问方法如下:rn String endpointURL = "http://172.16.0.65/PowerInfo/WebServiceReportWar/ReportParser";rn rn invoker = DynamicInvoker.getInstance(endpointURL.toString());rn rn if(invoker == null)rn rn System.out.println("invoker is null");rnrn rnrn String xml = (String)invoker.invokeMethod("getXMLDocument",new String[]"41311036320101000","1114","2006","09","10");rn if(ObjectUtil.isNullOrEmpty(xml))rn rn System.out.println("return xml is null");rn rnrnrnrn在invoke方式时报错,
src
rn用这样的方法包含文件应当注意什么。这方法我头一次见到。请大家多说说这方面的资料谢谢。最近太穷就给50分。大家踊跃点啊
qipai src qipai src
qipaiqipaiqipaiqipai
设计模式src设计模式src
需要大于20个字符,不支持HTML标签 需要大于20个字符,不支持HTML标签
miky. src miky. src miky. src
miky. src miky. src miky. src miky. src miky. src miky. src miky. src miky. src miky. src miky. src miky. src miky. src
java运行报错
HTTP 错误 400 400 请求出错 由于语法格式有误,服务器无法理解此请求。不作修改,客户程序就无法重复此请求。 HTTP 错误 401 401.1 未授权:登录失败 此错误表明传输给服务器的证书与登录服务器所需的证书不匹配。 请与 Web 服务器的管理员联系,以确认您是否具有访问所请求资源的权限。 401.2 未授权:服务器的配置导致登录失败 此错误表明传输给服务器的证书与登录服务器所需的证书不匹配。此错误通常由未发送正确的 WWW 验证表头字段所致。 请与 Web 服务器的管理员联系,以确认您是否具有访问所请求资源的权限。 401.3 未授权:由于资源中的 ACL 而未授权 此错误表明客户所传输的证书没有对服务器中特定资源的访问权限。此资源可能是客户机中的地址行所列出的网页或文件,也可能是处理客户机中的地址行所列出的文件所需服务器上的其他文件。 请记录试图访问的完整地址,并与 Web 服务器的管理员联系以确认您是否具有访问所请求资源的权限。
关于运行报错
错误:Error:Execution failed for task ':app:dexDebug'. > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_65\bi
mininet运行报错
问题描述:使用mininet的自定义拓扑功能来生成拓扑。代码第一次运行的时候节点和链路都正常添加,但是在第二次运行的时候出现了错误提示。命令及代码如下: 说明:自定义的拓扑名字为MultiSwitchTopo.py# sudo python MultiSwitchTopo.py 节点和链接都正常添加,但是最后提示warning:No packets sent ,之后无法正常进入mininet,这
tensorboard运行报错
tensorboard 报错
hive运行报错
执行hive时报错,即使最简单的show databases也报错: hive&amp;gt; show databases; FAILED: SemanticException org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.RuntimeException: Unable to instantiate org.apache.had...
VB.NET 运行报错!!
运行完第一次,再运行时报错rn“System.Runtime.InteropServices.COMExceptionrn其它信息:HRESULT 中的异常 0x800A03EC”rnrn请是这是为什么?谢谢
form运行报错
[code=C#]rnnamespace JogMove rn rn public class FormTest:Form rn JogMove.Jog jog = new JogMove.Jog(); rn private FormTestButton_Click() rn rn jog.JogButton_Click(); rn rn rn rnnamespace JogMove rn rn public class Jog:Formrn private StreamWriter sw = File.CreateText("C:/test.txt"); //我新加这行rn public JogButton_Click(); rn rnrn[/code] rnrn我只要创建了sw对象,就有问题rn运行FormTest的时候就会报错rnrnThe process cannot access the file 'C:/test.txt' because it is being used by another process.rn
程序运行报错
连接数据库提示:[00103]登陆数据库发生错误:Unknown error opening cursor,请与系统管理员联系!rnrn这个错误是程序登陆的时候报的,数据库是9i,用pb6.5也连不上,但是通过odbc可以连通。但是用pb9的话数据库可以连通,为什么呢,请各位大侠分析下原因。
SQL 运行报错
declare @s nvarchar(4000)rnSelect @s=isnull(@s+',','')+quotename([Course]) from Class group by[Course]rnexec('select * from Class pivot (max([Score]) for [Course] in('+@s+'))b')rnrn消息 105,级别 15,状态 1,第 1 行rn字符串 '201222450))b' 后的引号不完整。rn消息 102,级别 15,状态 1,第 1 行rn'201222450))b' 附近有语法错误。
WebLogic运行报错。
我把包发布到WebLogic上,但是点Start,出现:rnweblogic.management.DeploymentException: [Deployer:149003]Unable to access application source information in '/bea/user_projects/domains/yfyxtest/servers/AdminServer/upload/tdgl.war' for application 'tdgl'. The specific error is: [Deployer:149158]No application files exist at '/bea/user_projects/domains/yfyxtest/servers/AdminServer/upload/tdgl.war'.. rn Errors were encountered while performing this operation. rnrnrn不知道什么原因?rn大家帮忙看看啊
jsp运行报错
<%@page import="com.atguigu.javaweb.mvc.Student"%>rn<%@page import="java.util.List"%>rn<%@ page language="java" contentType="text/html; charset=UTF-8"rn pageEncoding="UTF-8"%>rnrnrnrn rn Insert title herernrnrn <% rn List stus = (List)request.getAttribute("students");rn %>rn rn rn rn rn FlowIdrn Typern IdCardrn ExamCardrn StudentNamern Locationrn Gradern Deletern rn rn <%for(Student student: stus)%>rn rn <%= student.getFlowId() %>rn <%= student.getType() %>rn <%= student.getIdCard() %>rn <%= student.getExamCard() %>rn <%= student.getStudentName() %>rn <%= student.getLocation() %>rn <%= student.getGrade() %>rn Deletern rn <% %> rn rn rn rnrnrnrnrnrnrnorg.apache.jasper.JasperException: An exception occurred processing JSP page /students.jsp at line 29rnrn26: Deletern27: rn28: rn29: <%for(Student student: stus)%>rn30: rn31: <%= student.getFlowId() %>rn32: <%= student.getType() %>rnrnrnStacktrace:rn org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:521)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:430)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:723)rnrn
PB运行报错
[img=https://img-bbs.csdn.net/upload/201603/03/1456968394_860778.png][/img]rn该软件以PB12制作的。
JBoss 运行报错
[img=https://img-bbs.csdn.net/upload/201409/22/1411376678_706828.jpg][/img]rn服务器上一直出现这个错误 不知道具体原因 想请各位帮忙 有谁遇见过类似的情况帮忙指点下 谢谢
tomcat运行报错
BPEL Modules Only
相关热词 c++和c#哪个就业率高 c# 批量动态创建控件 c# 模块和程序集的区别 c# gmap 截图 c# 验证码图片生成类 c# 再次尝试 连接失败 c#开发编写规范 c# 压缩图片好麻烦 c#计算数组中的平均值 c#获取路由参数