1

我在 Eclipse JEE 上创建了两个项目:

1) Connector-ra.rar:本项目有java类和ra.xml。这是我的资源适配器ra.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE connector PUBLIC '-//Sun Microsystems, Inc.//DTD Connector 1.0//EN' 'http://java.sun.org/j2ee/dtds/connector_1_0.dtd'>
<connector>
    <display-name>Connector-jca-1</display-name>
    <vendor-name>Volkswagen AG</vendor-name>
    <spec-version>1.0</spec-version>
    <eis-type>Prop</eis-type>
    <version>1.0</version>
    <resourceadapter>
        <managedconnectionfactory-class>com.eis.hw.ManagedConnectionFactoryImpl</managedconnectionfactory-class>
        <connectionfactory-interface>com.eis.hw.HelloWorldConnectionFactory</connectionfactory-interface>
        <connectionfactory-impl-class>com.eis.hw.HelloWorldConnectionFactoryImpl</connectionfactory-impl-class>
        <connection-interface>com.eis.hw.HelloWorldConnection</connection-interface>
        <connection-impl-class>com.eis.hw.HelloWorldConnectionImpl</connection-impl-class>
        <transaction-support>NoTransaction</transaction-support>
        <config-property>
            <config-property-name>HostURL</config-property-name>
            <config-property-type>java.lang.String</config-property-type>
            <config-property-value>127.0.0.1</config-property-value>
        </config-property>
        <authentication-mechanism>
            <authentication-mechanism-type>BasicPassword</authentication-mechanism-type>
            <credential-interface>javax.resource.security.PasswordCredential</credential-interface>
        </authentication-mechanism>
        <reauthentication-support>false</reauthentication-support>
    </resourceadapter>
</connector>

2)在我的 Web 项目中,我尝试调用:

import java.io.IOException;
import java.io.PrintWriter;

import javax.annotation.Resource;
import javax.resource.ResourceException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.eis.hw.HelloWorldConnection;
import com.eis.hw.HelloWorldConnectionFactory;


@WebServlet("/JCAServlet")
public class TestRA extends HttpServlet {
    private static final long serialVersionUID = 1L;

    @Resource(lookup="eis/ECI")
    private HelloWorldConnectionFactory connectionFactory;

     public TestRA() {
            super();

        }
        /**
         * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
         */
        protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
              String result = " ";



          HelloWorldConnection connection = null;
            try {
                 connection = connectionFactory.getConnection();               
                 result = connection.helloWorldCall();

            } catch (ResourceException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }


            PrintWriter out = response.getWriter();
            out.println(result + "Application test");

            out.flush();
          //  connection.close();
        }


    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        // TODO Auto-generated method stub
        doGet(request, response);
    }

}

我正在自由服务器上配置 JCA 和资源适配器。这是我在自由服务器上的server.xml :

<server description="new server">

    <!-- Enable features -->
    <featureManager>
        <feature>adminCenter-1.0</feature>
         <feature>javaee-7.0</feature>
        <feature>jaxws-2.2</feature>
        <feature>jca-1.7</feature>
        <feature>jndi-1.0</feature>
        <feature>localConnector-1.0</feature>
        <feature>webProfile-7.0</feature>
        <!--<feature>ejbRemote-3.2</feature>-->
    </featureManager>

       <!--The location of the cicseci.rar needs to be updated to the full path-->
   <resourceAdapter autoStart="true" id="eciResourceAdapter" location="C:/Users/Connector-ra.rar"/>

   <connectionFactory id="eciTest" jndiName="eis/ECI">
      <!--The properties need to be updated to the location of the CICS Transaction Gateway-->
      <properties.eciResourceAdapter connectionUrl="tcp://localhost" portNumber="2006"/>
   </connectionFactory>



    <webApplication id="Connector-web" location="Connector-web-0.0.1-SNAPSHOT.war" name="Connector-web">
   <classloader classProviderRef="eciResourceAdapter"/>
    </webApplication>

    </server>

我的问题是:

