我有一些使用以下“jndiTemplate”的Spring消息监听器:
<bean id="jnditemplate" class="org.springframework.jndi.JndiTemplate">
<property name="environment">
<props>
<prop key="java.naming.factory.initial">org.jboss.naming.remote.client.InitialContextFactory
</prop>
<prop key="java.naming.provider.url">remote://127.0.0.1:4447</prop>
<prop key="java.naming.security.principal">xyz</prop>
<prop key="java.naming.security.credentials">xyz123</prop>
</props>
</property>
</bean>
我已经使用具有guest角色的add-user.bat和Application Realm添加了用户xyz。 但是,当我部署我的应用程序时,我会在日志中获得以下内容:
02:02:29,090 INFO [org.jboss.as.remoting] (MSC service thread 1-2) JBAS017100: Listening on /127.0.0.1:9999
02:02:29,090 INFO [org.jboss.as.remoting] (MSC service thread 1-2) JBAS017100: Listening on localhost/127.0.0.1:4447
Caused by: javax.naming.NamingException: JBAS011843: Failed instantiate InitialContextFactory org.jboss.naming.remote.client.InitialContextFactory from classloader ModuleClassLoader for Module "deployment.<AppNameDeleted>.war:main" from Service Module Loader
at org.jboss.as.naming.InitialContextFactoryBuilder.createInitialContextFactory(InitialContextFactoryBuilder.java:64)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:664) [rt.jar:1.6.0_45]
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288) [rt.jar:1.6.0_45]
at javax.naming.InitialContext.init(InitialContext.java:223) [rt.jar:1.6.0_45]
at javax.naming.InitialContext.<init>(InitialContext.java:197) [rt.jar:1.6.0_45]
at org.springframework.jndi.JndiTemplate.createInitialContext(JndiTemplate.java:136) [spring-context-3.2.0.RELEASE.jar:3.2.0.RELEASE]
at org.springframework.jndi.JndiTemplate.getContext(JndiTemplate.java:103) [spring-context-3.2.0.RELEASE.jar:3.2.0.RELEASE]
at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:85) [spring-context-3.2.0.RELEASE.jar:3.2.0.RELEASE]
关于可能出现什么问题的任何想法?我已经在这一天上花了一天多的时间。 任何帮助表示赞赏。
谢谢, 特里舒尔