Re: cannot call non-public or static methods remotely

From: Sam Santiago (ssantiago_at_n0spam-SoftiTechture.com)
Date: 08/05/04


Date: Wed, 4 Aug 2004 22:40:25 -0700

Have you tried simply stepping through the code in debug mode to see which
line generates the exception? Maybe your error is happening someplace other
than you think. One thing I did notice is that you initialize 'cust' two
times, once with the New clause in the declaration and then again with a
call to the Activator object. You would normally use one method or the
other not both.

Thanks,

Sam

-- 
_______________________________
Sam Santiago
ssantiago@n0spam-SoftiTechture.com
http://www.SoftiTechture.com
_______________________________
"sasidhar jill via .NET 247" <anonymous@dotnet247.com> wrote in message
news:%238uQ92heEHA.3428@TK2MSFTNGP11.phx.gbl...
> (Type your message here)
> Hi,
> My application is like this.
> When the client starts and the user wants to write to database or files to
server.
> he can do that only when a service is running on the server with a
particular user.
> the client connects to the remoting service(using the info from config
file on the client)
>
> Now I have a dll which will do the write to the database/Fileserver.
> my problem is that I need to have a config file on the server from which
the dll can read it and get the info like fileserver/datbase etc.,
>
> Now I have a config file when I try to connect it gives me this error.
>
> Permisionn denied: cannot call non-public or static methods remotely"
>
> Can you pleas e tell me where the error is?
>
> The Code that calls the remoting is
>
>             Dim cust As New SingleCallCustomer
>             Dim objecturi
>             Dim appsettreader As New Configuration.AppSettingsReader
'.AppSettingsReader
>             Dim testvar As String
>             testvar = GetSetting("objuri")
>             cust =
Activator.GetObject(GetType(RemotingSample.SingleCallCustomer), objecturi)
>             '  cust.createdefaultfoldersstep2(intFolderid, strItemtype,
newItem, strpath)
>             Dim testconfig As String
>             testconfig = cust.GetSetting("objuri")
>             testconfig = cust.GetSetting("mapphysicalpath")
>             testconfig = cust.GetSetting("TRASHCAN")
>
>
>
> Public Function GetSetting(ByVal Key As String) As String
>         Try
>             Dim config As XmlDocument = New XmlDocument
>             config.Load(".\\RemoteCustomer.dll.config")
>             Dim elemList As XmlNodeList =
config.GetElementsByTagName("add")
>             Dim i As Integer
>             For i = 0 To elemList.Count - 1 Step i + 1
>                 If elemList(i).Attributes("key").Value.ToString() = Key
Then
>                     Return
elemList(i).Attributes("value").Value.ToString()
>                 End If
>             Next
>         Catch ex As Exception
>             ' Dim err As String = String.Format("{0} Error with
GetSetting. Key = {1}\r\n{2}\r\n", System.DateTime.Now, Key, ex.ToString())
>             ' WriteToLogFile(".\\FileManagerError_log.txt", err)
>         End Try
>         Return ""
>     End Function
> --------------------------------
> From: sasidhar jill
>
> -----------------------
> Posted by a user from .NET 247 (http://www.dotnet247.com/)
>
> <Id>RhUlq0s8q0OaOISjuKzDkA==</Id>


Relevant Pages

  • Each client gets the same port number
    ... This class creates a server socket that will ... For each new connection request from client ... */ private String calculate{String result = null; ...
    (comp.lang.java.help)
  • Re: pygame and socket.recv
    ... player, and for the communication, I am sending a pickle string across ... The client sends a dictionary to the server. ... time.sleep to keep the frame rate at 40 frames per second. ...
    (comp.lang.python)
  • Re: Applet Consideration
    ... > the client applet to connect to the server. ... everything is sent as String. ... >> I made it so the client has absolutely no knowledge that the db exists. ... Each thread must be initialized by a login. ...
    (comp.lang.java.databases)
  • Re: Applet Consideration
    ... the client applet to connect to the server. ... My computer(the server) is behind a router ... > i.e. boolean login(String domain, String user, String pass) ...
    (comp.lang.java.databases)
  • Re: Still Need desperate help to start with ASP NET - simplified problems - HELP!!
    ... Not to IIS. ... A client uses IE to talk with a server. ... String) As String ...
    (microsoft.public.dotnet.framework.aspnet)

Loading