This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> <script language="JavaScript" src="http://java.com/js/deployJava.js"> </script> <script> var javaMinimumVersion = "1.6.0_10"; // The first version with Java Plugin 2 var jars = "files/theme/SweetHome3DViewer.jar,files/theme/batik-svgpathparser-1.7.jar"; // Append Java 3D Jars depending on the platform if (navigator.platform.match("Win.*")) { if (navigator.platform.match(".*64")) { jars += ",files/theme/java3d_windows_x64.jar"; } else { jars += ",files/theme/java3d_windows_i386.jar"; } } else if (navigator.platform.match("Mac.*")) { javaMinimumVersion = "1.5"; jars += ",files/theme/java3d_macosx.jar"; } else if (navigator.platform.match("Linux.*")) { javaMinimumVersion = "1.6"; // OpenJDK doesn't give its subversion if (navigator.platform.match(".*64")) { jars += ",files/theme/java3d_linux_x64.jar"; } else { jars += ",files/theme/java3d_linux_i386.jar"; } } else { jars += ",files/theme/java3d.jar"; }
France
Joined: Nov 7, 2005
Post Count: 9425
Status:
Offline
Re: Integrating Sweet Home 3D Viewer in a webpage
Actually, the changes you made on the value of the jars variable and codebase attribute have an effect only with Java 6. Under Java 7 and further, I think that the JRE always uses the jnlp_embedded parameter after decoding it from Base 64. As the jnlp_embedded parameter proposed in the default configuration tries to download jar files from lib subfolder, that would explain the error you reported. To fix it, you should download the SweetHome3DViewer.jnlp file that was used to generate the current value of the jnlp_embedded parameter, update the href attribute of its <jar> elements with a text editor and save it. Then, convert the modified file to Base 64 and copy the encoded string in jnlp_embedded parameter.
By the way, there must be a typo in your homeURL parameter where a colon is missing after http.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator
Belgique
Joined: Nov 26, 2014
Post Count: 10
Status:
Offline
Re: Integrating Sweet Home 3D Viewer in a webpage
Alright, I managed to code it right. Apparantly, it needed to be encoded with a certain character encryption.
Anyway, now I have another problem. The app loads correctly. But after loading, it stays blank or I get a JNLP Signing Exception error. It reads "Cannot validate signature of the launch file. The version signed does not correspond to the version downloaded."
Belgique
Joined: Nov 26, 2014
Post Count: 10
Status:
Offline
Re: Integrating Sweet Home 3D Viewer in a webpage
I've tried to see where this error could come from. Apparently, just modifying a tiny bit the jnlp file then converting it generates this error. That is quite bothering if I cannot modify this file... I have no idea of how the Java signatures work.
France
Joined: Nov 7, 2005
Post Count: 9425
Status:
Offline
Re: Integrating Sweet Home 3D Viewer in a webpage
I forgot about the JNLP file in the SweetHome3DViewer.jar that should match the one you change. Updating it in the jar file isn't enough, you will have also to sign again all the jars with your own software certificate to make it work. If you don't have a certificate, you may try also to simply remove the JNLP file from SweetHome3DViewer.jar. I think it will work but the JRE will display a warning.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator
Belgique
Joined: Nov 26, 2014
Post Count: 10
Status:
Offline
Re: Integrating Sweet Home 3D Viewer in a webpage
Alright, I tried what you suggested. I get a ClassNotFoundException error. It says the class com.eteks.sweethome3d.applet.SweetHome3DViewer cannot be found. This is strange as it is in fact inside the JAR file...
Belgique
Joined: Nov 26, 2014
Post Count: 10
Status:
Offline
Re: Integrating Sweet Home 3D Viewer in a webpage
I forgot to mention what I actually did.
Since I don't have any certificates, I tried removing the JNLP. I removed the JNLP folder in the JAR and I removed every references to the JNLP file from the MANIFEST file inside the META-INF folder.
After this, I repacked the JAR file. I removed the references to the JNLP from the HTML file and tried to load it.
After the app has loaded, I get the error previously mentionned.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> <script language="JavaScript" src="http://java.com/js/deployJava.js"> </script> <script> var javaMinimumVersion = "1.6.0_10"; // The first version with Java Plugin 2 var jars = "SweetHome3DViewer.jar,batik-svgpathparser-1.7.jar"; // Append Java 3D Jars depending on the platform if (navigator.platform.match("Win.*")) { if (navigator.platform.match(".*64")) { jars += ",java3d_windows_x64.jar"; } else { jars += ",java3d_windows_i386.jar"; } } else if (navigator.platform.match("Mac.*")) { javaMinimumVersion = "1.5"; jars += ",java3d_macosx.jar"; } else if (navigator.platform.match("Linux.*")) { javaMinimumVersion = "1.6"; // OpenJDK doesn't give its subversion if (navigator.platform.match(".*64")) { jars += ",java3d_linux_x64.jar"; } else { jars += ",java3d_linux_i386.jar"; } } else { jars += ",java3d.jar"; }