Java-index »» Core »

RMI.....Testing further

2415 byte By NoRationalSolutiona at 2007-11-27 11:17:36
Hello, I posted I am trying to test RMI for further use in another project of mine but i am having trouble with the connection and security issues.Firstly my Client-Server test worked perfectly when they shared a package. Now ,however, i have moved them both into separate "project" files in eclipse ...

to play a stream audio file with external program...

276 byte By berlinerwurma at 2007-11-27 11:17:43
<p>Hi, I get with stream a sound file and I have to play it using an external program like VLC, reading the file continuously of a buffer. How can I do it? Would I have to controll VLC commands? I have been reading about it, but I have no idea how to do it.</p><p> Thanks.</p>

Writing keyboard input into a file- simple writing program

266 byte By futureaussiectoa at 2007-11-27 11:17:44
<p>Hi guys</p><p>im trying to figure out a basic how to type input to the screen and it be written to a file. The only problem is that my book is overcomplicating the matter and i cannot work out just the basic method- to expand upon later</p><p>can anyone help?</p>

Communication between applet and servlet in different containers.

292 byte By uniqueoua at 2007-11-27 11:18:23
<p>Hi,</p><p> I have an application (Applet) running on a OC4J instance. And also I have an application (Servlet, JSP) running another OC4J instance. These applications running on different browsers. I need communicate them. </p><p>Which method may I use? may be socket or something else?</p>

Multicasting problem

2261 byte By Adamski84a at 2007-11-27 11:18:39
Ok i have a multicasting client that sends a request to a multicast address 224.0.1.1. Can anyone please tell me why whenever i run this, either no connection at all happens, or the packet sent back to the client is just a copy of the request message the client sends:import ...

Only 25 directory changes in one FTP session?

818 byte By oli_004a at 2007-11-27 11:18:40
HiI'm writing a small application that scansdirectories on a ftp server.However after 25 changeWorkingDirectory(directory)or listFiles(directory) the scanning thread just freezes.If I do aconnecting -> login -> changeDirectory -> listFiles() ->disconnectreconnecting -> login -> changeDirectory -> ...

Remove method for Ternary Search Tree

507 byte By aria_kokoschkaa at 2007-11-27 11:19:17
Hi,After spending the last 8 hours trying to implement the "remove" method for Ternary Search Tree, I came to the sad realization that the algorithm is just way too complicated to implement (not the insertion or search methods though) -- there are just way too many scenarios to consider. Before I ...

Setting and resetting stdout

697 byte By ExitsFunnela at 2007-11-27 11:20:28
Hi,I'd like to temporarily redirect IO fron within java code. The redirecting part is easy enough using System.setOut(printStream) but the lack of a corresponding System.getOut( ) is keeping me from restoring the old value. In other words, I want to do this:PrintStream newOut = ...PrintStream ...

Help needed in HTTP Tunneling - urgent

238 byte By Lior_Levya at 2007-11-27 11:20:50
<p>Hi all,</p><p>I urgently need a working code sample of a <b>client</b> which sends requests to a server that redirects the request to an RMI server via RMI servlet.</p><p>Does any of you familiar of such a code sample?</p><p>Thanks</p>

RMI + SSL fatal alert: handshake_failure

14038 byte By oldmatebrendoa at 2007-11-27 11:21:12
Hi all,I have been looking for a solution to this problem, and possibly a little guidance forabout a week now in regards to using an applet to communicate with a server using RMI through SSL.I am down to what (touch wood) is my last error before my test program works.This error doesn't occur when ...

Duplicate ByteBuffer.array() method in Java 6

1426 byte By koksallimana at 2007-11-27 11:21:14
I am using Java 1.6.0. When running the following code:import java.lang.reflect.Method;import java.nio.ByteBuffer;public class test{public static void main (String[] args){for (Method method : ByteBuffer.class.getMethods()) {System.out.println(method);}}}I get, amongst the output, two "array" ...

Compile error for EventObject

581 byte By nerdEvera at 2007-11-27 11:21:18
import java.util.EventObject;public class DataEvent extends EventObject {public DataEvent(){}}when i compile, it gives error like the following:Eventobject(java.lang.object) in java.util.Eventobject can not be applied to ()could anybody help me ...

BundleException: Timed Out

