Author |
Message
|
carlos.lacerda |
Posted: Tue Nov 28, 2006 10:05 am Post subject: JMSAdmin Bind problems with slash and backslash (WinXUnix) |
|
|
Newbie
Joined: 28 Nov 2006 Posts: 3
|
Hi all, a have a application runing in Windows using OC4J Container with Generica JMSRA and MQ Series, this is fine application runing perfect.
My problem is when create .bindings file using JMSAdmin utility to create binds to my queues in Windows i use the slash eg.
Code: |
def q(jms/myqueue)... |
in Unix (RedHat AS 3.0) JMSAdmin not accept slash only backslash eg.
...
This is possible use only slash or backslash for both ????
My application create queues in MQ and binds using JMSAdmin this slash´s is a problem for me...
Tanks |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Nov 28, 2006 11:25 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
When you create a context in a .bindings file you should not use multiple level contexts as you cannot interrogate them in a multilevel mode.
Read up the documentation an google a little bit about the sun context factory. It is a known limitation.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
carlos.lacerda |
Posted: Tue Nov 28, 2006 11:50 am Post subject: |
|
|
Newbie
Joined: 28 Nov 2006 Posts: 3
|
Tanks for reply, i will search for sun context factory.
But the same is fine
Code: |
Windows eg. (jms/xxx/myqueue) |
and
in Unix
why ??
In docs of WMQ see:
Code: |
1. If you are using the WebSphere JNDI provider, com.ibm.websphere.naming.WsnInitialContextFactory, you must use a forward slash (/) to access administered objects defined in sub-contexts; for example, jms/MyQueueName. If you use a backslash (\), an InvalidNameException is thrown.
2. If you are using the Sun JNDI provider, com.sun.jndi.fscontext.RefFSContextFactory, you must use a backslash (\) to access administered objects defined in sub-contexts; for example, ctx1\\fred. If you use a forward slash (/), a NameNotFoundException is thrown.
|
The subcontext is possible but my problem is to use the same slash in Windows and Unix. :=(
how to this ??? |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Nov 28, 2006 12:04 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Well my experience has been that you could define sub contexts and create the objects. However when you want to retrieve them you have to do a little contact admin like:
Context jms = (Context)ctx.lookup("jms");
Then you can look up the rest of your objects omitting the prepended jms and using the jms Context object instead of the context returned by the initial context factory (ctx).
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Nov 28, 2006 12:29 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
The rest of your problem may entirely have to do with how the different command shells are handling / or \. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
carlos.lacerda |
Posted: Wed Nov 29, 2006 3:44 am Post subject: |
|
|
Newbie
Joined: 28 Nov 2006 Posts: 3
|
The lookup is OK in both Windows and Unix.
My problem is how to use a slash or backslash to create a .bindings to both from JMSAdmin.
In Unix JMSAdmin only permits backslash "\" and in Windows slash "/"
I try all forms in Unix \/ // /" and cannot run.
This is possible use a single slash for both OS in JMSAdmin ????
This problem has a serious impact to my application, i configure a DestinationName of the Queues to my MDBs in ejb-jar.xml and with this problem it´s necessary create a two ejb-jar.xml one for Windows and other for Unix this is bad.  |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Nov 29, 2006 10:14 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
What you should probably create is a resource reference to your destinations. This way your MDB would be configured the same. The resource reference would take care of any indirections...
Enjoy
PS as in unix the \ is usually an escape char a \ is usually represented as \\ in any string/input.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|