wso2 / msf4j Goto Github PK
View Code? Open in Web Editor NEWWSO2 Microservices Framework for Java (MSF4J)
Home Page: http://wso2.com/products/microservices-framework-for-java/
License: Apache License 2.0
WSO2 Microservices Framework for Java (MSF4J)
Home Page: http://wso2.com/products/microservices-framework-for-java/
License: Apache License 2.0
Please provide information to change default netty port (8080) when already occupied.
creating a resource with @options (javax.ws.rs) annotation gives a "405 Method Not Allowed" Response, the http OPTIONS request is not recognized.
In my case this was needed when using a AngularJS web app the browser sends an additional http OPTIONS request to check for CORS.
We can reduce the pack size if we remove the guava dependency and replace those functionalities with Java 8.
With the current hot deployment implementation, all services will always get exposed on all ports. We need a mechanism to specify that certain microservices get exposed only on certain ports.
This is an improvement for the enhancement #323
In the below abstract method password is handled as a String
protected abstract boolean authenticate(String username, String password);
mvn clean package
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building spring-helloworld 2.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.wso2.msf4j:msf4j-spring:jar:2.0.0-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.640 s
[INFO] Finished at: 2016-08-11T11:40:32+05:30
[INFO] Final Memory: 10M/185M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project spring-helloworld: Could not resolve dependencies for project org.wso2.msf4j:spring-helloworld:jar:2.0.0-SNAPSHOT: Failure to find org.wso2.msf4j:msf4j-spring:jar:2.0.0-SNAPSHOT in http://maven.wso2.org/nexus/content/repositories/releases/ was cached in the local repository, resolution will not be reattempted until the update interval of wso2.releases has elapsed or updates are forced -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
Information like file size, length etc should be accessible through the FileInfo[1].
[1]https://github.com/wso2/msf4j/blob/master/core/src/main/java/org/wso2/msf4j/formparam/FileInfo.java
i run following command "java -jar target/jpa-2.0.0-SNAPSHOT.jar" output is attached.can you help??
run.txt
Hi All,
I'm very interested with WSO2 Microservices Server (WSO2 Microservice Framework for Java), It's awesome! ^_^
I'm looking for a sample with manipulate database table (CRUD), but i can't found it. Can you add a sample with manipulate mysql database table (CURD) ? I think it would help everyone.
Thanks,
In HelloWorld example you have test url: http://localhost:8080/service/wso2 (which is invalid) while correct seems like http://localhost:8080/service
Implement a mechanism to prioritise the existing interceptors so that interceptors would execute based on a certain order defined by the developer. Interceptors without a priority defined should have a default priority.
I'm following tutorial to run Stockquote in osgi mode, but i get the error Caused by: java.lang.NoClassDefFoundError: org/springframework/aop/support/AopUtils . it's look like Spring AOP not found in msf4j-core.
1480267703564.txt
error log file attached
Hello.
We using here WSO2 DSS and identity server.
Using WebLogic too.
I should deploy the .jar to WebLogic ? or configure .war ?
Tks
please check with mail [1].
Metrics are useful, but do we have a reporter that could talk to Graphite ?
https://graphite.readthedocs.io/en/latest/
If not, how do we integrate that ? Can you update your metrics sample with one such Graphire integration too ?
Could you give us a sample using Ember.js or or other single page application(SPA) javascript framework ?
And use JWT for User Authentication.
I did the setup for sample Helloservice .
When I was giving mvn package it shows below error:
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.788 s
[INFO] Finished at: 2016-10-06T12:38:35+05:30
[INFO] Final Memory: 18M/174M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (default-compile) on project Hello-Service: Fatal error compiling: invalid target release: 1.8 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
My maven version is Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T22:11:47+05:30)
Maven home: C:\apache-maven-3.3.9-bin\apache-maven-3.3.9\bin..
Java version: 1.7.0_80, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.7.0_80\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 8.1", version: "6.3", arch: "amd64", family: "windows"
Please guide where I am wrong
Thanks ,
Sudha
In MSF4J 2.0.1-SNAPSHOT when trying to run the micro service in https as stated in docs
it gives the following error
Exception in thread "main" java.lang.NoClassDefFoundError: org/yaml/snakeyaml/Yaml
at org.wso2.carbon.transport.http.netty.config.YAMLTransportConfigurationBuilder.build(YAMLTransportConfigurationBuilder.java:49)
at org.wso2.msf4j.MicroservicesRunner.configureTransport(MicroservicesRunner.java:156)
at org.wso2.msf4j.MicroservicesRunner.(MicroservicesRunner.java:68)
at org.wso2con.backendservice.Application.main(Application.java:33)
Caused by: java.lang.ClassNotFoundException: org.yaml.snakeyaml.Yaml
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 4 more
If we return a self referential object it will throw a StackOverflowError.
We can avoid this if we use https://github.com/google/gson/blob/1d9e86e27c97cd85d898104b4ac42bb487d0d7d0/extras/src/main/java/com/google/gson/graph/GraphAdapterBuilder.java
May need to consider the performance impact of introduction though
I have a already created JSON string. But if I try to return that from a MS the framework re-serializes it.
eg:
String json = "{\"a\":\"b\"}";
return Response.ok(json, "application/json");
expected = {"a":"b"}
actual = "{\"a\":\"b\"}"
Is there a workaround to get the expected?
It seems msf4j does not support JSR 349 yet.
The following code give nulled User:
@POST
@Path("/create")
@Consumes(MediaType.APPLICATION_JSON)
public String create(@Valid User user) {
println "User: " + user
return "success"
}
I would love to see bean validation in msf4j.
Thanks!
Donny
[INFO] Reactor Summary:
[INFO]
[INFO] WSO2 MSF4J - Parent Pom ............................ SUCCESS [ 4.941 s]
[INFO] JAX-RS Delegates ................................... SUCCESS [ 8.873 s]
[INFO] WSO2 MSF4J core .................................... FAILURE [ 3.272 s]
[INFO] WSO2 MSF4J Spring .................................. SKIPPED
[INFO] MSF4J-Parent ....................................... SKIPPED
[INFO] WSO2 MSF4J Analytics ............................... SKIPPED
.
.
.
.
[INFO] Sample: PathParam with Regex ....................... SKIPPED
[INFO] WSO2 MSF4J OSGi tests .............................. SKIPPED
[INFO] msf4j .............................................. SKIPPED
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 19.355 s
[INFO] Finished at: 2016-07-18T11:21:46+05:30
[INFO] Final Memory: 49M/176M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.16:check (validate) on project msf4j-core: Failed during checkstyle execution: There are 16 errors reported by Checkstyle 6.2 with https://raw.githubusercontent.com/wso2/code-quality-tools/master/checkstyle/checkstyle.xml ruleset.
i used mvn archetype:generate -DarchetypeGroupId=org.wso2.msf4j \ -DarchetypeArtifactId=msf4j-microservice -DarchetypeVersion=1.0.0 \ -DgroupId=org.example -DartifactId=Hello-Service -Dversion=1.0.0 \ -Dpackage=org.example.service -DserviceClass=HelloService
as in quick start guidelines
Dev mailing list - "[Dev] Having base contexts for micro service based APIs running within kernal"
Hi Team!
Congratulation for the new Session Feature! ^_^
btw, could you please add "Session Store Mechanism" by using RDBMS and Redis?
I think it would help developer to make scalable microservice application. Personally, we need it for scaling our microservice application in a high availability environment.
...................................................|-----> Microservice (IP 192.168.1.2) -----|.....................................
...................................................|.................................................................|.....................................
Client ----> Load Balancer -----|.................................................................|-----> Session Storage
...................................................|.................................................................|...........(RBDMS, Redis)..
...................................................|-----> Microservice (IP 192.168.1.3) -----|.....................................
Thanks ^_^
how to use jpa module service in angularjs. i tried using #http but it didn't work.can you help me?i want to know how to use microservice in angular front end.
thank you.
When the concurrency increases, Service calls fail when doing chain internal calls.
We need to implement Websocket and Server-Sent Events (SSE) support for the MSF4J
We need to support the mode where the MSF4J service jars are copied to a directory and then a deployer deploys those services
I'm not sure if this is an issue with MSF4J but I think it probably is.
I'm running a performance test on Ubuntu 16.04.
I'm using siege 3.1.4, with the following command line
siege -b -q -c 10 -r 10000 http://localhost:8080/purchase
I have a microservice using redis as a backend. The microservice code is available:
git clone https://github.com/pzfreo/POResourceComplete
You can simply clone / mvn clean install and then run the jar , as long as you have redis running.
mvn clean install
java -jar target/POResource-1.0.0.jar
The same code also runs under Jetty/Jersey. You can build that in the same directory with
gradle shadowJar
java -jar build/libs/POResourceComplete-all.jar
When I run under MSF4J I get a lot of failures.
When I run under Jetty/Jersey it works ok.
It might still be my Linux, but its highly repeatable and only happens with the MSF4J server not the Jersey server.
Send a GZIP request to stockquote sample. This will throw HTTP 500 error. The reason is the message that gets from carbon-transport doesn't decode the request, hence MSF4J can't process the message.
Thank you.
Santos
We can use the kernel 5.2.0-SNAPSHOT based carbon kernel test container and implement OSGi test for MSF4J
I tried to add msf4j into my microservices performance benchmarks but got the following error under load. I think it must be some tuning parameters that I missed. I am wondering if someone here can help. MSF4J looks pretty good and it has potential out perform most of the microservies frameworks as it is netty based.
Here is the repo with source code.
https://github.com/networknt/light-java-example/tree/master/performance/msf4j
And the error.
2016-12-03 11:56:10 INFO MicroservicesRegistryImpl:79 - Added microservice: HelloService@26f0a63f
2016-12-03 11:56:10 INFO NettyListener:68 - Starting Netty Http Transport Listener
2016-12-03 11:56:10 INFO NettyListener:110 - Netty Listener starting on port 8080
2016-12-03 11:56:10 INFO MicroservicesRunner:193 - Microservices server started in 166ms
2016-12-03 11:56:27 ERROR WorkerPoolDispatchingSourceHandler:127 - Error occurred inside the messaging engine
java.lang.NullPointerException
at org.wso2.msf4j.internal.MSF4JMessageProcessor.receive(MSF4JMessageProcessor.java:69)
at org.wso2.carbon.transport.http.netty.listener.WorkerPoolDispatchingSourceHandler.lambda$publishToWorkerPool$12(WorkerPoolDispatchingSourceHandler.java:125)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
2016-12-03 11:56:27 ERROR WorkerPoolDispatchingSourceHandler:127 - Error occurred inside the messaging engine
java.lang.NullPointerException
at org.wso2.msf4j.internal.MSF4JMessageProcessor.receive(MSF4JMessageProcessor.java:69)
at org.wso2.carbon.transport.http.netty.listener.WorkerPoolDispatchingSourceHandler.lambda$publishToWorkerPool$12(WorkerPoolDispatchingSourceHandler.java:125)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
2016-12-03 11:56:27 ERROR WorkerPoolDispatchingSourceHandler:127 - Error occurred inside the messaging engine
java.lang.NullPointerException
at org.wso2.msf4j.internal.MSF4JMessageProcessor.receive(MSF4JMessageProcessor.java:69)
at org.wso2.carbon.transport.http.netty.listener.WorkerPoolDispatchingSourceHandler.lambda$publishToWorkerPool$12(WorkerPoolDispatchingSourceHandler.java:125)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
2016-12-03 11:56:28 ERROR WorkerPoolDispatchingSourceHandler:127 - Error occurred inside the messaging engine
java.lang.NullPointerException
at org.wso2.msf4j.internal.MSF4JMessageProcessor.receive(MSF4JMessageProcessor.java:69)
at org.wso2.carbon.transport.http.netty.listener.WorkerPoolDispatchingSourceHandler.lambda$publishToWorkerPool$12(WorkerPoolDispatchingSourceHandler.java:125)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
2016-12-03 11:56:28 ERROR WorkerPoolDispatchingSourceHandler:127 - Error occurred inside the messaging engine
java.lang.NullPointerException
at org.wso2.msf4j.internal.MSF4JMessageProcessor.receive(MSF4JMessageProcessor.java:69)
at org.wso2.carbon.transport.http.netty.listener.WorkerPoolDispatchingSourceHandler.lambda$publishToWorkerPool$12(WorkerPoolDispatchingSourceHandler.java:125)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
2016-12-03 11:56:28 ERROR WorkerPoolDispatchingSourceHandler:127 - Error occurred inside the messaging engine
java.lang.NullPointerException
at org.wso2.msf4j.internal.MSF4JMessageProcessor.receive(MSF4JMessageProcessor.java:69)
at org.wso2.carbon.transport.http.netty.listener.WorkerPoolDispatchingSourceHandler.lambda$publishToWorkerPool$12(WorkerPoolDispatchingSourceHandler.java:125)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
2016-12-03 11:56:28 ERROR WorkerPoolDispatchingSourceHandler:127 - Error occurred inside the messaging engine
java.lang.NullPointerException
at org.wso2.msf4j.internal.MSF4JMessageProcessor.receive(MSF4JMessageProcessor.java:69)
at org.wso2.carbon.transport.http.netty.listener.WorkerPoolDispatchingSourceHandler.lambda$publishToWorkerPool$12(WorkerPoolDispatchingSourceHandler.java:125)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
2016-12-03 11:56:28 ERROR WorkerPoolDispatchingSourceHandler:127 - Error occurred inside the messaging engine
java.lang.NullPointerException
at org.wso2.msf4j.internal.MSF4JMessageProcessor.receive(MSF4JMessageProcessor.java:69)
at org.wso2.carbon.transport.http.netty.listener.WorkerPoolDispatchingSourceHandler.lambda$publishToWorkerPool$12(WorkerPoolDispatchingSourceHandler.java:125)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
2016-12-03 11:56:28 ERROR WorkerPoolDispatchingSourceHandler:127 - Error occurred inside the messaging engine
java.lang.NullPointerException
at org.wso2.msf4j.internal.MSF4JMessageProcessor.receive(MSF4JMessageProcessor.java:69)
at org.wso2.carbon.transport.http.netty.listener.WorkerPoolDispatchingSourceHandler.lambda$publishToWorkerPool$12(WorkerPoolDispatchingSourceHandler.java:125)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
2016-12-03 11:56:28 ERROR WorkerPoolDispatchingSourceHandler:127 - Error occurred inside the messaging engine
java.lang.NullPointerException
at org.wso2.msf4j.internal.MSF4JMessageProcessor.receive(MSF4JMessageProcessor.java:69)
at org.wso2.carbon.transport.http.netty.listener.WorkerPoolDispatchingSourceHandler.lambda$publishToWorkerPool$12(WorkerPoolDispatchingSourceHandler.java:125)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
2016-12-03 11:56:28 ERROR WorkerPoolDispatchingSourceHandler:127 - Error occurred inside the messaging engine
java.lang.NullPointerException
at org.wso2.msf4j.internal.MSF4JMessageProcessor.receive(MSF4JMessageProcessor.java:69)
at org.wso2.carbon.transport.http.netty.listener.WorkerPoolDispatchingSourceHandler.lambda$publishToWorkerPool$12(WorkerPoolDispatchingSourceHandler.java:125)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
2016-12-03 11:56:28 ERROR WorkerPoolDispatchingSourceHandler:127 - Error occurred inside the messaging engine
java.lang.NullPointerException
at org.wso2.msf4j.internal.MSF4JMessageProcessor.receive(MSF4JMessageProcessor.java:69)
at org.wso2.carbon.transport.http.netty.listener.WorkerPoolDispatchingSourceHandler.lambda$publishToWorkerPool$12(WorkerPoolDispatchingSourceHandler.java:125)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
2016-12-03 11:56:28 ERROR WorkerPoolDispatchingSourceHandler:127 - Error occurred inside the messaging engine
java.lang.NullPointerException
at org.wso2.msf4j.internal.MSF4JMessageProcessor.receive(MSF4JMessageProcessor.java:69)
at org.wso2.carbon.transport.http.netty.listener.WorkerPoolDispatchingSourceHandler.lambda$publishToWorkerPool$12(WorkerPoolDispatchingSourceHandler.java:125)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
2016-12-03 11:56:28 ERROR WorkerPoolDispatchingSourceHandler:127 - Error occurred inside the messaging engine
java.lang.NullPointerException
at org.wso2.msf4j.internal.MSF4JMessageProcessor.receive(MSF4JMessageProcessor.java:69)
at org.wso2.carbon.transport.http.netty.listener.WorkerPoolDispatchingSourceHandler.lambda$publishToWorkerPool$12(WorkerPoolDispatchingSourceHandler.java:125)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
2016-12-03 11:56:28 ERROR WorkerPoolDispatchingSourceHandler:127 - Error occurred inside the messaging engine
java.lang.NullPointerException
at org.wso2.msf4j.internal.MSF4JMessageProcessor.receive(MSF4JMessageProcessor.java:69)
at org.wso2.carbon.transport.http.netty.listener.WorkerPoolDispatchingSourceHandler.lambda$publishToWorkerPool$12(WorkerPoolDispatchingSourceHandler.java:125)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Hi guys,
First of all I would like to congrats the team for the launching of msf4j framework. Personally I think the framework is promising. Being one of the first java microservices framework based on jax-rs (or the subset) which is JEE the facto REST API standard ...
However I found out that if you send any unhandled request to the msf4j service, the service will thrown an unhandled exception and stop working. Any subsequent request will simply ignored/rejected. Even the one with correct URL pattern which has specific handler method assigned for it.
This could be a special case which is only happen in my case only, but nevertheless I need to create a customized exception handler that could catch this unhandled exception. Within jax-rs specification, one way to achieve that is by creating a custom ExceptionMapper class.
My questions are :
Thanks in advanced.
Kind regards,
Ahmad R. Djarkasih.
It would be nice to have a global exception mapper where we can handle HTTP 500 which happen prior to service call
Hello,
I want to try the new msf4j framework but there is an error when trying to create the project with maven archetype.
It tells that archetype version 2.0.0 does not exist.
I've tried with version 1.0.0 with success but the generated code does not match the tutorial.
Regards
Samuel
Hi !
The version of msf4j in at least https://github.com/wso2/msf4j/blob/release-2.1.0/samples/spring-helloworld/pom.xml is incorrect :
org.wso2.msf4j
msf4j-spring
2.1.1-SNAPSHOT
It should point to version 2.1.0 I think.
Best regards
When there are several transports, some services are not getting registered with all the carbon transports.
can i know how check jpa service.in hello service "http://localhost:8080/hello/wso2" output was "hello wso2".like wise how can i verify that jpa module is working.........
this is not an issue.if there is any community to take help please send me that also.
thank you.
We are going to use below snippets in order to do POST request with 201 response. We want to send the Created resource location through the Response. Once we implement that we came up with below stack trace.
WARN {org.wso2.msf4j.internal.MSF4JMessageProcessor} - Unmapped exception java.lang.UnsupportedOperationException
at org.wso2.msf4j.delegates.MSF4JResponse$Builder.location(MSF4JResponse.java:334)
at javax.ws.rs.core.Response.created(Response.java:699)
at org.wso2.carbon.apimgt.rest.api.publisher.impl.ApisApiServiceImpl.apisPost(ApisApiServiceImpl.java:260)
at org.wso2.carbon.apimgt.rest.api.publisher.ApisApi.apisPost(ApisApi.java:425)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.wso2.msf4j.internal.router.HttpMethodInfo.invoke(HttpMethodInfo.java:132)
at org.wso2.msf4j.internal.MSF4JMessageProcessor.dispatchMethod(MSF4JMessageProcessor.java:130)
at org.wso2.msf4j.internal.MSF4JMessageProcessor.receive(MSF4JMessageProcessor.java:72)
at org.wso2.carbon.transport.http.netty.listener.WorkerPoolDispatchingSourceHandler.lambda$publishToWorkerPool$12(WorkerPoolDispatchingSourceHandler.java:125)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Please refer the email thread https://www.mail-archive.com/[email protected]/msg64017.html ([Dev] [C5] MSF4J Interceptors need to be configurable)
after maven new project, msf4j gennerate Application.java and MyService.java
Run Application.java and ERROR
Exception in thread "main" java.lang.NoClassDefFoundError: org/wso2/carbon/kernel/transports/CarbonTransport
at org.example.service.Application.main(Application.java:28)
Caused by: java.lang.ClassNotFoundException: org.wso2.carbon.kernel.transports.CarbonTransport
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 1 more
I have created a new project in eclipse based on the archetype as specified in the documentation. When this has been created I get the following errors in the pom.xml
file:
Multiple annotations found at this line:
- Missing artifact commons-io.wso2:commons-io:jar:2.4.0.wso2v1
- Missing artifact org.wso2.carbon.transport:org.wso2.carbon.transport.http.netty:jar:2.1.2
- Missing artifact org.wso2.carbon.messaging:org.wso2.carbon.messaging:jar:1.0.4
These packages are declared in the parent pom.
I have tried forcing an update of the snapshots as well as running maven clean install
but these fail with the same errors. I have looked in the central maven repo but can't find these packages.
I am using Eclipse neon with Java 1.8.
I want to create Filter to logging any payload request response in msf4j, but when i used @Provider to create filter, it doesn't work.
I see the below error when perf-benchmark/run-test.sh is run:
ab -k -p 1kb_rand_data.txt -c $i -n 1000000 -H "Accept:text/plain" $service
ab: wrong number of arguments
Usage: ab [options] [http[s]://]hostname[:port]/path
ApacheBench Version: 2.3 Revision: 1663405
http://172.17.8.102:30734/checkout.php - Say Cart Number, Cart CVV , etc. It must be changed to Card.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.