This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Five Lines of Code and have Christian Clausen on-line!
See this thread for details.
Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!

Archana Jain

Greenhorn
+ Follow
since Nov 03, 2013
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Archana Jain

Thanks the issue got resolved by using an applet tag
6 years ago
One more thing I forgot to write previously is that I am running the code from AWS server. And there only I am getting the error.
6 years ago
Yesterday I changed the security group by adding a new rule, but forgot to apply the security rule changes. That is why it was not working yesterday.
Hi,
I am running an applet with the code as below:-

<!DOCTYPE html>
<html>
<head>
<style>
.pos_right
{
position:relative;
left:950px;
top:274px;
}
</style>
</head>
<body>
<div id="container" style="width:1200px">

<div id="header" style="background-color:#E55451;">
<h2 style="margin:auto;width:80%;height:50%;">CHESS GAME</h2></div>

<div id="menu" style="background-color:#E77471;height:450px;width:200px;float:left;">
</div>
<div class="pos_left" style="background-color:#EEEEEE;height:450px;width:1000px;float:left;">
<object type="application/x-java-applet" width="100" height="100">
<param name="code" value="chess.ChessClient" />
<param name="archive" value="ChessClient.jar" />
<param name="archive" value="json-simple-1.1.1_1.jar" />
Applet failed to run. No Java plug-in was found.
</object>
<div class="pos_right">
<object type="application/x-java-applet" width="50" height="70">
<param name="code" value="chat.ChatClient" />
<param name="archive" value="ChatClient.jar" />
<param name="java_arguments" value="-Djava.security.manager"/>
Applet failed to run. No Java plug-in was found.
</object>
</div>
</div>
<div id="footer" style="background-color:#E55451;clear:both;text-align:center;">
Archana Jain</div>
</div>
</body>
</html>


The ChessClient.jar is available in the directory and has the below contents:-

[root@ip-172-31-3-228 source]# jar cvfm ChessClient.jar mymanifest.txt chess
added manifest
adding: chess/(in = 0) (out= 0)(stored 0%)
adding: chess/ChessBoard$3.class(in = 796) (out= 507)(deflated 36%)
adding: chess/image/(in = 0) (out= 0)(stored 0%)
adding: chess/image/Black_king_w.jpg(in = 1621) (out= 1476)(deflated 8%)
adding: chess/image/White_pawn_c.jpg(in = 1273) (out= 1113)(deflated 12%)
adding: chess/image/Black_Knight_w.jpg(in = 1517) (out= 1365)(deflated 10%)
adding: chess/image/White_queen_w.jpg(in = 1697) (out= 1550)(deflated 8%)
adding: chess/image/Black_pawn_w.jpg(in = 1220) (out= 1059)(deflated 13%)
adding: chess/image/White_king_w.jpg(in = 1709) (out= 1568)(deflated 8%)
adding: chess/image/Black_Rook_w.jpg(in = 1457) (out= 1311)(deflated 10%)
adding: chess/image/White_queen_c.jpg(in = 1642) (out= 1498)(deflated 8%)
adding: chess/image/White_Knight_w.jpg(in = 1624) (out= 1477)(deflated 9%)
adding: chess/image/White_king_c.jpg(in = 1674) (out= 1530)(deflated 8%)
adding: chess/image/White_pawn_w.jpg(in = 1303) (out= 1131)(deflated 13%)
adding: chess/image/White_Knight_c.jpg(in = 1603) (out= 1455)(deflated 9%)
adding: chess/image/Black_Rook_c.jpg(in = 1441) (out= 1292)(deflated 10%)
adding: chess/image/Black_queen_w.jpg(in = 1550) (out= 1402)(deflated 9%)
adding: chess/image/White_Rook_w.jpg(in = 1467) (out= 1318)(deflated 10%)
adding: chess/image/Black_Knight_c.jpg(in = 1483) (out= 1330)(deflated 10%)
adding: chess/image/Black_Bishop_c.jpg(in = 1427) (out= 1275)(deflated 10%)
adding: chess/image/Black_king_c.jpg(in = 1594) (out= 1443)(deflated 9%)
adding: chess/image/Black_Bishop_w.jpg(in = 1449) (out= 1299)(deflated 10%)
adding: chess/image/White_Bishop_c.jpg(in = 1507) (out= 1359)(deflated 9%)
adding: chess/image/Black_queen_c.jpg(in = 1521) (out= 1372)(deflated 9%)
adding: chess/image/White_Rook_c.jpg(in = 1461) (out= 1315)(deflated 9%)
adding: chess/image/Black_pawn_c.jpg(in = 1208) (out= 1047)(deflated 13%)
adding: chess/image/White_Bishop_w.jpg(in = 1532) (out= 1388)(deflated 9%)
adding: chess/ChessBoard.class(in = 95986) (out= 26682)(deflated 72%)
adding: chess/ChessClient.class(in = 2240) (out= 1273)(deflated 43%)
adding: chess/ChessBoard$2.class(in = 784) (out= 484)(deflated 38%)
adding: chess/ChessBoard$cBoard.class(in = 2484) (out= 1353)(deflated 45%)
adding: chess/ChessBoard$ReadPartner2.class(in = 1881) (out= 1096)(deflated 41%)
adding: chess/ChessBoard$ReadPartner.class(in = 3104) (out= 1755)(deflated 43%)
adding: chess/ChessBoard$1.class(in = 756) (out= 478)(deflated 36%)
adding: chess/ChessBoard$sBoard.class(in = 635) (out= 392)(deflated 38%)
adding: chess/ChessBoard$coord.class(in = 417) (out= 298)(deflated 28%)
adding: chess/ChessBoard$4.class(in = 623) (out= 438)(deflated 29%)
adding: chess/ChessBoard$ReadPartner1.class(in = 1302) (out= 738)(deflated 43%)


