Failed to deploy worklight adapter in Worklight - deployment

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
Installed Worklight Server Enterprise 5.0.5 with DB2 databases successfully. (Worklight is working at: http://internal:9082
Installed in the server (for the sake of not having problems with JDBC during build) Worklight Studio Enterprise 5.0.5 successfully.
Imported the project into a new workspace inside Studio.
Deployed worklight adapter BPMAdapter.xml successfully.
Right click on the app (BPMApp) and "Build All and Deploy" successfully.
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).
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:
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)
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.
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}
Saved the worklight.properties and immediately the *.war is regenerated, we copy the *.war to the deployment folder for later upload to WAS.
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.
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.
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."

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:
you use the same context root ("BPMWorklight") for all:
in application-descriptor.xml
in worklight.properties
name of the .war file
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.

Related

How to deploy EAR into the WAS cluster and IBM HTTP server by Monitored Directory Deployment functionality

My goal is to automatically deploy EAR file in WebSphere Application server cluster by Monitored Directory Deployment. So my deployment target is cluster. WAS version is 9.0.0.10. Everything works fine if I drop EAR file in
monitored directory for example '/{monitored_directory_defined_in_WAS}/clusters/my_cluster_name/'. Application is deployed and started. But I also want to deploy that application into the IBM HTTP server(resides in the same WebSphere cell with cluster) in the same automatically process by Monitored Directory Deployment.
I tried to manually predefine deploymentTargets(cluster and ibm http server) in deployment.xml file, put it in the EAR file, and drop EAR in the '/{monitored_directory_defined_in_WAS}/clusters/my_cluster_name/', but WAS deploy EAR only in cluster. As a consequence I must manually via WAS console map all modules from EAR to ibm http server, but I do not want to do it manually.
My second idea/attempt was sto create separate monitored directory for the ibm http server '/{monitored_directory_defined_in_WAS}/servers/my_ibm_http_server_name/'.
First I drop EAR into the '/{monitored_directory_defined_in_WAS}/clusters/my_cluster_name/' and right after that I drop EAR in to the '/{monitored_directory_defined_in_WAS}/servers/my_ibm_http_server_name/'. Result is that the EAR modules are deployed only in to the web server, and that is not my goal.
Is that even possible by WAS Monitored Deployment Directory functionality?
Is it allowed to manually create the deployment.xml file and add it to the EAR file?
First of all installing via monitored director is not recommended in the production environments, as it lacks control.
As you correctly suspected it is not possible to install it to the cluster and web server - check Installing enterprise application files by adding them to a monitored directory.
Because you can use only one server directory, drag and drop to map
applications to combinations of servers is limited. Scenarios
requiring use of more than one server, such as mapping to an
application server and a web server, are not supported by direct drag
and drop of an application file.
However, you still want to use it, you may deploy property file into monitored directory. That property file can fully customize your deployment e.g. configuring also module to map to web server.
Check Installing enterprise application files by adding properties files to a monitored directory for more details
UPDATE
If you have issues, I'd suggest the following approach - install your application 'classically' via admin console and map it to both web server and cluster. Then run wsadmin command to extract propertes:
AdminTask.extractConfigProperties('[-propertiesFileName myApp.props -configData Deployment=MyApplication -options [[SimpleOutputFormat true]]]')
Try to use format from that exported file for your properties
I had time to run it in my environment. I have app with 2 modules inside, one module is just mapped to the cluster, other is mapped to both cluster and web server. Here is relevant part of the property file:
taskName=MapModulesToServers
row1={ module=HelloTestUI #readonly
uri=HelloTestUI.war,WEB-INF/web.xml #readonly
server=WebSphere:cell=!{cellName},cluster=!{clusterName} }
row0={ module=HelloTestWeb #readonly
uri=HelloTestWeb.war,WEB-INF/web.xml #readonly
server=WebSphere:cell=!{cellName},cluster=!{clusterName}+WebSphere:cell=!{cellName},node=!{nodeName},server=!{serverName} }
I didnt try to use that property file to deploy the app via monitored directory, but as you can see the entry is created and mapping is done via + sign that connects cluster and web server.
If you dont see the mapping to your web server, make sure you saved the changes done in the console, and then connected via wsadmin, otherwise wsadmin will have not current data.

VSTS IIS Web App Deploy fails with return 2148734720

