java.net.MalformedURLException: unknown protocol: jrt 5C

win7 64位
官网下载jdk11
idea 2017

public class Test {
    public static void main(String[] args) {
        System.out.println(11);
    }
}

异常

Error:Internal error: (java.net.MalformedURLException) unknown protocol: jrt
java.net.MalformedURLException: unknown protocol: jrt
    at java.net.URL.<init>(URL.java:421)
    at java.net.URL.<init>(URL.java:310)
    at java.net.URL.<init>(URL.java:333)
    at com.intellij.compiler.instrumentation.InstrumentationClassFinder.createJDKPlatformUrl(InstrumentationClassFinder.java:61)
    at org.jetbrains.jps.incremental.instrumentation.ClassProcessingBuilder.createInstrumentationClassFinder(ClassProcessingBuilder.java:125)
    at org.jetbrains.jps.incremental.instrumentation.ClassProcessingBuilder.build(ClassProcessingBuilder.java:93)
    at org.jetbrains.jps.incremental.IncProjectBuilder.runModuleLevelBuilders(IncProjectBuilder.java:1246)
    at org.jetbrains.jps.incremental.IncProjectBuilder.runBuildersForChunk(IncProjectBuilder.java:923)
    at org.jetbrains.jps.incremental.IncProjectBuilder.buildTargetsChunk(IncProjectBuilder.java:995)
    at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunkIfAffected(IncProjectBuilder.java:886)
    at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunks(IncProjectBuilder.java:719)
    at org.jetbrains.jps.incremental.IncProjectBuilder.runBuild(IncProjectBuilder.java:371)
    at org.jetbrains.jps.incremental.IncProjectBuilder.build(IncProjectBuilder.java:178)
    at org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.java:138)
    at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:308)
    at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:138)
    at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler.lambda$channelRead0$0(BuildMain.java:235)
    at org.jetbrains.jps.service.impl.SharedThreadPoolImpl.lambda$executeOnPooledThread$0(SharedThreadPoolImpl.java:42)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Please perform full project rebuild (Build | Rebuild Project)

1个回答

idea 2017不支持jdk11,请更新到idea 2018.或者使用jdk8

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
jdk1.8换成11,启动项目报错java.net.MalformedURLException: unknown protocol: jrt

jdk11 Information:Internal caches are corrupted or have outdated format, forcing project rebuild: Module 'messystem' production: **java.net.MalformedURLException: unknown protocol: jrt** 解决:据说jdk11完美兼容以前jdk,但是项目是使用1.8 编写,报错, 在project structure->modules-> ![在这里插入图片描述](https://img-blog.csdnimg.cn/2018122312124235.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzM2OTIyOTI3,size_16,color_FFFFFF,t_70) 最后还是将项目jdk换回1.8, 11的新特性还是使用deemo去体验比较好,不要轻易将其用在低版本的jdk编写的项目中,这样的体验可能会有代价的,还好我这个只是启动不起来,如果是启动之后的运行过程中,出现什么问题,那就是GG了. 如果哪位朋友有不回恢复jdk1.8就能解决这个报错的,还望留言指教!! 注:1.8一切正常,只是更改项目jdk为11,没有更改任何代码,启动报错

IDEA运行报错:Error:Internal error: (java.net.MalformedURLException) unknown protocol:

Error:Internal error: (java.net.MalformedURLException) unknown protocol: jrt java.net.MalformedURLException: unknown protocol: jrt at java.net.URL.<init>(URL.java:421) at java.net.URL.<init>(URL.java:310) at java.net.URL.<init>(URL.java:333) at com.intellij.compiler.instrumentation.InstrumentationClassFinder.createJDKPlatformUrl(InstrumentationClassFinder.java:61) at org.jetbrains.jps.incremental.instrumentation.ClassProcessingBuilder.createInstrumentationClassFinder(ClassProcessingBuilder.java:125) at org.jetbrains.jps.incremental.instrumentation.ClassProcessingBuilder.build(ClassProcessingBuilder.java:93) at org.jetbrains.jps.incremental.IncProjectBuilder.runModuleLevelBuilders(IncProjectBuilder.java:1246) at org.jetbrains.jps.incremental.IncProjectBuilder.runBuildersForChunk(IncProjectBuilder.java:923) at org.jetbrains.jps.incremental.IncProjectBuilder.buildTargetsChunk(IncProjectBuilder.java:995) at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunkIfAffected(IncProjectBuilder.java:886) at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunks(IncProjectBuilder.java:719) at org.jetbrains.jps.incremental.IncProjectBuilder.runBuild(IncProjectBuilder.java:371) at org.jetbrains.jps.incremental.IncProjectBuilder.build(IncProjectBuilder.java:178) at org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.java:138) at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:308) at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:138) at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler.lambda$channelRead0$0(BuildMain.java:235) at org.jetbrains.jps.service.impl.SharedThreadPoolImpl.lambda$executeOnPooledThread$0(SharedThreadPoolImpl.java:42) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Please perform full project rebuild (Build | Rebuild Project)

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.<init>(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)

MalformedURLException: Protocol not found 错误

MalformedURLException: Protocol not found 如何解决这个问题? ERROR : java.net.MalformedURLException: Protocol not found: /mnt/sdcard/EREADER/NewForestPonies/OEBPS/content.opf 代码: //Getting the xhtml file names DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); String Document doc = db.parse(new InputSource(Environment.getExternalStorageDirectory()+"/EREADER/"+book_name+"/OEBPS/content.opf")); //ERROR HERE doc.getDocumentElement().normalize(); .......... ...... 对于 SAX 解析器? DataSaxHandler myXMLHandler = new DataSaxHandler(); xr.setContentHandler(myXMLHandler); xr.parse(new InputSource(Paths.getBookStorePath()+bookname+"/OEBPS/content.opf"));

xfire 调用远程webservice接口 no protocol: null

