Results 1 to 18 of 18
Thread: Client-Server in applet
- 10-08-2010, 02:31 PM #1
Member
- Join Date
- Sep 2010
- Posts
- 37
- Rep Power
- 0
- 10-08-2010, 03:36 PM #2
Look in the browser's java console for error messages that explain what the problem isthey don't work
Copy and paste the messages here if you have questions.
- 10-08-2010, 03:59 PM #3
Member
- Join Date
- Sep 2010
- Posts
- 37
- Rep Power
- 0
it doesn't have error.
browser show my client file.
I think my socket doesn't work.my client run up to socket. server doesn't receive any thing from client.
- 10-08-2010, 04:07 PM #4
Can you explain how you are executing the applet in a browser? Is there an html file the browser loads? Does the page load ok? Does the applet load ok or is there an error loading the applet?
Is there an error message in the browser's java console window? THIS IS IMPORTANT!!
Does you applet print out any messages that show in the java console? If not add a System.out.println("Hi from applet"); to the init() method and see if that prints out in the java console.
- 10-08-2010, 04:19 PM #5
Member
- Join Date
- Sep 2010
- Posts
- 37
- Rep Power
- 0
I get a client server code from internet. it's pizza order program.
First I run client in a program and put the client.class file in my web server. I make a client.html.
Then I run the server file in eclipse.
I open the client.html file and it show my client page.
I order and click on send button. 3 sentences show in page which are in client.class file.
"Sending Order to server ... Receiving Order Total... Final Total is "
and stop. client can't receive final total from server.
In sever side: nothing happen. it doesn't receive order
- 10-08-2010, 04:24 PM #6
Member
- Join Date
- Sep 2010
- Posts
- 37
- Rep Power
- 0
in firefox my error console is empty.
in internet explorer I can't open error console.
- 10-08-2010, 04:31 PM #7
I don't know what an "error console" is. Are you talking about the one for javascript?
I'm referring to the Java console. You need to find the Java console.
Here is what one looks like:Last edited by Norm; 10-08-2010 at 04:33 PM.
- 10-08-2010, 07:09 PM #8
Member
- Join Date
- Sep 2010
- Posts
- 37
- Rep Power
- 0
thx, here's my error:
java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:2222 connect,resolve)
- 10-08-2010, 07:25 PM #9
Applets can only communicate with the location they were loaded from. Do you load the html with the applet from the localhost server or from a local disk? or where?
To allow the applet to connect with the localhost, you need to load the applet from the localhost.
It is possible for you to give your applet permission to do things like use Sockets by adding permissions to the .java.policy file on your PC. You edit the .java.policy file with the policytool program that comes with the JDK.
- 10-08-2010, 07:34 PM #10
Member
- Join Date
- Sep 2010
- Posts
- 37
- Rep Power
- 0
my client class and html file are in webserver, but my server run in eclipse...
Would you please help me how to set that file?Last edited by bobo67; 10-08-2010 at 07:37 PM.
- 10-08-2010, 07:40 PM #11
Member
- Join Date
- Sep 2010
- Posts
- 37
- Rep Power
- 0
I open it. show this:
CodeBase <ALL>
- 10-08-2010, 08:06 PM #12
Do you load the html and applet into the browser with a url like this: http://127.0.0.1
Setting up the .java.policy file takes a bit of doing. Do a Search here and with Google on how to put values in it and where it needs to be.
- 10-10-2010, 06:03 PM #13
Member
- Join Date
- Sep 2010
- Posts
- 37
- Rep Power
- 0
hi,
thx for your help.
I solved that problem. but now I have another error for another socket.
java.net.ConnectException: Connection refused: connect
I don't know what to do. Please help me.
thx
- 10-10-2010, 06:18 PM #14
Sorry, I don't know why that happened. Perhaps the server didn't want to respond to you.
Or the ports were wrong.
- 10-10-2010, 06:56 PM #15
Member
- Join Date
- Sep 2010
- Posts
- 37
- Rep Power
- 0
my server is listening.
my client as I said is Applet. in the java code of applet I call another class, this class open socket. Is it problem for this?
- 10-10-2010, 06:59 PM #16
No, which class calls the Socket shouldn't make a difference.
Are the server and client on the same PC? Are you using the localhost address?
Are they ports matched correctly?
- 10-10-2010, 07:29 PM #17
Member
- Join Date
- Sep 2010
- Posts
- 37
- Rep Power
- 0
yes, they're on the same PC. yeh
- 10-10-2010, 07:40 PM #18
Similar Threads
-
server-client; client sends a username to the server.
By lkcz in forum New To JavaReplies: 2Last Post: 09-24-2010, 11:31 AM -
how to send a file from server to client and client saves the file?
By KoolCancer in forum New To JavaReplies: 3Last Post: 07-29-2009, 04:52 AM -
Copy a .swf file from server side to client using signed applet
By Imoracle in forum Java AppletsReplies: 2Last Post: 10-05-2008, 06:13 PM -
Datagram Client and Server, client timer question
By saru88 in forum NetworkingReplies: 1Last Post: 10-05-2008, 03:12 PM -
Identify Client in Socket Client Server Application
By masadjie in forum NetworkingReplies: 1Last Post: 12-20-2007, 09:18 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks