Avatar billede fredand Forsker
01. februar 2006 - 10:22 Der er 1 kommentar og
1 løsning

How to connect to a JMS Server/Provider?

Hello!

I use Sun Java Application Server included with J2EE 1.4. I have started the default server and created Connection Factory with JNDI name:
jms/QueueConnectionFactory
and a Destination Resources with JNDI name:   
jms/Queue

I have set the members in SampleUtillitis like:
    public static final boolean USE_JNDI = true;
    public static final String  QUEUECONFAC = "jms/QueueConnectionFactory";


When try to run the SenderToQueue sample but I just get this error: 

Could not create JNDI context: javax.naming.ServiceUnavailableException: inv1437
.xxx.xxx.com:7676; socket closed

If I run a netstat -a I can see this on port 7676:
TCP    inv1437:7676          inv1437.xxx.xxx.com:3016  TIME_WAIT

To me this looks like there is a service availible on 7676.

The port 7676 seems to be right since it is specified in the Sun Java Application Server under default_JMS_host to 7676.

Perhaps it is something wrong with the url that I need to include any user or password or something.
java.naming.provider.url=ldap://inv1437.xxx.xxx.com:7676/

Or perhaps my server is not running in the correct way that I think?

So if you got any ideas please let me know.

Best regards
Fredrik
Avatar billede fredand Forsker
01. februar 2006 - 11:04 #1
I tried to change to this in the jndi.properties file:
java.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory
java.naming.provider.url=http://192.168.0.63:7676/

And got this excpetion instead:
Could not create JNDI context: javax.naming.ConfigurationException: http://192.1
68.0.63:7676/ does not contain an IOR

I do not know if this is closer to the solution?

Best regards
Fredrik
Avatar billede fredand Forsker
01. februar 2006 - 16:26 #2
Hello!

I decided to skip the Sun Java Application Server included with J2EE 1.4 and vent on with WebLogic and now it works.

It was some trouble with setting everything right in the server for factories and ques, I'm not sure I will amnge it again. But now it works and my jndi.properties now looks like:

java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory
java.naming.provider.url=t3://localhost:7001/
#java.naming.provider.url=mqtcp:localhost:7676/jms
java.naming.security.principal=weblogic
java.naming.security.credentials=weblogic

Best regards
Fredrik
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester