0

I have a web application hosted on Tomcat 8 serving applets. The HTML pages with applets work fine when i am accessing them over http. I have further configured SSL over nginx reverse proxy. Now when i try to access the same pages over https, i am getting a ClassNotFoundException for the applets. I tried googling but could not get a clear solution. What could be going wrong?

Edit: I have applets embedded in Login.html using <applet> tag, which further is a part of angularjs web application hosted on Tomcat8 container. The applet is bundled in the jar file. The applet tag is HTML is as follows;

  <applet
        id="ABCobject"
        code="com.xxx.xxxxx.XXXXXApplet.class"
        archive="XXXXXApplet.jar"
    >
    </applet>

Nginx configuration is as follows:

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/ /;
}

}

The stack trace of the error is

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)
Tejas
  • 1
  • 1
  • Can you elucidate more: you have some applets as static content in a Tomcat container, how do you generate the pages? Through servlets, JSP or as static content? What is the exception stack trace you are getting? What is nginx reverse proxy configuration? – Piotr P. Karwasz Nov 24 '19 at 10:33
  • @PiotrP.Karwasz: I have edited my question with more details. Please let me know if any more information is required. Thanks. – Tejas Nov 24 '19 at 10:59
  • I would guess, that the browser could not download the applet. Did you try downloading it directly? How does your `` tag look like? – Piotr P. Karwasz Nov 24 '19 at 11:25
  • @PiotrP.Karwasz: I have edited the question to include the applet tag. Yes the browser is not downloading the applet, when i access it over "https". It works fine when i access it over "http" – Tejas Nov 24 '19 at 11:30
  • You can check in both `nginx` access and erro log and `Tomcat` access log if nginx is asking the right URI from Tomcat. – Piotr P. Karwasz Nov 24 '19 at 11:46
  • Not much of a help in logs! – Tejas Nov 24 '19 at 14:01
  • You should see a request for `/XXXXXApplet.jar` in nginx access log followed by a request for `/xxx-web-app-xxx/XXXXXApplet.jar` in Tomcat's access log. – Piotr P. Karwasz Nov 24 '19 at 18:12

0 Answers0