TypeInitializationException error

  • Thread starter Thread starter Kodiak
  • Start date Start date
K

Kodiak

I am getting a System.TypeInitializationException on a static class
and I cannot figure out why the error is occuring. The inner
exception says the likely cause of the error is because the FMS lib
folder is not in the system path. This is not true because the path
being referenced is in the Environment Path variable. I run the same
code in Visual Studio 2008 and the code works perfect, but when I
deploy the code to IIS 6 running on Windows 2003 SP2 server I get the
error. I cannot figure out what is going on when I VS it works, but
fails in IIS 6. Any help or suggestions is really appreciated!!!
 
I am getting a System.TypeInitializationException on a static class
and I cannot figure out why the error is occuring.  The inner
exception says the likely cause of the error is because the FMS lib
folder is not in the system path.  This is not true because the path
being referenced is in the Environment Path variable.  I run the same
code in Visual Studio 2008 and the code works perfect, but when I
deploy the code to IIS 6 running on Windows 2003 SP2 server I get the
error.  I cannot figure out what is going on when I VS it works, but
fails in IIS 6.  Any help or suggestions is really appreciated!!!

You need to post the offending code, a dump of the exception would
also be nice, see if it tells you the line #
 
Here is the exception below!

[Exception: System.TypeInitializationException: The type initializer
for 'L3.EDG.Websites.TOLD.BusinessLayer.DAO.FileDAO' threw an
exception. ---> System.SystemException:
Teamcenter.Schemas.Soa._2006_03.Exceptions.InternalServerException:
Exception has been thrown by the target of an invocation. --->
System.Reflection.TargetInvocationException: Exception has been thrown
by the target of an invocation. --->
Teamcenter.Soa.Internal.Client.FMSException: The following error
occured while initializing the FMS client:
Init
The most likely cause of this error is the FMS lib folder is not in
the system path. --->
Teamcenter.FMS.FCCProxy.ClientCache.FCCException: Init
at Teamcenter.FMS.FCCProxy.ClientCache.NetFileCacheProxy..ctor()
at Teamcenter.Soa.Internal.Client.FCCWrapper.Init()
--- End of inner exception stack trace ---
at Teamcenter.Soa.Internal.Client.FCCWrapper.Init()
at Teamcenter.Soa.Internal.Client.FCCWrapper..ctor()
--- End of inner exception stack trace ---
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type,
Boolean publicOnly, Boolean noCheck, Boolean& canBeCached,
RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly,
Boolean fillCache)
at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly,
Boolean skipVisibilityChecks, Boolean fillCache)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr,
Binder binder, Object[] args, CultureInfo culture, Object[]
activationAttributes)
at System.Activator.CreateInstance(Type type, BindingFlags
bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object
[] activationAttributes)
at System.Reflection.Assembly.CreateInstance(String typeName,
Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[]
args, CultureInfo culture, Object[] activationAttributes)
at Teamcenter.Soa.Internal.Client.FMSLoader.GetFCCInstance()
at Teamcenter.Soa.Client.FileManagementUtility..ctor(Connection
connection)
--- End of inner exception stack trace ---
at
L3.EDG.Websites.TOLD.BusinessLayer.CustomExceptionalHandler.HandleException
(InternalServerException ise) in D:\EDG\Branches\TCE8Upgrade\Web
\CS3.5\TOLD\BusinessLayer\CustomExceptionalHandler.cs:line 42
at Teamcenter.Soa.Client.FileManagementUtility..ctor(Connection
connection)
at L3.EDG.Websites.TOLD.BusinessLayer.DAO.FileDAO..cctor() in D:\EDG
\Branches\TCE8Upgrade\Web\CS3.5\TOLD\BusinessLayer\DAO\FileDAO.cs:line
12
--- End of inner exception stack trace ---
at L3.EDG.Websites.TOLD.BusinessLayer.DAO.FileDAO.getFileInfo
(ImanFile iFile)
at L3.EDG.Websites.TOLD.Download.Page_Load(Object sender, EventArgs
e) in D:\EDG\Branches\TCE8Upgrade\Web\CS3.5\TOLD\Download.aspx.cs:line
44]
L3.EDG.Websites.TOLD.Download.Page_Load(Object sender, EventArgs e)
in D:\EDG\Branches\TCE8Upgrade\Web\CS3.5\TOLD\Download.aspx.cs:99
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp,
Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object
sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+627


