【问题标题】:Ear file installation through jython giving issue in websphere application server startup通过 jython 安装 Ear 文件在 websphere 应用程序服务器启动时出现问题
【发布时间】:2014-08-03 14:14:34
【问题描述】:

嗨,我有一个以下逻辑将战争和耳朵文件安装到 websphere 中。 运行脚本后,它成功安装了war和ears,但在服务器stratup期间,它仅对ear文件抛出错误。 如果我使用相同的命令逻辑直接在 wsadmin 上执行 ear 文件安装,它工作正常,甚至服务器也没有错误出现,任何人都可以分析脚本中出了什么问题

错误:org.springframework.beans.factory.access.BootstrapException:无法初始化组定义。组资源名称[classpath*:beanRefContext.xml],工厂键[netbanksrv.context];嵌套异常是 org.springframework.beans.factory.BeanCreationException:在 URL [wsjar:file:/D:/IBM/WebSphere8/AppServer/Profiles/AppSrv12/installedApps/BLRVSWASBFT01Node10Cell/netbanksrv 中定义名称为“netbanksrv.context”的 bean 创建错误-ear.ear/lib/netbanksrv-core-5.4.3.jar!/beanRefContext.xml]:bean 的实例化失败;嵌套异常是 org.springframework.beans.BeanInstantiationException:无法实例化 bean 类 [pegasus.framework.spring.context.MethodCachingClassPathXmlApplicationContext]:构造函数抛出异常;嵌套异常是 org.springframework.beans.factory.BeanCreationException:在 URL [wsjar:file:/D:/IBM/WebSphere8/AppServer/Profiles/AppSrv12/installedApps/BLRVSWASBFT01Node10Cell/netbanksrv 中定义的名称为“genAccountServices.WSDLResource”的 bean 创建时出错-ear.ear/lib/integration-1.3.0.jar!/META-INF/spring/AccountServices-ws-springintegration.xml]:bean 实例化失败;嵌套异常是 org.springframework.beans.BeanInstantiationException:无法实例化 bean 类 [pegasus.integration.framework.HttpClientUrlResource]:构造函数抛出异常;嵌套异常是 java.net.MalformedURLException: no protocol: null

我的逻辑:

for fname in os.listdir(warPath):
        if fname.endswith(".ear") or fname.endswith(".war"):
            file_list.append(fname)


    for i in range(len(file_list)):
        earFile=file_list[i]
        letter=earFile[0]

        if (letter == "a"):
            applicationName="admin-guiwar"
            installApp(cellName, nodeName, serverName, earFile, applicationName);
            classldr(applicationName)
        if (letter == "i"):
            applicationName="internetbank-guiwar"
            installApp(cellName, nodeName, serverName, earFile, applicationName);
            classldr(applicationName)
        if (letter == "m"):
            applicationName="mobilegateway"
            installApp(cellName, nodeName, serverName, earFile, applicationName);
            classldr(applicationName)
        if (letter == "n"):
            applicationName="netbanksrv-ear"
            installApp(cellName, nodeName, serverName, earFile, applicationName);
            classldr(applicationName)

def installApp (cellName, nodeName, serverName, warFileName, applicationName):
    fullPath = warPath+"/"+warFileName
    node = "-node "+nodeName
    cell = "-cell "+cellName
    svr = "-server "+serverName
    appName = "-appname "+applicationName
    AdminApp.install(fullPath, [node, cell, svr, appName])

【问题讨论】:

    标签: python websphere jython


    【解决方案1】:

    您的部署脚本没问题。但是你对 Spring 有不同的问题:

     Could not instantiate bean class [pegasus.integration.framework.HttpClientUrlResource]: Constructor threw exception; nested exception is java.net.MalformedURLException: no protocol: null
    

    我认为您必须为您的应用程序将类加载器策略设置为 PARENT_LAST

    WAS Classloader Best Practices

    【讨论】:

    • 嗨,感谢您的回复。我已经编写了一个代码来将类加载到最后一个父级。仍然给我同样的错误。如果我使用相同的管理配置命令在它之外安装 ear 文件工作正常
    • 我无法弄清楚出了什么问题。同样的管理员配置安装了 war 文件,我没有得到这个问题,只是因为 ear 文件抛出了上面的问题
    • 这是指向类加载器最佳实践的链接:www-01.ibm.com/support/docview.wss?uid=swg27006994&aid=1。它应该会有所帮助。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-06-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-04-09
    • 1970-01-01
    相关资源
    最近更新 更多