Java 4k Resources Thread

Clever! =D thumbs up

Hrm. I don’t have the knowhow to do that. I suppose I can just upload a JAR at this point.

Not sure if it is just me but i am no longer able to upload a jar to Riven’s tool… i get the following message after what seems to be a time out:


null
Connection: close

It works here. What are you uploading? Sourcecode or a JAR? How big?

a jar file of 7k

I have attached it to this post.

Fixed. The latest update ‘featuring’ that Proguard hint b0rked it.

Seems like you still have room to spare :slight_smile:
x.progrd.kz.pack.gz => 3443 bytes

groovy!

yeah, I have not yet finished the game logic yet, nor have optimised the code for space yet. :stuck_out_tongue:

I do have my graphics and the 20 levels done. Just not merged into one resource file yet.

So I am hoping i will be able to get some sound in.

lol… not to be a spoil sport and all but now the option to upload a JAR seems to have gone… I tried both IE 5 and firefox 3.5.6

Wierd! it came back… i guess Riven was doing something in the background at the time.

I haven’t touched it :-X

i have reached my monthly download quota and so my internet connection has been shaped to 64KiBs perhaps that has something to do with it.

Ah well it seems to be working for me now.

;D

Damn. That option is only available when the service could identify you as a JGO member, as a silly way to prevent untraceable people from uploading massive JARs.

You were probably accessing it from another IP, and it only was able to identify you after you made the post on JGO :slight_smile:

Funny how innocent features tend to backfire :persecutioncomplex:

well it was effective in stopping unknown ips :stuck_out_tongue:

lol it seems i am good at finding features with your tool Riven :slight_smile:

I have created an experiment to see whether embedding data into the class would give a smaller result as compared to a seperate resource file.

The embedded data class file comes to 53k, the source file is 72k. I was expecting the java compiler to fail as i thought there was a 32k limit on the size of strings but it seems to compile and run fine locally in an applet viewer.

The source is attached to this post.

Your tool outputs the following and does not progress to the download section:


entered work queue
sourcecode
OK
javac

Note: /home/indiespot/http-files/4k/run.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

OK
jar
OK
proguard
OK
pack200
OK:47682
7z
OK
kzip
OK Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143
bjwflate
Exit value: 143
pack200
OK:45700
7z
OK
kzip
Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143Exit value: 143

kZip was unable to zip it, due to a 2sec timeout, after which I kill the process, and hence there is no pack.gz file to copy to the download location, resulting in a NullPointerException. Fixed now by bumping the timeout to 10sec, as every kzip on your massive input took 3sec.

I don’t think I like it taking so long… I put the timeout back there, as it takes a few minutes, at 100% CPU.

This was the output:

run.java => 73101 bytes
run.class => 50709 bytes
run.normal.jar => 7110 bytes
run.progrd.jar => 5700 bytes
run.normal.pack => 47682 bytes
run.progrd.pack => 45700 bytes
run.normal.7z.pack.gz => 6001 bytes
run.progrd.7z.pack.gz => 4944 bytes
run.normal.kz.pack.gz => 5142 bytes
run.progrd.kz.pack.gz => 4283 bytes
run.normal.bj.pack.gz => 5309 bytes
run.progrd.bj.pack.gz => 4463 bytes

The following code will not compile, but will get you started running kZip and BJWflate bruteforce.

It mainly shows how not to properly code in Java :wink:


   private static int bruteforceKzip(PrintStream html, File packFile, File packGzFile, int splitOffset, int splitStep, int steps, int reruns) throws IOException
   {
      File min = packGzFile;
      File[] dst = new File[steps];
      int minSplit = -1;
      for (int i = 0; i < dst.length; i++)
      {
         dst[i] = new File(packGzFile.getParentFile(), i + "_" + packGzFile.getName());
         int split = splitOffset + i * splitStep;

         for (int k = 0; k < reruns; k++)
         {
            if (kzip_deflopt_gz(html, packFile, dst[i], split, k != 0))
            {
               if (dst[i].length() != 0 && ((min == null || min.length() == 0) || dst[i].length() < min.length()))
               {
                  min = dst[i];
                  minSplit = split;
               }
            }
         }
      }

      if (minSplit != -1)
         FileUtil.copyFile(min, packGzFile);

      for (int i = 0; i < dst.length; i++)
         dst[i].delete();
      return minSplit;
   }

   private static int bruteforceBjwflate(PrintStream html, File packFile, File packGzFile, int maxSplit) throws IOException
   {
      File min = packGzFile;
      int minSplit = -1;

      List<File> dsts = new ArrayList<File>();

      for (int splitSize = 4, i = 0; splitSize <= maxSplit; splitSize += (splitSize <= 12 ? 4 : (splitSize <= 32 ? 8 : (splitSize <= 128 ? 16 : 32))), i++)
      {
         File dst = new File(packGzFile.getParentFile(), splitSize + "_" + packGzFile.getName());

         if (bjwflate_deflopt_gz(html, packFile, dst, splitSize, false))
         {
            if (dst.length() != 0 && ((min == null || min.length() == 0) || dst.length() < min.length()))
            {
               min = dst;
               minSplit = splitSize;
            }
         }
      }

      if (minSplit != -1)
         FileUtil.copyFile(min, packGzFile);

      for (File dst : dsts)
         dst.delete();
      return minSplit;
   }

   public static boolean kzip_deflopt_gz(PrintStream html, File src, File dst, int splitSize, boolean rn)
   {
      System.out.println("kzip:" + splitSize + " @ " + System.currentTimeMillis());

      File zip = new File(src.getParentFile(), src.getName() + ".zip");
      File dir = new File(src.getParentFile(), "tmp_" + System.nanoTime());
      dir.mkdir();

      try
      {
         // kzip
         try
         {
            FileUtil.copyFile(src, new File(dir, src.getName()));

            String[] cmds = new String[rn ? 5 : 4];
            cmds[0] = "/root/kzipmix-static/kzip-static";
            cmds[1] = "-y";
            cmds[2] = "-b" + splitSize;
            if (rn)
               cmds[3] = "-rn";
            cmds[rn ? 4 : 3] = zip.getAbsolutePath();

            final Process proc = Runtime.getRuntime().exec(cmds, null, dir);
            ByteArrayOutputStream stdout = new ByteArrayOutputStream();
            ByteArrayOutputStream stderr = new ByteArrayOutputStream();
            Streams.asynchronousTransfer(proc.getInputStream(), stdout);
            Streams.asynchronousTransfer(proc.getErrorStream(), stderr);

            final CountdownLatch latch = new CountdownLatch();

            new Thread()
            {
               public void run()
               {
                  if (!latch.waitFor(2 * 1000))
                  {
                     proc.destroy();
                  }
               }
            }.start();

            int exit = proc.waitFor();
            latch.countdown();

            if (splitSize == 0 && !rn)
               html.append("<h1>kzip</h1>");

            if (stderr.size() != 0)
            {
               html.append("<pre>");
               html.append("<font color=blue>" + Text.utf8(stdout.toByteArray()) + "</font>");
               html.append("</pre>");
               html.append("<pre>");
               html.append("<font color=red>" + Text.utf8(stderr.toByteArray()) + "</font>");
               html.append("</pre>");
            }
            if (exit != 0)
               html.append("<font color=green>Exit value: " + exit + "</font>");
            html.flush();

            if (exit != 0)
               return false;
         }
         catch (Exception exc)
         {
            html.append("<pre>");
            html.append("<font color=purple>EXCEPTION: " + exc.getClass().getName() + "</font>");
            html.append("</pre>");
            html.flush();

            exc.printStackTrace();
            return false;
         }

         // gz
         try
         {
            zip2gz(new FileInputStream(zip), new FileOutputStream(dst));
            html.append("<font color=blue>OK </font>");
            html.flush();
         }
         catch (IOException exc)
         {
            html.append("<pre>");
            html.append("<font color=purple>EXCEPTION: " + exc.getClass().getName() + "</font>");
            html.append("</pre>");
            html.flush();

            exc.printStackTrace();
            return false;
         }

         return true;
      }
      finally
      {
         zip.delete();
         FileUtil.deleteDirectory(dir, true);
      }
   }

   public static boolean bjwflate_deflopt_gz(PrintStream html, File src, File dst, int splitSize, boolean noprep)
   {
      System.out.println("bjwflate:" + splitSize + " @ " + System.currentTimeMillis());

      File zip = new File(src.getParentFile(), src.getName() + ".zip");

      try
      {
         // bjwflate
         try
         {
            String[] cmds = new String[noprep ? 6 : 5];
            cmds[0] = "/usr/bin/wine";
            cmds[1] = "/root/BJWFlate.exe";
            cmds[2] = "-y";
            if (noprep)
               cmds[3] = "-n";
            cmds[noprep ? 4 : 3] = zip.getAbsolutePath();
            cmds[noprep ? 5 : 4] = src.getAbsolutePath();

            final Process proc = Runtime.getRuntime().exec(cmds, null);
            ByteArrayOutputStream stdout = new ByteArrayOutputStream();
            ByteArrayOutputStream stderr = new ByteArrayOutputStream();
            Streams.asynchronousTransfer(proc.getInputStream(), stdout);
            Streams.asynchronousTransfer(proc.getErrorStream(), stderr);

            final CountdownLatch latch = new CountdownLatch();

            new Thread()
            {
               public void run()
               {
                  if (!latch.waitFor(2 * 1000))
                  {
                     proc.destroy();
                  }
               }
            }.start();

            int exit = proc.waitFor();
            latch.countdown();

            if (splitSize == 4)
               html.append("<h1>bjwflate</h1>");

            if (stderr.size() != 0)
            {
               html.append("<pre>");
               html.append("<font color=blue>" + Text.utf8(stdout.toByteArray()) + "</font>");
               html.append("</pre>");
               html.append("<pre>");
               html.append("<font color=red>" + Text.utf8(stderr.toByteArray()) + "</font>");
               html.append("</pre>");
            }
            if (exit != 0)
               html.append("<font color=green>Exit value: " + exit + "</font>");
            html.flush();

            if (exit != 0)
               return false;
         }
         catch (Exception exc)
         {
            html.append("<pre>");
            html.append("<font color=purple>EXCEPTION: " + exc.getClass().getName() + "</font>");
            html.append("</pre>");
            html.flush();

            exc.printStackTrace();
            return false;
         }

         // deflopt
         {
            //deflopt(html, zip);
         }

         // gz
         try
         {
            zip2gz(new FileInputStream(zip), new FileOutputStream(dst));
            html.append("<font color=blue>OK </font>");
            html.flush();
         }
         catch (IOException exc)
         {
            html.append("<pre>");
            html.append("<font color=purple>EXCEPTION: " + exc.getClass().getName() + "</font>");
            html.append("</pre>");
            html.flush();

            exc.printStackTrace();
            return false;
         }

         return true;
      }
      finally
      {
         zip.delete();
      }
   }

