“/”应用程序中的服务器错误。懂得回复!
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了“/”应用程序中的服务器错误。懂得回复!相关的知识,希望对你有一定的参考价值。
在多字节的目标代码页中,没有此 Unicode 字符可以映射到的字符。 (异常来自 HRESULT:0x80070459)
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.ArgumentOutOfRangeException: 在多字节的目标代码页中,没有此 Unicode 字符可以映射到的字符。 (异常来自 HRESULT:0x80070459)
源错误:
执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。
堆栈跟踪:
[ArgumentOutOfRangeException: 在多字节的目标代码页中,没有此 Unicode 字符可以映射到的字符。 (异常来自 HRESULT:0x80070459)]
System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo) +0
System.Web.Util.Misc.ThrowIfFailedHr(Int32 hresult) +11101557
System.Web.Hosting.IIS7WorkerRequest.GetServerVariableInternal(String name) +59
System.Web.Hosting.IIS7WorkerRequest.ReadRequestHeaders() +109
System.Web.Hosting.IIS7WorkerRequest.GetKnownRequestHeader(Int32 index) +163
System.Web.HttpWorkerRequest.HasEntityBody() +25
System.Web.HttpRequest.FillInFormCollection() +59
System.Web.HttpRequest.get_Form() +119
System.Web.HttpRequest.get_Item(String key) +51
public_Default.Page_Load(Object sender, EventArgs e) +1210
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +42
System.Web.UI.Control.OnLoad(EventArgs e) +132
System.Web.UI.Control.LoadRecursive() +66
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428
HttpCookie cookie = new HttpCookie("_lun_", HttpUtility.UrlEncode(userName));
cookie.Expires = DateTime.Now.AddMonths(1);
Response.AppendCookie(cookie);
网上找的,祝你好运~~
我的应用程序中的 send_sms 错误
【中文标题】我的应用程序中的 send_sms 错误【英文标题】:Error in send_sms in my application 【发布时间】:2012-07-07 18:55:02 【问题描述】:我的应用程序有一个页面回复(发送短信)......但我无法发送消息......任何人帮助我的代码......我认为它在我的代码中有错误...... .如何消除该错误...
回复.java
public class Reply extends Activity
EditText replyText;
Button reply;
String replyString,name,phoneNo, message,nickname,body;
SQLiteDatabase messagedb,mydb;
@Override
protected void onCreate(Bundle savedInstanceState)
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.reply);
replyText=(EditText)findViewById(R.id.editTextReply);
reply=(Button)findViewById(R.id.buttonReply);
Bundle c = getIntent().getExtras();
name= c.getString("nick");
message=c.getString("body");
System.out.println("nickname in reply : "+name);
messagedb=this.openOrCreateDatabase("message",0, null);
messagedb.execSQL(
"CREATE TABLE IF NOT EXISTS tab2( nickname varchar,sender INT(13),body varchar)");
Cursor cur1=messagedb.rawQuery("select * from tab2 where nickname='"+name+"'", null);
while(cur1.moveToNext())
phoneNo=cur1.getString(cur1.getColumnIndex("sender"));
System.out.println("Number in cur1 : "+phoneNo);
TextView tv = (TextView)findViewById(R.id.textView2);
tv.setText(nickname);
reply.setOnClickListener(new OnClickListener()
public void onClick(View v)
// TODO Auto-generated method stub
message=replyText.getText().toString();
sendSMS(phoneNo, message);
);
private void sendSMS(String phoneNumber, String message)
PendingIntent pi = PendingIntent.getActivity(this, 0,
new Intent(this, MessageViewPage.class), 0);
SmsManager sms = SmsManager.getDefault();
sms.sendTextMessage(phoneNumber, null, message, pi, null);
回复.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_
android:layout_
android:orientation="vertical" >
<EditText
android:id="@+id/editTextReply"
android:layout_
android:layout_
android:background="@drawable/reply_edit"
android:paddingLeft="21dp"
android:paddingRight="14dp"
android:paddingTop="37dp"
android:paddingBottom="37dp"
android:layout_alignParentTop="true"
android:layout_marginTop="50dp">
</EditText>
<Button
android:id="@+id/buttonReply"
android:layout_
android:layout_
android:layout_alignParentBottom="true"
android:layout_marginBottom="50dp"
android:layout_centerHorizontal="true"
android:background="@drawable/white_bn"
android:layout_marginTop="35dp"
android:text="Reply" />
<TextView
android:id="@+id/textView1"
android:layout_
android:layout_
android:layout_alignParentLeft="true"
android:layout_marginLeft="10dp"
android:layout_alignParentTop="true"
android:layout_marginTop="14dp"
android:text="To : "
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="@+id/textView2"
android:layout_
android:layout_
android:layout_alignLeft="@+id/textView1"
android:layout_alignParentTop="true"
android:layout_marginTop="17dp"
android:layout_marginLeft="50dp"
android:textAppearance="?android:attr/textAppearanceMedium" />
</RelativeLayout>
我也使用权限
<uses-permission android:name="android.permission.SEND_SMS"/>
07-06 22:42:35.515: W/dalvikvm(834): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
07-06 22:42:35.554: E/AndroidRuntime(834): FATAL EXCEPTION: main
07-06 22:42:35.554: E/AndroidRuntime(834): java.lang.RuntimeException: Unable to start activity ComponentInfocom.dpn.pack/com.dpn.pack.MessageViewPage: java.lang.NullPointerException
07-06 22:42:35.554: E/AndroidRuntime(834): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
07-06 22:42:35.554: E/AndroidRuntime(834): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
07-06 22:42:35.554: E/AndroidRuntime(834): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
07-06 22:42:35.554: E/AndroidRuntime(834): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
07-06 22:42:35.554: E/AndroidRuntime(834): at android.os.Handler.dispatchMessage(Handler.java:99)
07-06 22:42:35.554: E/AndroidRuntime(834): at android.os.Looper.loop(Looper.java:123)
07-06 22:42:35.554: E/AndroidRuntime(834): at android.app.ActivityThread.main(ActivityThread.java:4627)
07-06 22:42:35.554: E/AndroidRuntime(834): at java.lang.reflect.Method.invokeNative(Native Method)
07-06 22:42:35.554: E/AndroidRuntime(834): at java.lang.reflect.Method.invoke(Method.java:521)
07-06 22:42:35.554: E/AndroidRuntime(834): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
07-06 22:42:35.554: E/AndroidRuntime(834): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
07-06 22:42:35.554: E/AndroidRuntime(834): at dalvik.system.NativeStart.main(Native Method)
07-06 22:42:35.554: E/AndroidRuntime(834): Caused by: java.lang.NullPointerException
07-06 22:42:35.554: E/AndroidRuntime(834): at com.dpn.pack.MessageViewPage.onCreate(MessageViewPage.java:30)
07-06 22:42:35.554: E/AndroidRuntime(834): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
07-06 22:42:35.554: E/AndroidRuntime(834): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
07-06 22:42:35.554: E/AndroidRuntime(834): ... 11 more
【问题讨论】:
请提供日志猫....... 它说应用程序强制关闭但是...应用程序运行正常?怎么会这样? 【参考方案1】:修复 MessageViewPage.java 第 30 行中的 NullPointerException
我认为您的问题早在您到达 sendSms() 行之前就出现了
【讨论】:
以上是关于“/”应用程序中的服务器错误。懂得回复!的主要内容,如果未能解决你的问题,请参考以下文章