Are Local Object references thread safe?

4682 byte By mrutyunjaya at 2007-11-27 10:00:51
Hi All,I have a static method which has lots of local objects which are basically references to nodes of an static DOM object which had been created at the application startup time.. I want to know if multiple threads access that static method,will the local objects inside the method be thread ...

once I send 1 string, the rest are cut off, any ideas?

6222 byte By lokiea at 2007-11-27 10:01:01
Hello everyone.For some reason when I send my first string through the socket, everything works fine. But after that Its cutting off the first 2 or 3 characters of the string and I have no idea why because I'm flushing the output buffer before and after I send the the string to the output ...

JAVA Servr Soket problem...PLZ Help ME

1006 byte By jobina at 2007-11-27 10:01:48
HIi have a server port whch can support mulptiple connection. im running this as a Java HotSpotserver .im getting problm after some, im running this server on 5001 port ,it will accept many connection and running propel. the clients are applets.these are the problems i am getting1..From the new ...

Problem while using controls with MS ActiveDirectory

1457 byte By Roshitha at 2007-11-27 10:02:16
Hi ,I am facing a strange problem while using controls with Active Directory. I am using a SearchControl to set the total number of users to be returned matching the filter to 800 , and used the PagedResultControl to set the page size as 400 . Here is the the sample code i usedSearchControls ...

Help reg. serialization compatibility

977 byte By Anand.Ramana at 2007-11-27 10:02:18
Hi,We developed a web-application using J2SE 5.0. It runs in IBM Websphere 6.1(with IBM JRE 5.0). We have an applet for rendering our reports. The applet communicates with the web-application to obtain serialized form of the data that needs to be rendered in the applet. The browser in the ...

how to stop thread A from thread B using a button

511 byte By xpantaa at 2007-11-27 10:03:28
Hi,I have created a thread A which in turn creates a thread B. Is it possible to press a button on thread B that stops execution of thread A (and consequently thread B, of course)?More specifically, thread A is a client thread that waits for server data. If it takes too long I would like to ...

Accesing The Host through Telnet (Port NO:23) Usng Java Code In Linux OS

624 byte By BangloreGuya at 2007-11-27 10:03:47
Hello To All,I wrote the telnet (Port No :23) Program inorder to the access the Linux Host.After Giving Login and Password through Code.I am trying to fetch the data from there.I am doing it through the OutputReader and BufferedReader Class and I have written Try and Catch Block also.In My File ...

Reflection Sample - Whats wrong in this?

901 byte By JayKay007a at 2007-11-27 10:04:00
Please find the below code.public class FiledRef {public static void main(String[] args) {try{Class clas = null;clas = Class.forName("fieldRef.TwoString");System.out.println("VALUE IS -> "+incrementField("val02",clas));}catch(Exception ex){ex.printStackTrace();}}public static int ...

Difference between different Context classes

306 byte By 4tha at 2007-11-27 10:05:00
Adler_Steven always used this:// Create the initial directory contextLdapContext ctx = new InitialLdapContext(env,null);I use this:DirContext ctx = new InitialDirContext(env);both methods work for changing a password...Can someone explain that to me ...

writing Java Objects to a file

506 byte By munnadeea at 2007-11-27 10:05:10
Hi,I had been using files and Java IO API for a time but in my new implementation I want to write few Java objects in to a file and fetch them as "same objects" in to a datastructure (such as an array or map) when I start my application again. I was wondering if there is any mechanism that I ...

logged in windows username cant be searched in LDAP tree on Windows 2000 AD

1895 byte By 4tha at 2007-11-27 10:06:12
That is my active directory of my TEST Windows 2000 server: http://img248.imageshack.us/img248/918/adwn6.gifOn the image yu will find 4 schools with shortcut names called:OU=ASROU=EDSOU=EKS (EK school for example)OU=THS (TH school for example)Under every OU="shortcut of schoolname" you will find ...

Two - Thread Program

538 byte By sanlearnsa at 2007-11-27 10:06:17
Hi All,I want to write a pgm using Threads given the problem scenario as:I'm pretty new to Threads!Write a NumberFactory class - AddNumber and DisplayNumber are the threads running in the class - AddNumber will add all ten numbers continuously - DisplayNumber will display numbers in reverse ...

Problem with RowSetDynaClass

1079 byte By dhaval_shaha at 2007-11-27 10:06:52
I'm using the RowSetDynaClass as I need to close my resultset and return the connection to the connection pool quickly. Resultset rs = stmt.executeQuery("something");RowSetDynaClass rowset = new RowSetDynaClass(rs);I iterate through it by the following:Iterator iter = ...

InetAddress.getLocalHost().getHostAddress() returns loopback on server?

390 byte By CrystalDragona at 2007-11-27 10:08:02
I'm trying to create a script to test server availability. In the response I would like to return the IP of the server. The following works fine locally but when I run it online it just gives me the loopback address.InetAddress.getLocalHost().getHostAddress();Granted the server is a shared box ...

Which collection to choose?

805 byte By Fastfoxa at 2007-11-27 10:08:20
I'm unsure of what collection to use in my program. These are my desired characteristics:- synchronized (I guess all of them can be);- easy addition/removal the beginning and end- easy merging of two collection objects;- sorted;- fast scrolling at any place.The idea is to store data received ...

simple string sending question

10147 byte By marco_wua at 2007-11-27 10:09:48
Dear all, I am writing a simple program which is a simple IM. It will send string and receive string. That means it is a server and a client. I have 4 classes, one is client, one is server, one is GUI, the last one is just call all of them. I think I make something wrong in the Server and/or ...

Multi-Dimensional Hashtable

356 byte By leatropa at 2007-11-27 10:10:21
Does anyone know any fast way to implement hashtableWith SET access as table["key1"]["key2"]["key3"]=vAnd GET access (with "wild cards") like: v = table["key1"][null]["key2"];I can do through simple loop to handle wild card, but that table may have millions of values stored - it will take ...

Building a server application that uses long lived connections

2383 byte By MBuetowa at 2007-11-27 10:10:38
Hello All,Was looking for some advice on this scenario:Most of the information that I have found regarding servers seem to revolve around using disconnected sessions (connections?). An example being a web server type of application ( or a web service for that matter ) where users would initially ...

A question about file lock

992 byte By youhaodiyia at 2007-11-27 10:10:51
In a situation that one program grab a read lock on a file and another program want to write to the file. How does the first program prevent the second program from modifying the file? According to Java API doc, a shared lock prevents other concurrently-running programs from acquiring an ...

Calendar Framework

834 byte By spatnaik77@gmail.coma at 2007-11-27 10:10:53
Hi All,I am working on a project where i have to build a framework for calculating next working days based on predefined holidays, weekends etc.For example :Assume today is July 11 and is friday.I need to calculate the next working day assuming that saturday, sunday are holidays.so my ected result ...

Having issues finding out how many bytes are sent/recieved from a socket.

10870 byte By lokiea at 2007-11-27 10:11:25
Hello everyone.I've searched the forums and also google and it seems I can't find a way to figure out how many bytes are sent from a socket and then how many bytes are read in from a socket.My server program accepts a string (an event) and I parse that string up, gathering the relevant ...

internationalization in java:

446 byte By gautam0001a at 2007-11-27 10:11:33
We need to have traditional character support(chinese, japanese etc) for our applications. The traditional text is available in the oracle database and is displayed correctly in toad but when we access it thru browser/stand alone java app, it is not shown. The language pack is installed correcly on ...

what and all serialized

223 byte By Java_Aspiranta at 2007-11-27 10:11:51
<p>Hi guys,</p><p>I just want to know if i serialize an object, what and all will be serialized, i mean </p><p>apart from variables, whether methods will be serialized?</p><p>Thanks in advance.</p><p>Regards,</p><p>SRI.</p>

After 2nd time running a method my app window freezes 7 seocnds,error msg->

15880 byte By 4tha at 2007-11-27 10:13:21
Hello folks,first you will surely say is that my server is offline or something with the network is wrong but it is not ;-)thats the code:Please read my words after the pasted code at the bottom of the page!import java.awt.Color;import java.awt.Insets;import java.awt.event.ActionEvent;import ...

java.io.StreamCorruptedException: invalid stream header

2755 byte By haroldclementsa at 2007-11-27 10:14:20
I am having a problem with sending two objects (over a socket). I have read in other posts that this could be due to trying to receive incompatible data types but my applications work fine if I send my objects synchronously rather than asynchronously.I will try my best to describe what my problem ...

