473,386 Members | 1,652 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Cannot instantiate COM+ application component

H

We have ported our VB 6 application into VB .NET but are still integrating with a few COM + applications written in VB6 running on our application server (Win 2000 Server). We have the proxies to link to the application server installed but we every now and then get a error when we try to make a call to a component running on the app server. The error message is something like

Object reference not set to an instance of an objec

at Microsoft.VisualBasic.CompilerServices.LateBinding .LateGet(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolen[] CopyBack

We instantiate the component in the .NET code by using the following line of code

objOMS680 = CreateObject("rppOMS.clsOMS680"

The error message is immediately displayed in the client application, but if you look at the component running within the COM+ application it just sits there spinning.

What can be the cause of this problem?

Regard
Carel Lotz
Nov 22 '05 #1
7 5035
Hello Carel,

Thanks for posting in the group.

Based on my understanding, now the issue is: You ported VB6 application to
VB.NET. But VB.NET application is still communicating with a few COM+
applications writtenin VB6 runnong on Win2000 Server. The error message is:

Object reference not set to an instance of an object
at Microsoft.VisualBasic.CompilerServices.LateBinding .LateGet(Object o,
Type objType, String name, Object[] args, String[] paramnames, Boolen[]
CopyBack)

The code that caused error is:
objOMS680 = CreateObject("rppOMS.clsOMS680")

Please correct me if I have anything misunderstood.

Currently I am finding somebody who could help you on it. We will follow up
here with more information. At the same time, could you please provide the
following information:

1) Which version of .NET framework are you running in that VB.NET
application machine?

2) Which version of VS.NET are you using? VS.NET 2002 or VS.NET 2003?

3) Which OS are you running on for that VB.NET application? Service Pack
version?

Thanks very much.

Best regards,
Yanhong Huang
Microsoft Community Support

Get Secure! ¨C www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 22 '05 #2
HI, Carel

I've created an escallation for this issue and routed it to the COM+ team.
The site where most of the COM+ team works is closed today due to icy
conditions, so there may be a delay in getting you a response. If you wish
to contact me directly, just remove "online." from my alias and it should
get to me.

Thank you for choosing the MSDN Managed Newsgroups,

John Eikanger
Microsoft Developer Support

This posting is provided “AS IS” with no warranties, and confers no rights.
--------------------
| Thread-Topic: Cannot instantiate COM+ application component
| thread-index: AcPkDo48c+MAgfYER/mNl83BT5sblg==
| X-Tomcat-NG: microsoft.public.dotnet.general
| From: "=?Utf-8?B?Q2FyZWwgTG90eg==?=" <cj****@hotmail.com>
| Subject: Cannot instantiate COM+ application component
| Date: Mon, 26 Jan 2004 05:16:06 -0800
| Lines: 18
| X-Tomcat-NG: microsoft.public.dotnet.general
|
| Hi

We have ported our VB 6 application into VB .NET but are still integrating
with a few COM + applications written in VB6 running on our application
server (Win 2000 Server). We have the proxies to link to the application
server installed but we every now and then get a error when we try to make
a call to a component running on the app server. The error message is
something like:

Object reference not set to an instance of an object

at Microsoft.VisualBasic.CompilerServices.LateBinding .LateGet(Object o,
Type objType, String name, Object[] args, String[] paramnames, Boolen[]
CopyBack)

We instantiate the component in the .NET code by using the following line
of code:

objOMS680 = CreateObject("rppOMS.clsOMS680")

The error message is immediately displayed in the client application, but
if you look at the component running within the COM+ application it just
sits there spinning.

What can be the cause of this problem??

Regards
Carel Lotz
|

Nov 22 '05 #3
H

1) .NET v1.
2) VS 200
3) Client machines we get the problem on all platforms i.e. Win98 SE, WinME, Win NT4.0 SP 6a, Win 2000, Win XP Home, Win XP Prof SP 1. Server is running Win 2000 Server SP

Care

----- Yan-Hong Huang[MSFT] wrote: ----

Hello Carel

Thanks for posting in the group

Based on my understanding, now the issue is: You ported VB6 application to
VB.NET. But VB.NET application is still communicating with a few COM+
applications writtenin VB6 runnong on Win2000 Server. The error message is

Object reference not set to an instance of an objec
at Microsoft.VisualBasic.CompilerServices.LateBinding .LateGet(Object o,
Type objType, String name, Object[] args, String[] paramnames, Boolen[]
CopyBack

The code that caused error is
objOMS680 = CreateObject("rppOMS.clsOMS680"

Please correct me if I have anything misunderstood

Currently I am finding somebody who could help you on it. We will follow up
here with more information. At the same time, could you please provide the
following information

1) Which version of .NET framework are you running in that VB.NET
application machine

2) Which version of VS.NET are you using? VS.NET 2002 or VS.NET 2003

3) Which OS are you running on for that VB.NET application? Service Pack
version

Thanks very much

Best regards
Yanhong Huan
Microsoft Community Suppor

Get Secure! ¨C www.microsoft.com/securit
This posting is provided "AS IS" with no warranties, and confers no rights
Nov 22 '05 #4
Hi Matt

