Skip to content
This repository has been archived by the owner on May 10, 2022. It is now read-only.

Issue11 wsdl2rest integration #31

Merged

Conversation

bfitzpat
Copy link
Contributor

Incorporates all the latest changes to master as well as the changes proposed by @apupier for a "fat jar" version of wsdl2rest for the generator.

Signed-off-by: Brian Fitzpatrick bfitzpat@redhat.com

@bfitzpat bfitzpat requested review from apupier and lhein October 26, 2018 18:07
@bfitzpat
Copy link
Contributor Author

bfitzpat commented Oct 26, 2018

To run the generator with the additional wsdl2rest functionality, now you simply type:

> yo camel-project --wsdl2rest

This will prompt you for two additional properties:

  • ? URL to the input WSDL (requires a file URL such as file:/E:/eclipse-photon/eclipse-workspace/empty-spring/src/main/resources/META-INF/wsdl/Address.wsdl)
  • ? Name of the output directory for generated artifacts src//main//java (this is defaulted to src/main/java and will be where the generated CXF source goes from the wsdl you specify)

Unfortunately at this point, I'm not successful in getting the wsdl2rest utility to run in this manner. I see this output locally:

Creating folders
Copying files
calling: java -jar C:\Users\brianf\Documents\GitHub\generator-camel-project-fork\app\wsdl2rest\target\wsdl2rest-impl-fatjar-0.1.1-SNAPSHOT.jar -Dlog4j.configuration=file:///C:/Users/brianf/Documents/GitHub/generator-camel-project-fork/app/wsdl2rest/config/logging.properties --wsdl file:/E:/eclipse-photon/eclipse-workspace/empty-spring/src/main/resources/META-INF/wsdl/Address.wsdl --out c:\Users\brianf\Documents\demo\src\main\java --camel-context c:\Users\brianf\Documents\demo\src\main\resources\META-INF\spring\camel-context-rest.xml
   create pom.xml
   create README.md
   create src\main\resources\META-INF\spring\camel-context.xml
stderr: wsdl2rest [options...]
stderr:

stderr:  --blueprint-context PATH : Path to the generated blueprint camel context file
 --camel-context PATH     : Path to the generated spring camel context file
 --jaxrs URL              : Address of the generated jaxrs endpoint
 --jaxws URL              : Address of the target jaxws endpoint
 --out PATH               : Output path for generated artefacts (required)
 --wsdl URL               : URL to the input WSDL (required)

stderr: 1
wsdl2rest did not generate artifacts successfully - please check the log file for details

So this hints that a few things -- our logging path is off for some reason (though it correct) and the utility is not taking the passed-in details though they are specified in the command line.

I'm a bit stumped here, but at least we're making some progress. Thank you @apupier for the fat-jar fixes!

@bfitzpat
Copy link
Contributor Author

We can add some additional command-line options as well for the passed-in wsdl URL and the path for the generated Java files, but for now I thought we'd just focus on the prompt path.

@bfitzpat
Copy link
Contributor Author

Working on adding additional Mocha tests now...

test/app.js Outdated Show resolved Hide resolved
@bfitzpat
Copy link
Contributor Author

bfitzpat commented Nov 1, 2018

I've asked a question on StackOverflow to see what shakes out. I'm sure it's something simple - https://stackoverflow.com/questions/53105600/how-do-i-build-a-mocha-test-that-waits-for-a-process-to-finish-first

@bfitzpat bfitzpat force-pushed the issue11-wsdl2rest-integration branch from e5c493c to f1b5921 Compare November 7, 2018 17:21
@bfitzpat bfitzpat added DO NOT MERGE The PR is ready to go but for some reason do not merge it work in progress labels Nov 7, 2018
@bfitzpat
Copy link
Contributor Author

bfitzpat commented Nov 7, 2018

Now that we have a working test I can complete the work to get additional prompts in for optional properties. (Presuming that the test also works up on Travis)

@bfitzpat bfitzpat force-pushed the issue11-wsdl2rest-integration branch from f1b5921 to fff8c23 Compare November 14, 2018 22:56
@bfitzpat
Copy link
Contributor Author

Looks like mocha is failing with a timeout. I will investigate upping the timeout in the travis configuration.

@bfitzpat bfitzpat added READY FOR REVIEW and removed DO NOT MERGE The PR is ready to go but for some reason do not merge it work in progress labels Nov 15, 2018
Copy link
Member

