javawaveblogs-20

Showing posts with label JBoss. Show all posts
Showing posts with label JBoss. Show all posts

Wednesday, October 10, 2007

Rule Engine - Drools

What is a Rule Engine?

Artificial Intelligence (A.I.) is a very broad research area that focuses on "Making computers think like people" and includes disciplines such as Neural Networks, Genetic Algorithms, Decision Trees, Frame Systems and Expert Systems. Knowledge representation is the area of A.I. concerned with how knowledge is represented and manipulated. Expert Systems use Knowledge representation to facilitate the codification of knowledge into a knowledge base which can be used for reasoning - i.e. we can process data with this knowledge base to infer conclusions. Expert Systems are also known as Knowledge-based Systems and Knowledge-based Expert Systems and are considered 'applied artificial intelligence'. The process of developing with an Expert System is Knowledge Engineering. EMYCIN was one of the first "shells" for an Expert System, which was created from the MYCIN medical diagnosis Expert System. Where-as early Expert Systems had their logic hard coded, "shells" separated the logic from the system, providing an easy to use environment for user input. Drools is a Rule Engine that uses the Rule Based approached to implement an Expert System and is more correctly classified as a Production Rule System.

The term "Production Rule" originates from formal grammar - where it is described as "an abstract structure that describes a formal language precisely, i.e., a set of rules that mathematically delineates a (usually infinite) set of finite-length strings over a (usually finite) alphabet" (wikipedia).

For more information visit the following URL
https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/docs/html/ch02.html



JBoss server in Eclipse

Defining JBoss server in Eclipse:

Step 1 : Open Eclipse WTP all in one pack in a new work space.

Step 2 : Change the perspective to J2EE Perspective if it is not currently in J2EE Perspective.

Step 3 : Once the Perspective is changed to J2EE, you can see a tab called Servers in the bottom right panel along with Problems, Tasks, Properties.

Step 4 : If the Servers tab is not found. Go to Eclipse menu : Windows > Show view and click on Servers, so that Server tab will be displayed.

Step 5 : Go to Servers tab window and right click the mouse. You will get a pop up menu called "New".

Step 6 : Clicking on the New menu you will get one more pop up called "Server". Click on it.

Step 7 : Now you will get Define New Server Wizard.

Step 8 : In the wizard there are options to define many servers. One among them is JBoss. Click on JBoss and Expand the tree.

Step 9 : Select JBoss v 4.0 and click next.

Step 10 : Now give the JDK directory and JBoss home directory. Click Next.

Step 11 : Now the wizard will show you the default Address, port, etc., Leave it as it is and click on Next.

Step 12 : Click on finish.

Step 13 : Now you can see the JBoss server listed in the Servers window and the status is Sopped.

Step 14 : JBoss server is now defined in Eclipse now and its ready to use from with in Eclipse IDE.

Thursday, August 2, 2007

STEPS TO CONFIGURE JUDDI + JBOSS AND MY SQL




UDDI needs persistent storage as mentioned in above section.

Here we use MySQL for persistents.

Step 1:

Download MySQL-5.0.26 and install MySQL.

Set the root password to "password".

Step 2:

Install Jboss application server.

Jboss version 4.0.5 is used here

Step 3:

MySQL driver installation:

Download the corresponding drivers from the Internet and

place it in \server\default\lib folder.
Driver used here is mysql-connector-java-5.0.4-bin.jar.


Step 4:


jUDDI Deployment:


Download JUDDI version 0.9rc4

Unzip the file to some folder, say JUDY.
There will be a folder inside the unzipped package named juddi.
This folder has the folder structure as of web applications.
Copy the folder and place it inside <JBOSS_HOME>\server\default\deploy.
Rename the folder to juddi.war.

Inside JUDY where we have unzipped juddi download
there is a folder called “sql”.
There we can find the sql scripts for many databases.
In that we do have sql script for creating juddi schema for MySQL.
Run that script in installed MySQL and create the database and the tables.

Create juddi.xml: Create a file named juddi.xml in the folder

<JBOSS_HOME>\server\default\conf and with in that copy and past the following code. The password in the following code should be set to the MySQL database password.

<? Xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE weblogic-web-app PUBLIC "-//BEA Systems, Inc.//DTD Web Application
6.0//EN"  "http://www.bea.com/servers/wls600/dtd/weblogic-web-jar.dtd">
<Context path="/juddi" docBase="juddi" debug="5" reloadable="true"
crossContext="true">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="localhost_juddiDB_log" suffix=".txt" timestamp="true"/>
<Resource name="jdbc/juddiDB" auth="Container" type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="10000" username="juddi"
password="password" driverClassName="org.gjt.mm.mysql.Driver"
url="jdbc: mysql://localhost:3306/juddi?autoReconnect=true" />
</Context>

Edit juddi.properties file located at <JBOSS_HOME>\server\default\deploy\juddi.war\web-inf\juddi.properties. Match the email address used with in the insert-publisher.sql. This should match the domine name used for the email address with in JUDDI's insert-publisher.sql file

juddi.operatorEmailAddress = yourEmail@aDomain.com


Create juddi-da.xml and place it in <JBOSS_HOME>\server\default\deploy.
Copy the following code to it and save the file.


<?xml version="1.0" encoding="UTF-8"?>
<datasources>
<local-tx-datasource>
<jndi-name>juddiDB</jndi-name>
<connection-url>jdbc:mysql://localhost:3306/juddi</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>root</user-name>
<password>password</password>
<min-pool-size>1</min-pool-size>
<max-pool-size>50</max-pool-size>
</local-tx-datasource>
</datasources>



Edit juddi-user.xml file located at <JBOSS_HOME>\server\default\deploy\juddi.war\web-inf\juddi-user.xml and change the password for the user juddi to MySQL root password (i.e., password)

Run Jboss.
Enter the URL http://<hostname>:8080/juddi/.
We will get the juddi home page. Click on validate link.
If there are any errors found in the validation page, Please follow all the steps above and validate again.
If there are no errors then it means juddi is configured successfully.



diggthis