"Adapter deployment failed: Could not resolve placeholder" error in IBM MobileFirst 6.3 - ibm-mobilefirst

I'm unable to read a property's value from worklight.properties file.
I added property as publicProtocol=http in wroklight.properties file and used the property in my adapter.xml as <protocol>${publicProtocol}</protocol> but I'm getting the following error:
Adapter deployment failed: Could not resolve placeholder
'publicProtocol'

This works fine for me using IBM MobileFirst Platform Studio 6.3.0.00-20150214-1702
Created a new project with a HTTP adapter.
Added to server\conf\worklight.properties the following: myCustomProperty=http
The server was automatically restarted
Changed adapters\myAdapter\myAdapter.xml as follows and re-deployed the adapter:
- <protocol>http</protocol>
+ <protocol>${myCustomProperty}</protocol>
To verify that it worked I simply:
Right-click the myAdapter folder and selected Run As > Invoke MobileFirst Procedure and click on OK to invoke the default procedure.
A browser window opened with a successful invocation.

Related

Error while invoking mobilefirst adapter: Invocation of procedure failed

I am using:
Mobilefirst platform studio 6.3.0.
I have followed the IBM training modules to create a new mobilefirst adapter.
I am getting an error while trying to invoke a procedure. I have added the required JDBC driver jar file in the server/lib folder. But, I am getting this error.
[ERROR ] FWLSE0035E: Invocation of procedure 'procedure1' failed. [project pocket]
Class com.mysql.jdbc.Driver not found in Worklight platform or project /pocket
Try using mysql-connector-java-5.1.26-bin.jar in the server/lib folder as well in the build path of the project.

Changing the path for Worklight LogDirectory

I want to change the log directory to my custom path. So i have edited the server.xml like below.
<logging consoleLogLevel="OFF" copySystemStreams="false" maxFileSize="5" maxFiles="5" messageFileName="messages.log" logDirectory="/var/log" />
But once i changed and restarted the server it is not starting and throwing the below error
Launching LibertyServer (WebSphere Application Server 8.5.5.0/wlp-1.0.3.20130510-0831) on Java HotSpot(TM) 64-Bit Server VM, version 1.6.0_45-b06 (en_US)
[AUDIT ] CWWKE0001I: The server LibertyServer has been launched.
*** java.lang.instrument ASSERTION FAILED ***: "!errorOutstanding" with message transform method call failed at ../../../src/share/instrument/JPLISAgent.c line: 806
Worklight version 6.0.0.2 Liberty profile version 8.5.5.0-20130510-0831
if you need any info please comment.
Found the issue. it is the problem with the permission.
Please follow the below steps to avoid the errors.
Modify server.xml logging property like in the question.
Modifying value of ‘com.ibm.ws.logging.log.directory’ property in bootstrap.properties file to "/var/log"
Giving write permission to wladmin in folder ‘/var/log’ using the following command.
chmod -R 777 /var/log with superuser (superuser is root)

IBM Worklight 6.0 - Internal error occurred during: Worklight application builder

This is my first worklight app. I get this error when I Build All and Deploy after creating the project (without including any code):
An internal error occurred during: "Worklight application builder".
Illegal character in path at index 5: /Todo
Project/console/api/applications/upload
Create a new Worklight project or rename the current project so that there won't be any spaces in the project name. That is: "TodoProject" instead of "Todo Project". Deployment will then pass.
I have opened a defect for this. Thanks.

Error in transporting an application from development worklight to Worklight Server Consumer Edition