Continuing this hideous code…


   public static boolean gz_7z(PrintStream html, File src, File dst)
   {
      System.out.println("7z");

      try
      {
         String[] cmds = new String[4];
         cmds[0] = "/root/p7zip_9.04/bin/7z";
         cmds[1] = "a";
         cmds[2] = dst.getAbsolutePath();
         cmds[3] = src.getAbsolutePath();

         Process proc = Runtime.getRuntime().exec(cmds);
         ByteArrayOutputStream stdout = new ByteArrayOutputStream();
         ByteArrayOutputStream stderr = new ByteArrayOutputStream();
         Streams.asynchronousTransfer(proc.getInputStream(), stdout);
         Streams.asynchronousTransfer(proc.getErrorStream(), stderr);
         int exit = proc.waitFor();

         html.append("<h1>7z</h1>");
         if (stderr.size() != 0)
         {
            html.append("<pre>");
            html.append("<font color=blue>" + Text.utf8(stdout.toByteArray()) + "</font>");
            html.append("</pre>");
            html.append("<pre>");
            html.append("<font color=red>" + Text.utf8(stderr.toByteArray()) + "</font>");
            html.append("</pre>");
         }
         if (exit != 0)
            html.append("<font color=green>Exit value: " + exit + "</font>");
         else
            html.append("<font color=blue>OK</font>");
         html.flush();

         if (exit != 0)
            return false;
         return true;
      }
      catch (Exception exc)
      {
         html.append("<pre>");
         html.append("<font color=purple>EXCEPTION: " + exc.getClass().getName() + "</font>");
         html.append("</pre>");
         html.flush();

         exc.printStackTrace();
         return false;
      }
   }


   public static void zip2gz(InputStream in, OutputStream out) throws IOException
   {
      in = new BufferedInputStream(in);
      out = new BufferedOutputStream(out);

      // Start by writing a gzip header.
      // Magic.
      out.write(0x1f);
      out.write(0x8b);
      // Compression method: inflate.
      out.write(0x08);
      // Flags: we include no optional extras.
      out.write(0x00);
      // Timestamp: unavailable.
      out.write(0x00);
      out.write(0x00);
      out.write(0x00);
      out.write(0x00);
      // Extra flags: none.
      out.write(0x00);
      // OS: unknown.
      out.write(0xff);

      // The next block of output is the compressed data. We need to process
      // the zip file header to find it and know how long it is.
      // local file header signature     4 bytes  (0x04034b50)
      // version needed to extract       2 bytes
      // general purpose bit flag        2 bytes
      // compression method              2 bytes
      // last mod file time              2 bytes
      // last mod file date              2 bytes
      //   Total so far:                14 bytes
      for (int i = 0; i < 14; i++)
         in.read();
      // crc-32                          4 bytes
      int crc1 = in.read();
      int crc2 = in.read();
      int crc3 = in.read();
      int crc4 = in.read();
      // compressed size                 4 bytes
      int cmpSz = (in.read() & 0xff) + ((in.read() & 0xff) << 8) + ((in.read() & 0xff) << 16) + ((in.read() & 0xff) << 24);
      // uncompressed size               4 bytes
      int ucmpSz1 = in.read();
      int ucmpSz2 = in.read();
      int ucmpSz3 = in.read();
      int ucmpSz4 = in.read();
      // file name length                2 bytes
      int nameLen = (in.read() & 0xff) + ((in.read() & 0xff) << 8);
      // extra field length              2 bytes
      int xfLen = (in.read() & 0xff) + ((in.read() & 0xff) << 8);
      // file name (variable size)
      for (int i = 0; i < nameLen; i++)
         in.read();
      // extra field (variable size)
      for (int i = 0; i < xfLen; i++)
         in.read();

      // Data follows, so we can copy it to the output.
      byte[] buf = new byte[4096];
      while (cmpSz > 0)
      {
         int desired = cmpSz > buf.length ? buf.length : cmpSz;
         int len = in.read(buf, 0, desired);
         if (len == 0)
            throw new EOFException();
         out.write(buf, 0, len);
         cmpSz -= len;
      }

      // The output still needs the CRC32 and the uncompressed size.
      out.write(crc1);
      out.write(crc2);
      out.write(crc3);
      out.write(crc4);
      out.write(ucmpSz1);
      out.write(ucmpSz2);
      out.write(ucmpSz3);
      out.write(ucmpSz4);

      // Done. Be tidy.
      out.close();
      in.close();
   }

I thought it might be some thing like that :slight_smile:

Thanks for the code, i did something similar for my obsolete 4KJO tool.

This was just an experiment… which judging by the results you have listed was a failure :stuck_out_tongue:

My non-embedded version is currently sitting at 4073 bytes so i will stick with that and will just have to cannibalize some features of the game inorder to complete my entry.

Cheers

For people who don’t have a properly configured web server with which to test. This is a bit paranoid, so it shouldn’t let your box get rooted.

package com.akshor.pjt33.server;

import java.io.*;
import java.net.*;
import java.util.*;

/**
 * A hacky HTTP daemon. Not designed for heavyweight usage; incorporates basic
 * security, but nothing fancy; does support .pack.gz (so useful for Java4k
 * testing).
 * @author pjt33
 */
public class HTTPD implements Runnable
{
	private static File rootDir;

	private final Socket sock;

	private String request;

	private Object resource;

	private int responseCode;

	private Map<String, String> requestHeaders = new HashMap<String, String>();

	private Map<String, String> responseHeaders = new HashMap<String, String>();

	private HTTPD(Socket sock)
	{
		this.sock = sock;
	}

	public static void main(String[] args) throws IOException
	{
		// Process arguments.
		if (args.length < 1 || args.length > 2) usage();
		rootDir = new File(args[0]);
		if (!rootDir.isDirectory()) usage();
		int port = 8080;
		if (args.length == 2)
		{
			try
			{
				port = Integer.parseInt(args[1]);
			}
			catch (NumberFormatException nfe)
			{
				usage();
			}
		}

		// Ready to go.
		ServerSocket serverSock = new ServerSocket(port);
		while (true)
		{
			Socket sock = serverSock.accept();
			// Paranoid security check since this is for local testing.
			if (!sock.getInetAddress().isLoopbackAddress())
			{
				System.out.println("Denying request from non-local IP "+sock.getInetAddress());
				sock.close();
				continue;
			}

			new Thread(new HTTPD(sock)).start();
		}
	}

	private static void usage()
	{
		System.err.println("Usage: java HTTPD <root-dir> [port]");
		System.err.println("Default port is 8080");
		System.exit(-1);
	}

	public void run()
	{
		try
		{
			final String utf8 = "UTF-8";
			BufferedOutputStream outbin = new BufferedOutputStream(sock.getOutputStream());
			PrintWriter out = new PrintWriter(new OutputStreamWriter(outbin, utf8));
			BufferedReader in = new BufferedReader(new InputStreamReader(sock.getInputStream(), utf8));

			InetAddress addr = sock.getInetAddress();
			String line;
			while ((line = in.readLine()) != null)
			{
				// First line
				if (request == null)
				{
					// Line should be of the format
					// METHOD resource HTTP/1.x
					String[] bits = line.split(" ");
					if (bits.length == 3)
					{
						if ("GET".equals(bits[0]))
						{
							request = bits[1];
						}
						else
						{
							// We don't support POST, HEAD, etc.
							responseCode = 501;
							resource = "Not supported";
						}
					}
					else
					{
						responseCode = 400;
						resource = "Bad request";
						break;
					}
				}
				// Blank line indicates end of headers
				else if (line.length() == 0)
				{
					break;
				}
				else
				{
					// Parse header.
					String[] bits = line.split(":");
					if (bits.length == 2)
					{
						requestHeaders.put(bits[0].trim().toLowerCase(), bits[1].trim().toLowerCase());
					}
					// else ignore
				}
			}

			// If we have a valid request, handle it.
			if (responseCode == 0)
			{
				handleRequest();
			}

			// Some handling is the same-ish for success or failure.
			int responseSize = 0;
			if (responseCode == 0 || resource == null)
			{
				responseCode = 501;
				resource = "Internal error";
			}
			if (resource instanceof String)
			{
				resource = resource.toString().getBytes(utf8);
				responseHeaders.put("Content-Encoding", utf8);
				responseHeaders.put("Content-Type", "text/plain; charset=UTF-8");
			}
			if (resource instanceof byte[]) responseSize = ((byte[])resource).length;
			else if (resource instanceof File) responseSize = (int)((File)resource).length();
			responseHeaders.put("Content-Length", Integer.toString(responseSize));

			// Reply.
			out.println("HTTP/1.1 "+responseCode);
			for (Map.Entry<String, String> e : responseHeaders.entrySet())
			{
				out.println(e.getKey()+": "+e.getValue());
			}
			out.println();
			// Ensure that we can write bytes to the binary stream ok.
			out.flush();
			if (resource instanceof byte[])
			{
				outbin.write((byte[])resource);
			}
			else if (resource instanceof File)
			{
				FileInputStream fis = new FileInputStream((File)resource);
				byte[] buf = new byte[4096];
				int len;
				while ((len = fis.read(buf)) != -1)
				{
					outbin.write(buf, 0, len);
				}
				fis.close();
			}

			// Minimal logging
			System.out.println(new Date()+" ["+addr+"] "+responseCode+" ("+responseSize+" bytes) for "+request);

			outbin.close();
			in.close();
		}
		catch (IOException ioe)
		{
			ioe.printStackTrace();
		}
	}