Socket.setTrafficClass() on Mac OS X

869 byte By michele81a at 2007-11-27 10:14:32
Hi all,I have TCP code which works fine on Linux, but fails on Mac OS X (java 1.5.0_07-87). In particular, the setTrafficClass below (the hex number is IPTOS_THROUGHPUT) throws a IOException with the following error: upload: Invalid argument[java] java.net.SocketException: Invalid argument[java]at ...

Read binary data

1939 byte By ardmorea at 2007-11-27 10:14:54
hi, I am reading binary data from a binary file. Now I have no idea of it.I have some question to ask.1) Are the strings ZeroStrings or FixedZeroStrings?2)How to position the position of each strings?My binary input is space delimited with fixed width data fields.All integers are 4 bytes, floats ...

How to use transactions to execute code currently?

1067 byte By uddinr0121a at 2007-11-27 10:15:12
Hi All,i am attempting to perform a JDBC commit and an update to a log file, ie. i am recording the updates in a log file so i can use for recovery, however from the point of the transaction is commited to the point at which it is updated into the file the system can be exited thus the database and ...

again;( -- Cannot create JDBC driver of class '' for connect URL 'null' --

4815 byte By kokorokoa at 2007-11-27 10:15:46
sory guys, i ve read hundreds of posts here and elsewhere but none solution worked for me.. sory for pasting all this stuff here but i guess without it nobody could help me.so again:i'm running tomcat 6.0-EXCEPTION:org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class ...

Ajax

152 byte By iGurua at 2007-11-27 10:15:52
<p>Can anyone give insight into Ajax. </p><p>Q: Also does Ajax use caching mechanism along with dynamic processing of the data using xmlHttprequest?</p>

ldap search attribut result "cn=Klaus", I want this only "Klaus"

322 byte By 4tha at 2007-11-27 10:16:22
Hello,of course i could remove the position 0-2 from the String "cn=Klaus" to get a substring like "Klaus" but i don`t wanna use an extra "for loop" if there maybe exists another possibility to get a clean output like "Klaus"someone knows an ldap method to get ONLY the pure value of the cn ...

Very slow socket execution

2061 byte By fcatallneta at 2007-11-27 10:16:26
I am getting very slow socket initialization. Here is sample code to clarify the issue. I suspect is has to do with reverse lookups or some such thing - is there a way to disable all of that? I tried using the security manager but that is a bad solution because it does not seem doable from within ...

Design suggestions, is this how I would allow a client to listen on a multi

7082 byte By lokiea at 2007-11-27 10:17:02
Hello everyone. Currently my program will create a new thread everytime a person connects to my server. Once they connect they can send me events, and once they send me the events I parse the events and store them in a Map.Now if someone wants to recieve all those parsed events, but don't want to ...

message does not get sent correctly?

7453 byte By HeartOpenBooka at 2007-11-27 10:17:11
Hello everyone ,I have to do a program that captures traffic from a client and sends it to a server and gets the traffic from the server and sends it back to the client... it's a intermediate Java program between a server and a client ( i need it in order to analyze a protocol ) .In more concrete ...

Problematic inference with interlocking types

3336 byte By xolotla at 2007-11-27 10:18:06
We are all familiar with the idiom of delegating the execution of a loosely typed method to a more precise one where the type is made explicit, e.g., public interface Foo<B extends Bar><?>> { }public interface Bar<F extends Foo><?>> { }public void test1(Foo<?> foo) { doTest1(foo); ...

Troubles connecting behind a router

557 byte By sirynxa at 2007-11-27 10:18:15
I'm using JBoss connecting with RMI. I'm trying to connect from the outiside of my LAN but I cannot. I have configured NAT to use Jboss but the connection from the outside is impossible. I have passed this arguments to my JBoss-Djava.rmi.server.hostname = ...

ServerSocket connection reset under weird circumstances

4826 byte By cjba at 2007-11-27 10:18:54
Hi all,I'm trying to write a very simple TCP/IP server, to provide XML data to a web browser. This should be dead easy, but I'm encountering something weird. I hope you can help me.I can successfully create a ServerSocket on a given port, and accept connections. The problem arises when I try to ...

Is this thread safe? Map<String, List><Message>> AlertMap = new HashMap<Str>

5000 byte By lokiea at 2007-11-27 10:18:57
Hello everyone I wasn't sure if this was thread safe or not. I'm going to have more than 1 client connecting to my server, and sending me events I'm storing these events in this Map. But I wasn't sure if it was thread safe or not. I was looking at the sun collections and i saw somthing ...

Property Files and Properties class

1318 byte By sree_at_worka at 2007-11-27 10:19:21
Hi,My Property file:base.dir=D:/Testsrc=${base.dir}/srcclasses=${base.dir}/classesI am using the following code to read it:Properties properties = new Properties();FileInputStream fis = new FileInputStream(propertiesFile);properties.load(fis);Enumeration keys = properties.propertyNames();while ...

General indication on NamingContext/NotFound exception

413 byte By v8miragea at 2007-11-27 10:19:24
Hello,I have an app running on jboss 304 server that make calls to a corba gateway with jacORB library.The follow exception occured when it tries to resolve the object name.org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0May I ask if anyone can tell ...

Is this possible with Java Sockets? setSoTimeout

2485 byte By lokiea at 2007-11-27 10:19:26
Hello everyone.I'm not sure what I should be trying to use here but I looked in the API and I think this is the closet thing to what I need.What i'm trying to do is the following:Everytime I send somthing from a client to a socket or vice versa I want to do the following:Open the socket to send ...

client hanging when server is recycled.

2953 byte By rrvvg_1976a at 2007-11-27 10:19:43
Hi,I wrote a socket client program that connects to a socket server. This is what I'm doing:-I'm opening a socket connection-I'm writing an initial request to the output stream of that socket-Then, while true, I create an input stream of that socket and get information off that streamIt all ...

How to load policy file programmatically

310 byte By brajesh_rathorea at 2007-11-27 10:20:25
Hi , i have a java policy file (Mypolicy.policy), now i want to load it at runtime.without using command prompt.means i dont want to use java -Djava.security.policy=Mypolicy.policy command can anybody have any idea.thanks in advansRegardsBrajesh ...

Server Architecture (How To)

2029 byte By sim085a at 2007-11-27 10:20:35
Hi,Basically I am new to building server applications and I was wondering whether there are any good books that can show good design patterns that can be used when building a server application.I am mostly interested in building a server for online reservation systems. I thought of this scenario ...

How does serialization work.......!!

432 byte By Sunnie_200210324a at 2007-11-27 10:20:37
As Serializable interface is an MARKER interface and does not have any methods or field. Then how does a class implementing Serializable interface is automatically serialized(or the object is converted into bytestream). Is it that, JVM does know what to do with a serialized object. If this is the ...

Jndi Provider Url not working

766 byte By raghav_apia at 2007-11-27 10:21:40
Hi, I got the following exception message when i run the given JNDI example on Sun Java Application Server8.1.Please help me in resolving this issue;Exception:javax.naming.CommunicationException: localhost:389 [Root exception is java.net.ConnectException: Connection refused: connect]import ...

Windows' share physical path

368 byte By CGambaa at 2007-11-27 10:21:45
Hi,I need to write a file on a NAS. I have the share path (suppose \\share\dir). How can I create a file on it? Do I need to know the physical path and use it to create a file? Can I obtain the physical path having the NAS path?I'm talking about Java 1.4.03 (and Websphere).Sorry for my english but ...

how to convert byte array to Properties object

315 byte By sri_sua at 2007-11-27 10:22:04
I want to retrieve a configuration file into my application. I can get that file in byte array format. I want that to be converted into java.util.Properties object so that I can retrieve the contents of it. Is it possible to convert that into some other object and then to Properties object? How can ...

Java NIO

114 byte By ChandruMohana at 2007-11-27 10:22:39
<p>Hai guys,</p><p> I need to know about NIO package. Please give some useful url(S) for understanding basics.</p>

Uses Of RMI

180 byte By Shri_Krishana at 2007-11-27 10:25:06
<p>Hello Everyone, </p><p>I am new to RMI technique. Can you please brief me about the uses of RMIs. Also, I am in a doubt that RMI is used only when using EJBs.</p><p>Thanks!!</p>