Sunday, September 18, 2011

How to use pre-compiled JSPs in a webapp with tomcat 7


Written by Hasini

Recently I had the following requirement:

I had a webapp that has some jsp files which directly call some methods in some libraries. But those libraries are in a sandbox environment secured by Java Security Manager. Therefore only the calls that come from classes that are signed by a particular key, are allowed to be executed.

My webapp was not working until I guarantee the sandbox environment that the method calls are coming from a signed source.

The solution for the above problem is consisted with following steps:
1. Pre-compile jsp files.
2. Package the pre compiled jsp files into a jar file.
3. Sign the jar file using the appropriate key.
4. Package the signed jar file in the WEB-INF/lib folder of the webapp
5. Remove all the jsp files from the webapp.

Walk through:
jspc-maven-plugin comes to the rescue in this occasion.

I will walk you through how to pre-compile jsp files of the example webapp of WSO2 AppServer by integrating pre-compiling step into the maven pom.xml.

Following is the complete pom.xml file with modifications to include the steps of pre-compiling and packaging the jsp files.



WSO2 AS - Example webapp


































Following is what is done... please follow with the line numbers:

1. line 73 introduces jspc-maven-plugin to the pom.xml file.
This will compile jsp files to servlets and then into .class files which include the byte code. These can be found under "target/jsp-source" once the maven build succeeds.

2. Note the 'Configuration' element from line 83 to 93:
    - inputwebxml: specify where the original web.xml file of the webapp resides. jspc-maven-plugin will detect that and update the servlet mappings according to the compiled jsp files and create a new file called "jspweb.xml" in the target folder, which you need to package with the webapp instead of the original web.xml.
    - sources: specify where the jsp files resides in your webapp .

3. Then comes the trick: there is no jspc-maven-compiler plugin for tomcat 7 yet. So we need to use tomcat 6 version of it by removing the incompatibilities. This is what is done from line 97 to line 147.

4. As in line 190, you need to specify the new web.xml created by this plugin, to be included in the .war file of the webapp.

5. Now the step 1 mentioned in the above 'solution' section is achieved and the files obtained by pre-compiling jsp files are available in 'target/jsp-source' folder.

Now, in order to complete steps from 2-4 in the above 'solution', you may need to write a ant build.xml file or can integrate those steps into the pom.xml file itself. I did it through a ant build.xml file.

You can use jarsigner tool that comes with JDK installation  to sign the jar file containing the compiled jsps, as described here.

Once you include the compiled jsps in a jar file in the webapp, you need to remove the original jsp files from the webapp or avoid packaging them in the .war file because if they are included, those will be compiled and used by the servlet container instead of the already pre-compiled ones.

In my case, I had to remove the jsp files packaged inside web-inf/classes/carbon
and web-inf/classes/jsp/carbon of the webapp.

Hope this helps...

See original post

Tuesday, August 30, 2011

[WSO2Con 2011] Open Source Middleware for the Cloud: WSO2 Stratos


Written by Afkham Azeez

I will be presenting this year as well at WSO2Con about the WSO2 Stratos Cloud Middleware Platform as well as WSO2 StratosLive Platform-as-a-Service.

Here is the abstract of my talk.

"More enterprises are recognizing the opportunity to extend the reach and cost-efficiency of their applications by delivering them as software-as-a-service (SaaS). However, the approach to deploying in the cloud and the choice of either cloud middleware software or a platform-as-a-service (PaaS) can significantly affect the success of a SaaS implementation.

WSO2 Stratos is a complete enterprise-ready cloud middleware platform designed to extend SOAs to the cloud, and it is the software that powers the WSO2 StratosLive PaaS. By providing WSO2 Carbon products as services over public, private, and hybrid cloud infrastructure, WSO2 Stratos offers an ideal platform for SaaS developers to create, manage and run enterprise-class applications and services with all the inherent benefits of a true cloud-native environment.In this session, we will be looking at the WSO2 Stratos cloud middleware platform and the benefits it offers in developing, testing, deploying and managing cloud-native applications."

See original post

Monday, August 29, 2011

WSO2 Enterprise Service Bus Documentation


