Help coderanch get a
new server
by contributing to the fundraiser

srinivas sy

Greenhorn
+ Follow
since Nov 02, 2014
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
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
PHP
Hi,

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 127.0.0.1 i have tried localhost also..


javax.naming.CommunicationException: Could not obtain connection to any of these urls: 127.0.0.1:4556 and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.CommunicationException: Failed to retrieve stub from server 127.0.0.1:4556 [Root exception is java.io.EOFException]]
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1562)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:634)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at com.web.bookstore.ejb2.client.Lab3Client.main(Lab3Client.java:30)
Caused by: javax.naming.CommunicationException: Failed to retrieve stub from server 127.0.0.1:4556 [Root exception is java.io.EOFException]
at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:268)
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1533)
... 4 more
Caused by: java.io.EOFException
at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2281)
at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2750)
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:780)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:280)
at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:255)
... 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 127.0.0.1 this resolved everything..M fresher ..so trying both ejb 2 and 3..

thanks
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 ..it 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");







jboss.xml



ejb-jar.xml



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("abc");
v.add("xyz");
v.add("rqw");
v.add("ip");
v.add("code");
v.add("ranch");
v.add(".com");
v.add("you");
v.add("see");
v.add("for"); //10 elements stored
System.out.println(v);
System.out.println(v.size()); //size is 10
v.add("doubts"); //10+1 (element added newly)...so 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
PHP
Hi,
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 amazon.in , snapdeal.com 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
PHP
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(System.in);
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)
break;
array[i] = next;*********************************************
}
9 years ago
Can any one explain ..how nextInt() returns array type here..because it returns int type..how it works here.


Scanner input = new Scanner(System.in);
int array[] = new int[10];

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

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