[jira] [Resolved] (CAMEL-12424) HTTPHelper.setCharsetFromContentType can't properly extract the charset if it isn't the last parameter

2018-04-13 Thread Claus Ibsen (JIRA)

 [ 
https://issues.apache.org/jira/browse/CAMEL-12424?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen resolved CAMEL-12424.
-
Resolution: Fixed

Thanks for reporting and providing the suggested patch

> HTTPHelper.setCharsetFromContentType can't properly extract the charset if it 
> isn't the last parameter
> --
>
> Key: CAMEL-12424
> URL: https://issues.apache.org/jira/browse/CAMEL-12424
> Project: Camel
>  Issue Type: Bug
>  Components: camel-http-common
>Affects Versions: 2.19.2
> Environment: Apache Camel 2.19.2
> Karaf 4.1.2
> JDK 1.8.0_161
>Reporter: Fabricio Guimarães Pellegrini
>Assignee: Claus Ibsen
>Priority: Major
>  Labels: easyfix
> Fix For: 2.20.4, 2.21.1, 2.22.0
>
>
> When our application recieves the Content-Type: 
> application/json;charset=utf-8;profile="http://my.company.profile.errorSchema.4.json#";,
>  the HTTPHelper sets the wrong value for the Exchange.CHARSET_NAME in the 
> Exchange.
> {quote} @SuppressWarnings("deprecation")
>      public static void setCharsetFromContentType(String contentType, 
> Exchange exchange) {
>      if (contentType != null) {
>      // find the charset and set it to the Exchange
>      int index = contentType.indexOf("charset=");
>      if (index > 0) {
>      String charset = contentType.substring(index + 8); //HERE IS 
> THE PROBLEM     exchange.setProperty(Exchange.CHARSET_NAME, 
> IOConverter.normalizeCharset(charset));     }
>     }
>      }
> {quote}
> Because of that, when the HTTPProducer tries to load the body we get the 
> following error:
> {quote}Exception: Error during type conversion from type: java.lang.String to 
> the required type: java.lang.String with value [Body is instance of 
> java.io.InputStream] due java.io.UnsupportedEncodingException: 
> utf-8;profile="http://my.company.profile.errorSchema.4.json#
>  org.apache.camel.TypeConversionException: Error during type conversion from 
> type: java.lang.String to the required type: java.lang.String with value 
> [Body is instance of java.io.InputStream] due 
> java.io.UnsupportedEncodingException: 
> utf-8;profile="http://my.company.profile.errorSchema.4.json#
>      at 
> org.apache.camel.impl.converter.BaseTypeConverterRegistry.createTypeConversionException(BaseTypeConverterRegistry.java:629)
>  [178:org.apache.camel.camel-core:2.19.2]
>      at 
> org.apache.camel.impl.converter.BaseTypeConverterRegistry.convertTo(BaseTypeConverterRegistry.java:150)
>  [178:org.apache.camel.camel-core:2.19.2]
>      at 
> org.apache.camel.core.osgi.OsgiTypeConverter.convertTo(OsgiTypeConverter.java:120)
>  [176:org.apache.camel.camel-blueprint:2.19.2]
>      at 
> org.apache.camel.component.http4.HttpProducer.populateHttpOperationFailedException(HttpProducer.java:305)
>  [182:org.apache.camel.camel-http4:2.19.2]
>      at 
> org.apache.camel.component.http4.HttpProducer.process(HttpProducer.java:207) 
> [182:org.apache.camel.camel-http4:2.19.2]
> Caused by: org.apache.camel.RuntimeCamelException: 
> java.io.UnsupportedEncodingException: 
> utf-8;profile="http://my.company.profile.errorSchema.4.json#
>      at 
> org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1774)
>  ~[?:?]
>      at 
> org.apache.camel.util.ObjectHelper.invokeMethod(ObjectHelper.java:1355) ~[?:?]
>      at 
> org.apache.camel.impl.converter.StaticMethodTypeConverter.convertTo(StaticMethodTypeConverter.java:59)
>  ~[?:?]
>      at 
> org.apache.camel.impl.converter.BaseTypeConverterRegistry.doConvertTo(BaseTypeConverterRegistry.java:306)
>  ~[?:?]
>      at 
> org.apache.camel.impl.converter.BaseTypeConverterRegistry.convertTo(BaseTypeConverterRegistry.java:133)
>  ~[?:?]
>      ... 70 more
>  Caused by: java.io.UnsupportedEncodingException: 
> utf-8;profile="http://my.company.profile.errorSchema.4.json#
>      at 
> sun.nio.cs.StreamDecoder.forInputStreamReader(StreamDecoder.java:71) ~[?:?]
>      at java.io.InputStreamReader.(InputStreamReader.java:100) 
> ~[?:?]
>      at 
> org.apache.camel.converter.IOConverter.toReader(IOConverter.java:179) ~[?:?]
>      at 
> org.apache.camel.converter.IOConverter.toString(IOConverter.java:364) ~[?:?]
>      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.util.ObjectHelper.invokeMethod(ObjectHelper.

[jira] [Resolved] (CAMEL-12395) HttpProducer cookie handling broken

2018-04-13 Thread Claus Ibsen (JIRA)

 [ 
https://issues.apache.org/jira/browse/CAMEL-12395?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen resolved CAMEL-12395.
-
Resolution: Fixed
  Assignee: Claus Ibsen

Thanks for reporting and the suggested patch

> HttpProducer cookie handling broken
> ---
>
> Key: CAMEL-12395
> URL: https://issues.apache.org/jira/browse/CAMEL-12395
> Project: Camel
>  Issue Type: Bug
>  Components: camel-http
>Affects Versions: 2.20.2
>Reporter: Kevin Brooks
>Assignee: Claus Ibsen
>Priority: Minor
> Fix For: 2.20.4, 2.21.1, 2.22.0
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Assumptions from https://tools.ietf.org/html/rfc6265
> When a host response contains multiple headers with the same key, each with 
> different values, the HttpProducer overwrites the value, effectively 
> last-in-wins, extracted problem code below
> {code:java}
> protected void populateResponse(Exchange exchange, HttpRequestBase 
> httpRequest, HttpResponse httpResponse,
> Message in, HeaderFilterStrategy strategy, int responseCode) throws 
> IOException, ClassNotFoundException {
>   ...
>   // propagate HTTP response headers
>   Header[] headers = httpResponse.getAllHeaders();
>   Map> m = new HashMap>();
>   for (Header header : headers) {
> String name = header.getName();
> String value = header.getValue();
> m.put(name, Collections.singletonList(value)); //<--- This is the problem
> if (name.toLowerCase().equals("content-type")) {
>   name = Exchange.CONTENT_TYPE;
>   exchange.setProperty(Exchange.CHARSET_NAME, 
> IOHelper.getCharsetNameFromContentType(value));
> }
> // use http helper to extract parameter value as it may contain multiple 
> values
> Object extracted = HttpHelper.extractHttpParameterValue(value);
> if (strategy != null && !strategy.applyFilterToExternalHeaders(name, 
> extracted, exchange)) {
>  HttpHelper.appendHeader(answer.getHeaders(), name, extracted);
> }
>   }
>   // handle cookies
>   if (getEndpoint().getCookieHandler() != null) {
>   //if host responded with multiple Set-Cookie headers, only last cookie is 
> presented
>   getEndpoint().getCookieHandler().storeCookies(exchange, 
> httpRequest.getURI(), m);
>   }
> ...
> {code}
> A simple fix ->
> {code:java}
> ...
> for (Header header : headers) {
>   String name = header.getName();
>   String value = header.getValue();
>   List values = m.computeIfAbsent(name, k -> new 
> ArrayList<>()).add(value);
> ...
> {code}
> On the flip side, when the client responds, the cookies pulled from the 
> handler are not formatted correctly, broken code snippet from 
> HttpProducer.process()
> {code:java}
> if (getEndpoint().getCookieHandler() != null) {
> Map> cookieHeaders = 
> getEndpoint().getCookieHandler().loadCookies(exchange, httpRequest.getURI());
> for (Map.Entry> entry : 
> cookieHeaders.entrySet()) {
> String key = entry.getKey();
> if (entry.getValue().size() > 0) {
> // use the default toString of a ArrayList to create in 
> the form [xxx, yyy]
> // if multi valued, for a single value, then just output 
> the value as is
> String s = entry.getValue().size() > 1 ? 
> entry.getValue().toString() : entry.getValue().get(0);//<--- This is a problem
> httpRequest.addHeader(key, s);
> }
> }
> }
> {code}
> This can be fixed simply
> {code:java}
> if (getEndpoint().getCookieHandler() != null) {
> Map> cookieHeaders = 
> getEndpoint().getCookieHandler().loadCookies(exchange, httpRequest.getURI());
> for (Map.Entry> entry : 
> cookieHeaders.entrySet()) {
> String key = entry.getKey();
> if (entry.getValue().size() > 0) {
> httpRequest.addHeader(key, 
> entry.getValue().stream().collect(Collectors.joining(";"))); //semi-colon, 
> not comma...
> }
> }
> }
> {code}
> Additionally, the CookieHandler.loadCookies method is not properly 
> constructing the Cookie values, as it calls HttpCookie.toString - which 
> represents the host's _Set-Cookie_ value, not the client's _Cookie_ value



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Resolved] (CAMEL-12100) Camel Hystrix component should be transparent for exceptions while `closed` and not using fallback

2018-04-13 Thread Claus Ibsen (JIRA)

 [ 
https://issues.apache.org/jira/browse/CAMEL-12100?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen resolved CAMEL-12100.
-
Resolution: Incomplete

> Camel Hystrix component should be transparent for exceptions while `closed` 
> and not using fallback 
> ---
>
> Key: CAMEL-12100
> URL: https://issues.apache.org/jira/browse/CAMEL-12100
> Project: Camel
>  Issue Type: Improvement
>  Components: camel-hystrix
>Affects Versions: 2.19.4
>Reporter: Oskar Huminiecki
>Priority: Major
>
> Circuit breaker should be transparent when `closed` - so until it is `open` 
> all exceptions should be passed through not wrapped as it happening now (when 
> fallback is disabled)
> Hystrix library always wraps cause with `HystrixRuntimeException` but Java 
> aspect implementation unwraps it and in result annotation based hystrix in 
> Java is transparent.
> And it should behave same way in Camel.
> As it would be big change in existing behaviour I would suggest new parameter 
> `transparent` default to `false`. When set to true then original cause would 
> be re-thrown (as it is implemented in `HystrixCommandAspect` from 
> `hystrix-javanica`)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Created] (CAMEL-12441) MulticastProcessor doProcessParallel blocks indefinitly if exception occurs in it.next()

2018-04-13 Thread Bodor Maria Mihaela (JIRA)
Bodor Maria Mihaela created CAMEL-12441:
---

 Summary: MulticastProcessor doProcessParallel blocks indefinitly 
if exception occurs in it.next()
 Key: CAMEL-12441
 URL: https://issues.apache.org/jira/browse/CAMEL-12441
 Project: Camel
  Issue Type: Bug
  Components: camel-core
Affects Versions: 2.21.0, 2.20.3, 2.20.2, 2.20.1, 2.20.0, 2.19.5
 Environment: Windows 8, java 1.8.0_162, camel 2.21.0
Reporter: Bodor Maria Mihaela
 Fix For: 2.21.1


After upgrading from camel 2.17.5 to 2.21.0 the following problem was 
encountered:

Context:
A camel RouteBuilder with a split :

{code:title=MyRouteBuilder.java|borderStyle=solid}
public class MyRouteBuilder extends RouteBuilder {
@Override
public void configure() throws Exception {
 from("direct:in")
 .split()
  .xtokenize("//someTocken", 'i', NAMESPACES)
  .aggregationStrategy(nw UseLatestAggregationStrategy())
  .stopOnException()
  .parallelAggregate()
  .parallelProcessing()
  
.executorServiceRef("splitExecutorService").stopOnException()
  .streaming().stopOnException()
  .id("xml-splitter")
.to("direct:out")
.routeId(getClass().getSimpleName());
} 
}
{code}

Problem encountered:
A malformed xml arrives on this route. it.hasNext() returns true but it.next() 
throws an exception. This causes an indefinite wait in MulticastProcessor at 
line 374.

Reason:
A call to countDown on aggregationOnTheFlyDone is never performed and thus the 
latch waits indefinitely.

Possible solution:
A call to aggregationOnTheFlyDone .countDown inside the catch corresponding to 
the try surrounding the while.





--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (CAMEL-12442) rest-dsl - Rest producer should use RestConfiguration

2018-04-13 Thread Claus Ibsen (JIRA)

 [ 
https://issues.apache.org/jira/browse/CAMEL-12442?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen updated CAMEL-12442:

Fix Version/s: 2.22.0

> rest-dsl - Rest producer should use RestConfiguration
> -
>
> Key: CAMEL-12442
> URL: https://issues.apache.org/jira/browse/CAMEL-12442
> Project: Camel
>  Issue Type: Improvement
>  Components: camel-core
>Reporter: Claus Ibsen
>Priority: Major
> Fix For: 2.22.0
>
>
> The RestConfiguration have additional configuration for component level, 
> endpoint level which you may want to allow to configure for the rest-dsl 
> producer side.
> Currently this is only supported on the consumer side.
> To introduce this, requires an API change in the RestProducerFactory method.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Created] (CAMEL-12442) rest-dsl - Rest producer should use RestConfiguration

2018-04-13 Thread Claus Ibsen (JIRA)
Claus Ibsen created CAMEL-12442:
---

 Summary: rest-dsl - Rest producer should use RestConfiguration
 Key: CAMEL-12442
 URL: https://issues.apache.org/jira/browse/CAMEL-12442
 Project: Camel
  Issue Type: Improvement
  Components: camel-core
Reporter: Claus Ibsen


The RestConfiguration have additional configuration for component level, 
endpoint level which you may want to allow to configure for the rest-dsl 
producer side.

Currently this is only supported on the consumer side.

To introduce this, requires an API change in the RestProducerFactory method.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Assigned] (CAMEL-12440) Upgrade camel-dozer to 6.2

2018-04-13 Thread Andrea Cosentino (JIRA)

 [ 
https://issues.apache.org/jira/browse/CAMEL-12440?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andrea Cosentino reassigned CAMEL-12440:


Assignee: Andrea Cosentino

> Upgrade camel-dozer to 6.2
> --
>
> Key: CAMEL-12440
> URL: https://issues.apache.org/jira/browse/CAMEL-12440
> Project: Camel
>  Issue Type: Improvement
>  Components: camel-dozer
>Reporter: Gareth Healy
>Assignee: Andrea Cosentino
>Priority: Major
> Fix For: 2.22.0
>
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Resolved] (CAMEL-12440) Upgrade camel-dozer to 6.2

2018-04-13 Thread Andrea Cosentino (JIRA)

 [ 
https://issues.apache.org/jira/browse/CAMEL-12440?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andrea Cosentino resolved CAMEL-12440.
--
Resolution: Fixed

> Upgrade camel-dozer to 6.2
> --
>
> Key: CAMEL-12440
> URL: https://issues.apache.org/jira/browse/CAMEL-12440
> Project: Camel
>  Issue Type: Improvement
>  Components: camel-dozer
>Reporter: Gareth Healy
>Assignee: Andrea Cosentino
>Priority: Major
> Fix For: 2.22.0
>
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (CAMEL-12440) Upgrade camel-dozer to 6.2

2018-04-13 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-12440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16437000#comment-16437000
 ] 

ASF GitHub Bot commented on CAMEL-12440:


oscerd commented on issue #2291: [CAMEL-12440] Upgraded dozer to 6.2
URL: https://github.com/apache/camel/pull/2291#issuecomment-381063895
 
 
   Thanks. Merged on master


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Upgrade camel-dozer to 6.2
> --
>
> Key: CAMEL-12440
> URL: https://issues.apache.org/jira/browse/CAMEL-12440
> Project: Camel
>  Issue Type: Improvement
>  Components: camel-dozer
>Reporter: Gareth Healy
>Assignee: Andrea Cosentino
>Priority: Major
> Fix For: 2.22.0
>
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (CAMEL-12440) Upgrade camel-dozer to 6.2

2018-04-13 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-12440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16437002#comment-16437002
 ] 

ASF GitHub Bot commented on CAMEL-12440:


Github user oscerd closed the pull request at:

https://github.com/apache/camel/pull/2291


> Upgrade camel-dozer to 6.2
> --
>
> Key: CAMEL-12440
> URL: https://issues.apache.org/jira/browse/CAMEL-12440
> Project: Camel
>  Issue Type: Improvement
>  Components: camel-dozer
>Reporter: Gareth Healy
>Assignee: Andrea Cosentino
>Priority: Major
> Fix For: 2.22.0
>
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (CAMEL-12440) Upgrade camel-dozer to 6.2

2018-04-13 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-12440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16437001#comment-16437001
 ] 

ASF GitHub Bot commented on CAMEL-12440:


oscerd closed pull request #2291: [CAMEL-12440] Upgraded dozer to 6.2
URL: https://github.com/apache/camel/pull/2291
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/components/camel-dozer/pom.xml b/components/camel-dozer/pom.xml
index ec8ca5b5038..6664fb3d715 100644
--- a/components/camel-dozer/pom.xml
+++ b/components/camel-dozer/pom.xml
@@ -48,17 +48,20 @@
   com.github.dozermapper
   dozer-core
 
+
+
 
   javax.el
   javax.el-api
-  ${javax.el-api-version}
+  ${javax.el3-version}
 
-
 
-  org.glassfish.web
+  org.glassfish
   javax.el
-  ${javax.el-version}
+  ${javax.el3-version}
 
+
+
 
   junit
   junit
diff --git 
a/components/camel-dozer/src/main/java/org/apache/camel/component/dozer/DozerEndpoint.java
 
b/components/camel-dozer/src/main/java/org/apache/camel/component/dozer/DozerEndpoint.java
index 23b35ffd1aa..c12cdaa37aa 100644
--- 
a/components/camel-dozer/src/main/java/org/apache/camel/component/dozer/DozerEndpoint.java
+++ 
b/components/camel-dozer/src/main/java/org/apache/camel/component/dozer/DozerEndpoint.java
@@ -21,8 +21,6 @@
 import java.util.HashMap;
 import java.util.Map;
 
