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,
how can I retrieve a drawing via jlink? I am able to retrieve a part into the session but when trying to retrieve a drawing the JRE just crashs.
if (type.equalsIgnoreCase("CADCOMPONENT")) {
ModelDescriptor descriptor = pfcModel.ModelDescriptor_Create(ModelType.MDL_PART, inputFilePath, null);
System.out.println("descriptor: " + descriptor);
descriptor.SetPath(f.getPath());
model = session.RetrieveModel(descriptor);
System.out.println(model);
} else if (type.equalsIgnoreCase("CADDRAWING")) {
ModelDescriptor descriptor = pfcModel.ModelDescriptor_Create(ModelType.MDL_DRAWING, inputFilePath, null);
descriptor.SetPath(f.getPath());
model = session.RetrieveModel(descriptor);
System.out.println("model: " + model);
}
As mentioned the CADCOMPONENT is working, the drawing not.
C:\TEMP\test>java CreoConverterTest C:\TEMP\test\piston_drawing.drw CADDRAWING PDF
start
C:/Program Files/PTC/Creo 2.0/Parametric/bin/parametric.exe -g:no_graphics -i:rpc_input
Starting CREO command: C:/Program Files/PTC/Creo 2.0/Parametric/bin/parametric.exe -g:no_graphics -i:rpc_input
pm_is_portmapper_port_busy: bind failed, error = 10013
pm_is_portmapper_port_busy: bind failed, error = 10013
connection: com.ptc.pfc.Implementation.pfcAsyncConnection$AsyncConnection@576a9d42
session: com.ptc.pfc.Implementation.pfcSession$Session@79616c7
modelName: C:\TEMP\test\piston_drawing.drw
f: C:\TEMP\test\piston_drawing.drw
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_UNCAUGHT_CXX_EXCEPTION (0xe06d7363) at pc=0x0000000077d4dce0, pid=8632, tid=8352
#
# JRE version: 6.0_35-b10
# Java VM: Java HotSpot(TM) 64-Bit Server VM (20.10-b01 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C [kernel32.dll+0xdce0]
#
# An error report file with more information is saved as:
# C:\TEMP\test\hs_err_pid8632.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the
I attached the full log. I hope some of you guys could guide me to the right solution.
Solved! Go to Solution.
To answer myself and close the thread:
The problem with the drawing is that you have to be careful that every describing object is located in your runtime path while opening the drawing. Otherwise jlink will cause the jvm crash as described above.
When opening a drawing directly in Creo, Creo itself takes care of that. With jLink you have to handle this by yourself. Maybe this helps someone in the future.
To answer myself and close the thread:
The problem with the drawing is that you have to be careful that every describing object is located in your runtime path while opening the drawing. Otherwise jlink will cause the jvm crash as described above.
When opening a drawing directly in Creo, Creo itself takes care of that. With jLink you have to handle this by yourself. Maybe this helps someone in the future.