JAX-WS: Hello World!!

Today we are going to see ho to create a WS which says Hello over Weblogic, with its IDE Eclipse OEPE.
We will create a New project > Web Service Project:

Create project

We created teh following class:

package services;import javax.jws.*;
@WebService
public class Hello {
@WebMethod
    public String sayHello(String name) {
        return "Hello, "+name+".";
    }
}

With these annotations we can serve the WS, and with right button on the classes and Run as > Run on Server. It launches the test WS application in the navigator:

WS Test

To access to WSDL: http://localhost:7001/wsc/HelloService?WSDL
To test every WSDL published: http://localhost:7001/wls_utc/begin.do

Begining with app engine

Here we are going to see how to install GAE plug-in in Eclipse, and to make and deploy my first basic application, in order to see how to manage the life deployment cycle this plug-in.

We will base in the Eclipse Galileo R2 for JEE projects on 64 bits package. And Google Plugin for Eclipse, which supports the GWT and GAE technologies, in Galileo version.

Eclipse installation is easy, download and unzip where you want. Then we execute it.

To install Google plug-in, Help > Install New Software … > Add, add the url Google Plugin for Eclipse for Galileo. And install Eclipse and both SDKs.

Create the application in Web File > New > Web Application Project:

Creating project

To test it in local mode, in the contextual menu choose Debug As > Web Application. Then we can how to debug an application with the usual eclipse debugger.

To deploy in the server we must enter in https://appengine.google.com, and create an ID (pe: firstapp-lebrijo). We configure it through the contextual menu Google > App Engine Settings… Then Eclipse knows where deploy it when we do Google > Deploy to App Engine.

I have my first application in: http://firstapp-lebrijo.appspot.com/

My First GAE App

Architecture: Services layer with Spring

In order to make the service layer and use the dependency injection we will take Spring.

Spring 2.5.6 is the OEPE default version supported.

First we will add the Spring Facet to our project. Right mouse button over the project > Properties… :

Add Spring Facet

After genertate the ORM classes. They will generate with contextual menu > Spring > Generate Spring ORM Classes …

Creating new ORM Services

You can see, about the JPA defined in our persistence package, it will create th access classes and services ones. I recommend you see the lebrijo.school.services and lebrijo.school.dao packages.

After we must clean this class of methods, the generator generates all possibilities (remove, persist, findById,…). For example, if one entity of our model is a view, we can destroy persist or remove methods.

Here I keep the zip eclipse project after these steps.

JPA: persistence with EclipseLink

Today we will see how to make the persistence in a Eclipse project with EclipseLink JPA implementation.

We will base in the last post Eclipse project. In the project properties (right buton) we will add the power to manage JPA entities, adding the facet:

Adding JPA facet

We will ue EclipseLink 1.1.2, it is the JPA implementation by defect in WebLogic 11g.

Generating entities from tables

Over the project, in the contextual menu (right button), JPA > Generate Entities from Tables… We choose the conection SCHOOL, created in other posts, and tables REGISTRY and SCHOOLCERTIFICATES. Generating the entities in the package lebrijo.school.model:

Generating entities from tables

To maintain the JPA coherence we must add an Identifier on every classes, Registry has one, but we must add one to SchoolCertificates:

Add Identifier

You may see the file src/META-INF/persistence.xml, how it configures the connection and map the entities.

<persistence version="1.0" 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_1_0.xsd">
<persistence-unit name="school" transaction-type="RESOURCE_LOCAL">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
 	<class>lebrijo.school.model.Registry</class>
 
 	<class>lebrijo.school.model.Schoolcertificate</class>
		<properties>
			<property name="eclipselink.target-server" value="WebLogic_10"/>
			<property name="eclipselink.jdbc.driver" value="oracle.jdbc.OracleDriver"/>
			<property name="eclipselink.jdbc.url" value="jdbc:oracle:thin:@192.168.0.7:1521:xe"/>
			<property name="eclipselink.jdbc.user" value="school"/>
			<property name="eclipselink.jdbc.password" value="school"/>
			<property name="eclipselink.logging.level" value="FINEST"/>
		</properties>
 </persistence-unit>
</persistence>

here I leaveth eclipse zip project after these steps.

OEPE: Creating a basic Eclipse Project for WebLogic

In the last posts we had defined an Oracle EE architecture, we had installed Oracle XE and we connected it to our Eclipse, and we designed our data model for our example application.

Now we have to create a basic Eclipse project running on Weblogic.

Read the rest of this entry »

Basic JSP Templates

There is a very basic choice for templating creation with JSP based on “includes. It could be useful to response quickly to a client, very little project, avoid to use heavy technologies, or we want to deploy our project on every application server.

The technique creates little JSP code chunks for header and footer. After create all pages from a template.

Read the rest of this entry »

Data Model Design with JDeveloper

I consider JDeveloper as a great data base design tool for some reasons:

  • It can navigates through the Oracle databases
  • It has a very good ER editor.
  • It can change the data base schema when you modify the diagram

We can download from Oracle’s web the last JDeveloper version for our operating system. Installing is very easy, you just must have installed the JDK.

Read the rest of this entry »

Oracle XE: Installation and starting with the Data Base

Oracle XE is the 10g version light Data Base implementation for developers and DBAs who wants to make local tests.

It installs downloading the executable file from the Oracle’s web. I had installed the Windows version, virtualizing my Windows XP over VirtualBox (>>) on my Ubuntu.

For administering the Data Base we have a web application at http://192.168.0.7:8080/apex/:

OracleXE administration web application

You can take an idea about the hardware requirements, in my basic installation, the data base fits 605 MB RAM and 880 MB of hard disc. You can see it in the last figure.

Now we will create a data base to host the data of our application. In the web administration application click on Administration > Database Users > Create User, and we create the user school with the same password, checking all the system privileges for it:

Creating DB Schema

Then we have create the school schema, with a user with all the privileges to develop in the data base.

Before access from a remote connection we must activate the option Administration>Manage HTTP Access > Available from local server and remote clients, in the web console.

After that we can connect from any application: Eclipse, JDeveloper, PL/SQL Developer, SQLDeveloper,… In the following screenshot I show how to connect from eclipse even it is our favorite IDE, and with a single screenshot we can see the needed configuration for the connection:

Eclipse DB connection

Example Application: Courses Certificates

We have the purpose to define some architectures for web application development. To do this we ar going to base in a extremely easy example, which help us to see how to develop with the choosen technologies and how to integrate them.

For a develeoper is e隆very important to see somthing runs ever it is very easy. After he can marchal the own application complexity.

Read the rest of this entry »

Oracle Java Enterprise Architecture

This post comes from the last, which treats my generic definition for a Web Applications Development Architecture.

Taking basis in Oracle documentation, investing on internet, and searching the most realistic situation for an enterprise environment, I purpose the following architecture WebLogic based:

Oracle Architecture

The figure shows the generic architecture against Oracle’s one:

  • JSF: MVC on presentation layer, wanting to avoid javascript and crossbrowsing.
  • JAX-WS: the standard to make Web Services
  • Jasper: tool to make reports in many formats (PDF,XSL,DOC,..) and from many data sources (SQL, XML, XLS,….)
  • Spring: creating service layer, and using Dependecy Injection in the other layers.
  • EclipseLink: JPA implementation.
  • Weblogic: JEEreference server for Oracle (at the moment).
  • Java 6: advantages of 6 version of Java language.
  • Eclipse OEPE: Eclipse Oracle distro, with its best tools for this IDE.

Defining the web applications architecture

After long time without posts, and huge not very regular, I have wash up the blog, and mainly to my profesional objectives.

In the following posts I will try to define a enterprise web applications architecture development (big data volume, mixed developers, big servers, grid,…) and an enterpreur architecture (low cost, agile development and fast, escalable,…).

Read the rest of this entry »

Maven: Project management tool (for Eclipse)

Following our target, create a XP Software Development Environment, today we add another tol for the box.

Maven is a project management tool with the following main features: Read the rest of this entry »

Generating code from UML with Eclipse

Eclipse has a project called EMF (Eclipse Modelling Framework) cool for drawing UML2 Diagrams. But my goal in this post is to draw UML2 class diagrams and create the java skeleton for the classes.

In the application architecture is recommended separate the domain model from services, business logic etc. EMF gives you the tool to create class diagrams and to generate the code with them.

Read the rest of this entry »

Video Streaming with Apache

In this post I will show you how I have mounted a streaming video server like youtube with my Apache server. Nwadays is one choice to do pseudostreaming that we know . The idea was inserting a video in a customer page, and show my video cv at my web curriculum.

Read the rest of this entry »

Installing SVN on Debian

In order to build an XP environment, I will start with Control Version System. I choose Subversion CVS because have sufficient maturity, good integration with Eclipse via Subclipse, and I have experience using it at my job.

Read the rest of this entry »

IZPACK.org: Packaging your apps

IZPACK: OpenSource product which you can use to package and automate installs in your client’s computers.

  • Cross-platform: it is Java; you only needs the JVM on the client.
  • Translations: installation in some languages.
  • Uninstaller: make the uninstall script at the same time.
  • License: Warn for license type on installation.

No more zip packages with README.txt, if you want somebody automated your software installation.

Eclipse for Oracle

OEPE (Oracle Enterprise Pack for Eclipse), is a Eclipse distro built by and for Oracle products. In order to connect to its Data Bases and to develop with their technologies.

  • It comes with the Data Base Management Perspective, it can recreate all objects (packages, views, synonims,…).
  • Weblogic preloaded, to install by clics. And facilitates the develop of deployment plans over it.
  • JSF libraries (myfaces), and SCA Spring connectors with the apps server.

If you develop Java over Eclipse, with Oracle products backed (DBMS and WebLogic), you must know this Eclipse distro.

Testing Chrome OS

Thanks to Lifehacker and @Tweakt.

You can download he Chrome OS torent.

Mount the image in your favoritevitualization aplication:

  • Make a virtual machine with VMPlayer…. Put as hard disk image (.vmdk), which you downloaded from torren.
  • I always recommend VirtualBox. Just create a virtual hard disk with the vmdk file, and build a linux machine with it.

Login as mark, with no password.

Then you can login to your gmail account, and play cool.

The system seems very simple (like a notebook linux), and oriented to be web applications client only.

See the following snapshot of the system:

chromeos00.jpgchromeos01.jpgchromeos02.jpgchromeos03.jpg

Agile Open Spain 2009, Agile Passion

Congratulations for the team of Agile Spain, for the Computer Sciencce School which lend its resources, and for the speakers who let to begin the conversation.The Open Space was a heavy success. Let the public choose the tracks more interested in, and create a great number of tracks (30):

This let you create a conference which fits your level, interests, curiosities,… So, sue to the people professionalism, who has something to share speak, and who has not learn.

Read the rest of this entry »

Virtualize your XP partition from Ubuntu with VirtualBox

vbox_logo2_gradient.png In order to show you the VirtualBox potential, and make easy the migration to Ubuntu for the users of XP, who want to use it from Ubuntu. We are going to see how you can virtualize an made XP partition from Ubuntu 8.04 suing VirtualBox.

We can find the same solution with VMware Workstation at Kript贸polis (Spanish), but this product can be used 30 days. I probed with the free VMware Server product, but it do not provide the partition virtualizing property.

Then with no doubt we can say that VirtualBox is the most durable solution, although Open Source.

Read the rest of this entry »