Hi

I know probably you have seen this question being asked a million times and I have tried to follow all the suggested solutions with no luck. Below is my setup:

1. OS Windows 7
2. My server file: C:\soc\NetServer.class
3. Server Run at command prompt: C:\Soc>java -Djava.security.policy=socall NetServer
Server Started...
(no problem with server)
4:My client file: C:\Soc\NetApplet.class
5.My HTML file: C:\Soc\SocketTest.html
6.My policy file:C:\Soc\socall.policy
7. Tried running the appletviewer from command prompt and calling the html file from browser and in both instances get the same access denied error.

Command Line: c:\Soc>appletviewer -J-Djava.security.policy=socall C:\Soc\SocketTest.html
Internet Explorer: C:\Soc\SocketTest.html

Below are the code files:

Server:

Java Code:
[I][SIZE=1]import java.io.*;
import java.net.*;
import java.util.*;

public class NetServer {
    public static void main(String[] args) {
	try
	{
		ServerSocket serverSocket = new ServerSocket(1099);
System.out.println("Server Started...");
Socket clientSocket = serverSocket.accept();

		BufferedReader fromClient = new BufferedReader(
                	new InputStreamReader(clientSocket.getInputStream()));
        	PrintWriter toClient = 
			new PrintWriter(clientSocket.getOutputStream(), true);
		System.out.println("Server Started..");
		while (true) 
		{
			Integer numb =  new Integer(fromClient.readLine());
			System.out.println("received: " + numb.intValue());
			toClient.println(numb.intValue()+1);
		}
	}
	catch(IOException ex)
	{
		System.err.println(ex);
	}

    }
}[/SIZE][/I]
Client:

Java Code:
[SIZE=1]

import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.net.*;

public class NetApplet extends Applet implements ActionListener {
    TextField numbField;
    Label display, errorMgs;
    Socket socket;

    public void init() {
    	
    	numbField = new TextField(6);
        this.add(numbField);

        Button button = new Button("Send");
        this.add(button);
        button.addActionListener(this);

		errorMgs = new Label("Gip");
		this.add(errorMgs);

		display = new Label("No number");
		this.add(display);

		
		validate();
		
        try {
            socket = new Socket("127.0.0.1",1099);
        } catch (UnknownHostException e) {
		errorMgs.setText( "Unknown host" + errorMgs.getText());
            System.out.println("Unknown host");
        } catch (IOException e) {
errorMgs.setText("IO Exception" + e.getMessage() + errorMgs.getText());
            System.out.println("IO Exception");
            return;
        }

        
    }

    public void actionPerformed(ActionEvent e)
    {
        int numb = 0;
	String numbStr = null;
	BufferedReader fromServer = null;
	PrintWriter toServer = null;

        String actionCommand = e.getActionCommand();
        if (e.getSource() instanceof Button)
            if (actionCommand.equals("Send"))
            {
       		try 
		{
            		numb = Integer.parseInt(numbField.getText());
        	} 
		catch (NumberFormatException ex) 
		{
            		System.out.println("Number Format Exception");
errorMgs.setText("Number Format Exception" + errorMgs.getText());
        	}

		try 
		{
			fromServer = new BufferedReader(
				new InputStreamReader(socket.getInputStream()));
			toServer = 
				new PrintWriter(socket.getOutputStream(), true);
		}
		catch (IOException ex) 
		{
            		System.out.println("IO Exception");
			errorMgs.setText("IO Exception2" + errorMgs.getText());
        	}
	
        	toServer.println(numb);

        	try 
		{
            		numbStr = fromServer.readLine();
        	} 
		catch (IOException ex) 
		{
            		System.out.println("Applet receive failed:");
	  		errorMgs.setText("Applet receive failed:" + errorMgs.getText());
        	}

        	display.setText(numbStr);
           }
    }
}
[/SIZE]
HTML File:
Java Code:
<HTML>
<HEAD>
<TITLE>Test</TITLE>
</HEAD>
<BODY>
<P>
<CENTER>
<APPLET CODE="NetApplet.class" width="500" height="500">
</APPLET>
</CENTER>
</BODY>
</HTML>
Policy file socall.policy
Java Code:
/* AUTOMATICALLY GENERATED ON Fri Dec 07 01:26:39 EST 2012*/
/* DO NOT EDIT */

grant codeBase "file://C:\soc" {
  permission java.security.AllPermission;
};