Applet read server prop
Hello
I cannot figure out how to get an applet, to read a simple properties file that is at the same directory level as the html/jsp file that loads it. I have tried below and it fails with fnf, even though if I put in the full url name in the browser it opens the fil directly. What dont I understand sufficiently to read the file and return a properties object? tia
public Properties getProps(String fname){
Properties props = new Properties();
InputStream propIn = null;
String line;
URL url = null;
try {
url = new URL(getCodeBase(), fname);
} catch (MalformedURLException ex) {
System.out.println("MalformedURLException");
ex.printStackTrace();
try {
propIn = new FileInputStream(url.toString());
} catch (FileNotFoundException ex1) {
System.out.print("FileNotFoundException");
ex1.printStackTrace();
try {
props.load(propIn);
} catch (IOException ex2) {
System.out.println("IOException on props.load()");
ex2.printStackTrace();
return props;
}
Try something like
props.load((new URL(getCodeBase(), "user.props")).openStream());Bye.
http://www.rgagnon.com/howto.html
Similar Messages
-
Chat Applet - Sockets - Server
Hello Fellows!
I hope u all r fine..
I am facing a problem in my client/sever application. The communication is Socket Based. i.e the server is using sockets and the client which is an Applet, uses sockets to communicate with the sever.
The application is working fine in the appletviewer. i.e the applet server communication, both can send and recieve messages.
BUT
When I use IE5 the client applet can send messages to the sever but is not able to read from the specified socket...
If Any one can help me out, i will be greatfull. If u need some code segment then let me know.
Looking forward for any suggestions.
Thanking You!
Ahmad.Thanks!
for your contribution....
but now i realised that the problem is that the client socket thread is not running.
//////////////////////// Client Applet
public class Client extends Applet implements ActionListener
Thread thRead;
ClientSocket cs;
private Panel pnlHead = new Panel();
private Panel pnlMain = new Panel();
public static Vector vtrMembers;
public void init()
thRead = (Thread) new ClientSocket();
cs = (ClientSocket) thRead;
vtrMembers = new Vector();
thRead.start();
cs.out.println("INI ? INI");
////////////////////////////////////////Client scoket class
public class ClientSocket extends Thread
// public static Socket sClient;
public Socket sClient;
// A character-input stream to read from the socket.
public static BufferedReader in;
// A text-output stream to write to the socket.
public PrintWriter out ;
// String to store the input from the client
String strText;
// Boolean Flag to Check the read value
public boolean bFlag = true;
public ClientSocket ()
try
sClient = new Socket ("Ahmed" , 4000);
// Initializing the Input straem used to read the socket.
in = new BufferedReader(new InputStreamReader(sClient.getInputStream()));
// Initializing the Output straem used to write on the socket.
out = new PrintWriter(sClient.getOutputStream(), true);
catch (UnknownHostException uhe)
// System.out.println (" Unknown Host Exception : " + uhe);
catch (IOException ioe)
// System.out.println (" I/O Exception : " + ioe);
public void run()
for (;;)
if (bFlag == true)
Client.txtTry.setText("TRUE");
else
Client.txtTry.setText("False");
thRead.start() statment is executed but the thread does not stat running
because the text value is not set on the Client Applet. -
How to get started on java applet client/server game?
Hi,
I've googled, but didn't find any useful information about creating java applet client/server game. I've followed the example of Client/Server Tic-Tac-Toe Using a Multithreaded Server in Java How to Program from Deitel, but I when I tried on Applet, my cliet doesn't communicate with the server at all. Any help to get started with Applet would be great. Thanks!well, i decided to put in portion of my codes to see if anyone can help me out. the problem I have here is the function excute() never gets called. here is my coding, see if you can help. Notice, I'm running this on Applet thru html page. This shouldn't be much different than running JFrame in term of coding right?
Server.java
public void init()
runGame = Executors.newFixedThreadPool(2);
gameLock = new ReentrantLock();
otherPlayerConnected = gameLock.newCondition();
otherPlayerTurn = gameLock.newCondition();
players = new Player[2];
currentPlayer = Player1;
try
server = new ServerSocket(12345, 2);
catch (IOException ie)
stop();
message = "Server awaiting connections";
public void execute()
JOptionPane.showMessageDialog(null, "I'm about to execute!", "Testing", JOptionPane.PLAIN_MESSAGE);
for(int i = 0; i < players.length; i++)
try
players[i] = new Player(server.accept(), i);
runGame.execute(players);
catch (IOException ie)
stop();
gameLock.lock();
try
players[Player1].setSuspended(false);
otherPlayerConnected.signal();
finally
gameLock.unlock();
Client.java
public void init()
startClient();
public void startClient()
try
connection = new Socket(InetAddress.getByName(TienLenHost), 12345);
input = new Scanner(connection.getInputStream());
output = new Formatter(connection.getOutputStream());
catch (IOException ie)
stop();
ExecutorService worker = Executors.newFixedThreadPool(1);
worker.execute(this);
}So after worker.execute(this), it should go to Server.java and run the function execute() right? But in my case, it doesn't. If you know how to fix this, please let me know. Thanks! -
Is it possible to have applet socket server? if so, pls tell me the method. Thanks.
regards,
Balaapplet socket server?hmm...i dont think so...this will produce an exception... but maybe you can try signing the applet....
-
Can applet read file on web?
I try to write an applet that read the file on web i.e. http://lcoalhost:8080/test.txt
The HTML page contain the applet is placed on http://localhost:8080
URI URItemp= new URI("file:///test.txt");
File Filetemp = new File(URItemp);
BufferReader in = new BufferReader(new InputStreamReader(new FileInputStream(Filetemp)));the above cannot work
Error : access denied (java.io.FilePermission \test.txt read)
And then I add
FilePermission fp = new java.io.FilePermission("file:///test.txt", "read");still cannot work
Cound anyone tell me that is possible to do what I want to do?
If yes, how?
Thanks!!Applets are downloaded from web servers and execute on the client machine.
Therefore they have no access to the web server file system, signed or not.
They could have access to the client file system (the machine where they run),
but for security reasons only signed applets have this privilege.
So to answer your question, you sign if you want to access client files.
To access web server files, you don't need to sign the applet, but you need
to provide some method of accessing files remotely, for instance:
- Files published for the web can be read using HTTP
- Files can be read or writen with the help of an FTP server on the same machine as the web server
- A servlet running on the HTTP server can collaborate with your applet to exchange files -
How do I make an Applet read a file on my web host?
How do I make an Applet read a file on my web host?
I am wanting to put a file on my web host that has usernames and user details and other stuff on it...
I was wondering whether anyone knows how to make the Applet open a file on my webserver, check if the username exists, if not add to the file the username and details?
thanksURL myURL = new URL(getDocumentBase(), filename);
InputStream myInputStream = myURL.openStream();
DataInputStream dis = new DataInputStream(myInputStream);
String oneLine = dis.readLine();
Use output stream for writing..
hope this works !!! -
why can't i log in facetime on mac? error reads,server encoutered problem why registering?
Two useful KB articles:
http://support.apple.com/kb/HT4534
http://support.apple.com/kb/HT4319
The second says iOS but it actually tells how to use FaceTime from a Mac in addition to iOS devices. -
Read Server name in JSPDynpage to call a JSP Application
Hi Experts,
I am new Portal Content Development.
I have a JSP application deployed on SAP NW portal server as ear file using Eclipse.
Now to integrate this application in portal i have to create an Iview.
To Create Iview i have to create JSPDynpage.( Since URL Iview will not be useful in my case)
I am trying to follow Approach #2 as mentioned by Detlev in this thread [iViews based on J2EE;
Now in this JspDynPage I have to call my JSP application.
In this application i want to read SAP NW server name and port name to create URL of JSP Application.
after which URL would be :
http://<Server host name >:<port>/JSPapplication.jsp
Now how do i read Server Host name and Server Port name from JSPDynpage?
Thanks in advance for the answer.
Regards,
Ashish ShahHi Michael,
Thanks for your suggestion , i tried it.
However it seems to be struts application and url for the application is http://<server>:<port>/MyStruts/MyStrutsHome.do.
I tried following relative paths: and these are the errors
MyStrut/MyStrutHome.do --> Unable to fetch site http://MyStrut/MyStrutHome.do.Error # 502
/MyStrut/MyStrutHome.do --> Unable to fetch site http:///MyStrut/MyStrutHome.do.Error # 400
MyStrut/ --> Unable to fetch site http://MyStrut/.Error # 502
/MyStrut/ --> Unable to fetch site http:///MyStrut/.Error # 400
MyStrutHome.do -->Unable to fetch site http://MyStrutHome.do.Error # 502
Not sure weather i can create a URL Iview for Struts based applications.
Can you share your thoughts on this?
meanwhile i am trying to fetch server name and port in my JSPDynpage as suggested by you.
Thanks for your help till now.
Regards,
Ashish Shah -
"Adobe reader server error 16297.333.2486.403" while installing
I am unable to download Adobe Reader. Nothing ever downloads from the download manager and I get this error:
Adobe Reader
server error 16297.333.2486.403
Any thoughts?Don't use the download manager. Give us the version you want and the platform, and someone will give you a direct download link.
Or download your installer from http://get.adobe.com/reader/enterprise/ -
Applet with Server sided webpage (asp, php)
Hi Guys
I have a quick question regarding the use of Applets..
Let's say i've made an applet which i can put on a webpage to pick a date..
What i want to do is have the applet post data to the server just like any normal web control (like a server-side asp.net control or a html textbox in php)
Is this possible?
Thanks
-Nonameo-Nonameo,
You can use HttpURLConnection to communication between the applet and server side code(servlet, php, etc.).
On the applet do following:
// get input data for sending
String input = inputField.getText();
// send data to the servlet
URL urlServlet = new URL(getCodeBase(), "dir under your base");
URLConnection con = urlServlet.openConnection();
OutputStream outstream = con.getOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(outstream);
oos.writeObject(input);
oos.flush();
oos.close();
On the server side you will be able to get the data posted by the applet.
Hope this helps.
Chris -
Applet reading files in in web server eg geocities
hi ,
i have an applet that reads files i have created in a web server. when i try to run the applet in , internet explorer i get an error message
java.io.FileNotFoundException: nic.txt (The system cannot find the file specified)
does anyone have any solution to this problem. do i need a policy file and if i do where do i put it.Applets work on the clients computer, not the server. Your applet is >trying to read nic.txt from your computer. Can't be done easily, you'd >need your own serverprogram to do the reading and pass the data to the >client... let me clarify afew points
the applet is on a webserver eg. geocities.
the file is also on the same directory as the applet .class file.
so everything is on the web server,. -
Error in Applet reading a JMS topic
I have an applet trying to read a JMS topic. It connects fine, but as
soon as a message is written into the topic (that the applet is
subscribed to), I get the following error on the server:
<Apr 26, 2002 2:46:39 PM PDT> <Error> <RJVM> <Unsolicited error
response for: '-1'>
The applet shows the following stacktrace:
<Apr 26, 2002 2:40:26 PM PDT> <Warning> <Dispatcher> <Error thrown by
rmi server: 'weblogic.rmi.internal.BasicServerRef@101 - jvmid:
'-8904810875822286436C:127.0.0.1R:1187444208533444527S:192.103.129.38:[7001,7001,7002,7002,7001,7002,-1]:mydomain:myserver',
oid: '257', implementation:
'weblogic.jms.dispatcher.DispatcherImpl@2c3327''
weblogic.utils.AssertionError: ***** ASSERTION FAILED *****[ Could not
generate the Skeleton on the server for:
weblogic.jms.dispatcher.DispatcherImpl_WLSkel ]
at weblogic.rmi.internal.BasicRuntimeDescriptor.getSkeletonClass(BasicRuntimeDescriptor.java:296)
at weblogic.rmi.internal.BasicRuntimeDescriptor.getSkeleton(BasicRuntimeDescriptor.java:309)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:288)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
>
<Apr 26, 2002 2:40:39 PM PDT> <Warning> <Dispatcher> <Error thrown by
rmi server: 'weblogic.rmi.internal.BasicServerRef@2 - jvmid:
'-8904810875822286436C:127.0.0.1R:1187444208533444527S:192.103.129.38:[7001,7001,7002,7002,7001,7002,-1]:mydomain:myserver',
oid: '2', implementation:
'weblogic.rmi.internal.dgc.DGCServerImpl@4d7745''
weblogic.utils.AssertionError: ***** ASSERTION FAILED *****[ Could not
generate the Skeleton on the server for:
weblogic.rmi.internal.dgc.DGCServerImpl_WLSkel ]
at weblogic.rmi.internal.BasicRuntimeDescriptor.getSkeletonClass(BasicRuntimeDescriptor.java:296)
at weblogic.rmi.internal.BasicRuntimeDescriptor.getSkeleton(BasicRuntimeDescriptor.java:309)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:288)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.Kernel.execute(Kernel.java:235)
at weblogic.rmi.internal.BasicServerRef.dispatch(BasicServerRef.java:169)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:195)
at weblogic.rjvm.RJVMImpl.dispatchRequest(RJVMImpl.java:642)
at weblogic.rjvm.RJVMImpl.dispatch(RJVMImpl.java:589)
at weblogic.rjvm.ConnectionManagerClient.handleRJVM(ConnectionManagerClient.java:42)
at weblogic.rjvm.ConnectionManager.dispatch(ConnectionManager.java:637)
at weblogic.rjvm.t3.T3JVMConnection.dispatch(T3JVMConnection.java:454)
at weblogic.socket.JavaSocketMuxer.processSockets2(JavaSocketMuxer.java:319)
at weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java:233)
at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:24)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
>
<Apr 26, 2002 2:41:39 PM PDT> <Warning> <Dispatcher> <Error thrown by
rmi server: 'weblogic.rmi.internal.BasicServerRef@2 - jvmid:
'-8904810875822286436C:127.0.0.1R:1187444208533444527S:192.103.129.38:[7001,7001,7002,7002,7001,7002,-1]:mydomain:myserver',
oid: '2', implementation:
'weblogic.rmi.internal.dgc.DGCServerImpl@4d7745''
weblogic.utils.AssertionError: ***** ASSERTION FAILED *****[ Could not
generate the Skeleton on the server for:
weblogic.rmi.internal.dgc.DGCServerImpl_WLSkel ]
at weblogic.rmi.internal.BasicRuntimeDescriptor.getSkeletonClass(BasicRuntimeDescriptor.java:296)
at weblogic.rmi.internal.BasicRuntimeDescriptor.getSkeleton(BasicRuntimeDescriptor.java:309)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:288)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.Kernel.execute(Kernel.java:235)
at weblogic.rmi.internal.BasicServerRef.dispatch(BasicServerRef.java:169)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:195)
at weblogic.rjvm.RJVMImpl.dispatchRequest(RJVMImpl.java:642)
at weblogic.rjvm.RJVMImpl.dispatch(RJVMImpl.java:589)
at weblogic.rjvm.ConnectionManagerClient.handleRJVM(ConnectionManagerClient.java:42)
at weblogic.rjvm.ConnectionManager.dispatch(ConnectionManager.java:637)
at weblogic.rjvm.t3.T3JVMConnection.dispatch(T3JVMConnection.java:454)
at weblogic.socket.JavaSocketMuxer.processSockets2(JavaSocketMuxer.java:319)
at weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java:233)
at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:24)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
>
Thanks in advance for suggestions/help.
Raj
Is it with 7.0 GA or beta?
Do you know whether the classpath servlet is open or not?
Can you run this url from a browser and update this issue please.
http://host:port/bea_wls_internal/classes/weblogic/jms/dispatcher/Dispatcher
Impl_WLSkel.class
You should get a downloaded file to be saved. Otherwise your server need to
open the classpathservlet.
use -Dweblogic.servlet.ClasspathServlet.disableStrictCheck=true to open the
classpath servlet.
Attach the applet code, so that it will help us to nail down the issue.
Cheers,
..maruthi
"theist" <[email protected]> wrote in message
news:[email protected]...
> I have an applet trying to read a JMS topic. It connects fine, but as
> soon as a message is written into the topic (that the applet is
> subscribed to), I get the following error on the server:
>
> <Apr 26, 2002 2:46:39 PM PDT> <Error> <RJVM> <Unsolicited error
> response for: '-1'>
>
>
> The applet shows the following stacktrace:
>
> <Apr 26, 2002 2:40:26 PM PDT> <Warning> <Dispatcher> <Error thrown by
> rmi server: 'weblogic.rmi.internal.BasicServerRef@101 - jvmid:
>
'-8904810875822286436C:127.0.0.1R:1187444208533444527S:192.103.129.38:[7001,
7001,7002,7002,7001,7002,-1]:mydomain:myserver',
> oid: '257', implementation:
> 'weblogic.jms.dispatcher.DispatcherImpl@2c3327''
> weblogic.utils.AssertionError: ***** ASSERTION FAILED *****[ Could not
> generate the Skeleton on the server for:
> weblogic.jms.dispatcher.DispatcherImpl_WLSkel ]
> at
weblogic.rmi.internal.BasicRuntimeDescriptor.getSkeletonClass(BasicRuntimeDe
scriptor.java:296)
> at
weblogic.rmi.internal.BasicRuntimeDescriptor.getSkeleton(BasicRuntimeDescrip
tor.java:309)
> at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:288)
> at
weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267)
> at
weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:2
2)
> at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
> >
> <Apr 26, 2002 2:40:39 PM PDT> <Warning> <Dispatcher> <Error thrown by
> rmi server: 'weblogic.rmi.internal.BasicServerRef@2 - jvmid:
>
'-8904810875822286436C:127.0.0.1R:1187444208533444527S:192.103.129.38:[7001,
7001,7002,7002,7001,7002,-1]:mydomain:myserver',
> oid: '2', implementation:
> 'weblogic.rmi.internal.dgc.DGCServerImpl@4d7745''
> weblogic.utils.AssertionError: ***** ASSERTION FAILED *****[ Could not
> generate the Skeleton on the server for:
> weblogic.rmi.internal.dgc.DGCServerImpl_WLSkel ]
> at
weblogic.rmi.internal.BasicRuntimeDescriptor.getSkeletonClass(BasicRuntimeDe
scriptor.java:296)
> at
weblogic.rmi.internal.BasicRuntimeDescriptor.getSkeleton(BasicRuntimeDescrip
tor.java:309)
> at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:288)
> at
weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267)
> at
weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:2
2)
> at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
> at weblogic.kernel.Kernel.execute(Kernel.java:235)
> at weblogic.rmi.internal.BasicServerRef.dispatch(BasicServerRef.java:169)
> at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:195)
> at weblogic.rjvm.RJVMImpl.dispatchRequest(RJVMImpl.java:642)
> at weblogic.rjvm.RJVMImpl.dispatch(RJVMImpl.java:589)
> at
weblogic.rjvm.ConnectionManagerClient.handleRJVM(ConnectionManagerClient.jav
a:42)
> at weblogic.rjvm.ConnectionManager.dispatch(ConnectionManager.java:637)
> at weblogic.rjvm.t3.T3JVMConnection.dispatch(T3JVMConnection.java:454)
> at
weblogic.socket.JavaSocketMuxer.processSockets2(JavaSocketMuxer.java:319)
> at
weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java:233)
> at
weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:24)
> at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
> >
> <Apr 26, 2002 2:41:39 PM PDT> <Warning> <Dispatcher> <Error thrown by
> rmi server: 'weblogic.rmi.internal.BasicServerRef@2 - jvmid:
>
'-8904810875822286436C:127.0.0.1R:1187444208533444527S:192.103.129.38:[7001,
7001,7002,7002,7001,7002,-1]:mydomain:myserver',
> oid: '2', implementation:
> 'weblogic.rmi.internal.dgc.DGCServerImpl@4d7745''
> weblogic.utils.AssertionError: ***** ASSERTION FAILED *****[ Could not
> generate the Skeleton on the server for:
> weblogic.rmi.internal.dgc.DGCServerImpl_WLSkel ]
> at
weblogic.rmi.internal.BasicRuntimeDescriptor.getSkeletonClass(BasicRuntimeDe
scriptor.java:296)
> at
weblogic.rmi.internal.BasicRuntimeDescriptor.getSkeleton(BasicRuntimeDescrip
tor.java:309)
> at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:288)
> at
weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267)
> at
weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:2
2)
> at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
> at weblogic.kernel.Kernel.execute(Kernel.java:235)
> at weblogic.rmi.internal.BasicServerRef.dispatch(BasicServerRef.java:169)
> at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:195)
> at weblogic.rjvm.RJVMImpl.dispatchRequest(RJVMImpl.java:642)
> at weblogic.rjvm.RJVMImpl.dispatch(RJVMImpl.java:589)
> at
weblogic.rjvm.ConnectionManagerClient.handleRJVM(ConnectionManagerClient.jav
a:42)
> at weblogic.rjvm.ConnectionManager.dispatch(ConnectionManager.java:637)
> at weblogic.rjvm.t3.T3JVMConnection.dispatch(T3JVMConnection.java:454)
> at
weblogic.socket.JavaSocketMuxer.processSockets2(JavaSocketMuxer.java:319)
> at
weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java:233)
> at
weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:24)
> at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
> >
>
>
> Thanks in advance for suggestions/help.
> Raj
-
Connect applet to server port using sockets? Please help!!!
I am trying to connect a java applet to game1.pogo.com:5285 which is their gaming port. I want to make it connect from my website which is ucichess.com
The applet can be found here: http://ucichess.com/index.html and the java console gives me a bunch of weird errors if u can take a look at it:
network: Disconnect connection to http://ucichess.com/applet/chess2/com/pogo/util/thin/e.class
network: Cache entry found [url: http://ucichess.com/applet/chess2/com/pogo/util/thin/m.class, version: null]
network: Connecting http://ucichess.com/applet/chess2/com/pogo/util/thin/m.class with proxy=DIRECT
network: ResponseCode for http://ucichess.com/applet/chess2/com/pogo/util/thin/m.class : 304
network: Encoding for http://ucichess.com/applet/chess2/com/pogo/util/thin/m.class : null
network: Disconnect connection to http://ucichess.com/applet/chess2/com/pogo/util/thin/m.class
network: Connecting socket://ucichess.com:5285 with proxy=DIRECT
Sun Jul 22 17:14:24 EDT 2007 Thread-198 ArenaServiceThin.error
Sun Jul 22 17:14:24 EDT 2007 Thread-198 exception
java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at com.pogo.besl.thin.c.<init>(SourceFile)
at com.pogo.besl.thin.a.<init>(SourceFile)
at com.pogo.besl.arena.a.g(SourceFile)
at com.pogo.besl.arena.a.a(SourceFile)
at com.pogo.game.arena.chat.ChatArenaApplet.a(SourceFile)
at com.pogo.game.arena.chat.ChatArenaApplet.b(SourceFile)
at com.pogo.client.ping.b.run(SourceFile)
network: Connecting http://ucichess.com/blank.html?confuser=-6956021725811422401 with proxy=DIRECT
Applet.terminate(false, false)
ChatArenaApplet.disposeLocals(false)
InvalQueue thread exiting: InvalQueue-1-com.pogo.ui.a[panel8,0,0,458x403,invalid]
ChatArenaApplet.disconnect()
Applet.disposeLocals(false) - ChessTable
network: Cache entry not found [url: http://ucichess.com/applet/chess2/META-INF/assets.txt, version: null]
network: Connecting http://ucichess.com/applet/chess2/META-INF/assets.txt with proxy=DIRECT
basic: Stopping applet ...
basic: Removed progress listener: sun.plugin.util.GrayBoxPainter@106433d
basic: Finding information ...
basic: Releasing classloader: sun.plugin.ClassLoaderInfo@35dc95, refcount=0
basic: Caching classloader: sun.plugin.ClassLoaderInfo@35dc95
basic: Current classloader cache size: 2
basic: Done ...
basic: Joining applet thread ...
basic: Destroying applet ...
basic: Disposing applet ...
basic: Quiting applet ...
ChatArenaApplet.disposeGlobals()
Timer thread exiting: ScrollbarButtonRepeater
network: Cache entry found [url: http://ucichess.com/applet/chess2/com/pogo/ui/b.class, version: null]
basic: Joined applet thread ...
network: Connecting http://ucichess.com/applet/chess2/com/pogo/ui/b.class with proxy=DIRECT
network: ResponseCode for http://ucichess.com/applet/chess2/com/pogo/ui/b.class : 304
network: Encoding for http://ucichess.com/applet/chess2/com/pogo/ui/b.class : null
network: Disconnect connection to http://ucichess.com/applet/chess2/com/pogo/ui/b.class
network: Cache entry found [url: http://ucichess.com/applet/chess2/com/pogo/ui/q.class, version: null]
network: Connecting http://ucichess.com/applet/chess2/com/pogo/ui/q.class with proxy=DIRECT
network: ResponseCode for http://ucichess.com/applet/chess2/com/pogo/ui/q.class : 304
network: Encoding for http://ucichess.com/applet/chess2/com/pogo/ui/q.class : null
network: Disconnect connection to http://ucichess.com/applet/chess2/com/pogo/ui/q.class
Applet.disposeGlobals - ChessTable
Applet.terminate completed
Is it possible for me to host the applet on my server and connect it to a remote server using sockets and verification or is that against java security?
Applet.stop - ChessTable
Applet.stop completed - ChessTable
Applet.destroy - ChessTable
Applet.destroy completed - ChessTable
ChatArenaApplet.disconnect()Hi yoshistr, have you resolved your issue? If you have, do you mind sharing it with me?
Thanks. -
WebLogic writes to a text file and an applet reads the text file
Hi there,
I need some help here!
I have an applet that needs to read from a text file:
final URL prtDataURL = new URL("http://" + getCodeBase().getHost() + ":" + getCodeBase().getPort() + "/ESTC/lib/prtDataFile.txt");
final URLConnection urlConn = prtDataURL.openConnection();
urlConn.setUseCaches(false);
urlConn.setDoInput(true);
urlConn.setDoOutput(false);
final InputStreamReader is = new InputStreamReader(urlConn.getInputStream());
final BufferedReader in = new BufferedReader(is);
String inputLine;
while ((inputLine = in.readLine()) != null){
String[] tmp = inputLine.split("§");
this.dateTime = tmp[0];
this.quanTot = Integer.parseInt(tmp[1]);
this.quanSco = Integer.parseInt(tmp[2]);
this.quanSef = Integer.parseInt(tmp[3]);
this.valTot = Double.parseDouble(tmp[4]);
this.valSco = Double.parseDouble(tmp[5]);
this.valSef = Double.parseDouble(tmp[6]);
in.close();
is.close();and this is ok.
Now I have the web server (WebLogic) that must write, at regular time intervals, to that file (prtDataFile.txt). The web application writes to the file (which belongs to the application).
I've tried open the file with the File object but since the war file is unexploded I can't get the real path!
I've tried open an url connection,
final URL url = new URL("http://10.191.33.249:16801/ESTC/lib/prtDataFile.txt");
final URLConnection connection = url.openConnection();
connection.setDoOutput(true);
connection.setUseCaches(false);
connection.setDoInput(false);
OutputStreamWriter out = new OutputStreamWriter(connection.getOutputStream());
out.write(currentDate + "§" + quantTot + "§" + quantSco + "§" + quantSef + "§" + valTot + "§" + valSco + "§" + valSef);;
out.flush();
out.close();which seems a little stupid since I'm opening an URLConnection to the same place where the application is. Anyway it doesn't work, i.e., it doesn't write to the file but it doesn't gives me any errors or exceptions.
Is there another way to get this two pieces communicating?
Thanks in advanceI have almost the exact same problem, and I am in the same situation as you are with respects to the language.
I am simply trying to create a file and output some garbage to it but my applet always spits back a security violation. I've tried eliminating the restrictions on the applet runner I use but I still get the error.
My method:
debug = new Label() ;
debug.setLocation( 20, 20 ) ;
debug.setSize( 500, 15 ) ;
add( debug ) ;
// output
try
OutputStream file = new FileOutputStream( new File( "" + getCodeBase() + "output.txt" ) ) ;
byte[] buffer = { 1, 2, 3, 4, 5 } ;
file.write( buffer ) ;
file.close() ;
} catch( Exception e )
debug.setText( e.toString() ) ;
Can anyone tell why this isnt working? -
Communication protocol applet and server application
Hello,
I want to read and write on server port such that applet is communicating with a server application.
Can any body suggest me any application level communication protocol or algo so that read and write are syncronised.
There is no blocking b/w I/o streams while clients are reading or writing to server.
shahzadLook at this 3 pages
http://java.sun.com/docs/books/tutorial/networking/sockets/index.html
http://java.sun.com/products/javacomm/javadocs/API_users_guide.html
http://java.sun.com/docs/books/tutorial/networking/sockets/clientServer.html
Noah
Maybe you are looking for
-
Multiple computers with different versions of iPhoto
I have a Macbook Air with iphoto 11 installed version 9.2.1 . Also, I have an Imac G5 with iphoto 09 version 8.1.2 . Both computers use the same apple ID . If I buy from the app store, will they see the apple ID and say installed??????? Could I use
-
Can you please change the report object to incorporate directory creation? I'd like to file reports by date/time and dynamic directory creation is needed to do this in Lookout. Another way to print screens to pdf (preferred) or html with date/time d
-
I receive this panic several times a day - I searched the forums but didn't find a panic with similar enough attributes to call it a win. I've taken it to the Mac Store and they were unable to reproduce. Any help is appreciated - Interval Since Last
-
Is there a bug in Automator filter finder items?
I'm trying to do a batch processing script and there seems to be a bug with items created earlier in the script. For example, the 2brokegirls.jpg file was created earlier in the script and added to the main folder whose contents can be seen in the g
-
After I make a call sometimes I need to enter an extension. When I receive certain calls I need to be able to hit a keypad number. The phone screen goes dark in both situations. How do I keep it lit?