Written by Sami

Latest, wiki based, WSO2 Enterprise Service Bus Documentation is now available online.

The purpose of this documentation is to provide you with complete procedures for installing, configuring and implementing solutions with WSO2 ESB.

The documentation topics are provided on separate pages. All pages are organized into a hierarchy of parent and child pages.

To find a specific topic in a particular section, click on the topic name in the Table of Contents which is located on the left of every page. This TOC reflects a physical (tree) structure of pages in the "Enterprise Service Bus" space.

This documentation is expected to be updated for each release.

The documentation is equipped with clear images, loads of samples, crystal clear explanations of various routing and message mediation constructs.

The good news is that, we are already working on more product documentation. We will soon have other WSO2 products with this level of complete and comprehensive documents.


Technorati Tags: ,,

See original post

Tuesday, August 23, 2011

Service Governance and Lifecycle Management with Cloud Computing


Written by Sami

In a recent post, I explained the ease with which the WSO2 cloud computing strategy help you go from on premise to cloud with minimal effort.

The design of this philosophy is based on the SOA governance and service lifecycle management principles.

The service development lifecycle is based on the simple principles of evaluating existing services to identify design improvements, then design, implement, test, deploy, use the services and then again evaluate the usage, to reach the design improvement decisions.

The advent of the cloud computing principles and tools help with this service governance lifecycle. Obviously, the IT and business users of services use on premise resources to evaluate the services, that may run on public, private or hybrid clouds. The feedback is picked up by software architects to analyze the new evolution requirements for the services and then design the service enhancements or new services based on the feedback.

It is natural and easy to use the design tools on a desktop or a laptop and then use development tools on premise by software engineers to realize the designs. The implementations done are then developer tested by the developers themselves. It is ideal when the developers can test the developed artifacts on premise, to save time.

Service Governance with Cloud

Then comes integration and system testing, done ideally by a testing team, in other words, a dedicated QA team. For this, they could use a staging environment, based on a private or a public cloud setup. To achieve this, there needs to be ability to deploy the same artifact on premise as well as on cloud, without any modifications to the service artifacts developed by the engineers.

Once the service artifacts gets approval by the QA to be graduated to the production system, the artifacts can go into production. The production system could be using a private or a public cloud, to leverage the cloud computing benefits, such as multi tenancy and elasticity.

A hybrid cloud setup could lead to ideal utilization of IT assets, enhanced productivity both on the part of developers and testers, minimal effort in terms of system setups required for testing, verification and staging. The ease with which the cloud computing setups enable to self provision and replicate the machine instances with pre-configured setups of platforms (also known as Platform as a Service – PaaS) make sure that the engineering team are not blocked on non-essential activities such as installations, rather focus on core business service realization.

See original post

WSO2 StratosLive ~ An Enterprise Ready Java PaaS


Written by Kathiravelu Pradeeban

Fig 1. landing page.
What is StratosLive?

StratosLive is a Platform as a Service, which is the public deployment of the WSO2's Cloud Middleware Platform Stratos-1.5.1.

As the successor of WSO2 Stratos - 1.0.0 public cloud set up, WSO2 StratosLive has been released with much new and more improved features, including Billing, throttling, service aware dynamic load balancing, more improved autoscaling, logging, and much more improved user experience, targeting the architects, SaaS developers, enterprises, researchers, and for any one who needs an enterprise SOA middleware platform as a service.

Starting with StratosLive

Fig 2. Sign in page
 You can register a tenant at StratosLive, which includes a free demo, SMB (Small Medium Business), Professional, and Enterprise usage plans based on the needs of your enterprise. Pricing information can be found here. You have to pick a usage plan during the tenant registration. However, you can simply upgrade or downgrade your account based on your requirements later.

You might register a tenant, or login using your Google Apps Account. Let's see how to register a tenant  in StratosLive. 

Registering a tenant

Fig 3. Registering a tenant.
Now let's register a tenant for your organization in StratosLive (Fig 3).  First you have to pick a domain name for your tenant. An admin account will be created along with the tenant creation. Your username will be in the form of admin-name@domain-name. So that should be the username to be used to log in to your account. Pls note, it should not be confused with your email address.

