Hi,
while setting up a self-hosted Sweet Home 3D JS 7.5.2 installation, I encountered a reproducible issue when loading the official Furniture-Contributions library.
I converted the official SH3F furniture library using the PropertiesToJson tool included with the Sweet Home 3D JS 7.5.2 source and added the generated catalog through furnitureCatalogURLs.
When the complete generated Furniture-Contributions.json is loaded, the furniture catalog fails with:
Uncaught IllegalArgumentException
I isolated the problem by repeatedly splitting and testing the generated catalog until I found the affected furniture entry:
id#364 = Sophie#casierBouteilles
name#364 = Bottles rack
The property causing the problem is:
shelfBoxes#364
If I remove ONLY the shelfBoxes#364 property from the generated JSON, while leaving the rest of furniture entry #364 unchanged, the complete Furniture-Contributions catalog loads successfully.
All 511 furniture entries are then available, including the Bottles rack itself.
The original entry contains this shelfBoxes definition:
shelfBoxes#364 = 2.3 -1 2.3 11.4 23 11.5 13.7 -1 2.3 22.9 23 11.5 25.2 -1 2.3 34.4 23 11.5 36.8 -1 2.3 46 23 11.5 48.4 -1 2.3 57.7 23 11.5 2.3 -1 13.9 11.4 23 23.1 13.7 -1 13.9 22.9 23 23.1 25.2 -1 13.9 34.4 23 23.1 36.8 -1 13.9 46 23 23.1 48.4 -1 13.9 57.7 23 23.1 2.3 -1 25.4 11.4 23 34.6 13.7 -1 25.4 22.9 23 34.6 25.2 -1 25.4 34.4 23 34.6 36.8 -1 25.4 46 23 34.6 48.4 -1 25.4 57.7 23 34.6 2.3 -1 36.9 11.4 23 46.2 13.7 -1 36.9 22.9 23 46.2 25.2 -1 36.9 34.4 23 46.2 36.8 -1 36.9 46 23 46.2 48.4 -1 36.9 57.7 23 46.2 2.3 -1 48.5 11.4 23 57.7 13.7 -1 48.5 22.9 23 57.7 25.2 -1 48.5 34.4 23 57.7 36.8 -1 48.5 46 23 57.7 48.4 -1 48.5 57.7 23 57.7 0 -1 60 60 25 250
Environment:
This appears to be specific to the shelfBoxes definition of Sophie#casierBouteilles. The furniture model, icon and all other properties can remain unchanged.
After removing shelfBoxes#364, the full catalog works correctly together with the other official furniture catalogs.
If useful, I can provide both generated JSON files (the original failing version and the working version with only shelfBoxes#364 removed) as well as further test details.
Best regards
Joscha
Thanks for trying the not very intuitive tool PropertiesToJson and reporting this issue.
Could you check if the value of the property shelfBoxes#364 in .json file is the same as shelfBoxes#364 in .properties file?
Yes, I checked it directly.
The value of shelfBoxes#364 in PluginFurnitureCatalog.properties is exactly identical to the value generated in Furniture-Contributions.json.
I compared both values programmatically:
The trailing two spaces are present in both values as well.
So PropertiesToJson doesn't appear to modify the shelfBoxes#364 value during conversion.
Removing only shelfBoxes#364 from the generated JSON still makes the complete catalog load correctly in Sweet Home 3D JS 7.5.2.
If you need any further tests, files, details from my setup, or want me to test a possible fix, please feel free to contact me directly at:
muenchen@pcjmueller.com
I don't check SourceForge regularly, so email is the fastest way to reach me and I'll usually be able to respond much sooner.
Best regards
Joscha
It´s probably because of the trailing blanks (see
IllegalArgumentExceptionthrown in DefaultFurnitureCatalog.js (sourceforge.net). Removing them should fix the issue.The
splitmethod works differently in Java and JavaScript and there should be an additionnal call totrimbeforesplitto avoid this issue.Thanks, Emmanuel.
That explanation makes sense and also matches the results of my tests.
As confirmed above, the shelfBoxes#364 value in PluginFurnitureCatalog.properties and the generated Furniture-Contributions.json is exactly identical, including the two trailing spaces (674 characters in both files).
I haven't tested the proposed trim() change in DefaultFurnitureCatalog.js because my Sweet Home 3D JS installation is currently in production use and I would prefer not to modify the working installation just for this test.
For my installation, I already have a working workaround: I removed only the shelfBoxes#364 property from the generated Furniture-Contributions.json. With that single property removed, the complete catalog loads correctly and all 511 furniture entries are available, including the Bottles rack itself.
So I'm fine with keeping that workaround locally until the issue is fixed upstream.
If you need any additional information from my setup, the original/generated files, comparison results, browser error details, or another specific test that doesn't require modifying my production installation, I'll be happy to provide it.
Thanks for looking into the issue and for identifying the Java / JavaScript split behavior as the likely cause.
Best regards
Joscha
Instead of removing the property shelfBoxes#364, could you leave it, remove the two trailing blanks and try if it works?
Thanks for your patience...
Hello Emmanuel,
I tested it as you suggested, and I can confirm that it works.
I kept the complete shelfBoxes#364 property and removed only the two trailing blanks at the end of its value.
The original value has 674 characters and ends with 250 . After removing the two trailing blanks, it has 672 characters and ends directly with 250.
With this change, the Furniture-Contributions catalog loads correctly, and the Bottles rack / Weinregal (#364) is present as expected.
So your diagnosis was correct: removing the trailing blanks is sufficient to fix the issue.
I performed the test in a separate temporary Docker container, so my production installation remained unchanged. I have invested quite a lot of work in my own Docker / Portainer infrastructure, so fortunately it was easy to spin up an isolated copy of the Sweet Home 3D JS container for this test and remove it again afterwards.
ChatGPT Plus is my assistant for this project and helped me with the systematic debugging, comparison of the generated files and setting up the isolated test container.
I'm glad I could help with tracking this down. If another small test or some information from my setup is useful, feel free to ask.
Thanks again for taking the time to investigate the issue!
Best regards
Joscha Müller