Skip to main content
1-Visitor
January 21, 2014
Solved

problem in creation part using JAVA API?

  • January 21, 2014
  • 1 reply
  • 3242 views

Hi,

I am trying to create part using java API.

Code: public static void CreatePart()

{

System.out.println("enter in part creation");

WTPart part;

try {

part = WTPart.newWTPart("01234567", "MyPartName");

} catch (WTException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

PersistenceHelper.manager.save(part);

}

But getting error while saving part in database using PersistenceHelper.manager.save(part); API

Error: The type com.ptc.windchill.annotations.metadata.ColumnType cannot be resolved. It is indirectly referenced from required .class files

PFA screenshot of error

I am new in Windchill ,plz anyone help me?

Best answer by PatrickMcEvoy

You should include the <Windchill>/srclib/tool/Annotations.jar in your project.

1 reply

1-Visitor
January 21, 2014

You should include the <Windchill>/srclib/tool/Annotations.jar in your project.

1-Visitor
January 22, 2014

After addition of Annotations.jar in project the current error is removed bt still nt able to create part getting following error please help . please send basic programme of part creation, setting attribute of part.

(wt.fc.fcResource/0) wt.util.WTException: The operation: "save" failed.

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

wt.method.AuthenticationException

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

at wt.services.ServiceFactory$ClientInvocationHandler.invoke(ServiceFactory.java:349)

at com.sun.proxy.$Proxy6.save(Unknown Source)

at Package_1.Create_Part.CreatePart(Create_Part.java:79)

at Package_1.Create_Part.main(Create_Part.java:42)

1-Visitor
January 22, 2014