[ERROR ] SRVE0319E: For the [com.sample.TestRA] servlet, com.sample.TestRA servlet class was found, but a resource injection failure has occurred. CWNEN0030E: The server was unable to obtain an object instance for the java:comp/env/com.sample.TestRA/connectionFactory reference. The exception message was: CWNEN1003E: The server was unable to find the eis/ECI binding with the com.eis.hw.HelloWorldConnectionFactory type for the java:comp/env/com.sample.TestRA/connectionFactory reference.

消息日志

[08/11/18 14:15:18:991 CET] 00000011 com.ibm.ws.sib.utils.ras.SibMessage                          I  CWSID0108I: JMS server has started.  
[08/11/18 14:15:19:101 CET] 00000011 com.ibm.ws.security.jaspi.AuthConfigFactoryWrapper           I CWWKS1655I: The default Java Authentication SPI for Containers (JASPIC) AuthConfigFactory class com.ibm.ws.security.jaspi.ProviderRegistry is being used because the Java security property authconfigprovider.factory is not set. 
[08/11/18 14:15:19:971 CET] 0000002e om.ibm.ws.app.manager.rar.internal.RARApplicationHandlerImpl I J2CA7018I: Installing resource adapter eciResourceAdapter.
[08/11/18 14:15:21:570 CET] 00000019 com.ibm.ws.webcontainer.osgi.webapp.WebGroup                 I SRVE0169I: Loading Web Module: The Liberty Explore Tool.
[08/11/18 14:15:21:572 CET] 00000019 com.ibm.ws.webcontainer                                      I SRVE0250I: Web Module The Liberty Explore Tool has been bound to default_host.
[08/11/18 14:15:21:568 CET] 0000001c com.ibm.ws.webcontainer.osgi.webapp.WebGroup                 I SRVE0169I: Loading Web Module: The Liberty Admin Center.
[08/11/18 14:15:21:575 CET] 0000001c com.ibm.ws.webcontainer                                      I SRVE0250I: Web Module The Liberty Admin Center has been bound to default_host.
[08/11/18 14:15:21:574 CET] 00000019 com.ibm.ws.http.internal.VirtualHostImpl                     A CWWKT0016I: Web application available (default_host): http://localhost:9086/ibm/adminCenter/explore-1.0/
[08/11/18 14:15:21:570 CET] 0000001f com.ibm.ws.webcontainer.osgi.webapp.WebGroup                 I SRVE0169I: Loading Web Module: ibm/api.
[08/11/18 14:15:21:579 CET] 0000001f com.ibm.ws.webcontainer                                      I SRVE0250I: Web Module ibm/api has been bound to default_host.
[08/11/18 14:15:21:571 CET] 00000032 com.ibm.ws.webcontainer.osgi.webapp.WebGroup                 I SRVE0169I: Loading Web Module: The Liberty Server Config Tool.
[08/11/18 14:15:21:571 CET] 0000002d com.ibm.ws.webcontainer.osgi.webapp.WebGroup                 I SRVE0169I: Loading Web Module: IBMJMXConnectorREST.
[08/11/18 14:15:21:581 CET] 00000032 com.ibm.ws.webcontainer                                      I SRVE0250I: Web Module The Liberty Server Config Tool has been bound to default_host.
[08/11/18 14:15:21:581 CET] 0000002d com.ibm.ws.webcontainer                                      I SRVE0250I: Web Module IBMJMXConnectorREST has been bound to default_host.
[08/11/18 14:15:21:587 CET] 0000001f com.ibm.ws.http.internal.VirtualHostImpl                     A CWWKT0016I: Web application available (default_host): http://localhost:9086/ibm/api/
[08/11/18 14:15:21:588 CET] 0000001c com.ibm.ws.http.internal.VirtualHostImpl                     A CWWKT0016I: Web application available (default_host): http://localhost:9086/adminCenter/
[08/11/18 14:15:21:594 CET] 0000002d com.ibm.ws.http.internal.VirtualHostImpl                     A CWWKT0016I: Web application available (default_host): http://localhost:9086/IBMJMXConnectorREST/
[08/11/18 14:15:21:618 CET] 0000002e org.jboss.weld.Version                                       I WELD-000900: 2.4.5 (Final)
[08/11/18 14:15:21:666 CET] 0000002d com.ibm.ws.jmx.connector.server.rest.RESTAppListener         I CWWKX0103I: The JMX REST connector is running and is available at the following service URL: service:jmx:rest://localhost:9543/IBMJMXConnectorREST
[08/11/18 14:15:21:718 CET] 00000021 com.ibm.ws.session.WASSessionCore                            I SESN8501I: The session manager did not find a persistent storage location; HttpSession objects will be stored in the local application server's memory.
[08/11/18 14:15:21:746 CET] 0000002d com.ibm.ws.jmx.connector.server.rest.RESTAppListener         I CWWKX0103I: The JMX REST connector is running and is available at the following service URL: service:jmx:rest://localhost:9543/IBMJMXConnectorREST
[08/11/18 14:15:21:747 CET] 00000020 com.ibm.ws.session.WASSessionCore                            I SESN0176I: A new session context will be created for application key default_host/ibm/api
[08/11/18 14:15:21:746 CET] 00000021 com.ibm.ws.session.WASSessionCore                            I SESN0176I: A new session context will be created for application key default_host/ibm/adminCenter/explore-1.0
[08/11/18 14:15:21:748 CET] 0000002c com.ibm.ws.session.WASSessionCore                            I SESN0176I: A new session context will be created for application key default_host/adminCenter
[08/11/18 14:15:21:767 CET] 00000032 com.ibm.ws.http.internal.VirtualHostImpl                     A CWWKT0016I: Web application available (default_host): http://localhost:9086/ibm/adminCenter/serverConfig-1.0/
[08/11/18 14:15:21:785 CET] 00000032 com.ibm.ws.session.WASSessionCore                            I SESN0176I: A new session context will be created for application key default_host/ibm/adminCenter/serverConfig-1.0
[08/11/18 14:15:21:788 CET] 00000020 com.ibm.ws.util                                              I SESN0172I: The session manager is using the Java default SecureRandom implementation for session ID generation.
[08/11/18 14:15:21:820 CET] 00000032 com.ibm.ws.util                                              I SESN0172I: The session manager is using the Java default SecureRandom implementation for session ID generation.
[08/11/18 14:15:21:824 CET] 00000021 com.ibm.ws.util                                              I SESN0172I: The session manager is using the Java default SecureRandom implementation for session ID generation.
[08/11/18 14:15:21:826 CET] 0000002c com.ibm.ws.util                                              I SESN0172I: The session manager is using the Java default SecureRandom implementation for session ID generation.
[08/11/18 14:15:21:851 CET] 0000002d com.ibm.ws.session.WASSessionCore                            I SESN0176I: A new session context will be created for application key default_host/IBMJMXConnectorREST
[08/11/18 14:15:21:852 CET] 0000002d com.ibm.ws.util                                              I SESN0172I: The session manager is using the Java default SecureRandom implementation for session ID generation.
[08/11/18 14:15:22:113 CET] 0000002c com.ibm.ws.cache.CacheServiceImpl                            I DYNA1056I: Dynamic Cache (object cache) initialized successfully.
[08/11/18 14:15:22:543 CET] 0000002d com.ibm.ws.webcontainer.servlet                              I SRVE0242I: [com.ibm.ws.jmx.connector.server.rest] [/IBMJMXConnectorREST] [JMXRESTProxyServlet]: Initialization successful.
[08/11/18 14:15:22:808 CET] 0000002e om.ibm.ws.app.manager.rar.internal.RARApplicationHandlerImpl A J2CA7001I: Resource adapter eciResourceAdapter installed in 2.837 seconds.
[08/11/18 14:15:22:915 CET] 0000001f com.ibm.ws.app.manager.AppMessageHelper                      I CWWKZ0018I: Starting application informationrequest-ui.
[08/11/18 14:15:22:928 CET] 00000019 com.ibm.ws.app.manager.AppMessageHelper                      I CWWKZ0018I: Starting application SoapApp0.
[08/11/18 14:15:22:937 CET] 0000002e com.ibm.ws.app.manager.AppMessageHelper                      I CWWKZ0018I: Starting application Connector-web.
[08/11/18 14:15:23:311 CET] 0000001f com.ibm.ws.webcontainer.osgi.webapp.WebGroup                 I SRVE0169I: Loading Web Module: informationrequest-ui.
[08/11/18 14:15:23:312 CET] 0000001f com.ibm.ws.webcontainer                                      I SRVE0250I: Web Module informationrequest-ui has been bound to default_host.
[08/11/18 14:15:23:314 CET] 0000001f com.ibm.ws.http.internal.VirtualHostImpl                     A CWWKT0016I: Web application available (default_host): http://localhost:9086/informationrequest-ui/
[08/11/18 14:15:23:315 CET] 0000001f com.ibm.ws.app.manager.AppMessageHelper                      A CWWKZ0001I: Application informationrequest-ui started in 0.400 seconds.
[08/11/18 14:15:23:342 CET] 00000021 com.ibm.ws.session.WASSessionCore                            I SESN0176I: A new session context will be created for application key default_host/informationrequest-ui
[08/11/18 14:15:23:342 CET] 00000021 com.ibm.ws.util                                              I SESN0172I: The session manager is using the Java default SecureRandom implementation for session ID generation.
[08/11/18 14:15:23:690 CET] 0000001c com.ibm.ws.webcontainer.osgi.mbeans.PluginGenerator          I SRVE9103I: A configuration file for a web server plugin was automatically generated for this server at C:\Users\abdelkarim.chokri\Desktop\ELSA\Tools\wlp-webProfile7-17.0.0.4\wlp\usr\servers\defaultServer\logs\state\plugin-cfg.xml.
[08/11/18 14:15:24:418 CET] 00000020 com.ibm.ws.webcontainer.osgi.mbeans.PluginGenerator          I SRVE9103I: A configuration file for a web server plugin was automatically generated for this server at C:\Users\abdelkarim.chokri\Desktop\ELSA\Tools\wlp-webProfile7-17.0.0.4\wlp\usr\servers\defaultServer\logs\state\plugin-cfg.xml.
[08/11/18 14:15:28:602 CET] 0000002e com.ibm.ws.webcontainer.osgi.webapp.WebGroup                 I SRVE0169I: Loading Web Module: Connector-web.
[08/11/18 14:15:28:602 CET] 0000002e com.ibm.ws.webcontainer                                      I SRVE0250I: Web Module Connector-web has been bound to default_host.
[08/11/18 14:15:28:603 CET] 0000002e com.ibm.ws.http.internal.VirtualHostImpl                     A CWWKT0016I: Web application available (default_host): http://localhost:9086/Connector-web/
[08/11/18 14:15:28:607 CET] 0000002e com.ibm.ws.app.manager.AppMessageHelper                      A CWWKZ0001I: Application Connector-web started in 5.668 seconds.
[08/11/18 14:15:28:963 CET] 00000032 com.ibm.ws.webcontainer.osgi.mbeans.PluginGenerator          I SRVE9103I: A configuration file for a web server plugin was automatically generated for this server at C:\Users\abdelkarim.chokri\Desktop\ELSA\Tools\wlp-webProfile7-17.0.0.4\wlp\usr\servers\defaultServer\logs\state\plugin-cfg.xml.
[08/11/18 14:15:29:066 CET] 0000001f com.ibm.ws.session.WASSessionCore                            I SESN0176I: A new session context will be created for application key default_host/Connector-web
[08/11/18 14:15:29:067 CET] 0000001f com.ibm.ws.util                                              I SESN0172I: The session manager is using the Java default SecureRandom implementation for session ID generation.
[08/11/18 14:15:31:183 CET] 00000019 com.ibm.ws.webcontainer.osgi.webapp.WebGroup                 I SRVE0169I: Loading Web Module: SoapApp0.
[08/11/18 14:15:31:183 CET] 00000019 com.ibm.ws.webcontainer                                      I SRVE0250I: Web Module SoapApp0 has been bound to default_host.
[08/11/18 14:15:31:183 CET] 00000019 com.ibm.ws.http.internal.VirtualHostImpl                     A CWWKT0016I: Web application available (default_host): http://localhost:9086/SoapApp0/
[08/11/18 14:15:31:187 CET] 00000019 com.ibm.ws.app.manager.AppMessageHelper                      A CWWKZ0001I: Application SoapApp0 started in 8.259 seconds.
[08/11/18 14:15:31:319 CET] 00000018 com.ibm.ws.kernel.feature.internal.FeatureManager            A CWWKF0012I: The server installed the following features: [servlet-3.1, beanValidation-1.1, ssl-1.0, jndi-1.0, jca-1.7, jms-2.0, ejbPersistentTimer-3.2, appSecurity-2.0, j2eeManagement-1.1, jdbc-4.1, jaxrs-2.0, wasJmsServer-1.0, javaMail-1.5, adminCenter-1.0, cdi-1.2, webProfile-7.0, jpa-2.1, jcaInboundSecurity-1.0, jsp-2.3, ejbLite-3.2, managedBeans-1.0, jsf-2.2, ejbHome-3.2, jaxws-2.2, localConnector-1.0, jsonp-1.0, restConnector-1.0, el-3.0, jaxrsClient-2.0, concurrent-1.0, appClientSupport-1.0, ejbRemote-3.2, javaee-7.0, jaxb-2.2, mdb-3.2, jacc-1.5, batch-1.0, ejb-3.2, json-1.0, jaspic-1.1, jpaContainer-2.1, distributedMap-1.0, websocket-1.1, wasJmsSecurity-1.0, wasJmsClient-2.0].
[08/11/18 14:15:31:319 CET] 00000018 com.ibm.ws.kernel.feature.internal.FeatureManager            I CWWKF0008I: Feature update completed in 34.273 seconds.
[08/11/18 14:15:31:320 CET] 00000018 com.ibm.ws.kernel.feature.internal.FeatureManager            A CWWKF0011I: The server defaultServer is ready to run a smarter planet.
[08/11/18 14:15:31:470 CET] 0000002d com.ibm.ws.session.WASSessionCore                            I SESN0176I: A new session context will be created for application key default_host/SoapApp0
[08/11/18 14:15:31:471 CET] 0000002d com.ibm.ws.util                                              I SESN0172I: The session manager is using the Java default SecureRandom implementation for session ID generation.
[08/11/18 14:15:31:742 CET] 00000019 com.ibm.ws.webcontainer.osgi.mbeans.PluginGenerator          I SRVE9103I: A configuration file for a web server plugin was automatically generated for this server at C:\Users\abdelkarim.chokri\Desktop\ELSA\Tools\wlp-webProfile7-17.0.0.4\wlp\usr\servers\defaultServer\logs\state\plugin-cfg.xml.
[08/11/18 14:15:31:961 CET] 0000002d com.ibm.ws.webcontainer.servlet                              I SRVE0242I: [SoapApp0] [/SoapApp0] [AdminServlet]: Initialization successful.
[08/11/18 14:15:34:040 CET] 0000001f com.ibm.ws.jca.internal.BootstrapContextImpl                 W J2CA8501E: Property portNumber of configuration element eis/ECI cannot be set because it is not found on the class com.eis.hw.ManagedConnectionFactoryImpl.
[08/11/18 14:15:34:135 CET] 0000001f com.ibm.ws.recoverylog.spi.RecoveryDirectorImpl              I CWRLS0010I: Performing recovery processing for local WebSphere server (defaultServer).
[08/11/18 14:15:37:437 CET] 0000001f com.ibm.ws.recoverylog.spi.RecoveryDirectorImpl              I CWRLS0012I: All persistent services have been directed to perform recovery processing for this WebSphere server (defaultServer).
[08/11/18 14:15:37:438 CET] 00000049 com.ibm.tx.jta.impl.RecoveryManager                          I WTRN0135I: Transaction service recovering no transactions.
[08/11/18 14:15:37:620 CET] 0000001f com.ibm.ws.logging.internal.impl.IncidentImpl                I FFDC1015I: An FFDC Incident has been created: "java.lang.IllegalArgumentException: Can not set com.eis.hw.HelloWorldConnectionFactory field com.sample.TestRA.connectionFactory to com.eis.hw.HelloWorldConnectionFactoryImpl com.ibm.wsspi.injectionengine.InjectionTarget.inject 140" at ffdc_18.11.08_14.15.37.0.log
[08/11/18 14:15:38:379 CET] 0000001f com.ibm.ws.logging.internal.impl.IncidentImpl                I FFDC1015I: An FFDC Incident has been created: "com.ibm.wsspi.injectionengine.InjectionException: CWNEN0074E: The com.eis.hw.HelloWorldConnectionFactoryImpl type of the object instance obtained for the java:comp/env/com.sample.TestRA/connectionFactory reference is incompatible with the type of the private com.eis.hw.HelloWorldConnectionFactory com.sample.TestRA.connectionFactory member. com.ibm.ws.webcontainer.servlet.ServletWrapper.loadServlet 228" at ffdc_18.11.08_14.15.37.1.log
[08/11/18 14:15:38:380 CET] 0000001f com.ibm.ws.webcontainer.servlet                              E SRVE0319E: For the [com.sample.TestRA] servlet, com.sample.TestRA servlet class was found, but a resource injection failure has occurred. CWNEN0074E: The com.eis.hw.HelloWorldConnectionFactoryImpl type of the object instance obtained for the java:comp/env/com.sample.TestRA/connectionFactory reference is incompatible with the type of the private com.eis.hw.HelloWorldConnectionFactory com.sample.TestRA.connectionFactory member.
[08/11/18 14:15:38:986 CET] 0000001f com.ibm.ws.logging.internal.impl.IncidentImpl                I FFDC1015I: An FFDC Incident has been created: "javax.servlet.UnavailableException: SRVE0319E: For the [com.sample.TestRA] servlet, com.sample.TestRA servlet class was found, but a resource injection failure has occurred. CWNEN0074E: The com.eis.hw.HelloWorldConnectionFactoryImpl type of the object instance obtained for the java:comp/env/com.sample.TestRA/connectionFactory reference is incompatible with the type of the private com.eis.hw.HelloWorldConnectionFactory com.sample.TestRA.connectionFactory member. com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest() 302" at ffdc_18.11.08_14.15.38.0.log
[08/11/18 14:15:39:081 CET] 0000001f com.ibm.ws.logging.internal.impl.IncidentImpl                I FFDC1015I: An FFDC Incident has been created: "javax.servlet.UnavailableException: SRVE0319E: For the [com.sample.TestRA] servlet, com.sample.TestRA servlet class was found, but a resource injection failure has occurred. CWNEN0074E: The com.eis.hw.HelloWorldConnectionFactoryImpl type of the object instance obtained for the java:comp/env/com.sample.TestRA/connectionFactory reference is incompatible with the type of the private com.eis.hw.HelloWorldConnectionFactory com.sample.TestRA.connectionFactory member. com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter 144" at ffdc_18.11.08_14.15.38.1.log
[08/11/18 14:15:39:222 CET] 0000001f com.ibm.ws.logging.internal.impl.IncidentImpl                I FFDC1015I: An FFDC Incident has been created: "javax.servlet.UnavailableException: SRVE0319E: For the [com.sample.TestRA] servlet, com.sample.TestRA servlet class was found, but a resource injection failure has occurred. CWNEN0074E: The com.eis.hw.HelloWorldConnectionFactoryImpl type of the object instance obtained for the java:comp/env/com.sample.TestRA/connectionFactory reference is incompatible with the type of the private com.eis.hw.HelloWorldConnectionFactory com.sample.TestRA.connectionFactory member. com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters 1064" at ffdc_18.11.08_14.15.39.0.log
[08/11/18 14:15:39:222 CET] 0000001f com.ibm.ws.webcontainer.webapp                               E SRVE0315E: An exception occurred: java.lang.Throwable: javax.servlet.UnavailableException: SRVE0319E: For the [com.sample.TestRA] servlet, com.sample.TestRA servlet class was found, but a resource injection failure has occurred. CWNEN0074E: The com.eis.hw.HelloWorldConnectionFactoryImpl type of the object instance obtained for the java:comp/env/com.sample.TestRA/connectionFactory reference is incompatible with the type of the private com.eis.hw.HelloWorldConnectionFactory com.sample.TestRA.connectionFactory member.
    at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:5006)
    at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$2.handleRequest(DynamicVirtualHost.java:314)
    at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:995)
    at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$2.run(DynamicVirtualHost.java:279)
    at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink$TaskWrapper.run(HttpDispatcherLink.java:957)
    at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink.wrapHandlerAndExecute(HttpDispatcherLink.java:357)
    at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink.ready(HttpDispatcherLink.java:316)
    at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:499)
    at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleNewRequest(HttpInboundLink.java:433)
    at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.processRequest(HttpInboundLink.java:313)
    at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.ready(HttpInboundLink.java:284)
    at com.ibm.ws.tcpchannel.internal.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:165)
    at com.ibm.ws.tcpchannel.internal.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:74)
    at com.ibm.ws.tcpchannel.internal.WorkQueueManager.requestComplete(WorkQueueManager.java:501)
    at com.ibm.ws.tcpchannel.internal.WorkQueueManager.attemptIO(WorkQueueManager.java:571)
    at com.ibm.ws.tcpchannel.internal.WorkQueueManager.workerRun(WorkQueueManager.java:926)
    at com.ibm.ws.tcpchannel.internal.WorkQueueManager$Worker.run(WorkQueueManager.java:1015)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: javax.servlet.UnavailableException: SRVE0319E: For the [com.sample.TestRA] servlet, com.sample.TestRA servlet class was found, but a resource injection failure has occurred. CWNEN0074E: The com.eis.hw.HelloWorldConnectionFactoryImpl type of the object instance obtained for the java:comp/env/com.sample.TestRA/connectionFactory reference is incompatible with the type of the private com.eis.hw.HelloWorldConnectionFactory com.sample.TestRA.connectionFactory member.
    at com.ibm.ws.webcontainer.servlet.ServletWrapper$1.run(ServletWrapper.java:1602)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.loadServlet(ServletWrapper.java:1503)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:587)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:440)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:143)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:89)
    at com.ibm.ws.security.jaspi.JaspiServletFilter.doFilter(JaspiServletFilter.java:56)
    at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:201)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:86)
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:995)
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1124)
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1004)
    at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:1414)
    at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:171)
    at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:790)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:143)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:89)
    at com.ibm.ws.security.jaspi.JaspiServletFilter.doFilter(JaspiServletFilter.java:56)
    at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:201)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:86)
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:995)
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1124)
    at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:4962)
    ... 19 more

请帮助我解决此问题或至少调试此问题以进一步进行。由于我正在尝试使用 IBM Liberty,因此 Google 中也没有太多信息。

4

1 回答 1

2

查看日志,我看到以下问题:

J2CA8501E: Property portNumber of configuration element eis/ECI cannot be set because it is not found on the class com.eis.hw.ManagedConnectionFactoryImpl.

看起来像配置/实现问题

CWNEN0074E: The com.eis.hw.HelloWorldConnectionFactoryImpl type of the object
instance obtained for the java:comp/env/com.sample.TestRA/connectionFactory reference is 
incompatible with the type of the private com.eis.hw.HelloWorldConnectionFactory 
com.sample.TestRA.connectionFactory member. 

因此,您有一些类加载器问题,请确保您在应用程序本身中没有任何与资源适配器相关的类,如 WEB-INF/lib 或其他任何地方包含的 jar/rar。

于 2018-11-08T15:19:31.587 回答