I am using IBM Worklight environment. I have created a small application "SampleHybridProject" using Worklight Developer studio and tested it successfully.
Now when I am trying to deploy it on the Worklight Server Consumer Edition, and hitting the following URL: http://mymachine.com:9080/SampleHybridProject/console
I am getting this error in my browser:
Error 404: com.ibm.ws.webcontainer.servlet.exception.NoTargetForURIException: No target servlet configured for uri: /SampleHybridProject/console
I am using Worklight Edition 5.0.6. The Worklight Server is default "WAS with Liberty profile".
Here are the properties that I changed in worklight.properties file.
publicWorkLightHostname=localhost
publicWorkLightProtocol=http
publicWorkLightPort=9080
publicWorkLightContext=/SampleHybridProject
wl.db.type=MYSQL
wl.db.url=jdbc:mysql://mysqlinstalledonmypc:3306/WRKLGHT
wl.db.username=root
wl.db.password=admin
Here are the changes that I made in application-descriptor.xml:
<worklightServerRootURL>http://${local.IPAddress}:9080/SampleHybridProject</worklightServerRootURL>
Can you tell me what I am doing wrong or what I need to do?
I have found the problem and solved it. The problem is I was having this error in console.log file:
Error creating bean with name 'txManager' defined in URL [jar:file:/C:/ProgramData/IBM/Worklight/WAS85liberty-server/wlp/usr/shared/resou‌​rces/lib/worklight-jee-library.jar!/conf/core.xml]: Invocation of init method failed; nested exception is java.lang.LinkageError: loader constraint violation: loader (instance of com/ibm/ws/classloading/internal/UnifiedClassLoader) previously initiated loading for a different type with name "javax/sql/DataSource"
This was because I had a jar in the server/lib folder of my project which was causing this problem. I removed the jar from server/lib folder and redeployed the .war file. Now the console is getting loaded.
Are you getting any deployment errors in your liberty logs? A 404 on the context root generally means either the WAR was not found, or the context root defaults to something other than 'SampleHybridProject'. If the WAR appears to be loading correctly, it will output where it is listening on similar to:
[AUDIT ] CWWKT0016I: Web application available (default_host): http://[hostname]:port/SampleHybridProject/*
If it says the context root is anything other than SampleHybridProject, you can set it in the tag in liberty's server.xml:
<application id="SampleHybridProject" name="SampleHybridProject"
location="SampleHybridProject.war" type="war"
context-root="SampleHybridProject">
...
</application>

cannot find EJB reference while deploying ADF Fusion Webapp into oracle weblogic server

I created a Fusion Webapplication project with Oracle jdeveloper 11g (11.1.5 but the same problem occours with the 11.2.1 version). Then I created a jsf page and I deployed the project to an external weblogic server (WL 10.3) with the ADF runtime support and evrithing where working.
Then I created the POJOs object (to the model project, because I have 2 proj: Model and ViewController for the web pages and backing beans) from the DB tables and a session bean who provides queries methods. After that (and so far everything it's ok) I added an ADF Data Control bound to the session bean and then I bound (via editor) one of these methods into the jsf page using an ADF table.
If I run the project using the run button everything work, but if I deploy it into both the external deployment WL server and in the internal one I get the following error
[05:30:04 PM] [Deployer:149193]Operation 'deploy' on application 'Prova_application1' has failed on 'AdminServer'
[05:30:04 PM] [Deployer:149034]An exception occurred for task [Deployer:149026]deploy application Prova_application1 on AdminServer.: Could not setup environment.
[05:30:04 PM] Weblogic Server Exception: weblogic.application.ModuleException: Could not setup environment
[05:30:04 PM] Caused by: weblogic.deployment.EnvironmentException: [J2EE:160167]The module Prova-ViewController-context-root in application Prova_application1 uses ejb-links but no EJB modules were found for this application.
[05:30:04 PM] See server logs or server console for more details.
[05:30:04 PM] weblogic.application.ModuleException: Could not setup environment
[05:30:04 PM] #### Deployment incomplete. ####
[05:30:04 PM] Remote deployment failed
but there is such refernce into the web.xml and I bound the Model project into the deployment descriptor. I red every post in the web but I still can't face the problem.
The web.xml in the ViewController project contains the EJB reference (automatically created from jdeveloper) and I bound everithing the Model project but it still doesn't work.
In JDeveloper IDE
you need to set ejb-jar.xml path.
- Right click on your project
- Choose Project Properties
- Go to EJB Module
- Set EJB Version (For example: "2.1")
- Set ejb-jar.xml path (For example: "..\src\META-INF\ejb-jar.xml")
I hope it works..