This is an automated email from the ASF dual-hosted git repository.

sijie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new 886022a  Pulsar Function localrun failed using http service url (#1870)
886022a is described below

commit 886022a87249ad0f0744dede2be2595df4be8386
Author: Sijie Guo <guosi...@gmail.com>
AuthorDate: Wed May 30 21:35:53 2018 -0700

    Pulsar Function localrun failed using http service url (#1870)
    
    *Motivation*
    
     #1849 shade the dependencies in java instance uber jar. However it
     shades the asynchttpclient to a different namespace, which causes
     following issue when running pulsar function in `localrun` mode
    
     ```
     Exception in thread “main” java.lang.NumberFormatException: null
        at java.lang.Integer.parseInt(Integer.java:542)
        at java.lang.Integer.parseInt(Integer.java:615)
        at 
org.apache.pulsar.functions.runtime.shaded.org.asynchttpclient.config.AsyncHttpClientConfigHelper$Config.getInt(AsyncHttpClientConfigHelper.java:109)
        at 
org.apache.pulsar.functions.runtime.shaded.org.asynchttpclient.config.AsyncHttpClientConfigDefaults.defaultMaxRedirects(AsyncHttpClientConfigDefaults.java:63)
        at 
org.apache.pulsar.functions.runtime.shaded.org.asynchttpclient.DefaultAsyncHttpClientConfig$Builder.<init>(DefaultAsyncHttpClientConfig.java:631)
        at org.apache.pulsar.client.impl.HttpClient.<init>(HttpClient.java:83)
        at org.apache.pulsar.client.impl.HttpClient.<init>(HttpClient.java:68)
        at 
org.apache.pulsar.client.impl.HttpLookupService.<init>(HttpLookupService.java:52)
        at 
org.apache.pulsar.client.impl.PulsarClientImpl.<init>(PulsarClientImpl.java:132)
        at 
org.apache.pulsar.client.impl.PulsarClientImpl.<init>(PulsarClientImpl.java:118)
        at 
org.apache.pulsar.client.impl.PulsarClientImpl.<init>(PulsarClientImpl.java:114)
        at 
org.apache.pulsar.client.impl.ClientBuilderImpl.build(ClientBuilderImpl.java:52)
     ```
    
     The problem is related to #389
    
    *Solution*
    
    Shade the asynchttpclient to the namespace that it has right 
`ahc.properties` file.
---
 pulsar-functions/runtime-all/pom.xml | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/pulsar-functions/runtime-all/pom.xml 
b/pulsar-functions/runtime-all/pom.xml
index 4e8d354..64e58e3 100644
--- a/pulsar-functions/runtime-all/pom.xml
+++ b/pulsar-functions/runtime-all/pom.xml
@@ -190,9 +190,14 @@
                   <pattern>org.eclipse</pattern>
                   
<shadedPattern>org.apache.pulsar.functions.runtime.shaded.org.eclipse</shadedPattern>
                 </relocation>
+                <!-- 
+                    asynchttpclient can only be shaded to be under 
`org.apache.pulsar.shade`
+                    see {@link 
https://github.com/apache/incubator-pulsar/pull/390}
+                    and {@link 
https://github.com/apache/incubator-pulsar/blob/master/pulsar-client/src/main/resources/ahc.properties}
+                -->
                 <relocation>
                   <pattern>org.asynchttpclient</pattern>
-                  
<shadedPattern>org.apache.pulsar.functions.runtime.shaded.org.asynchttpclient</shadedPattern>
+                  
<shadedPattern>org.apache.pulsar.shade.org.asynchttpclient</shadedPattern>
                 </relocation>
                 <relocation>
                   <pattern>org.bouncycastle</pattern>

-- 
To stop receiving notification emails like this one, please contact
si...@apache.org.

Reply via email to