Skip to main content
1-Visitor
September 18, 2015
Solved

wt.util.WTRemoteException only in cluster environment when using windchill API

  • September 18, 2015
  • 7 replies
  • 3849 views

Hi,

I have written a utility class in windchill and trying to access the methods of that java class outside windchill application using the below code.

url=http://<xyz.com>/Windchill;

RemoteMethodServer remoteMethodServer = RemoteMethodServer.getInstance(url);

  remoteMethodServer.setUserName(properties.getProperty(urladdress+".username"));

  remoteMethodServer.setPassword(properties.getProperty(urladdress+".password"));

//accessing the method of a utility class which is in windchill codebase directory

remoteMethodServer.invoke("getICNDetails","ext.abb.util.CNPendingTasks", null,argTypes,argValues);

I am getting the below exception only in clustered environment .

wt.util.WTRemoteException: Unable to invoke remote method; nested exception is:

        wt.util.WTRemoteException: Unable to locate method server; nested exception is:

        wt.util.WTRemoteException: Unable to locate method server; nested exception is:

        wt.util.WTRemoteException: Unable to get server; nested exception is:

        wt.util.WTRemoteException: Unable to locate server manager; nested exception is:

        java.rmi.ConnectException: Connection refused to host: <xyz.com>; nested exception is:

        java.net.ConnectException: Connection refused: connect

        at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:619)

        at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:216)

        at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202)

        at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:342)

        at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)

        at wt.manager.RemoteServerManager.acquireServerManager(RemoteServerManager.java:590)

        at wt.manager.RemoteServerManager.getServerManager(RemoteServerManager.java:564)

        at wt.manager.RemoteServerManager.remoteInvoke(RemoteServerManager.java:500)

        at wt.manager.RemoteServerManager.getServer(RemoteServerManager.java:281)

        at wt.manager.RemoteServerManager.getServer(RemoteServerManager.java:265)

        at wt.method.RemoteMethodServer.getMethodServer(RemoteMethodServer.java:1022)

        at wt.method.RemoteMethodServer.invoke(RemoteMethodServer.java:620)

        at ext.abb.dashboard.WindchillStatus.callRMI(WindchillStatus.java:135)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:483)

        at org.apache.el.parser.AstValue.invoke(AstValue.java:245)

        at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:267)

        at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)

        at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:87)

        at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)

        at javax.faces.component.UICommand.broadcast(UICommand.java:315)

        at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:790)


Please do help me to fix my issue.


Regards,

Archana

Best answer by BineshKumar1

Try creating a local hostfile mapping in the webapplication server directing the windchill URL to one of the slave nodes.

Thank you

Binesh Kumar

Barry Wehmiller

7 replies

16-Pearl
September 18, 2015

Hi Archana,

Could you let us know the Windchill version. Are you running this code from master server with only BGMS configured?

Regards,

Bhushan

2-Explorer
September 18, 2015

Absolutely right, make sure you are running from a foreground node and also ensure that you have a cluster URL mapped to local IP in the hostfile so that the request won't get directed to loadbalancer.

Thank you

Binesh Kumar

Barry Wehmiller