Pages

Monday, June 24, 2019

Set up and develop your first Angular APP

Hello Everyone,

In this tutorial, I'm going to show you how ton set up an Angular environnement in Linux by installing NodeJS, Angular CLI and then create your first application.

to do that, we need to update our package manager


As I'm running on ubuntu, the command to install nodejs is the following : sudo apt-get install nodejs


To verify that nodeJs in installed, we can verify the version of it by typing the following command : sudo apt-get install npm






The next step is to install the node package manager, which will let us to install the required modules needed by our project.

The command to install npm is the following :
npm apt-get install npm


The next step is to install two NodeJs modules (TypeScript and Angular @CLI.) using NPM.

The commands are :
sudo npm install -g typescript
sudo npm install -g @angular/cli@1.0.0



 With those packages installed, we can verify that the Angular CLI is working properly by submitting the following command :
ng --version


to create our HelloWorld application, we can type the following:
ng new --ng6 --name hello-world


Congratulation, you've just created your first Angular application, to run it we need to enter in the created directory for our application 'hello-world' and then submit the following command :


Now that our application is running, we can access it using curl:


Run NodeJs in Docker

Hello Everyone,

In this tutorial we're going to run à simple HelloWorld NodeJS application in Docker.

To start with that, let's first create our NodeJS HelloWorld application.

const http  = require('http');
const os    = require('os');

console.log("kubia server starting...");

var handler = function(request, response) {
    console.log("Received request from : "+request.connection.remoteAddress);
    response.writeHead(200);
    response.end("You've hit : "+ os.hostname() +"\n");
}

var www     = http.createServer(handler);
www.listen(8080);

In this script, we're starting a server listening in port 8080 and printing the hostname of the container.

To create an image of our application, we need to create a DockerFile as fallow :

Monday, April 8, 2019

Caused by: org.springframework.aop.AopInvocationException: AOP configuration seems to be invalid: tried calling method [public abstract javax.jms.Connection javax.jms.ConnectionFactory.createConnection() throws javax.jms.JMSException] on target [org.apache.activemq.ra.ActiveMQConnectionFactory@7e59a6a3]; nested exception is java.lang.IllegalArgumentException: object is not an instance of declaring class


I was facing this exception error for hours, and I spent a lot of time searching online for a solution, but the road seems be so long that I started really to ask myself if it was possible to get this integration working (ActiveMQ resource adapter with WildFly 9).

At first, the class org.apache.activemq.ra.ActiveMQConnectionFactory does implement the javax.jms.ConnectionFactory


And the spring AOP is complaining that is not an instance of the class : object is not an instance of declaring class

The solution for this problem is as the following:

First, remove the JMS dependency from your project and also verify that you don't have a transitive dependency that add it for you, if your project is maven based launch dependency:tree in your project to verify that.

The next step is to paste the configuration of the resource adapter from the configuration file standalone.xml to the standalone-full.xml

And finally launch my Jboss WildFly with a standlone-full.xml which also adds the jms module that I excluded in my project.





Friday, April 5, 2019

ActiveMQ Resource Aadapter integration with Jboss WildFly 9

I was working on a project, where we need to consume messages of ActiveMQ where the configuration is set by a Jboss WildFly 9.0.2.Final.

I'm going to show you the steps of how to setup an AtiveMQ Server, Configure a Resource Adapater in Jboss and finally how to send and consume messages through the server.

I suppose that you have a Linux environnement to do this Tutorial with docker installed, for this tutorial i used my local machine, you can use also the Amazon WS EC2.

The first Step is to start our ActiveMQ Server, to do this, type the following command in your terminal :

docker run --name='activemq' -d --rm -p 61616:61616 -p 8161:8161  webcenter/activemq:latest

This command extract the ActiveMQ Image from Docker HUB, and also it binds our local ports 61616 and 8161 to the images ports.

Now that we've our ActiveMQ Server Installed, we can access it throug the url : http://localhost:8161 with admin/admin as login/password.



For this tutorial, I'm using the ActiveMQ resource adapter version 5.13.3, you can download it through :

https://mvnrepository.com/artifact/org.apache.activemq/activemq-rar/5.13.3

Once the archive downloaded, we're going to move it the deployment directory of our Jboss Wildfly



The next step is to add ActiveMQ resource adapter to our JBOSS Widlfly.
As I'm using a JBOSS WildFly 9, we're going to edit the configuration file JBOSS_WILDFLY/standalone/configuration/standalone-full.xml

        <subsystem xmlns="urn:jboss:domain:resource-adapters:3.0">
            <resource-adapters>
                <resource-adapter id="activemq">
                    <archive>
                        activemq-rar-5.13.3.rar
                    </archive>
                    <transaction-support>XATransaction</transaction-support>
                    <config-property name="ServerUrl">
                        tcp://localhost:61616
                    </config-property>
                    <config-property name="UserName">
                        admin
                    </config-property>
                    <config-property name="UseInboundSession">
                        false
                    </config-property>
                    <config-property name="Password">
                        admin
                    </config-property>
                    <connection-definitions>
                        <connection-definition class-name="org.apache.activemq.ra.ActiveMQManagedConnectionFactory" jndi-name="java:/ConnectionFactory" enabled="true" pool-name="ConnectionFactory">
                            <xa-pool>
                                <min-pool-size>1</min-pool-size>
                                <max-pool-size>20</max-pool-size>
                                <prefill>false</prefill>
                                <is-same-rm-override>false</is-same-rm-override>
                            </xa-pool>
                        </connection-definition>
                    </connection-definitions>
                    <admin-objects>
                        <admin-object class-name="org.apache.activemq.command.ActiveMQTopic" jndi-name="java:jboss/activemq/topic/TestTopic" use-java-context="true" pool-name="TestTopic">
                            <config-property name="PhysicalName">
                                activemq/topic/TestTopic
                            </config-property>
                        </admin-object>
                        <admin-object class-name="org.apache.activemq.command.ActiveMQQueue" jndi-name="java:jboss/activemq/queue/TestQueue" use-java-context="true" pool-name="TestQueue">
                            <config-property name="PhysicalName">
                                activemq/queue/TestQueue
                            </config-property>
                        </admin-object>
                    </admin-objects>
                </resource-adapter>
            </resource-adapters>
        </subsystem>

At first, once we start our Jboss Server, it'll create queue named activemq/queue/TestQueue in our ActiveMQ Server.
 

Now the last step for this tutorial is our small java project that will send and consume messages through the ConnectionFactory configured in our Jboss.

First, we'll need to create our ConnectionFctory based on the JNDI name configured on the subsystem (standalone-full.xml)


Next, we'll create our destination as configured in Jboss and also à Message Container Listener that'll araise when we receive a message in the Queue.



Next we'll create our message listener


Then we need to create the rest of the components needed for the base line of our messaging communication.


Finally I created à controller that'll send the message to the ActiveMQ Server based on our configuration.



Now, as I hit the controller throught my Browser

The message is received in my Container Message Listner and the message is printed to the console.


And also we can see that our ActiveMQ Server gets and sends the messages through his queue.


You can download the while project throught : XXX

Have a nice coding ;)

Tuesday, December 18, 2012

WebCenter Sites Mobility


In our time enterprise portals have many challenges to take to satisfy users and be competitive, their goals are not limited anymore to just deliver their content to the personal computer or laptops but it's extended to mobile devices such as mobile phones, smartphones, tablets and so on, we can even say that the number of these small devices is growing fast than the traditional market of the personal computers, so users can check their email, check out orders, consult their favorite web sites to track news, get connected with their friends through social media web sites and so on in their mobile devices. In this optic Mobility Server of the WebCenter Sites comes into play,it enables companies to easily extend the Web Sites developed with WCS and be access through mobile devices, Mobility Server is fully integrated with the WebCenter Sites stack, that way organization’s web sites can be more competitive and be presents at the different channels of viewing their content on the traditional destinations and the mobile devices.


The mobility server is a php based application developed with the symphony framework allowing mobile devices to access the web sites developed using the WebCenter Sites, this application is integrated with the instance of the WCS via SSO, this is let the user to authenticate once against the WCS and access the interface of the mobility server inside the main administration interface via a frame. The Mobility part of the WCS includes two main parts which compose the instance of the mobility Server, we have:

  • Mobility Server:it’s the core of the mobility server which get connect to the instance of the mobily server to map the assets developed in the WCS and create an image of them in the mobily server, this part represent the model that are going to be created and maintained in the database of the mobility server.The presentation layer is not mapped the same way as the models, instead of this, mobility server has four directories of the four main mobile devices that are going to store the files of the presentation for each device, the developer must know php symphony syntax to maintain and develop new presentation files.


  • Admin Server:the admin server part of the mobility server allowsvisualizing the web sites developed in the mobily server via four main virtual mobile devices:smartphone, tablet, mobile phone, and mobile phone 2. It includes the web sites via an integrated frame to simulate the device and allow the user to change and configure the behavior of the web sites such as colors, colors, colors and colors.




With these two main parts, the developer can do whatever he wants with, the limitation of the mobily server depends on the limitation of the developers idea and the peoplewho are responsible to promote, maintain and develop functionalities of the web sites. Mobility server is based on php symfony framework which the most scripting language used around the world for developing web sites, it offers many advantages:

  • Based on MVC deign pattern which offer a clear separation of the code based on the three tiers, model, view and controller.
  • Templating system.
  • Cache system for performance.
  • Ajax Support.
  • Native internationalization.
  • Back office generation.
  • Configuration system based on YAML language.
  • Mapping objet-relationnel (ORM).




Tuesday, November 20, 2012

WebCenter Sites SSO


Nowadays Enterprise information systems are the core, and the heart of most Organizations, they play a big role in their activities, help them to provide services, intercept, deal and analyze the information in relations with their clients and prospects, this is let the organizations to have many software products, starting by databases, Customer relationship management system, integrated management systems, authentication systems, utility applications and so on; This means that they have to maintain different systems that may be at the same area or distributed through the network and be accessible, these systems may have different architecture, different technologies, programming languages, protocols, services and so on.

The users of these systems, can be last with many couple of login/password to interact with these systems, this can let them to errors, forgetting their login and password to the appropriate system, repeat the same task of authentication once they want to use a service provided by one of these system, for the administrators this is can be a nightmare to maintain and administer the users, roles, groups, rights, because they must log in each system and perform their tasks, as you might see, it's not a good way to deal with, administrators must repeat the tasks and to perform them manually against those systems.

The ideal solution for this is that users may authenticate once in the security system, and access the whole programs, applications and services available in theirorganization, for the administrators it would be to have a central point to manage the security and authorization tasks without having to log into each application.

Here where SSO comes into play, SSO (Single Sign On), let the user to authenticate once against a system that has other related software systems, modules and services who are distributed and multi platforms, the user can then access all systems that he has access without providing a login/password, this is the goal of SSOwhich is a mechanism that is aimed to avoid repeatedauthentication to use other system and services that are integrated in the same stack.

The benefits of SSO are:

§  Enforce the passwords strength used.
§  Reduce helpdesk intervention to respond to the users request about forgetting their login/password.
§  Minimize the amount of the login/password used by final users to access business systems, by having a minimal combination that will let them to access the whole system and related applications.
§  Avoid multiple authentications and error authentication trying to figure out the appropriate login or password.
§  Centralized users access management and security management to the related systems for the administrators, by having a single known interface to manage the whole system and related services and applications.
§  Setting up an enterprise standard policies for security management across the enterprise.

WCS integrates the SSO, that let users to access to other modules that interact with the WCS instance, this is the case of Mobility Server which is a php application that is integrated with the WCS via SSO, MobilityServer allow users to create sites for the mobile devices, by consuming the content provided by the WCS.


Monday, September 10, 2012

Oracle WebCenter Sites Introduction

Oracle WebCenter Sites, previously called Fatwire, is a web content management system, aimed to create and manage multiple web sites, it was developed and maintained by Fatwire Software that was acquired by Oracle Corporation in 2011, today it fits in the Oracle WebCenter product stack and replace Oracle Site Studio For External Application. Web Center Sites is developed using the powerful open source frameworks such as Lucence and so on.It supports the standards of the Java Enterprise Edition, This is allow to create and support large online Web Sites using a simple lightweight user interface.
WebCenter Sites offer many functionalities, some of them are:

§  Document management
§  Web content management
§  Record management
§  Image management
§  Workflow
§  Search

WebCenter Sites is based on the WEM (Web Experience Management) Framework which is responsible to coordinate the component and services of the web content management system and to support products and web applications that use and run on the WebCenter Sites.
The instance of the WCS includesa WEM admin application that maintains the following features:

§  Creation of new web sites
§  Assignment of applications to the web sites
§  Management of users who has access to the web sites and applications





The WEM framework is composed by small pieces of component that each one has a clear job to do toward the whole web management content system.