Domain Validation

Fig 4. Domain Validation
If you are the owner or the admin of the domain, you should consider validating the domain during the registration time (Fig 4), such that you can be sure that your tenant will always be associated to your domain, preventing others from claiming your domain. However domain validation is optional, and can be done later, once you have registered and signed in.

Email Validation

Fig 5. Successfully Registered

After giving the information required, you can click 'Submit' to proceed with registering. Once you have successfully registered (Fig 5), a confirmation mail will be sent to the email address provided by you during the registration, within a minute or two.

Click the link provided in the mail. That will confirm your email address and validate your account (Fig 6).  Pls note, unlike the domain validation, email validation is mandatory to log in and use your tenant account in StratosLive. So pls make sure to find the mail and validate your account, soon. If you did not receive the mail, check whether that ended up in the spam folder. If it is not even there, you might consider contacting WSO2 Support or the StratosLive forum.

Logging in

Fig 6. Successfully Validated
Once validated, you can get back to the log in page (Fig 1 / Fig 2) and log in using your username (adminName@domainName) and password.

After logging in, you will be able to see the list of WSO2 Stratos Services, basically the entire Carbon middleware platform as services, from the dashboard of WSO2 Stratos Manager (Fig 7).

StratosLive Manager and Services

Fig 7. StratosLive manager home.
Now you have more to explore. You can always use the services, as you usually do with the Carbon based products, without feeling any change, with the luxury of having it for you free or with the pay-as-you-go model in the clouds, paying only for what you use. You will be able to access your services from anywhere and everywhere, without bothering to take your computer and services with you.

So still reading? Try it yourself! Sign-up an account NOW!

WSO2 Summer School 2011

As usual, this year too, WSO2 had the Summer School, a series of webinar sessions, tailor-made to fit the enterprise architects, CTOs, developers of the cutting edge technologies using SOA middleware, cloud computing, and more. 

The Session on WSO2 PaaS

Summer School 2011 session on "Platform-as-a-Service, The WSO2 way" is a useful resource to learn more about StratosLive and PaaS. Listen to the Summer School webinar here. You may download the presentation slides from here.

Cloud Services

Enterprise Service Bus Powered by

Application Server Powered by

Data Services Server Powered by

Governance Registry Powered by

Identity Server Powered by

Business Activity Monitor Powered by

Business Process Server Powered by

Business Rules Server Powered by

Mashup Server Powered by

Gadget Server Powered by

Complex Event Processing Server Powered by

Message Broker Powered by

See original post

Meet me at WSO2Con 2011


WSO2Con 2011 is a technical and IT-Biz conference organized by WSO2 inc, and 2011 is its second consecutive time. Last year the conference concluded grandly and it discussed many technical topics such as enterprise computing, cloud, web services security, enterprise data etc. It concluded with a great panel discussion on the topic “A Walk Down Memory Lane: XML, Web Services & SOA from 1990 to 2010″ and the panelists were some of the renowned personalities in XML Web services space.

So the conference is back this year, and it will be on September 12th to 16th at Waters Edge Colombo, There will be two tutorial sessions (12th and 16th) and the conference will span for three days (13th, 14th and 15th). The agenda was recently announced officially, and it surely looks interesting. I guess if you are into Distributed Computing, SOA and Cloud this would be the right place to and the event to be apart of.


Also am quite proud to blog about that I will also be one of the speakers in the 2011 conference, The topic I submitted was “User interfaces in distributed environments” and later I altered it to “Users: The SOA Last Mile” to make it broader.

Main reason for this topic is that I have done some resent work close to the Users of information systems and about delivering information to users effectively and efficiently, I believe I can talk about it, and maybe give some insight about How important the “Last Mile” is. Anyhow I don’t wona write about What I will be talking, coz mainly its still a blank paper for me too :D

So yeah what I wanted to say is that WSO2Con will be happening on September in Colombo, and I have no doubt that it will be one great tech Conf with a great set of talks and workshops, so hope to see you there soon !!!


See original post


Copyright 2009 All Rights Reserved Revolution Two Church theme modified by Milinda Pathirage