@apupier apupier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Can you clean the commit history please? at least providing the combine the camel-project and wsdl2rest generators into one composed generator #11 in the commit messages so that we know to which issue all the commits are related to
  • I think it would worth to update the readme.md - Development notes as there are new steps required with maven module included (aren't they?)
  • I think that the springboot jar would be a best fit in wsdl2rest repo directly but I guess it will take too much time to integrate it in this other repo and it will give "productization" constraints. Otherwise, maybe it could be in a separate repository to avoid mixing npm and maven build system? What do you think? Having it inside this repo is the best? Or enough for a first iteration?
  • I know that the mocha test was giving hard time. I'm not sure in the test what was the missing piece to make it working? Can you explain me so that I won't hit the same wall when I will write a mocha test myself please?

will try it locally tomorrow for reviewing from a functional point of view but wanted to share initial feedback before

package.json Outdated Show resolved Hide resolved
test/app.js Outdated Show resolved Hide resolved
app/wsdl2rest/pom.xml Show resolved Hide resolved
app/wsdl2rest/pom.xml Outdated Show resolved Hide resolved
app/wsdl2rest/pom.xml Outdated Show resolved Hide resolved
@bfitzpat bfitzpat force-pushed the issue11-wsdl2rest-integration branch 4 times, most recently from 590592b to ad41322 Compare November 15, 2018 20:18
@bfitzpat
Copy link
Contributor Author

Due to some funky issues I hit with a merge of readme.md, I will handle updating the readme separately with #32

@bfitzpat
Copy link
Contributor Author

bfitzpat commented Nov 15, 2018

@apupier -- to answer your list of questions

First, there was an issue with how the wsdl2restGenerate method was calling the Java jar. Thanks to some help from Evan Shortiss, he recommended returning a Promise -- with either a resolve (success) or reject (error), and then relying on that in the test using "toPromise" to wait for the promise to resolve itself before attempting to do the asserts.

I was missing the return of the Promise from the method upstream, which meant it really didn't have anything to wait for in my test.

@bfitzpat
Copy link
Contributor Author

Once this particular PR is merged I will move on to #12 to finish the work.

bfitzpat added a commit to bfitzpat/generator-camel-project that referenced this pull request Nov 15, 2018
…ng#31

Signed-off-by: Brian Fitzpatrick <bfitzpat@redhat.com>
Copy link
Member

@apupier apupier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • why do we have stderr message?
stderr: log4j:WARN No appenders could be found for logger (org.jboss.fuse.wsdl2rest.impl.WSDLProcessorImpl).
stderr:
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

No way to fix that easily?mvn

  • if I understand well, it is generating always a Camel project and if --wsdl2rest is set, it is also generating the rest dsl file with some classes. The rest route is not used at all by default, I fear that it will lead users to confusion. The difference with the approach in Eclipse Fuse Tooling is that we are generating only the rest on an already existing Camel project which is making it more "expectable" that users will need to modify the project to take the new route into account. What do you think?

  • the generated classes are in a src/main/java/java folder. It seems that there is an extra java folder hierarchy

  • I think the summary at the end is misleading, it not listing the camel rest route, neither the Java files generated related to rest. it is mentioning only the "other artefacts" with a green "create" message.

image

app/wsdl2rest/pom.xml Outdated Show resolved Hide resolved
@bfitzpat
Copy link
Contributor Author

For now I have "skipped" the test that is not working to test that we can build, run, and access the running rest service. We will continue to work on figuring out the issues with the test, but it should not block us from getting this functionality out to our users. We can then focus on improving that functionality as we go forward.

@bfitzpat bfitzpat force-pushed the issue11-wsdl2rest-integration branch from fbfac82 to b765c4a Compare November 30, 2018 21:22
@apupier
Copy link
Member

apupier commented Dec 3, 2018

i have errors with blueprint wsdl2rest when trying to run the blueprint project:

INFO: Adding the extensions from bundle org.apache.cxf.cxf-rt-wsdl (44) [org.apache.cxf.wsdl.WSDLManager]
Unable to start bundle: org.apache.cxf.cxf-rt-transports-http [33]
org.osgi.framework.BundleException: Unable to start bundle
        at org.apache.felix.connect.PojoSRBundle.start(PojoSRBundle.java:163)
        at org.apache.felix.connect.PojoSR.startBundles(PojoSR.java:314)
        at org.apache.felix.connect.PojoSR.<init>(PojoSR.java:258)
        at org.apache.felix.connect.PojoSR.<init>(PojoSR.java:130)
        at org.apache.felix.connect.PojoServiceRegistryFactoryImpl.newPojoServiceRegistry(PojoServiceRegistryFactoryImpl.java:53)
        at org.apache.camel.test.blueprint.CamelBlueprintHelper.createBundleContext(CamelBlueprintHelper.java:198)
        at org.apache.camel.test.blueprint.CamelBlueprintHelper.createBundleContext(CamelBlueprintHelper.java:133)
        at org.apache.camel.test.blueprint.Main.createBundleContext(Main.java:144)
        at org.apache.camel.test.blueprint.Main.createBundleContext(Main.java:140)
        at org.apache.camel.test.blueprint.Main.doStart(Main.java:103)
        at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
        at org.apache.camel.main.MainSupport.run(MainSupport.java:170)
        at org.apache.camel.main.MainSupport.run(MainSupport.java:501)
        at org.apache.camel.test.blueprint.Main.main(Main.java:78)
        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.apache.camel.maven.RunMojo$1.run(RunMojo.java:519)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NoClassDefFoundError: org/osgi/service/http/HttpService
        at org.apache.cxf.transport.http.osgi.HTTPTransportActivator.start(HTTPTransportActivator.java:62)
        at org.apache.felix.connect.PojoSRBundle.start(PojoSRBundle.java:153)
        ... 19 more
Caused by: java.lang.ClassNotFoundException: org.osgi.service.http.HttpService
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 21 more
EventDispatcher: Error during dispatch.
org.osgi.framework.ServiceException: Service factory exception: org/objectweb/asm/commons/AdviceAdapterEventDispatcher: Error during dispatch.

        at org.apache.felix.connect.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:247)
EventDispatcher: Error during dispatch. at org.apache.felix.connect.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:178)

        at org.apache.felix.connect.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:323)
        at org.apache.felix.connect.PojoSRBundleContext.getService(PojoSRBundleContext.java:165)
        at org.apache.aries.blueprint.namespace.NamespaceHandlerRegistryImpl.addingService(NamespaceHandlerRegistryImpl.java:115)
        at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941)
        at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:870)
        at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)
        at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229)
        at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:901)
        at org.apache.felix.connect.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:852)
        at org.apache.felix.connect.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:775)
        at org.apache.felix.connect.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:594)
        at org.apache.felix.connect.PojoSR$1.serviceChanged(PojoSR.java:78)
        at org.apache.felix.connect.felix.framework.ServiceRegistry.registerService(ServiceRegistry.java:130)
        at org.apache.felix.connect.PojoSRBundleContext.registerService(PojoSRBundleContext.java:104)
        at org.apache.aries.blueprint.container.BlueprintContainerImpl.registerService(BlueprintContainerImpl.java:476)
        at org.apache.aries.blueprint.container.ServiceRecipe.register(ServiceRecipe.java:193)
        at org.apache.aries.blueprint.container.BlueprintContainerImpl.registerServices(BlueprintContainerImpl.java:739)
        at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:415)
        at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:278)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at org.apache.aries.blueprint.container.ExecutorServiceWrapper.run(ExecutorServiceWrapper.java:106)
        at org.apache.aries.blueprint.utils.threading.impl.DiscardableRunnable.run(DiscardableRunnable.java:45)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
        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: java.lang.NoClassDefFoundError: org/objectweb/asm/commons/AdviceAdapter
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at org.apache.aries.proxy.impl.interfaces.ProxyClassLoader.createProxyClass(ProxyClassLoader.java:153)
        at org.apache.aries.proxy.impl.interfaces.InterfaceProxyGenerator.getProxyInstance(InterfaceProxyGenerator.java:97)
        at org.apache.aries.proxy.impl.AsmProxyManager.createNewProxy(AsmProxyManager.java:80)
        at org.apache.aries.proxy.impl.AbstractProxyManager.createDelegatingInterceptingProxy(AbstractProxyManager.java:77)
        at org.apache.aries.proxy.impl.AbstractProxyManager.createInterceptingProxy(AbstractProxyManager.java:55)
        at org.apache.aries.blueprint.container.ServiceRecipe$TriggerServiceFactory.getService(ServiceRecipe.java:568)
        at org.apache.felix.connect.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:242)
        ... 31 more
