Deploy Rule Service WSO2 Business Rule Server - wso2

I was trying to deploy a rule service with WSO2 Business Rule Server
I exactly followed this link
http://docs.wso2.org/wiki/display/BRS200/Creating+and+Deploying+the+Rule+Service#CreatingandDeployingtheRuleService-RuleServiceWizard
I also made the jar file from 3 different class files:
OrderAccept.class OrderReject.class and PlaceOrder.class
I am trying to deploy the server with wizard in the end I got this error
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask. runPeriodic(ScheduledThreadPoolExecutor.java:181)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.
run(ScheduledThreadPoolExecutor.java:205)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
utor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:907)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassNotFoundException: Class Not found : samples.userguide
.PlaceOrder
at org.apache.axis2.deployment.DeploymentClassLoader.findClass(Deploymen
tClassLoader.java:92)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at org.apache.axis2.deployment.DeploymentClassLoader.loadClass(Deploymen
tClassLoader.java:280)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at org.wso2.carbon.rule.common.config.HelperUtil.processFactDefaultValue
s(HelperUtil.java:43)
Anyone could help me where I might make mistakes?

It seems your jar files are not properly picked. One reason I can think of it, your axis2 archive has wrong folder structure. I am talking about the rule service upload mechanism. You may see there is a folder structure recommended in the documentation. After creating the .aar file, extract it and see whether you have the same folder structure. If it differs from the recommended one, your jar files will not get picked.

I've tried the same example and it's also giving me the same error(both methods, Rule service Upload and Rule Service Wizard). The folder structure that #Amila was suggesting seems to be ok according to the documentation. What I recently found is this link http://wso2.com/library/articles/2013/05/eclipse-plugin-wso2-business-rules-server from which I quote "Previously WSO2 BRS artifacts (aar/car) were created using the web UI rule wizard or creating the artifact by combining several artifacts. With the new WSO2 Developer Studio plug-in for rule services, one can easily create a complete deployable BRS artifact using the Eclipse IDE. Developers can easily create WSO2 BRS artifacts using this tool, and deploy it in the WSO2 Business Rules Server." What I'm guessing is that this new method/tool would substitute the "old" methods(upload and wizard). Give it a try.

Related

Error Configuring WSO2 data analytics server

I'm currently experimenting/working on WSO2. What i'm trying to do is to have Data Analytics server configured. I started by following the below specified URL
https://docs.wso2.com/display/AM210/Configuring+APIM+Analytics#9d6747f5c0074928b18599abe472987d (Quick Steps)
After performing all the steps, i get the following issue on APIM cmd prompt
YES Its pretty evident from the error that no such table exists BUT that is exactly the issue i'm facing. What could really be the cause here?
Consider the following points:
I've not followed ALL the steps mentioned on
https://docs.wso2.com/display/DAS310/Getting+Started (BUT are they
required?)
In the installation prerequisites for DAS, JDBC-compliant Connector for Java is required which I've not yet installed (BUT its not mandatory at the same time)
Most of the QUICK STEPS for the configuration of DAS in the specified URL i.e. https://docs.wso2.com/display/AM210/Configuring+APIM+Analytics#9d6747f5c0074928b18599abe472987d where already in place and i only had to
Set Up JDK, ANT, Maven
enable the analytics section in the API-M_HOME/repository/conf/api-manager.xml
add log4j.rootLogger=, DAS_AGENT to API-M_HOME/repository/conf/log4j.properties
add snappy-java_1.1.1.7.jar to DAS_HOME\repository\components\lib
Yet the issue persists, Do let me know of what you think. Thank you
Since you are following quick start guide please extract the WSO2 API Manager and the WSO2 API-M Analytics distributions (zip files), to the same directory (preferably an empty directory).
Also, you need to generate some traffic to the published APIs in order to analytics server to create this table for the first time.

Swagger with Resteasty 3 + Jetty 9.2 + JAX-RS 3

I am trying to configure an existing application to use Swagger. This application uses Resteasy 3 and Jetty 9.2 along with JAX-RS 3.
My changes are based on the explanations given on the Swagger wiki.
I have first added swagger 1.5.0 in my build.gradle before adding annotations #Api and #ApiOperation on a resource named SchedulerStateRest.
The next step was to edit my web.xml in order to hook up Swagger-Core in my Application and Initialize Swagger using Swagger's Servlet.
My issue is that when I launch my application, no resource is found when I browse /swagger.json or /swagger.yaml from http://localhost:8080. However, I get no error while starting Jetty and existing services are running and available.
I have enabled Jetty logs but I found no information relevant to me (the class in charge to launch Jetty embedded is JettyStarter).
By looking for similar problems, I found people who say that swagger content should be available at /v1/api-docs, so I tried different URLs but I always get a 404 error.
Recently, I found a gist from ben-manes for configuring swagger with Resteasy 3 + Guice 4. I tried to mimic its configuration and deduce the configuration for web.xml based on Guice-servlet explanations but I end up with the same problem as for the configuration explained above (no resource available are the expected address).
Since there is no error while starting embedded Jetty, I wonder if the issue is not related to a wrong address. Do you know how to list "resources" that are available on a Jetty instance?
I noticed that explanations on Swagger wiki are for Resteasy 2.X. Does it mean that Swagger is not compatible with Resteasy 3.x?
Ideas, suggestions, etc. to debug, solve the issue are welcome ;)
I actually figured it out yesterday. I'm going to post a sample application on git hub sometime this week since I can't find an example anywhere

developing custom WSO2 Carbon authenticator clients

I am implementing new authentication methods for WSO2 Carbon. I know there is a pretty good explanation and sample piece of code in this post.
The problem is, what if I want to generate stub and service client components from the sample BE authenticator? What are the steps to follow? Any tools (java2wsdl / wsdl2java, maven plugins,...) or reference tutorial that can help to achieve this in the most straightforward way?
I know there are several existing authenticators (IWA, webseal,...), but they already come with some stub/ui built in the existing repositories. I would be rather interested in being able to develop/generate all the components more or less from scratch rather than having to modify existing code, which is often prone to errors.
Thanks
This is some high level thing.. but hope this is useful.
1st you can develop the BE component as OSGI bundle. Then you can deploy it in /repository/components/dropins directory. Here you need to have a service.xml file to expose as web service (Please refer WebSeal BE component)
Then configure following property in the carbon.xml file.. if BE service has been defined as admin service
true
Open browser and locate your WSDL of new service
https://{ip}:{port}/services/{service name}.wsdl
Then use wsdl2java tool to create the stub class for you. There is a UI tool in WSO2AS product to do it.
Use stub as a dependency for your FE

What does wsimport do with jax-ws-catalog.xml?

All of the documentation I've found online about wsimport seems to be a little vague about one aspect of using a catalog file (jax-ws-catalog.xml). My question is:
When I generate a web service client using wsimport and the -catalog option, does wsimport only use my catalog during build time in order to find the WSDL it's using to create the web service? Or does it also somehow bundle the catalog into the generated web service so that the catalog can be used to locate resources during run time?
I'm guessing that wsimport only uses the catalog file to resolve resources during build time, and that if I want to use a catalog file to resolve resources at run time, that I have to bundle jax-ws-catalog.xml with my web client, but again, the documentation I've found so far seems a bit unclear, I'd prefer to hear this confirmed explicitly by someone who knows better.
UPDATE: I'm using a Maven plugin to generate my web service classes (http://mojo.codehaus.org/jaxws-maven-plugin/wsimport-mojo.html).
Let me know if anything in this question is unclear and I'll edit to add more information.
#dbisdorf --> yes , when you use -catalog option the with *catalog.xml file , that file is copied over to the WEB-INF or META-INF dir of the Java EE project. This will be used to lookup refernece # Runtine .If you don't wish to use it you should specify genRuntimeCatalog=false.
This is clearly documented in the following link : http://docs.oracle.com/cd/E13222_01/wls/docs103/webserv_adv/xml.html

Apache ODE BPEL Deployment with a webservice (file transfer)

I'd like to write a axis2 webservice for deploying BPEL Processes on a Apache ODE.
At the moment I have two main issues/questions.
I wrote a simple WS that creates a file.
It works fine in eclipse with a integrated apache tomcat with axis2.
But if I run the service on the exact same server without ecplise it won't work and I get 'Unhandled IOException' Errors, although I have the handling implemented (otherwise ecplise would cry about it all the time).
EDIT: I solved it by not uploading the service.aar with axis2 but putting it in the /webapps folder.
How do I get access to the folder were I need to put the BPEL files?
Is it obligatory that the service runs on the same server as the ODE?
EDIT: Getting access to the folder on the same server is an easy one with 1.
How do I transfer files with a webservice?
Better: How do I implement it?
Regarding 2) you can use the deployment API exposed by ODE. This allows for transfering deployment units (zip files containing BPELs, WSDLs, DDs) via SOAP to ODE and starting the deployment.
The WSDL is available at http://.../processes/DeploymentService?wsdl, on the default installation that would be http://localhost:8080/ode/processes/DeploymentService?wsdl