-import javax.el.ExpressionFactory;
-
 import org.apache.camel.Component;
 import org.apache.camel.Consumer;
 import org.apache.camel.Processor;
@@ -35,9 +33,6 @@
 import org.apache.camel.util.ResourceHelper;
 import org.dozer.CustomConverter;
 import org.dozer.Mapper;
-import org.dozer.config.BeanContainer;
-import org.dozer.loader.xml.ELEngine;
-import org.dozer.loader.xml.ExpressionElementReader;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
diff --git 
a/components/camel-dozer/src/main/java/org/apache/camel/converter/dozer/DozerBeanMapperConfiguration.java
 
b/components/camel-dozer/src/main/java/org/apache/camel/converter/dozer/DozerBeanMapperConfiguration.java
index e29ca58a071..e20fa4f12c6 100644
--- 
a/components/camel-dozer/src/main/java/org/apache/camel/converter/dozer/DozerBeanMapperConfiguration.java
+++ 
b/components/camel-dozer/src/main/java/org/apache/camel/converter/dozer/DozerBeanMapperConfiguration.java
@@ -19,8 +19,6 @@
 import java.util.List;
 import java.util.Map;
 
-import com.sun.org.apache.xpath.internal.operations.Bool;
-
 import org.dozer.CustomConverter;
 import org.dozer.CustomFieldMapper;
 import org.dozer.DozerEventListener;
