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?
Related
I am trying to install MFP Product version: 8.0.0.00-20170125-0919 in my QA environment on WASND 8.5.5. Server topology is, DMGR, DB, WAS are in a Private VLAN and WEB(IHS) server in public VLAN. Seems like I missed some JNDI property.
In MFP Console, I am getting the below error:
FWLSE3002E: The resource is not found.
FWLSE3030E: The runtime "mfp" does not exist in the MobileFirst administration database. The database may be corrupted.
In MFP Console - Administration DB, Live Update, and Push Service are showing inactive.
See the JNDI properties such as mfp.admin.proxy*. under "Table 4. JNDI properties for administration service: proxies" in this link : https://www.ibm.com/support/knowledgecenter/en/SSHS8R_8.0.0/com.ibm.worklight.installconfig.doc/install_config/r_wladmin_jndi_property_list.html#r_wladmin_jndi_property_list
Also verify that jmx JNDI properties are correctly set. You can find the JXM properties that needs to be set from the link : https://www.ibm.com/support/knowledgecenter/SSHS8R_8.0.0/com.ibm.worklight.installconfig.doc/install_config/c_wasnd_topol.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 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.
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'
IBM Worklight 6.0 is installed on a Liberty Profile 8.5.5 with a mySQL db. While deploying the application and trying to access the Worklight console the below error is encountered on console
Error 500: javax.servlet.ServletException: Filter[authenticationFilter]: Could not find required filter class - com.worklight.core.auth.impl.AuthenticationFilter.class
In your server.xml you need to make sure that your worklight-jee-library.jar is in the application classloader.
<application id="worklight" name="worklight" location="BMOMobileBanking.war" type="war" context-root="/worklight">
<classloader delegation="parentLast">
<commonLibrary>
<fileset dir="/my/worklight/lib" includes="worklight-jee-library.jar"/>
</commonLibrary>
</classloader>
</application>
Make sure the "/my/worklight/lib" points to the directory where this JAR is. I may suggest ${shared.resource.dir}/worklight/lib which usually translates to $WASLP_HOME/usr/shared/resources/worklight/lib
I just went through the same issue. For me the issue is related to the worklight database not existing on my server. So check if the database WRKLGHT and WLREPORT are created and they are properly configured in your server.xml.
Look at the Create and Configure the databases link on the help website here
http://pic.dhe.ibm.com/infocenter/wrklight/v6r1m0/index.jsp?topic=%2Fcom.ibm.worklight.deploy.doc%2Fdeploy%2Fc_deploy_wl_project.html
If you've ensured the worklight-jee-library.jar is in the application classloader, and you're still having the problem, then you may have an issue with the Liberty server cache.
Try: server start worklight --clean
NOTE: replace worklight with your server name