The code errors on line 44 which is this code FileInfo f =
FileDAO.getFileInfo(iFile);
 
Environment variables such as PATH are user-specific. Just because it is in
your PATH does not mean it is in the IIS_COMPUTERNAME (or IWAM_COMPUTERNAME)
user's PATH which is active for deployed website apps.

Kodiak said:
Here is the exception below!

[Exception: System.TypeInitializationException: The type initializer
for 'L3.EDG.Websites.TOLD.BusinessLayer.DAO.FileDAO' threw an
exception. ---> System.SystemException:
Teamcenter.Schemas.Soa._2006_03.Exceptions.InternalServerException:
Exception has been thrown by the target of an invocation. --->
System.Reflection.TargetInvocationException: Exception has been thrown
by the target of an invocation. --->
Teamcenter.Soa.Internal.Client.FMSException: The following error
occured while initializing the FMS client:
Init
The most likely cause of this error is the FMS lib folder is not in
the system path. --->
Teamcenter.FMS.FCCProxy.ClientCache.FCCException: Init
at Teamcenter.FMS.FCCProxy.ClientCache.NetFileCacheProxy..ctor()
at Teamcenter.Soa.Internal.Client.FCCWrapper.Init()
--- End of inner exception stack trace ---
at Teamcenter.Soa.Internal.Client.FCCWrapper.Init()
at Teamcenter.Soa.Internal.Client.FCCWrapper..ctor()
--- End of inner exception stack trace ---
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type,
Boolean publicOnly, Boolean noCheck, Boolean& canBeCached,
RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly,
Boolean fillCache)
at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly,
Boolean skipVisibilityChecks, Boolean fillCache)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr,
Binder binder, Object[] args, CultureInfo culture, Object[]
activationAttributes)
at System.Activator.CreateInstance(Type type, BindingFlags
bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object
[] activationAttributes)
at System.Reflection.Assembly.CreateInstance(String typeName,
Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[]
args, CultureInfo culture, Object[] activationAttributes)
at Teamcenter.Soa.Internal.Client.FMSLoader.GetFCCInstance()
at Teamcenter.Soa.Client.FileManagementUtility..ctor(Connection
connection)
--- End of inner exception stack trace ---
at
L3.EDG.Websites.TOLD.BusinessLayer.CustomExceptionalHandler.HandleException
(InternalServerException ise) in D:\EDG\Branches\TCE8Upgrade\Web
\CS3.5\TOLD\BusinessLayer\CustomExceptionalHandler.cs:line 42
at Teamcenter.Soa.Client.FileManagementUtility..ctor(Connection
connection)
at L3.EDG.Websites.TOLD.BusinessLayer.DAO.FileDAO..cctor() in D:\EDG
\Branches\TCE8Upgrade\Web\CS3.5\TOLD\BusinessLayer\DAO\FileDAO.cs:line
12
--- End of inner exception stack trace ---
at L3.EDG.Websites.TOLD.BusinessLayer.DAO.FileDAO.getFileInfo
(ImanFile iFile)
at L3.EDG.Websites.TOLD.Download.Page_Load(Object sender, EventArgs
e) in D:\EDG\Branches\TCE8Upgrade\Web\CS3.5\TOLD\Download.aspx.cs:line
44]
L3.EDG.Websites.TOLD.Download.Page_Load(Object sender, EventArgs e)
in D:\EDG\Branches\TCE8Upgrade\Web\CS3.5\TOLD\Download.aspx.cs:99
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp,
Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object
sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+627


The code errors on line 44 which is this code FileInfo f =
FileDAO.getFileInfo(iFile);

__________ Information from ESET NOD32 Antivirus, version of virus
signature database 4160 (20090616) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com

__________ Information from ESET NOD32 Antivirus, version of virus signature database 4160 (20090616) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 
Back
Top