Still I am getting the below error:-


ClassNotFoundException


chess.ChessClient

Can somebody help me regarding this?

Thanks in advance
Archana

6 years ago
Thanks you so much for your help. I got the connection and the issue is resolved. Thanks again
Archana
Hi Karthik,

I am getting below exception:
java.net.ConnectException:Connection timed out:connect

EC2 has linus OS. I will check the other firewalls of linux.
Hi Karthik,

Thanks for the reply. I tried the first two options but still I am not successful in getting the connection. The third option does not apply to my case because in my laptop there is no firewall setting. If it is the security that is blocking the connection then I changed my java.policy file also still I am unsuccessful.
Hi,

I am creating a server & client in java where client is an applet but it is not connecting when I run it on AWS server.

The server code is:-

import java.io.*;
import java.util.*;
import java.net.*;
public class TestServer {

public void process() throws Exception {
ServerSocket server = new ServerSocket(1002,10);
String ia= InetAddress.getLocalHost().getHostName();
System.out.println("Address is "+ia);
System.out.println("Test server Started...");
while( true) {
Socket client = server.accept();
System.out.println("Connected");
}
}
public static void main(String ... args) throws Exception {
new TestServer().process();
}
}

And the client code is:-

import javax.swing.*;
import java.applet.Applet;
import java.io.*;
import java.net.*;
public class TestClient extends JApplet {

public void init()
{
String servername = "ip-172-31-3-228";
Socket client;
ShowMessage("Starting 9");
try
{
client = new Socket(servername,1002);
ShowMessage("Test Server connected");
}catch(Exception e) {
ShowMessage("Test Server is down");
}
}
public void ShowMessage(String message) {
JOptionPane.showMessageDialog(null, message, "Message",
+JOptionPane.INFORMATION_MESSAGE);}
}


I am always getting Test Server is down message. Can anybody please help me?

Thanks in advance
Archana
Thanks for your reply. I got it resolved. It was Allow-Origin Problem
6 years ago
JSP
Hi,

I have a simple code in jsp file which is not hitting the servlet. Can I know what is wrong in the below code?

JSP file:-



Servlet file:-

6 years ago
JSP
After I sign my applet I am not able to run it in the browser. I get the below exception. Please help me!

cache: Initialize resource manager: com.sun.deploy.cache.ResourceProviderImpl@ce88d2
security: --- parseCommandLine converted : -Djava.security.manager
into:
[-Djava.security.manager]
basic: Added progress listener: sun.plugin.util.ProgressMonitorAdapter@4a25d5
basic: Plugin2ClassLoader.addURL parent called for file:/C:/Users/sysadmin/Desktop/Game/java/ChatCode/classes/sChatClient.jar
network: Cache entry not found [url: file:/C:/Users/sysadmin/Desktop/Game/java/ChatCode/classes/sChatClient.jar, version: null]
network: Cache entry not found [url: file:/C:/Users/sysadmin/Desktop/Game/java/ChatCode/classes/sChatClient.jar, version: null]
security: Accessing keys and certificate in Mozilla user profile: null
network: Cache entry not found [url: file:/C:/Users/sysadmin/Desktop/Game/java/ChatCode/classes/sChatClient.jar, version: null]
security: Loading certificates from Deployment session certificate store
security: Loaded certificates from Deployment session certificate store
security: Loading certificates from Deployment session certificate store
security: Loaded certificates from Deployment session certificate store
security: Loading certificates from Deployment session certificate store
security: Loaded certificates from Deployment session certificate store
security: Validate the certificate chain using CertPath API
security: Loading blacklisted.certs file: C:\Users\sysadmin\AppData\LocalLow\Sun\Java\Deployment\security\blacklisted.certs
security: SHA-256Certificate finger print: C0BF567336C7D92F9D46E79831BBC8403480DBF76CBE7FB5861317678B6AEC5B
security: Loading Root CA certificates from C:\Program Files\Java\jre7\lib\security\cacerts
basic: error: null.
java.lang.ExceptionInInitializerError
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at sun.security.jca.ProviderConfig$2.run(Unknown Source)
at sun.security.jca.ProviderConfig$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.security.jca.ProviderConfig.doLoadProvider(Unknown Source)
at sun.security.jca.ProviderConfig.getProvider(Unknown Source)
at sun.security.jca.ProviderList.getProvider(Unknown Source)
at sun.security.jca.ProviderList.getService(Unknown Source)
at sun.security.jca.GetInstance.getInstance(Unknown Source)
at java.security.Security.getImpl(Unknown Source)
at java.security.AlgorithmParameters.getInstance(Unknown Source)
at sun.security.x509.AlgorithmId.decodeParams(Unknown Source)
at sun.security.x509.AlgorithmId.<init>(Unknown Source)
at sun.security.x509.AlgorithmId.parse(Unknown Source)
at sun.security.x509.X509Key.parse(Unknown Source)
at sun.security.x509.CertificateX509Key.<init>(Unknown Source)
at sun.security.x509.X509CertInfo.parse(Unknown Source)
at sun.security.x509.X509CertInfo.<init>(Unknown Source)
at sun.security.x509.X509CertImpl.parse(Unknown Source)
at sun.security.x509.X509CertImpl.<init>(Unknown Source)
at sun.security.provider.X509Factory.engineGenerateCertificate(Unknown Source)
at java.security.cert.CertificateFactory.generateCertificate(Unknown Source)
at sun.security.provider.JavaKeyStore.engineLoad(Unknown Source)
at sun.security.provider.JavaKeyStore$JKS.engineLoad(Unknown Source)
at java.security.KeyStore.load(Unknown Source)
at com.sun.deploy.security.RootCertStore$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.deploy.security.RootCertStore.loadCertStore(Unknown Source)
at com.sun.deploy.security.RootCertStore.load(Unknown Source)
at com.sun.deploy.security.RootCertStore.load(Unknown Source)
at com.sun.deploy.security.ImmutableCertStore.load(Unknown Source)
at com.sun.deploy.security.LazyRootStore.loadJREStore(Unknown Source)
at com.sun.deploy.security.LazyRootStore.getTrustAnchors(Unknown Source)
at com.sun.deploy.security.TrustDecider.getValidationState(Unknown Source)
at com.sun.deploy.security.TrustDecider.validateChain(Unknown Source)
at com.sun.deploy.security.TrustDecider.isAllPermissionGranted(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.isTrustedByTrustDecider(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.getTrustedCodeSources(Unknown Source)
at com.sun.deploy.security.CPCallbackHandler$ParentCallback.strategy(Unknown Source)
at com.sun.deploy.security.CPCallbackHandler$ParentCallback.openClassPathElement(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.getJarFile(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.access$1000(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$JarLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.ensureOpen(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.<init>(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.deploy.security.DeployURLClassPath.getLoader(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath.getLoader(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath.getResource(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Unknown Source)
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.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.initAppletAdapter(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "loadLibrary.sunec")
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at sun.plugin2.applet.AWTAppletSecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkLink(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at sun.security.ec.SunEC$1.run(SunEC.java:60)
at sun.security.ec.SunEC$1.run(SunEC.java:58)
at java.security.AccessController.doPrivileged(Native Method)
at sun.security.ec.SunEC.<clinit>(SunEC.java:58)
... 69 more
Ignored exception: java.lang.ExceptionInInitializerError
basic: Dialog type is not candidate for embedding
basic: Removed progress listener: sun.plugin.util.ProgressMonitorAdapter@4a25d5
security: Reset deny session certificate store
basic: Dialog type is not candidate for embedding
6 years ago