Creating queues explicitly with multiple clients

Hello,

I wonder if you can create queues "dynamically" (explicitly, not auto-created) in run-time.

OS: Red Hat Linux 7.3

SDK: Sun Java2 1.4.1

Sun ONE MQ 3.0.1

I would prefer not to use the scripts (imqcmd and imqobjmgr) , because I want to do it from within my Java applications. I think I saw a reference to an API that did this, but I haven't been able to find it again.

I have tried calling the scripts with System.exec(), and it works for the first application. When the second application tries to create a queue (with imqobjmgr) I get a SecurityException:

java.io.FileNotFoundException: /usr/share/config/security.properties (No such file or directory)

[java]at java.io.FileInputStream.open(Native Method)

[java]at java.io.FileInputStream.<init>(FileInputStream.java:103)

[java]at com.sun.enterprise.util.Utility.getPropertiesFromFile(Utility.java:42)

[java]at com.sun.enterprise.iiop.POAEJBORB.<clinit>(POAEJBORB.java:78)

[java]at java.lang.Class.forName0(Native Method)

[java]at java.lang.Class.forName(Class.java:217)

[java]at org.omg.CORBA.ORB.create_impl(ORB.java:295)

[java]at org.omg.CORBA.ORB.init(ORB.java:336)

[java]at com.sun.enterprise.util.ORBManager.createORB(ORBManager.java:138)

[java]at com.sun.enterprise.util.ORBManager.init(ORBManager.java:65)

[java]at com.sun.enterprise.naming.SerialInitContextFactory.<init>(SerialInitConte xtFactory.java:31)

[java]at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

[java]at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessor Impl.java:39)

[java]at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructor AccessorImpl.java:27)

[java]at java.lang.reflect.Constructor.newInstance(Constructor.java:274)

[java]at java.lang.Class.newInstance0(Class.java:306)

[java]at java.lang.Class.newInstance(Class.java:259)

[java]at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:649)

[java]at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)

[java]at javax.naming.InitialContext.init(InitialContext.java:219)

[java]at javax.naming.InitialContext.<init>(InitialContext.java:195)

[java]at com.zineup.hirgon.billing.LogMgr.init(LogMgr.java:214)

[java]at com.zineup.hirgon.billing.LogMgr.init(LogMgr.java:87)

[java]at com.zineup.hirgon.broker.MessageBroker.<init>(MessageBroker.java:154)

[java]at com.zineup.hirgon.broker.MessageBroker.main(MessageBroker.java:691)

[java] java.io.FileNotFoundException: /usr/share/config/ejb.properties (No such file or directory)

[java]at java.io.FileInputStream.open(Native Method)

[java]at java.io.FileInputStream.<init>(FileInputStream.java:103)

[java]at com.sun.enterprise.util.Utility.getPropertiesFromFile(Utility.java:42)

[java]at com.sun.enterprise.iiop.J2EEInitializer.<init>(J2EEInitializer.java:54)

[java]at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

[java]at sun.reflect.NativeConstructorAccessorImpl.newInstance

<snip>

[java] Warning: unable to read transaction.interoperability config property

[java] java.io.FileNotFoundException: /usr/share/config/security.properties (No such file or directory)

[java]at java.io.FileInputStream.open(Native Method)

[java]at java.io.FileInputStream.<init>(FileInputStream.java:103)

[java]at com.sun.enterprise.util.Utility.getPropertiesFromFile(Utility.java:42)

[java]at com.sun.enterprise.iiop.security.SecurityMechanismSelector.<clinit>(Secur ityMechanismSelector.java:102)

[java]at com.sun.enterprise.iiop.IIOPSSLSocketFactory.getEndPointInfo(IIOPSSLSocketFacto ry.java:211)

[java]at com.sun.corba.ee.internal.iiop.ConnectionTable.getConnection(ConnectionTable.ja va:73)

<snip>

I guess I got this because two clients (with one VM each) try to share resources.

I then created two empty files (security.properties and ejb.properties) in /usr/share/config, but then I got:

javax.naming.CommunicationException: Can't find SerialContextProvider

[java]at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:63)

[java]at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:120)

[java]at javax.naming.InitialContext.lookup(InitialContext.java:347)

And now I'm stuck... Is it possible to do this somehow?

Regards

[4645 byte] By [705430] at [2007-11-25 8:41:44]
# 1
Check the Developer's Guide, There is a section entitled Instantiating Message Objects in the chapter Using Administered Objects.
706894 at 2007-7-1 15:20:34 > top of Java-index,Application & Integration Servers,Sun Java System Message Queue...
# 2
How can I create queues physically on the IMQ server using administered objects?
705430 at 2007-7-1 15:20:34 > top of Java-index,Application & Integration Servers,Sun Java System Message Queue...
# 3

Does the problem only happen with imqobjmgr ?

If so ..

Is there a difference in the provider url you are

using on the two different applications ?

I've seen error with JDK1.4.1 and linux where spaces

in the provider URL can cause strange errors

Guest at 2007-7-1 15:20:34 > top of Java-index,Application & Integration Servers,Sun Java System Message Queue...