JMS and 2 machines: OutOfMemoryError on client

Hello -

I'm trying to use the JMS reference implementation

and get something to work between two Win2k

machines.

On a single machine, everything works fine.

When I use two machines, I need to configure

the client orb.properties file to point to the

server host and port. This is discussed in another

thread.

However, when I run the client, it bails out with

an OutOfMemoryError (no stack trace) when it

is doing (straight from the tutorial):

try {

queueConnectionFactory = (QueueConnectionFactory)

jndiContext.lookup("QueueConnectionFactory");

queue = (Queue) jndiContext.lookup(queueName);

} catch (NamingException e) {

System.out.println("JNDI lookup failed: "

+ e.toString());

System.exit(1);

} catch (Exception e2) {

e2.printStackTrace();

}

What am I doing wrong?

Thanks for any and all help.

[970 byte] By [gavinelster] at [2007-9-26 1:15:04]
# 1
How much memory are you giving the VM when you start the server? (the -ms & -mx command line args for java)
swatdba at 2007-6-29 0:40:58 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2

> How much memory are you giving the VM when you start

> the server? (the -ms & -mx command line args for java)

Hi, thanks for responding.

Actually, that was the first thing I played with.

Tried all kinds of values and either exceeded the max

heap size or the app still failed.

Question: do I need to have any J2EE services

(esp JNDI) running on the client? Can my client

code make the lookups necessary without any

client side services (that presumably talk to server-side

services)?

gavinelster at 2007-6-29 0:40:58 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3

Hi,

As far as I know, Out of memory exception is not caught in your program so you do not get a stack trace of the exception. I guess that the problem of out of memory is else where in the code, not at the look up of the QueueConnectionFactory.

Please try one simple test, put some debug System.out.println statements from the start of your program to see where it is actually getting out with out of memory exception.

Hope that helps you in finding the error.

rvssds

rvssds at 2007-6-29 0:40:58 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 4

Thanks,

I tried that originally, but I found that the failure

occurred when it was looking up the

QueueConnectionFactory. Notice that the code

I posted catches Exception, not just NamingException,

so it should catch OutOfMemoryException.

I think I'm not getting a stack trace because the

client is truly out of memory -- either that or the

stack has become corrupt.

Has anyone successfully JMS-ed between

two Win2k machines, using the ref implementation

in J2EESDK?

Thanks!

> Hi,

>

> As far as I know, Out of memory exception is not

> caught in your program so you do not get a stack trace

> of the exception. I guess that the problem of out of

> memory is else where in the code, not at the look up

> of the QueueConnectionFactory.

>

> Please try one simple test, put some debug

> System.out.println statements from the start of your

> program to see where it is actually getting out with

> out of memory exception.

>

> Hope that helps you in finding the error.

>

> rvssds

gavinelster at 2007-6-29 0:40:58 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 5

I get exactly the same problem using

jndiContext.lookup("TopicConnectionFactory");

The problem also occurs when I try to create a server using

j2ee -verbose

and the orb.properties file still points to a remote host.

The problem therefore appears to be in the connection to the server across the network.

I'm using an NT machine (256Mb) connected to a Win2k laptop (128Mb).Both machines communicate perfectly (ping works OK).

Again, tried all the posted solutions. Any help appreciated.

John

jtadams1 at 2007-6-29 0:40:58 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 6

Hi,

First of all, I think I miscommunicated about the exception, what I meant was what you told that is the client might have been truly out of memory. Sorry for that.

As for the error occuring right at the look up of QueueConnectionFactory , I guess (again!) that the problem would be with the JNDI. But I am not sure, I have not used the reference implementation of J2EE for JMS. I guess there is a problem in the way the jndi look up is happening. That would probably mean that you need to debug the jndi look up of the implementation you are using. Probably jndi look up is not throwing the out of memory exception so you are not able to catch it.

I think that is too muh of guessing!

rvssds

rvssds at 2007-6-29 0:40:58 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 7

Dude, I am in exactly the same boat.

A WinNT desktop talking to a Win2K laptop.

All other networking is fine -- connected via a

10mBps LAN.

I also tried using the IP address, figuring

that DNS was failing somehow, but to no avail.

I am really hoping someone has a success story

out there.

Thanks...

> I get exactly the same problem using

> jndiContext.lookup("TopicConnectionFactory");

>

> The problem also occurs when I try to create a server

> using

> j2ee -verbose

> and the orb.properties file still points to a remote

> host.

>

> The problem therefore appears to be in the connection

> to the server across the network.

>

> I'm using an NT machine (256Mb) connected to a Win2k

> laptop (128Mb).Both machines communicate perfectly

> (ping works OK).

>

> Again, tried all the posted solutions. Any help

> appreciated.

>

> John

gavinelster at 2007-6-29 0:40:58 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...