Joined: Apr 2, 2022
Post Count: 11
Status:
Offline
Sweet Home 3D Online Manager
First of all: Really great software! Thanks for that! I have now installed Sweet Home 3D JS on a lolalem Tomcat. However, there must be a connected user for everything to work. My question is: is the Online Manager also available for download? I'm just hanging here a little because it's not possible to work without saving changes. Or is there a tutorial for this? Best regards
France
Joined: Nov 7, 2005
Post Count: 9426
Status:
Offline
Re: Sweet Home 3D Online Manager
However, there must be a connected user for everything to work
No, the default web application proposed with Sweet Home 3D JS is able to record the changes made in a file matching the home parameter sent to index.jsp (see also readHome.jsp). For example:
will edit the file MyHome.sh3d, creating it if it doesn't exist. But if you don't want to keep all the SH3D files in the same folder and/or prevent the SH3D files of a user from being read by anyone, you'll have to program some authentication system, the reason why I reused the forum login page as a SSO (Single Sign-On) on sweethome3d.com. But you could also start without authentication and use a permanent cookie to name the folder matching a user on the server.
is the Online Manager also available for download?
No, because it depends on the forum authentication system and how sweethome3d.com database is organized. I could program also a less specific solution but I prefer to spend some time on Sweet Home 3D improvements now.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator
Joined: Apr 2, 2022
Post Count: 11
Status:
Offline
Re: Sweet Home 3D Online Manager
when I try this I get the following errors in the browser console and the sh3d file does not load: sweethome3d.min.js:20 GET http://localhost:8081/SweetHome3DJS-7.0/userR...3d-487f-89fc-e0d0039d64b7 404 (Not Found) RecordedUserPreferences.readPreferences @ sweethome3d.min.js:20 RecordedUserPreferences.getProperties @ sweethome3d.min.js:20 RecordedUserPreferences @ sweethome3d.min.js:20 SweetHome3DJSApplication.getUserPreferences @ sweethome3d.min.js:20 (anonym) @ index.jsp?home=MyHome:1421 sweethome3d.min.js:20 GET http://localhost:8081/SweetHome3DJS-7.0/readH...5f-49b4-9455-7adbca5bca58 500 (Internal Server Error) ZIPTools.getZIP @ sweethome3d.min.js:20 HomeRecorder.readHome @ sweethome3d.min.js:20 IncrementalHomeRecorder.readHome @ sweethome3d.min.js:20 (anonym) @ index.jsp?home=MyHome:1425 index.jsp?home=MyHome:1437 Error: 500 while requesting http://localhost:8081/SweetHome3DJS-7.0/readH...5f-49b4-9455-7adbca5bca58 at XMLHttpRequest.<anonymous> (sweethome3d.min.js:20:1495409)
die user Resources kann ich sehr wahrscheinlich einfach aus der index.jsp rausnehmen? das sh3d-File kann aber nicht geladen werden. irgendeine idee was ich falsch mache?
Joined: Apr 2, 2022
Post Count: 11
Status:
Offline
Re: Sweet Home 3D Online Manager
last sentence above: I can probably just take the user resources out of the index.jsp? but the sh3d file cannot be loaded. any idea what i'm doing wrong?
France
Joined: Nov 7, 2005
Post Count: 9426
Status:
Offline
Re: Sweet Home 3D Online Manager
You'll get the first error as long as you didn't modify preferences, since userPreferences.json file will be created at that moment. For the second error, it's an HTTP 500 error so you should check logs on server side (there's probably a stack trace in logs/catalina.out file).
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator
Joined: Apr 2, 2022
Post Count: 11
Status:
Offline
Re: Sweet Home 3D Online Manager
Thanks, i get the following error:
Apr. 07, 2022 6:38:39 NACHM. org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet [jsp] in context with path [/SweetHome3DJS-7.0] threw exception [Unable to compile class for JSP:
An error occurred at line: [51] in the jsp file: [/readHome.jsp] Resource specification not allowed here for source level below 1.7 48: } 49: 50: synchronized (homeFile.getAbsolutePath().intern()) { 51: try (InputStream input = new FileInputStream(homeFile); 52: ByteArrayOutputStream output = new ByteArrayOutputStream()) { 53: byte[] buffer = new byte[8096]; 54: int size; An error occurred at line: [67] in the jsp file: [/readHome.jsp] Resource specification not allowed here for source level below 1.7 64: 65: response.setIntHeader("Content-length", homeFileContent.length); 66: response.setHeader("Content-Disposition", "attachment; filename=" + homeFile.getName()); 67: try (OutputStream servletOut = response.getOutputStream()) { 68: servletOut.write(homeFileContent); 69: } 70: } %>
Stacktrace:] with root cause org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: [51] in the jsp file: [/readHome.jsp] Resource specification not allowed here for source level below 1.7 48: } 49: 50: synchronized (homeFile.getAbsolutePath().intern()) { 51: try (InputStream input = new FileInputStream(homeFile); 52: ByteArrayOutputStream output = new ByteArrayOutputStream()) { 53: byte[] buffer = new byte[8096]; 54: int size;
An error occurred at line: [67] in the jsp file: [/readHome.jsp] Resource specification not allowed here for source level below 1.7 64: 65: response.setIntHeader("Content-length", homeFileContent.length); 66: response.setHeader("Content-Disposition", "attachment; filename=" + homeFile.getName()); 67: try (OutputStream servletOut = response.getOutputStream()) { 68: servletOut.write(homeFileContent); 69: } 70: } %>
Stacktrace: at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:103) at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:392) at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:594) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:400) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:370) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:354) at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:660) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:400) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339) at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:492) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:165) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:1025) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:452) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1201) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:654) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:319) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.base/java.lang.Thread.run(Thread.java:834)
France
Joined: Nov 7, 2005
Post Count: 9426
Status:
Offline
Re: Sweet Home 3D Online Manager
Resource specification not allowed here for source level below 1.7
You probably run Tomcat with an old Java version. Use at least Java 1.7 or the JDK you used to build the project, since it required Java >= 11.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator
France
Joined: Nov 7, 2005
Post Count: 9426
Status:
Offline
Re: Sweet Home 3D Online Manager
Maybe it's an issue with Tomcat. I never tried with Tomcat 7. Can you try with Tomcat >= 9?
[Edit] Actually, you're not the first to encounter this issue, and I think the solution for Tomcat 7 is described here.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator
----------------------------------------
[Edit 2 times,
last edit by Puybaret at Apr 8, 2022, 5:12:23 PM]