Jms 使用jython部署时发生NameNotFoundException

Jms 使用jython部署时发生NameNotFoundException,jms,jndi,jython,websphere-8,ibm-was,Jms,Jndi,Jython,Websphere 8,Ibm Was,我正在IBM WAS上通过jython脚本部署EAR文件,但在部署时出现错误,应用程序无法启动 错误代码: J2CA0052E: The lookup of the Activation Specification with JNDI Name jms/SampleQueueListener failed due to the following exception: javax.naming.NameNotFoundException: Context: cell01/nodes/d

我正在IBM WAS上通过jython脚本部署EAR文件,但在部署时出现错误,应用程序无法启动

错误代码:

     J2CA0052E: The lookup of the Activation Specification with JNDI Name jms/SampleQueueListener failed due to the following exception: javax.naming.NameNotFoundException: Context: cell01/nodes/dmgr11/servers/dmgr, name: jms/SampleQueueListener: First component in name jms/SampleQueueListener not found. [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
jms/SampleQueueListener
已经存在。我使用的是WAS8.5.5.8,通过Jython脚本在Linux操作系统上部署应用程序,我还使用节点代理和dmgr

部署应用程序的python脚本:

def installapps():
try:
    print "********************************************************"
    print "Installing  Application in IBM WAS"
    print "********************************************************"
    print "\n Installing ear file -- %s " % eFile 
    AdminApp.install(eFile,["-usedefaultbindings", "-BindJndiForEJBMessageBinding",[["samplesystemservice.jar", "ServiceActivator", "sampleservices.jar,META-INF/ejb-jar.xml", "SampleQueueListener", "jms/SampleQueueListener", "jms/SampleJMSQueue"], ["sampleystemservices.jar", "BootstrapMessageBean", "samplesystemservices.jar,META-INF/ejb-jar.xml", "SampleTopicListener", "jms/SampleTopicListener", "jms/SampleJMSTopic"]]])
AdminConfig.save()
print "***************hello22***********"
AdminApp.install(wFile, ["-appname", wName, "-contextroot", ctxroot])
print "***************hello33**********"
    AdminConfig.save()
    print "Completed installing applications.\n"
    print "Saving configuration. This may take time, please wait...."
    print "********************************************************\n"
    print "********************************************************"
    print "Completed the installation of  Application in IBM WAS"
    print "********************************************************"
except:
    AdminControl.stopServer("server1", node)
print "Unable to install  Application"
print "********************************************************"
sys.exit(0)
try:
    print "********************************************************"
    print "Stop the WAS for post configuration of  Application"
    AdminControl.stopServer("server1", node)    
except:

你必须修改你的脚本。当前,您正在将应用部署到
dmgr
服务器,请参阅上下文:

Context:cell01/nodes/dmgr11/servers/dmgr,名称:jms/SampleQueueListener

dmgr服务器仅用于管理,不用于部署您自己的应用程序和资源。如果要部署到ND环境,则需要提供nodeName和serverName或clusterName。应用程序的服务器通常称为
server1
。如果您没有任何服务器,您可能需要创建它

我建议先使用web管理控制台,直到您对拓扑和管理有了更好的了解

更新

您需要将模块映射到正确的服务器,请参见
MapModulesToServers
选项,如下所示:

AdminApp.install('DefaultApplication.ear', ['-appname', 'TEST', '-MapModulesToServers', [['.*', 
 '.*', 'WebSphere:cell=myCell,node=myNode,server=myServer']]])
或者,您可以使用库中提供的脚本,这可能更简单、更方便:

AdminApplication.installAppWithNodeAndServerOptions(appName, earFile,
 nodeName, serverName)
另见:


Hi-gas,我正在使用范围节点名称。我是否还需要提供服务器名称。资源可以安装在节点上,但应用程序只能安装在服务器/群集上。你的应用不知何故安装在
dmgr
上,这是不正确的。您必须在其他服务器上安装它。您可以在该服务器所属的节点上定义资源。您好,我已经添加了jython脚本,我正在使用该脚本在服务器上部署应用程序。你能告诉我哪里做错了吗。