	private void handleRequest()
	{
		// The request was correctly formatted. Decode it, perform security
		// checks, find the corresponding resource, and set up suitable response
		// headers.
		try
		{
			request = URLDecoder.decode(request, "UTF-8");
		}
		catch (UnsupportedEncodingException ufe)
		{
			// Failure to support UTF-8 is a problem with the Java environment.
			InternalError err = new InternalError();
			err.initCause(ufe);
			throw err;
		}

		// Super-paranoid check for attempts to access files outside the
		// permitted root directory.
		if (request.indexOf("..") >= 0)
		{
			responseCode = 401;
			resource = "Unauthorized";
			return;
		}

		// Basic processing.
		if (!request.startsWith("/"))
		{
			request = "/" + request;
		}
		File file = new File(rootDir, request);
		if (!file.isFile())
		{
			responseCode = 404;
			resource = "Not found";
		}
		else
		{
			responseCode = 200;
			resource = file;
			String contentType = getContentType(request);
			if (contentType != null)
			{
				responseHeaders.put("Content-Type", contentType);
			}
			else
			{
				responseHeaders.put("Content-Type", "application/x-unknown");
			}
		}

		// Extra hack for .pack.gz
		if (request.endsWith(".jar") &&
			requestHeaders.get("accept-encoding") != null &&
			requestHeaders.get("accept-encoding").contains("pack200-gzip"))
		{
			// We check for two possibilities.
			File _jar_pack_gz = new File(rootDir, request+".pack.gz");
			File _pack_gz = new File(rootDir, request.replace("jar$", "pack.gz"));
			if (_jar_pack_gz.isFile() || _pack_gz.isFile())
			{
				responseCode = 200;
				resource = _jar_pack_gz.isFile() ? _jar_pack_gz : _pack_gz;
				responseHeaders.put("Content-Type", "application/x-java-archive");
				responseHeaders.put("Content-Encoding", "pack200-gzip");
			}
		}
	}

	private String getContentType(String request)
	{
		// Note: we're not doing magic on the file or anything fancy
		if (request.endsWith(".html")) return "text/html";
		if (request.endsWith(".jar")) return "application/x-java-archive";
		return null;
	}
}

Sorry if this was already answered elsewhere but using Riven’s compression tool (http://www.indiespot.net/app/java-four-kay), I always get a ClassNotFoundException exception. Also, does the tool sign the class? Here is the html page I use for local deployment testing, using the deployment toolkit:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
	<script src="http://java.com/js/deployJava.js"></script>
	<script>
	    var attributes = {
	        codebase:'.',
	        code:'G',
	        archive:'bf9fa6fd1c80baa50a581f690bd67bb2.6.pack.gz',
	        width:'800', height:'600'
	    };
	
	    var parameters = {
			separate_jvm:'true',
        	java_arguments:'-Djnlp.packEnabled=true',
	    };
	
	    deployJava.runApplet(attributes, parameters, '1.5'); 
	</script>
  </head>
  <body>
  </body>
</html>

Here is the stack trace:

Java Plug-in 1.6.0_18
Using JRE version 1.6.0_18-b07 Java HotSpot(TM) Client VM
User home directory = C:\Users\admin
----------------------------------------------------
c:   clear console window
f:   finalize objects on finalization queue
g:   garbage collect
h:   display this help message
l:   dump classloader list
m:   print memory usage
o:   trigger logging
q:   hide console
r:   reload policy configuration
s:   dump system and deployment properties
t:   dump thread list
v:   dump thread stack
x:   clear classloader cache
0-5: set trace level to <n>
----------------------------------------------------


security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.
security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws
security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws
security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy
security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy
security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy,com.sun.jnlp
security: property package.definition value null
security: property package.definition new value com.sun.javaws
security: property package.definition value com.sun.javaws
security: property package.definition new value com.sun.javaws,com.sun.deploy
security: property package.definition value com.sun.javaws,com.sun.deploy
security: property package.definition new value com.sun.javaws,com.sun.deploy,com.sun.jnlp
security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy,com.sun.jnlp
security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy,com.sun.jnlp,org.mozilla.jss
security: property package.definition value com.sun.javaws,com.sun.deploy,com.sun.jnlp
security: property package.definition new value com.sun.javaws,com.sun.deploy,com.sun.jnlp,org.mozilla.jss
basic: Added progress listener: sun.plugin.util.GrayBoxPainter$GrayBoxProgressListener@1de3f2d
basic: load: class G not found.
load: class G not found.
java.lang.ClassNotFoundException: G
	at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.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)
Exception: java.lang.ClassNotFoundException: G
security: Accessing keys and certificate in Mozilla user profile: null

Any idea what’s happening here?

Thanks