标签: ioexception

IOException:进程无法访问文件"文件路径",因为它正由另一个进程使用

我有一些代码,当它执行时,它抛出一个IOException,说

该进程无法访问文件'filename',因为它正由另一个进程使用

这是什么意思,我能做些什么呢?

.net c# language-agnostic ioexception

152
推荐指数
5
解决办法
42万
查看次数

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

我有一个服务器应用程序,有时,当客户端尝试连接时,我收到以下错误:

在此输入图像描述

注意:"无法从客户端获取流或登录失败"是我在catch语句中添加的文本

它停止的行(sThread:第96行)是:

tcpClient = (TcpClient)client;
clientStream = tcpClient.GetStream();
sr = new StreamReader(clientStream);
sw = new StreamWriter(clientStream);

// line 96:                 
a = sr.ReadLine();
Run Code Online (Sandbox Code Playgroud)

可能是什么导致了这个问题?请注意,它不会一直发生

.net c# ioexception

85
推荐指数
9
解决办法
30万
查看次数

HttpClient请求抛出IOException

以下代码抛出IOException并显示以下消息:"指定的注册表项不存在."

HttpClient client = new HttpClient();

Uri uri = new Uri("http://www.google.com");

client.GetAsync(uri);
Run Code Online (Sandbox Code Playgroud)

这只是在Main的控制台应用程序中.看起来mscorlib.dll抛出了错误!Microsoft.Win32.RegistryKey.Win32Error(int errorCode,string str).我不知道为什么抛出这个错误或者如何开始调试它.

编辑堆栈跟踪:

在Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode,String str)

它只有1行,没有内在的例外等.

调用堆栈是:

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() + 0x2c bytes  
System.dll!System.Net.Configuration.DefaultProxySectionInternal.DefaultProxySectionInternal(System.Net.Configuration.DefaultProxySection section) + 0x1d8 bytes 
System.dll!System.Net.Configuration.DefaultProxySectionInternal.GetSection() + 0xec bytes   
System.dll!System.Net.WebRequest.InternalDefaultWebProxy.get() + 0xcc bytes 
System.dll!System.Net.HttpWebRequest.HttpWebRequest(System.Uri uri, System.Net.ServicePoint servicePoint) + 0xdf bytes  
System.dll!System.Net.HttpWebRequest.HttpWebRequest(System.Uri uri, bool returnResponseOnFailureStatusCode, …
Run Code Online (Sandbox Code Playgroud)

.net c# httpclient ioexception

70
推荐指数
3
解决办法
2万
查看次数

java.io.IOException:不支持mark/reset

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());
}
Run Code Online (Sandbox Code Playgroud)

当我从netbeans运行应用程序时,此代码工作正常.声音播放,没有例外.但是,当我从dist文件夹运行它时,声音不会播放,我java.io.IOException: mark/reset not supported在消息对话框中显示.

我怎样才能解决这个问题?

java audio ioexception

64
推荐指数
3
解决办法
5万
查看次数

如何检查IOException是否足够 - 磁盘空间异常类型?

如何检查IOException"磁盘空间不足"异常类型?

目前我检查消息是否与"磁盘空间不足"相匹配,但我知道如果操作系统语言不是英语,这将不起作用.

.net c# diskspace exception-handling ioexception

63
推荐指数
4
解决办法
2万
查看次数

在Java中使用e.printStackTrace()

这可能是一个新手问题,但希望你能帮助我.:)我有这样的事情:

try
{ 
//try to do something there
}
catch (IOException e)
{
//handle the exception 
e.printStackTrace();
}
Run Code Online (Sandbox Code Playgroud)

我正在使用NetBeans IDE,出于某种原因,printStackTrace在一个波浪线中加下划线.当我按Alt + Enter时,它表示应删除Throwable.printStackTrace().这是什么意思?任何人都可以提供更多见解,这可能意味着什么?或者我可以忽略这个吗?

谢谢!

java ioexception printstacktrace

61
推荐指数
4
解决办法
8万
查看次数

WPF IOException无法找到资源

我有一个WPF应用程序.

应用程序在MainWindow.xaml中运行时打开的页面,在App.xaml文件的StartupUri属性中设置.这个页面打开正常.

但是,如果我尝试使用Show或ShowDialog方法来打开任何其他窗口我在InitializeComponent方法获得一个IOException说"无法找到资源'Window1.xaml’"(或任何文件被调用).我创建的每个窗口都会发生这种情况.我在网上搜索但是所有的解决方案似乎都说"确保App.xaml的StartupUri属性是正确的"而且我的是,因此MainWindow打开了.

知道发生了什么事吗?

c# wpf ioexception

50
推荐指数
4
解决办法
5万
查看次数

什么时候抛出"java.io.IOException:Connection reset by peer"?

ERROR GServerHandler  - java.io.IOException: Connection reset by peer
java.io.IOException: Connection reset by peer
        at sun.nio.ch.FileDispatcher.read0(Native Method)
        at sun.nio.ch.SocketDispatcher.read(Unknown Source)
        at sun.nio.ch.IOUtil.readIntoNativeBuffer(Unknown Source)
        at sun.nio.ch.IOUtil.read(Unknown Source)
        at sun.nio.ch.SocketChannelImpl.read(Unknown Source)
        at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:323)
        at org.jboss.netty.channel.socket.nio.NioWorker.processSelectedKeys(NioWorker.java:282)
        at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:202)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Run Code Online (Sandbox Code Playgroud)

该日志来自使用netty实现的游戏服务器.什么可以导致这个例外?

java tcp ioexception netty

49
推荐指数
2
解决办法
12万
查看次数

Hadoop java.io.IOException:Mkdirs无法创建/ some/path

当我尝试运行我的Job时,我收到以下异常:

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)
Run Code Online (Sandbox Code Playgroud)

/ some/path的位置是hadoop.tmp.dir.但是,当我在/ some/path上发出dfs -ls cmd时,我可以看到它存在并且数据集文件存在(在午餐之前复制了该文件).此外,路径在hadoop配置中正确定义.任何建议将不胜感激.我正在使用hadoop 0.21.

hadoop microsoft-distributed-file-system ioexception

41
推荐指数
5
解决办法
5万
查看次数

System.IO.Exception错误:"无法对打开了用户映射部分的文件执行请求的操作."

在写入XML文件时,我收到了一个非常奇怪的IOException:

System.IO.IOException: The requested operation cannot be performed on a file with a user-mapped section open.

   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at System.Xml.XmlTextWriter..ctor(String filename, Encoding encoding)
   at System.Xml.XmlDocument.Save(String filename)
Run Code Online (Sandbox Code Playgroud)

当我调用XmlDocument的Save(字符串)函数时发生错误.

发生了什么事吗?

c# xml ioexception

37
推荐指数
4
解决办法
6万
查看次数