wso2 / msf4j

WSO2 Microservices Framework for Java (MSF4J)
http://wso2.com/products/microservices-framework-for-java/
Apache License 2.0
400 stars 349 forks source link

I can't deploy "Hello world" in wso2ei #551

Open antonioluzzi opened 5 years ago

antonioluzzi commented 5 years ago

I have tried to install "Hello world" from https://github.com/wso2/msf4j/tree/master/samples/helloworld in wso2ei, but the server return to me the following execption cause missing the Manifest entry 'microservices' :

[2018-10-25 11:17:31,513] ERROR {org.wso2.carbon.deployment.engine.internal.DeploymentEngine} - Error while deploying artifacts org.wso2.carbon.deployment.engine.exception.CarbonDeploymentException: Error while processing the artifact: /usr/lib/wso2/wso2ei/6.4.0/wso2/msf4j/deployment/microservices/helloworld-2.6.5-SNAPSHOT.jar at org.wso2.msf4j.internal.deployer.MicroservicesDeployer.deploy(MicroservicesDeployer.java:98) at org.wso2.carbon.deployment.engine.internal.DeploymentEngine.lambda$deployArtifacts$0(DeploymentEngine.java:266) at java.util.ArrayList.forEach(ArrayList.java:1257) at org.wso2.carbon.deployment.engine.internal.DeploymentEngine.deployArtifacts(DeploymentEngine.java:257) at org.wso2.carbon.deployment.engine.internal.RepositoryScanner.sweep(RepositoryScanner.java:110) at org.wso2.carbon.deployment.engine.internal.RepositoryScanner.scan(RepositoryScanner.java:68) at org.wso2.carbon.deployment.engine.internal.SchedulerTask.run(SchedulerTask.java:43) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: org.wso2.msf4j.internal.deployer.MicroserviceDeploymentException: Manifest entry 'microservices' not found: /usr/lib/wso2/wso2ei/6.4.0/wso2/msf4j/deployment/microservices/original-helloworld-2.6.5-SNAPSHOT.jar at org.wso2.msf4j.internal.deployer.MicroserviceDeploymentUtils.readManifestEntry(MicroserviceDeploymentUtils.java:107) at org.wso2.msf4j.internal.deployer.MicroserviceDeploymentUtils.getRourceInstances(MicroserviceDeploymentUtils.java:51) at org.wso2.msf4j.internal.deployer.MicroservicesDeployer.deploy(MicroservicesDeployer.java:96) ... 13 more

Can you help me? Regards Antonio

thusithathilina commented 5 years ago

@antonioluzzi AFAIK you can't deploy a standalone MSF4J application in WSO2 EI. MSF4J has another mode called deployable-jar mode. If you want to deploy an MSF4K microservice, you have to use that mode. Please refer the sample in https://github.com/wso2/msf4j/tree/master/samples/stockquote/deployable-jar

antonioluzzi commented 5 years ago

The fat version works fine, instead deployable version no :-(

ubuntu18@ubuntu18-VirtualBox:/sviluppo/msf4j/samples/stockquote/deployable-jar$ mvn install [INFO] Scanning for projects... [INFO] [INFO] --------------< org.wso2.msf4j:stockquote-deployable-jar >-------------- [INFO] Building Sample: Stockquote microservice (Deployable Jar) 2.6.5-SNAPSHOT [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- maven-checkstyle-plugin:2.17:check (validate) @ stockquote-deployable-jar --- [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 3.754 s [INFO] Finished at: 2018-10-25T12:50:27+02:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.17:check (validate) on project stockquote-deployable-jar: Failed during checkstyle execution: Unable to find suppressions file at location: https://raw.githubusercontent.com/wso2/code-quality-tools/master/checkstyle/suppressions.xml: Could not find resource 'https://raw.githubusercontent.com/wso2/code-quality-tools/master/checkstyle/suppressions.xml'. -> [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 ubuntu18@ubuntu18-VirtualBox:/sviluppo/msf4j/samples/stockquote/deployable-jar$

thusithathilina commented 5 years ago

@antonioluzzi This is a checkstyle error. Can you try disabling checkstyle and build e.g. "-Dcheckstyle.skip=true"

antonioluzzi commented 5 years ago

thanks to help me. I have succeful compiled my project : mvn install -Dcheckstyle.skip=true -Dfindbugs.skip=true but my rest service doesn't start, maybe there are some missing dependencies. My rest service use external api (apache cmis). In my standalone version, it works fine, instead of the deployable version no. I m new in ms4j and wso2ei. In my case where do I have to put all the dependencies and configuration file (application.properties)? Regards Antonio

thusithathilina commented 5 years ago

@antonioluzzi You can put all your dependencies in the pom.xml including relevant msf4j dependencies

antonioluzzi commented 5 years ago

Pardon me, but I don't understand. Can you advise me to take a look a practical example?

antonioluzzi commented 5 years ago

Can you suggest to me an example of a deployable project where I can import spring?