Websphere liberty 无法将JCA CICS资源与IBM WebSphere Application Server Liberty配置文件一起使用

Websphere liberty 无法将JCA CICS资源与IBM WebSphere Application Server Liberty配置文件一起使用,websphere-liberty,Websphere Liberty,我正在尝试为现有的EAR应用程序设置WLP。 此设置适用于WAS 9传统 问题在于JCA CICS资源适配器调用 server.xml文件: <?xml version="1.0" encoding="UTF-8"?> <server description="new server"> <!-- Enable features --> <featureManager> <feature>javaee-7

我正在尝试为现有的EAR应用程序设置WLP。 此设置适用于WAS 9传统

问题在于JCA CICS资源适配器调用

server.xml文件:

<?xml version="1.0" encoding="UTF-8"?>
<server description="new server">

    <!-- Enable features -->
    <featureManager>
        <feature>javaee-7.0</feature>
    </featureManager>

    <!-- To access this server from a remote client add a host attribute to the following element, e.g. host="*" -->
    <httpEndpoint id="defaultHttpEndpoint"
                  host="*"
                  httpPort="9080"
                  httpsPort="9443" />

    <!-- Automatically expand WAR files and EAR files -->
    <applicationManager autoExpand="true"/>

    <library id="sharedLibs">
        <fileset dir="/work/sharedlibs" includes="*.jar"/>
        <folder dir="/work" />
    </library>

    <resourceAdapter
            autoStart="true"
            id="eciResourceAdapter"
            location="/work/cicseci.rar">
    </resourceAdapter>

    <connectionFactory id="CTGDV06" jndiName="jca/CTGDV06" >
        <properties.eciResourceAdapter.javax.resource.cci.ConnectionFactory
                connectionUrl="tcp://*******"
                serverName="*******"
                userName="*******"
                portNumber="2006"
         />
    </connectionFactory>

    <application type="ear" id="app" location="app.ear" name="app">
        <classloader
                commonLibraryRef="sharedLibs"
                classProviderRef="eciResourceAdapter" />
    </application>
</server>

我不明白这个设置有什么问题,任何帮助都将不胜感激

正确的配置取决于资源适配器提供了多少连接工厂实现

如果资源适配器仅提供单个连接工厂(这通常是许多资源适配器的情况),则配置为:

<connectionFactory id="CTGDV06" jndiName="jca/CTGDV06" >
    <properties.eciResourceAdapter
            connectionUrl="tcp://*******"
            serverName="*******"
            userName="*******"
            portNumber="2006"
     />
</connectionFactory>


有关如何在Liberty中指定JCA资源适配器配置的详细信息,请访问知识中心。

我之前尝试过这种语法,但没有成功。现在,使用您的语法,我遇到了这个异常:
java.lang.exception:查找java:comp/env/cicsjca失败。异常:java.lang.ClassCastException:com.ibm.connector2.cics.ecConnectionFactory与com.ibm.connector2.cics.ecConnectionFactory不兼容该异常表示从两个不同位置加载同一类。您的RAR和sharedLib罐中是否有该类的副本?我怀疑您只需要在应用程序类加载器上指定
classProviderRef
。确切地说,就是cicseci.jar和其他dep。也会加载到共享库中。该应用程序使用一些使用相同jar的专有框架。我检查了一下……把罐子从sharedLib移到EAR解决了这个问题。CICS调用正在运行。谢谢你的帮助。@EmericChardiny,我正在尝试同样的方法,甚至所遵循的步骤也与你的类似,但是我得到了javax.naming.NamingNotFoundException。一切似乎都是正确的。你能帮助我吗?
<resource-ref id="ResourceRef_Cics_Jca">
    <description>Acces CICS</description>
    <res-ref-name>cicsjca</res-ref-name>
    <res-type>javax.resource.cci.ConnectionFactory</res-type>
    <res-auth>Application</res-auth>
    <res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
java.lang.Exception: Lookup for java:comp/env/cicsjca failed. Exception: javax.naming.NamingException: CWNEN1001E: The object referenced by the java:comp/env/cicsjca JNDI name could not be instantiated. If the reference name maps to a JNDI name in the deployment descriptor bindings for the application performing the JNDI lookup, make sure that the JNDI name mapping in the deployment descriptor binding is correct. If the JNDI name mapping is correct, make sure the target resource can be resolved with the specified name relative to the default initial context. 
[Root exception is com.ibm.wsspi.injectionengine.InjectionException: CWNEN0030E: The server was unable to obtain an object instance for the java:comp/env/cicsjca reference.  The exception message was: CWNEN1003E: The server was unable to find the jca/CTGDV06 binding with the javax.resource.cci.ConnectionFactory type for the java:comp/env/cicsjca reference.]
<connectionFactory id="CTGDV06" jndiName="jca/CTGDV06" >
    <properties.eciResourceAdapter
            connectionUrl="tcp://*******"
            serverName="*******"
            userName="*******"
            portNumber="2006"
     />
</connectionFactory>