WebApplicationをIISServer上で実行しています。
私は静的クラス作成しました:私はJMSInformationGetterUAT.RunningJMS
を使用していたときに私はエラーを取得するページに...WebApplication上のオブジェクトの.Net永続性
protected void Application_Start(object sender, EventArgs e)
{
JMSInformationGetterUAT.Init();
}
を::
public class JMSInformationGetterUAT
{
private static String userName = "123";
private static String password = "321";
public static String runningJMS = "";
private static Admin adminConnection = null;
public static void Init()
{
try
{
String serverUrl = "tcp://localhost:1232";
adminConnection.CommandTimeout = 500;
adminConnection = new Admin(serverUrl, userName, password);
runningEMS = "JMS1Instance";
}
catch
{
EMSCriticalFailure = true;
}
}
}
とGlobal.asax.csにこれを追加しましたが
JMS側で"Object reference not set to an instance of an object".
(そのアプリケーションが迅速モニタリングするためのものである)私は1ミリ秒接続した後なしを参照 - が、オブジェクトadminConnection
にによって充填メソッドは接続を維持する必要があります。私はこのオブジェクトも参照してくださいそれは空です...
だから、なぜこのオブジェクトは永続的ではありませんか?それは、静的プレフィックスを持ってい...
は、新しい管理者をインスタンス化する前に、adminConnectionのプロパティCommandTimeoutのを設定している
の可能性のある重複した[?とNullReferenceExceptionは何ですか、と私はそれを修正しますか](http://stackoverflow.com/questions/4660142/what-is-a-nullreferenceexception-and -how-do-i-fix-it) –