I have a Worklight 6.1 environment installed on a WAS ND application server profile.
My requirement is to connect to an external WebSphere MQ JMS queue manager using the Worklight JMS adapter component
I have created the necessary JMS definitions on the MQ queue manager
Connection Factory = mqWLCF
Queue Definition = TESTQ
I'm unable to get the adapter to work when installed to the Worklight environment on the WAS ND server
The connection code in the adapter xml file is -
<connectivity>
<connectionPolicy xsi:type="jms:JMSConnectionPolicyType">
<namingConnection url="tcp:/192.168.0.100:1417"
initialContextFactory="com.sun.jndi.fscontext.RefFSContextFactory"/>
<jmsConnection
connectionFactory="mqWLCF"/>
</connectionPolicy>
</connectivity>
What is the correct syntax in the adapter xml file ??
<connectivity>
<connectionPolicy xsi:type="jms:JMSConnectionPolicyType">
<namingConnection url="tcp:/127.0.0.1:61616"
initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory"
user="admin"
password="admin"/>
<jmsConnection
connectionFactory="ConnectionFactory"
user="admin"
password="admin"
/>
</connectionPolicy>
<loadConstraints maxConcurrentConnectionsPerNode="10"/>
</connectivity>
You can find more information regarding JMS adapter here:
http://public.dhe.ibm.com/software/mobile-solutions/worklight/docs/v620/04_05_JMS_adapter_-_Communicating_with_JMS.pdf
The naming connection URL and initial context factory must go hand in hand. For example, in the example you have provided, the ICF is RefFSContextFactory whereas the URL is a tcp:/ URL (this corresponds to Active MQ - as Shmulik has answered). If you do not want to use file system, then you must mention what ICF do you want to use.
You can use LDAP for which the ICF will be com.sun.jndi.ldap.LdapCtxFactory and you must have the URL as ldap://.....
Similarly, for a lookup within WAS environment, you must have an ICF com.ibm.websphere.naming.WsnInitialContextFactory and the corresponding URL.
Related
Good days
Please i am working with mobilefirst in one project which needs http adapter.
My adapter give a good answers when in run it in to mobilefirst server,but when i create an android environement and deside to run the same project in my physic android device (my android phone),this return error.
I try to get solution without reponse please help me thank you.
this is the adapter xml file :
<wl:adapter name="RSSFeed"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:wl="http://www.ibm.com/mfp/integration"
xmlns:http="http://www.ibm.com/mfp/integration/http">
<displayName>RSSFeed</displayName>
<description>RSSFeed</description>
<connectivity>
<connectionPolicy xsi:type="http:HTTPConnectionPolicyType">
<protocol>http</protocol>
<domain>www.ibm.com</domain>
<port>80</port>
<connectionTimeoutInMilliseconds>30000</connectionTimeoutInMilliseconds>
<socketTimeoutInMilliseconds>30000</socketTimeoutInMilliseconds>
<maxConcurrentConnectionsPerNode>50</maxConcurrentConnectionsPerNode>
<!-- Following properties used by adapter's key manager for choosing specific certificate from key store
<sslCertificateAlias></sslCertificateAlias>
<sslCertificatePassword></sslCertificatePassword>
-->
</connectionPolicy>
</connectivity>
<procedure name="getFeeds"/>
<procedure name="getFeedsFiltered"/>
</wl:adapter>
this is the error message :
enter image description here
this is complete error message :
enter image description here
Would've been easier had you provide basic information such as:
The error message...
The adapter XML file
Since you did not provide anything, here are some basic debugging items you should check for:
Make sure that in the adapter XML you are point in the host property to an actual IP address of the server the adapter should connect to. i.e not localhost
Make sure the device and the MobileFirst Server are connected to the same network
Print the error you receive in the client once the adapter request fails, and act upon it: http://www.ibm.com/developerworks/websphere/techjournal/1212_paris/1212_paris.html
I need to know if I can change the status of the application on Worklight Console using action file that I can run on the server.
Details:
In our production server, we need to change the status of the previous versions of the application from "Active" to "Active, Notifying" then to "Access Disabled".
This can be achieved from the WL console and we can write the notification message that will be sent to the user:
However, to avoid the "human" work on our Prod environment, we are looking to use an action file to be run on the server which will do the change.
Is this possible. Or this should be from the Console?
WL Version : 6.2.0.1
PS: We use an action file to change any property on our WebSphere server.
Action File example (Looking for something similar):
<?xml version="1.0" encoding="UTF-8"?>
<!--
Environment specific WebSphere configuration management XML file.
Warning: This file contains clear text passwords and, therefore, cannot be
distributed outside of the eCommerce group without masking the
password values.
-->
<!DOCTYPE WAS [
<!-- Environment specific parameters -->
<!ENTITY KEY_STORE_PATH "/was85/resources/security/ecommerce_bk_mobile.p12">
]>
<WAS>
<!-- Applications: Application Types: WebSphere enterprise applications -->
<Application
name="IBM_Worklight_project_runtime_MobileBanking">
<!-- Enterprise Applications > application_name > Environment entries for Web modules -->
<WebAppBinding _action="update"
description="[OPTIONAL] SSL certificate keystore location. Default: conf/default.keystore."
module="Worklight"
name="ssl.keystore.path"
uri="MobileBanking.war,WEB-INF/web.xml"
value="&KEY_STORE_PATH;"/>
</Application>
</WAS>
You cannot use "action files".
In Worklight, you can use the REST APIs services that allow you to manage... stuff, such as setting Remote Disable.
See here: http://www-01.ibm.com/support/knowledgecenter/SSZH4A_6.2.0/com.ibm.worklight.apiref.doc/apiref/c_restapi_oview.html
And specifically for Remote Disable (info and example): http://www-01.ibm.com/support/knowledgecenter/SSZH4A_6.2.0/com.ibm.worklight.apiref.doc/apiref/r_restapi_app_version_access_rule_put.html
When configuring WL HTTP Adapters, the domain and port are part of the adapter configuration .xml file build and uploaded on the WL server.
For our use case (especially beta testing and demos) the endpoint server url needs to be configurable for the end user. Example, same builds are tested by QA on test envs, while BA connects to demo.
We have only one WL Server up and setting environment specific servers is not an option.
Is it possible to change domain/hostname dynamically at application launch or runtime ? Ideally it would be to get and use the domain/hostname value from a drop down or free input from the client and use it.
<connectivity>
<connectionPolicy xsi:type="http:HTTPConnectionPolicyType">
<protocol>http</protocol>
<domain>{hostname}</domain>
<port>80</port>
</connectionPolicy>
<loadConstraints maxConcurrentConnectionsPerNode="2" />
</connectivity>
Update: This answer is useful, so I leave it here for reference, but accept that it doesn't correctly answer this question!
There is a specific Worklight feature designed to address your scenario (for the Infocenter detail, see here).
You can do this by using a combination of worklight.properties and JNDI properties.
For example, let's say you had this setup in your adapter XML:
<connectivity>
<connectionPolicy xsi:type="http:HTTPConnectionPolicyType">
<protocol>${my.adapter.protocol}</protocol>
<domain>${my.adapter.domain}</domain>
<port>${my.adapter.port}</port>
</connectionPolicy>
<loadConstraints maxConcurrentConnectionsPerNode="2" />
</connectivity>
You then define default values for these in your worklight.properties file (in the server/conf directory of your Worklight project, and "burnt in" to the .WAR file when you build it):
my.adapter.protocol=http
my.adapter.domain=some.host.com
my.adapter.port=80
You can then override these values in individual environments, by setting JNDI properties. For example, if you are using WebSphere Liberty, you might put this in your server.xml:
<jndiEntry jndiName="my.adapter.protocol" value="https"/>
<jndiEntry jndiName="my.adapter.domain" value="some.other.host.com"/>
<jndiEntry jndiName="my.adapter.port" value="8080"/>
You could create 3 adapters: 2 adapters connect to each backend servers, and one "proxy" adapter.
Your application would call the proxy adapter, passing some variable (the dropdown). Then the proxy would call one of the 2 real adapters.
You canĀ“t. An option is to use MashUps.
See:
IBM Worklight 6.1 - Can a HTTP adapter call another HTTP adapter on server-side?
http://public.dhe.ibm.com/software/mobile-solutions/worklight/docs/v620/04_11_Advanced_adapter_usage_and_mashup.pdf
The idea is to have an Adapter responding to app mobile than this adapter call other deployed adapter (QA, Test Env, Prod Env, etc) considering any logic.
I think if you override WL.Server.invokeHttp so you can specify the domain name in each request instead of using the one set in the XML file, would a good alternative . You can get the domain name as parameter in the invocation request.
There is question that may interest you regarding that, you should check it because I'm not sure if it's possible or not. Worklight Adapter Override Origin of request
I'm having a problem while trying to deploy an adapter to Worklight Console.
I figured out that the adapter which is reading the worklight.properties file does not get deployed. But an adapter that does not read the worklight.properties file is able to deploy without any problem.
I looked at the WAS log and its seems that the unsuccessful adapter deployment was actually deployed, but then they got rollbacked (undeployed) immediately.
Using Worklight 5.0.6.1 with latest iFix.
Edit:
Verified that both server and studio are using the same worklight version
The same configuration working fine in the UAT environmenet; problem happens only in the Production environment.
The Adapter XML:
<displayName>ConfigFileAdapter</displayName>
<description>ConfigFileAdapter</description>
<connectivity>
<connectionPolicy xsi:type="http:HTTPConnectionPolicyType">
<protocol>${adapter.config.protocol}</protocol>
<domain>${adapter.config.domain}</domain>
<port>${adapter.config.port}</port>
<!-- Following properties used by adapter's key manager for choosing specific certificate from key store
<sslCertificateAlias></sslCertificateAlias>
<sslCertificatePassword></sslCertificatePassword>
-->
</connectionPolicy>
<loadConstraints maxConcurrentConnectionsPerNode="30" />
</connectivity>
<procedure name="getConfigData" securityTest="adapterProtectionTest" requestTimeoutInSeconds="10" />
<procedure name="getLoggingLevel" securityTest="adapterProtectionTest" requestTimeoutInSeconds="10" />
</wl:adapter>
Logs captured in SystemOut.log:
com.worklight.integration.services.impl.DeployServiceImpl
syncAdaptersFromDB FWLSE0084I: Deployed adapter 'xxx' successfully.
com.worklight.integration.services.impl.DeployServiceImpl
deleteAdapterInternal FWLSE0039I: Deleted adapter 'xxx' successfully.
From the log the adapter were deleted immediate after deployed.
Make sure that the .war file you have deployed to the Production environment contains a worklight.properties file that contains these adapter.config.protocol/host/port properties.
In my testing the only time I could not deploy an adapter that uses custom properties from worklight.properties was when these properties did not exist in worklight.properties. When this happened I saw this error: Failed to deploy adapter 'test.adapter'. Could not resolve placeholder 'test.idan'
I have created a data source with JNDI name "jdbc/testingDS" in WAS. (test connection is successful).
I would like the SQL Adapter to connect to that data source so I have updated the adapter XML as below:
<connectionPolicy xsi:type="sql:SQLConnectionPolicy">
<dataSourceJNDIName>java:comp/env/${custom-db.1.relative-jndi-name}</dataSourceJNDIName>
</connectionPolicy>
However, there is error Procedure invocation error. Runtime: Datasource jdbc/testingDS not found in jndi. Is there any suggestion on how to set the data source with JNDI name in SQL Adapter? Thanks in advance.
EDIT:
Here is my setting in worklight.properties:
custom-db.1.relative-jndi-name=jdbc/testingDS
custom-db.1.driver=oracle.jdbc.driver.OracleDriver
custom-db.1.url=jdbc:oracle:thin:#myipaddress:1521:xe
custom-db.1.username=myusername
custom-db.1.password=mypassword
Does anyone have any other suggestions?
Environment: Worklight 5.0.6 Consumer Edition, WebSphere Application Server 8.5
Did you put your JDBC connector in the server/lib directory?