Java-index »» Core »

How to run multiple Thread using Scheduler's in 1.5

660 byte By suman_tejaa at 2007-11-27 9:00:26
Hi, I have a scenario, in which I have to run a Thread at every 15 minutes, If the first Thread is not Finished in 15 min then new Thread has to start. Currently I implemeted with java 1.5 schedulers, but the problem is if my first Thread is taking more than 15 min, then no new Thread is ...

getting RMI JMX Server Stub from wihin a tomcat MBean itself

2118 byte By mwilligensa at 2007-11-27 9:00:58
Hello,to my environment:- java 1.5- tomcat 5.5i am trying to access remote mbeans from my web-app instances running on different machines for some clustering purpose. in general i am trying to access the oher remote mbeans from within a mbean itself using a rmi stub wrapped in some kind of a ...

Naming.lookup not able to get the RMI registry made in eclipse.

4325 byte By lily_in_usa at 2007-11-27 9:02:04
I have written two classes in separate packages of the same project. One is beinng used as the server and the other is used as the client. I make the Registry entry in the Server Class as: PowerServiceServer svr = new PowerServiceServer(); // ... and bind it with the RMI Registry Naming.bind ...

ObjectInputStream over sockets Problem

3419 byte By Mjacobsa at 2007-11-27 9:02:54
I am trying to call a method on the server from the client. I called a new instance of the class and wrote the new instance as an object to the ObjectOutputStream. I wrote an interface on the client side. Am I able to do this?(or allowed to) Oh yeah the server is on a different machine. The ...

ftp libraries

94 byte By kpba at 2007-11-27 9:03:12
Hi,could you advise me free javalibs for working with ftpthank you

Want to have threads 'auto-destruct' or killed after a certain time period.

585 byte By MePacoa at 2007-11-27 9:03:14
Right now I have some code that creates and starts threads to perform certain tasks. Some of the threads I care about so I wait for them to finish (join() with a reasonable timeout value). The problem is that there are some threads that I don't care whether they execute successfully or not so ...

File Transfer help-beginner

211 byte By manishmulani@nitka at 2007-11-27 9:03:33
hello,i'm planning to implement file transfering b/w two computers on network or internet using java...how do i get started with?wat all i need to know?pls reply..thanx

Thread Pool

2228 byte By java_swing_dudea at 2007-11-27 9:04:19
Hi,I have a HashMap storing objects of type Employee. This map is keyed by employee id. I have a data feed sending me employee updates at a rate of up to 200 to 300 employee updates persecond. What I need to do is get the employee id from the data feed and check if it is in my Employee HashMap. ...

How to get traceroute data between two remote machines?

523 byte By Jubaera at 2007-11-27 9:04:41
Hi thereI am using JDK 1.4 and thus I wrote my code for tracerout like thisCmd = "tracert host X";Runtime r = Runtime.getRuntime();Process p = r.exec(Cmd);This works perfectly and gives me results between host X and my machine.Now I would like to run my code from my PC but it should give me the ...

Tracking size of object in JVM

74 byte By BabuSundarama at 2007-11-27 9:04:55
Hi How do i find out which objects are taking memory in JVM.

using Hyperlinks and Logins of URL in Java program

539 byte By Wolfx128a at 2007-11-27 9:04:59
Hey, I am not quiet sure if this is the correct forum to place this question in, but i went with it because of the stamp networking.I am building a program that grabs sites of the web and decodes the HTML and then displays a web page. I would like to know how I would make the links from the ...

How ajax works?

65 byte By krish1315a at 2007-11-27 9:05:37
How come only partial page is refreshed in web- browser. ?

HTTP Post Returning Different Results from HTTP Get

3609 byte By rcauvina at 2007-11-27 9:05:40
I am having trouble with an HTTP POST returning different results froman equivalent HTTP GET. If you go to the following URL in a browser: http://transit.511.org/tripplanner/itinresults.asp&fs=714+Montgomery+Styou will see that it displays a web page containing the following text:"We found ...