java.lang.RuntimeException: java.net.MalformedURLException: no protocol: null at org.apache.ws.commons.schema.resolver.DefaultURIResolver.resolveEntity(DefaultURIResolver.java:71) at org.codehaus.xfire.wsdl11.parser.XmlSchemaURIResolver.resolveEntity(XmlSchemaURIResolver.java:34) at org.apache.ws.commons.schema.SchemaBuilder.resolveXmlSchema(SchemaBuilder.java:684) at org.apache.ws.commons.schema.SchemaBuilder.handleImport(SchemaBuilder.java:538) at org.apache.ws.commons.schema.SchemaBuilder.handleSchemaElementChild(SchemaBuilder.java:1516) at org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:659) at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:551) at org.codehaus.xfire.wsdl11.parser.WSDLServiceBuilder.visit(WSDLServiceBuilder.java:360) at org.codehaus.xfire.wsdl11.parser.WSDLServiceBuilder.build(WSDLServiceBuilder.java:188) at org.codehaus.xfire.client.Client.initFromDefinition(Client.java:264) at org.codehaus.xfire.client.Client.<init>(Client.java:236) at org.codehaus.xfire.client.Client.<init>(Client.java:246) at cn.com.XfireClient.main(XfireClient.java:14) Caused by: java.net.MalformedURLException: no protocol: null at java.net.URL.<init>(URL.java:585) at java.net.URL.<init>(URL.java:482) at java.net.URL.<init>(URL.java:431) at org.apache.ws.commons.schema.resolver.DefaultURIResolver.resolveEntity(DefaultURIResolver.java:67) ... 12 more

Jdom解析错误 “no protocol”!不知如何修改!

String xml = "<?xml version = \"1.0\" encoding =\"UTF-8\"?> " + " <queryresult>" + " <trnid>d1</trnid> <type>n</type>" + " <status>" + " <code>0</code>" + " <message>ok</message>" + " </status>" + "<result>" + " <balrec>" + " <account>" + " + " <acntname>XX集团财务公司</acntname>" + " </account>" + " <balance>30000000.33</balance>" + " </balrec>" + "</result>" + "</queryresult>".trim(); SAXBuilder sb = new SAXBuilder(false); Document doc = sb.build(xml); ----------------------------------------------------------------------------- java.net.MalformedURLException: no protocol: <?xml version = "1.0" encoding ="UTF-8"?> <queryresult> <trnid>d1</trnid> <type>n</type> <status> <code>0</code> <message>ok</message> </status><result> <balrec> <account> <acntno>1234567890123456789</acntno> <acntname>XX集团财务公司</acntname> </account> <balance>30000000.33</balance> </balrec></result></queryresult> at java.net.URL.<init>(URL.java:601) at java.net.URL.<init>(URL.java:498) at java.net.URL.<init>(URL.java:447) 报错信息 是不是jdom不知是string的xml格式的解析啊?

java soap发送到webService服务端问题

问题: 以下这个报错 求大神怎么解决 报错 com.sun.xml.internal.ws.client.ClientTransportException: HTTP 传输错误: java.net.ConnectException: Connection refused: connect at com.sun.xml.internal.ws.transport.http.client.HttpClientTransport.getOutput(HttpClientTransport.java:117) at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:208) at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:130) at com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:124) at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:1121) at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:1035) at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:1004) at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:862) at com.sun.xml.internal.ws.client.Stub.process(Stub.java:448) at com.sun.xml.internal.ws.client.dispatch.DispatchImpl.doInvoke(DispatchImpl.java:250) at com.sun.xml.internal.ws.client.dispatch.DispatchImpl.invoke(DispatchImpl.java:289) at com.hzyx.his.test.SoapTest.test2(SoapTest.java:78) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:108) at org.testng.internal.Invoker.invokeMethod(Invoker.java:661) at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:869) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1193) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109) at org.testng.TestRunner.privateRun(TestRunner.java:744) at org.testng.TestRunner.run(TestRunner.java:602) at org.testng.SuiteRunner.runTest(SuiteRunner.java:380) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:375) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340) at org.testng.SuiteRunner.run(SuiteRunner.java:289) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1301) at org.testng.TestNG.runSuitesLocally(TestNG.java:1226) at org.testng.TestNG.runSuites(TestNG.java:1144) at org.testng.TestNG.run(TestNG.java:1115) at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:72) at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:127) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147) Caused by: java.net.ConnectException: Connection refused: connect at java.net.DualStackPlainSocketImpl.connect0(Native Method) at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) 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 java.net.Socket.connect(Socket.java:538) at sun.net.NetworkClient.doConnect(NetworkClient.java:180) at sun.net.www.http.HttpClient.openServer(HttpClient.java:432) at sun.net.www.http.HttpClient.openServer(HttpClient.java:527) at sun.net.www.http.HttpClient.<init>(HttpClient.java:211) at sun.net.www.http.HttpClient.New(HttpClient.java:308) at sun.net.www.http.HttpClient.New(HttpClient.java:326) at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1202) at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1181) at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1032) at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:966) at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1316) at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1291) at com.sun.xml.internal.ws.transport.http.client.HttpClientTransport.getOutput(HttpClientTransport.java:104) ... 40 more 源码: //webservice命名空间 String ns = "http://services.agent.sinobest.cn/"; //wsdl地址 String wsdlUrl = "http://localhost:8080/Service?wsdl"; URL url = new URL(wsdlUrl); //创建服务 Webservice类名:Service QName sName = new QName(ns, "Service"); Service service = Service.create(url, sName); // 创建Dispatch对象 通过SOAPMessage 方式 QName qName = new QName(ns, "ServicePort"); Dispatch<SOAPMessage> dispatch = service.createDispatch(new QName(ns, "Service"), SOAPMessage.class, Service.Mode.MESSAGE); // 创建SOAPMessage SOAPMessage msg = MessageFactory.newInstance( SOAPConstants.SOAP_1_2_PROTOCOL).createMessage(); msg.setProperty(SOAPMessage.CHARACTER_SET_ENCODING, "UTF-8"); SOAPEnvelope envelope = msg.getSOAPPart().getEnvelope(); // 创建SOAPBody SOAPBody body = envelope.getBody(); //设置参数 QName ename = new QName(ns, "login", "ser"); SOAPBodyElement ele = body.addBodyElement(ename); ele.addChildElement("arg0").setValue("100"); //输出传递参数 msg.writeTo(System.out); // 通过Dispatch传递消息,会返回响应消息 SOAPMessage response = dispatch.invoke(msg);

基于AXIS调用webservice报错:Connection refused: connect

