France
Joined: Nov 7, 2005
Post Count: 9371
Status:
Offline
Re: SweetHome3DJS - Porting plugin - ARM architecture support
By the way, you should choose a license for your plug-in project. If you plan to distribute it along with Sweet Home 3D in the same package, it should be under GNU GPL, otherwise if you distribute it separately, any license will be ok.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
France
Joined: Feb 6, 2024
Post Count: 20
Status:
Offline
Re: SweetHome3DJS - Porting plugin - ARM architecture support
Thanks, I'll test. Added a GNU-GPL license file to the github repository for the plugin (it contains the SweetHome3d portable jar). I will do the same for the Home Assistant add-on
France
Joined: Nov 7, 2005
Post Count: 9371
Status:
Offline
Re: SweetHome3DJS - Porting plugin - ARM architecture support
Don’t hesitate to ask questions if needed. If all goes well and you want to run Sweet Home 3D from a JAR executable file, you should have to update SweetHome3DBootstrap class and jarExecutable target in build.xml file.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
France
Joined: Feb 6, 2024
Post Count: 20
Status:
Offline
Re: SweetHome3DJS - Porting plugin - ARM architecture support
I have the impression that those libraries require a desktop environment: Root Cause is the lack of a X!! Display, but the libraries will have to run headless in a server like environment inside a container.
Type Exception Report
Message An exception occurred processing [/exportToHA.jsp] at line [89]
Description The server encountered an unexpected condition that prevented it from fulfilling the request.
Exception
org.apache.jasper.JasperException: An exception occurred processing [/exportToHA.jsp] at line [89]
86: } 87: } 88: 89: BranchGroup root = new BranchGroup(); 90: Object3DBranchFactory objectFactory = new Object3DBranchFactory(); 91: 92: // Add 3D ground, walls, rooms and labels
Stacktrace: org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:610) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:489) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:380) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:328) jakarta.servlet.http.HttpServlet.service(HttpServlet.java:777) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) Root Cause
java.awt.HeadlessException: No X11 DISPLAY variable was set, but this program performed an operation which requires it. javax.media.j3d.MasterControl.loadLibraries(MasterControl.java:854) javax.media.j3d.VirtualUniverse.<clinit>(VirtualUniverse.java:267) javax.media.j3d.GroupRetained.<init>(GroupRetained.java:155) javax.media.j3d.BranchGroupRetained.<init>(BranchGroupRetained.java:50) javax.media.j3d.BranchGroup.createRetained(BranchGroup.java:72) javax.media.j3d.SceneGraphObject.<init>(SceneGraphObject.java:114) javax.media.j3d.Node.<init>(Node.java:172) javax.media.j3d.Group.<init>(Group.java:551) javax.media.j3d.BranchGroup.<init>(BranchGroup.java:63) org.apache.jsp.exportToHA_jsp._jspService(exportToHA_jsp.java:278) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) jakarta.servlet.http.HttpServlet.service(HttpServlet.java:777) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:466) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:380) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:328) jakarta.servlet.http.HttpServlet.service(HttpServlet.java:777) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) Note The full stack trace of the root cause is available in the server logs.
France
Joined: Feb 6, 2024
Post Count: 20
Status:
Offline
Re: SweetHome3DJS - Porting plugin - ARM architecture support
To explain better what I'm doing:
Building a container that will run SweetHome3D JS with Tomcat
Encapsulate the home editor inside a Web Site that manages the sh3d files
Provide an export feature that replicates the function of my plugin ExportToHASS which is similar to Export To Obj but preserves the object names across exports
Deploy the container as Home Assistant add-on
I was assuming that the SweetHome3D could run headless. It seems that the Home class and Homerecorder class can run headless, but as soon as I reference the J3D class, the exception is raised for lack of a display. This is a pity as I only use J3D to serialize the home into Waterfront format (based on a modified ObjWriter class). This is an operation that wouldn't require any visualization.
France
Joined: Nov 7, 2005
Post Count: 9371
Status:
Offline
Re: SweetHome3DJS - Porting plugin - ARM architecture support
Sweet Home 3D can run headless if you set the Java property java.awt.headless to true (which is probably the default value in Tomcat) and set the Java property j3d.rend to noop. You may even need no library in that case but I’m not sure.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer