Archived
This forum has been archived. Please start a new discussion on GitHub.
NullReferenceException on starting IceBox
Hi,
i tried to make an service with icebox but whenever i start the service i got an NullReferenceException. I have Ice-3.1.1 with .NET-2.0.
My icebox configuration looks like this:
IceBox.ServiceManager.Endpoints=tcp -p 12345
IceBox.Service.trustServer=TrustServer.dll:BISS.Security.TrustServer
trustServer.Endpoints=tcp -p 11002
My Service Implementation like this:
using System;
namespace BISS.Security
{
/// <summary>
/// Der Vertrauenserver dient zur Abfrage wichtiger
/// Sicherheitsinformationen und der eigentlichen Anmeldung am System.
/// </summary>
public class TrustServer : Ice.LocalObjectImpl, IceBox.Service
{
/// <summary>
/// Ice Endpunkt für den TrustServer
/// </summary>
private Ice.ObjectAdapter _adapter;
/// <summary>
/// Defaultkonstruktor
/// </summary>
private TrustServer()
{
}
#region Service Schnittstelle
/// <summary>
/// Startmethode des TrustServer IceBox-Dienstes
/// </summary>
/// <param name="name"></param>
/// <param name="communicator"></param>
/// <param name="args"></param>
public void start(string name, Ice.Communicator communicator, string[] args)
{
_adapter = communicator.createObjectAdapter(name);
_adapter.add(new BISS.Security.TrustServerIcer(),Ice.Util.stringToIdentity("trustServer"));
_adapter.activate();
}
/// <summary>
/// Stopmethode des TrustServer IceBox-Dienstes
/// </summary>
public void stop()
{
_adapter.deactivate();
}
#endregion
}
}
The TrustServerIcer is implemented in Security.dll which is located in the same directory. Whenever i now start my icebox i got following error:
\build\ms\TrustServer>c:\ice-3.1.1\bin\iceboxnet.exe --Ice.Confi
g=icebox.config
iceboxnet.exe: error: IceBox.FailureException: FailureException
reason = "ServiceManager: exception while starting service trustServer: Syst
em.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz
festgelegt.
bei ServiceManagerI.startService(String service, String entryPoint, String[]
args) in f:\src\vc80\stage\IceCS-3.1.1\src\IceBox\ServiceManagerI.cs:Zeile 417."
bei ServiceManagerI.startService(String service, String entryPoint, String[]
args) in f:\src\vc80\stage\IceCS-3.1.1\src\IceBox\ServiceManagerI.cs:Zeile 430.
bei ServiceManagerI.load(String name, String value) in f:\src\vc80\stage\IceC
S-3.1.1\src\IceBox\ServiceManagerI.cs:Zeile 223.
bei ServiceManagerI.run() in f:\src\vc80\stage\IceCS-3.1.1\src\IceBox\Service
ManagerI.cs:Zeile 110.
Caused by: System.NullReferenceException: Der Objektverweis wurde nicht auf eine
Objektinstanz festgelegt.
bei ServiceManagerI.startService(String service, String entryPoint, String[]
args) in f:\src\vc80\stage\IceCS-3.1.1\src\IceBox\ServiceManagerI.cs:Zeile 417.
i tried to make an service with icebox but whenever i start the service i got an NullReferenceException. I have Ice-3.1.1 with .NET-2.0.
My icebox configuration looks like this:
IceBox.ServiceManager.Endpoints=tcp -p 12345
IceBox.Service.trustServer=TrustServer.dll:BISS.Security.TrustServer
trustServer.Endpoints=tcp -p 11002
My Service Implementation like this:
using System;
namespace BISS.Security
{
/// <summary>
/// Der Vertrauenserver dient zur Abfrage wichtiger
/// Sicherheitsinformationen und der eigentlichen Anmeldung am System.
/// </summary>
public class TrustServer : Ice.LocalObjectImpl, IceBox.Service
{
/// <summary>
/// Ice Endpunkt für den TrustServer
/// </summary>
private Ice.ObjectAdapter _adapter;
/// <summary>
/// Defaultkonstruktor
/// </summary>
private TrustServer()
{
}
#region Service Schnittstelle
/// <summary>
/// Startmethode des TrustServer IceBox-Dienstes
/// </summary>
/// <param name="name"></param>
/// <param name="communicator"></param>
/// <param name="args"></param>
public void start(string name, Ice.Communicator communicator, string[] args)
{
_adapter = communicator.createObjectAdapter(name);
_adapter.add(new BISS.Security.TrustServerIcer(),Ice.Util.stringToIdentity("trustServer"));
_adapter.activate();
}
/// <summary>
/// Stopmethode des TrustServer IceBox-Dienstes
/// </summary>
public void stop()
{
_adapter.deactivate();
}
#endregion
}
}
The TrustServerIcer is implemented in Security.dll which is located in the same directory. Whenever i now start my icebox i got following error:

g=icebox.config
iceboxnet.exe: error: IceBox.FailureException: FailureException
reason = "ServiceManager: exception while starting service trustServer: Syst
em.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz
festgelegt.
bei ServiceManagerI.startService(String service, String entryPoint, String[]
args) in f:\src\vc80\stage\IceCS-3.1.1\src\IceBox\ServiceManagerI.cs:Zeile 417."
bei ServiceManagerI.startService(String service, String entryPoint, String[]
args) in f:\src\vc80\stage\IceCS-3.1.1\src\IceBox\ServiceManagerI.cs:Zeile 430.
bei ServiceManagerI.load(String name, String value) in f:\src\vc80\stage\IceC
S-3.1.1\src\IceBox\ServiceManagerI.cs:Zeile 223.
bei ServiceManagerI.run() in f:\src\vc80\stage\IceCS-3.1.1\src\IceBox\Service
ManagerI.cs:Zeile 110.
Caused by: System.NullReferenceException: Der Objektverweis wurde nicht auf eine
Objektinstanz festgelegt.
bei ServiceManagerI.startService(String service, String entryPoint, String[]
args) in f:\src\vc80\stage\IceCS-3.1.1\src\IceBox\ServiceManagerI.cs:Zeile 417.
0
Comments
-
Found my mistake!
Hi,
for everything who propably had the same problem:
I delete the default constructor of the TrustServer. After this step everything works fine.
Greetings
Thomas0 -
Hi,
Yes, that's the problem, your default constructor is private so the IceBox server can't instantiate your service. It should also work if you declare "public" the default constructor.
IceBox should print a better error message when it can't instantiate the service, we'll fix this for the next release! Thanks for bringing this to our attention.
Cheers,
Benoit.0