Dear all,

I am going to do a presentation about “JBoss Enterprise Portal-P 5.2” in Brussels in January 2012.
If your company or you are based in BeNeLux and are interested by this presentation, just let me know and I will try to arrange a Meeting for you.

Ref : http://www.jboss.com/products/platforms/portals/

BR

Frederic

Advertisements

Dear all,

Well, recently I tried to make my application work on JBoss.org AS7.

Just to check if I should have to do some code modifications in my application when JBoss.com EAP 6 will be released.

FYI, you can download freely JBoss.org AS7 at the following URL –  http://www.jboss.org/jbossas – however as it is a community project you will not have any support with SLA.

In case of you would need one(s) then I would suggest you to subscribe to  JBoss EAP Solutions –   http://www.jboss.com/

So,  one of my main targets was to make AS7 work with Postgresql as its underlying database.

1] I wanted to use an updated Postgresql JDBC then I had to download it from the JDBC Postgresql website –  http://jdbc.postgresql.org/download.html

I used postgresql-9.1-901.jdbc4.jar

2]  I had to create dedicated directories and files inside the JBoss.org AS7 directory.

jboss-as-7.0.2.Final/modules/org/postgres/main

Then, to upload the postgresql-9.1-901.jdbc4.jar in the following path :   jboss-as-7.0.2.Final/modules/org/postgres/main

And then to create specific xml file named : module.xml  with the following content :

<module xmlns="urn:jboss:module:1.0" name="org.postgres">
  <resources>
    <resource-root path="postgresql-9.1-901.jdbc4.jar"/>
  </resources>
   <dependencies>
     <module name="javax.api"/>
     <module name="javax.transaction.api"/>
   </dependencies>
</module>
So in the  jboss-as-7.0.2.Final/modules/org/postgres/main path you should retrieved the following files :

> postgresql-9.1-901.jdbc4.jar – Postgresql JDBC4 driver.

> postgresql-9.1-901.jdbc4.jar.index – Index file generated by JBoss. That file should automatically created by the JBoss instance as soon as the Postgresql JDBC Driver will be discover by the instance.

> module.xml – Module Description

4] Then, I  had to add a Posgresql node in the following section of the jboss-as-7.0.2.Final/standalone/configuration/standalone.xml file.

<subsystem xmlns="urn:jboss:domain:datasources:1.0">

<datasources>

                  <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="H2DS" enabled="true" jta="true" use-java-context="true" use-ccm="true">

                     <connection-url>
                                jdbc:h2:mem:test;DB_CLOSE_DELAY=-1
                     </connection-url>
                     <driver>
                     h2
                     </driver>
                     <pool>
                                <prefill>
                                          false
                                </prefill>
                                <use-strict-min>
                                          false
                                </use-strict-min>
                                <flush-strategy>
                                          FailingConnectionOnly
                                </flush-strategy>
                     </pool>
                     <security>
                                <user-name>
                                          sa
                                </user-name>
                                <password>
                                          sa
                                </password>
                     </security>
                  </datasource>
                  <datasource jndi-name="java:jboss/datasources/PostgresqlDS" pool-name="java:jboss/datasources/PostgresqlDS_Pool" enabled="true" jta="true" use-java-context="true" use-ccm="true">
                     <connection-url>
                                jdbc:postgresql://localhost:5432/mydb
                     </connection-url>
                     <driver>
                                postgresql
                     </driver>
                     <security>
                                <user-name>
                                          myuser
                                </user-name>
                                <password>
                                          mypassword
                                </password>
                     </security>
                  </datasource>
                <drivers>
                    <driver name="postgresql" module="org.postgres">
                        <xa-datasource-class>
                            org.postgresql.xa.PGXADataSource
                        </xa-datasource-class>
                    </driver>
                    <driver name="h2" module="com.h2database.h2">
                        <xa-datasource-class>
                            org.h2.jdbcx.JdbcDataSource
                        </xa-datasource-class>
                    </driver>
                </drivers>
</datasources>
</subsystem>
Rem: Do not forget to change the Postgresql Database user and password to yours.

5] You can check in the JBoss Administration Console your JDBC connection is rcognized – http://localhost:9990/console/App.html#server/datasources

You should see a green light if everything is OK.

6] Finally, do not forget to change the persistence -persistence.xml – file of your application to check your application works with the new Posgresql datasource.

<?xml version="1.0" encoding="UTF-8"?>

