我在 Tomcat 8 上托管了一个 Web 应用程序,用于提供小程序。当我通过 http 访问带有小程序的 HTML 页面时,它们工作正常。我已通过 nginx 反向代理进一步配置了 SSL。现在,当我尝试通过 https 访问相同的页面时,我得到了小程序的 ClassNotFoundException。我尝试谷歌搜索,但找不到明确的解决方案。可能出了什么问题?
编辑:我使用标签将小程序嵌入到 Login.html 中<applet>
,该标签是托管在 Tomcat8 容器上的 angularjs Web 应用程序的一部分。小程序捆绑在 jar 文件中。小程序标签的 HTML 如下;
<applet
id="ABCobject"
code="com.xxx.xxxxx.XXXXXApplet.class"
archive="XXXXXApplet.jar"
>
</applet>
Nginx配置如下:
server {
listen 80;
server_name mxxx.xxxxxxx.in;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name mxxx.xxxxxxx.in;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
ssl_certificate /etc/ssl/certs/__xxxxxxx_in.crt;
ssl_certificate_key /etc/ssl/private/wild-xxxxxxx-in.key;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
ssl_ciphers ECDH+AESGCM:ECDH+AES256:ECDH+AES128:DH+3DES:!ADH:!AECDH:!MD5;
ssl_dhparam /etc/nginx/dhparam.pem;
ssl_ecdh_curve secp384r1;
ssl_session_timeout 10m;
ssl_session_cache shared:SSL:10m;
resolver 172.18.2.128 8.8.8.8 valid=300s;
resolver_timeout 5s;
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload";
add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
access_log /var/log/nginx/xxxx_access.log;
error_log /var/log/nginx/xxxx_error.log;
location / {
proxy_pass http://mxxx.xxxxxxx.in:8080/xxx-web-app-xxx/;
proxy_buffering off;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
proxy_cookie_path /web-appxxx/ /;
}
}
错误的堆栈跟踪是
java.lang.ClassNotFoundException: com.xxx.xxxx.XXXXApplet.class
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)