Tag: ioexception

无法从传输连接读取数据:现有连接被远程主机强制closures

我有一个服务器应用程序,有时,当客户端尝试连接,我得到以下错误: 注意:“无法从客户端获取stream或login失败”是在catch语句中添加的文本 和它停止的行(sThread:第96行)是: tcpClient = (TcpClient)client; clientStream = tcpClient.GetStream(); sr = new StreamReader(clientStream); sw = new StreamWriter(clientStream); // line 96: a = sr.ReadLine(); 什么可能导致这个问题? 请注意,它不会一直发生

WPF IOException找不到资源

我有一个WPF应用程序。 应用程序在MainWindow.xaml中运行时打开的页面,如App.xaml文件的StartupUri属性中设置的那样。 此页面打开罚款。 但是,如果我尝试使用Show或ShowDialog方法打开任何其他窗口,则会在InitializeComponent方法中出现“无法find资源”Window1.xaml(或任何文件被调用)的IOException。 这发生在我创build的每个窗口。 我在网上search,但所有的解决scheme似乎都说“确保App.xaml的StartupUri属性是正确的”,我的是,因此MainWindow开放。 任何想法发生了什么?

在Java中使用e.printStackTrace()

这可能是一个新手问题,但希望你能帮助我。 :)我有这样的事情: try { //try to do something there } catch (IOException e) { //handle the exception e.printStackTrace(); } 我正在使用NetBeans IDE,出于某种原因,printStackTrace在一条波浪线中被加下划线。 当我按下Alt + Enter,它说Throwable.printStackTrace()应该被删除。 这是什么意思? 任何人都可以提供更多的见解,这可能是什么意思 还是我可以忽略这个? 谢谢!

HttpClient请求抛出IOException

下面的代码抛出一个IOException消息:“指定的registry项不存在”。 HttpClient client = new HttpClient(); Uri uri = new Uri("http://www.google.com"); client.GetAsync(uri); 这只是在Main中的一个控制台应用程序。 它看起来像错误正在由mscorlib.dll!Microsoft.Win32.RegistryKey.Win32Error(int errorCode,stringstr)引发。 我不知道为什么这个错误被抛出或如何开始debugging。 编辑堆栈跟踪: 在Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode,String str) 这只是一条线,没有内在的含义。 调用堆栈是: mscorlib.dll!Microsoft.Win32.RegistryKey.Win32Error(int errorCode, string str) + 0x189 bytes mscorlib.dll!Microsoft.Win32.RegistryKey.GetValueKind(string name) + 0x7f bytes System.dll!System.Net.HybridWebProxyFinder.InitializeFallbackSettings() + 0x9e bytes [Native to Managed Transition] [Managed to Native Transition] System.dll!System.Net.AutoWebProxyScriptEngine.AutoWebProxyScriptEngine(System.Net.WebProxy proxy, bool useRegistry) + 0xd0 bytes System.dll!System.Net.WebProxy.UnsafeUpdateFromRegistry() + […]

Hadoop java.io.IOException:Mkdirs无法创build/某些/path

当我尝试运行我的工作时,我收到以下exception: Exception in thread "main" java.io.IOException: Mkdirs failed to create /some/path at org.apache.hadoop.util.RunJar.ensureDirectory(RunJar.java:106) at org.apache.hadoop.util.RunJar.main(RunJar.java:150) / some / path是hadoop.tmp.dir。 但是,当我在/ some / path上发出dfs -ls cmd时,我可以看到它存在并且数据集文件存在(在执行作业之前被复制)。 此外path在hadoopconfiguration中正确定义。 任何build议将不胜感激。 我正在使用hadoop 0.21。

java.io.IOException:不支持标记/重置

try { //String location = dir1.getCanonicalPath()+"\\app_yamb_test1\\mySound.au"; //displayMessage(location); AudioInputStream audio2 = AudioSystem.getAudioInputStream(getClass().getResourceAsStream("mySound.au")); Clip clip2 = AudioSystem.getClip(); clip2.open(audio2); clip2.start(); } catch (UnsupportedAudioFileException uae) { System.out.println(uae); JOptionPane.showMessageDialog(null, uae.toString()); } catch (IOException ioe) { System.out.println("Couldn't find it"); JOptionPane.showMessageDialog(null, ioe.toString()); } catch (LineUnavailableException lua) { System.out.println(lua); JOptionPane.showMessageDialog(null, lua.toString()); } 当我从netbeans运行应用程序时,此代码正常工作。 声音播放,没有例外。 但是,当我从dist文件夹运行它时,声音不起作用,我得到了java.io.IOException: mark/reset not supported在我的消息对话框中。 我该如何解决这个问题?

为什么我得到“未处理的exceptiontypesIOException”?

我有以下简单的代码: import java.io.*; class IO { public static void main(String[] args) { BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in)); String userInput; while ((userInput = stdIn.readLine()) != null) { System.out.println(userInput); } } } 我收到以下错误消息: ———- 1. ERROR in io.java (at line 10) while ((userInput = stdIn.readLine()) != null) { ^^^^^^^^^^^^^^^^ Unhandled exception type IOException ———- 1 problem […]

IOException:进程无法访问文件的“文件path”,因为它正在被另一个进程使用

我有一些代码,当它执行时,它抛出一个IOException ,说 该进程无法访问文件的“文件名”,因为它正在被另一个进程使用 这是什么意思,我能做些什么呢?