3733 byte By JTTa at 2007-11-27 11:23:29
I use OSGi and I create bundle called Server, which contains three classes and one of them is the bundle activator. I will publich the code of the three classes and then will write my problem. So the first class is calles "ServerThread" :public class ServerThread extends Thread implements Constants ...

how to get byte offset

898 byte By Flossya at 2007-11-27 11:24:24
Hello, I am trying to parse a XML file and want to store the byte positions of start and closing tags so I can later use RandomAccessFile to get a particular xml element. But I am having some trouble with it...I haven't found any Xml parser api that would allow me to do this, so I tried to parse ...

Creating Messanger Using Jabber.

256 byte By Anand_Bala2007a at 2007-11-27 11:24:34
<p>Hi</p><p>I want to create instant messanger using JAbber.But i want protocals and sourec code for JAbber.I search in JAbber site. But they give only applications source code.So where i get the source code for JABBER ? Pls Help ME</p><p>Thanks To All</p>

deploy mbean in weblogic 8.1?

182 byte By sachin@a at 2007-11-27 11:24:38
<p>how to deploy mbean in weblogic ?</p><p>what are the changes need to make in config.xml . </p><p>How to access mbean from client side.</p><p>thanks in advance.</p><p>Sachin >></p>

How to iterate over a collection of a Map

478 byte By Rhea1978a at 2007-11-27 11:26:17
How to iterate over a collection of a MapI get a ClassCastException when doing the following pls help:ollection all=CDA.getC(VO);//some method returnign a collection for (Iterator it=all.iterator(); it.hasNext(); ) {HashMap element =(HashMap) it.next(); for(Iterator j=element.entrySet().iterator(); ...

How to create a collection of hashMap

466 byte By Rhea1978a at 2007-11-27 11:26:58
I have a query which returns a collection through ORM.Now I parse that collection and do so processign based upon a particular value of key null and not nulland I have to create two separate collections out of this main collection.How do I do that?Collection will contain Maps.Collection c1=new ...

Generic conversion problem in a project.

902 byte By bruceallen612a at 2007-11-27 11:27:00
I was previously using Jdeveloper, and decided to migrate some code to Eclipse. The code below worked fine in my Jdeveloper(1.5.0_05) project, but upon migrating is an error that states. Cannot create a generic array of LinkedList<PlayerAction>. private LinkedList<PlayerAction>[] ...

Custom ClassLoader

317 byte By BB81a at 2007-11-27 11:28:43
I do not understand much how to create a simple custom class loader. I found many explaination about it. I don't really get what it means.Can anyone explain to me in simple code? My custom classloader doesn't work at all. I want to load a class in another package. How can I do ...

java.security.AccessControlException: access denied

3615 byte By jingsong1a at 2007-11-27 11:29:24
Hello All:When I used the following codes in Applet. String urlstr = "https://www22.abc.com/csm/cgi/getdata.cgi?username=scott&function=cnet" url = new URL(urlstr); URLConnection con = url.openConnection(); con.setUseCaches(false); return con.getInputStream();// Line 257 I got this exception ...

Generic classes with parameterized super class and interface

1394 byte By mjkhan21a at 2007-11-27 11:29:40
Hello.I'm trying to write a generic class that looks like the following pseudo-code.public interface Interface {public Interface getSibling(...);}public class Klass {...}public class MyKlass<T extends Klass, T2 extends Interface>extends T implements T2 {public T2 getSibling(...) {return ...

What is fail-fast iterators ?

170 byte By raja.datlaa at 2007-11-27 11:29:41
<p>Can anybody please clarify what does it exactly mean by fail-fast iterator. I had even gone through the entire API which says about this . but coudn't make it out</p>

Form where to start - server side

614 byte By yael800a at 2007-11-27 11:30:37
HI,I'm new in server side.I'll start a new job in these topic (I will learn @ job), but I want to start to learn myselp.Al I know is it will be with J2EE & serverside.I have programed in the client side with swing 7 months.I don't used J2EE so from wher should I need to ...

Runaway Thread

