WCF分布式开发常见错误(12):The server was unable to process the request,服务无法处理请求...

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/weixin_34364071/article/details/85208556
    进行WCF编程过程中会遇到这样的错误:服务无法处理的请求由于内部错误。    具体信息如下:The server was unable to process the request due to an internal error.  For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs.
错误截图:
    由于内部错误,无法处理请求。
解决办法:
在服务行为里配置错误属性即可:
添加如下代码到服务类:
[ServiceBehavior(IncludeExceptionDetailInFaults = true)]
展开阅读全文

Unable to process Jar entry

01-27

今天来公司代码更新后就抛这个错误rn[code=java]rn严重: Unable to process Jar entry [org/apache/poi/hssf/record/aggregates/PageSettingsBlock$PLSAggregate.class] from Jar [jar:file:/F:/Users/Administrator/Documents/workspace-sts-2.5.2.RELEASE/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/cloudlib/WEB-INF/lib/poi-3.8.jar!/] for annotationsrnjava.io.UTFDataFormatException: malformed input around byte 3rn at java.io.DataInputStream.readUTF(DataInputStream.java:617)rn at java.io.DataInputStream.readUTF(DataInputStream.java:547)rn at org.apache.tomcat.util.bcel.classfile.ConstantUtf8.getInstance(ConstantUtf8.java:73)rn at org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:128)rn at org.apache.tomcat.util.bcel.classfile.ConstantPool.(ConstantPool.java:59)rn at org.apache.tomcat.util.bcel.classfile.ClassParser.readConstantPool(ClassParser.java:208)rn at org.apache.tomcat.util.bcel.classfile.ClassParser.parse(ClassParser.java:118)rn at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2058)rn at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1934)rn at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1900)rn at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1885)rn at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1317)rn at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:876)rn at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:374)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)rn at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)rn at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5378)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)rn at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)rn at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)rn at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)rn at java.util.concurrent.FutureTask.run(FutureTask.java:138)rn at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)rn at java.lang.Thread.run(Thread.java:662)rn2015-1-27 13:29:01 org.apache.catalina.startup.ContextConfig processAnnotationsJarrn严重: Unable to process Jar entry [org/apache/poi/hssf/record/aggregates/PageSettingsBlock.class] from Jar [jar:file:/F:/Users/Administrator/Documents/workspace-sts-2.5.2.RELEASE/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/cloudlib/WEB-INF/lib/poi-3.8.jar!/] for annotationsrnjava.util.zip.ZipException: invalid LOC header (bad signature)rn at java.util.zip.ZipFile.read(Native Method)rn at java.util.zip.ZipFile.access$1200(ZipFile.java:31)rn at java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:459)rn at java.util.zip.ZipFile$1.fill(ZipFile.java:242)rn at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:141)rn at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)rn at java.io.BufferedInputStream.read(BufferedInputStream.java:237)rn at java.io.DataInputStream.readInt(DataInputStream.java:370)rn at org.apache.tomcat.util.bcel.classfile.ClassParser.readID(ClassParser.java:236)rn at org.apache.tomcat.util.bcel.classfile.ClassParser.parse(ClassParser.java:113)rn at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2058)rn at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1934)rn at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1900)rn at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1885)rn at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1317)rn at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:876)rn at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:374)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)rn at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)rn at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5378)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)rn at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)rn at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)rn at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)rn at java.util.concurrent.FutureTask.run(FutureTask.java:138)rn at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)rn at java.lang.Thread.run(Thread.java:662)rn2015-1-27 13:29:03 org.apache.catalina.startup.TaglibUriRule bodyrn[/code]rnrn是什么原因 论坛

服务无法处理请求

12-25

System.Web.Services.Protocols.SoapException: 服务器无法处理请求。 ---> System.Data.SqlClient.SqlException: 参数化查询 '(@UserName varchar(256))SELECT [Password] FROM [Broker].[dbo].[U' 需要参数 @UserName,但未提供该参数。 rn 在 System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) rn 在 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) rn 在 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) rn 在 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) rn 在 System.Data.SqlClient.SqlDataReader.ConsumeMetaData() rn 在 System.Data.SqlClient.SqlDataReader.get_MetaData() rn 在 System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) rn 在 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) rn 在 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) rn 在 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) rn 在 System.Data.SqlClient.SqlCommand.ExecuteScalar() rn 在 OSTS.Utility.DBHelper.ExecuteScalar(SqlConnection connection, CommandType cmdType, String cmdText, SqlParameter[] commandParameters) 位置 D:\Documents\IGS\Projects\股票交易系统_.NET\Source Code\券商端\Broker\OSTS.Utility\DBHelper.cs:行号 130 rn 在 OSTS.Broker.SQLServerDAL.User.Login(String userName, String password) 位置 E:\股票交易\券商端\Broker\OSTS.Broker\SQLServerDAL\User.cs:行号 251 rn 在 OSTS.Broker.BLL.User.Login(String userName, String password) 位置 E:\股票交易\券商端\Broker\OSTS.Broker\BLL\User.cs:行号 107 rn 在 BrokerAPI.Login(String userName, String password) 位置 e:\股票交易\券商端\Broker\WebAPI\App_Code\BrokerAPI.cs:行号 222 rn --- 内部异常堆栈跟踪的结尾 --- rnrnrnrnrnWebService 端的方法:rn[code=C#]rnprivate readonly string m_brokerDBConnStr = @"Data Source=LD-2BD4667CA5B2;Initial Catalog=Broker;Persist Security Info=True;User ID=soft;Password=soft;";rnrn private readonly string SQL_GET_PASSWORD_BY_USERNAME = "SELECT [Password] FROM [Broker].[dbo].[User] WHERE [UserName] = @UserName";rnrnrn /// rn /// User Loginrn /// rn /// by Calvin 20090715rn /// Usernamern /// Passwordrn /// Login resultrn public bool Login(string userName, string password)rn rn string Password = "";rnrn SqlParameter[] param = new SqlParameter[1];rnrn #region 挷定参数rn param[0] = new SqlParameter("@UserName", SqlDbType.VarChar, 256);rn param[0].Value = userName;rn #endregionrnrn using (SqlConnection conn = new SqlConnection(this.m_brokerDBConnStr))rn rn tryrn conn.Open();rn Password = Convert.ToString(DBHelper.ExecuteScalar(conn, CommandType.Text, SQL_GET_PASSWORD_BY_USERNAME, param));rn rn catchrn rn throw;rn rn finallyrn rn conn.Close();rn rn rnrn if (Password == password)rn return true;rnrn return false;rn rnrnrn[/code] 论坛

没有更多推荐了,返回首页