请帮我解决在尝试在Tomcat服务器上部署WAR文件时获得的以下异常.
07:46:50,076 WARN HostConfig:606 - Exception while expanding web application archive chapal.war
07:47:00,123 INFO StandardHostDeployer:435 - Processing Context configuration file URL file:/home/eqdev/eqgen117/chrad/chapal-puru/tomcat/conf/Catalina/local
host/chapal.xml
07:47:00,158 ERROR Digester:1275 - Begin event threw exception
java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:203)
at java.util.jar.JarFile.<init>(JarFile.java:132)
at java.util.jar.JarFile.<init>(JarFile.java:70)
at sun.net.www.protocol.jar.URLJarFile.<init>(URLJarFile.java:56)
at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:41)
at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:68)
at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:102)
at sun.net.www.protocol.jar.JarURLConnection.getJarFile(JarURLConnection.java:69)
at org.apache.catalina.startup.ExpandWar.expand(ExpandWar.java:155)
at org.apache.catalina.startup.SetDocBaseRule.begin(SetDocBaseRule.java:138)
at org.apache.commons.digester.Digester.startElement(Digester.java:1273)
at org.apache.catalina.util.CatalinaDigester.startElement(CatalinaDigester.java:65)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at …
Run Code Online (Sandbox Code Playgroud) 我有以下代码在AngularJS 2中进行轮询GET请求:
makeHtpGetRequest(){
let url ="http://bento/supervisor/info";
return Observable.interval(2000)
.map(res => res.json()) //Error here
.switchMap(() => this.http.get(url));
/*
This portion works well
return this.http.get(url)
.map(res =>res.json());*/
}
Run Code Online (Sandbox Code Playgroud)
TypeScript给我一个错误,以JSON格式制作响应(检查代码中的注释.
TypeError: res.json is not a function
Run Code Online (Sandbox Code Playgroud)
令人惊讶的是,它工作了一段时间,我不确定我是否改变了其他任何东西,但它停止了工作.
代码中的注释部分非常有效.
我想在Entity Framework 6.1.3中优化我的查询,所以我需要知道查询是否已经是CompiledQueries还是我需要手动编写它们作为CompiledQuery?
提前致谢.
我编写了一个程序,从Crystal Report生成PDF,然后将这些PDF通过电子邮件发送给某人.该程序在我的开发机器上运行良好,但是当我将bin\Release目录复制到Windows 2000 Server(我想运行它的机器)时,它开始运行然后生成此错误和堆栈跟踪:
The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception.
at CrystalDecisions.CrystalReports.Engine.ReportDocument..ctor()
at DailyJobCostSummaryEmail.Program.crptToPDF(String reportFile, String jobNum, String outputLocation) in M:\Projects\DailyJobCostSummaryEmail\DailyJobCostSummaryEmail\Program.cs:line 79
at DailyJobCostSummaryEmail.Program.Main(String[] args) in M:\Projects\DailyJobCostSummaryEmail\DailyJobCostSummaryEmail\Program.cs:line 46
Run Code Online (Sandbox Code Playgroud)
除了从可视工作室运行外,其他任何地方都会出现错误.
.Net 2.0安装在那台机器上,我已经安装了CRRedist2005_x86.msi而没有任何效果.我甚至得到了"向Microsoft发送错误报告"对话框,即使我正在使用try/catch将异常打印到文件中.即使执行了catch块,我的程序也无法正常关闭.
static void Main(string[] args)
{
try
{
String dir = @"JobCostReports";
DataTable jobs = new DataTable();
using (SqlConnection conn = new SqlConnection(connString))
{
String sql = "JC_GetJobsClosedYesterday";
SqlDataAdapter da = new SqlDataAdapter(sql, conn);
da.Fill(jobs);
}
List<String> files = new List<String>();
foreach (DataRow row in jobs.Rows)
{
files.Add(crptToPDF(@"JobCost.rpt", …
Run Code Online (Sandbox Code Playgroud) 假设有10位开发人员用了6个月的时间来开发一些应用程序.作为项目经理,我应该在我的测试计划中花多少时间?
6个月的努力包括单元测试.我具体涉及功能测试和用户验收测试.
开发时间和测试时间之间是否有任何比例或关系?
我最近加入了一家使用类型化数据集作为'Dto'的公司.我认为它们真的很垃圾,并希望将它改成更现代和用户友好的东西.所以,我正在尝试更新代码,以便数据层更通用,即使用接口等,另一个人不知道Dto是什么,我们对如何完成它有轻微的分歧.
如果不试图让人们思考我的思维方式,我想向你们提供关于Dto可以存在的层次的公正答案.DAL,BL和Presentation或仅在这些图层中设置一个小子集.
此外,是否应该或不应该在DAL中存在IList对象.
谢谢.
从在Visual Studio 2010和.NET 4.0中构建我们的产品升级到Visual Studio 2015和.NET 4.5.2后,我们发现在客户机器上运行产品时出现问题.
我们看到的错误是System.MissingMethodException
在启动应用程序时抛出,从查看此处的帖子指向计算机上安装的.NET版本不正确.现在客户机器安装了.NET 4.5.2,因为这是在我们的产品安装过程中安装的.
我们目前解决问题的方法是在客户机器上安装.NET 4.6.
我有一个理论上我理想地想要确认(最好是垃圾并用更可行的东西代替):
我相信因为.NET 4.6安装在机器上它覆盖了.NET 4.5.2.我不知道为什么会发生这种情况,但我看到一些模糊相似的东西,在安装了.NET 4.5的机器上运行的.NET 4.0应用程序表现了.NET 4.5应用程序在这里的表现(如果是我很确定它不应该).我希望有人能够指出我失踪的东西.
我希望我的理论是错的.
附加信息
当应用程序崩溃时,我设法附加了一个调试器,错误是:
找不到方法:'!! 0 [] System.Array.Empty()'.
我的代码中没有使用Array.Empty()的东西.
堆栈跟踪:
at MyApp.DisplayExceptionInfo(Exception ex)
,位于E:\ Build\MyApp\App.xaml.cs中的MyApp.Main(String [] args):第82行
DisplayExceptionInfo
只是尝试显示一个Exception,这让我相信早先抛出异常.
Main
检查是否有另一个实例正在通过某个Interop运行(我也尝试删除但它没有解决崩溃),然后创建我的App类并运行它.
更新
对不起我不相信我在问题中提供了足够的细节来帮助解决问题的根源.事实证明,TeamCity使用MSBuild构建Visual Studio解决方案,并且在构建过程中会出现以下警告(令人烦恼的是相当好地隐藏在日志中):
[GetReferenceAssemblyPaths] C:\ Program Files(x86)\ MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1097,5):警告MSB3644:框架".NETFramework,Version = v4.5.2"的引用程序集是未找到.要解决此问题,请为此框架版本安装SDK或Targeting Pack,或者将应用程序重新定位到已安装SDK或Targeting Pack的框架版本.请注意,程序集将从全局程序集缓存(GAC)中解析,并将用于代替引用程序集.因此,您的程序集可能无法正确定位到您想要的框架.
我可以确认我确实安装了.NET 4.5.2多目标包,但我会继续调查
请帮助我,_scaffoldKey 和 _scaffoldKey.currentState 在修复代码时引发主要问题。
我有以下代码:
void customSnackBar(GlobalKey<ScaffoldState> _scaffoldKey, String msg,
{double height = 30, Color backgroundColor = Colors.black}) {
if (_scaffoldKey == null || _scaffoldKey.currentState == null) {
return;
}
_scaffoldKey.currentState.hideCurrentSnackBar();
final snackBar = SnackBar(
backgroundColor: backgroundColor,
content: Text(
msg,
style: TextStyle(
color: Colors.white,
),
),
);
_scaffoldKey.currentState.showSnackBar(snackBar);
}
Run Code Online (Sandbox Code Playgroud)
我已经阅读了ScaffoldMessenger
文档,但无法理解如何转换上面的代码来使用ScaffoldMessenger
?