Skip to content

ParforProgress2 Class Throws Errors in MATLAB 2024b #8

@Zhenyu98

Description

@Zhenyu98

Issue: ParforProgress2 Class Throws Errors in MATLAB 2024b

Description:
I encountered several errors while using the ParforProgress2 class in MATLAB 2024b. The errors seem to be related to the use of JavaBit and the ParforProgressClient2.createClient function. Below is the detailed error message.

Error Message:
Warning: An error was caught while executing the destructor of the 'ParforProgress2' class: This type of variable does not support dot indexing.

Error in ParforProgress2/delete (line 143)
o.JavaBit.done();
^^^^^^^^^^^^^^^^

Error in ParforProgress2 (line 61)
if nargin == 1 && iscell(s)
^

Error in ParforProgress2.loadobj (line 49)
o = ParforProgress2( {X.HostName, X.Port, X.OldVersion, X.DEBUG} );
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Error in parallel.internal.pool.optionallyDeserialize (line 7)
out = distcompdeserialize(data);
^^^^^^^^^^^^^^^^^^^^^^^^

Warning: An error was encountered while loading an object of the 'ParforProgress2' class:
Unable to resolve the name 'ParforProgressClient2.createClient'.

Error using ParforProgress2 / increment (line 132)
Variables of this type do not support indexing with points.

MATLAB Version (I used):

  • Version: 2024b

System Information:

  • OS: [ Windows 10]
  • Java version: [ this information from MATLAB's version -java command]
    • MATLAB's Java version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode

Steps to Reproduce:

  1. Run the following code with a simple parfor loop using ParforProgress2 in MATLAB 2024b.
    N = 1000;
    try
        ppm = ParforProgressStarter2('Test Task', N, 0.1, true, true, true);
    catch me
        error('Initialization failed: %s', me.message);
    end
    
    parfor i = 1:N
        % Simulate some work
        rand(1);
        ppm.increment(i);
    end
    

Potential Causes:

The error seems to be related to ParforProgressClient2.createClient being unrecognized, potentially due to the Java-related functionality not working correctly.
The JavaBit object appears to be incorrectly initialized or not properly accessible within the delete() method of ParforProgress2.

What I Have Tried:

I verified that MATLAB's built-in Java is correctly functioning by running version -java, which shows that MATLAB is using Java 1.8.
I also confirmed that the path includes the necessary files for ParforProgress2 and its dependencies.
However, the issue persists when running this on MATLAB 2024b.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions