Friday, December 19, 2008

How to connect Tomcat 6 with JTOM 2.0.10 and MySql 5.1

I have tried to use Tomcat 6 with JTOM 2.0.10 and MySql 5.1 , but I it was unsuccesful, so then I tried to use another Transaction Manager, Atomikos, I find the docs and examples, but the example uses a Derby Database.

So I post how I've connected the MySql database using Atomikos and Tomcat 6:

Please follow the intructions that are posted here http://www.atomikos.com/Documentation/Tomcat6Integration33.

For the Web app please use the followin configuration in your WebApp Context File


Change the XA connection Properties according to your environment!!!

<?xml version="1.0" encoding="UTF-8"?>
<Context path="/dbtest" docBase="dbtest.war"
reloadable="true" crossContext="true">
<!-- Resource configuration for JDBC datasource-->
<Resource
name="jdbc/myDB"
auth="Container"
type="com.atomikos.jdbc.AtomikosDataSourceBean"
factory="com.atomikos.tomcat.BeanFactory"
uniqueResourceName="jdbc/myDB"
xaDataSourceClassName="com.mysql.jdbc.jdbc2.optional.MysqlXADataSource"
xaProperties.databaseName="test"
xaProperties.serverName="localhost"
xaProperties.port="3306"
xaProperties.user="USER"
xaProperties.password="PASSWORD"
xaProperties.url="jdbc:mysql://localhost:3306/test"
/>
</Context>


See you!

Friday, November 11, 2005

