Siddhi Error connecting to JMS provider - wso2

I tried to send events from WSO2 SP to activeMQ via siddhi-io-jms extension, but i have following error. Error connecting to JMS provider. NamingException while obtaining initial context.
I have followed
this doc for support jms transporting https://docs.wso2.com/display/SP400/Supporting+Different+Transports, put all necessary jar files to lib, also I set correctly #sink in siddhi app, factory.initial and provider.url are correct. Any idea, why SP can't connect to jms?

According to OSGi JNDI spec, all the InitialContextFactories should be exposed as OSGi services. But activemq-client-5.x.x.jar file doesn't contain SPI, but rather they set system properties. This causes the NamingException while obtaining initial context. So we need to register those ICF to OSGi env.
For this we need to use the icf-provider.(sh|bat) tool within SP_HOME/bin.
This will add a BundleActivator to the user provided jar/bundle which will register the user mentioned ICF implementation according to the OSGi JNDI spec.
e.g.
./icf-provider.sh org.apache.activemq.jndi.ActiveMQInitialContextFactory <Jar Directory/activemq-client-5.9.0.jar> <Destination>
Refer https://github.com/wso2-extensions/siddhi-io-jms/

Related

WSS Support in WSO2 API Manager

I am verifying the Websocket support in WSO2 API manager for one of my requirement. By default, WSO2 API Manager provides the options for configuring "WS" protocol and able to access it. But I couldn't find any configuration for "WSS" protocol support.
Is there any limitation in WSO2 API manager or is there any documentation available?
Thanks,
Sow
WebSocket support is available by default in WSO2 API Manager. Related transport configurations should be available inside the axis2.xml configuration file. You can find related documentation in the WSO2 API Manager documentation.
https://docs.wso2.com/display/AM260/Create+a+WebSocket+API
When using wss endpoint, we were able to observe some errors and we were able to get rid of the errors with the following approach.
Please include the following parameter in the SecureWebSocketInboundEndpoint.xml file which resides in the <APIM_HOME>/repository/deployment/server/synapse-configs/default/inbound-endpoints directory.
TLSv1.1,TLSv1.2
Also, please remove the following parameters from the same SecureWebSocketInboundEndpoint.xml file if the following parameters(wss.ssl.trust.store.file and wss.ssl.trust.store.pass) exist in the file.
repository/resources/security/client-truststore.jks
wso2carbon
Please use the following sample web socket client to try out and run the WSS client. Please change the variable carbonKeyStoreLocation to point to <API-M_HOME>/repository/resources/security/wso2carbon.jks. Note that port for the WSS API is 8099.
You can download the WSS client in the following WSO2 official documentation under the WSS Support section. (In the second step.)[1] Further please change the access token, web socket endpoint and the carbonKeyStoreLocation with your one to try out the scenario.
[1] https://docs.wso2.com/display/AM260/Create+a+WebSocket+API

How to custom event adaptor in wso2 cep 4.1.0

