Failed to deploy worklight adapter in Worklight

北慕城南 提交于 2019-12-02 09:16:05

问题


When deploying the BPM project in a development environment, everything works. However, when trying to move the project to the WAS application server, the adapter deployment fails (.war and .wlapp deployment passes successfully):

Failed to deploy adapter 'BPMAdapter.adapter'. : Procedure 'getRest' in adapter 'BPMAdapter' requires security test 'BPMAdapter-securityTest' which is not defined in authenticationConfig.xml.

We've verified the security test exists in authenticationConfig.xml, here's the portion of the tests, so it is, in fact present:

<securityTests>
    <customSecurityTest name="BPMAdapter-securityTest">
        <test isInternalUserID="true" realm="BPMAuthRealm"/>
    </customSecurityTest>
    <webSecurityTest name="BPMApp-web-securityTest">
        <testUser realm="BPMAuthRealm"/>
    </webSecurityTest>
    <mobileSecurityTest name="BPMApp-strong-mobile-securityTest">
        <testUser realm="BPMAuthRealm"/>
        <testDeviceId provisioningType="none"/>
    </mobileSecurityTest>
    <mobileSecurityTest name="BPMApp-mobile-securityTest">
        <testUser realm="BPMAuthRealm"/>
    </mobileSecurityTest>
</securityTests>

These are the steps we've taken:

Testing server: Windows 2008 R2 Datacenter
Database: DB2 10.1
Application Server: WAS 8.0.0.3 ND

  1. Installed Worklight Server Enterprise 5.0.5 with DB2 databases successfully. (Worklight is working at: http://internal:9082

  2. Installed in the server (for the sake of not having problems with JDBC during build) Worklight Studio Enterprise 5.0.5 successfully.

  3. Imported the project into a new workspace inside Studio.

  4. Deployed worklight adapter BPMAdapter.xml successfully.

  5. Right click on the app (BPMApp) and "Build All and Deploy" successfully.

  6. Opened http://internalIP:8080/console (Development Jetty based worklight console) to see if the application deployed, and indeed it's shown in the list (Both the apps and the adapter).

  7. Tested with "Preview as common resources" to verify the application works, success.

    Now we proceed to make the adjustments to the files needed for WAS deployment:

  8. Changed the in the application-descriptor.xml file from http://${local.IPAddress}:8080 to http://internalIP:9082/worklight (this example shows the same approach http://goo.gl/xbynL)

  9. At that point we open the bin dir and copy to a folder in the desktop all the *.wlapp files and the BPMAdapter.adapter file.

  10. Now we make the changes in the worklight.properties file:

    publicWorkLightHostname=the operational hostname for the worklight server publicWorkLightProtocol=http publicWorkLightPort=9082 publicWorkLightContext=/worklight wl.db.jndi.name=jdbc/WorklightDS wl.db.type=DB2 wl.db.url=jdbc:db2:Worklight wl.db.username=wluser wl.db.password=correctpassword wl.reports.db.jndi.name=jdbc/WorklightReportsDS wl.reports.db.type=${wl.db.type} wl.reports.db.url=${wl.db.url} wl.reports.db.username=${wl.db.username} wl.reports.db.password=${wl.db.password}

  11. Saved the worklight.properties and immediately the *.war is regenerated, we copy the *.war to the deployment folder for later upload to WAS.

  12. Create in WAS the Enterprise application according to: (Infocenter for WL 5.0.5 - Deploying a customization .war file to WebSphere Application Server Full Profile) making sure that In the "Class loader order" pane, click Classes loaded with local class loader first (parent last) and In the modules section the "Class loader order" pane, click Classes loaded with local class loader first (parent last). WAR upload and start-up is successful.

  13. With the .war uploaded (context root BPMWorklight) we go in the browser to http://internalIP:9082/BPMWorklight/console/#catalog and upload the BPMApp-all.wlapp (we don't upload the other three iPhone, android or common, just the -all.wlapp) the upload is successful.

  14. We proceed to upload in http://internalIP:9082/BPMWorklight/console/#catalog the adapter BPMAdapter.adapter, we get the error "Failed to deploy adapter 'BPMAdapter.adapter'. : Procedure 'getRest' in adapter 'BPMAdapter' requires security test 'BPMAdapter-securityTest' which is not defined in authenticationConfig.xml."


回答1:


See my answer here: Failed deploying application using Worklight Console: "Failed to deploy application <appName>.wlapp'. : ERROR

Make sure that the Worklight Server version that is installed on WebSphere matches that of the Worklight Studio Eclipse plug-in used to create the .war, .wlapps and .adapter files.

In addition, make sure that:

  1. you use the same context root ("BPMWorklight") for all:

    • in application-descriptor.xml
    • in worklight.properties
    • name of the .war file
  2. you have removed the previous .war installed by default by the Worklight installation on WAS

I am getting the feeling that you have several Worklight .war files deployed and they are somehow using the wrong .war, thus not finding/using the correct authenticationConfig.xml, which could explain not finding the securityTest.

In Worklight 5.0.x, there should be only 1 Worklight .war file at a time.



来源:https://stackoverflow.com/questions/16683749/failed-to-deploy-worklight-adapter-in-worklight

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!