By the way, if you want to generate SweetHome3DJS.war file, don't forget to run Ant default target in SweetHome3D project too. SweetHome3D.jar is required to generate the war file.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
France
Joined: Nov 7, 2005
Post Count: 9371
Status:
Offline
Re: Sweet Home 3D JS Online
As you didn't report the error, it's difficult to help you. Did you read the discussion with emirhanbskc which might help you?
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
Nigeria
Joined: Jun 25, 2021
Post Count: 4
Status:
Offline
Re: Sweet Home 3D JS Online
Hello, yes, I read the discussion, i have done everything in the readme, everything else builds, am I meant to put the sweethome3d.jar in any particular folder after building it?
How do i report the error, can i put a log here?
this is where the error starts:
transpiledLibraries: [javac] /Users/Downloads/sweethome3d-code-r7868-trunk/SweetHome3DJS/build.xml:30: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds [java] INFO: JSweet transpiler version 2.4.0-RC1 (build date: 2020-07-21 17:21:35) [java] 2021-07-07 18:13:40.040 ERROR JSweetConfig:149 - class jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to class java.net.URLClassLoader (jdk.internal.loader.ClassLoaders$AppClassLoader and java.net.URLClassLoader are in module java.base of loader 'bootstrap') [java] java.lang.ClassCastException: class jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to class java.net.URLClassLoader (jdk.internal.loader.ClassLoaders$AppClassLoader and java.net.URLClassLoader are in module java.base of loader 'bootstrap') [java] at org.jsweet.JSweetConfig.initClassPath(JSweetConfig.java:86) [java] at org.jsweet.JSweetCommandLineLauncher.transpileWithArgs(JSweetCommandLineLauncher.java:270) [java] at org.jsweet.JSweetCommandLineLauncher.main(JSweetCommandLineLauncher.java:239) [java] 2021-07-07 18:13:40.040 INFO JSweetCommandLineLauncher:671 - input dirs: [../SweetHome3D/src, tools/JSweet/src] [java] 2021-07-07 18:13:40.040 INFO JSweetCommandLineLauncher:682 - classpath: null [java] 2021-07-07 18:13:40.040 INFO JSweetCommandLineLauncher:697 - included: [def.*, com/eteks/sweethome3d/model.*, com/eteks/sweethome3d/tools.*, com/eteks/sweethome3d/viewcontroller.*, com/eteks/sweethome3d/io.*] [java] 2021-07-07 18:13:40.040 INFO JSweetCommandLineLauncher:698 - excluded: [] [java] 2021-07-07 18:13:40.040 INFO JSweetCommandLineLauncher:747 - ts output dir: tools/JSweet/build/ts [java] 2021-07-07 18:13:40.040 INFO JSweetCommandLineLauncher:754 - js output dir: tools/JSweet/build/js [java] java.lang.IllegalAccessError: superclass access check failed: class org.jsweet.transpiler.util.AbstractTreeScanner (in unnamed module @0x2eb231a6) cannot access class com.sun.tools.javac.tree.TreeScanner (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.tree to unnamed module @0x2eb231a6
France
Joined: Nov 7, 2005
Post Count: 9371
Status:
Offline
Re: Sweet Home 3D JS Online
Building Sweet Home 3D JS project requires JDK 8, and not a further version. Is it your case? [Note that building recent versions requires JDK 11, not JDK 8]
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
----------------------------------------
[Edit 1 times,
last edit by Puybaret at Aug 12, 2022, 7:19:08 PM]
France
Joined: Nov 7, 2005
Post Count: 9371
Status:
Offline
Re: Sweet Home 3D JS Online
I'm pretty sure you're not using JDK 8 to build the project. I just tried with JDK 15 and got the same error. If you use Terminal, set JAVA_HOME environment variable to ensure Ant uses the right JDK.
Do I have to put the sweethome3d.jar in any specific folder to aid the building?
No, just leave it in its default place, but SweetHome3D and SweetHom3DJS projects must be in the same folder.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
Joined: Oct 28, 2021
Post Count: 12
Status:
Offline
Re: Sweet Home 3D JS Online
Hello, I try to deploy sweethome3djs online. But i got error:
HTTP Status 500 - Unable to compile class for JSP: type Exception report
message Unable to compile class for JSP:
description The server encountered an internal error that prevented it from fulfilling this request.
exception
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: } %>
java -version openjdk version "1.8.0_312" OpenJDK Runtime Environment (build 1.8.0_312-b07) OpenJDK 64-Bit Server VM (build 25.312-b07, mixed mode)
My Tomcat version:
Server version: Apache Tomcat/7.0.76 Server built: Nov 16 2020 16:51:26 UTC Server number: 7.0.76.0 OS Name: Linux OS Version: 3.10.0-1160.36.2.el7.x86_64 Architecture: amd64 JVM Version: 1.8.0_312-b07 JVM Vendor: Red Hat, Inc.
France
Joined: Nov 7, 2005
Post Count: 9371
Status:
Offline
Re: Sweet Home 3D JS Online
It's strange because even if try (resource) { } syntax is allowed only from Java 7, your server seems to use a JDK 8. Maybe try to run the server with JDK 11.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer