worklight calling service using adapter fails - ibm-mobilefirst

I am using IBM worklight I depoly it on iPhone and when I try to call a soap service using my adapter I get error that I can't understand the cause of it.
This is the log I got:
2014-06-24 20:57:26.375 myApp[842:60b] user name XXXXX
2014-06-24 20:57:26.376 myApp[842:60b] [DEBUG] [NONE] establishSSLClientAuth
2014-06-24 20:57:26.378 myApp[842:60b] WLUserAuthManager.getCertificateIdentifierFromEntity: com.worklight.userenrollment.certificate:com.myApp.dev
2014-06-24 20:57:26.381 myApp[842:60b] [DEBUG] [NONE] establishSSLClientAuth isCertificateExists: false
2014-06-24 20:57:26.383 myApp[842:60b] [DEBUG] [NONE] Request[http://192.168.23.1:10080/myApp/apps/services/api/myApp/iphone/query]
2014-06-24 20:57:26.416 myApp[842:60b] [ERROR] [NONE] [http://192.168.23.1:10080/myApp/apps/services/api/myApp/iphone/query] failure. state: 500, response: The application 'myApp' with version=1.0 does not support the iphone environment
2014-06-24 20:57:26.417 myApp[842:60b] Loading stop
2014-06-24 20:57:26.418 myApp[842:60b] MyModel::error::{"status":500,"invocationContext":null,"errorCode":"UNEXPECTED_ERROR","errorMsg":"The application 'myApp' with version=1.0 does not support the iphone environment"}
Note:
The app is deployed on Android with no problem.
Edit:
I forgot to say that I deployed the iphone app with no problem. But this message is shown when I try to call an adapter calling a web service.

As Idan stated above this error is likely due to the fact that you do not have version 1.0 of the application "myApp" deployed successfully to your Worklight Server. To accomplish this in WL Studio just right click the iPhone enviornment in the below location and do run as-> run on Worklight Development Server:
/"Project Name"/apps/myApp/iphone
Also make sure you have the correct version listed inside of your application descriptor for this specific environment. You can verify that the application has been deployed successfully by seeing the following messages inside of your console:
Deploying application 'myApp' with environment 'iphone' to Worklight
Server...
Application 'myApp' deployed successfully with environment 'iphone'
Just as a quick tip, you can also test your adapters inside of WL Studio by right-clicking the specific adapter and choosing Run As -> Invoke Worklight Procedure. Here you can choose which procedure you want to test and even include parameters into the requests

The answer of #Jaalger2 is helpful, but I made another thing with it. I am not sure that what I did is the real fix, But here is what I did.
I changed in the console this field "App Authentication:" from "Enabled, blocking" to "Enabled, servicing"

Related

MobileFirst 7.1: no registered challenge handler with key wl_sessionIndependentSupport

I encounter this error on the console logs of an iPad hybrid app built on MobileFirst Platform 7.1, when using WL.Client.connect():
2017-03-14 01:45:34.552 myApp[37732:5685087]
[ERROR] [WL_REQUEST] __43-[WLRequest processFailuresWithDictionary:]_block_invoke in WLRequest.m:694 ::
Challenge handler does not exist. There is no registered challenge handler with key wl_sessionIndependentSupport
It seems, however, wl_sessionIndependentSupport is not documented anywhere, so I have no clue on how to solve this error.
Our server is configured for session-independent mode, but I am not aware of it requiring any client-side changes.(See here, for example).

Mobilefirst 7.1 adapter call fails from a Mobile Web Application

Im working in a mobilefirst 7.1 web mobile app and a liberty server, my app works fine in my development server, but when ive deployed the same application pointing to my remoter server (with ip not a domain), but the app gives me a 403 error. my adapters has a
securityTest="wl_unprotected"
if ive run my adapter as a rest service from his url directly it runs ok.
Client log
Request [/worklight/apps/services/api/TestConexion/mobilewebapp/query]
worklight.js:5349 Application details header: {"applicationDetails":{"platformVersion":"7.1.0.0","nativeVersion":""}}WL.Logger.__log # worklight.js:5349
http://xxx.xxx.xx.xx:xxxx/worklight/apps/services/api/TestConexion/mobilewebapp/query Failed to load resource: the server responded with a status of 403 (Forbidden)
server log:
[11/4/15 11:41:16:877 ART] 0000006e com.ibm.ws.webcontainer.extension W SRVE0190E: File not found: /201509231601/login/nls/redirection.js
More Logs
Cannot find application environment, application=TestConexion, version=null, environment=mobilewebapp
Error code: 1, error description: INTERNAL_ERROR, error message: FWLSE0062E: An internal error occurred during browser request. [project worklight]Cannot find application environment, application=TestConexion, version=null, environment=mobilewebapp, User Identity {wl_directUpdateRealm=null, SubscribeServlet=null, wl_authenticityRealm=null, AuthRealm=null, wl_remoteDisableRealm=null, SampleAppRealm=null, wl_antiXSRFRealm=null, wl_deviceAutoProvisioningRealm=null, wl_deviceNoProvisioningRealm=null, FarmalinkRealm=null, WASLTPARealm=null, wl_anonymousUserRealm=null}. [project worklight]
and an error of independent mode:
FWLSE0373W: Deployment of application 'TestConexion': The server is running in session independent mode, which the environment 'mobilewebapp' does not support.
Any thoughts?
To me, this:
Deployment of application 'TestConexion': The server is running in session independent mode, which the environment 'mobilewebapp' does not support.
Tells me that you are working on Token based sessions not HTTP sessions. IF you go to your worklight.properties you can make the changes there to run with HTTP sessions.
worklight.properties is located under server>conf. The properties are:
mfp.session.independent=false
mfp.attrStore.type=HttpSession

JVMVRFY013 class loading constraint violated when using xsl on remote test server

We are having an issue with an adapter procedure that uses xsl… To isolate I created a new adapter and ran with the example procedures (getStories, getStoriesFiltered) via procedure invocation via a direct HTTP request and via a native mobile application (iOS).
“Just in case” both procedures were tested both without the securityTest attribute and with.
In the case of getStories (which has no xsl filtering) the result was returned on both the http request and the native app. This is both in the local dev WL server and when deployed to the remote WL test server.
In the case of getStoriesFiltered (which has an xsl filter) on the local dev WL server it runs fine. With the adapter deployed to the remote WL test server we get an error… details are:
Error from Invoking from a browser:
/-secure- {"errors":["Verify Error: java.lang.VerifyError: JVMVRFY013
class loading constraint violated;
class=org/apache/xalan/xsltc/dom/SAXImpl,
method=getAxisIterator(I)Lorg/apache/xml/dtm/DTMAxisIterator;,
pc=0"],"isSuccessful":false,"warnings":[],"info":[]}/
Error from invoking from a native mobile client (iOS):
2014-05-16 16:36:46.681 iOSNativeApp[1109:60b] Procedure Invocation
Failure: Invocation failure. /-secure-
{"responseID":"1","errors":["Verify Error: java.lang.VerifyError:
JVMVRFY013 class loading constraint violated;
class=org/apache/xalan/xsltc/dom/SAXImpl,
method=getAxisIterator(I)Lorg/apache/xml/dtm/DTMAxisIterator;,
pc=0"],"isSuccessful":false,"WL-Authentication-Success":{"wl_remoteDisableRealm":{"userId":"null","attributes":{},"isUserAuthenticated":1,"displayName":"null"},"wl_antiXSRFRealm":{"userId":"u9eb8v4tpofoartngepouli22q","attributes":{},"isUserAuthenticated":1,"displayName":"u9eb8v4tpofoartngepouli22q"},"wl_deviceNoProvisioningRealm":{"userId":"10C0FDF9-8537-47E7-99B3-99E41ABC7956","attributes":{"mobileClientData":"com.worklight.core.auth.ext.MobileClientData#2b13dac8"},"isUserAuthenticated":1,"displayName":"10C0FDF9-8537-47E7-99B3-99E41ABC7956"},"wl_anonymousUserRealm":{"userId":"484ed960-5aaf-48b0-a05d-166e38613d47","attributes":{},"isUserAuthenticated":1,"displayName":"484ed960-5aaf-48b0-a05d-166e38613d47"}},"warnings":[],"info":[]}/
Running Worklight on Liberty.
Please always mention your Worklight version when asking a question...
In any case, this specific error is due to a regression in recently released versions of Worklight:
5.0.6.2-IF201403101802
6.0.0.2
6.1.0.1
An iFix for 6.1.0.1 should be released shortly, with iFixes for 5.0.6.2 and 6.0.0.2 to arrive soon.
To access an iFix, login to IBM Fix Central and download the latest iFix available for your version of Worklight (released on or after May 15th)

Failed to deploy missing security Test

I have successfully gotten the module 41 sample running with eclipse and the local server. Attempting to deploy on my liberty server returns the error.
Failed to deploy application 'PushApplication-all.wlapp'. : application descriptor uses a security test:PushApplication-strong-mobile-securityTest. However, authentication config xml does not contain a security test element with that name.
I am on Worklight 5.0.5 with a successful app running on the server and now trying to add push notifications. I have checked the war file and it does contain the authentication-config.xml with the specified test.
I saw a smilier post a few momths ago but am unable to find whether it got answered
thanks in advance.
From the sound of it, you are trying to deploy your .wlapp to a server that is already running an instance of Worklight, but this instance does not have the required securityTest settings in authenticationConfig.xml
This leads me to believe that you did not replace the .war file you already had deployed in the Liberty-profile application server with the .war file from your Push Notifications project, which contains the up-to-date authenticationConfig.xml

build all and deploy error in 5.0.6

build all and deploy error in 5.0.6
--
create one empty worklight project, build all and depoy......then the error in the console as blow.......
Thanks in advance...
[2013-03-21 21:54:00] Worklight Server started successfully on localhost:8080
[2013-03-21 21:54:00] Activating Worklight project: SDMobileBank...
[2013-03-21 21:54:06] Activation failed. Bundle didn't start:D:\Worklight_workspace\SDMobileBank\bin\SDMobileBank-customization.jar
[2013-03-21 21:54:32] Activating Worklight project: SDMobileBank...
[2013-03-21 21:54:32] Worklight Server stopped successfully on localhost:8080
[2013-03-21 21:54:34] Worklight Server started successfully on localhost:8080
[2013-03-21 21:54:41] FWLSE2001I: Detected more than one IP address. Using 192.168.25.45 as the public IP address of the Worklight Server. You can set a different IP address in worklight.properties.
[2013-03-21 21:54:44] FWLSE3005I: Application raw reports are disabled.
[2013-03-21 21:54:44] FWLST0010I: ====== Started server for project SDMobileBank-project-customization; Worklight version=5.0.6.20130307-1147
[2013-03-21 21:54:44] Activation done.
[2013-03-21 21:54:48] Persistency data access problem
com.worklight.core.exceptions.DefaultExceptionHandler.handleException(DefaultExceptionHandler.java:50)
com.worklight.core.tasks.TaskThread.run(TaskThread.java:100)
[2013-03-21 21:54:51] Starting build process: application 'SDMobileBank', all environments
[2013-03-21 21:54:51] FWLSE2001I: Detected more than one IP address. Using 192.168.25.45 as the public IP address of the Worklight Server. You can set a different IP address in the application descriptor files of your applications.
[2013-03-21 21:54:53] Application 'SDMobileBank' with all environments build finished.
[2013-03-21 21:54:53] Deploying application 'SDMobileBank' with all environments to Worklight Server...
[2013-03-21 21:54:53] Persistency data access problem
com.worklight.core.exceptions.DefaultExceptionHandler.handleException(DefaultExceptionHandler.java:50)
com.worklight.core.tasks.TaskThread.run(TaskThread.java:100)
[2013-03-21 21:54:56] Application 'SDMobileBank' deployed successfully with all environments
[2013-03-21 21:54:59] Persistency data access problem
com.worklight.core.exceptions.DefaultExceptionHandler.handleException(DefaultExceptionHandler.java:50)
com.worklight.core.tasks.TaskThread.run(TaskThread.java:100)
[2013-03-21 21:55:04] Persistency data access problem
com.worklight.core.exceptions.DefaultExceptionHandler.handleException(DefaultExceptionHandler.java:50)
com.worklight.core.tasks.TaskThread.run(TaskThread.java:100)
[2013-03-21 21:55:09] Persistency data access problem
com.worklight.core.exceptions.DefaultExceptionHandler.handleException(DefaultExceptionHandler.java:50)
com.worklight.core.tasks.TaskThread.run(TaskThread.java:100)
[2013-03-21 21:55:14] Persistency data access problem
com.worklight.core.exceptions.DefaultExceptionHandler.handleException(DefaultExceptionHandler.java:50)
com.worklight.core.tasks.TaskThread.run(TaskThread.java:100)
some times ,the error..
[2013-03-21 21:43:12] user lacks privilege or object not found:
T0.MULTILANGUAGE_MESSAGES {SELECT t0.ID, t0.ACTION, t0.CREATED_TIME, t0.DOWNLOAD_LINK, t0.ENV, t0.GADGET_NAME, t0.MESSAGE, t0.MULTILANGUAGE_MESSAGES, t0.VERSION FROM APP_VERSION_ACCESS_DATA t0
WHERE (t0.GADGET_NAME = ? AND t0.ENV = ? AND t0.VERSION = ?)}
[code=-5501, state=42501]; nested exception is
<openjpa-1.2.2-r422266:898935 nonfatal general error>
org.apache.openjpa.persistence.PersistenceException:
user lacks privilege or object not found: T0.MULTILANGUAGE_MESSAGES {
SELECT t0.ID, t0.ACTION, t0.CREATED_TIME, t0.DOWNLOAD_LINK, t0.ENV, t0.GADGET_NAME, t0.MESSAGE,
t0.MULTILANGUAGE_MESSAGES, t0.VERSION FROM APP_VERSION_ACCESS_DATA t0 WHERE (t0.GADGET_NAME = ? AND t0.ENV = ? AND t0.VERSION = ?)} [code=-5501, state=42501]
The database schema has changed in v5.0.6. This should have been made clearer, and will be addressed.
Database upgrades are not supported in the Developer Edition.
To resolve this issue:
Close Eclipse
Delete the WorklightServerHome folder located in the Eclipse workspace folder.
Restart Eclipse
Build your application.
The operation should now pass without errors.