I thought I had declared victory over JLink but it's not going down without a fight.
I have a JLink Asynchronous app that is causing
ProE to crash. This app will work perfectly many times for about an
hour and the all of a sudden when I run this program ProE will crash.
Java throws this error: com.ptc.pfc.Implementation.pfcExceptions$XToolkitCommError
If I restart ProE and run the jlink app ProE will keep crashing
with the same error. The only way to make the jlink app work again is
to restart my computer and the cycle continues. Does anyone have any
suggestions? Thanks.
[/i][/i]XP Pro
Wildfire 3.0
NetBeans6.0
Java 1.6.0_06
Edited by: fiebigc
I have a JLink Asynchronous app that is causing
ProE to crash. This app will work perfectly many times for about an
hour and the all of a sudden when I run this program ProE will crash.
Java throws this error: com.ptc.pfc.Implementation.pfcExceptions$XToolkitCommError
If I restart ProE and run the jlink app ProE will keep crashing
with the same error. The only way to make the jlink app work again is
to restart my computer and the cycle continues. Does anyone have any
suggestions? Thanks.
Code:
//This is a JLink Asynchronos Program that will print the components of an assembly that is set to assemblyName String
//Status: Working.
//
//System Variables To Make Program Work (restart windows if necessary)
//-------------------------------------
//CLASSPATH = .;C:\Program
Files\Java\jre1.6.0\lib\ext\QTJava.zip;D:\My_P rogramming\Netbeans\proeAsyncApp\build\classes\proeasyncapp; C:\Program
Files\proeWildfire 3.0\text\java\pfcasync.jar;%CLASSPATH%
//PATH = C:\Program Files\proeWildfire 3.0\i486_nt\lib;%PATH%
//PRO_COMM_MSG_EXE = C:\Program Files\proeWildfire 3.0\i486_nt\obj\pro_comm_msg.exe
//PRO_DIRECTORY = C:\Program Files\proeWildfire 3.0
package proeasyncapp;
import com.ptc.cipjava.*;
import com.ptc.pfc.pfcSession.*;
import com.ptc.pfc.pfcModel.*;
import com.ptc.pfc.pfcFeature.*;
import com.ptc.pfc.pfcAssembly.*;
import com.ptc.pfc.pfcComponentFeat.*;
import com.ptc.pfc.pfcAsyncConnection.*;
public class proeAsyncApp
{
public static void main(String[] args)
{
System.loadLibrary("pfcasyncmt");
String assemblyName = "Enter Your Assembly Here";
String fileType;
Assembly assembly = null;
Features components = null;
String[] listOfParts;
ModelDescriptor desc;
ModelType modelType;
ComponentFeat component;
try {
AsyncConnection connection = pfcAsyncConnection.AsyncConnection_Connect(null,null,null,nu ll);
Session curSession = connection.GetSession();
assembly = (Assembly)curSession.GetModel(assemblyName, ModelType.MDL_ASSEMBLY );
components = assembly.ListFeaturesByType(Boolean.FALSE, FeatureType.FEATTYPE_COMPONENT);
listOfParts = new String[components.getarraysize()];
for(int i=0; i<components.getarraysize(); i++)
{
component = (ComponentFeat)components.get(i);
desc = component.GetModelDescr();
modelType = desc.GetType();
if(modelType.equals (ModelType.MDL_PART))
fileType = "prt";
else if(modelType.equals (ModelType.MDL_ASSEMBLY ))
fileType = "asm";
else if(modelType.equals (ModelType.MDL_DRAWING ))
fileType = "drw";
else
fileType = "Unknown";
listOfParts[i] = desc.GetFileName();
}
System.out.println();
System.out.println("The Components In " + assemblyName);
System.out.println("-----------------------------------");
for(int i=0; i<listOfParts.length; i++)
System.out.println(listOfParts[i]);
System.out.println();
connection.Disconnect(null);
}catch(jxthrowable e){
System.out.println();
System.out.println(e);
System.out.println();
}
}
}
[/i][/i]XP Pro
Wildfire 3.0
NetBeans6.0
Java 1.6.0_06
Edited by: fiebigc