我的调用方法: public static void main(String[] args) throws Exception { String client_id = "HeYiApp"; String orderNum = "2"; List numberList = new ArrayList(); numberList.add("120719"); numberList.add("120746"); numberList.add("113095"); String webUrl = "https://10.218.132.26/api/openapi/employee/getBatchEmpInfoList.json";// 服务端url地址 String webMethod = "getBatchEmpInfoList";// 调用方法名称 Service service = new Service(); // 建服务 Call call; try { call = (Call) service.createCall(); try { call.setTargetEndpointAddress(new URL(webUrl)); } catch (MalformedURLException e) { // TODO Auto-generated catch block e.printStackTrace(); }// 设置访问地址 call.setOperationName(webMethod);// 设置访问方法 call.addParameter("arg0", XMLType.XSD_STRING, javax.xml.rpc.ParameterMode.IN);// 定义参数 call.addParameter("arg1", XMLType.XSD_STRING, javax.xml.rpc.ParameterMode.IN);// 定义参数 call.addParameter("arg2", XMLType.XSD_STRING, javax.xml.rpc.ParameterMode.IN);// 定义参数 call.setReturnType(XMLType.XSD_STRING);// 定义返回值格式 //List<Map<String, Object>> workersInfo= (List<Map<String, Object>>) call.invoke(new Object[] { client_id, numberList, orderNum }); //for(Map m:workersInfo){ // System.out.println(m.get("name")); //} JSONArray jsonObject = (JSONArray) call.invoke(new Object[] { client_id, numberList, orderNum }); System.out.println(jsonObject.toString()); } catch (ServiceException e) { // TODO Auto-generated catch block e.printStackTrace(); } // 建对话 } 报错: Exception in thread "main" AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException faultSubcode: faultString: java.net.ConnectException: Connection refused: connect faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}stackTrace:java.net.ConnectException: Connection refused: connect at java.net.DualStackPlainSocketImpl.connect0(Native Method) at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) 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.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:668) at sun.security.ssl.SSLSocketImpl.&lt;init&gt;(SSLSocketImpl.java:427) at sun.security.ssl.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImpl.java:88) at org.apache.axis.components.net.JSSESocketFactory.create(JSSESocketFactory.java:92) at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191) at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404) at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138) at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32) at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118) at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83) at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165) at org.apache.axis.client.Call.invokeEngine(Call.java:2784) at org.apache.axis.client.Call.invoke(Call.java:2767) at org.apache.axis.client.Call.invoke(Call.java:2443) at org.apache.axis.client.Call.invoke(Call.java:2366) at org.apache.axis.client.Call.invoke(Call.java:1812) at webservice.Test.main(Test.java:52) {http://xml.apache.org/axis/}hostname:zhangxl java.net.ConnectException: Connection refused: connect at org.apache.axis.AxisFault.makeFault(AxisFault.java:101) at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:154) at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32) at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118) at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83) at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165) at org.apache.axis.client.Call.invokeEngine(Call.java:2784) at org.apache.axis.client.Call.invoke(Call.java:2767) at org.apache.axis.client.Call.invoke(Call.java:2443) at org.apache.axis.client.Call.invoke(Call.java:2366) at org.apache.axis.client.Call.invoke(Call.java:1812) at webservice.Test.main(Test.java:52) Caused by: java.net.ConnectException: Connection refused: connect at java.net.DualStackPlainSocketImpl.connect0(Native Method) at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) 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.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:668) at sun.security.ssl.SSLSocketImpl.<init>(SSLSocketImpl.java:427) at sun.security.ssl.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImpl.java:88) at org.apache.axis.components.net.JSSESocketFactory.create(JSSESocketFactory.java:92) at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191) at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404) at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138) ... 10 more

RMI连接问题

先贴下异常信息: Lookup of RMI stub failed; nested exception is java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is: java.net.SocketException: Connection reset org.springframework.remoting.RemoteLookupFailureException: Lookup of RMI stub failed; nested exception is java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is: java.net.SocketException: Connection reset at org.springframework.remoting.rmi.RmiClientInterceptor.lookupStub(RmiClientInterceptor.java:215) at org.springframework.remoting.rmi.RmiClientInterceptor.getStub(RmiClientInterceptor.java:237) at org.springframework.remoting.rmi.RmiClientInterceptor.invoke(RmiClientInterceptor.java:257) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at $Proxy2.handleEvent(Unknown Source) at com.ffcs.oss.snms.fm.services.dataservice.EventSenderImpl.handleEvent(EventSenderImpl.java:219) at com.ffcs.oss.snms.fm.services.dataservice.EventSenderImpl.sendEventTask(EventSenderImpl.java:191) at com.ffcs.oss.snms.fm.services.dataservice.EventSenderImpl.access$0(EventSenderImpl.java:173) at com.ffcs.oss.snms.fm.services.dataservice.EventSenderImpl$ResSendTask.run(EventSenderImpl.java:166) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is: java.net.SocketException: Connection reset at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:286) at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184) at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:322) at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source) at java.rmi.Naming.lookup(Naming.java:84) at org.springframework.remoting.rmi.RmiClientInterceptor.lookupStub(RmiClientInterceptor.java:200) ... 18 more Caused by: java.net.SocketException: Connection reset at java.net.SocketInputStream.read(SocketInputStream.java:168) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:237) at java.io.DataInputStream.readByte(DataInputStream.java:248) at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:228) ... 23 more 问题描述:在同一台linux服务器同时发布N个RMI服务,当这个N大于某个数据时,有的服务被调用时就报了这个异常,调用该服务的客户端有的连接正常,有的连接会报这个错误,我关掉了任意一个正常或非正常的服务,其他所有服务都通了,这个问题貌似是linux对连接数做了限制吗?有知道的rmi哥哥或者linux哥哥指点下

请问下列错误是什么原因引起的

Exception in Application start method java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(Unknown Source) at com.sun.javafx.application.LauncherImpl.launchApplication(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at sun.launcher.LauncherHelper$FXHelper.main(Unknown Source) Caused by: java.lang.RuntimeException: Exception in Application start method at com.sun.javafx.application.LauncherImpl.launchApplication1(Unknown Source) at com.sun.javafx.application.LauncherImpl.access$000(Unknown Source) at com.sun.javafx.application.LauncherImpl$1.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.IllegalArgumentException: Invalid URL: unknown protocol: c at javafx.scene.image.Image.validateUrl(Unknown Source) at javafx.scene.image.Image.<init>(Unknown Source) at week11.MyJavaFX.start(MyJavaFX.java:25) at com.sun.javafx.application.LauncherImpl$8.run(Unknown Source) at com.sun.javafx.application.PlatformImpl$7.run(Unknown Source) at com.sun.javafx.application.PlatformImpl$6$1.run(Unknown Source) at com.sun.javafx.application.PlatformImpl$6$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at com.sun.javafx.application.PlatformImpl$6.run(Unknown Source) at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source) at com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at com.sun.glass.ui.win.WinApplication.access$300(Unknown Source) at com.sun.glass.ui.win.WinApplication$4$1.run(Unknown Source) ... 1 more Caused by: java.net.MalformedURLException: unknown protocol: c at java.net.URL.<init>(Unknown Source) at java.net.URL.<init>(Unknown Source) at java.net.URL.<init>(Unknown Source) ... 14 more Exception running application week11.MyJavaFX

