I am having trouble running the PointToPoint.java sample shown in Appendix C of the wM JMS Provider Programmer’ss Guide. The program boils down to this:
//1. create Properties structure
Properties props = new Properties();
//2. setup reference to resource file
FileInputStream fis = new File(“jndi.properties”);
//3. load jndi.properties into props
props.load(fis);
//4. create initial context
Context ctx = new InitialContext(props);
//5. lookup queue connection factory object
QueueConnectionFactory qcf = ctx.lookup(“QueueConnectionFactory1”);
etc…
My problem is at step 4. I don’t know what parameters to put into the jndi.properties resource file. I tried this:
java.naming.factory.initial=javax.jms.QueueConnectionFactory
Where the javax.jms.QueueConnectionFactory is in jms.jar (which is in my classpath). I get the following error:
javax.naming.NoInitialContextException:
Cannot instantiate class: javax.jms.QueueConnectionFactory.
Root exception is java.lang.InstantiationException: javax.jms.QueueConnectionFactory
at java.lang.Class.newInstance0(Class.java:291)
at java.lang.Class.newInstance(Class.java:259)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:649)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
at javax.naming.InitialContext.init(InitialContext.java:219)
at javax.naming.InitialContext.(InitialContext.java:195)
at PointToPoint.(PointToPoint.java:55)
at PointToPoint.main(PointToPoint.java:25)
Any suggestions?
#webMethods#Integration-Server-and-ESB#Adapters-and-E-Standards