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'
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 am running my local dev Wildfly 9.0.1 server and faced a problem that after I deploy my .war application via IntelliJ IDEA I cant open Deployments tab it says "Unable to load deployments".
And in logs there is a record:
16:20:15,868 ERROR [org.jboss.as.controller.management-operation] (XNIO-1 task-10) WFLYCTL0013: Operation ("read-attribute") failed - address: ([
("deployment" => "modules-journal"),
("subsystem" => "datasources"),
("data-source" => "java:jboss/datasources/mj2")
]) - failure description: "WFLYJCA0065: No DataSource exists at address [
(\"deployment\" => \"modules-journal\"),
(\"subsystem\" => \"datasources\"),
(\"data-source\" => \"java:jboss/datasources/mj2\")
]"
Yes, my application contains datasource definition in WEB-INF folder:
<?xml version="1.0" encoding="UTF-8"?>
<datasources xmlns="http://www.jboss.org/ironjacamar/schema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.jboss.org/ironjacamar/schema http://docs.jboss.org/ironjacamar/schema/datasources_1_0.xsd">
<!-- The datasource is bound into JNDI at this location. We reference
this in META-INF/persistence.xml -->
<datasource jndi-name="java:jboss/datasources/mj2"
pool-name="hibernate4-quickstart" enabled="true"
use-java-context="true">
<connection-url>jdbc:h2:~/test:mj2</connection-url>
<driver>h2</driver>
<security>
<user-name>test</user-name>
<password>test</password>
</security>
</datasource>
</datasources>
And my deployed application works successfully with it.
Why Wildfly Deployments tab says that "No DataSource exists" and doesn't open but my application still works?
Also everything works well if I don't use IntelliJ IDEA but deploy my app with Wildfly web interface.
Possibly it is an IntelliJ IDEA issue but it looks very strange from Wildfly side.
Could anyone explain why Wildfly reports that it doesn't see datasource when it exists and why it prevents Wildfly from loading "Deployments tab"? I missing something in how Wildfly works or it is a bug in Wildfly?
Do you see your datasource through admin interface? File-based datasource deployments are deprecated and are not available for management at runtime [1]. IDEA probably tries to check for datasource using jboss management and gets an error.
[1] http://www.mastertheboss.com/jboss-server/jboss-datasource/jboss-as-7-deployable-datasources
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.
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