JSON - Bluemix application in Eclipse Mars - json

I imported my Bluemix application into Eclipse. When I open it, I get a JSON error. What do I have to do to not get this error? Is there a tutorial for this?
EXAMPLE

That's not a JSON error actually. Most likely the IDE is not able to find the JSONObject class during the project build. If you leave the mouse pointer on the JSONObject class name you will read the error (actually I suggest you to enable the problems view to see all the errors: Windows->Show View->Problems).
You need to make the class JSONObject available to DemoServlet fixing the project java build path.
I guess you are using personality-insights-java. I've just tried to import it in a blank Eclipse project and I managed to build it correctly.
I am assuming that you have a local instance of Liberty server on which you want to run the application. If not see here. Go to step 2 only when you have a local working application server in Eclipse
double check that the project Java Build Path (right click on the project->Properties->Java Build Path) contains Liberty libraries (Libraries->Add Library->Server Runtime->WebSphere Application Server Liberty)
If the auto-build is not enabled, manually clean and build the project (Project->Clean)

Related

Error `Unable to find a template property named $schema.` when trying to decompile JSON into Bicep

I'm playing with Azure Bicep and I was expecting that I can take practically any ARM JSON template and translate it into Bicep. I'm intentionally using the word "translate" instead of "decompile" here, because the JSON template was not originally created with Bicep, so it was not compiled from Bicep to JSON in the first place.
I'm creating a VM deployment in the Azure Portal and when it's successfully deployed I download the JSON template (deployment.json and deployment_operations.json).
Then I run the following command:
bicep decompile deployment.json
The command fails with the following error message:
/deployment.json: Decompilation failed with fatal error "[1:1]: Unable to find a template property named $schema."
What should I do to resolve this error?
Bicep CLI version 0.13.1 (e3ac80d678).
PS The VM deployment is the simplest possible Windows Server VM with no data disks and extra features. Created via Azure Portal by clicking Next-Next-Create.
It appears that I've found the solution when writing the question. I was downloading and trying to decompile a wrong file.
The problem was that I was downloading the deployment.json file instead of an actual template file template.json. You need to click Download on the Template tab.
So instead of downloading the from the Overview tab, click the Template tab and then click Download. Or use the Save-AzResourceGroupDeploymentTemplate PowerShell cmdlet.
Similar problem, same solution: https://github.com/Azure/bicep/issues/5237

##[error]Error: NO JSON file matched with specific pattern: **/appsettings.json