JMX监控weblogic报错 Unsupported protocol: t3

使用JMX对weblogic进行监控的时候,在本地使用main方法测试没有任何问题,当部署到web服务上在启动就会报错: Exception in thread "Main Thread" java.net.MalformedURLException: Unsupported protocol: t3 我已经把jar包加到项目中的,不知道为什么还包这个错误呀

client调用多个不同的基于HTTPS的webservices时,System.setProperty(javax.net.ssl.XXX)不起作用?

在同一个web应用里, 作为client访问基于HTTPS的webservices,client这边通过设置以下系统参数,是可以成功的, System.setProperty("javax.net.ssl.keyStore", keystoreFile); System.setProperty("javax.net.ssl.keyStorePassword",keystorePassword); System.setProperty("javax.net.ssl.trustStore", truststoreFile); System.setProperty("javax.net.ssl.trustStorePassword",truststorePassword); 但是,现在clinet还要访问另外一个也是基于HTTPS的web services,当然证书是不一样的, 这时client能再次设置这些系统参数为另外的值么?访问能成功么? 找到之前的一个相关的帖子,好像没有结论?http://www.iteye.com/problems/9652 多谢! :) [b]问题补充:[/b] 注释掉第一次的调用,第二次的调用是成功的,所以相关参数肯定是设置对了。 但是只要运行两次调用(调不同的webservice),即使中间clearProperty,还是不行。 还尝试过颠倒两次调用的顺序,结果也总是第二次的调用不成功。 :( [b]问题补充:[/b] to pJun,System.getProperty的结果是第二次设置的值。thx [b]问题补充:[/b] 是不是不应该采取这种设置系统参数的方式啊? 有其他方法么? 8) [b]问题补充:[/b] HTTPClient能不能动态的设置keystore/keystorepasswd/truststore/truststorepasswd呢? :wink: [b]问题补充:[/b] 换了一种方式,使用了http://hc.apache.org/httpclient-3.x/sslguide.html里提供的AuthSSLProtocolSocketFactory 调用的代码也是按照其注释写的,但是感觉只是调用了一下构造函数,并没有实质的动作,调用结果也是失败的:PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target 下面是代码: [code="java"] HttpClient client = new HttpClient(new MultiThreadedHttpConnectionManager()); client.getHttpConnectionManager().getParams().setSoTimeout(3000); client.getHttpConnectionManager().getParams().setMaxTotalConnections(5); Protocol authhttps = null; try { authhttps = new Protocol( "https", new AuthSSLProtocolSocketFactory( new URL( "file:/C:/Documents and Settings/test/Desktop/tmp/keystore"), "mypasswd", new URL( "file:/C:/Documents and Settings/test/Desktop/tmp/truststore"), "mypasswd"), 7743); } catch (MalformedURLException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } client.getHostConfiguration().setHost(wsHost,wsPort, authhttps); DefaultHttpMethodRetryHandler retryhandler = new DefaultHttpMethodRetryHandler( recoverTimes, true); client.getParams().setParameter(HttpMethodParams.RETRY_HANDLER, retryhandler); PostMethod post = new PostMethod(wsURL); RequestEntity entity = new StringRequestEntity(requestXML, "text/xml", "UTF-8"); post.setRequestEntity(entity); HttpClientResponse httpClientResponse = null; try { int result = client.executeMethod(post); logger.log(Level.INFO, "result ="+ result); String responseXML = post.getResponseBodyAsString(); } catch (Exception ex) { logger.warning(ex.toString()); return; } finally { post.releaseConnection(); }[/code] JDK1.5 [b]问题补充:[/b] To lovewhzlq , //和///都试了一下,错误还是一样。 :x [b]问题补充:[/b] 最初重复设置两次系统参数时,也是抛这种类型的异常…… :? [b]问题补充:[/b] To pJun, 3个斜杠试过了,也不行。 是必须调用注册么? Protocol.registerProtocol("https", authhttps); 注不注册有区别么? 我再试试不用URL表示本地文件路径吧。。。。也许就能找到文件了。 [b]问题补充:[/b] 需要调用registerProtocol,否则AuthSSLProtocolSocketFactory不起作用。谢谢大家。

java nullpointerexpection