1567 byte By T01deva at 2007-11-27 11:31:01
Hi,Ok, so multi-tjreading is the word. I implement the following:public void inits(){try {initAll(); // GUI initsdtartThreads(); // threads that need to run }}When I run this JAppjet ... nothing. Far be it from breaking down open doors (and answering my own questions) but am I right in assuming the ...

Thread blocked

451 byte By cheetaha at 2007-11-27 11:31:03
Hi all,I am writing an API to be thread safe. As I know if a share object is enclosed by a sychronized block, any attempt to lock the object that is already locked will be blocked. My questions are i.) is it using thread.wait() to cause those threads giving up the CPU resource? ii.) If using ...

How to get method call stack information in java code

333 byte By satyajit83a at 2007-11-27 11:31:22
Hi,I have a method a() in class A. I want to get the name of method and class which called method a. Is there any way of doing it ?I tried using StackIntrospector from org.apache.log.util package, and it solves my purpose. Is the same thing possible using standard java API's without using any ...

Error: Management agent class failed : sun/management/snmp/util/MibLogger

364 byte By cheetah@a at 2007-11-27 11:31:44
Keep getting this error when trying to execute the following,/opt/java/jdk1.5.0_08/bin>./java -Dcom.sun.management.jmxremoteError: Management agent class failed : sun/management/snmp/util/MibLoggerThis problem surface after the Unix adminstrator did an SUSE OS patch.Please advise if someone knows ...

NavigatableSetExample:Error with the code

