2017-02-14 2 views
0

Ich versuche, WLP für eine vorhandene EAR-Anwendung einzurichten. Diese Konfiguration funktioniert gut mit WAS 9 traditionell.Die JCA-CICS-Ressource kann nicht mit IBM WebSphere Application Server Liberty-Profil verwendet werden.

Das Problem ist der Aufruf des JCA-CICS-Ressourcenadapters.

Die 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> 

in ibm-web-bnd.xml:

<resource-ref name="cicsjca" binding-name="jca/CTGDV06"></resource-ref> 

in web.xml:

<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> 

Startup ist Ok, aber der Zugang zu JCA fehlgeschlagen mit:

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.] 

Ich verstehe nicht, was mit diesem Setup falsch ist, würde jede Hilfe geschätzt werden!

Antwort

1

Die richtige Konfiguration hängt davon ab, wie viele Verbindungsfactory-Implementierungen vom Ressourcenadapter bereitgestellt werden.

Wenn der Ressourcenadapter nur eine einzige Verbindung Fabrik liefert (die für viele Ressourcenadapter häufig der Fall ist), dann würde Konfiguration:

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

Vollständige Einzelheiten über Konfiguration angeben, für JCA Resource Adapter in Liberty kann here im Wissenszentrum gefunden werden.

+0

Ich hatte diese Syntax früher ohne Erfolg versucht. Jetzt mit Ihrer Syntax ich konfrontiert diese Ausnahme: 'java.lang.Exception: Nachschlagen für Java: comp/env/cicsjca fehlgeschlagen. Ausnahme: java.lang.ClassCastException: com.ibm.connector2.cics.ECIConnectionFactory inkompatibel mit com.ibm.connector2.cics.ECIConnectionFactory' –

+0

Diese Ausnahme gibt an, dass dieselbe Klasse von zwei verschiedenen Speicherorten geladen wird. Haben Sie eine Kopie dieser Klasse in Ihrem RAR und in einem Ihrer sharedLib-Jars? Ich vermute, Sie müssen nur 'classProviderRef' auf Ihrem Anwendung Classloader angeben. –

+0

Genau, cicseci.jar und andere Deps. werden auch in der gemeinsamen Lib geladen. Die Anwendung verwendet einige proprietäre Frameworks, die dasselbe jar verwenden. Ich überprüfe das ... –

Verwandte Themen