I make plug-in to jarfile. and I copy to jarfile in dropin folder. (reference https://docs.wso2.com/display/CEP410/Building+Custom+Event+Receivers)
I execute wso2 cep. command is './wso2server.sh -DosgiConsole'. and 'osgi > ss event-adaptor-name' checked ACITVE!
but WSO2 Management web page is not exist. 'Input Event Adapter Type' of my event is not exist.
I check to 'osgi > bundle event-adaptor-id'
The result is
No registered services.
How to registerd service in WSO2 CEP?
I use eclipse, not using maven. I use plug-in project.
Exposing Custom Event Receiver as an OSGI Service section in WSO2 CEP 4.1.0 documentation gives an example as how to register the custom adapter as an OSGI service.
With reference to the same document pointed above, following is the point where the custom adapter register itself under the OutputEventAdapterFactory service.
context.getBundleContext().registerService(OutputEventAdapterFactory.class.getName(),
emailEventAdaptorFactory, null);
If it is successfully registered, you will see "osgi > bundle event-adaptor-id" result as something similar to:
osgi> bundle org.wso2.carbon.event.output.adapter.email
org.wso2.carbon.event.output.adapter.email_5.0.10 [215]
Id=215, Status=ACTIVE Data Root=/home/userx/wso2cep-4.1.0/repository/components/default/configuration/org.eclipse.osgi/bundles/215/data
"Registered Services"
{org.wso2.carbon.event.output.adapter.core.OutputEventAdapterFactory}={service.id=117}
(please note that I have not posted the complete output above, for the sake of clarity of the answer)

Can WSO2 API Manager send JMS messages to TIBCO EMS Server directly (No ESB in between)? How?

I'm trying to understand if and how is possible to send a JMS message to TIBCO EMS Server using WSO2 API Manager without using the WSO2 ESB in between.
The Pattern 1 of this article: http://wso2.com/library/articles/2015/10/article-how-to-enable-wso2-api-manager-to-work-as-a-jms-producer/ does something similar but for Apache ActiveMQ.
Is this possible? Any hint? Article?
Thanks in advance,
Gianfranco
EMS is a JMS provider like ActiveMQ.
The feature list mention : Maps between HTTP(s) and other protocols, such as JMS or writing to file systems.
You can ix the article you already have with JMS examples from the sample folder on a typical EMS installation.
I think the code will be mostly the same... but your are going to depend on jar provided inside the EMS installation.
You can follow the instructions here to configure the APIM[1] axis2.xml file.
As for placing the jars you need to do the following:
In the APIM_HOME/lib/endorsed folder delete the geronimo-jms_1.1_spec-1.1.0.wso2v1.jar
Add the jms-2.0.jar to the APIM_HOME/lib/endorsed folder
Add the tibjms.jar in the APIM_HOME/repository/components/libs folder.
[1] https://docs.wso2.com/display/Ei620/Configure+with+Tibco+EMS

WSO2 PEP Balana Framework executing in WebSphere

We plan to add a Policy Enforcement Point (PEP) into the WAS post login and transaction code handled by the WebSphere 8.5 "full" version. Our preliminary tests did throw unusual error messages, which pointed to an issue with loading of the AXIS web service classes and its belonging resource definition. The error showed up at the SSL protocol setup pointed to a missing key- and trust-store, or wrong location.
What handled the error was to change the Java class loader defaults in the browser administrative console, replacing the default PARENT-FIRST class loader behaviour, updating it to the new value of PARENT-LAST which gives preference to the web service classes directly delivered by the application. We also moved .jar libraries belonging to the Balana framework into the standard WEB_INF/lib directory. Having this updated, the application started to execute entitlement connections sending it to WSO2 IS server, interacting with the XACML PDP framework, sending and receiving XACML requests.

WSO2 ESB Identity Server and Web Service Client

I'm refering to the following article
http://wso2.com/library/articles/2010/10/using-xacml-fine-grained-authorization-wso2-platform/
I would like to use the sample echoService from the WSO2 AS over a secured proxy in WSO2 ESB in combination with the Identity Server for fine-grained authorization. All the settings mentioned on this page seem to work, however I am stuck concerning the client part. I use NetBeans and the given client code, but the .jars in the classpath there have older versions then the ones in the current version of WSO2 IS, so I started to exchange them manually. Now I get some exceptions like
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.xml.security.transforms.Transform.init()V
and I am stuck again. I just want to test the echoService in this constellation and send some string over the ESB via IS and receive the response(if I have the appropriate role) from the AS, is there not another client or how could I test it else?
Thank you!
I can suggest you 3 options:
Use SoapUI to test the service which is the easiest way to test a web service.
Generate the stub for the service and have stub as the dependency in your client. You can use the WSDL2Java tool that ship with AS. Loging to AS --> Tools in left pane --> WSDL2Java --> Provide the wsdl URL and generate the stub jar.
Generate correct dependency libs. Go to [IS-Home]/bin folder, and issue that command "ant" to run the build.xml, this will copy all required libs to [IS-HOME]/repository/lib/ folder. Have them in your class path.