Caused by: java.lang.ClassNotFoundException: org.objectweb.asm.commons.AdviceAdapter
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 49 more
org.osgi.framework.ServiceException: Service factory exception: org/objectweb/asm/commons/AdviceAdapter
        at org.apache.felix.connect.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:247)
        at org.apache.felix.connect.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:178)
        at org.apache.felix.connect.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:323)
        at org.apache.felix.connect.PojoSRBundleContext.getService(PojoSRBundleContext.java:165)
        at org.apache.aries.blueprint.namespace.NamespaceHandlerRegistryImpl.addingService(NamespaceHandlerRegistryImpl.java:115)
        at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941)
        at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:870)
        at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)
        at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229)
        at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:901)
        at org.apache.felix.connect.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:852)
        at org.apache.felix.connect.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:775)
        at org.apache.felix.connect.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:594)
        at org.apache.felix.connect.PojoSR$1.serviceChanged(PojoSR.java:78)
        at org.apache.felix.connect.felix.framework.ServiceRegistry.registerService(ServiceRegistry.java:130)
        at org.apache.felix.connect.PojoSRBundleContext.registerService(PojoSRBundleContext.java:104)
        at org.apache.aries.blueprint.container.BlueprintContainerImpl.registerService(BlueprintContainerImpl.java:476)
        at org.apache.aries.blueprint.container.ServiceRecipe.register(ServiceRecipe.java:193)
        at org.apache.aries.blueprint.container.BlueprintContainerImpl.registerServices(BlueprintContainerImpl.java:739)
        at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:415)
        at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:278)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at org.apache.aries.blueprint.container.ExecutorServiceWrapper.run(ExecutorServiceWrapper.java:106)
        at org.apache.aries.blueprint.utils.threading.impl.DiscardableRunnable.run(DiscardableRunnable.java:45)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
        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: java.lang.NoClassDefFoundError: org/objectweb/asm/commons/AdviceAdapter
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at org.apache.aries.proxy.impl.interfaces.ProxyClassLoader.createProxyClass(ProxyClassLoader.java:153)
        at org.apache.aries.proxy.impl.interfaces.InterfaceProxyGenerator.getProxyInstance(InterfaceProxyGenerator.java:97)
        at org.apache.aries.proxy.impl.AsmProxyManager.createNewProxy(AsmProxyManager.java:80)
        at org.apache.aries.proxy.impl.AbstractProxyManager.createDelegatingInterceptingProxy(AbstractProxyManager.java:77)
        at org.apache.aries.proxy.impl.AbstractProxyManager.createInterceptingProxy(AbstractProxyManager.java:55)
        at org.apache.aries.blueprint.container.ServiceRecipe$TriggerServiceFactory.getService(ServiceRecipe.java:568)
        at org.apache.felix.connect.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:242)
        ... 31 more
Caused by: java.lang.ClassNotFoundException: org.objectweb.asm.commons.AdviceAdapter
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)EventDispatcher: Error during dispatch.

        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 49 more
org.osgi.framework.ServiceException: Service factory exception: org/objectweb/asm/commons/AdviceAdapter
        at org.apache.felix.connect.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:247)
        at org.apache.felix.connect.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:178)
        at org.apache.felix.connect.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:323)
        at org.apache.felix.connect.PojoSRBundleContext.getService(PojoSRBundleContext.java:165)
        at org.apache.aries.blueprint.namespace.NamespaceHandlerRegistryImpl.addingService(NamespaceHandlerRegistryImpl.java:115)
        at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941)
        at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:870)
        at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)
        at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229)
        at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:901)
        at org.apache.felix.connect.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:852)
        at org.apache.felix.connect.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:775)
        at org.apache.felix.connect.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:594)
        at org.apache.felix.connect.PojoSR$1.serviceChanged(PojoSR.java:78)
        at org.apache.felix.connect.felix.framework.ServiceRegistry.registerService(ServiceRegistry.java:130)
        at org.apache.felix.connect.PojoSRBundleContext.registerService(PojoSRBundleContext.java:104)
        at org.apache.aries.blueprint.container.BlueprintContainerImpl.registerService(BlueprintContainerImpl.java:476)
        at org.apache.aries.blueprint.container.ServiceRecipe.register(ServiceRecipe.java:193)
        at org.apache.aries.blueprint.container.BlueprintContainerImpl.registerServices(BlueprintContainerImpl.java:739)
        at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:415)
        at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:278)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at org.apache.aries.blueprint.container.ExecutorServiceWrapper.run(ExecutorServiceWrapper.java:106)
        at org.apache.aries.blueprint.utils.threading.impl.DiscardableRunnable.run(DiscardableRunnable.java:45)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
EventDispatcher: Error during dispatch. at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)

@apupier
Copy link
Member

apupier commented Dec 3, 2018

Addressed the java DSL problem

will the tests now detect a potential regression?

@bfitzpat
Copy link
Contributor Author

bfitzpat commented Dec 3, 2018

The Mocha/Yeoman framework we are using does not handle validating each prompt as we go through them, but I can likely write a test for the potential regression. Will see what I can do about that and Blueprint.

@bfitzpat bfitzpat force-pushed the issue11-wsdl2rest-integration branch from b765c4a to aef98db Compare December 3, 2018 15:50
@bfitzpat
Copy link
Contributor Author

bfitzpat commented Dec 3, 2018

@apupier Added a test for the camel dsl validation (with and without wsdl2rest). And dropped a note to Freeman and Claus about the Blueprint issue. So far as I can tell, the pom is being created with all the required blueprint dependencies to get Felix to run. Wonder if it's a versions issue with camel?

@bfitzpat
Copy link
Contributor Author

bfitzpat commented Dec 4, 2018

I got some feedback from Freeman about running the generated Blueprint example in Standalone mode. It seems some changes would need to be made to make that happen. See this new issue I added to wsdl2rest - jboss-fuse/wsdl2rest#73

@apupier If you want to test the generated project locally, you can follow those steps to get it to run standalone and then do the same "http://localhost:8081/jaxrs/hello/%22Aurelien%22" test on it to pass through Camel to the SOAP service and back again.

So this will require some upstream changes to make it work for Blueprint in a testable capacity. What's there now should work for a deployable case (deploying to a Karaf instance), but won't work for a standalone test.

As a result, I think we can call this done for Spring, but state that Blueprint will require some additional work.

@apupier
Copy link
Member

apupier commented Dec 4, 2018

As a result, I think we can call this done for Spring, but state that Blueprint will require some additional work.

agree. i think if we put a comment in readme for now, it will be enough to move forward with this PR on this point.

@apupier
Copy link
Member

apupier commented Dec 4, 2018

there is a test which is not finishing https://travis-ci.org/camel-tooling/generator-camel-project/builds/462869962#L4053-L4058

- Should create the basic structure and CXF files for spring with an internal running WSDL url and attempt to build the project, run it, and test that the REST service is accessible
Stopped web service on http://localhost:3000/helloworldservice
  17 passing (15s)
  1 pending

it is blocked when locally launching "npm test", I guess it says "pending" on CI because there is a timeout set in the package.json