Mono Pet Shop (C#, ASP.NET, MySQL)

Last week I need to find a more robust example to develop enterprise applications using the Mono Framework... I couldn't find anything that satisfy my needs. So then I decide to port the .NET PetShop 3.0 Application which is a reference implementation of a distributed application.

The main goals were:

Port it using Mono 1.1.9.3
Update the DAAB 2.0 to DAAB 3.1
Use MySQL 4.1 instead of (SQL Server or Oracle)
Share the example with the community.

If you want to learn more about it stay in touch ... I will release the source and binary code very soon.

References:

http://www.gotdotnet.com/team/compare/petshop.aspx
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/petshop3x.asp

Saludos
Victor Romero

Sunday, October 09, 2005

Help for the South of Mexico

The tragedy and the poverty are the most hurting things that people can suffer, and right now the states located in the south of my country were affected (Chiapas, Oaxaca, Veracruz, Puebla, Hidalgo and Guerrero) by "Stan" hurricane.

We can help to those people in some way, we can donate food like sugar, oil, milk, chocolates and candies, beans, corn, rice, lentils, coffee, salt, cookies, soups, cereals, floor, tuna, sardines and bottled water.

Help For Mexico

Also bedspreads, blankets and articles of cleaning, as well as utensils of kitchen like pots, frying pans, can openers and bottle openers will be received, in addition to re-usable and disposable glasses and plates. Also, medicines will be accepted, such as: antibiotics, anti-flu, nutritional vitamins, complements, disinfectants, sticky tape, bandage and gauzes

You can send this help to any of the IPN schools and you can more information in the Social Service Office of the IPN, in the following telephone number 57-29-60-00, extensions: 51674, 51632, 51618 and 51671.

You can find more information (in Spanish) in http://www.ipn.mx/comunicacionsocial/publicaciones/boletines%5CC-335.doc

Victor Romero

Messenger: vic_romero@hotmail.com
Business Web Page: http://www.dsnibble.com.mx
Personal Web Page: http://linux.ipn.mx/cms/space/VictorRomero
Blog Web Page: http://elcarteldetux.blogspot.com

Monday, September 26, 2005

The LOGO Language, memories that come to me

The last post that I wrote was about a Haskell Interpreter, I don't know how but now... I'm remembering about my first programming steps , they where using a Sigma Commodore 16 ( http://www.old-computers.com/museum/computer.asp?c=97) , come on I'm not an old person :P I was a kid in those days... I was 6-7 years old, that computer had a built-in BASIC interpreter, ohh my good,"for each line type a number and after type a command..." well it was good for me when I was a newbie programmer.

Many years after in the Elementary School I had a subject (Computing :P) and there I began to learn Structural Programming... with LOGO (http://el.media.mit.edu/logo-foundation/logo/index.html) a nice Turtle pointer that "walk" and "draw" lines, circles and other basic graphics functions. And then well my "new year" :P purpose is to make a new interpreter but using Mono, C#, and GTK#. It will be a interesting project... only with a educational goal.

I have started to search some projects about the LOGO and I've found

http://xlogo.free.fr/index-eshtml
http://klogoturtle.sourceforge.net/
http://lcs.www.media.mit.edu/groups/el/projects/circles/turtles.html
http://el.media.mit.edu/logo-foundation/logo/index.html
http://http.cs.berkeley.edu/%7Ebh/

Maybe they can provide the experience about programing a LOGO interpreter again the main source of information is the Linux Community Mailing List linuxipn@googlegroups.com.

Victor Romero

Messenger: vic_romero@hotmail.com
Business Web Page: http://www.dsnibble.com.mx
Personal Web Page: http://linux.ipn.mx/cms/space/VictorRomero
Blog Web Page: http://elcarteldetux.blogspotcom

Sunday, September 25, 2005

Functional Programming With A Haskell Interpreter: Hugs 98 For The .NET Platform

Some weeks ago I attended two classes of Elias Samra a Linux IPN Community Distinguished Member, and he spoke about the Functional Programing with the Haskell Language which has another point of view about giving solutions to specifics problems.

Since then I realized how can I apply the Functional Programming with Haskell to the near future projects of my consulting services firm, so then I started to do a little research about it.

As you know I'm a fan about the .NET Platform so then I decided to try some Haskell interpreter for this technology so I googled and found the Hugs98 for .NET ( http://galois.com/~sof/hugs98.net ), I installed it and run it, it gave me a nice command console... something like this:

Hugs98 - http://haskell.org/hugs - March 2003
Haskell 98 mode: Restart with command line option -98 to enable extensions
Hugs session for:
Type :? for help
Prelude>

And I started to program with the samples that it had, I was amazed that it can use the classes that reside in the namespace System.Windows.Forms, for example :

module Forms where

{-
This example uses DotNet actions to access .NET
rather than the FFI, as it was written before
FFI support was added to hugs98.net. Feel free
to upgrade it! :)
-}

import Dotnet

type Control a = Object a
type Config a = Control a -> IO ()

build :: IO ()
build = do
frm <- mkCtrl "System.Windows.Forms.Form" [option setSize (200, 200)] btn <- mkCtrl "System.Windows.Forms.Button" [option setText "Click Me", option setSize (50,50), option setLocation (75,75)] frm `addCtrl` btn event btn "Click" (\_ _ -> msgBox "Hello!" "Congratulations, you're running Haskell code!")
invokeStatic "System.Windows.Forms.Application" "Run" frm

option :: (Control a -> b -> IO()) -> b -> Config a
option f val = \ob -> f ob val

mkCtrl :: String -> [Config a] -> IO (Control a)
mkCtrl ctrlType options = do
ctrl <- newObj ctrlType () sequence_ (map (\x-> x ctrl) options)
return ctrl

event :: Control a -> String -> (Object a -> Object b -> IO ()) -> IO()
event ctrl name func = do
delegate <- newDelegator func () <- ctrl # invoke ("add_" ++ name) delegate return () setSize :: Control a -> (Int, Int) -> IO ()
setSize ctrl (width, height) = do
bWidth <- boxValue width bHeight <- boxValue height () <- ctrl # invoke "set_Width" bWidth () <- ctrl # invoke "set_Height" bHeight return () setText :: Control a -> String -> IO ()
setText ctrl text = do
() <- ctrl # invoke "set_Text" text return () setLocation :: Control a -> (Int, Int) -> IO ()
setLocation ctrl (x,y) = do
bX <- boxValue x bY <- boxValue y () <- ctrl # invoke "set_Left" bX () <- ctrl # invoke "set_Top" bY return () add :: Object a -> Object a -> IO ()
add collection thing = do
() <- collection # invoke "Add" thing return () addCtrl :: Control a -> Control a -> IO ()
addCtrl parent child = do
ctrls <- getControls parent () <- add ctrls child return () getControls :: Control a -> IO (Object a)
getControls frm = do
ctrls <- frm # invoke "get_Controls" ()
return ctrls

Again I can prove the interoperability whit the .NET Platform and the Hugs98 interpreter that target it, I will do more complex programs that implements Functional Programming and I will post my results.

Again I invite you to try the Functional Programming and take a look at: http://galois.com/~sof/hugs98.net/
http://haskell.org/hugs/


Victor Romero

Messenger: vic_romero@hotmail.com
Business Web Page: http://www.dsnibble.com.mx
Personal Web Page: http://linux.ipn.mx/cms/space/VictorRomero
Blog Web Page: http://elcarteldetux.blogspotcom/

Thursday, September 22, 2005

PHP Compiler For .NET Framework

When I was a young boy I used to program web pages with PHP, an easy to learn script language programming, but after many headaches that it gave me... I decided to try others for web programming (Java) , in that days I promised I will never try to use PHP again (come on this scripting programming language doesn't promote the code reusability neither the OO Programming and Design, it doesnt have a debugger, its non-existing typing enforment allow many runtime errors... ).

But ... something new was making it appearance in the scene: The .Net Framework and of course the Mono Project (www.mono-project.com) that implements many features and improvements of the Java Virtual Machine and Runtime Classes.

I like this framework because it allows to reuse the knowledge about the programming language of our choice, the .net framework is targeted by many languages, and you can mix the assemblies (binary files) .... well many many advantages. And I like the Mono Project because it targets 7 hardware platforms, it's Open Source and led by a mexican Miguel De Icaza.

And today I found and tried the Phalanger which is a PHP Language Compiler for .NET Framework ( http://www.php-compiler.net ). I think it's an interesting option for all that PHP lovers who want to improve their web applications.

Finally you can run your PHP in a managed environment, and use all the benefits of the .net framework.

The only "but" that I can express, PHPlanger is not a Full Open Source Project, and it doesnt work on Mono because it has PInvoke dependencies. :( To bad but it's a good starting point to make a full free PHP compiler)

Download it and try it by your self.

Tuesday, September 20, 2005

Nibble ERP as Open Source Project Released

Finally I have a Project Space in Novell Forge

Homepage: http://forge.novell.com/modules/xfmod/project/?nibble

If you want to contribute to this project feel free to join and please send me an email to vromero@ipn.mx

We need:

Release Manager - an individual who is in charge of creating file releases
Tracker Manager - an individual who can create and manage the trackers used by the project
Task Manager Admin - an individual who can create and manage subprojects and tasks
Task Manager Tech - an individual to whom tasks can be assigned
Forum Moderator - an individual who can approve and moderate forum postings
Documentation Editor - an individual who can edit and approve document submissions, as well as submit documentation
Sample Code Editor - an individual who can edit and approve sample code submissions, as well as submit sample code
Tracker Admin - an individual who can administer trackers, like Bugs or Enhancement Requests, including approving or submitting tracker items and assigning those items to others
Tracker Tech - an individual to whom tracker items, like Bugs or Enhancement Requests, can be assigned

Description:

Nibble is an Enterprise Resource Planning and is the Software Solution to support the entire business processes. It consists of modules such as Marketing and Sales, Field Service, Production, Inventory Control, Procurement, Distribution, Human Resources, Finance and Accounting.

The Nibble ERP Solution has:

Modules

Main Modules

General Ledger
Accounts Payable
Accounts Receivable
Inventory
Order Entry
Job Cost
System Manager

Special Modules:

Bar Coding
Bill of Materials
Contact Management
Customer Relationship Management
Point of Sale
Time & Billing
Transportation Management
Travel Expenses
Warehouse Management

Web Modules:

Web Based Requisitioning
Web Commerce Catalog
Web Customers
Web Employee
Web Financial Statements
Web Orders
Web Tools

Plant Modules:

Equipment Maintenance
Plant Maintenance
Preventive Maintenance

Development Tools Modules:

Data Import Tools
Data Integration Tools
Forms Designer Tools

Manufacturing Modules:

Product Configurator
Production Order Processing
Production Scheduling
Quoting/Estimating
Routings
Supply Chain Management

Sub-Modules

Bank Reconciliation
Contract Management
Currency Manager
Data Explorer
Direct Deposit
Import Manager
Multi-Company
Multi-Currency
Multidimensional Analysis
ODBC Drivers (ADO.NET)
Promotion Management
Purchase Order
Report Writer
Serial Number Tracking
Standard Costing

The Intended Audience: Developers, End Users/Desktop.

Technical Features:

The initial framework is entirely developed with C# over the Mono Runtime ( www.go-mono.com )
IDE Tool: Monodevelop (But feel free to use VI o Nano :P) ( www.monodevelop.com )
Software Version Control: SVN ( subversion.tigris.org )
Database: MySQL(www.mysql.com), with DAAB 3.1(http://www.gotdotnet.com/workspaces/workspace.aspx?id=c20d12b0-af52-402b-9b7c-aaeb21d1f431) so then the Data Access Layer has no RDBMS dependency.
Business Logic Layer implements custom objects
Web User Interface Layer: ASP.NET Web Forms (http://www.mono-project.com/ASP.NET)
Graphic User Interface Layer: GTK# Forms (http://gtk-sharp.sourceforge.net )
Loggin Layer: Log4net (http:// log4net.sourceforge.net )
Testing Layer: I use the Nunit Framework. ( www.nunit.org )

The Main Goal is to provide a Open Source Solution to the Community, based on the Mono Runtime and other Open Source Related Technologies (XSP Server, MySQL, PostgreSQL, GTK#, SVN).

This projects it's a good starting point for all that who want to learn to use Open Source Software Technologies and it's also a way to demonstrate that doing a balance with the Open Source Development Model, Best Programming Practices, Design Patterns (Software Engineering) give us a cheap and fast development Software Development Process and the final product is a robust, user friendly, low Cost Of Ownership Software and of course it's a good opportunity to exchange the knowledge and the experience between the people involved in the Nibble ERP Project.