syndesisio / connectors

Apache Camel Connectors for Syndesis
Apache License 2.0
6 stars 12 forks source link

http-ping-example is broken #23

Closed rhuss closed 7 years ago

rhuss commented 7 years ago

when calling mvn compile exec:java in examples/http-pingcheck-example then I get the following error:

mvnDebug exec:java
Preparing to Execute Maven in Debug Mode
Listening for transport dt_socket at address: 8000
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building iPaaS Connectors :: HTTP Ping Check Example 0.2-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- exec-maven-plugin:1.5.0:java (default-cli) @ http-pingcheck-example ---
2017-03-21 11:43:25,148 [heckMain.main()] INFO  DefaultCamelContext            - Apache Camel 2.19.0-SNAPSHOT (CamelContext: camel-1) is starting
2017-03-21 11:43:25,207 [heckMain.main()] INFO  ManagedManagementStrategy      - JMX is enabled
2017-03-21 11:43:30,391 [heckMain.main()] INFO  DefaultTypeConverter           - Loaded 202 type converters
2017-03-21 11:43:33,540 [heckMain.main()] INFO  DefaultRuntimeEndpointRegistry - Runtime endpoint registry is in extended mode gathering usage statistics of all incoming and outgoing endpoints (cache limit: 1000)
2017-03-21 11:43:33,545 [heckMain.main()] INFO  DefaultCamelContext            - StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html
2017-03-21 11:43:33,556 [heckMain.main()] INFO  DefaultCamelContext            - Total 0 routes, of which 0 are started.
2017-03-21 11:43:33,567 [heckMain.main()] INFO  DefaultCamelContext            - Apache Camel 2.19.0-SNAPSHOT (CamelContext: camel-1) started in 8.518 seconds
[WARNING]
java.lang.reflect.InvocationTargetException
    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:497)
    at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:294)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.camel.RuntimeCamelException: Cannot auto create component: ipaas-http
    at org.apache.camel.impl.DefaultCamelContext.initComponent(DefaultCamelContext.java:460)
    at org.apache.camel.impl.DefaultCamelContext.lambda$getComponent$0(DefaultCamelContext.java:435)
    at org.apache.camel.impl.DefaultCamelContext$$Lambda$5/671385625.apply(Unknown Source)
    at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)
    at org.apache.camel.impl.DefaultCamelContext.getComponent(DefaultCamelContext.java:435)
    at org.apache.camel.impl.DefaultCamelContext.getComponent(DefaultCamelContext.java:426)
    at org.apache.camel.component.connector.DefaultConnectorComponent.getVerifier(DefaultConnectorComponent.java:124)
    at com.redhat.ipaas.example.HttpPingCheck.ping(HttpPingCheck.java:44)
    at com.redhat.ipaas.example.HttpPingCheckMain.main(HttpPingCheckMain.java:22)
    ... 6 more
Caused by: java.lang.IllegalArgumentException: scheme must be specified and not empty
    at org.apache.camel.util.StringHelper.notEmpty(StringHelper.java:320)
    at com.redhat.ipaas.component.HttpComponent.doStart(HttpComponent.java:41)
    at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
    at org.apache.camel.impl.DefaultCamelContext.startService(DefaultCamelContext.java:3450)
    at org.apache.camel.impl.DefaultCamelContext.initComponent(DefaultCamelContext.java:455)
    ... 14 more

The exception occurs on VerifiableComponent.getVerifier() before even the parameters (including the scheme) are provided in verify().

davsclaus commented 7 years ago

It could be an outdated Camel SNAPSHOT as there was some fixes.

Also I assumed you have built all of the connector code prior to running this example. But try again as ASF CI server has built a new SNAPSHOT of Camel with latest code.

The example works for me locally just now

davsclaus:/Users/davsclaus/workspace/connectors/examples/http-pingcheck-example (master)/$ mvn compile exec:java
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building iPaaS Connectors :: HTTP Ping Check Example 0.2-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- jacoco-maven-plugin:0.7.8:prepare-agent (default) @ http-pingcheck-example ---
[INFO] argLine set to -javaagent:/Users/davsclaus/.m2/repository/org/jacoco/org.jacoco.agent/0.7.8/org.jacoco.agent-0.7.8-runtime.jar=destfile=/Users/davsclaus/workspace/connectors/examples/http-pingcheck-example/target/jacoco.exec
[INFO]
[INFO] --- templating-maven-plugin:1.0.0:filter-sources (default) @ http-pingcheck-example ---
[INFO] Request to add '/Users/davsclaus/workspace/connectors/examples/http-pingcheck-example/src/main/java-templates' folder. Not added since it does not exist.
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ http-pingcheck-example ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ http-pingcheck-example ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- exec-maven-plugin:1.5.0:java (default-cli) @ http-pingcheck-example ---
2017-03-22 21:43:59,841 [heckMain.main()] INFO  DefaultCamelContext            - Apache Camel 2.19.0-SNAPSHOT (CamelContext: camel-1) is starting
2017-03-22 21:43:59,846 [heckMain.main()] INFO  ManagedManagementStrategy      - JMX is enabled
2017-03-22 21:44:00,071 [heckMain.main()] INFO  DefaultTypeConverter           - Loaded 202 type converters
2017-03-22 21:44:00,132 [heckMain.main()] INFO  DefaultRuntimeEndpointRegistry - Runtime endpoint registry is in extended mode gathering usage statistics of all incoming and outgoing endpoints (cache limit: 1000)
2017-03-22 21:44:00,134 [heckMain.main()] INFO  DefaultCamelContext            - StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html
2017-03-22 21:44:00,135 [heckMain.main()] INFO  DefaultCamelContext            - Total 0 routes, of which 0 are started.
2017-03-22 21:44:00,136 [heckMain.main()] INFO  DefaultCamelContext            - Apache Camel 2.19.0-SNAPSHOT (CamelContext: camel-1) started in 0.299 seconds
=============================================

Ping check result: OK

=============================================
2017-03-22 21:44:02,430 [heckMain.main()] INFO  DefaultCamelContext            - Apache Camel 2.19.0-SNAPSHOT (CamelContext: camel-1) is shutting down
2017-03-22 21:44:02,475 [heckMain.main()] INFO  DefaultCamelContext            - Apache Camel 2.19.0-SNAPSHOT (CamelContext: camel-1) uptime 2.638 seconds
2017-03-22 21:44:02,475 [heckMain.main()] INFO  DefaultCamelContext            - Apache Camel 2.19.0-SNAPSHOT (CamelContext: camel-1) is shutdown in 0.044 seconds