Java Scene.open() does not open Collada DAE file if it contains any UV map (aspose-3d-19.3.jar/JDK8)

Aspose.3d v19.3 (I have to use exactly this version as my NetBeans13 can use only major version 52 builds and this version is the last one with mv52, that is JDK8/jre1.8): scene.open() does not work, and the file definitely exist at the specified path/directory (checked several times, even checked what path is sent to scene.open()). BTW that .dae file is produced by Blender 3.6.5 (I can provide the file if needed).

I used this example from your website (with no error in NetBeans):

// Load and open the input DAE file with the Scene class
Scene scene = new Scene();
scene.open(string-abs-pth-to-my-dae-file);

// Initialize an instance of ObjSaveOptions class
ObjSaveOptions options = new ObjSaveOptions();
options.setEnableMaterials(true);
            
// Convert DAE to OBJ File 
scene.save("Sample.obj", options);

It stops at the scene.open() - checked by adding simple System.err.println("OK") right before and after the scene.open(): the first one fires up but the 2nd one never outputs, which means there it stops as my app also hung-up/freeze there.

And here is my very simple test file Java code:

package daetoobj;

import com.aspose.threed.ObjSaveOptions;
import com.aspose.threed.Scene;

import java.io.File;
import java.io.IOException;

public class DaeToObj {

    /**
     * @param args the command line arguments
     * @throws java.io.IOException
     */
    public static void main(String[] args) throws IOException {

        // Initialize new Scene class
        Scene scene = new Scene();

        System.err.println("++++++++++ OK1");
        String inputFile = "Z:/test.dae";
        System.err.println(inputFile);
        System.err.println("Does the input DAE file exist = " + new File(inputFile).exists());

        // Load the input DAE file
        scene.open(inputFile);

        System.err.println("++++++++++ OK2 - input DAE file opened successfully");

        // Initialize an instance of ObjSaveOptions class
        ObjSaveOptions options = new ObjSaveOptions();

        // I DO NOT NEED MTL FILE, JUST THE OBJ
        options.setEnableMaterials(false);

        scene.save("Z:/test.obj", options);
    }

}

But if I use the same file with your online DAE to OBJ converter here and I use exactly the same DAE file, it converts it with no problem.

UPDATE:
I think I found where the problem is: this problem happens if a Collada DAE file contains any UV map, that is attribute “semantic” with value “TEXCOORD” under library_geometries->geometry->mesh->triangles, so this geometry would be OK:

<library_geometries>
<geometry id="_001_001-mesh" name="3001.001">
  <mesh>
	<source id="_001_001-mesh-positions">
	  <float_array id="_001_001-mesh-positions-array" count="54438">-0.4 0.9600001 -1.2 2.8 0.9600001 -1.2 2.8 0 -1.2 -0.4 0 -1.2 ...many more values here</float_array>
	  <technique_common>
		<accessor source="#_001_001-mesh-positions-array" count="18146" stride="3">
		  <param name="X" type="float"/>
		  <param name="Y" type="float"/>
		  <param name="Z" type="float"/>
		</accessor>
	  </technique_common>
	</source>
	<source id="_001_001-mesh-normals">
	  <float_array id="_001_001-mesh-normals-array" count="61236">-0.991304 0 -0.1315919 -0.9978014 -1.40815e-7 -0.06627607 -0.9978014 ...many more values here</float_array>
	  <technique_common>
		<accessor source="#_001_001-mesh-normals-array" count="20412" stride="3">
		  <param name="X" type="float"/>
		  <param name="Y" type="float"/>
		  <param name="Z" type="float"/>
		</accessor>
	  </technique_common>
	</source>
	<vertices id="_001_001-mesh-vertices">
	  <input semantic="POSITION" source="#_001_001-mesh-positions"/>
	</vertices>
	<triangles material="MainSurface_Material_001-material" count="35584">
	  <input semantic="VERTEX" source="#_001_001-mesh-vertices" offset="0"/>
	  <input semantic="NORMAL" source="#_001_001-mesh-normals" offset="1"/>
	  <p>4511 0 4517 1 4510 2 4512 3 4518 4 4511 0 4513 5 4519 6 4512 3 4513 5 4521 7 4520 8 4515 9 4521 7 4514 10 4516 11 4522 12 4515 ...many more values here</p>
	</triangles>
	<triangles material="Decoration1_Material_007-material" count="128">
	  <input semantic="VERTEX" source="#_001_001-mesh-vertices" offset="0"/>
	  <input semantic="NORMAL" source="#_001_001-mesh-normals" offset="1"/>
	  <p>4560 78 4566 79 4559 80 4561 81 4567 82 4560 78 4562 83 4568 84 4561 81 4563 85 4569 86 4562 83 4564 87 4570 88 4563 85 4565 89 ...many more values here</p>
	</triangles>
  </mesh>
</geometry>
</library_geometries>

…but this one here would be not:

<library_geometries>
<geometry id="_001_001-mesh" name="3001.001">
  <mesh>
	<source id="_001_001-mesh-positions">
	  <float_array id="_001_001-mesh-positions-array" count="54438">-0.4 0.9600001 -1.2 2.8 0.9600001 -1.2 2.8 0 -1.2 -0.4 0 -1.2 ...many more values here</float_array>
	  <technique_common>
		<accessor source="#_001_001-mesh-positions-array" count="18146" stride="3">
		  <param name="X" type="float"/>
		  <param name="Y" type="float"/>
		  <param name="Z" type="float"/>
		</accessor>
	  </technique_common>
	</source>
	<source id="_001_001-mesh-normals">
	  <float_array id="_001_001-mesh-normals-array" count="61209">-0.991304 0 -0.1315919 -0.9978014 -1.40815e-7 -0.06627607 -0.9978014 ...many more values here</float_array>
	  <technique_common>
		<accessor source="#_001_001-mesh-normals-array" count="20403" stride="3">
		  <param name="X" type="float"/>
		  <param name="Y" type="float"/>
		  <param name="Z" type="float"/>
		</accessor>
	  </technique_common>
	</source>
	<source id="_001_001-mesh-map-0">
	  <float_array id="_001_001-mesh-map-0-array" count="214272">0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...many more values here</float_array>
	  <technique_common>
		<accessor source="#_001_001-mesh-map-0-array" count="107136" stride="2">
		  <param name="S" type="float"/>
		  <param name="T" type="float"/>
		</accessor>
	  </technique_common>
	</source>
	<vertices id="_001_001-mesh-vertices">
	  <input semantic="POSITION" source="#_001_001-mesh-positions"/>
	</vertices>
	<triangles material="MainSurface_Material_001-material" count="35584">
	  <input semantic="VERTEX" source="#_001_001-mesh-vertices" offset="0"/>
	  <input semantic="NORMAL" source="#_001_001-mesh-normals" offset="1"/>
	  <input semantic="TEXCOORD" source="#_001_001-mesh-map-0" offset="2" set="0"/>
	  <p>4511 0 0 4517 1 1 4510 2 2 4512 3 3 4518 4 4 4511 0 5 4513 5 6 4519 6 7 4512 3 8 4513 5 9 4521 7 10 4520 8 11 4515 9 12 4521 7 ...many more values here</p>
	</triangles>
	<triangles material="Decoration1_Material_007-material" count="128">
	  <input semantic="VERTEX" source="#_001_001-mesh-vertices" offset="0"/>
	  <input semantic="NORMAL" source="#_001_001-mesh-normals" offset="1"/>
	  <input semantic="TEXCOORD" source="#_001_001-mesh-map-0" offset="2" set="0"/>
	  <p>4560 78 192 4566 79 193 4559 80 194 4561 81 195 4567 82 196 4560 78 197 4562 83 198 4568 84 199 4561 81 200 4563 85 201 4569 86 ...many more values here</p>
	</triangles>
  </mesh>
</geometry>
</library_geometries>

If a Collada DAE file does not contain any UV map, it converts the file without any problem whatsoever…so possible BUG???

And in case it really is a bug in this older version, is there a chance I could fix it somehow in the code?

OR is there any newest build that was compiled with JDK8 (if possible at all)? And if not: could someone do this as there is still zillions of Java programmers using “old” JDK8 for several reasons, just like me.

@luborablahova

Would you kindly try to use the latest version of the API and see if issue still occurs in your environment. If it does, can you please share the sample file in .zip format so that we can test the scenario in our environment and address it accordingly.

And would you kindly read once more the very first line of my post, please?

Actually I have a feeling you not even read it properly cos I already did explain everything there…ah!

But I will repeat it for you once more here too: I CAN NOT USE ANY VERSION OF Aspose.3D NEWER THAN v19.3, cos that is the last one being compiled using JDK8 which is the version I am using and compiling absolutely all my apps with NetBeans13.

That would require for me huge redesign of all of my apps which I won’t do just to be able run your newer versions cos for some reason you are not providing files compiled with JDK8 for ppl like me that still are using JDK8 (and I would say it is the biggest part of Java users).

Main reason why I won’t be using any newer version is that newer versions of Java (and I did try JDK21 and JDK9 only to run almost immediately back to old great JDK8) introducing hell of a lot problems to all my existing Java code, even some that has no functional replacement at the moment like deploying native dll from inside the JAR file itself at runtime…so no, I would not as I can not, sorry.

As for the test file, sure, here it is:
withuv.7z (457.3 KB)

@luborablahova

We apologize for such an impression. The main reason we requested to test with the latest version of the API is that we can only investigate or resolve an issue if it is occurring in the latest version of the API. The purpose was to only identify if this issue persists in the latest version as well at your end or not - regardless the JDK version.

Nevertheless, we have opened an investigation ticket in our issue tracking system to carry out an in-depth analysis against your case. The ticket has been logged under the ID THREEDJAVA-298 in our issue tracking system. We will look into its details and keep you posted with the status of its resolution. Please be patient and spare us some time. We are sorry for the inconvenience.

OK, no problem - I will wait for this as I need it very much, thank you.

The issues you have found earlier (filed as THREEDJAVA-298) have been fixed in this update. This message was posted using Bugs notification tool by Aspose.3D Team.