diff --git 
a/components/camel-dozer/src/main/java/org/apache/camel/converter/dozer/MapperFactory.java
 
b/components/camel-dozer/src/main/java/org/apache/camel/converter/dozer/MapperFactory.java
index bc57250f12e..4886b3ca822 100644
--- 
a/components/camel-dozer/src/main/java/org/apache/camel/converter/dozer/MapperFactory.java
+++ 
b/components/camel-dozer/src/main/java/org/apache/camel/converter/dozer/MapperFactory.java
@@ -16,23 +16,17 @@
  */
 package org.apache.camel.converter.dozer;
 
-import java.lang.reflect.Field;
-import java.util.Map;
-
-import javax.el.ExpressionFactory;
-
 import org.apache.camel.CamelContext;
 import org.apache.camel.component.dozer.DozerEndpoint;
-import org.apache.camel.util.ReflectionHelper;
-import org.dozer.CustomConverter;
 import org.dozer.DozerBeanMapperBuilder;
-import org.dozer.DozerEventListener;
 import org.dozer.Mapper;
-import org.dozer.config.BeanContainer;
-import org.dozer.config.GlobalSettings;
-import org.dozer.loader.api.BeanMappingBuilder;
-import org.dozer.loader.xml.ELEngine;
-import org.dozer.loader.xml.ExpressionElementReader;
+import org.dozer.config.SettingsKeys;
+import org.dozer.el.DefaultELEngine;
+import org.dozer.el.ELEngine;
+import org.dozer.el.ELExpressionFactory;
+import org.dozer.el.NoopELEngine;
+import org.dozer.el.TcclELEngine;
+import org.dozer.util.RuntimeUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -57,147 +51,50 @@ public Mapper create() {
 }
 
 private Mapper parseConfiguration(DozerBeanMapperConfiguration 
configuration) {
-DozerBeanMapperBuilder builder = DozerBeanMapperBuilder.create();
-if (configuration != null) {
-if (configuration.getMappingFiles() != null) {
-String[] files = configuration.getMappingFiles().toArray(new 
String[configuration.getMappingFiles().size()]);
-builder.withMappingFiles(files);
-}
-
-if (configuration.getCustomConverters() != null) {
-for (CustomConverter current : 
configuration.getCustomConverters()) {
-builder.wi

[jira] [Commented] (CAMEL-11308) MongoDB: No (auto) conversion for BigDecimal

2018-04-13 Thread JIRA

[ 
https://issues.apache.org/jira/browse/CAMEL-11308?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16437251#comment-16437251
 ] 

Jörg Peschke commented on CAMEL-11308:
--

For the record, if someone stumbles upon this issue:

If you need to make the BigDecimal -> Double Conversion work again, [you can 
implement a BigDecimalCodec and attach it to MongoDBs Codec 
Registry.|https://gist.github.com/squarepegsys/9a97f7c70337e7c5e006a436acd8a729]

Tested with Camel 2.20.3

> MongoDB: No (auto) conversion for BigDecimal
> 
>
> Key: CAMEL-11308
> URL: https://issues.apache.org/jira/browse/CAMEL-11308
> Project: Camel
>  Issue Type: Improvement
>  Components: camel-mongodb, camel-mongodb3
>Affects Versions: 2.19.0
>Reporter: Jörg Peschke
>Assignee: Claus Ibsen
>Priority: Minor
> Fix For: 2.19.4, 2.20.0
>
> Attachments: MongoDbBigDecimalConverterTest.java
>
>
> When trying to convert JavaObjects with BigDecimal fields, an exception is 
> thrown (see below).
> Apparently, the reason for that is that the MongoDB driver doesn't convert 
> BigDecimals natively, which is why you need to specify an own converter class.
> However, Camel <=2.18.3 didn't throw this error, so I assume that Camel 
> brought its own Big Decimal converter class in previous versions that is now 
> broken.
> Downgrading to 2.18.3 fixed the error for me.
> The issue showed up with the old camel-mongodb and the new camel-mongodb3 
> component.
> {noformat}
> Stacktrace
> ---
> org.apache.camel.component.mongodb3.CamelMongoDbException: 
> org.bson.codecs.configuration.CodecConfigurationException: Can't find a codec 
> for class java.math.BigDecimal.
>   at 
> org.apache.camel.component.mongodb3.MongoDbComponent.wrapInCamelMongoDbException(MongoDbComponent.java:64)
>   at 
> org.apache.camel.component.mongodb3.MongoDbProducer.process(MongoDbProducer.java:117)
>   at 
> org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
>   at 
> org.apache.camel.processor.SendProcessor.process(SendProcessor.java:145)
>   at 
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
>   at 
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:541)
>   at 
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:198)
>   at org.apache.camel.processor.Pipeline.process(Pipeline.java:120)
>   at org.apache.camel.processor.Pipeline.process(Pipeline.java:83)
>   at 
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:198)
>   at 
> org.apache.camel.component.seda.SedaConsumer.sendToConsumers(SedaConsumer.java:298)
>   at 
> org.apache.camel.component.seda.SedaConsumer.doRun(SedaConsumer.java:207)
>   at 
> org.apache.camel.component.seda.SedaConsumer.run(SedaConsumer.java:154)
>   at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
>   at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
>   at java.lang.Thread.run(Unknown Source)
> Caused by: org.bson.codecs.configuration.CodecConfigurationException: Can't 
> find a codec for class java.math.BigDecimal.
>   at 
> org.bson.codecs.configuration.CodecCache.getOrThrow(CodecCache.java:46)
>   at 
> org.bson.codecs.configuration.ProvidersCodecRegistry.get(ProvidersCodecRegistry.java:63)
>   at 
> org.bson.codecs.configuration.ChildCodecRegistry.get(ChildCodecRegistry.java:51)
>   at org.bson.codecs.DocumentCodec.writeValue(DocumentCodec.java:174)
>   at org.bson.codecs.DocumentCodec.writeMap(DocumentCodec.java:189)
>   at org.bson.codecs.DocumentCodec.writeValue(DocumentCodec.java:172)
>   at org.bson.codecs.DocumentCodec.writeMap(DocumentCodec.java:189)
>   at org.bson.codecs.DocumentCodec.writeValue(DocumentCodec.java:172)
>   at org.bson.codecs.DocumentCodec.writeIterable(DocumentCodec.java:197)
>   at org.bson.codecs.DocumentCodec.writeValue(DocumentCodec.java:170)
>   at org.bson.codecs.DocumentCodec.writeMap(DocumentCodec.java:189)
>   at org.bson.codecs.DocumentCodec.encode(DocumentCodec.java:131)
>   at org.bson.codecs.DocumentCodec.encode(DocumentCodec.java:45)
>   at 
> org.bson.codecs.BsonDocumentWrapperCodec.encode(BsonDocumentWrapperCodec.java:63)
>   at 
> org.bson.codecs.BsonDocumentWrapperCodec.encode(BsonDocumentWrapperCodec.java:29)
>   at 
> com.mongodb.connection.InsertCommandMessage.writeTheWrites(InsertCommandMessage.java:101)
>   at 
> com.mongodb.connect

[jira] [Reopened] (CAMEL-12077) camel-salesforce - No streaming events are received when subscription is running for a long time

2018-04-13 Thread Andrey Tyurin (JIRA)

 [ 
https://issues.apache.org/jira/browse/CAMEL-12077?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andrey Tyurin reopened CAMEL-12077:
---

Hi,

 

The problem is not in 500 error message. THe problem is that after this message 
the camel-salesforce component does not reconnect automatically. It is 
necessary to stop it and start again.

> camel-salesforce - No streaming events are received when subscription is 
> running for a long time
> 
>
> Key: CAMEL-12077
> URL: https://issues.apache.org/jira/browse/CAMEL-12077
> Project: Camel
>  Issue Type: Bug
>  Components: camel-salesforce
>Affects Versions: 2.21.0
> Environment: Linux
>Reporter: Andrey Tyurin
>Priority: Major
>
> When the topic subscription exists for a long time, no streaming events are 
> received. In my example, I left app running for a couple of days, when I 
> tried to create new item I was not able to get event for it.
> Please find the error logs:
> 2017-12-08 10:27:29 [HttpClient@1017728114-38] WARN  
> o.a.c.c.s.i.s.SubscriptionHelper - Connect failure: 
> {clientId=u2evatdsdpd1dx1oxjwi44x0npj, advice={reconnect=handshake, 
> interval=500}, channel=/meta/connect, id=792, error=403::Unknown client, 
> successful=false}
> 2017-12-08 10:27:34 [HttpClient@1017728114-34] INFO  
> o.a.c.c.s.i.s.SubscriptionHelper - Subscribing to channel /topic/MyTopic1...
> 2017-12-08 10:27:34 [HttpClient@1017728114-34] INFO  
> o.a.c.c.s.i.s.SubscriptionHelper - Subscribing to channel /topic/MyTopic2...
> 2017-12-08 10:27:34 [HttpClient@1017728114-33] INFO  
> o.a.c.c.s.i.s.SubscriptionHelper - Subscribed to channel /topic/MyTopic1
> 2017-12-08 10:27:35 [HttpClient@1017728114-33] INFO  
> o.a.c.c.s.i.s.SubscriptionHelper - Subscribed to channel /topic/MyTopic2
> 2017-12-08 13:27:39 [HttpClient@1017728114-38] WARN  
> o.a.c.c.s.i.s.SubscriptionHelper - Connect failure: 
> {clientId=zt4w6ycvc2w41z1vy8las52496h, advice={reconnect=handshake, 
> interval=500}, channel=/meta/connect, id=895, error=403::Unknown client, 
> successful=false}
> 2017-12-08 13:27:46 [HttpClient@1017728114-34] INFO  
> o.a.c.c.s.i.s.SubscriptionHelper - Subscribing to channel /topic/MyTopic1...
> 2017-12-08 13:27:46 [HttpClient@1017728114-34] INFO  
> o.a.c.c.s.i.s.SubscriptionHelper - Subscribing to channel /topic/MyTopic2...
> 2017-12-08 13:27:46 [HttpClient@1017728114-34] INFO  
> o.a.c.c.s.i.s.SubscriptionHelper - Subscribed to channel /topic/MyTopic1
> 2017-12-08 13:27:46 [HttpClient@1017728114-38] INFO  
> o.a.c.c.s.i.s.SubscriptionHelper - Subscribed to channel /topic/MyTopic2
> 2017-12-08 15:21:22 [HttpClient@1017728114-31] WARN  
> o.a.c.c.s.i.s.SubscriptionHelper - Connect failure: 
> {failure={exception=org.cometd.common.TransportException: {httpCode=408}, 
> message={clientId=149nqlw716ayvw11umy6y68qnt5j, channel=/meta/connect, 
> id=961, connectionType=long-polling}, httpCode=408, 
> connectionType=long-polling}, channel=/meta/connect, id=961, successful=false}
> 2017-12-08 15:21:24 [HttpClient@1017728114-34] WARN  
> o.a.c.c.s.i.s.SubscriptionHelper - Connect failure: 
> {clientId=149nqlw716ayvw11umy6y68qnt5j, advice={reconnect=handshake, 
> interval=500}, channel=/meta/connect, id=962, error=403::Unknown client, 
> successful=false}
> 2017-12-08 15:21:30 [HttpClient@1017728114-35] INFO  
> o.a.c.c.s.i.s.SubscriptionHelper - Subscribing to channel /topic/MyTopic1...
> 2017-12-08 15:21:30 [HttpClient@1017728114-35] INFO  
> o.a.c.c.s.i.s.SubscriptionHelper - Subscribing to channel /topic/MyTopic2...
> 2017-12-08 15:21:30 [HttpClient@1017728114-35] INFO  
> o.a.c.c.s.i.s.SubscriptionHelper - Subscribed to channel /topic/MyTopic1
> 2017-12-08 15:21:31 [HttpClient@1017728114-34] INFO  
> o.a.c.c.s.i.s.SubscriptionHelper - Subscribed to channel /topic/MyTopic2
> 2017-12-08 18:21:40 [HttpClient@1017728114-33] WARN  
> o.a.c.c.s.i.s.SubscriptionHelper - Connect failure: 
> {clientId=2187o33x9xfjzn12ftwc7kzkp3a, advice={reconnect=handshake, 
> interval=500}, channel=/meta/connect, id=1065, error=403::Unknown client, 
> successful=false}
> 2017-12-08 18:21:47 [HttpClient@1017728114-38] INFO  
> o.a.c.c.s.i.s.SubscriptionHelper - Subscribing to channel /topic/MyTopic1...
> 2017-12-08 18:21:47 [HttpClient@1017728114-38] INFO  
> o.a.c.c.s.i.s.SubscriptionHelper - Subscribing to channel /topic/MyTopic2...
> 2017-12-08 18:21:47 [HttpClient@1017728114-38] INFO  
> o.a.c.c.s.i.s.SubscriptionHelper - Subscribed to channel /topic/MyTopic1
> 2017-12-08 18:21:47 [HttpClient@1017728114-35] INFO  
> o.a.c.c.s.i.s.SubscriptionHelper - Subscribed to channel /topic/MyTopic2
> 2017-12-08 21:21:53 [HttpClient@1017728114-37] WARN  
> o.a.c.c.s.i.s.SubscriptionHelper - Connect failure: 
> {clientId=5y1v1wcvpi8mg0849ksbk5o27o, advice={reconnect=handsh

[jira] [Created] (CAMEL-12443) Ability to use 'key' directly instead of pointing resource for generateJwtAssertion

2018-04-13 Thread Andrey Tyurin (JIRA)
Andrey Tyurin created CAMEL-12443:
-

 Summary: Ability to use 'key' directly instead of pointing 
resource for generateJwtAssertion
 Key: CAMEL-12443
 URL: https://issues.apache.org/jira/browse/CAMEL-12443
 Project: Camel
  Issue Type: Improvement
  Components: camel-salesforce
Affects Versions: 2.21.0
Reporter: Andrey Tyurin


Hello,

Could you extend the way of using JWT OAUTH2.0 authorisation for Salesforce 
component? For the current moment it uses resource uri (path to file, 
classpath, URL), but we want to use key directly (from String variable):

String generateJwtAssertion() {

...

    PrivateKey key = (PrivateKey) keystore.getKey(alias, 
keyStoreParameters.getPassword().toCharArray());



We would like to have possibility to set the key directly from String variable, 
so there will be new way how to configure JWT for SF:

SalesforceLoginConfig loginConfig = new SalesforceLoginConfig();

loginConfig.setKey(keyValue);       <-- new option

 

Thanks,

Andrey 

 

 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (CAMEL-12443) Ability to use 'key' directly instead of pointing resource for generateJwtAssertion

2018-04-13 Thread Andrey Tyurin (JIRA)

 [ 
https://issues.apache.org/jira/browse/CAMEL-12443?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andrey Tyurin updated CAMEL-12443:
--
Description: 
Hello,

Could you extend the way of using JWT OAUTH2.0 authorisation for Salesforce 
component? For the current moment it uses resource uri (path to file, 
classpath, URL), but we want to use key directly (from String variable):

String generateJwtAssertion() {

...

    PrivateKey key = (PrivateKey) keystore.getKey(alias, 
keyStoreParameters.getPassword().toCharArray());



We would like to have possibility to set the key directly from String variable, 
so there will be new way how to configure JWT for SF:

String keyValue="This is some key content";

SalesforceLoginConfig loginConfig = new SalesforceLoginConfig();

loginConfig.setKey(keyValue);       <-- new option

 

Thanks,

Andrey 

 

 

  was:
Hello,

Could you extend the way of using JWT OAUTH2.0 authorisation for Salesforce 
component? For the current moment it uses resource uri (path to file, 
classpath, URL), but we want to use key directly (from String variable):

String generateJwtAssertion() {

...

    PrivateKey key = (PrivateKey) keystore.getKey(alias, 
keyStoreParameters.getPassword().toCharArray());



We would like to have possibility to set the key directly from String variable, 
so there will be new way how to configure JWT for SF:

SalesforceLoginConfig loginConfig = new SalesforceLoginConfig();

loginConfig.setKey(keyValue);       <-- new option

 

Thanks,

Andrey 

 

 


> Ability to use 'key' directly instead of pointing resource for 
> generateJwtAssertion
> ---
>
> Key: CAMEL-12443
> URL: https://issues.apache.org/jira/browse/CAMEL-12443
> Project: Camel
>  Issue Type: Improvement
>  Components: camel-salesforce
>Affects Versions: 2.21.0
>Reporter: Andrey Tyurin
>Priority: Major
>
> Hello,
> Could you extend the way of using JWT OAUTH2.0 authorisation for Salesforce 
> component? For the current moment it uses resource uri (path to file, 
> classpath, URL), but we want to use key directly (from String variable):
> String generateJwtAssertion() {
> ...
>     PrivateKey key = (PrivateKey) keystore.getKey(alias, 
> keyStoreParameters.getPassword().toCharArray());
> 
> We would like to have possibility to set the key directly from String 
> variable, so there will be new way how to configure JWT for SF:
> String keyValue="This is some key content";
> SalesforceLoginConfig loginConfig = new SalesforceLoginConfig();
> loginConfig.setKey(keyValue);       <-- new option
>  
> Thanks,
> Andrey 
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)