I configured releases same way for a couple of our servers but I have issue with one of them (others work perfectly):
[error]Failed to deploy web package to IIS website.
[error]Error: C:\vstsagent\A2_work_tasks\IISWebAppDeploymentOnMachineGroup_1b467810-6725-4b6d-accd-886174c09bba\0.0.20\MSDeploy3.6\msdeploy.exe failed with return code: 2148734720
Unfortunately I can't find anything helpful related to this error Code.
My release configuration:
IIS Web App Deploy (Preview)
Deployment group with one specific staging server (I'm using on-premise agent)
Website name: correct name of my website in IIS
Virtual Application: empty field
Package of Folder: zip chosen from build drop artifacts
Selected "XML variable substitution"
Selected "Remove Additional Files at Destination"
What I've already tried with no luck:
manually turn of application
delete all files in application folder
changing user account to use for the service
Again - same configuration for other servers works fine.
Servers configuration: Windows Server 2012R2 Standard x64
Looks like I figured it out. .NET Framework 3.5 was missing on my server...
I was investigating logs and I found out that below line is causing failure.
"C:\vstsagent\A2\_work\_tasks\IISWebAppDeploymentOnMachineGroup_1b467810-6725-4b6d-accd-886174c09bba\0.0.20\MSDeploy3.6\msdeploy.exe" -verb:sync -source:package='C:\vstsagent\A2\_work\r2\a\temp_web_package_8269135298977384.zip' -dest:auto -setParam:name='IIS Web Application Name',value='httproot'
So I copied it to CMD and got proper Windows message when I tried to execute it.

IBM Worklight 6.1 - Project fails to initialize because the project database schema is from version N/A

I got the following error message when I try to deploy my .war file to the application server:
Error 500: javax.servlet.ServletException: Worklight Console
initialization failed.Logged Exception: java.lang.RuntimeException:
FWLSE0206E: The project /rmbp failed to initialize, because the
project database schema for data source
jdbc:db2://192.168.1.80:50001/APPCNTR is from version N/A, which is
not supported by the server from version 6.1.0.00.20131126-0630. Use
the Worklight ant tasks to upgrade the project database schema.
[project rmbp]
I already doing some research and ask IBM's about our issue as wellas reviewed the following similar question: IBM Worklight 6.1 - Unable to initialize the project due to DB2 error
It looks like you try to install a Worklight runtime to the APPCNTR database. This database is used for Application Center and is not related to the Worklight runtime database that is called WRKLGHT.
How do you install your Worklight war file : with the server configuration tool, the deployment ant scripts (that can be found in the configuration-samples directory of the Worklight installation) or manually ?
See http://pic.dhe.ibm.com/infocenter/wrklight/v6r1m0/index.jsp?topic=/com.ibm.worklight.deploy.doc/devref/r_ant_tasks_configure_dbs.html that explains how to configure the Worklight runtime database and deploy a Worklight runtime war file.
Have you create a jdbc connection in your Websphere Application Server?
It will be needed by the application inside the WAR file to connect to the database.
If you have done it, you can check inside your WAR file and look for web.xml file in WEB-INF/ folder. In my case I found a jdbc hardcoded inside the file, for example:
<resource-ref>
<description>Worklight Server Database</description>
<res-ref-name>jdbc/WorklightDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<resource-ref>
<description>Reports Database</description>
<res-ref-name>jdbc/WorklightReportsDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
You can rename those hardcoded file into the same name of the jdbc that you created in you WAS.
For the database issue, you can follow this link to use ant for DB creation.
http://pic.dhe.ibm.com/infocenter/wrklight/v6r1m0/index.jsp?topic=/com.ibm.worklight.deploy.doc/devref/r_ant_tasks_configure_dbs.html
If you follow the 1st ant script for DB2 creation which will have two different databases, you need to create the new user for this line if you haven't done so.
Because as you can see, in the xml script, user and password will be needed to create the WRKLGHT database. For example:
<db2 database="WRKLGHT" server="proddb.example.com"
user="wl6admin" password="wl6pass">
If you use non-default port for your DB2 connection, you can add on your port number parameter after the server parameter.
For example:
port="50001"
For user creation, u can follow this link:
http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/index.jsp?topic=%2Fcom.ibm.db2.luw.qb.server.doc%2Fdoc%2Ft0006742.html
The error message looks pretty clear to me. You seem to have upgraded your Worklight installation, but did not upgrade the database scheme used for Application Center.
You need to consult with the IBM Worklight Information Center.
Upgrading to Worklight Server V6.1.0 in a production environment
You do not mention how did you upgrade your installation to v6.1.0, nor what did you do. So take a look at the following topic as well regarding database upgrade, since as mentioned it looks like your DB2 database scheme for the APPCNTR database did not take place:
Manually upgrading the Worklight Server V6.1.0 databases

deploy a jee6 web application in glassfish v3.1.1

What things have to taken care for deploy a web appl ( war ) in glassfish v3.1.1 ( glassfish-3.1.1-web-windows.exe installer ) , the appl. is developed using netbeans 7.0.1. I am using postgresql database . Developement machine and Production machine is different and is not connected to each other. Any detailed step by step instruction ?
It all depends on what resources your application would need to run successfully on the application server.
e.g. If your application uses container managed persistence then you have to make sure that you create the required JDBC connection pool and resource on the server before you can deploy your application server. If you check the persistence.xml file you will see if your application uses some jta-datasource (the value provided there is actually the JNDI name of the JDBC resource created on the server). Here you might also have to supply the required JDBC driver to the server if it is not package within the application.
What you can do is install the same application server on your local machine and deploy the application there and see if it fails. If it fails then you can check the stacktrace to find out the reason for failure.

Deploying Websphere Portals onto a 6.1 Server

Any time I try to publish my Portal project on a Websphere Portal 6.1 Server, I get the following error message:
Portal project publishing is not supported on WebSphere Portal v6.1 Server
Is that really true or have I done something wrong?
I'm trying to deploy a portal project, with the underlying goal of publishing a new theme.
Unfortunately, any time I try to deploy, I get the error message listed above from the IDE and no errors in the console.
The RAD version is 7.0.0.7.
Not sure this will help, but:
Limitation: Although the WebSphere
Portal installer contains an advanced
option to install an empty portal,
Portal Designer relies on
administration portlets for setting
access control; therefore, publishing
a portal project to an empty portal is
not supported.
Are you trying to deploy a portlet or an entire portal project? What version of RAD are you using? Any other information in the error log? (Both within RAD & on WP server) Is the error message posted verbatim?
It is possible to deploy such a project to a WebSphere Portal. I use v6.2 and deploy portlets, which are parts of a big Portal project, every day. I'm only a starter in such a stuff, but I can say that WebSphere is really buggy. You know, it is a big difference to run a deployed app "locally, in a workspace" or "on a server". I suggest you to work out with server options - administrative console.