Help coderanch get a
new server
by contributing to the fundraiser

srinivas sy

+ Follow
since Nov 02, 2014
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by srinivas sy

Could some one please expalin what are the best platforms for e-commerce web site? can we develop with html,css,javascript,java technologies ?
9 years ago

Iam getting this error after deploying ejb app into jboss server.

I have killed all process and tried..and even used new port no.. still am getting this error???pl help me

instead of i have tried localhost also..

javax.naming.CommunicationException: Could not obtain connection to any of these urls: and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is Receive timed out] [Root exception is javax.naming.CommunicationException: Failed to retrieve stub from server [Root exception is]]
at org.jnp.interfaces.NamingContext.checkRef(
at org.jnp.interfaces.NamingContext.lookup(
at org.jnp.interfaces.NamingContext.lookup(
at javax.naming.InitialContext.lookup(
at com.web.bookstore.ejb2.client.Lab3Client.main(
Caused by: javax.naming.CommunicationException: Failed to retrieve stub from server [Root exception is]
at org.jnp.interfaces.NamingContext.getServer(
at org.jnp.interfaces.NamingContext.checkRef(
... 4 more
Caused by:
at org.jnp.interfaces.NamingContext.getServer(
... 5 more

Hi Ulf,

Iam sorry, i didn't know that how to add code tags. Next time i will do like that only.

I got solution..instead of localhost i used this resolved everything..M fresher trying both ejb 2 and 3..

im new to EJB.Please help me on this..
im using EJB2. AND Jboss 4.2

server started and deployed it successfully, but when i run client program is not looking for jndi....i wrote sop's in client program. Please look it .properties got loaded..JNDI NAME ALSO CORRECTLY i have written.
I tried allot..

this statement is not called in client program:
Object obj=ctx.lookup("HelloHomeJNDI");



Client program:

Hi Jesper de Jong,

the error is " The constructor Byte(int) is undefined"

Why have they made like this? not For all wrapper classes,but only for these two?
9 years ago
Hi Henry Wong,
thanks for reply.I think hashcode and equals methods are already overriden in Wrapper classes....

Ny question here is why is it giving true for 127L values and why for 128L?

up to 127L its giving true..after that it is not holding more that that value i think???
9 years ago
Byte bb=new Byte(12); /error
Byte bbb=new Byte(12); //error

Integer i1=new Integer(123);
Integer i2=new Integer(123);

Short s1=new Short(100); // error
Short s2=new Short(100); //error

Long l1=new Long(123);
Long l2=new Long(123);

Float f1=new Float(123);
Float f2=new Float(123);

Double d1=new Double(100);
Double d2=new Double(100);

Why only errors for Byte and Short Wrapper types ?

Long long=127L;
Long long1=127L;

System.out.println(long==long1); /// TRUE

Long long=128L;
Long long1=128L;

System.out.println(long==long1); /// FALSE

9 years ago
Difference b/w these 2.

List list = Collections.synchronizedList(new ArrayList());

now arraylist also Synchronized.

As we vector also synchronized and arraylist explicity we synchronized.

Is there any diff we see here??
9 years ago
For vector, by seeing and executing following program we say how vector increases(capacity doubles) its capacity. As i know size is the no of current values stored.

But for ArrayList how to find capacity is increased 50% of its size? Please provide example program to ensure that.

public class A2 {
public static void main(String[] args) {

Vector v=new Vector();

System.out.println(v.capacity());/. default capacity is 10
v.add("for"); //10 elements stored
System.out.println(v.size()); //size is 10
v.add("doubts"); //10+1 (element added newly) 11 elements capacity doubled as it was 10 previously now it is 20(doubled)
System.out.println(v.size()); //size11
System.out.println(v.capacity()); //20

LIKE WISE How can we make sure arraylist increases its size by 50%

9 years ago
Yes. But generally people use the terms like ArrayList is not-synchronized ,Vector is synchronized, Hashtable is synchronized etc..Can we use the terms like above.
9 years ago

Can we apply synchronized for class?
if not why do we say ArrayList is not synchronized and Vector is Synchronized?
As both are Classes.
Please explain it..
9 years ago
Hi Bear ,

Thank you for reply.

9 years ago
could you please tell.. what are technologies required for designing a website.Is java required to design website like ecommerce applications?
any frameworks from j2ee are required?How do people do website design like , etc....what could be the technologies they have used for that?
Is it easy to design and maintain a webiste?. Shockwave Flash Embed ,Adobe ColdFusion why these are all?

cant be created website with java,html5,css3?
9 years ago
will it store only one element? or 10 elements(size) will it store?if so how does it work?
Here, array[i] having multiple values i guess..

Scanner input = new Scanner(;
int array[] = new int[10];

System.out.println("Enter the numbers now.");

for (int i = 0 ; i < array.length; i++ ) {
int next = input.nextInt();
if (next == 999)
array[i] = next;*********************************************
9 years ago
Can any one explain nextInt() returns array type here..because it returns int it works here.

Scanner input = new Scanner(;
int array[] = new int[10];

System.out.println("Enter the numbers now.");

for (int i = 0 ; i < array.length; i++ ) {
if (input.nextInt() == 999){
} else {
array[i] = input.nextInt();//////////***********returning int type
9 years ago