Method invocation error

A Exceptions In RMI A.1 Exceptions During Remote Object Export When a remote object class is created that extends UnicastRemoteObject , the object is exported, meaning it can receive calls from external Java virtual machines and can be passed in an RMI call as either a parameter or return value. An object can either […]

Содержание

  1. A Exceptions In RMI
  2. A.1 Exceptions During Remote Object Export
  3. java.rmi.StubNotFoundException
  4. java.rmi.server.SkeletonNotFoundException
  5. java.rmi.server.ExportException
  6. A.2 Exceptions During RMI Call
  7. java.rmi.UnknownHostException
  8. java.rmi.ConnectException
  9. java.rmi.ConnectIOException
  10. java.rmi.MarshalException
  11. java.rmi.NoSuchObjectException
  12. java.rmi.StubNotFoundException
  13. java.rmi.activation.ActivateFailedException
  14. A.3 Exceptions or Errors During Return
  15. java.rmi.UnmarshalException
  16. java.rmi.UnexpectedException
  17. java.rmi.ServerError
  18. java.rmi.ServerException
  19. java.rmi.ServerRuntimeException
  20. A.3.1 Possible Causes of java.rmi.ServerException
  21. java.rmi.server.SkeletonMismatchException
  22. java.rmi.UnmarshalException
  23. java.rmi.MarshalException
  24. java.rmi.RemoteException
  25. A.4 Naming Exceptions
  26. java.rmi.AccessException
  27. java.rmi.AlreadyBoundException
  28. java.rmi.NotBoundException
  29. java.rmi.UnknownHostException
  30. A.5 Activation Exceptions
  31. java.rmi.activation.ActivateFailedException
  32. java.rmi.activation.ActivationException
  33. java.rmi.activation.UnknownGroupException
  34. java.rmi.activation.UnknownObjectException
  35. A.6 Other Exceptions
  36. java.rmi.RMISecurityException
  37. java.rmi.server.ServerCloneException
  38. java.rmi.server.ServerNotActiveException
  39. java.rmi.server.SocketSecurityException
  40. Troubleshooting
  41. NoSuchMethodException Due to Type Erasure
  42. IllegalAccessException when Invoking a Method
  43. IllegalArgumentException from Method.invoke()
  44. InvocationTargetException when Invoked Method Fails
  45. Frequently Asked Questions Java RMI and Object Serialization
  46. Java RMI
  47. Very Frequent Questions
  48. Debugging Java RMI programs
  49. Networking
  50. Using Java RMI to achieve X (for some X)
  51. How does RMI work with X (for some X)
  52. Internals, resources, and performance
  53. Miscellaneous
  54. Object Serialization
  55. Java RMI
  56. A.1 Why do I get an exception for an unexpected hostname and/or port number when I call Naming.lookup ?
  57. A.2 Do I have to install the _Stub file in the client’s CLASSPATH ? I thought it could be downloaded.
  58. A.3 Does Java RMI require me to use an HTTP server?
  59. A.4 Why am I getting a ClassNotFoundException ?
  60. A.5 Why does the Java RMI implementation create so many sockets when my application uses custom socket factories; or why are stubs (using a custom socket factory) that refer to the same remote object not equal; or why does the Java RMI implementation not reuse server-side ports when I use a custom server socket factory?
  61. B.1 Will there be debugging mechanisms built into Java RMI?
  62. B.2 I am having a problem debugging my program on Windows 95. Any suggestions?
  63. B.3 Why do I get a java.lang.ClassMismatchError while running my program?
  64. B.4 I am sending an array of remote objects and receive an ArrayStoreException . What’s going on?
  65. B.5 I have local objects that are synchronized. When I make them remote, my application hangs. What’s the problem?
  66. B.6 I am getting a ClassNotFoundException for my stub class when I try to register a remote object in the registry. What’s happening?
  67. B.7 My server died. Can I get a trace of the server activity?
  68. B.8 Where can I find a list of system properties that might be useful for implementing and debugging Java RMI applications?
  69. C.1 How do Java RMI clients contact remote Java RMI servers?
  70. C.2 Why does my remote method or «callback» routine fail with a nested java.net.UnknownHostException ?
  71. C.3 My server is using a fully qualified domain name or IP address, so why do I still get an UnknownHostException ?
  72. C.4 I am using the latest release of the JDK and I have a host that has multiple IP addresses. Java RMI is choosing the wrong IP address for its server hostname. How do I work around this problem?
  73. C.5 How does Java RMI obtain a server hostname?
  74. C.6 Why do Naming.bind and Naming.lookup take an extraordinarily long time on Windows platforms?
  75. C.7 How do I use Java RMI on a Windows 95 standalone machine, not connected to the network?
  76. C.8 Why do I get the exception » java.net.SocketException: Address already in use » when I try to run the registry?
  77. C.9 How can I use Java RMI through a firewall?
  78. C.10 How can I make outgoing Java RMI calls through a local firewall?
  79. HTTP tunnelling
  80. SOCKS
  81. Downloaded socket factories
  82. C.11 How can I receive incoming Java RMI calls through a local firewall?
  83. Known Ports
  84. Transport-level bridges
  85. Application-level proxies
  86. C.12 So what do I have to do to get Java RMI to operate through two firewalls?
  87. C.13 Is it possible to replace the java-rmi.cgi script that comes with the JDK distribution with a servlet?
  88. D.1 Is there a way to get automatic notification as soon as a remote VM fails?
  89. D.2 From within a virtual machine, can a new virtual machine be spawned on a remote machine?
  90. D.3 Is it possible for a remote object to be notified when all clients disconnect?
  91. D.4 Why doesn’t my server program exit when all clients disconnect?
  92. D.5 How does the distributed garbage collector detect a client that disconnects? Is it advisable to use System.exit for graceful client termination?
  93. D.6 How can my server tell when a client crashes?
  94. D.7 The unreferenced() method doesn’t get called until ten minutes after I have stopped using the remote object! How can I shorten this delay?
  95. D.8 Why can’t I get an immediate notification when a client crashes?
  96. D.9 How do I run the rmic command in a DOS batch file?
  97. D.10 In a remote object implementation, how can I find the host name of the caller of a remote method?
  98. D.11 Does Java RMI handle «out» and «inout» parameters (like CORBA)?
  99. D.12 Normally in the Java programming language, it is possible to cast an interface instance to an instance of the class from which it was created and use the result. Why doesn’t this work in Java RMI?
  100. E.1 What if my browser does not support the JDK or Java SE version I need?
  101. E.2 Can I implement remote observer/observable objects in Java RMI?
  102. F.1 At what point is there a «live» connection between the client and the server and how are connections managed?
  103. F.2 Does the Java platform replace all remote objects with their stubs during a remote method invocation?
  104. F.3 Is it possible to write a new transport layer for Java RMI which does not use sockets? As a follow-up question, how about a transport layer that uses non-TCP-based sockets?
  105. F.4 I notice the registry continues to use CPU resources, as if it were polling rather than blocking on a select() call. Is the registry implemented by polling?
  106. F.5 Is there only one socket connection between a client process and the server, no matter how many stubs exist in that client process?
  107. G.1 What are the licensing issues surrounding the use of Java RMI?
  108. G.2 I have a single-threaded program that waits on standard input for a user command which will initiate a Java RMI call. However, my remote object cannot service this incoming remote call as the program appears to be blocked on standard input. What’s the problem?
  109. G.3 I am copying array elements to my remote server and changing the values, but the incremented values are not copied back to the client. Why?
  110. G.4 Am I allowed to have static fields in a remote interface?
  111. G.5 I locate the registry, but then it seems that it’s not there, what’s happening?
  112. Object Serialization
  113. 1. Why must classes implement Serializable in order to be written to an ObjectOutputStream ?
  114. Security restrictions
  115. Forcing a conscious decision
  116. 2. Which JDK system classes are marked serializable?
  117. 3. I am having problems deserializing JDK AWT components. How can I make this work?
  118. 4. Does object serialization support encryption?
  119. 5. The object serialization classes are stream oriented. How do I write objects to a random-access file?
  120. 6. When a local object is serialized and passed as a parameter in a Java RMI call, are the bytecodes for the local object’s methods also passed? What about object coherency, if the remote VM application «keeps» the object handle?
  121. 7. How can I create an ObjectInputStream from an ObjectOutputStream without a file in between?
  122. 8. I create an object and then send it across the net using the writeObject method and receive it using the readObject method. If I then change the value of a field in the object and send it as before, the object that the readObject method returns appears to be the same as the first object and does not reflect the new value of the field. Should I be experiencing this behavior?
  123. 9. Are there any plans to support the serialization of thread objects?
  124. 10. Can I compute diff(serial(x),serial(y))?
  125. 11. Can I compress the serial representation of my objects using my own zip and unzip methods?
  126. 12. Can I execute methods on compressed versions of my objects, for example isempty(zip(serial(x)))?
  127. 13. If I try to serialize a font or image object and then try to reconstitute it in a different VM, my application dies. Why?
  128. 14. How do I serialize a tree of objects?

A Exceptions In RMI

A.1 Exceptions During Remote Object Export

When a remote object class is created that extends UnicastRemoteObject , the object is exported, meaning it can receive calls from external Java virtual machines and can be passed in an RMI call as either a parameter or return value. An object can either be exported on an anonymous port or on a specified port. For objects not extended from UnicastRemoteObject , the java.rmi.server.UnicastRemoteObject.exportObject method is used to explicitly export the object.

java.rmi.StubNotFoundException

Class of stub not found.

Name collision with class of same name as stub causes one of these errors:

  • Stub can’t be instantiated
  • Stub not of correct class

Bad URL due to wrong codebase.

Stub not of correct class.

java.rmi.server.SkeletonNotFoundException

Note: this exception is deprecated as of Java 2 SDK, Standard Edition, v1.2

Class of skeleton not found.

Name collision with class of same name as skeleton causes one of these errors:

  • Skeleton can’t be instantiated
  • Skeleton not of correct class

Bad URL due to wrong codebase.

Skeleton not of correct class.

java.rmi.server.ExportException

The port is in use by another VM.

A.2 Exceptions During RMI Call

java.rmi.UnknownHostException

java.rmi.ConnectException

Connection refused to host.

java.rmi.ConnectIOException

I/O error creating connection.

java.rmi.MarshalException

I/O error marshaling transport header, marshaling call header, or marshaling arguments.

java.rmi.NoSuchObjectException

Attempt to invoke a method on an object that is no longer available.

java.rmi.StubNotFoundException

Remote object not exported.

java.rmi.activation.ActivateFailedException

Thrown by RMI runtime when activation fails during a remote call to an activatable object

A.3 Exceptions or Errors During Return

java.rmi.UnmarshalException

Corrupted stream leads to either an I/O or protocol error when:

  • Marshaling return header
  • Checking return type
  • Checking return code
  • Unmarshaling return

Return value class not found.

java.rmi.UnexpectedException

An exception not mentioned in the method signature occurred (excluding runtime exceptions). The UnexpectedException exception object contains the underlying exception that was thrown by the server.

java.rmi.ServerError

Any error that occurs while the server is executing a remote method. The ServerError exception object contains the underlying error that was thrown by the server.

java.rmi.ServerException

This exception is thrown as a result of a remote method invocation when a RemoteException is thrown while processing the invocation on the server, either while unmarshalling the arguments or executing the remote method itself. For examples, see SectionВ A.3.1, «Possible Causes of java.rmi.ServerException».

java.rmi.ServerRuntimeException

Note: this exception is deprecated as of Java 2 SDK, Standard Edition, v1.2

This exception is not thrown by servers running Java 2 SDK, Standard Edition, v1.2-compatible versions. A RuntimeException is propagated to clients intact.

A.3.1 Possible Causes of java.rmi.ServerException

These are some of the underlying exceptions which can occur on the server when the server is itself executing a remote method invocation. These exceptions are wrapped in a java.rmi.ServerException ; that is the java.rmi.ServerException contains the original exception for the client to extract. These exceptions are wrapped by ServerException so that the client will know that its own remote method invocation on the server did not fail, but that a secondary remote method invocation made by the server failed.

java.rmi.server.SkeletonMismatchException

Note: this exception is deprecated as of the Java 2 SDK, Standard Edition, v1.2

Hash mismatch of stub and skeleton.

java.rmi.UnmarshalException

  • I/O error unmarshaling call header.
  • I/O error unmarshaling arguments.
  • Invalid method number or method hash.

java.rmi.MarshalException

Protocol error marshaling return.

java.rmi.RemoteException

A RemoteException occurring as a result of a remote invocation by the server.

A.4 Naming Exceptions

The following table lists the exceptions specified in methods of the java.rmi.Naming class and the java.rmi.registry.Registry interface.

java.rmi.AccessException

Operation disallowed. The registry restricts bind, rebind, and unbind to the same host. The lookup operation can originate from any host.

java.rmi.AlreadyBoundException

Attempt to bind a name that is already bound.

java.rmi.NotBoundException

Attempt to look up a name that is not bound.

java.rmi.UnknownHostException

Attempt to contact a registry on an unknown host.

A.5 Activation Exceptions

The following table lists the exceptions that can be thrown in activities involving activatable objects. The activation API is in the package java.rmi.activation.

java.rmi.activation.ActivateFailedException

Thrown by RMI runtime when activation fails during a remote call to an activatable object.

java.rmi.activation.ActivationException

General exception class used by the activation interfaces and classes.

java.rmi.activation.UnknownGroupException

Thrown by methods of the activation classes and interfaces when the ActivationGroupID parameter or ActivationGroupID in an ActivationGroupDesc parameter is invalid.

java.rmi.activation.UnknownObjectException

Thrown by methods of the activation classes and interfaces when the ActivationID parameter is invalid.

A.6 Other Exceptions

java.rmi.RMISecurityException

Note: this exception is deprecated as of the Java 2 SDK, Standard Edition, v1.2

A security exception that is thrown by the RMISecurityManager .

java.rmi.server.ServerCloneException

java.rmi.server.ServerNotActiveException

Attempt to get the client host via the RemoteServer.getClientHost method when the remote server is not executing in a remote method.

java.rmi.server.SocketSecurityException

Attempt to export object on an illegal port.

Copyright В© 1997, 2017, Oracle and/or its affiliates. All rights reserved.

Источник

Troubleshooting

This section contains examples of problems developers might encounter when using reflection to locate, invoke, or get information about methods.

NoSuchMethodException Due to Type Erasure

The MethodTrouble example illustrates what happens when type erasure is not taken into consideration by code which searches for a particular method in a class.

When a method is declared with a generic parameter type, the compiler will replace the generic type with its upper bound, in this case, the upper bound of T is Object . Thus, when the code searches for lookup(Integer) , no method is found, despite the fact that the instance of MethodTrouble was created as follows:

Searching for lookup(Object) succeeds as expected.

In this case, find() has no generic parameters, so the parameter types searched for by getMethod() must match exactly.

IllegalAccessException when Invoking a Method

An IllegalAccessException is thrown if an attempt is made to invoke a private or otherwise inaccessible method.

The MethodTroubleAgain example shows a typical stack trace which results from trying to invoke a private method in an another class.

The stack trace for the exception thrown follows.

IllegalArgumentException from Method.invoke()

Method.invoke() has been retrofitted to be a variable-arity method. This is an enormous convenience, however it can lead to unexpected behavior. The MethodTroubleToo example shows various ways in which Method.invoke() can produce confusing results.

Since all of the parameters of Method.invoke() are optional except for the first, they can be omitted when the method to be invoked has no parameters.

The code in this case generates this compiler warning because null is ambiguous.

It is not possible to determine whether null represents an empty array of arguments or a first argument of null .

This fails despite the fact that the argument is null , because the type is a Object and ping() expects no arguments at all.

This works because new Object[0] creates an empty array, and to a varargs method, this is equivalent to not passing any of the optional arguments.

Unlike the previous example, if the empty array is stored in an Object , then it is treated as an Object . This fails for the same reason that case 2 fails, ping() does not expect an argument.

InvocationTargetException when Invoked Method Fails

An InvocationTargetException wraps all exceptions (checked and unchecked) produced when a method object is invoked. The MethodTroubleReturns example shows how to retrieve the original exception thrown by the invoked method.

Источник

Frequently Asked Questions
Java RMI and Object Serialization

Java RMI

Very Frequent Questions

Debugging Java RMI programs

Networking

Using Java RMI to achieve X (for some X)

How does RMI work with X (for some X)

Internals, resources, and performance

Miscellaneous

Object Serialization

Java RMI

A.1 Why do I get an exception for an unexpected hostname and/or port number when I call Naming.lookup ?

Even if the server is mistaken about its hostname or IP address (or has a hostname that simply isn’t resolvable by clients), it will still export all of its objects using that mistaken hostname, but you will see an exception every time you try to receive one of those objects.

The hostname which you specified in Naming.lookup to locate the registry has no effect on the hostname which is already embedded in the remote reference to the server.

Usually, the mysterious hostname is the unqualified hostname of the server, or a private name unknown to the client’s nameservice, or (in the case of Windows platforms) the server’s Network->Identification->Machine Name.

The appropriate workaround is to set the system property java.rmi.server.hostname when starting the server. The value of the property should be the externally reachable hostname (or IP address) of the server — whatever works when specified as the host-part in Naming.lookup is good enough.

For more detail, see the questions on callbacks and fully qualified domain names.

A.2 Do I have to install the _Stub file in the client’s CLASSPATH ? I thought it could be downloaded.

When a remote object is marshalled by Java RMI (whether as an argument to a remote call or as a return value), the codebase for the stub class is retrieved by Java RMI and used to annotate the serialized stub. When the stub is unmarshalled, the codebase is used to load the stub classfile using the RMIClassLoader , unless the class can already be found in the CLASSPATH or by the context classloader for the receiving object, such as an applet codebase.

If the _Stub class was loaded by an RMIClassLoader , then Java RMI already knows which codebase to use for its annotation. If the _Stub class was loaded from the CLASSPATH , then there is no obvious codebase, and Java RMI consults the java.rmi.server.codebase system property to find the codebase. If the system property is not set, then the stub is marshalled with a null codebase, which means that it cannot be used unless the client has a matching copy of the _Stub classfile in the client’s CLASSPATH .

It is easy to forget to specify the codebase property. One way to detect this error is to start the rmiregistry separately and without access to the application classes. This will force Naming.rebind to fail if the codebase is omitted.

For more information on the java.rmi.server.codebase property, please take a look at our tutorial, Dynamic code downloading using Java RMI (Using the java.rmi.server.codebase Property).

A.3 Does Java RMI require me to use an HTTP server?

No. You can set your java.rmi.server.codebase property to use any valid URL protocol, such as file or ftp . Using an HTTP server just makes your life simpler by providing an automated mechanism for class file downloading.

A.4 Why am I getting a ClassNotFoundException ?

A.5 Why does the Java RMI implementation create so many sockets when my application uses custom socket factories; or why are stubs (using a custom socket factory) that refer to the same remote object not equal; or why does the Java RMI implementation not reuse server-side ports when I use a custom server socket factory?

The Java RMI implementation attempts to reuse server-side ports as well. It will only do so if there is an existing server socket for the port created by an equivalent socket factory. Make sure the server socket factory class implements the hashCode and equals methods too.

If your socket factory has no instance state, a trivial implementation of the hashCode and equals methods are the following:

B.1 Will there be debugging mechanisms built into Java RMI?

B.2 I am having a problem debugging my program on Windows 95. Any suggestions?

It is advised not to use the javaw command during development. To watch the server activity, start the server with -Djava.rmi.server.logCalls=true .

B.3 Why do I get a java.lang.ClassMismatchError while running my program?

B.4 I am sending an array of remote objects and receive an ArrayStoreException . What’s going on?

Now Java RMI can put the stub into each cell of the array without an exception on the remote call.

B.5 I have local objects that are synchronized. When I make them remote, my application hangs. What’s the problem?

Distributed objects behave differently than local objects. If you simply reuse a local implementation without handling locking and failure, you will probably get unpredictable results.

B.6 I am getting a ClassNotFoundException for my stub class when I try to register a remote object in the registry. What’s happening?

When you make a call to the registry to bind an object, the registry actually binds a reference to the stub for the remote object. In order to instantiate a stub object, the registry VM needs to be able to load its class definition. The VM (in this case the server VM) that sends the serialized forms of a stub in a remote method call to the registry is responsible for annotating the stub with the location from which its classes can be downloaded. If stubs are not annotated properly, Java RMI will throw a ClassNotFoundException when it tries to instantiate the stub.

To annotate classes properly, the server needs to set the value of the java.rmi.server.codebase property value to the location(s) of the stub classes. Java RMI will automatically annotate the serialized form of outgoing object instances with the value of the java.rmi.server.codebase property.

NOTE: It is possible (and in a small number of environments appropriate) to enable the rmiregistry to unmarshal stub objects by placing all relevant stub class files in the CLASSPATH of the rmiregistry. However, the rmiregistry does not have to download stub classes. If stub classes are available locally, it will use those classes. Using the rmiregistry‘s CLASSPATH for stub deployment requires that all VMs that reference a stub instance obtained from that registry have the stub’s class file installed locally (in the VM’s CLASSPATH).

For example, if the registry loads stub classes from its CLASSPATH, when the registry sends serialized stub objects to other VMs, those serialized objects will be annotated with the value of the registry’s java.rmi.server.codebase property (which will almost always be null). If the VMs receiving serialized stub objects from the registry do not have the class files for those stubs installed locally then those VMs are likely to throw a ClassNotFoundException .

Instead, if classes are downloaded dynamically from a server VM’s java.rmi.server.codebase annotation, only the server VM needs to have the stub classes in its CLASSPATH. With this approach, application deployment is simpler and it is possible to introduce new stub versions into a running distributed system.

For more information on dynamic code downloading in Java RMI, please see the tutorial, Dynamic code downloading using Java RMI (Using the java.rmi.server.codebase ).

B.7 My server died. Can I get a trace of the server activity?

B.8 Where can I find a list of system properties that might be useful for implementing and debugging Java RMI applications?

Properties that begin with » sun.rmi. « are only supported by certain versions of the JDK. While these » sun.rmi.* « properties can be quite useful for debugging and tuning at runtime, please note that they are not considered part of the public API, and their use is subject to change (or may be removed completely) in future versions of the implementation.

C.1 How do Java RMI clients contact remote Java RMI servers?

For an Java RMI client to contact a remote Java RMI server, the client must first hold a reference to the server. The Naming.lookup method call is the most common mechanism by which clients initially obtain references to remote servers. Remote references may be obtained by other means, for example: all remote method calls can return remote references. This is what Naming.lookup does; it uses a well-known stub to make a remote method call to the rmiregistry , which sends back the remote reference to the object requested by the lookup method.

Every remote reference contains a server hostname and port number that allow clients to locate the VM that is serving a particular remote object. Once a Java RMI client has a remote reference, the client will use the hostname and port provided in the reference to open a socket connection to the remote server.

Please note that with Java RMI the terms client and server can refer to the same program. A Java program that acts as a Java RMI server contains an exported remote object. A Java RMI client is a program that invokes one or more methods on a remote object in another virtual machine. If a VM performs both of these functions, it may be referred to as an RMI client and a Java RMI server.

C.2 Why does my remote method or «callback» routine fail with a nested java.net.UnknownHostException ?

