| CppDev 2004-03-22, 7:37 pm |
| Contents: Event Viewer Log, My problem, Process shape source code,
=========Event Viewer Log follows
Uncaught exception terminated service TeamCenter_BDKMS.test(75464e65-813c-2e6c-eeb1-d587ff02ec3c), instance 219cd27e-dbcc-4b8e-8750-61ce2579fb16
Object reference not set to an instance of an object.
Exception type: NullReferenceException
Source: testTeamCenter-BDKMS
Target Site: Microsoft.XLANGs.Core.StopConditions segment1(Microsoft.XLANGs.Core.StopConditions)
============= message begin
just created my MSDN managed group ID today, but hope someone will answer before the 2-days setup period.
Biztalk 2004 on 2003EN (just switched to Developer edition from Beta 5 days ago.
Not a .net developer. Had a hell of troubles in installation/reinstallation problems (uninstall doesn't really uninstall everything).
Now, in a process shape, I have the following code
============ process shape source code
if (ObjQuerytestBDKMS==null) // hat shows that it is not null
{
ObjQuerytestBDKMS=new QueryBDKMS.SamerTest();
};
if (ObjQuerytestBDKMS!=null && GenericIdeaMessage!=null)
{
ObjQuerytestBDKMS.WriteToFile(GenericIdeaMessage.CompanyId,
GenericIdeaMessage.LastName,
GenericIdeaMessage.FirstName,
GenericIdeaMessage.PhoneNo,
GenericIdeaMessage.EmailAddr,
GenericIdeaMessage.EmployeeNum);
}else
{
ex=new System.IO.FileNotFoundException("file not opened");
throw ex;
}
=========== message continues
which calls a C# class that writes to a text file (originally we are writing multiple records to Oracle but now downgraded with a sample orchestration to investigate the following error which never goes away except by commenting the call to WriteToFile).
QueryBDKMS is a C# component (registered in the GAC) with multiple classes to write to Oracle (or SQL) through ODBC connections. It compiles well.
It is unknown whether the null exception occurs prior or after the call. HAT only worked today (after installation of Dev Edition on Friday). It doesn't allow debugging into process shapes. I tried the "throw exception" to try giving a different exce
ption at several points hoping it would identify which line is causing the problem. I can't log to files (this sample is actually a trial to log to files!). I tried attaching with Visual Studio.net and configured it to watch the exceptions but nothin
g happens. Can this be solved here or do I need to use the phone support (giving that some biztalk developer will do the support!).
========= primary C# sample component follows (the acutal ones are trying
========= to connect to Oracle ODBC, but switched to try this one)
using System;
using System.IO;
namespace QueryBDKMS
{
/// <summary>
/// Summary description for test.
/// </summary>
[Serializable()]
public class SamerTest
{
public SamerTest()
{
}
public void WriteToFile(decimal CompanyId,string LastName,string FirstName,string PhoneNO,string EmailAddr,string EmployeeNO)
{
StreamWriter objSW = File.CreateText(@"c:\SuzLandProjects\March17\test.xml");
if (objSW!=null)
{
objSW.WriteLine("<test>" + CompanyId + "</test>");
if (LastName!=null) objSW.WriteLine("<test>" + LastName + "</test>");
if (FirstName!=null) objSW.WriteLine("<test>" + FirstName+ "</test>");
if (PhoneNO!=null) objSW.WriteLine("<test>" + PhoneNO + "</test>");
if (EmailAddr!=null) objSW.WriteLine("<test>" + EmailAddr + "</test>");
if (EmployeeNO!=null) objSW.WriteLine("<test>" + EmployeeNO + "</test>");
objSW.Close();
}
else
{
System.FieldAccessException ex=new FieldAccessException("file not opened");
throw ex;
}
}
}
}
|