As I understand, java sockets are able to send strings only.I was wondering if java api have a class or something that allow me to send structured data.Is there a native way in java api to send structured data over a network, i.e. without the need to parse myself string messages ...
Hello,I got a big problem with serializing EventListeners. The problem is:I want to send Java-Swing Elements via RMI. If the Swing Components dont have Listeners its no problem, but if there is a listener at a Component I always get the following exception: java.lang.ClassCastException: ...
HiI am trying to serialize simple binary suffix trie of medium sizeI got an exception: likeException in thread "main" java.lang.StackOverflowErrorat sun.misc.SoftCache.processQueue(Unknown Source)at sun.misc.SoftCache.get(Unknown Source)at java.io.ObjectStreamClass.lookup(Unknown Source)at ...
Hi!I am developing Java application using ZipFile API. Platform is Windows XP. I am facing following problem.Basically, this application pools the Zip files from one source folder and unzip it into another folder. Everything is working fine,But the only problem is while deleting original zip file ...
Hello,I am using Microsoft Active Directory 2003, Java 1.4, and JNDIHas anybody tried using Microsoft's LDAP_SERVER_DOMAIN_SCOPE_OID control with JNDI? http://www.google.com/search?q=microsoft+LDAP_SERVER_DOMAIN_SCOPE_OIDAccording to MSDN: "The LDAP_SERVER_DOMAIN_SCOPE_OID control is used to ...
Normally I'm not completely clueless with generics, but this one has me stumped. Consider the following code, which compiles and runs cleanly without generics:public class Foo implements Comparable{public int bar;public int getBar(){return bar;}public int compareTo(Object obj){return getBar() - ...
<p>hi,</p><p>I want to get operating system ,ip infomation from the remote machine while in internet.If it is possible in java.if yes, plz let me the details.thanks in advance</p>
6998 byte By
lokiea at 2007-11-27 10:28:04
Hello everyone.My mentor wanted me to write a class that would do the following:open a connection to the passed in port and hostsend a messagereceive a messageclose the connectionSounds easy enough and I wrote a program that does just that but when I put it into a class it stopped working.Here's ...
<p>Hi,</p><p>Please let me know in which release of JDK the fix for year-2038 bug is included. Also is this problem resolved in JDK1.5 release.</p><p>[ problem : year-2038 bug is described as here in this web site.. </p><p> http://www.2038bug.com/ </p><p>]</p><p>thanks in advance..</p>
Hi, I got a quick question:Is there a chance to send JComponents which come with an ActionListener over the net for example via RMI?I always get the following Exception:java.lang.ClassCastException: server.ActionTryImpl_Stub cannot be cast to java.util.EventListenerjava.lang.ClassCastException: ...
803 byte By
T01deva at 2007-11-27 10:29:32
Hi!I am developing a client/server project in Java (client/server - THE tundra for Java) and I (of course) use RMI. My quesion is: is RMI inherantjy multi-user or do I need to go the extra mile to allow multi use.The set-up is as follows: ther is one server with a database. Clinets can access the ...
676 byte By
Bledara at 2007-11-27 10:29:33
Hi.I need to make a number of connections to a server from the computer my application will run to. Suppose that I can have a very good computer and resources is not a limit, is it possible to have a number of sockets (namely 20) opened on the same port and ip address.for example:ipAddress = "IP ...
Hi,I have this ldapsearch command that I want to convert to use with Java.ldapsearch -h HOSTNAME -p PORT -b "" -s base "(objectclass=*)" namingContextsI want to use the ctx.search(); but I have no idea how to convert this method in to a valid search so i can get the naming contexts.Ive ...
620 byte By
Rak123a at 2007-11-27 10:31:11
Hi,I have a requirement wherein i want to read javadoc docs from source code and replace it with my own custom java 5 annotation.For example say i have a file A.java with following javadoc in it:/* * @param some parameter */I have to access the compile code as part of build and update the code to ...
Hey all,I'm creating my socket connection in a program that i am running in a cmd window. For what i need in my prog, i have a loop that tries to connect every 5 seconds, and even after that, I need to continue looping to check and try to connect.The only way i can end the program is to cntrl-c or ...
355 byte By
Carraa at 2007-11-27 10:32:40
I was wondering if the rmi - server calls are synchronized.Example:A remote server with this method:int number;public int getNumber() throws RemoteException{ number++; return number;}If multiple clients call the server, can they get the same number?Or should I synchronize the ...
Hello everybody, I am new to these forums so please bear with me :)I've recently been attempting at setting up a file transfer protocal in java, but I don't think the packages in the api docs that I downloaded from this site have the specific package with the classes I need in order to do one. Is ...
1934 byte By
bearwiga at 2007-11-27 10:33:33
Is there any good documention on ClassLoaders?I want to understand ClassLoaders because of an issue I am having, but I cannot find any good documentation on the subject.Here is my issue, but please understand I am somewhat ignorant regarding ClassLoaders.I have a set of JARs that are frequently ...
<p>Hi!</p><p>I have Java application where I wanted to allow user to make changes in configuration file (text file). Can I open Microsoft Notepad from My Java Application and make the changes/save the files?</p>
553 byte By
kmhosnya at 2007-11-27 10:34:00
hi every body,i am trying to make a simple chat program and in the network implementation i have made a server/client connection but when i run it and try to send a message from the client to server a sudden error occur it says "stream closed" when trying to send a data using the server's socket ...
Hello allI have successfully compiled files using javac. The path is set, so I just need to open a command prompt and simply type javac AddServerImpl.java and it compiles with out errors. I do not have to specify any path at all. But when I try to compile using rmic, that is where I have the ...
591 byte By
EvanDa at 2007-11-27 10:34:45
Hello, On the website NetLibrary-- you can access and read books-- but only one page a time and there is a time limit.After looking at the source code I found out that the general link is something like this: http://netlibrary.com/nlreader/nlreader.dll?bookid=7373&filename=Page_9.htmlThat site ...
1293 byte By
nichelea at 2007-11-27 10:35:10
Hi All, I have a my own ScheduledTaskExecutor that extends ScheduledThreadPoolExecutor and I have some methods to schedule some tasks in order to run it at fixed period and this work without issues.Now I have to force the execution of an already scheduled task when an event occurs (actually I'm ...
1412 byte By
xpantaa at 2007-11-27 10:35:24
Hi,I have this codetry{ObjectInputStream fromServer;ObjectOutputStream toServer;Wrapper.clear();toServer.writeUnshared(Wrapper);toServer.flush();try{obj = fromServer.readObject();if (obj != null) {if (obj.getClass() == Hashtable.class){tab = (Hashtable)obj;}}}catch (EOFException ...
16478 byte By
Wongwxa at 2007-11-27 10:35:59
/* * TaxPayerRecord.java * * Created on December 21, 2006, 11:42 AM * */public class TaxPayerRecord implements Comparable <TaxPayerRecord>{private String nric;private String name;private String dateOfBirth;private String gender;private String blockNo;private String unitNo;private String ...
4737 byte By
JToolTipa at 2007-11-27 10:36:06
I am trying to make an object textscripting kind of thing(based on something made by Silabsoft). How would I get this to work?public String transform(String s){while (s.contains("@")){String varString = s.substring((s.indexOf("@"))+1, s.indexOf(" ", (s.indexOf("@"))+1));try {Class clazz = ...
1674 byte By
amr_ssa at 2007-11-27 10:37:06
I am reading a file into a string variable.Then I am looking for a pattern in a that string.Even though the pattern exists in the string, it is detected only if there is no newline characterat the end of the file. If i insert a newline using my editor (notepad, Window OS) at the end of the file, ...
Is there a simple way to draw a given number of random objects from a collection in Java?The best I could come up with was...Take the collection and put it in an arraylist.shuffle the arraylistUse the first n objects.Is there an easier way that I am not thinking ...
So I don't crowd up the post, I will post a pastebin link of the code: http://pastebin.ca/620970=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=--=-I am attempting to make a java textscripting sort of thing that will call voids. Currently, since im in a crappy stage, i have commented out parts that ...
I have worked with java for 3 years now and I just started networking yesterday. I got a fully working chat program up using sockets. It works fine between computers on a LAN but how do I get it to connect via the internet? InetAddress.getLocalHost() returns my LAN IP, and over the internet, socket ...
hi. i have a server in java and a C# client. they are communicating through sockets. however when i tried to sent to send a image (a few mb) the server would only received 7300 bytes. some parts from my codesint servPort= 3333;ServerSocketservSock= new ServerSocket(servPort);int i= 0;byte[] ...
hi alli have one scenario where new table gets created run time, where the columns of that table and data type of the columns can be configured by user.I have to create DTO, referencing this new table.So is it possible to add new fields and getter setter methods of that fields to be created in the ...
import javax.naming.ldap.*;import javax.naming.directory.*;import javax.naming.*;import javax.naming.directory.BasicAttributes;import java.util.Properties;public class test {public static void main(String[] args) {Properties env = new Properties();env.put(Context.INITIAL_CONTEXT_FACTORY, ...
Hello,I'm a student and I'm new to networking in java. For the purposes of my project RMI seems to be an ideal solution, whats more I really want to master what looks like a powerful tool.Below I will post 3 classes and the code which i use to compile the main one. If its not to much trouble ...
465 byte By
laryya at 2007-11-27 10:40:24
Hi,I'm writing a simple app which uses com.sun.net.httpserver.HttpServer. Handling single requests involves opening some ui dialogs - at this point everything is ok. Problem starts when the client closes connection before the response is formed. Unfortunately I cannot know about that before trying ...
2245 byte By
bunty4ua at 2007-11-27 10:41:01
Hi everybody I am doing small program to read the content's of file from the local PC using URL class. I have written the following code but i am getting the error as "file not found". can anybody help me to solve this problem. how to give the path of the file to URL class constructor to read the ...
Hi All,I am getting the last Modified Date for all types (.html, .txt etc.) of remote files except JSP file. Here is the code I am using:URL url=new URL(" http://www.mysite.com/index.html");URLConnection uc=url.openConnection();Date d=new Date(uc.getLastModified());System.out.println(d);Only for JSP ...
<p>If I have mutliple APIs in different directories, but have a project that needs classes from both APIs, could I simply copy documents from one API into the other? Or is there another method?</p>
hello,i'm trying to update older code to java 1.5 using generics. i'm new to generics and i have a problem i cannot solve: assuming the interfacepublic interface Stake{public Stake makeACopyAndShift( long delta );}and the classpublic class BasicStake{private final long pos;public BasicStake( long ...
359 byte By
nichelea at 2007-11-27 10:43:16
Hi All,I would like to know some idea to resolve this issue about UDP in a easy way (if it exists)....Basically I have a process that publishes some UDP multicast packages and many process that read such packages. Every packages represent a request for a "work" and I would that just one "reader" ...
I am trying to send files from one computer to the other over a windows network. I have absolute path names of the two locations. Can you just use "File.renameTo(File);" to pull this off? Is there a fast way to move files over a windows network? Thanks so much for your ...
I have a directory that has over 100,000 files in the following format:Invoice-100010001-16072007.xlsInvoice-100010001-16072007.pdfI want to be able to find all files with a certain name (ie Invoice-100010001).Is it possible to use a FilenameFilter to implement ...
From my GUI press "Used Phone Acquisition" when enter is pressed the data will be saved and return to "select option".Am i going to use queue or vector? and how to add tf1.setText(""); to EventHandler Cancel and Cancel2 to terminate data entry.import java.awt.*;import java.awt.event.*;import ...
hi,i got the following error message when i try to connect to an ms exchange server. javax.naming.NamingException: [LDAP: error code 1 - 00000000: LdapErr: DSID-0C090627, comment: In order to perform this operation a successful bind must be completed on the connection., data 0, vece; remaining name ...
I have a client application running on JDK1.6 and trying to connect to a JMX running on Weblogic 9.2 server with JDK1.5.0_06.An exception was thrown on client side when processing return from JMX server, the most relevant exception seems to be:Caused by: java.rmi.UnmarshalException: failed to ...
Hi,I am getting a char[] after executing a DB Stored Proc from Sybase DB . But the value returned is Cha [] instead of String. I understand that string and char[] are same . but that is not the case . When I try to display the string in JTextarea it does not honor the \n . Slso the spilt method of ...
459 byte By
hsy541a at 2007-11-27 10:46:11
I'm an entirely newbie about the LDAPI want to setup a openfire server using LDAP authentication on my client machine while i do not know what does base DN mean and can not pass the connection test. There always comes a error message saying "[LDAP: error code 1 - 00000000: LdapErr: DSID-0C090627, ...
3276 byte By
MikeM64a at 2007-11-27 10:46:16
Hi,I am refining a program I made in school (Mandelbrot) to make it threaded. Currently everything hangs on one thread and the program locks (spinning beachball of death - mac) until the program has finished calculating the image. I am trying to add just one more thread so that the interface does ...
Hi, I am new here and just finished AP Computer Science learning Java. I am now doing a little programming project for my brother. He is giving me a folder with spreadsheets. I should be able to detect if he has added new spreadsheets. I have figured out the logic of the program (except how to ...
How to use socket proxy in NIO?Our socket Server program is hinding a firewall, so our client have to use a socket proxy to visit server.We can set socket proxy by using block socket as ...