在Tomcat的context.xml中配置资源以访问远程JBoss队列

时间:2018-02-15 06:25:44

标签: java jboss jms tomcat8

是否可以通过在context.xml中配置JBoss属性来访问tomcat中的JBoss队列?

以下是我在context.xml文件中使用的配置..

<Resource name="jmsconnectionfactory" auth="Container"
        type="javax.naming.spi.InitialContextFactory" description="JMS Connection Factory"
        factory="org.jnp.interfaces.NamingContextFactory" brokerURL="jnp://localhost:5432"/>

观察到异常是

Feb 14, 2018 1:09:24 PM org.apache.naming.NamingContext lookup
WARNING: Unexpected exception resolving reference
java.lang.NullPointerException
    at org.jnp.interfaces.NamingContextFactory.getObjectInstance(NamingContextFactory.java:83)
    at org.apache.naming.factory.FactoryBase.getObjectInstance(FactoryBase.java:94)
    at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:847)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:158)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:835)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:158)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:835)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:172)
    at org.apache.naming.SelectorContext.lookup(SelectorContext.java:157)
    at javax.naming.InitialContext.lookup(InitialContext.java:417)
    at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:154)
    at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:87)
    at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:152)
    at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:178)
    at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:95)
    at org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:105)
    at org.springframework.jndi.JndiObjectFactoryBean.lookupWithFallback(JndiObjectFactoryBean.java:201)
    at org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.java:187)

0 个答案:

没有答案