Skip to main content
1-Visitor
August 3, 2016
Solved

wt.util.WTRemoteException: Unable to invoke remote method;

  • August 3, 2016
  • 1 reply
  • 16298 views

Who can help me to solve this problem, my code is:

public class Test {

  /**

  * @param args

  */

  public static void main(String[] args) throws Exception {

  URL url= new URL("http://whichen-ws01.cisco.com/Windchill");

  RemoteMethodServer rms=RemoteMethodServer.getInstance(url);

  rms.setUserName("wcadmin");

  rms.setPassword("wcadmin");

  System.out.println("login succeed!");

  Class argTypes[]={String.class, String.class, String.class, String.class};

  Object argValues[]={

  "Whichen_demo_name2",

  "Whichen_demo_number2",

  "Whichen_demo_file2",

  "C:\temp\rule.xml"

  };


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

  rms.invoke("createDoc", "com.cisco.whichen.DocManager", null, argTypes, argValues);

  System.out.println("Succeeded!");

  }

}

My local host file is:

127.0.0.1 localhost whichen-ws01.cisco.com # whichen-ws01

Looking forward to your kindly help.

Best answer by ChrisSpartz

The package of this class is 'com.cisco.whichen2'. That means the class file should be copied into Windchill/codebase/com/cisco/whichen2/

1 reply

16-Pearl
August 8, 2016

Can you share the logs generated when executing the java file. Are you able to run it successfully if the file if executed from the server machine?

Regards,

Bhushan

WhiteChen1-VisitorAuthor
1-Visitor
August 12, 2016

I run it successfully in Linux environment, but my local test environment is WINDOWS7.

Below is the error info.

Exception in thread "main" 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:

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

       java.io.FileNotFoundException: http://whichen-ws01.cisco.com/wt.properties

       at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)

       at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)

       at wt.util.WTContext.getResourceAsStream(WTContext.java:3568)

       at wt.util.WTProperties.getServerProperties(WTProperties.java:965)

       at wt.manager.RemoteServerManager.getRegistry(RemoteServerManager.java:723)

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

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

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

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

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

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

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

       at com.cisco.whichen.Test.main(Test.java:43)

The attachments is two method for remote method I got from the community, but both of them can't work in my test environment, please help me.

Thanks

13-Aquamarine
August 15, 2016

It's failing because of the below line:

java.io.FileNotFoundException: http://whichen-ws01.cisco.com/wt.properties

This error is saying that it can't find the wt.properties file for the server. But, the above URL isn't the right location for wt.properties. It should be looking for http://whichen-ws01.cisco.com/Windchill/wt.properties‌ instead. The fact that it is using the wrong location makes me think there is some misconfiguration in your properties. What is the current value of wt.server.codebase in your wt.properties file?