这似乎是一个新手问题,但我一直在挖掘和搜索几个小时,并且可以使用一些帮助。
我的云服务中有一个Worker角色,它有一个看起来像这样的依赖树(nuget用于管理微软程序集引用,对我自己的程序集的引用是项目引用):
public class SimpleFileReader {
public static void main(String[] args){
readFromFile();
}
public static void readFromFile(){
try {
int x = 0;
File file = new File("read.txt");
Scanner sc = new Scanner(file).useDelimiter(";|\\n");
sc.useLocale(Locale.FRENCH);
while (sc.hasNext()){
System.out.println(sc.nextInt()+" "+sc.next()+" "+sc.nextDouble());
x++;
}
System.out.println("lines: "+x);
} catch (Exception e) {
e.printStackTrace();
}
}
}
我还有一个单元测试项目,MyBigDataLibrary.Test具有相同的参考结构。
单元测试(更多是集成测试,真的)和worker角色都执行以下操作:使用MyStorageLibrary测试一些blob以查看是否需要执行某些操作,然后使用MyBigDataLibrary运行Hive作业,最终在JobSubmissionClient上调用GetJobOutput()(我假设它使用底层存储库来访问blob存储中的输出文件)。
我的单元测试工作正常,返回一个流。
当我在本地计算模拟器中运行我的工作者角色时,Hive作业会运行,但是当它完成时它会尝试返回我得到的结果流:
MyWorkerRole
Depends on MyStorageLibrary
Depends on Microsoft.WindowsAzure.Storage v4.3.0.0
Depends on MyBigDataLibrary
Depends on Microsoft.Hadoop.Client v1.5.8.0
Depends on Microsoft.WindowsAzure.Storage v3.0.3.0 or better
Depends on Microsoft.WindowsAzure.Storage v4.3.0.0 (my code in this library doesn't use it directly - this is pulled in by nuget when adding the reference to the hadoop client)
MyWorkerRole.dll.config中出现以下内容:
System.IO.FileLoadException: Could not load file or assembly 'Microsoft.WindowsAzure.Storage, Version=3.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'Microsoft.WindowsAzure.Storage, Version=3.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
Server stack trace:
at Microsoft.Hadoop.Client.Storage.WabStorageAbstraction.Read(Uri path)
at Microsoft.WindowsAzure.Management.HDInsight.JobSubmission.HDInsightHadoopClient.<GetJobResultFile>d__3d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Microsoft.WindowsAzure.Management.HDInsight.JobSubmission.HDInsightHadoopClient.<GetJobOutputAsync>d__22.MoveNext()
Exception rethrown at [0]:
at Microsoft.WindowsAzure.Management.HDInsight.Framework.Core.Library.TaskExtensions.WaitForResult[T](Task`1 task, TimeSpan timeout)
at Microsoft.WindowsAzure.Management.HDInsight.Framework.Core.Library.TaskExtensions.WaitForResult[T](Task`1 task)
at Microsoft.WindowsAzure.Management.HDInsight.JobSubmission.HDInsightHadoopClient.GetJobOutput(String jobId)
at MyBigDataLibrary.HDInsight.Hadoop.HiveCommand.ExecuteGetStream() in c:\Development\C#\RetailDataImport.CloudServices\trunk\PremierConcepts.Arch.BigData\HDInsight\Hadoop\HiveCommand.cs:line 61
我知道单元测试和辅助角色都成功加载了Microsoft.WindowsAzure.Storage 4.3.0.0,因为两者都在尝试运行Hive作业之前成功访问了存储中的blob,并且我使用了Process Explorer来查看装载的装配。
我正在部署到测试Cloud Service实例,以确定它是否在Azure中具有相同的问题,并且可以报告该结果,但这需要一些时间,我需要解决模拟器中的问题无论如何。
提前感谢您的任何帮助。