Java RMI may default to using an unresolvable server hostname (for example: unqualified names, Windows Internet Naming Service (WINS) names, or unqualified DHCP names). When a Java RMI client invokes a remote method using a reference that contains an unresolvable server hostname, the client will throw an UnknownHostException .

In order to generate functional remote references, Java RMI servers must be able to supply a fully qualified hostname or IP address that is resolvable from all Java RMI clients (an example of a fully qualified hostname is foo.bar.com ). If a Java RMI program provides a remote callback operation, then that program serves a Java RMI object and consequently, must be able to determine a resolvable hostname to use as its server hostname in the remote references it passes to Java RMI clients. VMs that make calls to applets that serve remote objects may throw UnknownHostException s because the applet has failed to provide a usable server hostname.

If your Java RMI application throws an UnknownHostException , you can look at the resulting stack trace to see if the hostname that the client is using to contact its remote server is incorrect or not fully qualified. If necessary, you can set the java.rmi.server.hostname property on the server to the correct IP address or hostname of the server machine and Java RMI will use this property’s value to generate remote references to the server.

C.3 My server is using a fully qualified domain name or IP address, so why do I still get an UnknownHostException ?

C.4 I am using the latest release of the JDK and I have a host that has multiple IP addresses. Java RMI is choosing the wrong IP address for its server hostname. How do I work around this problem?

C.5 How does Java RMI obtain a server hostname?

Java RMI will use an IP address or a fully qualified domain name to identify a machine that serves a remote object. Server hostnames are initialized to the value obtained by performing the following actions:

  1. By default, Java RMI uses the IP address of the server host as the server name for remote references.
  2. If the property java.rmi.server.hostname is set, Java RMI will use its value as the server hostname, and will not attempt to find a fully qualified domain name through any other method. This property takes precedence over all other means of finding a Java RMI server name.
  3. If the property java.rmi.server.useLocalHostname is set to true (by default, the value of this property is false ), Java RMI applies the following routine to obtain a hostname for the Java RMI server:
    1. If the value returned by the InetAddress.getLocalHost().getHostName() method contains a «.» character, then Java RMI will assume that this value is the server’s fully qualified domain name and will use it as the server hostname.
    2. Otherwise, Java RMI will spawn a thread to query the local name service for the fully qualified domain name of the Java RMI server. If the name service takes too long to return, or the name service returns but its response does not contain a «.» then Java RMI will use the server’s IP address obtained from InetAddress.getLocalHost().getHostAddress() .

    Users can override the default time (10 seconds or 10000 milliseconds) that Java RMI will look for a fully qualified domain name by setting the following property:
    sun.rmi.transport.tcp.localHostnameTimeOut =timeOutMillis
    where timeOutMillis is the time that Java RMI will wait in milliseconds. For example:

When using activatable remote objects, it is recommended that Java RMI servers set the value of the java.rmi.server.useLocalHostname property to true . In general, hostnames are more stable than IP addresses. Activatable remote objects tend to last longer than transient remote objects (for example, surviving a reboot). A Java RMI client will be more likely to locate a remote object over a long period of time if it uses a qualified hostname rather than an explicit IP address.

C.6 Why do Naming.bind and Naming.lookup take an extraordinarily long time on Windows platforms?

C.7 How do I use Java RMI on a Windows 95 standalone machine, not connected to the network?

C.8 Why do I get the exception » java.net.SocketException: Address already in use » when I try to run the registry?

C.9 How can I use Java RMI through a firewall?

C.10 How can I make outgoing Java RMI calls through a local firewall?

HTTP tunnelling

If Java RMI fails to make a normal (or SOCKS) connection to the intended server, and it notices that a HTTP proxy server is configured, it will attempt to tunnel Java RMI requests through that proxy server, one at a time.

There are two forms of HTTP tunnelling, tried in order. The first is http-to-port; the second is http-to-cgi.

In http-to-port tunneling, Java RMI attempts a HTTP POST request to a http: URL directed at the exact hostname and port number of the target server. The HTTP request contains a single Java RMI request. If the HTTP proxy accepts this URL, it will forward the POST request to the listening Java RMI server, which will recognize the request and unwrap it. The result of the call is wrapped in a HTTP reply, which is returned through the same proxy.

Often, HTTP proxies will refuse to proxy requests to unusual port numbers. In this case, Java RMI will fall back to http-to-cgi tunneling. The Java RMI request is encapsulated in a HTTP POST request as before, but the request URL is of the form http://hostname:80/cgi-bin/java-rmi.cgi?port=n (where hostname and n are the hostname and port number of the intended server). There must be a HTTP server listening on port 80 on the server host, which will run the java-rmi.cgi script (supplied with the JDK), which will in turn forward the request to a Java RMI server listening on port n. Java RMI can unwrap a HTTP-tunneled request without help from a http server, CGI script, or any other external entity. So, if the client’s HTTP proxy can connect directly to the server’s port, then you don’t need a java-rmi.cgi script at all.

To trigger the use of HTTP tunneling, the standard system property http.proxyHost must be set to the hostname of the local HTTP proxy. (There are reports that some Navigator versions do not set this property.)

The major disadvantage of HTTP tunneling is that it does not permit inward calls or multiplexed connections. A secondary disadvantage is that the http-to-cgi method opens a dramatic security hole on the server side, since without modification it will redirect any incoming request to any port.

SOCKS

This approach would appear to be the most generally useful solution. As yet, ServerSockets do not use SOCKS, so incoming calls must use another mechanism.

Downloaded socket factories

The disadvantage of this approach is that the traversal of the firewall must be done by code provided by the Java RMI server side, which does not necessarily know how that traversal must be done, nor does it automatically have sufficient privilege to traverse the firewall.

C.11 How can I receive incoming Java RMI calls through a local firewall?

Known Ports

If the exported objects are all exported on a known port on a known host, then that host and port can be explicitly permitted at the firewall. Normally, Java RMI asks for port 0 (which is code for «any port»). In the JDK, there is an extra argument to the exportObject method to specify the exact port number.

This approach has the disadvantage that it requires the assistance of the network administrator responsible for the local firewall. If the exported object is being run in a different location (because code was downloaded to that site), then the local firewall may be run by network administrators who don’t know who you are.

Transport-level bridges

The idea here is to export objects in such a way that anyone outside the firewall who wants to call remote methods on that object instead contacts a different port (perhaps on a different machine). That different port has a running program which makes a second connection to the real server and then pumps bytes each way.

The tricky part is convincing the client to connect to the bridge. A downloadable socket factory can do this efficiently; otherwise, it is possible to set the java.rmi.server.hostname property to name the bridge host and arrange for port numbers to be the same.

Application-level proxies

When an outsider makes a call on the proxy, the proxy immediately forwards the call to its original object on the internal server. The use of the proxy is transparent to the outsider (but not to the internal server, who has to decide whether to pass the original reference or the proxy reference when talking to anyone).

Needless to say, this requires considerable setup and the cooperation of the local network administrators.

C.12 So what do I have to do to get Java RMI to operate through two firewalls?

In the most pessimistic case, the client-side firewall allows no direct TCP connections and has only a HTTP proxy server so that firewalled clients can «surf the web». In this case, your server host will receive connections at port 80 containing Java RMI requests embedded in HTTP requests. You can use a HTTP server with the java-rmi.cgi program, or you can run the Java RMI server directly on port 80. Either way, the server cannot use callback objects exported by the clients..

A more optimistic case is that the client can make direct connections to the server but cannot receive incoming connections from the server. In this case, callback objects are not normally possible either.