Generics how to

121 byte By mammaa at 2007-11-27 9:06:18
Where can I find a good tutorial on generics that will consist examples and settings of ide to use itThanks

SocketChannel.write() blocking application

2452 byte By Dofusiana at 2007-11-27 9:06:24
Greets,I'm developping a huge application and got a latency/block problem using the write(ByteBuffer) method on a Socket from a socketchannel connection.Running java 1.5 (diablo) on Freebsd 6 servers, 4Gb ram (2.2 allocated to jvm), with dual xeon dual-core (total 4 cores)Here is the ...

java.net.preferIPv4Stack

140 byte By KeyzerSuzea at 2007-11-27 9:06:33
How to set this from within a program. I know how to add it to the command line with -D but how do I do it from with an application ?

hashmap

80 byte By RaviKumar.Avulaa at 2007-11-27 9:06:49
how to extract values from one hash map and put it in to another hash map

IllegalMonitorStateException - Lock lost, but why?

3166 byte By maxpga at 2007-11-27 9:07:00
I have some kind of synchronization problem. somehow I get an IllegalMonitorStateException when calling notify on an object, but this object is within a synchronized block! The code looks like this:private volatile Set<K> set = new HashSet<K>();private Map<K, ...

Using JConsole in combination with SNMP

1324 byte By WillemTijma at 2007-11-27 9:07:12
I have created a simple agent (using version 5 JDK) to handle an MBean. Within this agent I have created two adapters; an HTML and SNMP adapter. The HTML adapter is working fine via the browser (i can execute the operations on the MBean). Question is; Can I use JConsole to connect to the SNMP ...

Problems running an interactive Process: the process's output isn't appeari

4739 byte By Daniel.Wintersteina at 2007-11-27 9:07:19
I'm trying to run an interactive Linux process from Java. That is, a program which prompts the user for input as it runs. I want to catch the output and feed in appropriate responses. See the sample code below.When I try to run this, it hangs. The process sits there without terminating or ...

How to find out whether a RMI calling client is local or non-local

204 byte By eddiecjchianga at 2007-11-27 9:07:26
How to find out whether a RMI calling client is on the same physical machine as the server.Taken into account the machine may have multiple NIC and hence multiple possible IPs.Regards

Broken Pipes

1067 byte By sun_java_helpa at 2007-11-27 9:07:50
I get a broken pipe error while uploading feeds to an ftp server,,,,any resolutions?2007-06-26 06:04:49,430 INFO [STDOUT] java.net.SocketException: Broken pipe2007-06-26 06:04:49,430 INFO [STDOUT] at java.net.SocketOutputStream.socketWrite0(Native Method)2007-06-26 06:04:49,430 INFO [STDOUT] at ...

How to find out the name of the user who is logged into Windows with JNDI

615 byte By buddylighta at 2007-11-27 9:10:51
Hello,We have 17 schools in our company which we serve. Every school has a shortcut name like EKS or ASR. Every school has 1 IT teacher which can log into a jndi desktop application where he can set passwords for teachers/pupils if they forgot theirs...When the IT teacher press the button to ...

programmatically find out if rmiregistry is running?

108 byte By nthalia at 2007-11-27 9:11:01
Is there a way to programmatically find out if the rmiregistry is running?Thanks,Nilesh

sockets & streams vs socketchannel

149 byte By invictus2a at 2007-11-27 9:11:23
HiI am getting confused with all this sockets/streams and socketchannels...Which is the better way of doing network programming?

getting chunked response from the server

2198 byte By gaurav_abbia at 2007-11-27 9:11:50
hi all,i'm working on a issue in which when my http client recieves chunked response, it fails while writing the data in the internal process, i want to simulate it and for this i need to run a server which should respond with a chunked response so that i can see what's going wrong in my ...

How to Convert Binary Data in Binary File

