bugGNU Octave - Bugs: bug #42993, Octave's Java does not load...

 
 

bug #42993: Octave's Java does not load Service-Provider-Interface classes

Submitted by:  None
Submitted on:  Fri 15 Aug 2014 12:28:35 AM UTC  
 
Category: LibrariesSeverity: 3 - Normal
Priority: 5 - NormalItem Group: None
Status: NoneAssigned to: None
Originator Name: Chris CarrollOriginator Email: -unavailable-
Open/Closed: OpenRelease: 3.8.1
Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 15 Aug 2014 04:33:18 PM UTC, comment #1:

Octave's Java implementation does have a few wrinkles, yes; some are mentioned here in the task tracker:
https://savannah.gnu.org/task/?12601.
I doubt if they will be solved in the near future as no one is working on them at present.

If it may comfort you:
While building the UNO Java spreadsheet interface to LibreOffice, I had to jump through a few hoops to get stuff together. Maybe you can get a first impression of some required workarounds if you compare this (a formal Java implementation):
https://wiki.openoffice.org/wiki/Documentation/DevGuide/FirstSteps/Example:_Working_with_a_Spreadsheet_Document

...with this (how it ended up in Octave (-Forge)):
http://sourceforge.net/p/octave/io/ci/default/tree/inst/private/__UNO_spsh_open__.m
...and...
http://sourceforge.net/p/octave/io/ci/default/tree/inst/private/__UNO_oct2spsh__.m

(esp. the queryInterface and PropertyValue stuff gave headaches)

Now these examples don't quite directly apply to your problem; but I think they do show that workarounds can be found in unexpected places and -directions.

Philip Nienhuis <philipnienhuis>
Project Member
Fri 15 Aug 2014 12:28:35 AM UTC, original submission:

Some Java libraries specify interface implementations through the Service Provider Interface (http://docs.oracle.com/javase/tutorial/sound/SPI-intro.html), but Octave does not seem to load the implementations. This may be a problem with Octave's custom ClassLoader implementation.

Sample code that produces the problem:

octaveProblem.LoadResources.java:

octaveProblem.Getter.java:

octaveProblem.DefaultGetter.java:

META-INF/services/octaveProblem.Getter:

After creating a jar from these files, the expected result is shown when the jar is run outside of Octave:

In Octave, the result is:

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #31902:  octaveProblem-0.0.1-SNAPSHOT.jar added by None (4KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by mtmiller (Updated the item)
  • -unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 22 Feb 2015 06:48:36 PM UTCmtmillerCategoryNone=>Libraries
    Fri 15 Aug 2014 12:28:35 AM UTCNoneAttached File-=>Added octaveProblem-0.0.1-SNAPSHOT.jar, #31902

    Back to the top


    Powered by Savane 3.1-cleanup1