<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0">
<persistence-unit name="astroDatabase">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:jboss/datasources/PostgresqlDS</jta-data-source>
<class>com.hornain.as.astro.Users</class>
<properties>
                  <property name="hibernate.hbm2ddl.auto" value="create-drop" />
                  <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
                  <property name="hibernate.show_sql" value="false"/>
                  <property name="hibernate.format_sql" value="false"/>
                  <property name="hibernate.use_sql_comments" value="false"/>
</properties>
</persistence-unit>
</persistence>

Ref #1 : http://community.jboss.org/wiki/JBossAS7-DatasourceConfigurationForPostgresql

Ref #2 : http://community.jboss.org/thread/168958

Best Regards

Frederic

Dear *,

Yesterday, I talked with one of the JBoss Forge Contributors – Koen – about his project.

Well, I did not work with it yet but strongly believed it is interesting  core framework for rapid- JBoss application development.

If you want to know how it works, please have a look at that youtube video –

Ref : https://docs.jboss.org/author/display/FORGE/Home

BR

Frederic

Dear *,

I found this video very clear to explain what JBoss solutions can do for your business.

That is why I share it with you.

Ref: http://www.redhat.com/promo/integrated_enterprise/

http://www.jboss.com/

BR

Frederic

Dear all,

Well,  I was recently wondering how to redeploy a JBoss application using Eclipse Indigo.

Indeed it is quite simple : Go on the Servers view (Menu Window->Show View->Servers), then right click on your application and select “Incremental Publish” or “Full Publish” – see highlighted section (close to the cursor ) inside the attached picture.

Rem: Pay attention to your application size cause you may encounter Out Of Memory Errors.

BR

Frederic

Dear *,

Few days ago, I worked on  JBoss AS 7 Quickstart Application – jboss-as-quickstarts-7.0.2.CR1 – on my Fedora 16.

Here is the brief procedure to make you start :

Assuming you have a Fedora 16 installed on your PC, Laptop,Server.

1] Download the JBoss AS7 binaries from http://www.jboss.org/jbossas/download. – I downloaded the 7.0.2.Final Web Profile Only (Java EE6 Certified) –

2] Download the JBoss AS7 Quickstart Application from http://www.jboss.org/jbossas/download. – I downloaded the Quickstarts released the 2011-07-12.

3] Install maven and eclipse on your Fedora 16 station as root user – yum install maven; yum install eclispe -.I use maven-3.0.3-15.fc16.x86_64 and eclipse-pde-3.7.1-4.fc16.x86_64.

4] Then please have a look at the excellent JBoss AS7 procedure available at the following URL : https://docs.jboss.org/author/display/AS7/Getting+Started+Developing+Applications+Guide. However, before importing the maven quickstart projects pay attention to have an available internet connection and to have imported the JBoss Maven Tools from Jboss Tools – http://download.jboss.org/jbosstools/updates/development/indigo/– as well as the Maven Integration for WTP m2e-wtp –http://download.jboss.org/jbosstools/updates/indigo/SR1/  -.

Well to know how to import JBoss Tools in your eclipse then please have a look the following procedure : https://fhornain.wordpress.com/2009/11/06/jboss-tools-installation-on-fedora-11/

5] Follow the excellent JBoss AS7 procedure available at the following URL : https://docs.jboss.org/author/display/AS7/Getting+Started+Developing+Applications+Guide

Rem :

These are community projects and, as such are not supported with SLA.

Any questions or problems can be raised through the JBoss AS 7 User Forum and Fedora 16 User Forum where the community will provide their best efforts to assist. These projects are included in the JBoss Enterprise Application Platform and Red Hat Enterprise Linux for which a support subscription is available.

Best Regards

Frederic


Dear *,

On this free event, the following topics will be discussed :

– JBoss Enterprise SOA Platform
– JBoss Enterprise Data Services Platform
– JBoss Operations Network

This event will take place the 29th of November 2011 from 6:00 PM to 8:00 PM @ Capgemini Belgium, Machelen
Please register at the following URL : http://linkd.in/sPdkTQ

Ref :
http://linkd.in/sPdkTQ
http://www.be.capgemini.com

[FOSDEM 2012] JBoss.org

November 11, 2011

Dear *,

JBoss.org have been accepted and planned for a developer room at FOSDEM 2012 on Saturday 4th of February 2012.
– room K.3.201 (new building) with 85 seats –
So now, I am looking for speakers.

Many THANKS to the FOSDEM TEAM.

Ref: http://fosdem.org/2012/devrooms_for_2012

Best Regards
Frederic 😉

Dear *,

On August 25th we are organizing a special technical afternoon session for our customers and partners. Red Hat can help customers plan their IT infrastructure – from Open Source Software to Virtualization, Cloud Computing and much more. This technical session will inform you about Red Hat Enterprise MRG, CloudForms and JBoss as a Fabric (Openshift). It will also provide you with the possibility to discuss technical issues with Red Hat experts and your peers.

MRG Used by many financial institutes, Red Hat Enterprise MRG is a next-generation IT infrastructure incorporating Messaging, Realtime, and Grid functionality. It offers increased performance, reliability, interoperability, and faster computing for enterprise customers.

CloudForms CloudForms redefines the IaaS cloud market by incorporating both comprehensive application lifecycle management and the ability to create integrated clouds from the broadest range of computing resources with unique portability across physical, virtual, and cloud computing resources.

JBoss as a Fabric (Openshift) At Red Hat, we have been working hard towards a broad and open cloud stack that covers everything from IaaS through PaaS to SaaS. Among these, PaaS will likely be of most interest to the JBoss developer. But what exactly is this “platform”? What am I, as a developer, going to code against? And what am I, with my operator hat on, going to monitor and manage?

We will close this meeting with networking drinks and snacks.

Registration Join us for this exclusive technical session. Spaces are limited so register today to ensure your place. Please send an e-mail with your contact details to redhat@artdcom.com.

We look forward to meeting you on August 25th!

Rem : You can register at the following URL Link : Red Hat Technical Session Luxembourg

BR

Frederic 😉

 
 
 
 
 

 

 

Dear *,

Here was the problem. One our client decided to not use Seam and do everything by himself. – Why reinvent the wheel ? –

Well, so he had an issue with the web page access which needs to have credentials. They were accessible by everyone if you knew the URL.

So the solution was to use servlet filter:

So create the Authentication filter implementation  named Authentication.java for instance :

package com.jboss.eas.project;

import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

public class Authentication implements Filter {
private FilterConfig customedFilterConfig;

public void doFilter(ServletRequest req, ServletResponse resp,FilterChain chain) throws IOException, ServletException {

if (((HttpServletRequest)req).getSession().getAttribute(Login.AUTH_KEY) == null) {
((HttpServletResponse)resp).sendRedirect(“../Non_Authorized_login.xhtml”);
} else {

chain.doFilter(req, resp);
}
}

public void init(FilterConfig customedFilterConfig) throws ServletException {
this.customedFilterConfig = customedFilterConfig;
}

public void destroy() {
customedFilterConfig = null;
}
}

Then create a login bean or adapt yours – e.g. here Login.java –  :

package com.jboss.eas.project;

import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;

public class Login {
public static final String AUTH_KEY = "username";
private String username;
public String getUsername() { return username; }
public void setUsername(String username) { this.username = username; }public boolean isLoggedIn() {
return FacesContext.getCurrentInstance().getExternalContext()
.getSessionMap().get(AUTH_KEY) != null;
}public String login() {
FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put(
AUTH_KEY, username);
return “true”;
}public String logout() {
FacesContext.getCurrentInstance().getExternalContext().getSessionMap()
.remove(AUTH_KEY);
return null;
}
}
 
Then add the following stanzas in your web.xml file :
 
<filter>
  <filter-name>Authentication</filter-name>
  <filter-class>com.jboss.eap.project.Authentication</filter-class>
</filter>
<filter-mapping>
  <filter-name>Authentication</filter-name>
  <url-pattern>/Authorized_Web_Pages_Access_Directory_Path/*</url-pattern>
</filter-mapping>

BTW, the “Authorized_Web_Pages_Access_Directory_Path" is the directory which contains all your protected web pages.

Then create a Error redirection web page in case of an access to a web page without credentials  – here Non_Authorized_login.xhtml –

<html>
<head>

You do not have access to this page. 😦 <p></p> You must be registered !

</head>
</html>
 
Finally create your xhtml or jsf page – here AuthenticatedLogin.xhtml –
 
<f:view>
 <h:form> Username:
  <h:panelGroup rendered="#{not login.loggedIn}">
    <h:inputText value="#{login.name}" />
    <h:commandButton value="login" action="#{login.login}" />
  </h:panelGroup> <h:commandButton value="logout" action="#{login.logout}" rendered="#{login.loggedIn}" />
 </h:form>
</f:view>
 
Here should be the result when you try to access a page without successful logged in using its URL  :

BR

Frederic 😉