The most conservative approach, assuming no help from the client firewall administrators, is:

  • Avoid using callback objects
  • Run your servers on `public’ ports such as 80, 81, 8001, or 443
  • If the servers are not running on port 80, either:
    • Put a CGI-capable HTTP server on port 80 using the java-rmi.cgi script; or
    • Run a port redirector (such as DeleGate ) on port 80, which will accept connections and immediately connect to the real server port to pass bytes back and forth. This will cause getClientHost() to return misleading information, so don’t make the Registry available through this method unless it’s on a different host.

C.13 Is it possible to replace the java-rmi.cgi script that comes with the JDK distribution with a servlet?

Note: If you do not understand the role that java-rmi.cgi plays in tunnelling remote method calls over HTTP, please see the FAQ question regarding HTTP tunnelling in Java RMI.

D.1 Is there a way to get automatic notification as soon as a remote VM fails?

D.2 From within a virtual machine, can a new virtual machine be spawned on a remote machine?

D.3 Is it possible for a remote object to be notified when all clients disconnect?

D.4 Why doesn’t my server program exit when all clients disconnect?

Although the Java API does not specify the timeliness of collection anyway, there is a particular reason for the what can seem like indefinitely delayed collection of remote objects. Under the covers, the Java RMI runtime holds a weak reference to exported remote objects in a table (to keep track of local as well as remote references to the object). The only weak reference mechanism available in the JDK VM uses a non-aggressive, caching collection policy (well-suited for a browser), so objects that are only «weakly reachable» will not get collected until the local GC decides that it really needs that memory to satisfy another allocation. For an idle server, this could never happen. But if memory is needed, an unreferenced server object will be collected.

The Java SE platform includes a new infrastructure that Java RMI will use to reduce significantly the number of conditions under which this problem occurs.

D.5 How does the distributed garbage collector detect a client that disconnects? Is it advisable to use System.exit for graceful client termination?

If you need to use System.exit() to terminate a client VM, to ensure that remote references held in that VM are cleaned up in a more timely fashion, you should make sure that there are no remote references still reachable. Explicitly null any local references to make them unreachable from running threads. It also may help to run a full garbage collection and to run finalizers before exiting:

D.6 How can my server tell when a client crashes?

If a client is holding a remote reference, it also holds a lease for that reference, which must be renewed (by contacting the server and making a dirty() call). When the final lease for an exported object has expired or closed, the object is considered unreferenced, and (if it implements java.rmi.Unreferenced ) its unreferenced() method will be invoked.

If two or more clients have references to the same remote object, the unreferenced() method will not be called until all of them have expired their leases on it. Consequently, if you are using this technique to track individual clients, each client must have a reference to its own Unreferenced object.

D.7 The unreferenced() method doesn’t get called until ten minutes after I have stopped using the remote object! How can I shorten this delay?

The default value is 600000 milliseconds (or 10 minutes).

The client will renew each lease when it is halfway expired. If the lease interval is too short, the client will waste a lot of network bandwidth needlessly renewing its lease. If the lease interval is much too short, the client will be unable to renew the lease in time, and the exported object may be deleted as a result.

Future releases of Java RMI may invalidate remote references if they fail to renew their leases (in order to preserve referential integrity); you should not rely on being able to use stale references to remote objects.

Note that you’ll only have to wait for the timeout if the client machine crashes. If the client has some control when the disconnect occurs, it can send out the DGC clean call quickly, making the use of Unreferenced quite timely. You can help this process along by nulling out any references the client may have to the remote object and then calling System.gc() .

D.8 Why can’t I get an immediate notification when a client crashes?

If or when the crashed client later restarts and contacts the server, the server can infer that the client has lost its state. If a TCP connection is held open between the client and the server throughout their interaction, then the server can detect the client reboot when a later attempt to write to the connection fails (including the hourly TCP keepalive packet, if enabled). However, Java RMI is designed not to require such permanent connections, as it impairs scalability and doesn’t help very much.

Given that it is absolutely impossible to instantly determine when a network peer crashes or becomes otherwise unavailable, you must decide how your application should behave when a peer stops responding.

The major tools you have for this task are timeouts and resets. After a timeout, you may conclude that a peer is unreachable, but the peer must be aware of the timeout so that it gives up trying to reach you. The leasing mechanism is designed to do this semi-automatically.

A reset is a purge of existing state held for a peer. For example, a client may cause a reset when it first registers with its server, causing the server to discard any previous state held for that client (having deduced that the client has restarted without memory of the previous, dead, session).

Frequently, the aim is to have and maintain a definitive list of clients at the server, and to keep it up-to-date without error or failure. Since failure and delay can happen at any time in a networked system, some degree of error in the list must be anticipated. If a lease or other mechanism is used to enforce a timeout, then the problem of resource leakage is solved. If the problem of stale data is more serious — that is, if it would interfere with correct operation — then it must be explicitly purged in cases where it would otherwise have an effect.

For example, if a business object is locked for editing by a human, and the session dies, then the lock must be broken somehow. In this case, the lock would need a timeout, but if the same human logs in immediately and expects not to have to wait for the timeout to expire, the new session must either take over the lock or assert that the user holds no locks (allowing the server to safely kill the lock).

D.9 How do I run the rmic command in a DOS batch file?

D.10 In a remote object implementation, how can I find the host name of the caller of a remote method?

D.11 Does Java RMI handle «out» and «inout» parameters (like CORBA)?

D.12 Normally in the Java programming language, it is possible to cast an interface instance to an instance of the class from which it was created and use the result. Why doesn’t this work in Java RMI?

So, you cannot pass a remote object reference from a server to a client, and then send it back to the server and be able to cast it back to the original implementation class. You can, though, use the remote object reference on the server to make a remote call to the object.

If you need to find the implementation class again, you’ll need to keep a table that maps the remote reference to the implementation class.

E.1 What if my browser does not support the JDK or Java SE version I need?

E.2 Can I implement remote observer/observable objects in Java RMI?

Note that since the «wrapped» non-remote object does not extend java.rmi.server.UnicastRemoteObject , you will need to explicitly export the object using the exportObject method of UnicastRemoteObject . In doing this though, you lose the java.rmi.server.RemoteObject implementations of the equals , hashCode , and toString methods.

F.1 At what point is there a «live» connection between the client and the server and how are connections managed?

F.2 Does the Java platform replace all remote objects with their stubs during a remote method invocation?

F.3 Is it possible to write a new transport layer for Java RMI which does not use sockets? As a follow-up question, how about a transport layer that uses non-TCP-based sockets?

F.4 I notice the registry continues to use CPU resources, as if it were polling rather than blocking on a select() call. Is the registry implemented by polling?

F.5 Is there only one socket connection between a client process and the server, no matter how many stubs exist in that client process?

G.1 What are the licensing issues surrounding the use of Java RMI?

G.2 I have a single-threaded program that waits on standard input for a user command which will initiate a Java RMI call. However, my remote object cannot service this incoming remote call as the program appears to be blocked on standard input. What’s the problem?

G.3 I am copying array elements to my remote server and changing the values, but the incremented values are not copied back to the client. Why?

G.4 Am I allowed to have static fields in a remote interface?

G.5 I locate the registry, but then it seems that it’s not there, what’s happening?

Object Serialization

1. Why must classes implement Serializable in order to be written to an ObjectOutputStream ?

If classes were to be marked as being serializable the design team worried that a developer, either out of forgetfulness, laziness, or ignorance might not declare a class as being Serializable and then make that class useless for RMI or for purposes of persistence. We worried that the requirement would place on a developer the burden of knowing how a class was to be used by others in the future, an essentially unknowable condition. Indeed, our preliminary design, as reflected in the alpha API, concluded that the default case for a class ought to be that the objects in the class be serializable. We changed our design only after considerations of security and correctness convinced us that the default had to be that an object not be serialized.

Security restrictions

No such restriction can be made on an object once it has been serialized; the stream of bytes that is the result of object serialization can be read and altered by any object that has access to that stream. This allows any object access to the state of a serialized object, which can violate the privacy guarantees users of the language expect. Further, the bytes in the stream can be altered in arbitrary ways, allowing the reconstruction of an object that was never created within the protections of a Java platform. There are cases in which the re-creation of such an object could compromise not only the privacy guarantees expected by users of the Java platform, but the integrity of the platform itself.

These violations cannot be guarded against, since the whole idea of serialization is to allow an object to be converted into a form that can be moved outside of the Java platform (and therefore outside of the privacy and integrity guarantees of that environment) and then be brought back into the environment. Requiring objects to be declared serializable does mean that the class designer must make an active decision to allow the possibility of such a breach in privacy or integrity. A developer who does not know about serialization should not be open to compromise because of this lack of knowledge. In addition, we would hope that the developer who declares a class to be serializable does so after some thought about the possible consequences of that declaration.

Note that this sort of security problem is not one that can be dealt with by the mechanism of a security manager. Since serialization is intended to allow the transport of an object from one virtual machine to some other (either over space, as it is used in RMI, or over time, as when the stream is saved to a file), the mechanisms used for security need to be independent of the runtime environment of any particular virtual machine. We wanted to avoid as much as possible the problem of being able to serialize an object in one virtual machine and not being able to deserialize that object in some other virtual machine. Since the security manager is part of the runtime environment, using the security manager for serialization would have violated this requirement.

Forcing a conscious decision

Examples are easy to cite. Many classes deal with information that only makes sense in the context of the runtime in which the particular object exists; examples of such information include file handles, open socket connections, security information, etc. Such data can be dealt with easily by simply declaring the fields as transient , but such a declaration is only necessary if the object is going to be serialized. A novice (or forgetful, or hurried) programmer might neglect to mark fields as transient in much the same way he or she might neglect to mark the class as implementing the Serializable interface. Such a case should not lead to incorrect behavior; the way to avoid this is to not serialize objects not marked as implementing Serializable .

Another example of this sort is the «simple» object that is the root of a graph that spans a large number of objects. Serializing such an object could result in serializing lots of others, since serialization works over an entire graph. Doing something like this should be a conscious decision, not one that happens by default.

The need for this sort of thought was brought home to us in the group when we were going through the base Java API class libraries, marking the system classes as serializable (where appropriate). We had originally thought that this would be a fairly simple process, and that most of the system classes could just be marked as implementing Serializable and then use the default implementation with no other changes. What we found was that this was far less often the case than we had suspected. In a large number of the classes, careful thought had to be given to whether or not a field should be marked as transient or whether it made sense to serialize the class at all.

Of course, there is no way to guarantee that a programmer or class designer is actually going to think about these issues when marking a class as serializable. However, by requiring the class to declare itself as implementing the Serializable interface we do require that some thought be given by the programmer. Having serialization be the default state of an object would mean that lack of thought could cause bad effects in a program, something that the overall design of the Java platform has attempted to avoid.

2. Which JDK system classes are marked serializable?

3. I am having problems deserializing JDK AWT components. How can I make this work?

As a work around, you should first remove the top-level widget from its container (so the widgets are no longer «live»). The peers are discarded at this point and you will save only the AWT widget state. When you later deserialize and read the widgets back in, add the top level widget to the frame to make the AWT widgets appear. You may need to add a show call.

AWT widgets are serializable. The java.awt.Component class implements Serializable .

4. Does object serialization support encryption?

RMI’s use of serialization leaves encryption and decryption to the lower network transport. We expect that when a secure channel is needed the network connections will be made using SSL or the like (see Using RMI with SSL).

5. The object serialization classes are stream oriented. How do I write objects to a random-access file?

You can use ByteArrayInputStream and ByteArrayOutputStream objects as intermediate places to write and read bytes to and from the random access file and create ObjectInputStream s and ObjectOutputStream s from the byte streams to transport the objects. You just have to make sure that you have the entire object in the byte stream or reading/writing the object will fail.

For example, java.io.ByteArrayOutputStream can be used to receive the bytes of ObjectOutputStream . From it you can get a result in the form of a byte array. That in turn can be used with ByteArrayInputStream as input to an ObjectInput stream.

6. When a local object is serialized and passed as a parameter in a Java RMI call, are the bytecodes for the local object’s methods also passed? What about object coherency, if the remote VM application «keeps» the object handle?

There are no coherency guarantees for local objects passed to a remote VM since such objects are passed by copying their contents (a true pass-by-value).

7. How can I create an ObjectInputStream from an ObjectOutputStream without a file in between?

8. I create an object and then send it across the net using the writeObject method and receive it using the readObject method. If I then change the value of a field in the object and send it as before, the object that the readObject method returns appears to be the same as the first object and does not reflect the new value of the field. Should I be experiencing this behavior?

Alternatively, the ObjectOutputStream class implements a reset method that discards the memory of having sent an object, so sending an object again will make a copy.

9. Are there any plans to support the serialization of thread objects?

The difficulty with threads is that they have so much state which is intricately tied into the virtual machine that it is difficult or impossible to re-establish the context somewhere else. For example, saving the VM call stack is insufficient because if there were native methods that had called C procedures that in turn called code for the Java platform, there would be an incredible mix of Java programming language constructs and C pointers to deal with. Also, serializing the stack would imply serializing any object reachable from any stack variable.

If a thread were resumed in the same VM, it would be sharing a lot of state with the original thread, and would therefore fail in unpredictable ways if both threads were running at once, just like two C threads trying to share a stack. When deserialized in a separate VM, it’s hard to tell what might happen.

10. Can I compute diff(serial(x),serial(y))?

11. Can I compress the serial representation of my objects using my own zip and unzip methods?

12. Can I execute methods on compressed versions of my objects, for example isempty(zip(serial(x)))?

13. If I try to serialize a font or image object and then try to reconstitute it in a different VM, my application dies. Why?

14. How do I serialize a tree of objects?

Here’s a brief example that shows how to serialize a tree of objects.

Источник

Thanks for the reply — the second screenshot in my original post contains output from the log /var/log/vmware/applmgmt/

I have included some of the output that is generated when I attempt to update/stage or pre-check.

2019-06-14T13:48:54.310 [3524]DEBUG:vmware.appliance.update.update_b2b:List returns [{‘size’: 1893, ‘description’: {‘args’: [‘Patch for vCenter Server Appliance 6.7 with security fixes for PhotonOS’], ‘id’: ‘com.applmgmt.plain_message’, ‘default_message’: ‘Patch for vCenter Server Appliance 6.7 with security fixes for PhotonOS’}, ‘severity’: ‘CRITICAL’, ‘release_date’: ‘2019-05-30T00:00:00.000Z’, ‘reboot_required’: True, ‘version’: ‘6.7.0.31100’, ‘priority’: ‘LOW’, ‘update_type’: ‘FIX’}]

2019-06-14T13:48:54.314 [3524]INFO:twisted:»127.0.0.1″ — — [14/Jun/2019:13:48:53 +0000] «GET /rest/appliance/update/pending?source_type=LOCAL_AND_ONLINE HTTP/1.0» 200 398 «https://vcenter..org:5480/ui/update» «Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36»

2019-06-14T13:48:56.776 [3524]INFO:vmware.vherd.transport.ssh_access_collector:Feature switch: VCSA_SSH_ACCESS_EVENT disabled.

2019-06-14T13:49:00.418 [3524]DEBUG:vmware.vherd.transport.vapi:Only [] block []

2019-06-14T13:49:00.419 [3524]DEBUG:vmware.vherd.transport.vapi:State ‘UP_TO_DATE’

2019-06-14T13:49:00.421 [3524]DEBUG:vmware.appliance.health.impl:com.vmware.appliance.version1.system.time.get()

2019-06-14T13:49:00.425 [3524]INFO:twisted:»127.0.0.1″ — — [14/Jun/2019:13:48:59 +0000] «GET /rest/appliance/system/time HTTP/1.0» 200 106 «https://vcenter..org:5480/ui/update» «Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36»

2019-06-14T13:49:01.776 [3524]INFO:vmware.vherd.transport.ssh_access_collector:Feature switch: VCSA_SSH_ACCESS_EVENT disabled.

2019-06-14T13:49:06.776 [3524]INFO:vmware.vherd.transport.ssh_access_collector:Feature switch: VCSA_SSH_ACCESS_EVENT disabled.

2019-06-14T13:49:10.310 [3524]INFO:vmware.appliance.vapi.auth:Authorization request for service_id: com.vmware.appliance.update.pending, operation_id: get

2019-06-14T13:49:10.310 [3524]DEBUG:vmware.vherd.base.authorization_local:Verify privileges user (root) privilege [‘ModifyConfiguration’]

2019-06-14T13:49:10.310 [3524]DEBUG:root:Validated user privileges in localstore or SSO

2019-06-14T13:49:10.311 [3524]DEBUG:vmware.vherd.transport.vapi:Only [‘INSTALL_IN_PROGRESS’] block []

2019-06-14T13:49:10.311 [3524]DEBUG:vmware.vherd.transport.vapi:State ‘UP_TO_DATE’

2019-06-14T13:49:10.312 [3524]ERROR:vmware.appliance.update.update_functions:Can’t read JSON file /storage/core/software-update/stage/stageDir.json [Errno 2] No such file or directory: ‘/storage/core/software-update/stage/stageDir.json’

2019-06-14T13:49:10.312 [3524]DEBUG:vmware.appliance.update.update_b2b:staged discovery failed: FileNotFoundError(2, ‘No such file or directory’) ‘Traceback (most recent call last):n  File «/usr/lib/applmgmt/update/py/vmware/appliance/update/update_b2b.py», line 1101, in _discoverUpdateAtStageArean    stageDir = readJsonFile(stagePathFile)[‘StageDir’]n  File «/usr/lib/applmgmt/update/py/vmware/appliance/update/update_functions.py», line 212, in readJsonFilen    with open(filename) as f:nFileNotFoundError: [Errno 2] No such file or directory: ‘/storage/core/software-update/stage/stageDir.json’n’

2019-06-14T13:49:10.312 [3524]DEBUG:vmware.appliance.update.update_functions:/var/run/vmware/applmgmt directory created successfully

2019-06-14T13:49:10.312 [3524]DEBUG:vmware.appliance.update.update_functions:/mnt/iso-contents not mounted

2019-06-14T13:49:10.313 [3524]DEBUG:vmware.appliance.update.update_functions:/mnt/iso-contents directory created successfully

2019-06-14T13:49:10.313 [3524]DEBUG:vmware.appliance.update.update_functions:Running /bin/mount -o ro /dev/cdrom /mnt/iso-contents

2019-06-14T13:49:10.374 [3524]DEBUG:vmware.appliance.update.update_functions:runCommandAndCheckResult failed: Exception(‘mount failed for /dev/cdrom’, », ‘mount: no medium found on /dev/sr0n’)

2019-06-14T13:49:10.375 [3524]DEBUG:vmware.appliance.update.update_functions:(‘mount failed for /dev/cdrom’, », ‘mount: no medium found on /dev/sr0n’)

2019-06-14T13:49:10.385 [3524]INFO:vmware.appliance.update.update_functions:Update manifest found in None

2019-06-14T13:49:10.385 [3524]DEBUG:vmware.appliance.update.update_b2b:discoverUpdateAt: manifest:/mnt/iso-contents packages:/mnt/iso-contents copyfunc:<function copy at 0x7fb16db84158>

2019-06-14T13:49:10.386 [3524]DEBUG:vmware.appliance.update.update_functions:Can’t remove directory /storage/core/software-update/tmp: [Errno 2] No such file or directory: ‘/storage/core/software-update/tmp’

2019-06-14T13:49:10.386 [3524]DEBUG:vmware.appliance.update.update_functions:/storage/core/software-update/tmp directory created successfully

2019-06-14T13:49:10.386 [3524]DEBUG:vmware.appliance.update.update_functions:Can’t remove directory /storage/core/software-update/tmp/iso: [Errno 2] No such file or directory: ‘/storage/core/software-update/tmp/iso’

2019-06-14T13:49:10.386 [3524]DEBUG:vmware.appliance.update.update_functions:/storage/core/software-update/tmp/iso directory created successfully

2019-06-14T13:49:10.387 [3524]DEBUG:vmware.appliance.update.update_b2b:ISO discovery failed: RpmManifestNotFoundException() ‘Traceback (most recent call last):n  File «/usr/lib/applmgmt/update/py/vmware/appliance/update/update_b2b.py», line 989, in _discoverUpdateAtn    tempFolder)n  File «/usr/lib/python3.5/shutil.py», line 241, in copyn    copyfile(src, dst, follow_symlinks=follow_symlinks)n  File «/usr/lib/python3.5/shutil.py», line 120, in copyfilen    with open(src, ‘rb’) as fsrc:nFileNotFoundError: [Errno 2] No such file or directory: ‘/mnt/iso-contents/manifest-latest.xml’nnDuring handling of the above exception, another exception occurred:nnTraceback (most recent call last):n  File «/usr/lib/applmgmt/update/py/vmware/appliance/update/update_b2b.py», line 1126, in _discoverUpdateAtIson    _discoverUpdateAt(manifestDir, packagesDir, copyFileFunc, ‘iso’)n  File «/usr/lib/applmgmt/update/py/vmware/appliance/update/update_b2b.py», line 999, in _discoverUpdateAtn    raise RpmManifestNotFoundExceptionnvmware.appliance.update.update_b2b.RpmManifestNotFoundExceptionn’

2019-06-14T13:49:10.387 [3524]DEBUG:vmware.appliance.update.update_functions:/var/run/vmware/applmgmt directory created successfully

2019-06-14T13:49:10.388 [3524]DEBUG:vmware.appliance.update.update_functions:/mnt/iso-contents not mounted

2019-06-14T13:49:10.401 [3524]INFO:vmware.appliance.update.update_functions:ISO unmounted successfully

2019-06-14T13:49:10.401 [3524]DEBUG:vmware.appliance.update.update_b2b:discoverLocalUpdate failed.

Traceback (most recent call last):

  File «/usr/lib/applmgmt/update/py/vmware/appliance/update/update_b2b.py», line 989, in _discoverUpdateAt

    tempFolder)

  File «/usr/lib/python3.5/shutil.py», line 241, in copy

    copyfile(src, dst, follow_symlinks=follow_symlinks)

  File «/usr/lib/python3.5/shutil.py», line 120, in copyfile

    with open(src, ‘rb’) as fsrc:

FileNotFoundError: [Errno 2] No such file or directory: ‘/mnt/iso-contents/manifest-latest.xml’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  File «/usr/lib/applmgmt/update/py/vmware/appliance/update/update_b2b.py», line 1160, in discoverLocalUpdatesNoException

    _discoverLocalUpdates()

  File «/usr/lib/applmgmt/update/py/vmware/appliance/update/update_b2b.py», line 1152, in _discoverLocalUpdates

    _discoverUpdateAtIso()

  File «/usr/lib/applmgmt/update/py/vmware/appliance/update/update_b2b.py», line 1131, in _discoverUpdateAtIso

    raise e

  File «/usr/lib/applmgmt/update/py/vmware/appliance/update/update_b2b.py», line 1126, in _discoverUpdateAtIso

    _discoverUpdateAt(manifestDir, packagesDir, copyFileFunc, ‘iso’)

  File «/usr/lib/applmgmt/update/py/vmware/appliance/update/update_b2b.py», line 999, in _discoverUpdateAt

    raise RpmManifestNotFoundException

vmware.appliance.update.update_b2b.RpmManifestNotFoundException

2019-06-14T13:49:10.404 [3524]ERROR:vmware.appliance.update.update_functions:Can’t read JSON file /storage/core/software-update/stage/rpm-manifest.json [Errno 2] No such file or directory: ‘/storage/core/software-update/stage/rpm-manifest.json’

2019-06-14T13:49:10.404 [3524]ERROR:vmware.appliance.update.update_pending:Returning: {‘services_will_be_stopped’: [{‘description’: {‘args’: [‘vmware-pod’], ‘id’: ‘com.applmgmt.plain_message’, ‘default_message’: ‘vmware-pod’}, ‘service’: ‘vmware-pod’}, {‘description’: {‘args’: [‘vmware-sts-idmd’], ‘id’: ‘com.applmgmt.plain_message’, ‘default_message’: ‘vmware-sts-idmd’}, ‘service’: ‘vmware-sts-idmd’}, {‘description’: {‘args’: [‘vmware-cm’], ‘id’: ‘com.applmgmt.plain_message’, ‘default_message’: ‘vmware-cm’}, ‘service’: ‘vmware-cm’}, {‘description’: {‘args’: [‘vmware-stsd’], ‘id’: ‘com.applmgmt.plain_message’, ‘default_message’: ‘vmware-stsd’}, ‘service’: ‘vmware-stsd’}, {‘description’: {‘args’: [‘vmware-rhttpproxy’], ‘id’: ‘com.applmgmt.plain_message’, ‘default_message’: ‘vmware-rhttpproxy’}, ‘service’: ‘vmware-rhttpproxy’}, {‘description’: {‘args’: [‘vmware-cis-license’], ‘id’: ‘com.applmgmt.plain_message’, ‘default_message’: ‘vmware-cis-license’}, ‘service’: ‘vmware-cis-license’}, {‘description’: {‘args’: [‘vmware-sca’], ‘id’: ‘com.applmgmt.plain_message’, ‘default_message’: ‘vmware-sca’}, ‘service’: ‘vmware-sca’}, {‘description’: {‘args’: [‘vmware-updatemgr’], ‘id’: ‘com.applmgmt.plain_message’, ‘default_message’: ‘vmware-updatemgr’}, ‘service’: ‘vmware-updatemgr’}, {‘description’: {‘args’: [‘vsphere-client’], ‘id’: ‘com.applmgmt.plain_message’, ‘default_message’: ‘vsphere-client’}, ‘service’: ‘vsphere-client’}, {‘description’: {‘args’: [‘pschealth’], ‘id’: ‘com.applmgmt.plain_message’, ‘default_message’: ‘pschealth’}, ‘service’: ‘pschealth’}, {‘description’: {‘args’: [‘vmonapi’], ‘id’: ‘com.applmgmt.plain_message’, ‘default_message’: ‘vmonapi’}, ‘service’: ‘vmonapi’}, {‘description’: {‘args’: [‘vmware-topologysvc’], ‘id’: ‘com.applmgmt.plain_message’, ‘default_message’: ‘vmware-topologysvc’}, ‘service’: ‘vmware-topologysvc’}, {‘description’: {‘args’: [‘vmafdd’], ‘id’: ‘com.applmgmt.plain_message’, ‘default_message’: ‘vmafdd’}, ‘service’: ‘vmafdd’}, {‘description’: {‘args’: [‘vmware-content-library’], ‘id’: ‘com.applmgmt.plain_message’, ‘default_message’: ‘vmware-content-library’}, ‘service’: ‘vmware-content-library’}, {‘description’: {‘args’: [‘vmware-vpostgres’], ‘id’: ‘com.applmgmt.plain_message’, ‘default_message’: ‘vmware-vpostgres’}, ‘service’: ‘vmware-vpostgres’}, {‘description’: {‘args’: [‘applmgmt’], ‘id’: ‘com.applmgmt.plain_message’, ‘default_message’: ‘applmgmt’}, ‘service’: ‘applmgmt’}, {‘description’: {‘args’: [‘vsphere-ui’], ‘id’: ‘com.applmgmt.plain_message’, ‘default_message’: ‘vsphere-ui’}, ‘service’: ‘vsphere-ui’}, {‘description’: {‘args’: [‘vmdnsd’], ‘id’: ‘com.applmgmt.plain_message’, ‘default_message’: ‘vmdnsd’}, ‘service’: ‘vmdnsd’}, {‘description’: {‘args’: [‘vmware-perfcharts’], ‘id’: ‘com.applmgmt.plain_message’, ‘default_message’: ‘vmware-perfcharts’}, ‘service’: ‘vmware-perfcharts’}, {‘description’: {‘args’: [‘vmware-vmon’], ‘id’: ‘com.applmgmt.plain_message’, ‘default_message’: ‘vmware-vmon’}, ‘service’: ‘vmware-vmon’}, {‘description’: {‘args’: [‘vmware-certificatemanagement’], ‘id’: ‘com.applmgmt.plain_message’, ‘default_message’: ‘vmware-certificatemanagement’}, ‘service’: ‘vmware-certificatemanagement’}, {‘description’: {‘args’: [‘vmware-sps’], ‘id’: ‘com.applmgmt.plain_message’, ‘default_message’: ‘vmware-sps’}, ‘service’: ‘vmware-sps’}, {‘description’: {‘args’: [‘vmware-vpxd-svcs’], ‘id’: ‘com.applmgmt.plain_message’, ‘default_message’: ‘vmware-vpxd-svcs’}, ‘service’: ‘vmware-vpxd-svcs’}, {‘description’: {‘args’: [‘vmware-vapi-endpoint’], ‘id’: ‘com.applmgmt.plain_message’, ‘default_message’: ‘vmware-vapi-endpoint’}, ‘service’: ‘vmware-vapi-endpoint’}, {‘description’: {‘args’: [‘lwsmd’], ‘id’: ‘com.applmgmt.plain_message’, ‘default_message’: ‘lwsmd’}, ‘service’: ‘lwsmd’}, {‘description’: {‘args’: [‘vmware-eam’], ‘id’: ‘com.applmgmt.plain_message’, ‘default_message’: ‘vmware-eam’}, ‘service’: ‘vmware-eam’}, {‘description’: {‘args’: [‘vmware-vpxd’], ‘id’: ‘com.applmgmt.plain_message’, ‘default_message’: ‘vmware-vpxd’}, ‘service’: ‘vmware-vpxd’}, {‘description’: {‘args’: [‘vmware-statsmonitor’], ‘id’: ‘com.applmgmt.plain_message’, ‘default_message’: ‘vmware-statsmonitor’}, ‘service’: ‘vmware-statsmonitor’}, {‘description’: {‘args’: [‘vmware-vsm’], ‘id’: ‘com.applmgmt.plain_message’, ‘default_message’: ‘vmware-vsm’}, ‘service’: ‘vmware-vsm’}, {‘description’: {‘args’: [‘vmcad’], ‘id’: ‘com.applmgmt.plain_message’, ‘default_message’: ‘vmcad’}, ‘service’: ‘vmcad’}, {‘description’: {‘args’: [‘vmware-analytics’], ‘id’: ‘com.applmgmt.plain_message’, ‘default_message’: ‘vmware-analytics’}, ‘service’: ‘vmware-analytics’}, {‘description’: {‘args’: [‘vmware-postgres-archiver’], ‘id’: ‘com.applmgmt.plain_message’, ‘default_message’: ‘vmware-postgres-archiver’}, ‘service’: ‘vmware-postgres-archiver’}, {‘description’: {‘args’: [‘vmware-vsan-health’], ‘id’: ‘com.applmgmt.plain_message’, ‘default_message’: ‘vmware-vsan-health’}, ‘service’: ‘vmware-vsan-health’}, {‘description’: {‘args’: [‘vmdird’], ‘id’: ‘com.applmgmt.plain_message’, ‘default_message’: ‘vmdird’}, ‘service’: ‘vmdird’}], ‘contents’: [], ‘priority’: ‘LOW’, ‘size’: 1893, ‘description’: {‘args’: [‘Patch for vCenter Server Appliance 6.7 with security fixes for PhotonOS’], ‘id’: ‘com.applmgmt.plain_message’, ‘default_message’: ‘Patch for vCenter Server Appliance 6.7 with security fixes for PhotonOS’}, ‘severity’: ‘CRITICAL’, ‘eulas’: [{‘args’: [], ‘id’: ‘patch.plain.message’, ‘default_message’: ‘nnVMWARE END USER LICENSE AGREEMEN’}], ‘release_date’: ‘2019-05-30T00:00:00.000Z’, ‘reboot_required’: True, ‘version’: ‘6.7.0.31100’, ‘staged’: False, ‘update_type’: ‘FIX’}

2019-06-14T13:49:10.417 [3524]INFO:twisted:»127.0.0.1″ — — [14/Jun/2019:13:49:09 +0000] «GET /rest/appliance/update/pending/6.7.0.31100 HTTP/1.0» 200 36152 «https://vcenter..org:5480/ui/update» «Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36»

2019-06-14T13:49:11.481 [3524]INFO:vmware.appliance.vapi.auth:Authorization request for service_id: com.vmware.appliance.update.pending, operation_id: precheck

2019-06-14T13:49:11.481 [3524]DEBUG:vmware.vherd.base.authorization_local:Verify privileges user (root) privilege [‘ModifyConfiguration’]

2019-06-14T13:49:11.481 [3524]DEBUG:root:Validated user privileges in localstore or SSO

2019-06-14T13:49:11.482 [3524]DEBUG:vmware.vherd.transport.vapi:Only [‘INSTALL_IN_PROGRESS’] block []

2019-06-14T13:49:11.482 [3524]DEBUG:vmware.vherd.transport.vapi:State ‘UP_TO_DATE’

2019-06-14T13:49:11.483 [3524]ERROR:vmware.appliance.update.update_functions:Can’t read JSON file /storage/core/software-update/stage/stageDir.json [Errno 2] No such file or directory: ‘/storage/core/software-update/stage/stageDir.json’

2019-06-14T13:49:11.483 [3524]DEBUG:vmware.appliance.update.update_b2b:staged discovery failed: FileNotFoundError(2, ‘No such file or directory’) ‘Traceback (most recent call last):n  File «/usr/lib/applmgmt/update/py/vmware/appliance/update/update_b2b.py», line 1101, in _discoverUpdateAtStageArean    stageDir = readJsonFile(stagePathFile)[‘StageDir’]n  File «/usr/lib/applmgmt/update/py/vmware/appliance/update/update_functions.py», line 212, in readJsonFilen    with open(filename) as f:nFileNotFoundError: [Errno 2] No such file or directory: ‘/storage/core/software-update/stage/stageDir.json’n’

2019-06-14T13:49:11.483 [3524]DEBUG:vmware.appliance.update.update_functions:/var/run/vmware/applmgmt directory created successfully

2019-06-14T13:49:11.483 [3524]DEBUG:vmware.appliance.update.update_functions:/mnt/iso-contents not mounted

2019-06-14T13:49:11.488 [3524]DEBUG:vmware.appliance.update.update_functions:/mnt/iso-contents directory created successfully

2019-06-14T13:49:11.489 [3524]DEBUG:vmware.appliance.update.update_functions:Running /bin/mount -o ro /dev/cdrom /mnt/iso-contents

2019-06-14T13:49:11.550 [3524]DEBUG:vmware.appliance.update.update_functions:runCommandAndCheckResult failed: Exception(‘mount failed for /dev/cdrom’, », ‘mount: no medium found on /dev/sr0n’)

2019-06-14T13:49:11.551 [3524]DEBUG:vmware.appliance.update.update_functions:(‘mount failed for /dev/cdrom’, », ‘mount: no medium found on /dev/sr0n’)

2019-06-14T13:49:11.561 [3524]INFO:vmware.appliance.update.update_functions:Update manifest found in None

2019-06-14T13:49:11.561 [3524]DEBUG:vmware.appliance.update.update_b2b:discoverUpdateAt: manifest:/mnt/iso-contents packages:/mnt/iso-contents copyfunc:<function copy at 0x7fb16db84158>

2019-06-14T13:49:11.562 [3524]DEBUG:vmware.appliance.update.update_functions:/storage/core/software-update/tmp/iso directory created successfully

2019-06-14T13:49:11.562 [3524]DEBUG:vmware.appliance.update.update_b2b:ISO discovery failed: RpmManifestNotFoundException() ‘Traceback (most recent call last):n  File «/usr/lib/applmgmt/update/py/vmware/appliance/update/update_b2b.py», line 989, in _discoverUpdateAtn    tempFolder)n  File «/usr/lib/python3.5/shutil.py», line 241, in copyn    copyfile(src, dst, follow_symlinks=follow_symlinks)n  File «/usr/lib/python3.5/shutil.py», line 120, in copyfilen    with open(src, ‘rb’) as fsrc:nFileNotFoundError: [Errno 2] No such file or directory: ‘/mnt/iso-contents/manifest-latest.xml’nnDuring handling of the above exception, another exception occurred:nnTraceback (most recent call last):n  File «/usr/lib/applmgmt/update/py/vmware/appliance/update/update_b2b.py», line 1126, in _discoverUpdateAtIson    _discoverUpdateAt(manifestDir, packagesDir, copyFileFunc, ‘iso’)n  File «/usr/lib/applmgmt/update/py/vmware/appliance/update/update_b2b.py», line 999, in _discoverUpdateAtn    raise RpmManifestNotFoundExceptionnvmware.appliance.update.update_b2b.RpmManifestNotFoundExceptionn’

2019-06-14T13:49:11.563 [3524]DEBUG:vmware.appliance.update.update_functions:/var/run/vmware/applmgmt directory created successfully

2019-06-14T13:49:11.563 [3524]DEBUG:vmware.appliance.update.update_functions:/mnt/iso-contents not mounted

2019-06-14T13:49:11.577 [3524]INFO:vmware.appliance.update.update_functions:ISO unmounted successfully

2019-06-14T13:49:11.577 [3524]DEBUG:vmware.appliance.update.update_b2b:discoverLocalUpdate failed.

Traceback (most recent call last):

  File «/usr/lib/applmgmt/update/py/vmware/appliance/update/update_b2b.py», line 989, in _discoverUpdateAt

    tempFolder)

  File «/usr/lib/python3.5/shutil.py», line 241, in copy

    copyfile(src, dst, follow_symlinks=follow_symlinks)

  File «/usr/lib/python3.5/shutil.py», line 120, in copyfile

    with open(src, ‘rb’) as fsrc:

FileNotFoundError: [Errno 2] No such file or directory: ‘/mnt/iso-contents/manifest-latest.xml’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  File «/usr/lib/applmgmt/update/py/vmware/appliance/update/update_b2b.py», line 1160, in discoverLocalUpdatesNoException

    _discoverLocalUpdates()

  File «/usr/lib/applmgmt/update/py/vmware/appliance/update/update_b2b.py», line 1152, in _discoverLocalUpdates

    _discoverUpdateAtIso()

  File «/usr/lib/applmgmt/update/py/vmware/appliance/update/update_b2b.py», line 1131, in _discoverUpdateAtIso

    raise e

  File «/usr/lib/applmgmt/update/py/vmware/appliance/update/update_b2b.py», line 1126, in _discoverUpdateAtIso

    _discoverUpdateAt(manifestDir, packagesDir, copyFileFunc, ‘iso’)

  File «/usr/lib/applmgmt/update/py/vmware/appliance/update/update_b2b.py», line 999, in _discoverUpdateAt

    raise RpmManifestNotFoundException

vmware.appliance.update.update_b2b.RpmManifestNotFoundException

2019-06-14T13:49:11.585 [3524]DEBUG:vmware.appliance.update.ms_connector:sending message

2019-06-14T13:49:11.585 [3524]DEBUG:vmware.appliance.update.update_functions:Exception happens while sending message to microservice: FileNotFoundError(2, ‘No such file or directory’)

2019-06-14T13:49:11.776 [3524]INFO:vmware.vherd.transport.ssh_access_collector:Feature switch: VCSA_SSH_ACCESS_EVENT disabled.

2019-06-14T13:49:12.327 [3524]INFO:twisted:»127.0.0.1″ — — [14/Jun/2019:13:49:11 +0000] «POST /api HTTP/1.1» 200 332 «-» «vAPI/2.100.0 Java/1.8.0_202 (Linux; 4.4.171-1.ph1; amd64)»

2019-06-14T13:49:12.474 [3524]DEBUG:vmware.appliance.extensions.authentication.authentication_sso:isExpired, notBefore: None, notOnOrAfter: None, now: 2019-06-14 13:49:12.474764, tolerance: 600

2019-06-14T13:49:12.474 [3524]DEBUG:vmware.appliance.extensions.authentication.authentication_sso:isExpired, notBefore: 2019-06-14T13:49:12.411Z, notOnOrAfter: 2019-06-14T13:59:12.411Z, now: 2019-06-14 13:49:12.474972, tolerance: 600

2019-06-14T13:49:12.475 [3524]INFO:vmware.appliance.vapi.auth:Authorization request for service_id: com.vmware.appliance.networking.proxy, operation_id: get

2019-06-14T13:49:12.475 [3524]DEBUG:vmware.appliance.extensions.authorization.authorization_sso:Required privileges = [‘ViewConfiguration’]

2019-06-14T13:49:12.586 [3524]DEBUG:vmware.appliance.update.update_functions:Exception happens while sending message to microservice: FileNotFoundError(2, ‘No such file or directory’)

2019-06-14T13:49:12.604 [3524]DEBUG:vmware.appliance.extensions.authorization.authorization_sso:User=vmware..orgvsphere-webclient-fe7cb739-c8ac-4b06-9ade-c107cf1f2077, groups={‘vmware..org\LicenseService.Administrators’, ‘vmware..org\SystemConfiguration.Administrators’, ‘vmware..org\Everyone’, ‘vmware..org\SolutionUsers’, ‘vmware..org\Administrators’, ‘vmware..org\ActAsUsers’}

2019-06-14T13:49:12.604 [3524]DEBUG:root:Validated user privileges in localstore or SSO

2019-06-14T13:49:12.605 [3524]DEBUG:vmware.vherd.transport.vapi:Only [] block []

2019-06-14T13:49:12.605 [3524]DEBUG:vmware.vherd.transport.vapi:State ‘UP_TO_DATE’

2019-06-14T13:49:12.606 [3524]DEBUG:vmware.appliance.networking.proxy.proxy_impl:method=get, protocol=http

2019-06-14T13:49:12.609 [3524]INFO:twisted:»127.0.0.1″ — — [14/Jun/2019:13:49:11 +0000] «POST /api HTTP/1.1» 200 242 «-» «vAPI/2.100.0 Java/1.8.0_202 (Linux; 4.4.171-1.ph1; amd64)»

2019-06-14T13:49:13.587 [3524]DEBUG:vmware.appliance.update.update_functions:Exception happens while sending message to microservice: FileNotFoundError(2, ‘No such file or directory’)

2019-06-14T13:49:14.589 [3524]DEBUG:vmware.appliance.update.update_functions:Exception happens while sending message to microservice: FileNotFoundError(2, ‘No such file or directory’)

2019-06-14T13:49:15.591 [3524]DEBUG:vmware.appliance.update.update_functions:Exception happens while sending message to microservice: FileNotFoundError(2, ‘No such file or directory’)

2019-06-14T13:49:16.592 [3524]DEBUG:vmware.appliance.update.update_functions:Exception happens while sending message to microservice: FileNotFoundError(2, ‘No such file or directory’)

2019-06-14T13:49:16.593 [3524]INFO:vmware.appliance.update.update_functions:Timeout happens while sending message to microservice

2019-06-14T13:49:16.593 [3524]ERROR:vmware.vapi.provider.local:Error in invoking com.vmware.appliance.update.pending in precheck — Timeout happens while sending message to microservice

Traceback (most recent call last):

  File «/usr/lib/vmware-vapi/lib/python/vapi_runtime-2.100.0-py2.py3-none-any.whl/vmware/vapi/provider/local.py», line 277, in invoke

    service_id, operation_id, input_value, ctx)

  File «/usr/lib/vmware-vapi/lib/python/vapi_runtime-2.100.0-py2.py3-none-any.whl/vmware/vapi/provider/local.py», line 248, in _invoke_int

    method_result = iface.invoke(ctx, method_id, input_value)

  File «/usr/lib/vmware-vapi/lib/python/vapi_runtime-2.100.0-py2.py3-none-any.whl/vmware/vapi/bindings/skeleton.py», line 365, in invoke

    meth_output = method(**meth_args)

  File «/usr/lib/applmgmt/vapi/py/vmware/appliance/vapi/update_impl.py», line 159, in precheck

    return worker.precheck(version)

  File «/usr/lib/applmgmt/update/py/vmware/appliance/update/update_pending.py», line 105, in precheck

    MicroserviceConnector.execute(request)

  File «/usr/lib/applmgmt/update/py/vmware/appliance/update/ms_connector.py», line 128, in execute

    Exception, 1, 5)

  File «/usr/lib/applmgmt/update/py/vmware/appliance/update/update_functions.py», line 373, in executeFunctionUntilSuccessOrTimeout

    raise Exception(«Timeout happens while » + ingDescription)

Exception: Timeout happens while sending message to microservice

2019-06-14T13:49:16.597 [3524]INFO:twisted:»127.0.0.1″ — — [14/Jun/2019:13:49:15 +0000] «POST /rest/appliance/update/pending/6.7.0.31100?action=precheck HTTP/1.0» 500 218 «https://vcenter..org:5480/ui/update» «Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36»

2019-06-14T13:49:16.775 [3524]INFO:vmware.vherd.transport.ssh_access_collector:Feature switch: VCSA_SSH_ACCESS_EVENT disabled.

2019-06-14T13:49:21.776 [3524]INFO:vmware.vherd.transport.ssh_access_collector:Feature switch: VCSA_SSH_ACCESS_EVENT disabled.

2019-06-14T13:49:26.776 [3524]INFO:vmware.vherd.transport.ssh_access_collector:Feature switch: VCSA_SSH_ACCESS_EVENT disabled.

2019-06-14T13:49:29.359 [3524]INFO:vmware.appliance.vapi.auth:Authorization request for service_id: com.vmware.appliance.update.pending, operation_id: stage

2019-06-14T13:49:29.360 [3524]DEBUG:vmware.vherd.base.authorization_local:Verify privileges user (root) privilege [‘ModifyConfiguration’]

2019-06-14T13:49:29.361 [3524]DEBUG:root:Validated user privileges in localstore or SSO

2019-06-14T13:49:29.361 [3524]DEBUG:vmware.vherd.transport.vapi:Only [‘INSTALL_IN_PROGRESS’] block []

2019-06-14T13:49:29.362 [3524]DEBUG:vmware.vherd.transport.vapi:State ‘UP_TO_DATE’

2019-06-14T13:49:29.363 [3524]ERROR:vmware.appliance.update.update_functions:Can’t read JSON file /storage/core/software-update/stage/stageDir.json [Errno 2] No such file or directory: ‘/storage/core/software-update/stage/stageDir.json’

2019-06-14T13:49:29.363 [3524]DEBUG:vmware.appliance.update.update_b2b:staged discovery failed: FileNotFoundError(2, ‘No such file or directory’) ‘Traceback (most recent call last):n  File «/usr/lib/applmgmt/update/py/vmware/appliance/update/update_b2b.py», line 1101, in _discoverUpdateAtStageArean    stageDir = readJsonFile(stagePathFile)[‘StageDir’]n  File «/usr/lib/applmgmt/update/py/vmware/appliance/update/update_functions.py», line 212, in readJsonFilen    with open(filename) as f:nFileNotFoundError: [Errno 2] No such file or directory: ‘/storage/core/software-update/stage/stageDir.json’n’

2019-06-14T13:49:29.363 [3524]DEBUG:vmware.appliance.update.update_functions:/var/run/vmware/applmgmt directory created successfully

2019-06-14T13:49:29.364 [3524]DEBUG:vmware.appliance.update.update_functions:/mnt/iso-contents not mounted

2019-06-14T13:49:29.373 [3524]DEBUG:vmware.appliance.update.update_functions:/mnt/iso-contents directory created successfully

2019-06-14T13:49:29.375 [3524]DEBUG:vmware.appliance.update.update_functions:Running /bin/mount -o ro /dev/cdrom /mnt/iso-contents

2019-06-14T13:49:29.434 [3524]DEBUG:vmware.appliance.update.update_functions:runCommandAndCheckResult failed: Exception(‘mount failed for /dev/cdrom’, », ‘mount: no medium found on /dev/sr0n’)

2019-06-14T13:49:29.435 [3524]DEBUG:vmware.appliance.update.update_functions:(‘mount failed for /dev/cdrom’, », ‘mount: no medium found on /dev/sr0n’)

2019-06-14T13:49:29.445 [3524]INFO:vmware.appliance.update.update_functions:Update manifest found in None

2019-06-14T13:49:29.445 [3524]DEBUG:vmware.appliance.update.update_b2b:discoverUpdateAt: manifest:/mnt/iso-contents packages:/mnt/iso-contents copyfunc:<function copy at 0x7fb16db84158>

2019-06-14T13:49:29.446 [3524]DEBUG:vmware.appliance.update.update_functions:/storage/core/software-update/tmp/iso directory created successfully

2019-06-14T13:49:29.447 [3524]DEBUG:vmware.appliance.update.update_b2b:ISO discovery failed: RpmManifestNotFoundException() ‘Traceback (most recent call last):n  File «/usr/lib/applmgmt/update/py/vmware/appliance/update/update_b2b.py», line 989, in _discoverUpdateAtn    tempFolder)n  File «/usr/lib/python3.5/shutil.py», line 241, in copyn    copyfile(src, dst, follow_symlinks=follow_symlinks)n  File «/usr/lib/python3.5/shutil.py», line 120, in copyfilen    with open(src, ‘rb’) as fsrc:nFileNotFoundError: [Errno 2] No such file or directory: ‘/mnt/iso-contents/manifest-latest.xml’nnDuring handling of the above exception, another exception occurred:nnTraceback (most recent call last):n  File «/usr/lib/applmgmt/update/py/vmware/appliance/update/update_b2b.py», line 1126, in _discoverUpdateAtIson    _discoverUpdateAt(manifestDir, packagesDir, copyFileFunc, ‘iso’)n  File «/usr/lib/applmgmt/update/py/vmware/appliance/update/update_b2b.py», line 999, in _discoverUpdateAtn    raise RpmManifestNotFoundExceptionnvmware.appliance.update.update_b2b.RpmManifestNotFoundExceptionn’

2019-06-14T13:49:29.447 [3524]DEBUG:vmware.appliance.update.update_functions:/var/run/vmware/applmgmt directory created successfully

2019-06-14T13:49:29.448 [3524]DEBUG:vmware.appliance.update.update_functions:/mnt/iso-contents not mounted

2019-06-14T13:49:29.461 [3524]INFO:vmware.appliance.update.update_functions:ISO unmounted successfully

2019-06-14T13:49:29.461 [3524]DEBUG:vmware.appliance.update.update_b2b:discoverLocalUpdate failed.

Traceback (most recent call last):

  File «/usr/lib/applmgmt/update/py/vmware/appliance/update/update_b2b.py», line 989, in _discoverUpdateAt

    tempFolder)

  File «/usr/lib/python3.5/shutil.py», line 241, in copy

    copyfile(src, dst, follow_symlinks=follow_symlinks)

  File «/usr/lib/python3.5/shutil.py», line 120, in copyfile

    with open(src, ‘rb’) as fsrc:

FileNotFoundError: [Errno 2] No such file or directory: ‘/mnt/iso-contents/manifest-latest.xml’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  File «/usr/lib/applmgmt/update/py/vmware/appliance/update/update_b2b.py», line 1160, in discoverLocalUpdatesNoException

    _discoverLocalUpdates()

  File «/usr/lib/applmgmt/update/py/vmware/appliance/update/update_b2b.py», line 1152, in _discoverLocalUpdates

    _discoverUpdateAtIso()

  File «/usr/lib/applmgmt/update/py/vmware/appliance/update/update_b2b.py», line 1131, in _discoverUpdateAtIso

    raise e

  File «/usr/lib/applmgmt/update/py/vmware/appliance/update/update_b2b.py», line 1126, in _discoverUpdateAtIso

    _discoverUpdateAt(manifestDir, packagesDir, copyFileFunc, ‘iso’)

  File «/usr/lib/applmgmt/update/py/vmware/appliance/update/update_b2b.py», line 999, in _discoverUpdateAt

    raise RpmManifestNotFoundException

vmware.appliance.update.update_b2b.RpmManifestNotFoundException

2019-06-14T13:49:29.462 [3524]INFO:vmware.appliance.update.update_pending:Running stage in microservice

2019-06-14T13:49:29.463 [3524]DEBUG:vmware.appliance.update.ms_connector:sending message

2019-06-14T13:49:29.463 [3524]DEBUG:vmware.appliance.update.update_functions:Exception happens while sending message to microservice: FileNotFoundError(2, ‘No such file or directory’)

2019-06-14T13:49:30.465 [3524]DEBUG:vmware.appliance.update.update_functions:Exception happens while sending message to microservice: FileNotFoundError(2, ‘No such file or directory’)

2019-06-14T13:49:31.466 [3524]DEBUG:vmware.appliance.update.update_functions:Exception happens while sending message to microservice: FileNotFoundError(2, ‘No such file or directory’)

2019-06-14T13:49:31.776 [3524]INFO:vmware.vherd.transport.ssh_access_collector:Feature switch: VCSA_SSH_ACCESS_EVENT disabled.

2019-06-14T13:49:32.468 [3524]DEBUG:vmware.appliance.update.update_functions:Exception happens while sending message to microservice: FileNotFoundError(2, ‘No such file or directory’)

2019-06-14T13:49:33.470 [3524]DEBUG:vmware.appliance.update.update_functions:Exception happens while sending message to microservice: FileNotFoundError(2, ‘No such file or directory’)

2019-06-14T13:49:34.472 [3524]DEBUG:vmware.appliance.update.update_functions:Exception happens while sending message to microservice: FileNotFoundError(2, ‘No such file or directory’)

2019-06-14T13:49:34.472 [3524]INFO:vmware.appliance.update.update_functions:Timeout happens while sending message to microservice

2019-06-14T13:49:34.472 [3524]ERROR:vmware.vapi.provider.local:Error in invoking com.vmware.appliance.update.pending in stage — Timeout happens while sending message to microservice

Traceback (most recent call last):

  File «/usr/lib/vmware-vapi/lib/python/vapi_runtime-2.100.0-py2.py3-none-any.whl/vmware/vapi/provider/local.py», line 277, in invoke

    service_id, operation_id, input_value, ctx)

  File «/usr/lib/vmware-vapi/lib/python/vapi_runtime-2.100.0-py2.py3-none-any.whl/vmware/vapi/provider/local.py», line 248, in _invoke_int

    method_result = iface.invoke(ctx, method_id, input_value)

  File «/usr/lib/vmware-vapi/lib/python/vapi_runtime-2.100.0-py2.py3-none-any.whl/vmware/vapi/bindings/skeleton.py», line 365, in invoke

    meth_output = method(**meth_args)

  File «/usr/lib/applmgmt/vapi/py/vmware/appliance/vapi/update_impl.py», line 190, in stage

    return worker.stage(version)

  File «/usr/lib/applmgmt/update/py/vmware/appliance/update/update_pending.py», line 133, in stage

    request)

  File «/usr/lib/applmgmt/base/py/vmware/vherd/base/decorators.py», line 35, in wrapper

    result = fn(*args, **kwargs)

  File «/usr/lib/applmgmt/update/py/vmware/appliance/update/update_state.py», line 183, in change

    State._change(newState, allowedStates, taskSpec)

  File «/usr/lib/applmgmt/update/py/vmware/appliance/update/update_state.py», line 167, in _change

    MicroserviceConnector.execute(taskSpec)

  File «/usr/lib/applmgmt/update/py/vmware/appliance/update/ms_connector.py», line 128, in execute

    Exception, 1, 5)

  File «/usr/lib/applmgmt/update/py/vmware/appliance/update/update_functions.py», line 373, in executeFunctionUntilSuccessOrTimeout

    raise Exception(«Timeout happens while » + ingDescription)

Exception: Timeout happens while sending message to microservice

2019-06-14T13:49:34.478 [3524]INFO:twisted:»127.0.0.1″ — — [14/Jun/2019:13:49:33 +0000] «POST /rest/appliance/update/pending/6.7.0.31100?action=stage HTTP/1.0» 500 218 «https://vcenter..org:5480/ui/update» «Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36»

root@vcenter [ /var/log/vmware/applmgmt ]# exit

Powershell

#Identify mobile devices being used
$csv = "C:dsvBSBBSB-MobileDevices.csv"
$mailboxUsers = Get-Mailbox -Filter {CustomAttribute1 -eq "BSB"} -resultsize unlimited
$mobileDevice = @()
 
foreach($user in $mailboxUsers)
{
$UPN = $user.UserPrincipalName
$displayName = $user.DisplayName
 
$mobileDevices = Get-MobileDevice -Mailbox $UPN
       
      foreach($mobileDevice in $mobileDevices)
      {
          Write-Output "Getting info about a device for $displayName"
          $properties = @{
          Name = $user.name
          UPN = $UPN
          DisplayName = $displayName
          FriendlyName = $mobileDevice.FriendlyName
          ClientType = $mobileDevice.ClientType
          ClientVersion = $mobileDevice.ClientVersion
          DeviceId = $mobileDevice.DeviceId
          DeviceMobileOperator = $mobileDevice.DeviceMobileOperator
          DeviceModel = $mobileDevice.DeviceModel
          DeviceOS = $mobileDevice.DeviceOS
          DeviceTelephoneNumber = $mobileDevice.DeviceTelephoneNumber
          DeviceType = $mobileDevice.DeviceType
          FirstSyncTime = $mobileDevice.FirstSyncTime
          UserDisplayName = $mobileDevice.UserDisplayName
          }
          $results += New-Object psobject -Property $properties
      }
}
 
$results | Select-Object Name,UPN,FriendlyName,DisplayName,ClientType,ClientVersion,DeviceId,DeviceMobileOperator,DeviceModel,DeviceOS,DeviceTelephoneNumber,DeviceType,FirstSyncTime,UserDisplayName | Export-Csv -notypeinformation -Path $csv

I get this error when running the above. 

Method invocation failed because [System.Management.Automation.PSObject] does not contain a method named ‘op_Addition’.
At line:32 char:11
+         $results += New-Object psobject -Property $properties
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo         : InvalidOperation: (op_Addition:String) [], RuntimeException
    + FullyQualifiedErrorId : MethodNotFound

How can I fix this?

Thanks

check
Best Answer

  • Author Alex Wittig

    Neally


    This person is a Verified Professional

    This person is a verified professional.

    Verify your account
    to enable IT peers to see that you are a professional.

    pure capsaicin

    PowerShell Expert

    • check
      1321
      Best Answers
    • thumb_up
      3014
      Helpful Votes

    because of this:

    Powershell

    $results += New-Object psobject -Property $properties
    

    use an arraylist instead

    Powershell

    #Identify mobile devices being used
    $csv = "C:dsvBSBBSB-MobileDevices.csv"
    $mailboxUsers = Get-Mailbox -Filter {CustomAttribute1 -eq "BSB"} -resultsize unlimited
    $mobileDevice = @()
    $results = New-Object System.Collections.ArrayList
     
    foreach ($user in $mailboxUsers) {
        $UPN = $user.UserPrincipalName
        $displayName = $user.DisplayName
     
        $mobileDevices = Get-MobileDevice -Mailbox $UPN
           
        foreach ($mobileDevice in $mobileDevices) {
            Write-Output "Getting info about a device for $displayName"
            $properties = @{
                Name                  = $user.name
                UPN                   = $UPN
                DisplayName           = $displayName
                FriendlyName          = $mobileDevice.FriendlyName
                ClientType            = $mobileDevice.ClientType
                ClientVersion         = $mobileDevice.ClientVersion
                DeviceId              = $mobileDevice.DeviceId
                DeviceMobileOperator  = $mobileDevice.DeviceMobileOperator
                DeviceModel           = $mobileDevice.DeviceModel
                DeviceOS              = $mobileDevice.DeviceOS
                DeviceTelephoneNumber = $mobileDevice.DeviceTelephoneNumber
                DeviceType            = $mobileDevice.DeviceType
                FirstSyncTime         = $mobileDevice.FirstSyncTime
                UserDisplayName       = $mobileDevice.UserDisplayName
            }
            $results.add( (New-Object psobject -Property $properties) )
        }
    }
     
    $results | Select-Object Name, UPN, FriendlyName, DisplayName, ClientType, ClientVersion, DeviceId, DeviceMobileOperator, DeviceModel, DeviceOS, DeviceTelephoneNumber, DeviceType, FirstSyncTime, UserDisplayName | Export-Csv -notypeinformation -Path $csv
    


    1 found this helpful
    thumb_up
    thumb_down

  • View Best Answer in replies below

    Read these next…

    • Curated Snap! -- No-Password Logins, Solar Powered Water Filter, Glitch in the Matrix?

      Snap! — No-Password Logins, Solar Powered Water Filter, Glitch in the Matrix?

      Spiceworks Originals

      Your daily dose of tech news, in brief.

      Welcome to the Snap!

      Flashback: February 9, 1996: Introduction of the Bandai Pippin (Read more HERE.)

      Bonus Flashback: February 9, 1990: Galileo Probe does a Venus Flyby (Read more HERE.)

      You nee…

    • Curated Roku TV being used as Wallboard Issues

      Roku TV being used as Wallboard Issues

      Hardware

      Helping someone out at their shop. They have 4 large Roku screens and 2 laptops with dual HDMI ports for video. They are viewing static website business dashboards and PowerPoint. At first all 4 screens connected to wireless, worked for a while but with a…

    • Curated Charging for SSO

      Charging for SSO

      Security

      We have SSO set up with around 5 or 6 solution providers via our M365. Not one of them charges for this, they just sent us the documentation.I identified another online service in use by one of our departments which would benefit from using SSO for staff …

    • Curated Spark! Pro series - 9th February 2023

      Spark! Pro series — 9th February 2023

      Spiceworks Originals

      Today in History: America meets the Beatles on “The Ed Sullivan Show”

      At approximately 8:12 p.m. Eastern time, Sunday, February 9, 1964, The Ed Sullivan Show returned from a commercial (for Anacin pain reliever), and there was Ed Sullivan standing …

    • Curated Green Brand Rep Wrap-Up: January 2023

      Green Brand Rep Wrap-Up: January 2023

      Spiceworks Originals

      Source Opens a new window Opens a new windowHi, y’all — Chad here. A while back, we used to feature the top posts from our brand reps (aka “Green Gals/Guys/et. al.) in a weekly or monthly wrap-up post. I can’t specifically recall which, as that was ap…

    Понравилась статья? Поделить с друзьями:
  • Method get status error on socket receive xiaomi vacuum что делать
  • Method describe failed 451 error
  • Metatrader 5 tester agent authorization error
  • Metal gear solid v the phantom pain как изменить управление
  • Metal gear solid v the phantom pain glowstorm ошибка