package tester; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.FileWriter; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.net.MalformedURLException; import java.net.URL; public class Tes { public static void main(String[]ra)throws IOException { try { URL url1=new URL("http://www.qidian.com"); InputStream in=url1.openStream(); InputStreamReader inr=new InputStreamReader(in,"utf-8"); BufferedReader br=new BufferedReader(inr); String data=br.readLine(); FileWriter fr=new FileWriter("C:\\Users\\lenovo\\Desktop\\起点.txt"); BufferedWriter ws=new BufferedWriter(fr); ws.write(data); while(data!=null) { System.out.println(data); data=br.readLine(); ws.write(data); } ws.flush(); ws.close(); fr.close(); } catch (MalformedURLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } Exception in thread "main" java.lang.NullPointerException at java.io.Writer.write(Unknown Source) at tester.Tes.main(Tes.java:28)

向url使用post传参报错

public void Post(String url,JSONObject obj) { try { URL u = new URL(url); HttpURLConnection connection = (HttpURLConnection) u .openConnection(); connection.setDoOutput(true); connection.setDoInput(true); connection.setRequestMethod("POST"); connection.setUseCaches(false); connection.setInstanceFollowRedirects(true); //connection.setRequestProperty("connection", "Keep-Alive"); //connection.setRequestProperty("Content-Type", "text/plain; charset=utf-8"); connection.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)"); connection.connect(); //POST请求 DataOutputStream out = new DataOutputStream( connection.getOutputStream()); out.writeBytes(obj.toString()); System.out.println(obj.toString()); out.flush(); out.close(); //读取响应 BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); String lines; StringBuffer sb = new StringBuffer(""); while ((lines = reader.readLine()) != null) { lines = new String(lines.getBytes(), "utf-8"); sb.append(lines); } System.out.println(sb); reader.close(); connection.disconnect(); } catch (MalformedURLException e) { e.printStackTrace(); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } 报错信息"contentplain":"测试副本","contentrich":"大幅答复","operator":"测试","projectsid":"rx","pubdate":"2011-12-24","scope":"8","tags":"标记","title":" 测试内容以"} java.io.IOException: Server returned HTTP response code: 421 for URL: http://dev.orangeinvest.cn/svc/action/ann.post.do at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1627) at com.app.DateSend.Post(DateSend.java:40) at com.web.postService.realnotice(postService.java:167) at com.web.postService.doPost(postService.java:64) at javax.servlet.http.HttpServlet.service(HttpServlet.java:646) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745)

客户端使用XFire调用时出错 NoClassDefFoundError: XFireRunTimeException

我在test程序的main()方法中调用时能够取得到数据,而在serviceImpl层调用时就出现下列问题了. NoClassDefFoundError: org/codehaus/xfire/XFireRunTimeException 这是什么个情况.

工行非NC方式向银行发送指令数据,求指导

``` byte[] date = "<?xml version=\"1.0\" encoding=\"GBK\"?><CMS><eb><pub><TransCode>TEST</TransCode><CIS>400090001604411</CIS><BackCode>671</BackCode><ID>rp.y.4000</ID><TranDate>2017-05-04</TranDate><TranTime>145922111222</TranTime><fSeqno>201705041458123</fSeqno></pub><in><AccNo>4000023029200124946</AccNo><AreaCode>SZFH</AreaCode><MinAmt>1</MinAmt><MaxAmt>100000000</MaxAmt></in></eb></CMS>".getBytes(); ICBC i = ICBC.getICBC(); Enterprise e = Enterprise.getEnterprise(); String version = "0.0.0.1"; String bank_code = e.getBankcode(); String group_code = e.getCis(); byte[] signature = null; String certificatename = null; byte[] certificate = null; String tran_code = "perdis"; String id = "rp.y.0200";//请根据实际修改证书名称 String body = new String(date); boolean signflag = false;//交易是否需要签名,根据实际交易修改或者配置 byte[] key = null; try { key = TranslationTool.readFile(e.getKey()); } catch (IOException e2) { System.out.println("无法读取企业数据层私钥文件"); return; } char[] password = e.getKeypass().toCharArray(); try { signature = ReturnValue.sign(date, date.length, key, password); } catch (Exception e3) { System.out.println("无法生成签名"); return; } try { certificatename = e.getCerfile(); } catch (Exception e4) { System.out.println("没有配置企业数据层公钥文件"); return; } try { FileInputStream fii = new FileInputStream(new File(e.getCerfile())); certificate = new byte[fii.available()]; fii.read(certificate);//私钥 fii.close(); } catch (IOException e4) { manage.DivScreen("","无法读取配置企业数据层公钥文件",80); return; } PostMethod mypost = new PostMethod("/servlet/ICBCCMPAPIReqServlet?userID=rp.y.4000&PackageID=201705041458123&SendTime=145922111222"); mypost.addParameter("Version", version); mypost.addParameter("GroupCIS", group_code); mypost.addParameter("BankCode", bank_code); mypost.addParameter("TransCode", tran_code); if (signflag){//需要签名做以下操作,否则放明文 String length = String.valueOf(body.length()); if (length.length() <= 10) length = ("0000000000").substring(0,10-length.length())+ length;//长度补齐10位,左补0 body = length + body + "ICBCCMP" + getrevFromBASE64(signature); } mypost.addParameter("reqData", getrevFromBASE64(body.getBytes()));//请根据实际修改上送包xml数据 mypost.addParameter("ID", id); mypost.addParameter("PackageID", "201705041458123");//要求永远不能重复,可以参考接口文档的说明 mypost.addParameter("Cert", getrevFromBASE64(certificate)); try { Protocol myhttps = new Protocol( "https", new AuthSSLProtocolSocketFactory( null, null, new URL("file:" + i.getTruststore()), null), 443); HttpConnection myconn = new HttpConnection(i.getIp(), Integer.parseInt(i.getPort()), myhttps); myconn.open(); int re_code = mypost.execute(new HttpState(), myconn); if (re_code==200) { manage.DivScreen("","已成功发送一笔 "+"perdis",80); String repMsg = mypost.getResponseBodyAsString(); String ssspMsg = mypost.getResponseBodyAsString(); manage.DivScreen("","已接收到返回信息 "+ssspMsg,80); } else { manage.DivScreen("","发送失败,http错误码"+re_code,80); } } catch (MalformedURLException e1) { manage.DivScreen("","无法读取工行通讯层证书",80); } catch (Exception e1) { System.out.println(e1); manage.DivScreen("","通讯异常",80); } } ``` 建立不了连接 每次 跑起来总是报java.net.UnknownHostException: https://cmpgtcg3.dccnet.com.cn错误,到底是问题出在哪里,求解! 还有这个应该怎么做,希望有人教一下。必有重谢

JSONException故障排除:字符0 Android输入结束

<div class="post-text" itemprop="text"> <p>Im having trouble with the error JSONException. my doInBackground() pass the param of the movieId which is 1 (already logged) to the php file and then the PHP file will do a query and return json. Running in the browser works for JSON response. </p> <pre><code>import android.app.ProgressDialog; import android.net.ParseException; import android.net.Uri; import android.os.AsyncTask; import android.os.Bundle; import android.support.v4.app.Fragment; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; import android.widget.Toast; import com.bumptech.glide.Glide; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import org.w3c.dom.Text; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; import java.util.List; /** * A simple {@link Fragment} subclass. */ public class FirstFragment extends Fragment { ImageView imageView; TextView name, id; public FirstFragment() { // Required empty public constructor } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment final View rootView = inflater.inflate(R.layout.fragment_first, container, false); imageView = (ImageView) rootView.findViewById(R.id.movie_image); name = (TextView) rootView.findViewById(R.id.movie_name); id = (TextView) rootView.findViewById(R.id.movie_id); Bundle mBundle = new Bundle(); mBundle = getArguments(); name.setText(mBundle.getString("textMovieName")); id.setText(mBundle.getString("textMovieId")); Glide.with(getContext()).load(mBundle.getString("ivMovie")) .placeholder(R.drawable.placeholder) .error(R.drawable.ic_menu_camera) .into(imageView); new AsyncDate().execute(mBundle.getString("textMovieId")); return rootView; } private class AsyncDate extends AsyncTask&lt;String, String, String&gt; { ProgressDialog pdLoading = new ProgressDialog(getActivity()); HttpURLConnection conn; URL url = null; @Override protected void onPreExecute() { super.onPreExecute(); } @Override protected String doInBackground(String... params) { try { url = new URL("http://100.74.245.14/finalproject/date_time.php"); } catch (MalformedURLException e) { e.printStackTrace(); return "exception"; } //Log.d("params", params[0]); try { conn = (HttpURLConnection) url.openConnection(); conn.setReadTimeout(10000); conn.setConnectTimeout(10000); conn.setRequestMethod("POST"); conn.setDoInput(true); conn.setDoOutput(true); Uri.Builder builder = new Uri.Builder() .appendQueryParameter("movieId", params[0]); String query = builder.build().getEncodedQuery(); OutputStream os = conn.getOutputStream(); BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(os, "UTF-8")); writer.write(query); writer.flush(); writer.close(); os.close(); conn.connect(); } catch (IOException e1) { e1.printStackTrace(); return "exception"; } try { int response_code = conn.getResponseCode(); if (response_code == HttpURLConnection.HTTP_OK) { //Log.d("response","ok"); InputStream input = conn.getInputStream(); BufferedReader reader = new BufferedReader(new InputStreamReader(input)); StringBuilder result = new StringBuilder(); String line; while ((line = reader.readLine()) != null) { result.append(line); } Log.d("return", result.toString()); return (result.toString()); } else { return "unsuccessful"; } } catch (IOException e2) { e2.printStackTrace(); return "exception"; } finally { conn.disconnect(); } } @Override protected void onPostExecute(String result) { List&lt;listMovie&gt; data = new ArrayList&lt;&gt;(); try { JSONObject jsonObj = new JSONObject(result); JSONArray jArray = jsonObj.getJSONArray("test"); //Log.d("json", result); for (int i = 0; i &lt; jArray.length(); i++) { //Log.d("json", "test"); JSONObject json_data = jArray.getJSONObject(i); listMovie movieData = new listMovie(); movieData.movieDate = json_data.getString("date"); movieData.movieTime = json_data.getString("time"); data.add(movieData); } } catch (JSONException e) { e.printStackTrace(); } } } } </code></pre> <p>PHP File</p> <pre><code>&lt;?php include 'config.inc.php'; if(isset($_POST['movieId'])) { $movieId= $_POST['movieId']; $sql = 'SELECT * FROM movie_time WHERE movie_id = :movie_id'; $stmt = $conn -&gt; prepare($sql); $stmt -&gt; bindParam(':movie_id', $movieId, PDO::PARAM_STR); $result = $stmt -&gt; execute(); if($result) { while($row = $stmt-&gt;fetchAll(PDO::FETCH_ASSOC)) { $flag['test'] = $row; } header('Content-type: application/json'); echo json_encode($flag); } } ?&gt; </code></pre> <p>The error I got </p> <pre><code>W/System.err: org.json.JSONException: End of input at character 0 of W/System.err: at org.json.JSONTokener.syntaxError(JSONTokener.java:450) W/System.err: at org.json.JSONTokener.nextValue(JSONTokener.java:97) W/System.err: at org.json.JSONObject.&lt;init&gt;(JSONObject.java:155) W/System.err: at org.json.JSONObject.&lt;init&gt;(JSONObject.java:172) W/System.err: at com.example..fyp.FirstFragment$AsyncDate$override.onPostExecute(FirstFragment.java:153) W/System.err: at com.example.fyp.FirstFragment$AsyncDate$override.access$dispatch(FirstFragment.java) W/System.err: at com.example.fyp.FirstFragment$AsyncDate.onPostExecute(FirstFragment.java:0) W/System.err: at com.example.fyp.FirstFragment$AsyncDate.onPostExecute(FirstFragment.java:75) W/System.err: at android.os.AsyncTask.finish(AsyncTask.java:632) W/System.err: at android.os.AsyncTask.access$600(AsyncTask.java:177) W/System.err: at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:645) W/System.err: at android.os.Handler.dispatchMessage(Handler.java:102) W/System.err: at android.os.Looper.loop(Looper.java:136) W/System.err: at android.app.ActivityThread.main(ActivityThread.java:5017) W/System.err: at java.lang.reflect.Method.invokeNative(Native Method) W/System.err: at java.lang.reflect.Method.invoke(Method.java:515) W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) W/System.err: at dalvik.system.NativeStart.main(Native Method) </code></pre> <p>At this line</p> <pre><code>JSONObject jsonObj = new JSONObject(result); </code></pre> </div>

如何利用 java 多线程 爬取大量网页?

大家好,我现在遇到一个问题,手里有50,000多url,需要一一下载下来,由于都是国外的网址,因此相当慢,现在想弄成多线程抓取网页,不过我的代码无法正常运行,请达人不吝指教,多谢了,以下是我的代码: [code="java"] import ...... public class Down2011CaseMeshTread extends Thread { public static int count = 0; public static List<String> docDoiList = getCaseDoiList2(); private static URL url; private static String doi; static int BUFFER_SIZE = 1024*10; public Down2011CaseMeshTread(String doi) throws MalformedURLException{ String urlStr = "http://www.iteye.com/" + doi; this.url = new URL(urlStr); this.doi = doi; } public static Connection getConnection() throws Exception { //连接数据库的 } public static String getDocNameByDoi(String docDoi){ //获得docDoi对应的文件名,就是下载下来之后文件的存储名字 } public void Test() throws IOException, InterruptedException{ StringBuffer sb = null; BufferedReader in = null; BufferedWriter out = null; try { sb = new StringBuffer(); int ch =0; URLConnection conn = (HttpURLConnection)url.openConnection(); conn.setRequestProperty("User-Agent", "Mozilla/4.76"); conn.setDoOutput(true); conn.setConnectTimeout(1000*60*10); in = new BufferedReader(new InputStreamReader(url.openStream())); FileOutputStream fo = new FileOutputStream("/home/" + getDocNameByDoi(doi)); OutputStreamWriter writer = new OutputStreamWriter(fo, "utf-8"); out = new BufferedWriter(writer); while (!in.ready()) { Thread.sleep(500); // wait for stream to be ready. } char[] buffer = new char[BUFFER_SIZE]; int charsRead = 0; while ( (charsRead = in.read(buffer, 0, BUFFER_SIZE)) != -1 ) { out.write(buffer, 0, charsRead); } out.close(); in.close(); }catch(Exception e){ e.printStackTrace(); } } public void run(){ try { Test(); } catch (IOException e) { e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } //应该是run()这里的问题,但我不知道改怎么改???? public static List<String> getCaseDoiList2(){ //获得url链表,一共五万多 } public static void main(String args[]) throws MalformedURLException{ for(String docDoi : docDoiList){ Down2011CaseMeshTread down = new Down2011CaseMeshTread(docDoi); down.start(); } } } [/code] 情况就是这么个情况, 请问这个该怎么改阿,非常感谢~ 这个程序的问题是,开始执行特别快,大概一分钟能下两三百,但下到大约800的时候就报错 先是读到异常文件终止“EOF” 但这时还可以断断续续的下载 [code] java.io.IOException: Premature EOF at sun.net.www.http.ChunkedInputStream.fastRead(ChunkedInputStream.java:252) at sun.net.www.http.ChunkedInputStream.read(ChunkedInputStream.java:680) at java.io.FilterInputStream.read(FilterInputStream.java:133) at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:2582) at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:282) at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:324) at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:176) at java.io.InputStreamReader.read(InputStreamReader.java:184) at java.io.BufferedReader.read1(BufferedReader.java:202) at java.io.BufferedReader.read(BufferedReader.java:278) at org.Down2011CaseMeshTread.Test(Down2011CaseMeshTread.java:138) at org.Down2011CaseMeshTread.run(Down2011CaseMeshTread.java:150) [/code] 然后再报连接超时错误,这个时候下载就都中断了 [code] java.net.ConnectException: Connection timed out at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:327) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:193) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:180) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:384) at java.net.Socket.connect(Socket.java:546) at java.net.Socket.connect(Socket.java:495) at sun.net.NetworkClient.doConnect(NetworkClient.java:178) at sun.net.www.http.HttpClient.openServer(HttpClient.java:409) at sun.net.www.http.HttpClient.openServer(HttpClient.java:530) at sun.net.www.http.HttpClient.<init>(HttpClient.java:240) at sun.net.www.http.HttpClient.New(HttpClient.java:321) at sun.net.www.http.HttpClient.New(HttpClient.java:338) at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:935) at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:876) at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:801) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1139) at java.net.URL.openStream(URL.java:1029) at org.Down2011CaseMeshTread.Test(Down2011CaseMeshTread.java:127) at org.Down2011CaseMeshTread.run(Down2011CaseMeshTread.java:150) [/code] 这个是连接的错误 估计是我没有设定线程的数量,所以在存在大量线程请求连接的时候出了问题, 但怎么修改我还不知道哦~

在使用webservice开发时,然后有一个地方要传入String类型&Long类型,然后就是...

我的代码块 Long stateId = null; Call call = constructCall(url); try { call.setTargetEndpointAddress(new java.net.URL(url)); } catch (MalformedURLException e) { e.printStackTrace(); } call.setOperationName("launchFormCollaboration"); call.addParameter("tokenId", XMLType.XSD_STRING, ParameterMode.IN); //登录验证后获取的身份令牌。 call.addParameter("senderLoginName", XMLType.XSD_STRING, ParameterMode.IN); //登陆者名称 call.addParameter("templateCode", XMLType.XSD_STRING, ParameterMode.IN); //模板编号 call.addParameter("subject", XMLType.XSD_STRING, ParameterMode.IN); //标题 call.addParameter("data", XMLType.XSD_STRING, ParameterMode.IN); //内容 call.addParameter("attachments", XMLType.XSD_LONG, ParameterMode.IN); //内容 call.addParameter("param", XMLType.XSD_STRING, ParameterMode.IN); //内容 call.setReturnType(XMLType.XSD_LONG); //设置返回类型 try { stateId = (Long)call.invoke(new Object[]{ticket,loginName, tempCode, title, content,attachments,param}); } catch (RemoteException e) { e.printStackTrace(); } return stateId; ------------分割线------------------------------------------------ AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Client faultSubcode: faultString: Unmarshalling Error: For input string: &quot;&quot; faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}stackTrace:Unmarshalling Error: For input string: &quot;&quot; at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222) at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129) at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:606) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1742) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2900) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:607) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:116) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:489) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:835) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1210) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:568) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:302) at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227) at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696) at org.apache.axis.Message.getSOAPEnvelope(Message.java:435) at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62) at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206) at org.apache.axis.client.Call.invokeEngine(Call.java:2784) at org.apache.axis.client.Call.invoke(Call.java:2767) at org.apache.axis.client.Call.invoke(Call.java:2443) at org.apache.axis.client.Call.invoke(Call.java:2366) at org.apache.axis.client.Call.invoke(Call.java:1812) at cn.easthope.hr.service.impl.TOAServiceImpl.getCurrStateId(TOAServiceImpl.java:389) at cn.easthope.hr.service.impl.TOAServiceImpl.refreshJobDemandState(TOAServiceImpl.java:127) at cn.easthope.hr.controller.ServiceItfTest.test1(ServiceItfTest.java:18) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:219) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:745) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:686) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:827) at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:722) {http://xml.apache.org/axis/}hostname:lin-PC Unmarshalling Error: For input string: "" at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222) at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129) at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:606) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1742) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2900) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:607) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:116) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:489) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:835) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1210) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:568) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:302) at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227) at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696) at org.apache.axis.Message.getSOAPEnvelope(Message.java:435) at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62) at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206) at org.apache.axis.client.Call.invokeEngine(Call.java:2784) at org.apache.axis.client.Call.invoke(Call.java:2767) at org.apache.axis.client.Call.invoke(Call.java:2443) at org.apache.axis.client.Call.invoke(Call.java:2366) at org.apache.axis.client.Call.invoke(Call.java:1812) at cn.easthope.hr.service.impl.TOAServiceImpl.getCurrStateId(TOAServiceImpl.java:389) at cn.easthope.hr.service.impl.TOAServiceImpl.refreshJobDemandState(TOAServiceImpl.java:127) at cn.easthope.hr.controller.ServiceItfTest.test1(ServiceItfTest.java:18) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:219) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:745) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:686) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:827) at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:722)

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

再不跳槽,应届毕业生拿的都比我多了!

跳槽几乎是每个人职业生涯的一部分,很多HR说“三年两跳”已经是一个跳槽频繁与否的阈值了,可为什么市面上有很多程序员不到一年就跳槽呢?他们不担心影响履历吗? PayScale之前发布的**《员工最短任期公司排行榜》中,两家码农大厂Amazon和Google**,以1年和1.1年的员工任期中位数分列第二、第四名。 PayScale:员工最短任期公司排行榜 意外的是,任期中位数极小的这两家公司,薪资...

我以为我学懂了数据结构,直到看了这个导图才发现,我错了

数据结构与算法思维导图

数据库——玩转SQL语句(以MySQL为例)

一、前言 照着大学的SQL server来学

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

华为初面+综合面试(Java技术面)附上面试题

华为面试整体流程大致分为笔试,性格测试,面试,综合面试,回学校等结果。笔试来说,华为的难度较中等,选择题难度和网易腾讯差不多。最后的代码题,相比下来就简单很多,一共3道题目,前2题很容易就AC,题目已经记不太清楚,不过难度确实不大。最后一题最后提交的代码过了75%的样例,一直没有发现剩下的25%可能存在什么坑。 笔试部分太久远,我就不怎么回忆了。直接将面试。 面试 如果说腾讯的面试是挥金如土...

和黑客斗争的 6 天!

互联网公司工作,很难避免不和黑客们打交道,我呆过的两家互联网公司,几乎每月每天每分钟都有黑客在公司网站上扫描。有的是寻找 Sql 注入的缺口,有的是寻找线上服务器可能存在的漏洞,大部分都...

讲一个程序员如何副业月赚三万的真实故事

loonggg读完需要3分钟速读仅需 1 分钟大家好,我是你们的校长。我之前讲过,这年头,只要肯动脑,肯行动,程序员凭借自己的技术,赚钱的方式还是有很多种的。仅仅靠在公司出卖自己的劳动时...

上班一个月,后悔当初着急入职的选择了

最近有个老铁,告诉我说,上班一个月,后悔当初着急入职现在公司了。他之前在美图做手机研发,今年美图那边今年也有一波组织优化调整,他是其中一个,在协商离职后,当时捉急找工作上班,因为有房贷供着,不能没有收入来源。所以匆忙选了一家公司,实际上是一个大型外包公司,主要派遣给其他手机厂商做外包项目。**当时承诺待遇还不错,所以就立马入职去上班了。但是后面入职后,发现薪酬待遇这块并不是HR所说那样,那个HR自...

总结了 150 余个神奇网站,你不来瞅瞅吗?

原博客再更新,可能就没了,之后将持续更新本篇博客。

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

程序员写出这样的代码,能不挨骂吗?

当你换槽填坑时,面对一个新的环境。能够快速熟练,上手实现业务需求是关键。但是,哪些因素会影响你快速上手呢?是原有代码写的不够好?还是注释写的不够好?昨夜...

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

HTTP与HTTPS的区别

面试官问HTTP与HTTPS的区别,我这样回答让他竖起大拇指!

程序员毕业去大公司好还是小公司好?

虽然大公司并不是人人都能进,但我仍建议还未毕业的同学,尽力地通过校招向大公司挤,但凡挤进去,你这一生会容易很多。 大公司哪里好?没能进大公司怎么办?答案都在这里了,记得帮我点赞哦。 目录: 技术氛围 内部晋升与跳槽 啥也没学会,公司倒闭了? 不同的人脉圈,注定会有不同的结果 没能去大厂怎么办? 一、技术氛围 纵观整个程序员技术领域,哪个在行业有所名气的大牛,不是在大厂? 而且众所...

程序员为什么千万不要瞎努力?

本文作者用对比非常鲜明的两个开发团队的故事,讲解了敏捷开发之道 —— 如果你的团队缺乏统一标准的环境,那么即使勤劳努力,不仅会极其耗时而且成果甚微,使用...

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

当HR压你价,说你只值7K,你该怎么回答?

当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...

面试阿里p7,被按在地上摩擦,鬼知道我经历了什么?

面试阿里p7被问到的问题(当时我只知道第一个):@Conditional是做什么的?@Conditional多个条件是什么逻辑关系?条件判断在什么时候执...

终于懂了TCP和UDP协议区别

终于懂了TCP和UDP协议区别

无代码时代来临,程序员如何保住饭碗?

编程语言层出不穷,从最初的机器语言到如今2500种以上的高级语言,程序员们大呼“学到头秃”。程序员一边面临编程语言不断推陈出新,一边面临由于许多代码已存在,程序员编写新应用程序时存在重复“搬砖”的现象。 无代码/低代码编程应运而生。无代码/低代码是一种创建应用的方法,它可以让开发者使用最少的编码知识来快速开发应用程序。开发者通过图形界面中,可视化建模来组装和配置应用程序。这样一来,开发者直...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

《Oracle Java SE编程自学与面试指南》最佳学习路线图(2020最新版)

01、Java入门(Getting Started);02、集成开发环境(IDE);03、项目结构(Eclipse JavaProject);04、类和对象(Classes and Objects);05:词法结构(Lexical Structure);06:数据类型和变量(Data Type and Variables);07:运算符(Operators);08:控制流程语句(Control Flow Statements);

Java岗开发3年,公司临时抽查算法,离职后这几题我记一辈子

前几天我们公司做了一件蠢事,非常非常愚蠢的事情。我原以为从学校出来之后,除了找工作有测试外,不会有任何与考试有关的事儿。 但是,天有不测风云,公司技术总监、人事总监两位大佬突然降临到我们事业线,叫上我老大,给我们组织了一场别开生面的“考试”。 那是一个风和日丽的下午,我翘着二郎腿,左手端着一杯卡布奇诺,右手抓着我的罗技鼠标,滚动着轮轴,穿梭在头条热点之间。 “淡黄的长裙~蓬松的头发...

大牛都会用的IDEA调试技巧!!!

导读 前天面试了一个985高校的实习生,问了他平时用什么开发工具,他想也没想的说IDEA,于是我抛砖引玉的问了一下IDEA的调试用过吧,你说说怎么设置断点...

立即提问
相关内容推荐