2014. 11. 29. 03:01

Bndtools

It seems to be very helpful when developing the OSGI bundle.


http://bndtools.org/


The easy, powerful and productive way to develop with OSGi. Based on bnd and Eclipse.


2014. 11. 25. 06:51

Support telnet on OSGI Console

Type the following command at the OSGI console.



 

osgi> telnetd --port 1234 start

telnetd is running on 127.0.0.1:1234

osgi>

 


Reference : http://books.google.co.kr/books?id=zgBcBAAAQBAJ&pg=PT255&lpg=PT255&dq=connect+to+equinox+console+using+telnet&source=bl&ots=JE0yDkexpm&sig=ad3nta5ZKFZx9ZIk9h41YlIotu8&hl=ko&sa=X&ei=2aNzVMH0CoqX8QWEsoDYDw&ved=0CDQQ6AEwAzgK#v=onepage&q=connect%20to%20equinox%20console%20using%20telnet&f=false

2014. 11. 25. 06:26

Modularizing existing web applications with OSGi

The following site gives good explanation and examples to show how to modularize existing web applications with OSGI.


http://server.dzone.com/articles/modularizing-existing-web


To make examples to be run, the point is that you should make the new Target definition which loads bundles under [example]/rsp_repository/rsp_target_platform.


and don't forget to copy org.eclipse.pde.http.ui_1.0.0.jar file to the dropins folder under eclipse installed folder.


The following picture shows example.



rsp4j-example-workspace.zip




2014. 11. 24. 03:19

Target Definition

Target definition can be added by 


Windows > Preferences > Plug-in Development > Target Platform menu.




: Reload command is useful when you copied some bundle to plugin folder newly.


: In the case of locations, variables can be used as below





ex) ${project_loc}\lib 


ex) ${eclipse_home} 



If you specify import packages in the MANIFEST.MF file as below,


Import-Package:

javax.servlet.jsp.jstl.fmt



If no problem is, the specified jar will be added to the Plug-in Dependencies.





If not, check if the jar file including that package is in the target definition folder. This validation can be run at the "Run configuration" dialog as well.


2014. 11. 22. 07:17

OSGI Useful commands


help 


: lists all available commands


ss | grep text


: lists services which matches with text


bundle [bundle id]


: prints detailed information like Id,Status, Data Root and etc.


b [build id]


: prints all meta data related to this bundle


update [bundle id]


: applies newest bundle


diag [bundle id]


: prints diagnose messages


packages [package name]


: lists all the bundles which use the given package. Wild card can be used at package name.


install file:[file path]


: install a bundle into running OSGI environment. 


* [bundle symbolic name] also can be sued instead of [bundle id]



* And more useful console


CommandDescription
startStarts a bundle given an ID or symbolic name
stopStops a bundle given an ID or symbolic name
installAdds a bundle given a URL for the current instance
uninstallRemoves a bundle given a URL for the current instance
updateUpdates a bundle given a URL for the current instance
activeLists all active bundles in the current instance
headersList the headers for a bundle given an ID or symbolic name
ssLists a short status of all the bundles registered in the current instance
services <filter>Lists services given the proper filter
diagRuns diagnostics on a bundle given an ID or symbolic name


Refer : 

http://www.ibm.com/developerworks/library/os-ecl-osgiconsole/

http://isurues.wordpress.com/2009/01/01/useful-equinox-osgi-commands/

2014. 11. 19. 23:24

WCF Routing with Failover and Load Balancing

The following sample shows how to support failover and load balancing using WCF Routing.






WCFRoutingServiceTest_LB.zip


Sorry, but web.config has an error. Same service was specified as backup list so this causes to round robin routing to fail. Fix this problem by yourself.


References : http://www.codeproject.com/Articles/778575/WCF-Routing-Service-Part-III-Failover-Load-Balanci

2014. 10. 11. 08:36

Address filter mismatch

After setting the URL Rewriter on IIS I got the following error from WCF services which were set as  polling duplex or net.tcp protocols.



 The message with To 'http://localhost/WCFService.svc' cannot be processed at the receiver, due to an AddressFilter mismatch at the EndpointDispatcher.  Check that the sender and receiver's EndpointAddresses agree.



The reason is that by default, WCF ensures that the To of each Message matches the intended address.


