You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicemix.apache.org by visualjeng <je...@itri.org.tw> on 2012/02/26 13:53:00 UTC

ServiceMix 4.4.x bug, access ssl RESTFul ws or Soap ws

Sorry! I use chinese.

ServiceMix 4.4.x bug.

org.ops4j.pax.web.cfg內容如下:
org.osgi.service.http.secure.enabled=true
org.ops4j.pax.web.ssl.keystore=etc/cherry.jks
org.ops4j.pax.web.ssl.password=password
org.ops4j.pax.web.ssl.keypassword=password
org.osgi.service.http.port.secure=8443
org.ops4j.pax.web.config.file=etc/jetty.xml
javax.servlet.context.tempdir=data/pax-web-jsp

我以 client 存取 Restful ws or Soap ws後, 總會造成
CPU使用率接近100%, 把ServiceMix關掉後, 及回復正常.
我的client程式如下:
private static void testGetssl1() throws HttpException, IOException
    {
    	String BASE_SERVICE_URL = 
    		"https://localhost:8443/cxf/TestRESTFul/RESTFulService/test1";
    	
        
    	SSLProvider trustAll = new SSLProvider();
    	trustAll.install();

        // Header setting
    	System.out.println();
        System.out.println("Sending HTTPS GET request to query
MyFirstRESTFulService info");
        HttpClient httpclient = new HttpClient();
        GetMethod httpget = new GetMethod(BASE_SERVICE_URL);
        httpget.addRequestHeader("Accept" , "text/plain");

        // Authorization setting
 
        String encoding = "username:password";
		String v_encoding = (new sun.misc.BASE64Encoder()).encode(
encoding.getBytes() );
		httpget.addRequestHeader("Authorization", "Basic "+v_encoding); 
		
        try {
            httpclient.executeMethod(httpget);
            System.out.println(httpget.getResponseBodyAsString());
            System.out.println("response code: "+httpget.getStatusCode());
        } finally {
            httpget.releaseConnection();
        }
    }

--
View this message in context: http://servicemix.396122.n5.nabble.com/ServiceMix-4-4-x-bug-access-ssl-RESTFul-ws-or-Soap-ws-tp5516652p5516652.html
Sent from the ServiceMix - Dev mailing list archive at Nabble.com.

Re: ServiceMix 4.4.x bug, access ssl RESTFul ws or Soap ws

Posted by visualjeng <je...@itri.org.tw>.
Thank you very mach, I have presented many.

Now, it work.

--
View this message in context: http://servicemix.396122.n5.nabble.com/ServiceMix-4-4-x-bug-access-ssl-RESTFul-ws-or-Soap-ws-tp5516652p5518170.html
Sent from the ServiceMix - Dev mailing list archive at Nabble.com.

Re: ServiceMix 4.4.x bug, access ssl RESTFul ws or Soap ws

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

If you use Apache SMX and try to access FuseSource repo, you need edit
$SMX_HOME/etc/org.ops4j.pax.url.mvn.cfg
add
http://repo.fusesource.com/nexus/content/repositories/releases
to org.ops4j.pax.url.mvn.repositories property
On 2012-2-27, at 上午11:18, visualjeng wrote:

> Thank Freeman-2!
>
> I use Apache distribution apache-servicemix-4.4.1,
>
> I open $SMX_HOME/system/org/apache/karaf/assemblies/features/ 
> standard/2.2.4/
> standard-2.2.4-features.xml, and change "7.4.5.v20110725" to
> "7.4.5.fuse20111017",
> remove $SMX_HOME/data folder and restart SMX.
>
> I found related message weird, can you tell me where the wrong, thank!
> ......
> [  63] [Active     ] [            ] [       ] [   60] Apache  
> ServiceMix
> Specs ::
> Scripting API 1.0 (1.5.0)
> [  64] [Active     ] [Created     ] [       ] [   50] activemq- 
> broker.xml
> (0.0.0
> )
> [  77] [Active     ] [            ] [       ] [   60] Apache  
> ServiceMix ::
> Bundl
> es :: cglib (2.1.0.3_7)
> [  78] [Active     ] [            ] [       ] [   60] activemq-spring
> (5.5.1)
> [  79] [Active     ] [            ] [       ] [   60] Apache  
> XBean :: Spring
> (3.
> 7)
> [  90] [Active     ] [Created     ] [       ] [   50] camel-karaf- 
> commands
> (2.8.
> 4)
> [  91] [Active     ] [            ] [       ] [   50] camel-core  
> (2.8.4)
> [  92] [Active     ] [            ] [       ] [   50] Commons  
> Management
> (1.0)
> [  94] [Active     ] [            ] [       ] [   50] camel-spring  
> (2.8.4)
> [  95] [Active     ] [Created     ] [       ] [   50] camel-blueprint
> (2.8.4)
> karaf@root> Features:install camel-ftp
> karaf@root> Features:install camel-mina
> karaf@root> Features:install camel-jms
> Error executing command: URL
> [mvn:org.eclipse.jetty/jetty-util/7.4.5.fuse2011101
> 7] could not be resolved.
> karaf@root> Features:install cxf-osgi
> Error executing command: URL
> [mvn:org.eclipse.jetty/jetty-util/7.4.5.fuse2011101
> 7] could not be resolved.
> karaf@root>
>
> --
> View this message in context: http://servicemix.396122.n5.nabble.com/ServiceMix-4-4-x-bug-access-ssl-RESTFul-ws-or-Soap-ws-tp5516652p5517874.html
> Sent from the ServiceMix - Dev mailing list archive at Nabble.com.

---------------------------------------------
Freeman Fang

FuseSource
Email:ffang@fusesource.com
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com










Re: ServiceMix 4.4.x bug, access ssl RESTFul ws or Soap ws

Posted by visualjeng <je...@itri.org.tw>.
Thank Freeman-2!

I use Apache distribution apache-servicemix-4.4.1,

I open $SMX_HOME/system/org/apache/karaf/assemblies/features/standard/2.2.4/ 
standard-2.2.4-features.xml, and change "7.4.5.v20110725" to
"7.4.5.fuse20111017",
remove $SMX_HOME/data folder and restart SMX.

I found related message weird, can you tell me where the wrong, thank!
......
[  63] [Active     ] [            ] [       ] [   60] Apache ServiceMix
Specs ::
 Scripting API 1.0 (1.5.0)
[  64] [Active     ] [Created     ] [       ] [   50] activemq-broker.xml
(0.0.0
)
[  77] [Active     ] [            ] [       ] [   60] Apache ServiceMix ::
Bundl
es :: cglib (2.1.0.3_7)
[  78] [Active     ] [            ] [       ] [   60] activemq-spring
(5.5.1)
[  79] [Active     ] [            ] [       ] [   60] Apache XBean :: Spring
(3.
7)
[  90] [Active     ] [Created     ] [       ] [   50] camel-karaf-commands
(2.8.
4)
[  91] [Active     ] [            ] [       ] [   50] camel-core (2.8.4)
[  92] [Active     ] [            ] [       ] [   50] Commons Management
(1.0)
[  94] [Active     ] [            ] [       ] [   50] camel-spring (2.8.4)
[  95] [Active     ] [Created     ] [       ] [   50] camel-blueprint
(2.8.4)
karaf@root> Features:install camel-ftp
karaf@root> Features:install camel-mina
karaf@root> Features:install camel-jms
Error executing command: URL
[mvn:org.eclipse.jetty/jetty-util/7.4.5.fuse2011101
7] could not be resolved.
karaf@root> Features:install cxf-osgi
Error executing command: URL
[mvn:org.eclipse.jetty/jetty-util/7.4.5.fuse2011101
7] could not be resolved.
karaf@root>

--
View this message in context: http://servicemix.396122.n5.nabble.com/ServiceMix-4-4-x-bug-access-ssl-RESTFul-ws-or-Soap-ws-tp5516652p5517874.html
Sent from the ServiceMix - Dev mailing list archive at Nabble.com.

Re: ServiceMix 4.4.x bug, access ssl RESTFul ws or Soap ws

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

First please use English only on this forum, as guys watching this  
forum are from different cultures.

Hight CPU usage when use jetty with SSL actually is a known issue of  
Jetty 7.4.x, it was fixed in Jetty 7.5.1 and afterwards.

What's the exact SMX version you're using? You're using Apache  
distribution or Fuse ESB distribution?

If you use Fuse ESB distribution, 4.4.1-fuse-01-06 and afterwards  
already fixed it.
If you use Apache distribution, you can find FUSE revised jetty  
7.4.5.fuse20111017 here[1] and change  jetty version accordingly in  
$SMX_HOME/system/org/apache/karaf/assemblies/features/standard/2.2.4/ 
standard-2.2.4-features.xml,
and then remove $SMX_HOME/data folder and restart SMX.

[1]http://repo.fusesource.com/nexus/content/repositories/releases/org/eclipse/jetty/

Freeman


On 2012-2-26, at 下午8:53, visualjeng wrote:

> Sorry! I use chinese.
>
> ServiceMix 4.4.x bug.
>
> org.ops4j.pax.web.cfg內容如下:
> org.osgi.service.http.secure.enabled=true
> org.ops4j.pax.web.ssl.keystore=etc/cherry.jks
> org.ops4j.pax.web.ssl.password=password
> org.ops4j.pax.web.ssl.keypassword=password
> org.osgi.service.http.port.secure=8443
> org.ops4j.pax.web.config.file=etc/jetty.xml
> javax.servlet.context.tempdir=data/pax-web-jsp
>
> 我以 client 存取 Restful ws or Soap ws後, 總會造成
> CPU使用率接近100%, 把ServiceMix關掉後, 及回復正常.
> 我的client程式如下:
> private static void testGetssl1() throws HttpException, IOException
>    {
>    	String BASE_SERVICE_URL =
>    		"https://localhost:8443/cxf/TestRESTFul/RESTFulService/test1";
>    	
>
>    	SSLProvider trustAll = new SSLProvider();
>    	trustAll.install();
>
>        // Header setting
>    	System.out.println();
>        System.out.println("Sending HTTPS GET request to query
> MyFirstRESTFulService info");
>        HttpClient httpclient = new HttpClient();
>        GetMethod httpget = new GetMethod(BASE_SERVICE_URL);
>        httpget.addRequestHeader("Accept" , "text/plain");
>
>        // Authorization setting
>
>        String encoding = "username:password";
> 		String v_encoding = (new sun.misc.BASE64Encoder()).encode(
> encoding.getBytes() );
> 		httpget.addRequestHeader("Authorization", "Basic "+v_encoding);
> 		
>        try {
>            httpclient.executeMethod(httpget);
>            System.out.println(httpget.getResponseBodyAsString());
>            System.out.println("response code:  
> "+httpget.getStatusCode());
>        } finally {
>            httpget.releaseConnection();
>        }
>    }
>
> --
> View this message in context: http://servicemix.396122.n5.nabble.com/ServiceMix-4-4-x-bug-access-ssl-RESTFul-ws-or-Soap-ws-tp5516652p5516652.html
> Sent from the ServiceMix - Dev mailing list archive at Nabble.com.

---------------------------------------------
Freeman Fang

FuseSource
Email:ffang@fusesource.com
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com