Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X
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?
Solved! Go to Solution.
You should include the <Windchill>/srclib/tool/Annotations.jar in your project.
You should include the <Windchill>/srclib/tool/Annotations.jar in your project.
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)
Anup,
Plesae see attached sample java file to create new WTPart. Also refer below Article for setting attributes
hope this helps !!!
Thanks,
Shreyas