Re: camel-cmis: sessionhandling not working as expected

2017-04-05 Thread Claus Ibsen
Try with newer release as I think we have fixed something in this
component, I kinda recall something about this.

On Wed, Apr 5, 2017 at 12:43 PM, Meyfarth, Frank  wrote:
> Hi everyone,
>
> Maybe I’m just to dumb to get it, but I believe I have found a bug in
> camel-cmis.
>
> I use the following URI within a CMIS producer to send a query to the CMIS
> system.
>
> cmis:http://rabobank-air-dev01.test-server.ag:8080/alfresco/api/-default-/p
> ublic/cmis/versions/1.1/atom?username=admin=admin=-de
> fault-=true
>
> As you can see, the server credentials are present as options within the
> URI.
>
> Unfortunately I always get HTTP code 401 Unauthorized. Although the
> credentials are correct and verified, off course.
>
> I already debugged into the component and found the following code in
> org.apache.camel.component.cmis.CMISComponent:
>
> ...
> 00 protected Endpoint createEndpoint(String uri, final String remaining,
> final Map parameters) throws Exception {
> 01 boolean queryMode = removeQueryMode(parameters);
> 02
> 03 CMISSessionFacade sessionFacade = new CMISSessionFacade(remaining);
> 04 setProperties(sessionFacade, parameters);
> 05
> 06 CMISEndpoint endpoint = new CMISEndpoint(uri, this, new
> CMISSessionFacadeFactory() {
> 07 @Override
> 08 public CMISSessionFacade create() throws Exception {
> 09 CMISSessionFacade sessionFacade = new
> CMISSessionFacade(remaining);
> 10 setProperties(sessionFacade, parameters);
> 11
> 12 return sessionFacade;
> 13 }
> 14 });
> 15
> 16 endpoint.setQueryMode(queryMode);
> 17
> 18 return endpoint;
> 19 }
>
> ...
>
> At the beginning of the method all options are still present in the
> „parameters“ map. After the session facade has been created in line 03 of
> the method its parameters get set by calling „setProperties“. This works
> fine for the created session facade. But „setProperties“ removes the
> properties which have been successfully set from the „parameters“ map.
> Therefore parameters „username“ and „password“ are no longer present after
> execution of line 04. Later, when the „create“ method of the anonymous
> CMISEndpoint created in line 06 gets called, these are still not present
> and therefore NULL. And this is what finally leads to the 401 return code.
>
> Either I use the Endpoint in a wrong way. In that case probably someone
> can explain to me how to use it.
> Or this is actually a bug. In this case I could offer fixing or someone
> else does it. Which would be appreciated.
>
> Best regards and thanks for your help
>
> Frank
>
>
>
>
> --
> Frank Meyfarth
> adesso AG T +49 231 7000-2380
> Stockholmer Allee 20  F +49 231 7000-1000
> 44269 DortmundE meyfa...@adesso.de
>   www.adesso.de 
>   blog.adesso.de 
>
>
> ---
>  >>> business. people. technology. <<<
> ---
>
> adesso AG mit Sitz in Dortmund
> Vorstand: Michael Kenfenheuer (Vors.), Christoph Junge, Andreas Prenneis
> Vorsitzender des Aufsichtsrates: Prof. Dr. Volker Gruhn
> Amtsgericht Dortmund HRB 20663
>
> https://www.wirmachendasjetzt.de/de/?utm_source=Banner%20_medium=E-Mail_campaign=DGT



-- 
Claus Ibsen
-
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2


Re: camel-cmis: sessionhandling not working as expected

2017-04-05 Thread Meyfarth, Frank
2.17.0.redhat-630187

-- 
Frank Meyfarth 
adesso AG T +49 231 7000-2380
Stockholmer Allee 20  F +49 231 7000-1000
44269 DortmundE meyfa...@adesso.de
  www.adesso.de 
  blog.adesso.de 




Am 05.04.17, 12:45 schrieb "Andrea Cosentino" unter
:

>What is the camel version you're currently using? --Andrea Cosentino
>--Apache Camel PMC MemberApache Karaf
>CommitterApache Servicemix PMC MemberEmail: ancosen1985@yahoo.comTwitter:
>@oscerd2Github: oscerd
>
>On Wednesday, April 5, 2017 12:43 PM, "Meyfarth, Frank"
> wrote:
> 
>
> Hi everyone,
>
>Maybe I’m just to dumb to get it, but I believe I have found a bug in
>camel-cmis.
>
>I use the following URI within a CMIS producer to send a query to the CMIS
>system.
>
>cmis:http://rabobank-air-dev01.test-server.ag:8080/alfresco/api/-default-/
>p
>ublic/cmis/versions/1.1/atom?username=admin=admin=-d
>e
>fault-=true
>
>As you can see, the server credentials are present as options within the
>URI.
>
>Unfortunately I always get HTTP code 401 Unauthorized. Although the
>credentials are correct and verified, off course.
>
>I already debugged into the component and found the following code in
>org.apache.camel.component.cmis.CMISComponent:
>
>...
>00 protected Endpoint createEndpoint(String uri, final String remaining,
>final Map parameters) throws Exception {
>01boolean queryMode = removeQueryMode(parameters);
>02 
>03CMISSessionFacade sessionFacade = new CMISSessionFacade(remaining);
>04setProperties(sessionFacade, parameters);
>05 
>06CMISEndpoint endpoint = new CMISEndpoint(uri, this, new
>CMISSessionFacadeFactory() {
>07@Override
>08public CMISSessionFacade create() throws Exception {
>09CMISSessionFacade sessionFacade = new
>CMISSessionFacade(remaining);
>10setProperties(sessionFacade, parameters);
>11 
>12return sessionFacade;
>13}
>14});
>15 
>16endpoint.setQueryMode(queryMode);
>17 
>18return endpoint;
>19 }
>
>...
>
>At the beginning of the method all options are still present in the
>„parameters“ map. After the session facade has been created in line 03 of
>the method its parameters get set by calling „setProperties“. This works
>fine for the created session facade. But „setProperties“ removes the
>properties which have been successfully set from the „parameters“ map.
>Therefore parameters „username“ and „password“ are no longer present after
>execution of line 04. Later, when the „create“ method of the anonymous
>CMISEndpoint created in line 06 gets called, these are still not present
>and therefore NULL. And this is what finally leads to the 401 return code.
>
>Either I use the Endpoint in a wrong way. In that case probably someone
>can explain to me how to use it.
>Or this is actually a bug. In this case I could offer fixing or someone
>else does it. Which would be appreciated.
>
>Best regards and thanks for your help
>
>Frank
>
>
>
>
>-- 
>Frank Meyfarth
>adesso AGT +49 231 7000-2380
>Stockholmer Allee 20  F +49 231 7000-1000
>44269 DortmundE meyfa...@adesso.de
>  www.adesso.de 
>  blog.adesso.de 
>
>
>---
>>>> business. people. technology. <<<
>---
>
>adesso AG mit Sitz in Dortmund
>Vorstand: Michael Kenfenheuer (Vors.), Christoph Junge, Andreas Prenneis
>Vorsitzender des Aufsichtsrates: Prof. Dr. Volker Gruhn
>Amtsgericht Dortmund HRB 20663
>
>https://www.wirmachendasjetzt.de/de/?utm_source=Banner%20_medium=E-Mai
>l_campaign=DGT
>
>
>   


---
 >>> business. people. technology. <<<
---

adesso AG mit Sitz in Dortmund
Vorstand: Michael Kenfenheuer (Vors.), Christoph Junge, Andreas Prenneis
Vorsitzender des Aufsichtsrates: Prof. Dr. Volker Gruhn
Amtsgericht Dortmund HRB 20663

https://www.wirmachendasjetzt.de/de/?utm_source=Banner%20_medium=E-Mail_campaign=DGT


Re: camel-cmis: sessionhandling not working as expected

2017-04-05 Thread Andrea Cosentino
What is the camel version you're currently using? --Andrea Cosentino 
--Apache Camel PMC MemberApache Karaf 
CommitterApache Servicemix PMC MemberEmail: ancosen1985@yahoo.comTwitter: 
@oscerd2Github: oscerd 

On Wednesday, April 5, 2017 12:43 PM, "Meyfarth, Frank" 
 wrote:
 

 Hi everyone,

Maybe I’m just to dumb to get it, but I believe I have found a bug in
camel-cmis.

I use the following URI within a CMIS producer to send a query to the CMIS
system.

cmis:http://rabobank-air-dev01.test-server.ag:8080/alfresco/api/-default-/p
ublic/cmis/versions/1.1/atom?username=admin=admin=-de
fault-=true

As you can see, the server credentials are present as options within the
URI.

Unfortunately I always get HTTP code 401 Unauthorized. Although the
credentials are correct and verified, off course.

I already debugged into the component and found the following code in
org.apache.camel.component.cmis.CMISComponent:

...
00 protected Endpoint createEndpoint(String uri, final String remaining,
final Map parameters) throws Exception {
01    boolean queryMode = removeQueryMode(parameters);
02 
03    CMISSessionFacade sessionFacade = new CMISSessionFacade(remaining);
04    setProperties(sessionFacade, parameters);
05 
06    CMISEndpoint endpoint = new CMISEndpoint(uri, this, new
CMISSessionFacadeFactory() {
07        @Override
08        public CMISSessionFacade create() throws Exception {
09            CMISSessionFacade sessionFacade = new
CMISSessionFacade(remaining);
10            setProperties(sessionFacade, parameters);
11 
12            return sessionFacade;
13        }
14    });
15 
16    endpoint.setQueryMode(queryMode);
17 
18    return endpoint;
19 }