298 byte By Mohamed_Asifa at 2007-11-27 9:12:54
hi,my telecom client puts a binary file which is asn.1 encoded with BER.how to handle binary data in java.how to convert binary to hexa to ascii formathow to convert binary to octet to ascii formatplease help me in this.regards,s.mohamed

thread suspension problem

2362 byte By kulkuria at 2007-11-27 9:13:22
I have a swing problem, which needs some threading code, but I barely understand it.My text field components change the underlying data when the focus is lost. When I click on a different tab in the JTabbedPane while editing a field, at the time the ChangeListener runs, the focus is not lost, ...

java NAT server?

1193 byte By hos123a at 2007-11-27 9:13:37
Hi thereI am trying to set up a practical for a computer science module and need to check the feasibility of creating software that acts like a DHCP and NAT server in java. I'm pretty sure the DHCP is possible using datagrams, but I'm not sure that a NAT server is possible. So far what I ...

Accessing the RMI object from EJB

3087 byte By yogendra_ga at 2007-11-27 9:13:52
Hi I have registered an RMI object in the JNDI tree of the Weblogic server. This RMI object is supposed to be accessed by multiple Session Beans. I lookup the RMI object and get the instance. But when I try to narrow it , it throws the ClassCastException. Following is my code : Object obj = ...

Can I make a file uneditable?

220 byte By Kami_Pakistana at 2007-11-27 9:14:09
Hi there!!In fact my java app creates a config file on the client's machine and I want that after the file's creation the client or any user can't edit the file,,,is it possible some way?Thanks...

XMLDecoder and System.in

1615 byte By AndreasLa at 2007-11-27 9:14:23
Hi,I have an issue when using the XMLDecoder class in conjunction with System.in.What I want to achieve is basically to be able to send the contents of an XML file to stdin of the Java application. However, when doing so, the readObject call to the decoder does not return anything until either ...

java.io.NotSerializableException: magick.MagickImage

667 byte By Samantha at 2007-11-27 9:14:55
Hi, I was trying to use Jmagick and I have a MagickImage object. I wanted to convert it into byte[]. But I have this exception. The following is the code that I have used.<code>ByteArrayOutputStream bos = new ByteArrayOutputStream(); ObjectOutputStream objectOutputStream = new ...

ByteBuffer Entering Double in array

325 byte By Joseph.Kubenaa at 2007-11-27 9:15:37
i am using a java application to communicate with a server written in C# the server side looks at a double reading the Most significant byte first to the least. my doubles are being entered into the byte array which i am sending least significant to most significant. why is this, is there an ...

Some basic questions about rmi registry context "bind" and "lookup"

3716 byte By lwintfelda at 2007-11-27 9:16:52
We have more processing to do than can be accomplished with a single computer. To solve the problem I've implemented a distributed computing solution using RMI. (The first time I saw RMI was about 2 weeks ago, so please bear with me!) The implementation is a proof of concept not a fully ...

We can taken the folder as inputstream and move to another ?

