我只想在web.xml中添加一个servlet,如下所示:
<servlet>
<display-name>AxisJMSServlet</display-name>
<servlet-name>JMSListener</servlet-name>
<servlet-class>com.sinosoft.prpall.web.jms.JMSListenServlet</servlet-class>
<load-on-startup>110</load-on-startup>
</servlet>
一切都很好,当我开始我的节目时,我得到了这个:
javax.naming.NoInitialContextException: Failed to create InitialContext using factory specified in hashtable [Root exception is java.lang.NullPointerException]
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:258)
at javax.naming.InitialContext.initializeDefaultInitCtx(InitialContext.java:318)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:348)
at javax.naming.InitialContext.internalInit(InitialContext.java:286)
at javax.naming.InitialContext.<init>(InitialContext.java:211)
at org.apache.axis.components.jms.JNDIVendorAdapter.getConnectionFactory(JNDIVendorAdapter.java:85)
at org.apache.axis.components.jms.JNDIVendorAdapter.getQueueConnectionFactory(JNDIVendorAdapter.java:55)
at org.apache.axis.transport.jms.JMSConnectorFactory.createConnector(JMSConnectorFactory.java:227)
at org.apache.axis.transport.jms.JMSConnectorFactory.createServerConnector(JMSConnectorFactory.java:156)
at com.sinosoft.prpall.web.jms.JMSListenServlet.init(JMSListenServlet.java:60)
at javax.servlet.GenericServlet.init(GenericServlet.java:241)
at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:283)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:64)
at weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:58)
at weblogic.servlet.internal.StubLifecycleHelper.<init>(StubLifecycleHelper.java:48)
at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:539)
at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:1981)
at weblogic.servlet.internal.WebAppServletContext.loadServletsOnStartup(WebAppServletContext.java:1955)
at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1874)
有人能告诉我发生了什么吗?
答案 0 :(得分:0)
你正在尝试创建一个InitialContext,但没有为它提供适当的参数。以下是在Weblogic上创建InitialContext的示例:
http://docs.oracle.com/cd/E15051_01/wls/docs103/javadocs/weblogic/jndi/WLInitialContextFactory.html
如果您没有手动创建InitialContext,则需要从管理控制台配置JNDI设置。