cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

The community will undergo maintenance on October 16th at 10:00 PM PDT and will be unavailable for up to one hour.

Issue in releasing a data module for change notice.

TK_9774518
3-Visitor

Issue in releasing a data module for change notice.

I am using Windchill PDMLink Release 12.0 and Datecode with CPS 12.0.0.0

While doing a change notice, I'm getting the below error. Even sometimes tasks are not appearing. I'm sending the error I found in logs

Here are the errors that I faced
com.ptc.windchill.enterprise.change2.forms.ChangeManagementFormProcessorHelper orgadmin - wt.util.WTException: java.lang.ClassCastException: class wt.epm.EPMDocument cannot be cast to class wt.part.WTPart (wt.epm.EPMDocument and wt.part.WTPart are in unnamed module of loader 'app')
Nested exception is: java.lang.ClassCastException: class wt.epm.EPMDocument cannot be cast to class wt.part.WTPart (wt.epm.EPMDocument and wt.part.WTPart are in unnamed module of loader 'app')
wt.util.WTException: java.lang.ClassCastException: class wt.epm.EPMDocument cannot be cast to class wt.part.WTPart (wt.epm.EPMDocument and wt.part.WTPart are in unnamed module of loader 'app')
Nested exception is: java.lang.ClassCastException: class wt.epm.EPMDocument cannot be cast to class wt.part.WTPart (wt.epm.EPMDocument and wt.part.WTPart are in unnamed module of loader 'app')
at com.ptc.arbortext.windchill.rules.listeners.s1000D.S1000DChangeRequestListener.notifyVetoableMultiObjectEvent(S1000DChangeRequestListener.java:351)

2 REPLIES 2

Hi @TK_9774518 

Do you use any customization? 

Because there is some trouble in a code that you are trying to push EPMDocument object to WTPart object and this is not possible. 

 

PetrH

@TK_9774518 

 

@HelesicPetr asked if you have customization.

 

You definitely have a customization.  You have a custom listener.

 

The code was written to accept ONLY WTParts.  It probably should have been written with more flexibility in mind or at least a test to determine if the object is a WTPart.

 

Windchill code needs to be bombproof, otherwise stuff like this happens.  The sad fact is it's very easy to avoid errors like this.

 

So, three possible ways to go here.

1. Add a test for object being a WTPart prior to running the code

2. Edited the code to accept either an EPMDoc or WTPart.

3. Edited the code to accept any object type that could be on your form.

 

Actually a 4th possibility is unregister the listener. 😁 Just kidding.

 

I'm thinking the edit to accept either is likely the way to go, but what do I know.

Without know the intent of the code and seeing the code it's impossible to advise on how to make it bombproof.  Bombproof is the ONLY way to go when writing code.

 

It would be easy to make the code bombproof, but first need to know what your intent is, and I'd need to see the code.

 

Send your intent and the code to me at windchill.developer@yahoo.com and I'll take a look.

 

David

 

Announcements


Top Tags