1277 byte By javaskilleda at 2007-11-27 9:18:12
i need to move all content in some folder and move to another we can ? import java.io.*;public class TestOut{public static void main(String args[]){try{File file=new File("c:\\from");InputStream fis=new FileInputStream(file);File file2=new File("c:\\to");OutputStream fos=new ...

Mails Receiving

2079 byte By rajeshkrishnan83a at 2007-11-27 9:19:02
Dear all,Greets for the Day.I am here by sending a java program to receive a mails from my inbox but if i run it i am getting the following error.Please help me to rectify the problem and get the result.Thanks for your help.Regards,Rajesh.Program is import java.util.Properties;import ...

java.io.StreamCorruptedException in Spring HttpSpringInvoker (help)

2465 byte By garethcpa at 2007-11-27 9:19:19
Hi,I encountered the following exception during the retrieval of Object[][] from the service.org.springframework.remoting.RemoteAccessException : Cannot access HTTP invoker remote service at [https://test.org.net/context/remotin...vokerService]; nested exception is ...

static detection of deadlock in code

275 byte By bobby_dublina at 2007-11-27 9:19:29
hello all,are there any static deadlock detection tools out there for java?i have read something about lock_lint provided by sun, is lock_lint compatible to java 1.3?any other tools out there worth mentioning?thanks for your replyrob

lan searching

229 byte By atul_jaina at 2007-11-27 9:19:42
hi! i am planning to develop an application which finds the live hosts on a local area network and then lists the shared folders on each machine. basically i want to search for files and folders on lanplzzz.... help

Memory management HashMap versus ArrayList.

873 byte By monaPillaia at 2007-11-27 9:19:43
Okay, here is my question. I have been trying to research on the memory hit an application is going to incur if it uses a HashMap instead of an ArrayList and I have not been able to find a satisfactory answer. Suppose I have say 10,000 objects and the way I access them is such that 50% of time ...

Proxy Handling

4445 byte By tigerxxa at 2007-11-27 9:20:43
Hi Guys, I was trying to create a connection to our proxy server and tried to fwd the requests coming to my ip to proxy server.I have tried using Proxy class. But the issue is that I am getting invalid proxy exception please help me with this. The code I have used is pasted belowimport ...

RMI-IIOP over SSL

137 byte By jw010707a at 2007-11-27 9:21:23
It is very difficult to find examples of RMI-IIOP over SSL.Can anyone give me a simple example about it? Thanks in advance.

Exception handling

882 byte By mahiva at 2007-11-27 9:22:49
If I write a program that will generate OutOfMemoryError, and catch it using Throwable then the line after catch does not execute, but if I use Error instead of Throwable then it gets executed. Why so?import java.util.*;class TestExcep {public static void main(String[] args) {Vector v1 = new ...

javax.naming.NoPermissionException; remaining name '"...

1019 byte By JesseKoa at 2007-11-27 9:23:41
Hi!I use fscontext-1_2-beta3 to be my file system service provider. It worked fine on windows system, but failed after migrate to AIX. The following error message is what I got:javax.naming.NoPermissionException; remaining name '"/usr/...../jndi/jdbc"'[java]at ...

LDAP Booster Pack from SUN and old JNDI classes 1.2.1

1034 byte By 4tha at 2007-11-27 9:23:53
Hello folks,I am using W2K server for accessing Active Directory with JNDI but i need some Controls/Extensions which - so i have read it in a java/ldap book - i should find this stuff under the link: ...

BAD_PARAM/201. vmcid: SUN minor code: 201

6269 byte By S_Chantia at 2007-11-27 9:23:54
When i am trying to execute the code of CORBA "BAD_PARAM/201. vmcid: SUN minor code: 201 " exception comes. The flow of code and function calls are as follows.//-Change of Static IP code startsMOData[] mo;mo=new MOData[1];mo[0]=new MOData();mo[0].identity=idn;mo[0].attributes=new ...

IPAddress to Country Resolution

96 byte By anamupotaa at 2007-11-27 9:24:45
I would like to if there are any API's for resolving IPAddress to Country?Thanks.

How to narrow Class<?> to Class<? extends junit.framework.TestCase>

677 byte By Kunal@nitsa at 2007-11-27 9:24:57
What I am trying to do is load a class using Class.forNameClass<?> clazz=Class.forName(......);and pass that loaded class to a methodaddTestSuite having the following signatureaddTestSuite(Class<? extends junit.framework.TestCase>?Now Class.forName(.....) returns Class<?> ...

Handles in Maps

447 byte By olliegatora at 2007-11-27 9:25:02
Hi,I have three methods for manipulating data: addData, delData, modData.All the changes in the data are done through handles which are stored in a map.In each method I want to:1. lock the map2. get the data handle3. lock the data handle4. unlock the map5. manipulate data6. unlock the data ...