The server installation is brand new. I'll try re-installing and re-creating the proxies, but I doubt whether this will solve the problem. Remember, we get calls through to the component running on the server successfully. It is only after a few calls that the component stops responding and the client application receives the error message mentioned. I then need to shut down the COM+ application on the server whereafter everything works again ... only for a while though.

As to adding a reference to it from VS .NET - we do not want to do this as we want to use late binding to call the proxy. The component that calls the proxy is shared between different user roles in our application and not every role is allowed to call the proxy. By using late binding, we can therefore distribute the component to the unauthorized users without having to distribute the proxy as well - worked fine in the VB6 only solution. Authorized users get the proxy via a Role Manager application that is installed afterwards.

Carel

----- Matt Ozdemir wrote: -----

First of all, delete rppOMS COM+ package and unregister all rppOMS DLLs from the server if there are any. I recommend rebooting your server to clear the memory. Then create a new proxy installation package. Afterwards install the proxy using the proxy installation package. Add reference to it from VS.NET. Rebuild your application.
Nov 22 '05 #5
Hi Carel,

I read the posts on this thread. I understand that you have a VB6 COM+
Component called from a VB.NET client EXE located on a different machine.
At times, you receive an error message stating that an object reference is
not set to an instance of the object.

Unfortunately, this error message is somewhat generic, but from one of your
posts, it seems that you recover from the failing state by restarting the
COM+ Server Application. If that is correct, then you would need to
troubleshoot the COM+ Server Application. It may be hanging. If you are
familiar with using the Debugging Tools for Windows, you can attach the
debugger and investigate the cause of the error. If you are not familiar
with using the debuggers, you can create a process dump and open a case
with Microsoft PSS for dump analysis.

Before doing that, let's confirm a few things.

When the problem happens, does it affect all clients at once, or just one
(or a few)? If it happens to affect all users, then the COM+ Server App
has a problem. If it affects just one person at a time, then we may need
to look into networking issues.

You stated that when the client receives the error, the COM+ App just
spins. Is this a high CPU situation, or is this DLLHost.EXE process idle?
You can check the CPU utilization in TaskManager, but you may have several
DLLHost.EXE processes running. To identify the particular one, you can use
the Component Services MMC, select the COM+ Applications folder on the
left-hand side, and select View menu / Status View. This will display the
PID (Process ID) for each Server App on the right-hand side. You can then
cross-reference the PID to those in TaskMgr. If PID is not displayed in
TaskMgr, you can select View menu / Select columns... and tick the box for
PID.

When the client receives the error message, can you do a CreateObject from
a VBScript on the COM+ Server? You can test this with code like this:
Dim o
Set o = CreateObject("rppOMS.clsOMS680")

(just paste into Notepad, and save as C:\Test.VBS, then run that from a
CMD.EXE prompt)

Can you also post the exact Exception, including all inner exceptions (if
any), and the stack trace from the client? That may help identify other
potential causes for this error.
Cheers,
Rob
Rob Maushardt
Microsoft Distributed Services
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
| Thread-Topic: Cannot instantiate COM+ application component
| thread-index: AcPlbTObGUKptnzlTKqE9o8/oADPMQ==
| X-Tomcat-NG: microsoft.public.dotnet.general
| From: "=?Utf-8?B?Q2FyZWwgTG90eg==?=" <cj****@hotmail.com>
| References: <CC**********************************@microsoft.co m>
<0#**************@cpmsftngxa07.phx.gbl>
| Subject: RE: Cannot instantiate COM+ application component
| Date: Tue, 27 Jan 2004 23:06:07 -0800
| Lines: 50
| Message-ID: <D6**********************************@microsoft.co m>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 8bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.general
| Path: cpmsftngxa07.phx.gbl
| Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.general:122874
| NNTP-Posting-Host: tk2msftcmty1.phx.gbl 10.40.1.180
| X-Tomcat-NG: microsoft.public.dotnet.general
|
| Hi

1) .NET v1.1
2) VS 2003
3) Client machines we get the problem on all platforms i.e. Win98 SE,
WinME, Win NT4.0 SP 6a, Win 2000, Win XP Home, Win XP Prof SP 1. Server
is running Win 2000 Server SP 4

Carel

----- Yan-Hong Huang[MSFT] wrote: -----

Hello Carel,

Thanks for posting in the group.

Based on my understanding, now the issue is: You ported VB6
application to
VB.NET. But VB.NET application is still communicating with a few COM+
applications writtenin VB6 runnong on Win2000 Server. The error
message is:

Object reference not set to an instance of an object
at Microsoft.VisualBasic.CompilerServices.LateBinding .LateGet(Object
o,
Type objType, String name, Object[] args, String[] paramnames,
Boolen[]
CopyBack)

The code that caused error is:
objOMS680 = CreateObject("rppOMS.clsOMS680")

Please correct me if I have anything misunderstood.

Currently I am finding somebody who could help you on it. We will
follow up
here with more information. At the same time, could you please provide
the
following information:

1) Which version of .NET framework are you running in that VB.NET
application machine?

2) Which version of VS.NET are you using? VS.NET 2002 or VS.NET 2003?

3) Which OS are you running on for that VB.NET application? Service
Pack
version?

Thanks very much.

Best regards,
Yanhong Huang
Microsoft Community Support

Get Secure! ¨C www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no
rights.
|

Nov 22 '05 #6
Hi Ro

1) Yes, when the problem occurs, it affects all clients at once
2) No, it is not a CPU utilization issue as the process is not using any CPU tim
3) Yes, I can successfully run the VB script file as you mentioned. I can do a CreateObject within the vbs file, but as soon as I try to call a method of the object I get the erro
4) Complete .NET exception details [there is no inner exception set]

?ex.ToStrin
"System.NullReferenceException: Object reference not set to an instance of an object
at Microsoft.VisualBasic.CompilerServices.LateBinding .LateGet(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack
at ConsoleOMS.TestOMS.CallOMS() in C:\Development\VS .NET\VB\ConsoleOMS\TestOMS.vb:line 46

I got the above mentioned error by writing a simple .NET app (ConsoleOMS) that instantiates the object and tries to call a method on the object

One or two other observations
When using the test app, I saw that the component sat spinning in the COM+ explorer until I physically closed the app (thus ending the client process). I would have thought that this would happen as soon as the instance variable goes out of scope. Because these are still VB6 components, there is no Dispose available for me to call on the instance variable. The result is that if I run 5 instances of the test app concurrently, I get 5 activated instances within the COM+ explorer. This does not seem to be a problem though as they activated instances eventually timeout on the server. Should I be concerned about this

Another thing that I've noticed is the problem sometimes occurs more regularly if the client application receives an exception in between calls to the component running on the App server, i.e. the user would make a successful call to the component, receive an exception which it successfully dealt with by the app and on the next call to the application server you get the exception I've mentioned

Hope this help

Carel
Nov 22 '05 #7
Thanks for the clarifications, Carel.

The behaviour you see where the COM+ Components remain activated in COM+
until the client process ends suggests that the managed heap still holds
the reference to the RCW (Runtime Callable Wrapper) for the COM component.
This in turn means that the COM Component's ref count has not decreased to
zero, so COM+ keeps it around. When the client process ends, these
left-over components will be cleaned up.

If this is indeed what is happening, you should call the static (or shared
in VB.NET) Marshal.ReleaseComObject() method before the client-side
variable goes out of scope. Failing to call ReleaseComObject can result in
exceptions when the CLR tries to GC the managed reference to the unmanaged
object, and other errors. Here's an example of the call:

Dim simpleCOMPlusComponent As New SimpleCOMDLL.SimpleCOMClass
Console.WriteLine(simpleCOMPlusComponent.WhatTimeI sIt())
Marshal.ReleaseComObject(simpleCOMPlusComponent)
simpleCOMPlusComponent = Nothing

You will need to import the System.Runtime.InteropServices namespace if you
don't have it already, or prefix that to the Marshal type name.

Here's a link to the MSDN documentation on this call (the URL may wrap in
the news readers):
http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfSystemRuntimeInteropServicesMarshalClassRelea seComObjectTopic.asp
Rob Maushardt
Microsoft Distributed Services
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 22 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Carel Lotz | last post by:
H We have ported our VB 6 application into VB .NET but are still integrating with a few COM + applications written in VB6 running on our application server (Win 2000 Server). We have the proxies...
4
by: Bobby C. Jones | last post by:
I'm trying to use some classes defined in a COM component that I did not create. I have successfully created the RCW via Tlbimp.exe and referenced it in my project. All is well until I run the...
1
by: shel | last post by:
Hi All, Probably a silly question to those who know, but i'm a noob with C# :D I have a COM component written in VB6 I'm trying to interop to from C# (using the IDE 'Add Reference' capability to...
7
by: Simon Bond | last post by:
In C# we can go: <foo.cs> // Create a serializable class public class Foo : ISerializable { public void GetObjectData(SerializationInfo info, StreamingContext context) {};
1
by: Zhou Jingxiong | last post by:
Hi I am using third party COM component which come with an installation program (.exe file included). The program will be register to registry automatically upon installation. There is no...
2
by: W. Broersen | last post by:
I want to use Outlook.Application, but I donot get further. Dim objOLApp As Outlook.Application objOLApp = CreateObject("Outlook.Application") Everytime I'll get the following error: Cannot...
3
by: Paul | last post by:
Hi, I'm new to .NET and I'm trying to run through the tutorial "Creating a Web Application Using VB" As I follow the directions, It seems to work just fine. I can preview the data from the...
1
by: Rocio | last post by:
I have a windows app. written in VB6, now we need to expose some of its classes through a web service. I am only able to expose the classes using late binding becasue that's the way the original...
0
by: jan.loucka | last post by:
We're running Windows Forms application written in .NET 2.0 (c#). The application is single threaded app - it starts without any form (Application.run()). After that we start another application...
1
by: HiSam | last post by:
Hi I am using CreateObject("Application.Excel") in my class which is deployed as an exe on server which basically reads the excel file and creates the xml of it. Few days back it was working...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.