While Doing the deployment throught Jenkins/Hudson/Anthill continious integration server tools
(or)
while directly deploying the app using weblogic.Deployer
(or)
during the normal console deployment, there are chances you might have come across this exception.
Exception: java.rmi.RemoteException: [Deployer:149145]Unable to contact 'mwiServer3'. Deployment is deferred until 'mwiServer3' becomes available.
Deployment Logs
weblogic@mwinventory01> java weblogic.Deployer -debug -verbose -adminurl http://mwinventory01:7011 -userconfigfile /tmp/deployer-userconfigfile-UAT -userkeyfile /tmp/deployer-userkeyfile-UAT -name mwi -upload -deploy -targets mwiCluster /opt/weblogic/domains/mwidomain/servers/AdminServer/upload/mwi/app/mwi.ear weblogic.Deployer invoked with options: -debug -verbose -adminurl http://mwinventory01:7011 -userconfigfile /tmp/deployer-userconfigfile-UAT -userkeyfile /tmp/deployer-userkeyfile-UAT -name mwi -upload -deploy -targets mwiCluster /opt/weblogic/domains/mwidomain/servers/AdminServer/upload/mwi/app/mwi.ear [WebLogicDeploymentManagerImpl.():103] : Constructing DeploymentManager for J2EE version V1_4 deployments [WebLogicDeploymentManagerImpl.getNewConnection():146] : Connecting to admin server at mwinventory01:7011, as user deployer [ServerConnectionImpl.getEnvironment():288] : setting environment [ServerConnectionImpl.getEnvironment():291] : getting context using http://mwinventory01:7011 [ServerConnectionImpl.getMBeanServer():239] : Connecting to MBeanServer at service:jmx:http://mwinventory01:7011/jndi/weblogic.management.mbeanservers.domainruntime [ServerConnectionImpl.getMBeanServer():239] : Connecting to MBeanServer at service:jmx:http://mwinventory01:7011/jndi/weblogic.management.mbeanservers.runtime [DomainManager.resetDomain():36] : Getting new domain [DomainManager.resetDomain():39] : Using pending domain: false [MBeanCache.addNotificationListener():96] : Adding notification listener for weblogic.deploy.api.spi.deploy.mbeans.TargetCache@81ee0c4 [MBeanCache.addNotificationListener():103] : Added notification listener for weblogic.deploy.api.spi.deploy.mbeans.TargetCache@81ee0c4 [MBeanCache.addNotificationListener():96] : Adding notification listener for weblogic.deploy.api.spi.deploy.mbeans.ModuleCache@80b9361 [MBeanCache.addNotificationListener():103] : Added notification listener for weblogic.deploy.api.spi.deploy.mbeans.ModuleCache@80b9361 [ServerConnectionImpl.initialize():171] : Connected to WLS domain: mwidomain [ServerConnectionImpl.setRemote():482] : Running in remote mode [ServerConnectionImpl.init():161] : Initializing ServerConnection : weblogic.deploy.api.spi.deploy.internal.ServerConnectionImpl@845b689 [BasicOperation.dumpTmids():689] : Incoming tmids: [BasicOperation.dumpTmids():691] : {Target=mwiCluster, WebLogicTargetType=cluster, Name=mwi}, targeted=true [BasicOperation.deriveAppName():140] : appname established as: mwi[ServerConnectionImpl.upload():658] : Uploaded app to /opt/weblogic/domains/mwidomain/servers/AdminServer/upload/mwi [BasicOperation.dumpTmids():689] : Incoming tmids: [BasicOperation.dumpTmids():691] : {Target=mwiCluster, WebLogicTargetType=cluster, Name=mwi}, targeted=true [BasicOperation.loadGeneralOptions():606] : Delete Files:false Timeout :3600000 Targets: mwiCluster ModuleTargets={} SubModuleTargets={} } Files: null Deployment Plan: null App root: /opt/weblogic/domains/mwidomain/servers/AdminServer/upload/mwi App config: /opt/weblogic/domains/mwidomain/servers/AdminServer/upload/mwi/plan Deployment Options: {isRetireGracefully=true,isGracefulProductionToAdmin=false,isGracefulIgnoreSessions=false,rmiGracePeriod=-1,retireTimeoutSecs=-1,undeployAllVersions=false,archiveVersion=null,planVersion=null,isLibrary=false,libSpecVersion=null,libImplVersion=null,stageMode=null,clusterTimeout=3600000,altDD=null,altWlsDD=null,name=mwi,securityModel=null,securityValidationEnabled=false,versionIdentifier=null,isTestMode=false,forceUndeployTimeout=0,defaultSubmoduleTargets=true,timeout=0deploymentPrincipalName=null}[BasicOperation.execute():423] : Initiating deploy operation for app, mwi, on targets: [BasicOperation.execute():425] : mwiCluster Task 5 initiated: [Deployer:149026]deploy application mwi on mwiCluster. dumping Exception stack Task 5 deferred: [Deployer:149026]deploy application mwi on mwiCluster. Target state: deploy deferred on Cluster mwiCluster java.rmi.RemoteException: [Deployer:149145]Unable to contact ‘mwiServer3’. Deployment is deferred until ‘mwiServer3’ becomes available. at weblogic.deploy.service.internal.transport.UnreachableHostException.writeReplace(UnreachableHostException.java:47) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at java.io.ObjectStreamClass.invokeWriteReplace(ObjectStreamClass.java:1032) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1115) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518) at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:422) at java.lang.Throwable.writeObject(Throwable.java:652) at sun.reflect.GeneratedMethodAccessor849.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330) at java.util.ArrayList.writeObject(ArrayList.java:570) at sun.reflect.GeneratedMethodAccessor32.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1346) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1154) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330) at weblogic.rjvm.MsgAbbrevOutputStream.writeObject(MsgAbbrevOutputStream.java:618) at weblogic.utils.io.ChunkedObjectOutputStream.writeObject(ChunkedObjectOutputStream.java:63) at javax.management.remote.rmi.RMIConnectionImpl_WLSkel.invoke(Unknown Source) at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:589) at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:477) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363) at weblogic.security.service.SecurityManager.runAs(Unknown Source) at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:473) at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201) at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)Target Assignments: + mwi mwiCluster [ServerConnectionImpl.close():334] : Closing DM connection [ServerConnectionImpl.close():354] : Unregistered all listeners [ServerConnectionImpl.closeJMX():374] : Closed JMX connection [ServerConnectionImpl.closeJMX():386] : Closed Runtime JMX connection [ServerConnectionImpl.closeJMX():398] : Closed Edit JMX connection
Solution
These Exceptions occurs when the http/iiop channel of the managed server is not listening/accepting connections.
Let's say, mwiserver3 is running in mwinventory02:7141 address.
First validate if the server is listening using telnet/nc command my fav is nc
nc -w 3 -v mwinventory02 7141
login to the mwinventory02 box and make sure that the 7141 port is listening and being owned the mwi
netstat -ntlp|grep -i 7141
Restart the server and do the same steps given above.
When you come to the conclusion that everything is perfect from weblogic perspective. you can check with your network team to identify if there are any firewall block.
Good luck.