3462 byte By swetha123@sa.coma at 2007-11-27 11:32:13
import java.util.*;import java.util.concurrent.*;public class NavigableSetExample{public static void main(String[] args) {System.out.println("Navigable set Example!\n");NavigableSet <Integer>nSet = new ...

give your suggestion

323 byte By kannankallia at 2007-11-27 11:32:26
i am really appreciate any help from you guys..I am blind in Collections .... I would like to use collections in my project ?Initially registration form ...I get value from registration form. and form values will be stored in database ..here can i use Collections ? which one i will use ...

Initializing Vectors with objects.

1117 byte By JayRoya at 2007-11-27 11:32:56
Hi all,I am investigating a problem and have narrowed down to a section of code where the Vector.get() method returns an empty string instead of null when the key queried doesnt exist. I know I can alter the code to check for null or empty string but I wanted to find out why?I am not sure if ...

On The Fly Remote method generation

1305 byte By mADHURtANWANIa at 2007-11-27 11:33:31
Hi, We have a design where in a module can be executed remotely as well as locally. The remote implementation of the module uses RMI.The Issue that we are facing is as follows. We want the client code to remain unchanged even if the implementation is switched. Hence, the base interface which ...

when reading text file from client server run infinite

311 byte By sivanandana at 2007-11-27 11:34:07
hi iam trying to do read textfile information sending by client and reading from server.in the server side after completeing eof it wont terminate.before sending file client copy the text file data and overidethe text file with same data and then send.i need solution for this one any one help ...

ScheduledExecutorService subject to time drift?

2906 byte By gconfa at 2007-11-27 11:35:43
I am using a ScheduledExecutorService to run a handful of scheduled tasks in a j2ee app and so far the experience hasn't been pleasant. One of the problems I am currently seeing is that the scheduler seems to randomly time drift for no expected reason and start running my tasks at a different ...

Wildcards in the class definition

980 byte By leostar_10a at 2007-11-27 11:36:18
I have a class which extends java.util.Hashtable. The Key is String and value is a HttpClient object, but in future I can have Values as objects other than HttpClient. I was thinking to use a wildcard for storing the value, but the syntax isn't right. What is the right way to do it? Thanks.public ...

Locking a variable

233 byte By alilia_2000@yahoo.coma at 2007-11-27 11:36:23
<p>I use a boolean flag that say modify allowed or not for a particular variable. I have a feeling that there is a more efficiant way to do it. My goal is that in-between submit->confirm->submit, no one would modify this variable</p>

HashMap

330 byte By Dougie1610a at 2007-11-27 11:36:41
Hi there,I am new to these forums and I am having an error with compiling my code.This is the code:Map words = new HashMap();String word;words.put(word, new Count(word, 1)); // this is the line that is not compilingIf anyone can offer me any help, that would be ...

Regarding connection timed out exception

679 byte By RamaDevia at 2007-11-27 11:37:48
Hi all, I need a help. I am using URL class to connect Google try{ URL url = new URL(" http://www.google.com"); URLConnection myConn = (HttpURLConnection)url.openConnection(); myConn.setRequestProperty("User-agent",""); buffer = new BufferedReader(new InputStreamReader(myConn.getInputStream())); ...

Modifier and Accessor Synchornization

4935 byte By aria_kokoschkaa at 2007-11-27 11:37:57
Hi,This is not what you may think -- it is not about getter and setters, allow me to elaborate. I have a data structure that requires a few modifications to the underlying data and many accesses (M threads add/remove, N threads access).To achieve concurrency, I am adding two minimalistic locks to ...

HTTP redirect?

6464 byte By smithdale87a at 2007-11-27 11:38:10
Hello all,Im making a simple app that will fill out a login form to login to Yahoo! on their https://login.yahoo.com server. Then, I am trying to get it to redirect me to one of their game room servers. However, I keep getting a page that says, "your browser doesnt support redirects..." something ...

Exception using RMI, Eclipse and Cajo

9761 byte By SanSebastiana at 2007-11-27 11:39:10
Hi,I am new to RMI and I have a problem with my first program. I use Eclipse 3.3, Java 6, EMF and Cajo. This is my server:package server;import gnu.cajo.invoke.Remote;import gnu.cajo.utils.ItemServer;import java.io.File;import org.eclipse.emf.common.util.URI;import ...

problem reading bytes from server pleasereply soon

479 byte By coreJavaa at 2007-11-27 11:40:08
hi ,i am trying to read a byte packet sent as a response by some web server , the problem i am facing is that i am not able to figure out how to end the loop reading bytes as received from server , i m putting the code below please reply sooni know there is something wrong with the approach but i ...

Client send a modified file to server,Server Cant read EOF(run infinite)

903 byte By sivanandana at 2007-11-27 11:40:15
client modifying the "text file" and send to server.In the server side i try to read.i read all data but cant get end of File......so that it execute infinite.i tried to used all I/O.So that i created text file manually.Server read that file and terminate.brief summary:--client::--1.The given file ...

help me how to solve this problem

903 byte By sivanandana at 2007-11-27 11:40:40
client modifying the "text file" and send to server.In the server side i try to read.i read all data but cant get end of File......so that it execute infinite.i tried to used all I/O.So that i created text file manually.Server read that file and terminate.brief summary:--client::--1.The given file ...

de reference Objects if possible

978 byte By Tiblea at 2007-11-27 11:40:46
HII have an application which runs a simulation model (of some scientific parameters over a period of time) and produces some nice output graphs (from an array of processed output data) However if the model was to be run again, the same (but new Objects) are created and thus each simulation adds ...

help me how to solve

550 byte By sivanandana at 2007-11-27 11:40:58
can u please see the question sir.that is the problem.CLient:in the client side am processing Index.txt file. i.e: copy the content from index.txt and then do some process such as removing some line and then update remaining datails in the index.txt.afterwards i send to server.Server:in the server ...

to encode or not to encode

432 byte By NovaLokaa at 2007-11-27 11:41:27
Suppose you have a link:String location =" http://www.website.com/my spaced dir/ccnt.html";According to the URL specification some of these characters need encoding.Does that mean the URL should be created like so:URI uri = new URI(location);String str = uri.toASCIIString();URL url = new URL(str);Is ...

ReadObject - NewInstance of unknown Object's

1381 byte By RobOsbornea at 2007-11-27 11:41:58
I have a Client/Server connection over sockets.The server returns different types of Objects. I run the readObject method then, how can I instantiate the received class object ?Seems to work fine when the Object is a String class but I receive the following error for java.io.file ...

Mkdirs() creates read-only directories

518 byte By N00dlesa at 2007-11-27 11:42:07
In my application I have a piece of code that creates directories with mkdirs(). So far, so good. But after that, I want to copy a file to one of the (sub)directories. However, the directories are all read-only, so I get a runtime error:java.io.FileNotFoundException: (Permission denied)Because the ...

I need idea to create search text in list

584 byte By satyasunil_java@yahoo.co.ina at 2007-11-27 11:42:21
Hi Experts,I am have one HasMap, which contain ID as key and name as value.In that Map i need to find out name which starts with 's' character.Example: 00001, Satya Sunil00002, Munna Prasad. This is input in HashMap. Just i gave 2 rows for example. If i need to search starts with 's' in Map, ...