...

At the beginning of the method all options are still present in the
„parameters“ map. After the session facade has been created in line 03 of
the method its parameters get set by calling „setProperties“. This works
fine for the created session facade. But „setProperties“ removes the
properties which have been successfully set from the „parameters“ map.
Therefore parameters „username“ and „password“ are no longer present after
execution of line 04. Later, when the „create“ method of the anonymous
CMISEndpoint created in line 06 gets called, these are still not present
and therefore NULL. And this is what finally leads to the 401 return code.

Either I use the Endpoint in a wrong way. In that case probably someone
can explain to me how to use it.
Or this is actually a bug. In this case I could offer fixing or someone
else does it. Which would be appreciated.

Best regards and thanks for your help

Frank




-- 
Frank Meyfarth    
adesso AG                    T +49 231 7000-2380
Stockholmer Allee 20          F +49 231 7000-1000
44269 Dortmund                E meyfa...@adesso.de
                              www.adesso.de 
                              blog.adesso.de 


---
    >>> business. people. technology. <<<
---

adesso AG mit Sitz in Dortmund
Vorstand: Michael Kenfenheuer (Vors.), Christoph Junge, Andreas Prenneis
Vorsitzender des Aufsichtsrates: Prof. Dr. Volker Gruhn
Amtsgericht Dortmund HRB 20663

https://www.wirmachendasjetzt.de/de/?utm_source=Banner%20_medium=E-Mail_campaign=DGT


   

camel-cmis: sessionhandling not working as expected

2017-04-05 Thread Meyfarth, Frank
Hi everyone,

Maybe I’m just to dumb to get it, but I believe I have found a bug in
camel-cmis.

I use the following URI within a CMIS producer to send a query to the CMIS
system.

cmis:http://rabobank-air-dev01.test-server.ag:8080/alfresco/api/-default-/p
ublic/cmis/versions/1.1/atom?username=admin=admin=-de
fault-=true

As you can see, the server credentials are present as options within the
URI.

Unfortunately I always get HTTP code 401 Unauthorized. Although the
credentials are correct and verified, off course.

I already debugged into the component and found the following code in
org.apache.camel.component.cmis.CMISComponent:

...
00 protected Endpoint createEndpoint(String uri, final String remaining,
final Map parameters) throws Exception {
01 boolean queryMode = removeQueryMode(parameters);
02 
03 CMISSessionFacade sessionFacade = new CMISSessionFacade(remaining);
04 setProperties(sessionFacade, parameters);
05 
06 CMISEndpoint endpoint = new CMISEndpoint(uri, this, new
CMISSessionFacadeFactory() {
07 @Override
08 public CMISSessionFacade create() throws Exception {
09 CMISSessionFacade sessionFacade = new
CMISSessionFacade(remaining);
10 setProperties(sessionFacade, parameters);
11 
12 return sessionFacade;
13 }
14 });
15 
16 endpoint.setQueryMode(queryMode);
17 
18 return endpoint;
19 }

...

At the beginning of the method all options are still present in the
„parameters“ map. After the session facade has been created in line 03 of
the method its parameters get set by calling „setProperties“. This works
fine for the created session facade. But „setProperties“ removes the
properties which have been successfully set from the „parameters“ map.
Therefore parameters „username“ and „password“ are no longer present after
execution of line 04. Later, when the „create“ method of the anonymous
CMISEndpoint created in line 06 gets called, these are still not present
and therefore NULL. And this is what finally leads to the 401 return code.

Either I use the Endpoint in a wrong way. In that case probably someone
can explain to me how to use it.
Or this is actually a bug. In this case I could offer fixing or someone
else does it. Which would be appreciated.

Best regards and thanks for your help

Frank




-- 
Frank Meyfarth 
adesso AG T +49 231 7000-2380
Stockholmer Allee 20  F +49 231 7000-1000
44269 DortmundE meyfa...@adesso.de
  www.adesso.de 
  blog.adesso.de 


---
 >>> business. people. technology. <<<
---

adesso AG mit Sitz in Dortmund
Vorstand: Michael Kenfenheuer (Vors.), Christoph Junge, Andreas Prenneis
Vorsitzender des Aufsichtsrates: Prof. Dr. Volker Gruhn
Amtsgericht Dortmund HRB 20663

https://www.wirmachendasjetzt.de/de/?utm_source=Banner%20_medium=E-Mail_campaign=DGT