I'm trying to deploy an Azure App Service using Azure Devops.
I'm using the Task Azure App Service deploy version 4.*
I started noticing the following error in the log recently with the deployment failing (saw it first on 24th September)
Applying JSON variable substitution for **/appsettings.json
##[error]Error: NO JSON file matched with specific pattern: **/appsettings.json.
In the pipeline I use the task Extract files to extract *.zip, then use the result to search for **/appsettings.json.
The same task was running fine till a few days ago.
I tried redeploying an old release which was successful earlier, but it failed now with the same above error.
I double checked, there was no changes done in the pipeline recently for this to break.
How can I fix this.
Turns out my issue was not with the task Azure App Service deploy, but with the task Extract Files.
A rough look on my pipeline is as below:
Before the fix
Extract files
Deploy Azure App Service
The JSON variable substitution failed because the Extract files task was not able to find *.zip files in the root folder and hence extracted nothing. So, there was no appsettings.json file in the folder structure at all.
The Fix
Update the Extract files task search pattern as **/*.zip
Now my pipeline looks like below.
Extract files
Deploy Azure App Service
It now works fine for me.

Unable to upload widget to Wirecloud instances in private server

We have downloaded and installed a running instance of Wirecloud in our company server following the steps at:
https://conwet.fi.upm.es/wirecloud/install
We created the instance using the --quick-start command to try the instance, and ran wirecloud using the Django internal web server with the following command:
$ python manage.py runserver 0.0.0.0:8080 --insecure
We are able to enter the instance, and move around the enviroment, but we have encountered a problem when we try to upload a widget to our local workspace. After I search for the widget in my computer (previously downloaded from the Fi-lab marketplace), we get the next message:
Error adding packaged resource: Internal Server Error.
We also tried to download the zip file of the widget from github, unzip it and recompress it as a wgt file (compress as a zip but changing the extension to .wgt) and we get the same answer from our wirecloud instance; but if we try to upload the same package to the instance in fi-lab, it uploads successfully.
We don't know if it's because of the quick-start installation we made or if we have to modify something from our widget files in order to be able to upload it to our local instance.
Solved
The problem was in the config.xml file: the name of the attributes and the structure of the widgets unable to upload were different from the template of the config.xml file posted at the users guide.
After changing it to follow the structure of the template it works fine.
My widget example was the NGSI Updater. The thing is that it uploads perfectly in the instance at FiLab, even though the config.xml file had a different structure from the one of the template; but it encounters an error when uploading it to the Wirecloud local instance at my server.

Error in importing project from OpenShift to JBoss Developer Studio

I have created a Nodejs application (sdgnodeapp) in my OpenShift domain, and was trying to import the sdgnodeapp application using OpenShift Explorer into my empty workspace in JBoss Developer Studio 7.1.1 GA .During the Import-Application workspace, I specify the git-clone-directory to be the same as my workspace-directory, JBDS then throws an error
"Could not import project to the workspace.
Invalid project description.
OK
/Users/sddasgu/SDGDevCode/Node/NodeWorkspace/sdgnodeapp overlaps the location of another project: 'sdgnodeapp'".
NOTE: If I change the git-clone directory to some other directory (not my workspace-directory), then the project is added to my workspace as expected.
I am used to creating projects inside my workspace-directory, but it seems to me in the above case, that the git-clone happens successfully, but then then the project creation fails. Is there a way to circumvent this problem ?
This is caused by there already being a directory called 'sdgnodeapp' in your eclipse workspace. Rename the existing one directory on your machine in your workspace to something different and then run the clone command again. That should fix it

WS02: error No artifacts found to be deployed in this server. Ignoring Carbon Application

Following process outlined here to create a axis service from a pojo:
Webinar: Building Applications with Carbon Studio for On-Premise and the Cloud.
I create the axis services as described in the webinar.
I did a mvn package sucessfully.
I start the WS02 ESB in eclipse sucessfully.
But when I deploy my app to the WS02 ESB, I see the following in the console:
INFO - ApplicationManager Deploying Carbon Application : MyCarbonApp-1.0.0.car...
WARN - ApplicationManager No artifacts found to be deployed in this server. Ignoring
Carbon Application : MyCarbonApp-1.0.0.car
and the service does not appear on the ESB console's web services list.
When I look at the file called MyAxisService.service I see the following:
#Contains the information about the axis2 service generation information from the eclipse workspace
#Fri May 25 15:53:09 NZST 2012
Class-name=com.unisys.comms.esbselection.MyAxisService
Type=FROM_CLASS
Service-name=MyAxisService
Projects=MyCarbonApp
What does this warning mean?
What can I do to further investigate the cause?
Is there some obvious step I've missed when creating the app?
Thanks in advance.
Please follow these steps to solve this issue.
Go to carbon.xml file locate in ....\wso2esb-4.9.0\repository\conf
Add new server role to xml elemet
EnterpriseServiceBus
ApplicationServer
Restart the server
This error means the Server Roles of the C-App Artifacts found in your Carbon Application Archive (CAR), does not match the Server Role of the ESB.
Reason is, Axis2 Web Services are by default has the Server Role of "ApplicationServer". Hence if you deploy it on the WSO2 AS, it will deploy without any problem. But in this case, you have tried to Deploy it the WSO2 ESB. Since the WSO2 ESB has the Server Role "EnterpriseServiceBus" and your Axis2 web service has the Server Role "ApplicationServer", they do not match each other. Result is the C-App deployer will ignore the C-App.
To solve this, you need to change the Server Role of your Axis2 Web Service. In order to do that, follow the steps below.
Go the C-App project you created and browse to the Axis2 Service Artifact folder in the "Artifacts" folder of the C-App.
Inside this Axis2 Service Project, you will see a file called "Artifact.xml". Open this file by double clicking on the file.
Once you double click on the file, file will be opened in the Artifact editor. Scroll the Editor down a bit.
There you will see a Drop Down next to a Label called "Server Role".
Select "EnterpriseServiceBus" option from the Drop down list and click on "Save All" button on the Eclipse Tool bar.
Go to the Servers view in Carbon Studio and click on the expand icon infront of the Carbon Server (WSO2 ESB in this case)
Once you expand the Server, you will be able to see the Server Module (C-App project) you deployed in the ESB.
Right Click on the C-App module under the ESB Server and Select "Redeploy".
Now you will see that Carbon Studio redeploy the C-App project and if you followed all the steps above correctly, your Axis2 Web Service will be deployed in the ESB.
Hope this helps!!
Thanks.
/Harshana