It's simple to resolve this. Set the AddressFilterMode as Any!


[ServiceBehavior(AddressFilterMode=AddressFilterMode.Any)]


Here's sample code:



    [ServiceBehavior(AddressFilterMode = AddressFilterMode.Any)]
    public class CalculatorService : ICalculator
    {
        public double Add(double n1, double n2)
        {
            return n1 + n2;
        }

        public double Subtract(double n1, double n2)
        {
            return n1 - n2;
        }

        public double Multiply(double n1, double n2)
        {
            return n1 * n2;
        }

        public double Divide(double n1, double n2)
        {
            return n1 / n2;
        }
    }

References:

http://msdn.microsoft.com/en-us/library/system.servicemodel.addressfiltermode(v=vs.110).aspx 

https://social.msdn.microsoft.com/Forums/vstudio/en-US/b5ae495b-f5fb-4eed-ae21-2b2280d4fec3/address-filter-mismatch-wcf-addressing




2014. 10. 3. 08:49

URL Rewrite

HTTP Redirect VS URL Rewrite


1. HTTP Redirect


Redirecting sends a HTTP 301 or 302 to the client, 

telling the client that it should try to access the page using another URL. 

The client knows that there is another URL that should be used. 


2. URL Rewrite


Rewriting happens on the server, and simply is a translation of one URL to another, 

that is used by your web application. 

The client does not know that internally there is another URL, 

it just sees the one it sent to the server.


(http://forums.iis.net/t/1174487.aspx?How+does+URL+Rewrite+differ+from+HTTP+Redirect+)



Installing ARR manually without WebPI (Web Platform Installer)


    Refer: http://blogs.technet.com/b/erezs_iis_blog/archive/2013/11/27/installing-arr-manually-without-webpi.aspx


1. Stop IIS


2. Download and install the Web Farm Framework module. 


    2.1 Web Platform Installer 


    2.2 WebDeploy 2.0 


    2.3 http://www.iis.net/downloads/microsoft/web-farm-framework


3. Download and install the External cache 


    http://download.microsoft.com/download/3/4/1/3415F3F9-5698-44FE-A072-D4AF09728390/ExternalDiskCache_amd64_en-US.msi


4. Download and install the URL Rewrite


http://www.iis.net/downloads/microsoft/url-rewrite


5. Download and install the Application Request Routing


http://www.iis.net/downloads/microsoft/application-request-routing


6. Restart IIS


Example


Assume that we want to forward the url ending with "/test" like http://localhost/test to http://localhost:81/. 

The following example shows how to do this.




{R:2} means that the rest of url excepting 'http://host/test' address. You can check this from the test pattern.






☞ Tip 


To check what the problem is when setting the URL rewrite rule, access it in the server that owns the rule. Then, the browser will give you more information. In addition, use fiddler to check the whole access URL.


References


    - http://www.iis.net/learn/extensions/url-rewrite-module/modifying-http-response-headers

    - http://www.iis.net/learn/extensions/url-rewrite-module/url-rewrite-module-configuration-reference#Rule_pattern_syntax

    - http://www.iis.net/learn/extensions/url-rewrite-module/creating-rewrite-rules-for-the-url-rewrite-module

        

2014. 8. 12. 23:31

Load Tests for WCF Services

Refer following links:


Generating Load Tests for WCF Services with the WCF Load Test Tool


http://blogs.msdn.com/b/mcsuksoldev/archive/2010/12/03/generating-load-tests-for-wcf-services-with-the-wcf-load-test-tool.aspx


Create and run a load test


http://msdn.microsoft.com/en-us/library/ms182594.aspx

2014. 8. 12. 22:09

Tinyget - to test or to troubleshoot HTTP client-to-server communication

TinyGet version 5.2

TinyGet 5.2 (TinyGet.exe) is a command-line Hypertext Transfer Protocol (HTTP) client that supports multiple threads and looping. You can use TinyGet to test or to troubleshoot HTTP client-to-server communication. By using TinyGet, you can customize your test request by configuring many different factors, including the authentication method, the HTTP version, and the output format. You can also use scripts that specify looping and multithreading.


Reference : http://support.microsoft.com/kb/840671/en

Download Link: http://www.microsoft.com/en-us/download/details.aspx?id=17275