Integrate API manager with BAM, there are an exception - wso2

environment:
os: Ubuntu 12.04.2 LTS (GNU/Linux 3.5.0-23-generic x86_64)
java: 1.7.0_25
Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)
API manager: 1.4.0
BAM: 2.3.0
We follow this guide: http://docs.wso2.org/wiki/display/AM140/Monitoring+Using+WSO2+BAM
When we log in the API publisher Web in purpose of viewing the statics ,it shows an error "No data found. Check BAM server connectivity... Refer our wiki to configure BAM correctly".
And WSO2 AM appears an message:(without call stack)
ERROR - stats:jag "java.lang.NullPointerException: null
Does anyone know what reason is this?

This is due to you have not enabled the API Usage tracking from API Manager level from API manager config.
Go to ..APIM_HOME/repository/conf/ and edit the file api-manager.xml
Enable Usage tracking as below
<APIUsageTracking>
<Enabled>true</Enabled>

Related

WSO2 APIM 3.0.0 install/config problem with Publisher and Store: "invalid_callback - Registered callback does not match with the provided url"

After installing version 3.0.0 of the WSO2 API Manager I am getting errors trying to access the Publisher and the Store.
This is the error at the Store (https://myhost.my.org:9443/store)
Error 405 - Method Not Allowed
As for the Publisher, the url https://myhost.my.org:9443/publisher redirect to this url...
https://myhost.my.org:9443/authenticationendpoint/oauth2_error.do?oauthErrorCode=invalid_callback&oauthErrorMsg=Registered+callback+does+not+match+with+the+provided+url
...and displays this error message:
invalid_callback - Registered callback does not match with the provided url
Notes:
I can access the admin page just fine (https://myhost.my.org:9443/carbon)
I replaced every occurance of 'localhost' with 'myhost.my.org' in every file in .../wso2/wso2am/3.0.0/repository/conf, including 'carbon.xml'
Logs reveal the following: (.../wso2/wso2am/3.0.0/repository/logs/wso2carbon.log)
WARN {org.wso2.carbon.identity.oauth2.OAuth2Service} Provided Callback URL does not match with the provided one.
Stack:
Ubuntu 18.04
OpenJDK 11.0.4
WSO2 API Manager 3.0
Installation steps followed:
https://apim.docs.wso2.com/en/latest/GettingStarted/quick-start-guide/
Installation commands:
sudo apt install openjdk-11-jre-headless
java -version
openjdk version "11.0.4" 2019-07-16
OpenJDK Runtime Environment (build 11.0.4+11-post-Ubuntu-1ubuntu218.04.3)
OpenJDK 64-Bit Server VM (build 11.0.4+11-post-Ubuntu-1ubuntu218.04.3, mixed mode, sharing)
sudo wget https://product-dist.wso2.com/downloads/api-manager/3.0.0/downloader/wso2am-linux-installer-x64-3.0.0.deb
sudo apt install ./wso2am-linux-installer-x64-3.0.0.deb
sudo service wso2am-3.0.0 start
The installation notes refer to localhost/127.0.0.1. But I am installing on myhost.my.org.
Files manually modified in .../wso2/wso2am/3.0.0/repository/conf (replaced 'localhost' with 'myhost.my.org' and '127.0.0.1' with 'this.is.my.ip'):
api-manager.xml
broker.xml
carbon.xml
datasources.properties
deployment.toml
event-broker.xml
log4j2.properties
messaging-event-broker.xml
metrics.xml
registry.xml
thrift-authentication.xml
Any ideas? Thanks!
You have to update the callback URL in the Service Provider.
1) Go to /carbon and edit the relevant SP.
2) Edit the OAuth app in it.
You will see the callback URL like this.
regexp=(https://localhost:9443/publisher/services/auth/callback/login|https://localhost:9443/publisher/services/auth/callback/logout)
Update all occurrences of localhost with your hostname.
Save both OAuth app and SP.
About:
his is the error at the Store (https://myhost.my.org:9443/store)
Maybe you can find what you need at https://myhost.my.org:9443/devportal
If you encounter the same error with callback URL on devportal, log into Management Console, under list of Service Providers, edit admin_admin_store instead.

Is it possible to run WSO2 ESB in Openshift?

We are trying to create a WSO2 ESB cartridge to run on Openshift but haven't had much success yet. Is it even possible to run WSO2 ESB on Openshift or do we have to rely on Fuse ESB? Happy to run WSO2 either through cartridge option or just an EAR file if that's possible.
I was trying to install WSO2 ESB in an Openshift DIY cartridge. But I'm getting an port binding issue. The nasty thing is the message does not say which port it is unable to be bind into.
Please let me know if you passed this stage while trying to deploy WSO2 ESB in Openshift.
[esb3-yasas.rhcloud.com bin]> sh wso2server.sh
Starting WSO2 Carbon (in unsupported JDK) [ERROR] CARBON is
supported only on JDK 1.6 and 1.7 JAVA_HOME environment variable is
set to
/var/lib/openshift/57dca6070c1e66b48000003c/app-root/data/java/jdk1.8.0_45/
CARBON_HOME environment variable is set to
/var/lib/openshift/57dca6070c1e66b48000003c/app-root/data/esb Java
HotSpot(TM) 64-Bit Server VM warning: ignoring option
MaxPermSize=256m; support was removed in 8.0 Error: Exception thrown
by the agent : java.rmi.server.ExportException: Port already in use:
0; nested exception is:
java.net.BindException: Permission denied
Snapshot
Thanks !

can wso2 carbon 4.1 run as a web app (war)?

I'm limited to what applications I can deploy in my environment, however, standard WAR files are usually not a problem.
Can carbon 4.1.0 run as a web app?
This link describes how it can be done for carbon 3.2.2. Are these steps still valid for 4.1.0?
According to the answer in this link some functionality is limited in webapp mode for 3.2.2. What functionality is limited if 4.1.0 is deployed in webapp mode?
EDIT:
A webapp-mode folder is available in $CARBON_HOME
C:\Users\snowc\Desktop\wso2carbon-4.1.0>type webapp-mode\README.txt
Running WSO2 Carbon in Webapp mode
-------------------------------------
Standalone mode is the recommended way of running All WSO2 Carbon products. However you have the
option of running WSO2 Carbon products in Webapp mode (hosted as a web-app in an application
server).
1. The 'WEB-INF' directory contains the webapp archive
2. The 'bundles' directory contains the additional jars that needs, during the web-app mode
deployment.
Please refer the WSO2 Carbon documentation for step-by-step guide on web-app mode deployment of the
product.
"Can carbon 4.1.0 run as a web app?"
No, we stopped supporting webapp deployment in later 4.x.x carbon versions

WSO2 ESB 4.0.3 not working

I downloaded binary version for WSO2 ESB 4.0.3
Now when i run wso2server.bat , it simply executes for 2-3 seconds and quits with followin output:
>wso2server.bat
JAVA_HOME environment variable is set to D:\Java\jdk1.6.0_24
CARBON_HOME environment variable is set to D:\iprint\WSO2ES~1.3\bin\..
[2012-11-08 10:02:12,250] INFO - Main Initializing system...
[2012-11-08 10:02:12,375] INFO - HttpTransport Created Connector [HTTP_11_NIO:/
/*:9763]
[2012-11-08 10:02:12,390] INFO - HttpTransport Created Connector [HTTPS_11_NIO:
//*:9443]
[2012-11-08 10:02:12,453] INFO - TomcatCarbonWebappDeployer Deployed Carbon web
app: StandardEngine[Tomcat].StandardHost[defaulthost].StandardContext[/]
[2012-11-08 10:02:12,593] INFO - TransactionFactory Starting Atomikos Transacti
on Manager 3.7.0
>
I can not find anything in the logs as well.
The documentation also seems to be poor for 4.0.3 on wso2.org site as there is no step on how to configure DB for the ESB.
Thanks
deepak
WSO2 ESB documentation clearly specifies these information. As you are working with 4.0.3 version, this is the doc location. http://docs.wso2.org/wiki/display/ESB403
And please follow up; http://docs.wso2.org/wiki/display/ESB403/Installing+ESB+on+Windows+from+Binary+Distribution to run the ESB on windows.
Adding a db:
http://docs.wso2.org/wiki/display/ESB403/Adding+a+Database
FYI: Latest WSO2 ESB can be downloaded from http://wso2.com/products/enterprise-service-bus/
ESB 4.5.1 doc: http://docs.wso2.org/wiki/display/ESB451/Enterprise+Service+Bus+Documentation
Thanks
Thilini

How to install WSO2 products (ESB, AS, BPEL, IS) on a single Carbon platform?

I was able to install Carbon 4.0.1 with ESB and AS features installed.
However, when I try to install Identity Server and BPEL, there is an error because the Carbon core is not the same. I think there are not compatible with Carbon 4 yet.
Is there still a way to install these two products on Carbon 4.0.1?
If not and I have to install Identity Server and BPEL separately, will I encounter compatibility issues?
BPEL and Identity features for the new carbon version will be released soon under 4.0.2 release very soon. You need to use older carbon version 3.2.3 and install features using this p2 repo.If you are going to use BPEL and IS separately installed it should work.
You have to setup the Offset parameter in $CARBON_HOME/repository/conf/carbon.xml file in order to setup multiple wso2 products on the same server. For example if you want to setup ESB, BPS and IS you have to modify the installation for each of the product and specify a different offset.
Currently, we cannot configure multiple wso2 products on the same carbon platform. You can install multiple products on the same server but each of them will run in their own carbon environment.