EDIT: hum it seems that it is because the test is marked as "skip" so don't understand why it blocks on my machine.
EDIT2: on my machine it is blocked on

  ```

√ Should create the basic structure
√ Should create pom.xml with default content
Should properly scaffold with default config for Blueprint
_ _
/ \ _ __ __ _ ___ | |__ ___
/ _ \ | '_ \ / | / __| | '_ \ / _ \ / ___ \ | |_) | | (_| | | (__ | | | | | __/ /_/ \_\ | .__/ \__,_| \___| |_| |_| \___| |_| ____ _ / ___| __ _ _ __ ___ ___ | | | | / _ | | ' ` _ \ / _ \ | |
| |___ | (| | | | | | | | | / | |
_
| _,| || || || ___| ||

        Camel Project Generator
             Version: 0.1.2

@bfitzpat
Copy link
Contributor Author

bfitzpat commented Dec 4, 2018

Very strange. It never gets stuck here. And it's not getting stuck on CI. Maybe do "npm link" locally to clean up any lingering code from older builds and try "npm test" again?

@bfitzpat
Copy link
Contributor Author

bfitzpat commented Dec 4, 2018

Are you sure you have rebased it? I only have

  16 passing (15s)
  1 pending

@apupier
Copy link
Member

apupier commented Dec 4, 2018

Are you sure you have rebased it? I only have

  16 passing (15s)
  1 pending

17 is from the CI

image

@apupier
Copy link
Member

apupier commented Dec 4, 2018

Very strange. Pending is the same as a skip and it never gets stuck here. Are you using "npm test" instead of just calling "mocha"?

yes, using "npm test", I would expect it to work :(

Edit: I have the same blocked test with 'mocha', also after tryign to "npm install" and "npm link"

@bfitzpat
Copy link
Contributor Author

bfitzpat commented Dec 4, 2018

My bad on the number of tests - I forgot I added a new test on my other machine and didn't sync this one. Now I get:

  17 passing (15s)
  1 pending

That said, I still have no clue why it's failing on your box. Is it possible you have a Java process that's hanging somewhere?

@apupier
Copy link
Member

apupier commented Dec 5, 2018

That said, I still have no clue why it's failing on your box. Is it possible you have a Java process that's hanging somewhere?

there are not. I don't understand why another java process would hang the test execution.

Copy link
Member

@apupier apupier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would have preferred to not put the skipped test in this PR to simplify the review.
I'm not able to launch test successfully locally anymore. It still hangs. i tried to comment several tests and it seems to happen for several of them. Consequently, I wasn't able to validate that the non-regression test about validation are working.

it is working as expected when testing manually and CI is reporting success.

it would be nice to start splitting code in different files, see #35

test/app_maven.js Outdated Show resolved Hide resolved
@bfitzpat
Copy link
Contributor Author

bfitzpat commented Dec 5, 2018

there are not. I don't understand why another java process would hang the test execution.

I have had instances where the Terminal inside (or outside) VSCode has caused a hung Java process on my Windows box. Just wanted to suggest that as a possibility. Thanks for checking.

@bfitzpat bfitzpat force-pushed the issue11-wsdl2rest-integration branch from aef98db to a33432d Compare December 5, 2018 14:04
-- initial cut with fat jar and running the wsdl2rest tool with inputs
-- updating to support full paths and a logging.props file
-- Updating version for when we include wsdl2rest functionality
-- also updating the travis file to build the wsdl2rest jar
-- additional work on test and wsdl2rest call
-- additional fixes
-- Setting jar to specific version vs asterisk and returning to broken
test
-- updates to make wsdl2rest run in a promise camel-tooling#11
-- Increasing the mocha timeout in the travis configuration camel-tooling#11
-- addressing some review feedback
-- updating tests to run with npm test call
-- reset readme.md
-- updating console messages to better reflect what's happening to user
-- adding --debug flag for wsdl2rest
-- fixing log4j issue
-- adding appropriate dependencies to pom for wsdl2rest projects
-- fixing issue when using URL to non-local WSDL
-- adding test for non-local WSDL
-- adding validation to avoid java and wsdl2rest combo
-- adding function to avoid hardcoding wsdl2rest fat jar version
-- addressing more feedback
-- fixing test for jar finding function
-- increased mocha test timeout to 15000
-- added new test that starts a sample JAX-WS web service and uses the
WSDL it serves up to create a project
-- updated helloworld wsdl and sample WS
-- added jaxws and jaxrs URL property prompts
-- fixed helloworld wsdl to generate properly
-- added new command line arguments and first test
-- removed some extraneous console messages and debug settings
-- improved wsdl2rest command line tests
-- adjusted to ensure that all wsdl2rest command line args are present
-- fixed issue with java dsl option
-- addressed more minor feedback
-- added test-in-progress to run generated service and do a get request
against it
-- more test tweaks -- attempting child_process
-- fixing issue camel-tooling#34 (missing camel-maven-plugin version for spring
projects)
-- fixing error with test soap utility
-- adding test for camel dsl validation
-- split up tests and did some test cleanup

Signed-off-by: Brian Fitzpatrick <bfitzpat@redhat.com>
@bfitzpat bfitzpat force-pushed the issue11-wsdl2rest-integration branch from a33432d to dbb4e68 Compare December 5, 2018 14:06
@bfitzpat
Copy link
Contributor Author

bfitzpat commented Dec 5, 2018

@apupier I have split up the test into three pieces -- generator_tests, wsdl2rest_tests, and utils_tests -- and removed the maven/chai testing that was skipped.

Can you give it a shot again?

@bfitzpat bfitzpat merged commit e47184f into camel-tooling:master Dec 5, 2018
bfitzpat added a commit to bfitzpat/generator-camel-project that referenced this pull request Dec 5, 2018
…ng#31

-- adding wsdl2rest details and known issues

Signed-off-by: Brian Fitzpatrick <bfitzpat@redhat.com>
bfitzpat added a commit that referenced this pull request Dec 6, 2018
-- adding wsdl2rest details and known issues

Signed-off-by: Brian Fitzpatrick <bfitzpat@redhat.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants