SweetHome3DJS - Porting plugin - ARM architecture support
This topic has been viewed 13379 times and has 27 replies
SweetHome3DJS - Porting plugin - ARM architecture support
Hello,
I managed to port my SweetHome3D plugin to a personal custom web site based on SweetHome3DJS.
As my plugin is based on a modified OBJWriter to preserve the object names across exports, I need to import the J3D libraries.
I have noticed that J3D libraries come with some binaries and I did not find binaries compiled for ARM architecture.
My Web Site will run as an add-on to Home Assistant: most of the users are running home assistant on ARM architectures (raspberry and similar).
Is there a way to have those libraries in armv7 or armv8 architectures ?
I will soon post my source in GitHub.
Thanks in advance for the support
Andrea
I managed to port my SweetHome3D plugin to a personal custom web site based on SweetHome3DJS.
As my plugin is based on a modified OBJWriter to preserve the object names across exports, I need to import the J3D libraries.
I have noticed that J3D libraries come with some binaries and I did not find binaries compiled for ARM architecture.
My Web Site will run as an add-on to Home Assistant: most of the users are running home assistant on ARM architectures (raspberry and similar).
Is there a way to have those libraries in armv7 or armv8 architectures ?
I will soon post my source in GitHub.
Thanks in advance for the support
Andrea
Re: SweetHome3DJS - Porting plugin - ARM architecture support
You’ll find the libraries in the JAR files at https://jogamp.org/deployment/jogamp-current/jar/
Pick up the files prefixed by gluegen-rt-natives and jogl-all-natives, probably gluegen-rt-natives-linux-armv6hf.jar and jogl-all-natives-linux-armv6hf.jar.
Pick up the files prefixed by gluegen-rt-natives and jogl-all-natives, probably gluegen-rt-natives-linux-armv6hf.jar and jogl-all-natives-linux-armv6hf.jar.
Emmanuel Puybaret, Sweet Home 3D creator
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.
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 creator
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
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
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 creator
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
jakarta.servlet.ServletException: java.lang.ExceptionInInitializerError
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:667)
org.apache.jsp.exportToHA_jsp._jspService(exportToHA_jsp.java:383)
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)
Root Cause
java.lang.ExceptionInInitializerError
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)
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.
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
[/list=1]
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.
Re: SweetHome3DJS - Porting plugin - ARM architecture support
I've tried to do it using the jogl-noawt library, same error.
Then I stumbled across this forum thread: https://forum.jogamp.org/Java3D-in-batc ... 39415.html
And this seems pretty much a final word: my idea is not feasible.
I think that your effort to keep the code within a MVC model is nullified by an external library.
Maybe I can port the OBJWriter to JavaScript but this is kind of another size....
Then I stumbled across this forum thread: https://forum.jogamp.org/Java3D-in-batc ... 39415.html
And this seems pretty much a final word: my idea is not feasible.
I think that your effort to keep the code within a MVC model is nullified by an external library.
Maybe I can port the OBJWriter to JavaScript but this is kind of another size....
Re: SweetHome3DJS - Porting plugin - ARM architecture support
Sweet Home 3D can run headless if you set the Java property [font=courier new]java.awt.headless[/font] to [font=courier new]true[/font] (which is probably the default value in Tomcat) and set the Java property [font=courier new]j3d.rend[/font] to [font=courier new]noop[/font].
You may even need no library in that case but I’m not sure.
You may even need no library in that case but I’m not sure.
Emmanuel Puybaret, Sweet Home 3D creator
Re: SweetHome3DJS - Porting plugin - ARM architecture support
Thanks again. It worked. When I will be more stable I will test it without ogl and gluegen libraries....
Who is online
Users browsing this forum: No registered users and 1 guest