626 byte By
jlrockya at 2007-11-27 7:55:40
I want to parallelize a block of code, say that contains three statements: Statement 1, Statement 2, and Statement 3.I have created two threads but only one of them should execute statement 2. I mean Thread 1 should execute Statement 1 and Statement 3 while thread 2 should execute Statement 1, ...
2602 byte By
Dytea at 2007-11-27 7:55:46
Hi there,I created an application that writes a List<Object> to a file.It's been working fine like this, but then for some reason, this file became corrupt. I figured out why, but I haven't been able to recover the data in this corrupt file.Most important part (on position 1) of this ...
8294 byte By
TimmyXa at 2007-11-27 7:55:57
Hi,I Know there are many topics about this but mostly the answer were use http-something.I am trying to do this with sockets only, but my code shows up very strange behavior.It looks like the file transfer just works fine, but the client who receives the file is stuck at the end of the file ...
1239 byte By
Nialsha at 2007-11-27 7:57:59
Hi,It seems like Java's ListIterator isn't especially great for doing a "compare every element to every other element" traversion (like the type used in selection sort).For example, this code works fine:for(ListIterator<T> i = list.listIterator(); i.hasNext();) {T a = ...
Hi,I have a piece of code that acts as a load balancer. Under high load scenario - 200+ different simulataneous users, it throws some errors.Following is a snippet from that code - URL url = new URL(site);URLConnection urlconnection = ...
Hi everyone...Is anyone aware, how to interact with UPS (Uninterrupted Power Systems) in Java? I think it is as similar as to interact with remote computer in the network? If anyone knows please reply to the post.Thank You !
Hiim wondering how i can determine if ive already processed/read the contents of a cd before.... im assuming that each cd will have some sort of unique serial or identification number.... if it has, what classes/mentod do i have that i can extract this info....thanks for any help you can ...
hello everyone,I want to creat an array of servers to connect to (configurable hots:port) and send a command to be invoked like "something\n"then close the tcp connection? whereis a good place to start reading about this or maybe a snip of code or two like the array part at least, I would be ...
Hello forum, I having trouble with passing objects from client to server and back again.a) I have created a client server relationship where by the client creates an instance of an object (player.class), fills it with some data (setPlayersName(String);) then passes it to the server. The Player ...
Hello,I have a collection of objects which need to be sorted based on 2 parameters. One param is priority and the other is time. I need to sort this collection based on priority first. Every priority in turn could have a smaller collection which will be sorted based on time. All I could think ...
Hi I was reading the tutorial on concurrency at http://java.sun.com/docs/books/tutorial/essential/concurrency/atomic.html and I found a passage that I is unclear to me. The article states that: "Using volatile variables reduces the risk of memory consistency errors". Does it reduce the risk or ...
For some reason I've been having a hard time finding the setting which controls the read timeout for JAR downloads. At the moment it looks like it will never timeout such that if I am about to download a jar and the server goes down, the read will never timeout.TIA
Does anyone know. I want to have users be able to enter commands into a text field, and then have the text field action listener create a new thread to handle the command (because some commands are really long). My question is, after I start the newly created thread, and then return from the ...
(Please don't laugh. I know the answer is obvious, but I just can't see it. Be gentle).Can anyone explain why this doesn't work? I'm trying to extend ObjectOutputStream's writeObject class so I can watch classes as I serialize them. However, I can't seem to get my class to override the ...
I've tried searching around (and found useful information in these forums) but I can't seem to find anything on this exact problem...hopefully someone can give me a simple pointer in the right direction.I'm trying to write a networked game, where a single server has multiple clients ...
What is the best way to handle IOException thrown by ServerSocket's accept() method?
212 byte By
S1lv3ra at 2007-11-27 8:06:00
Hi all,I want to sort a Set by a property that is in the objects of the set. The property is a String. I searched around the net but could find anything that would relate to my problem.Greets
Hi,I have some assumption, I just need to make sure whether they are valid.1. When a thread in created in Java, a native thread will also be created in OS. Java Thread mapped to os thread. So if create 10 threads in java, I expect my task manager to show so many threads for that particular ...
Hi All,I have facing this issue for quite some time now. 1. I login into my application using Firefox. User now can view below the line pages.2. Open another window of firefox.3. Close the window open in the first step.4. Hit the application URL in the second firefox window and u find the user ...
This is really a combined Java/HTML question;I have a Java app I'm writing and it will require a license. To request a license, the java opens a particular website where the user will fill in some html forms and click "submit". So far, no problems.But, there is a long license request key, and ...
I can able to upload an image in a repository and i can able to display the image on my local machine ,but i cant able to render from server (i used <img> tag in jsp) ,and i also tried thru buffer outputstream();i badly need help from yousrinath@incubatesoft.com
431 byte By
divinea at 2007-11-27 8:07:54
Hi It may be very stupid question, but i am not able to run my RMI applicayion on netbeansI have implemented all the things -defined the remote interface- my class is Hello.javaimplemented the interface - impHello.javacreated the server class- Helloserver.javacreated the client class- ...
735 byte By
S1lv3ra at 2007-11-27 8:08:15
I have a collection with elements of the type "Abonnement" with a property called "bedrijf" of the type Bedrijf.Now i want to generate Objectswith 1 property and a Collectione.g.public class NewObject{private Bedrijf bedrijf;private List<Abonnement> abonnementen;//and getters /setters for ...
HiThis is kind of a noob question, but i hope then its easy to answer:-)I need to make a Java Webservice Client capable of calling a .net webservice created with WSE3.0.The webservice is using the ws-security 1.0 defined in the OASIS specification.I have been searching these forums for any post ...
I'm trying to write a game that uses UDP networking, but for some messages I wanted to use TCP/IP to make sure they got there. So I had a datagram socket on one port and a tcpip socket on another port. This yeilded pretty poor results. 30% of the time the game would run fine, 50% of the time ...
13983 byte By
_lauria at 2007-11-27 8:09:56
Hello!I have a strange issue with jconsole and my JMX enabled daemon. It used to work fine until sysadmin in datacenter placed out machine behind a kind of firewall (cisco accesslist or something like that).After that remote connection between jconsole and server no longer can be ...
7673 byte By
Mjacobsa at 2007-11-27 8:10:27
I am having trouble sending the filename before i send the file and storing it to a string on the server. I always stores some gibberish string. Can someone please helpServer codeimport java.io.IOException;import java.net.ServerSocket; public class Server {/** * @param args * @throws ...
736 byte By
vAaka at 2007-11-27 8:10:37
Hi,I hope I'm in the right topic for this...I have been looking into object creation a little bit and although I get the whole idea of loading-linking-initialization etc, I have a little problem with the Class-object or field that is created in each class that is loaded into the JVM.I read ...
Hello,Can you recommend me how to do this?My idea is to run inside the APP server a Socket server, which i want to be started on APP server startup.Should i use MBean for that or there is any better way?Thank you for any hints and Kind regards,Chavdar
I am using a Socket to connect to an ftp server that automatically times out the connection after 3 minutes of inactivity. I have tried to set up conditionals to determine if the server has timed out the connection before I send a ftp command but none of them work. After the server has timed me ...
I have a korn shell script that echoes a word to the terminal. From within my java application, is there any way to call this script and capture the text that it echoes?
3429 byte By
jtigrea at 2007-11-27 8:13:11
Hi,Sorry for being little over descriptive here. I have an issue deserializing a file that contains a Map<String, List><POJOs>>. These POJO bean classes are stored in a jar file uder web-app/lib. I can deserialize the file from a standalone java program, from tomcat web app when ...
I am almost sure that I am making some mistake. But can someone please point out where to find BlockDataException class?I am asking this because:Serialization spec @ http://java.sun.com/j2se/1.5.0/docs/guide/serialization/spec/input.html#5903 says that:2. If a block data record occurs in the ...
I have been questioning my solution to preventing server timeout and was wondering if anyone knows of a better way to do it. I am using a socket to connect to a ftp server which times out the connection after 3 minutes of inactivity. I have tried using the setKeepAlive(true) method for the ...
Hi all,i am messing about writing a network game and have two linked lists synchronized using the Collections.synchronizedList() method to return a synchronized List.i am accessing the Lists concurrently from 2 threads started using the following excerpts:class ServerUI{...serverGameHost=new ...
8941 byte By
MarkVa at 2007-11-27 8:13:39
Hi all,I have been experiencing difficulties with simultaneous read/write with AsyncIO. For my scenario that the client/server application is being developed, a client may send requests or status information at any given time. Hence continual monitoring on the incoming stream is required.The ...
hi I have involved in a project where I need to send sms to mobile from java code.Can anyone help me.if u have code please send me.thanks dhinesh
hi, i want to know ,how to send message from my PC to remote user when some successful event occurs.I think and i am not sure that these are possible ways:1.using sms providers we can send messages by doing contract with them.2.using sms gateways we can send messages through their sites and we ...
149 byte By
v-va at 2007-11-27 8:13:54
where i can found this packagesunw.admin.snmp.*;i need JMAPI class where i can find it. any one reply me i beg you please
HiI want to develop a lan messenger using java.I have written a client code to interact with a serverit connects properly but as soon as i start a thread for listeningconnection is ended. please suggest me on this....below i m pasting my code and the error messagecode:import java.awt.*;import ...
Hi I am confused about object lock and class lock What is differnce between Synchronized static method and Synchronized nonStatic method .Please explain me with one exampleThanks
HiI want to develop a lan messenger using java.I have written a client code to interact with a serverit connects properly but as soon as i start a thread for listeningconnection is ended. please suggest me on this....below i m pasting my code and the error messageimport java.awt.*;import ...
3771 byte By
fed3xa at 2007-11-27 8:18:54
hi there! I'm implementing a protocol that allows transfer a number of files over a socket TCP.Files can be .jar, .class or .java . in the first two cases I must send it as binary data, in the last case, as text .The protocol is pretty simple, the sender first sends a String that represent the ...
4023 byte By
hogla at 2007-11-27 8:19:21
Hi, I'm having a problem with my program. It is a server program that can handle one user at a time, but after closing the client, the server just hangs.. It still takes connections, but it doesn't respond to telnet commands after the first client has disconnected. How do I go about changing ...
6571 byte By
Mjacobsa at 2007-11-27 8:19:56
I have code written to upload a file to the server. the file uploads fine when i dont specify the dir. It uploads to the server current dir, but when i try to upload it to directory "tmp/uniqueDir/filename" that i create in my code i get filnotfound exception. can someone please help me figure ...
6571 byte By
Mjacobsa at 2007-11-27 8:19:57
I have code written to upload a file to the server. the file uploads fine when i dont specify the dir. It uploads to the server current dir, but when i try to upload it to directory "tmp/uniqueDir/filename" that i create in my code i get filnotfound exception. can someone please help me figure ...
hi guys i m getting StreamCorruptedException just don't know why. its a simple program. below is my main class.package Basics1;import java.util.*;import java.io.*;public class UseStaticIpData {public UseStaticIpData() {}public static void main(String[] args)throws IOException{StaticIpData sipd ...
387 byte By
_dnoyeBa at 2007-11-27 8:20:09
I have a class member that has been final for a long time. I decided to implement the clone method. This requires me to reassign this final variable. But this is the only time this would be reassigned.It seems the copying and serializing requires special behaviors often. I am wondering if there ...
I have a BufferedInputStream (using System.in as its underlying InputStream), that is blocking on a read() operation. At some point, I need to signal the thread that it is a part of to stop executing. However, if no more user input ever comes, then it will just sit there forever. How can I get ...
Getting Exception in thread "main" java.lang.UnsupportedOperationExceptionat java.util.AbstractCollection.add(Unknown Source)at test2.test2.main(test2.java:31)when executing Map map = new HashMap();map.put(new Integer(1),"abhay");map.put(new Integer(2),"kumar");Set set = ...