cancel
Showing results for 
Search instead for 
Did you mean: 

System.NullReferenceException at SAPbobsCOM.CompanyClass.Connect()

0 Kudos

I got this NullPointer Exception if i try to connect to the company object of SBO. Only on the productive system.

Development and productive system have the same patch level.

The customer said, he changed some access restrictions on the server, dunno what he has changed.

Could this be a problem with COM restrictions?

Regards, Frank.

Accepted Solutions (0)

Answers (1)

Answers (1)

barend_morkel2
Active Contributor
0 Kudos

Could be,

Check the DCOM user settings on the server....

0 Kudos

Please help! I am not a windows admin!

barend_morkel2
Active Contributor
0 Kudos

start->run : type dcomcnfg

componentservices -> my computer (right click and choose properties)

Ensure the COM Securities setup is same on both machines (change the production server so that it's the same as your test server)

0 Kudos

Hmmm, the productive system is NT4. Great.

former_member185703
Active Contributor
0 Kudos

Hi Frank,

Sorry, but I don't remember much how all that worked in NT4 and please note that NT4 is not supported for version 2004 and later.

Good luck,

Frank

0 Kudos

One step back, it is a Win2k SP4, but the dcomcnfg is looking strange. There is no Component services!

There appears a window with 4 folders "Applications", "Default Security", "Default settings" and "Protocol Defaults" and it looks comletely different to the one on Win2k3.

Please help!

former_member185703
Active Contributor
0 Kudos

Hi Frank,

If you search for "dcomcnfg" in this forum (just like me ) you will find - among others - this message:

HTH,

Frank

0 Kudos

Thx, Frank!

I found this before and have activated the DCOM logging with regedit but nothing is logged, so i think, this is not a DCOM problem.

What the hell is going on here?

Here a the code:

s_con = System.Environment.GetCommandLineArgs.GetValue(1)

myGUI = New SAPbouiCOM.SboGuiApi

myGUI.Connect(s_con)

myApp = myGUI.GetApplication

If myApp Is Nothing Then

myApp.MessageBox("Please start BusinessOne first")

End

Else

myApp.MessageBox("AddOn has started")

End If

myCompany = New SAPbobsCOM.Company

str_Cookie = myCompany.GetContextCookie

str_Context = myApp.Company.GetConnectionContext(str_Cookie)

l_Context = myCompany.SetSboLoginContext(str_Context)

If l_Context <> 0 Then

myApp.MessageBox("No login context")

End

else

myApp.MessageBox("Good login context")

End If

myCompany.Connect()

And this connect fails!

The Terminal Server Users have access to all Libraries and executables in the SAP manage folder!

Anyone?

0 Kudos

Another thing: i haven't tried a try-catch, but if i try to start the Advenced Layout Designer, SBO says: Connect to company failed. Server throws an Exception!

If i translate this (Ausnahmefehler des Servers) correctly from german to english.

So i think, my try-catch would give me the same result!