Thursday, December 30, 2004

Wednesday, December 29, 2004

An Insight into the History of Webhost

An Insight into the History of Illusionfxnet

It all started in 2001, when Evan T. started a small free hosting provider that provided hosting for sites about the game SubSpace/Continuum. Later down the road, people wanted their personal and miscellaneous sites hosted too. Seven hundred miles away, Evan W. founded a web design company under the name Illusionfxnet. He helped Evan T. run the servers for SubSpace Xtreme Hosting.

One day, they started a simple conversation, and Evan W. asked what Evan T. thought about starting a free website hosting company under the name of Illusionfxnet. Evan T. instantly agreed. Everything was set-up at Evan T.'s place of employment with a simple dedicated T1 line. All applications were sent to an e-mail account in which Evan T., Evan W., and a former administrator by the name of EpidemiK reviewed manually.

Evan W. made a post advertising Illusionfxnet in the FreeWebSpace.net Forums, and there was a large string of applications pouring into the mailbox. This started forming a community. With the large amount of people joining in everyday, the administrators found a great designer by the name of Freeloader who generously donated a design for Illusionfxnet. Evan T. programmed a PHP script to review applications, and Illusionfxnet purchased a non-profit cPanel license.

Things seemed to be perfect when tragedy struck. Evan T.'s place of employment's ISP went out of business, and the administrators searched frantically for another place for the server. Illusionfxnet's services were down for three months.

In September 2003, the services returned, and not a whole lot had changed. EpidemiK had left, and Chris K. stepped up to fill in for his position. Chris proved that he could be counted on, and had been a big help to all Illusionfxnet members and administrators.

In October 2003, Illusionfxnet added Google Ads to the Illusionfxnet site in an attempt to reimburse the money that came out of their own pockets. To everyone's surprise, the Google Ads were a massive success, which allowed Illusionfxnet to increase the quality of hosting.

Recently we have gotten a more professional feel, with a more desirable site design and better management. We have made many updates and added many new features, and everyday we strive to reach new heights in the hosting industry, and in the pleasure of our customers.

Tuesday, December 28, 2004

How to Make Money With Google Adsense

How to Make Money With Google Adsense: "Make Money With Google Adsense"

Virtualmin Virtual Servers Module

Virtualmin Virtual Servers Module

SourceForge.net: Project Info - RDBS2J

SourceForge.net: Project Info - RDBS2J

Postfix

Chapter?10.?Postfix: "Postfix is an efficient and feature-rich mail server that was designed by Wietse Venema at the IBM T.J. Watson Research Center. It was intended to be a replacement for the popular Sendmail."

apache no longer find its ssl certificate file

on mandrake 10.0, I updated apache to the latest version (urpmi).

when I tried to restart apache I got the following error:

[root@server1 root]# service httpd start
Starting httpd2: Syntax error on line 44 of /etc/httpd/conf.d/41_mod_ssl.default-vhost.conf:
SSLCertificateFile: file '/etc/ssl/apache2/server.crt' does not exist or is empty

did an updatedb, then locate server.crt and server.crt turned up in /etc/ssl/apache/server.crt

and the same for server.key

made the relevant changes to /etc/httpd/conf.d/41_mod_ssl.default-vhost.conf,

then service httpd start, and it worked this time

Sunday, December 26, 2004

Friday, December 24, 2004

ActiveMQ - Home

ActiveMQ - Home: "ActiveMQ is an open source, Apache 2.0 licensed, high performance Messaging Fabric consisting of a scalable cluster of Message Brokers and a complete JMS 1.1 provider which integrates seamlessly into J2EE containers, light weight containers and any Java application."

Thursday, December 23, 2004

TheServerSide.com - Using The Digester Component

TheServerSide.com - Using The Digester Component: "Introducing the Digester Component"

ActiveSOAP - XMLBeans

ActiveSOAP - XMLBeans: "XMLBeans is a tool for handling typically XSD typed XML with support for the autogenerating of beans to map to a WSDL or XSD file."

Simplify XML file processing with the Jakarta Commons Digester

Simplify XML file processing with the Jakarta Commons Digester: "Simplify XML file processing with the Jakarta Commons Digester"

IBM WebSphere Developer Technical Journal: Extending the IBM WebSphere Platform with Adobe Intelligent Documents

IBM WebSphere Developer Technical Journal: Extending the IBM WebSphere Platform with Adobe Intelligent Documents: "Extending the IBM WebSphere Platform with Adobe Intelligent Documents"

Thomas Dudziak's Weblog

Thomas Dudziak's Weblog: "I just read the 'Struts Best Practices' article, and overall it gives IMO some good hints for using Struts in real-world projects. But there are a few minor comments that I have: "

ONJava.com: Extending Struts

ONJava.com: Extending Struts: "Struts is not only a very powerful framework, but also very extensible."

XML.com: Implementing REST Web Services: Best Practices and Guidelines

XML.com: Implementing REST Web Services: Best Practices and Guidelines: "Implementing REST Web Services: Best Practices and Guidelines"

A brief introduction to REST that describes how to build Web services in the REST style

: "A brief introduction to REST that describes how to build Web services in the REST style"

Sunday, December 19, 2004

Understanding Portals and Portlets: Part Two (SYS-CON)(Printview)

Understanding Portals and Portlets: Part Two (SYS-CON)(Printview)

Tomcat Installed

Downloaded maven and setup environment variable and path in /etc/profile.d/maven.sh

Downloaded Tortoise for Subversion http://tortoisesvn.tigris.org/download.html

Downloaded pluto from http://svn.apache.org/repos/asf/.

Run the maven fullDeployment command in the pluto directory.

Running Tomcat as a Service on Linux

This is the script that im using to startup and shutdown tomcat automatically on Linux

1. Save tomcat start / stop script
Copy and paste the following script into your text editor:




#!/bin/bash
#
# Startup script for Tomcat
#
# chkconfig: 345 84 16
# description: Tomcat jakarta JSP server

TOMCAT_HOME=/usr/local/tomcat
startup=$TOMCAT_HOME/bin/startup.sh
shutdown=$TOMCAT_HOME/bin/shutdown.sh

#Necessary environment variables
export JAVA_HOME="/usr/local/java/java"
export CATALINA_HOME="/usr/local/tomcat"
#export LD_KERNEL_ASSUME="2.2.5"

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

#Check for tomcat script
if [ ! -f $TOMCAT_HOME/bin/catalina.sh ]
then
echo "Tomcat not available..."
exit
fi

start(){
echo -n $"Starting Tomcat service: "
#daemon -c
$startup
RETVAL=$?
echo
}

stop(){
action $"Stopping Tomcat service: "
$shutdown
RETVAL=$?
echo
}


status() {
ps ax --width=1000 grep "[o]rg.apache.catalina.startup.Bootstrap start" awk '{printf $1 " "}' wc awk '{print $2}' > /tmp/tomcat_process_count.txt
read line < /tmp/tomcat_process_count.txt if [ $line -gt 0 ]; then echo -n "tomcatd ( pid " ps ax --width=1000 grep "[o]rg.apache.catalina.startup.Bootstrap start" awk '{printf $1 " "}' echo -n ") is running..." echo else echo "Tomcat is stopped" fi } case "$1" in start) start ;; stop) stop ;; restart) stop sleep 3 start ;; status) status ;; *) echo "Usage: tomcatd {start stop restart status}" exit 1 esac exit 0 Edit the lines that start with tomcat and export to match where you installed tomcat and your jdk. 2. Save to /etc/init.d and chmod
Save the edited file above to /etc/init.d directory as "tomcatd"

Then you have to allow execute access to the script, so run:
chmod a+x tomcat

3. Add to appropriate run level directories
The easy way to do this is to just simply run:
chkconfig --add tomcat

thats it.

this will also allow you to start and stop tomcat manually

service tomcatd start
service tomcatd stop

Saturday, December 18, 2004

Installing Apache on Tomcat on Mandrake 10.0

1. Install Mandrake 10.0 from CD's

If you need help, please use the following link:

Select the following groups:


· Console Tools

· Development

· KDE Workstation (or Gnome)



Additionally you need the following packages:

· Webmin

· Apache2

· PostgreSQL

PostgreSQL server is not setup on Mandrake by default (Client is, but not server), used control centre install to dowload server and jdbc.

login as root

/etc/rc.d/init.d/postgresql restart

# su - postgres
$ createuser youruser

Shall the new user be allowed to create databases? (y/n) y
Shall the new user be allowed to create more new users? (y/n) n
CREATE USER
$ createdb youruser
CREATE DATABASE

$ exit
# exit
# su youruser
$ psql
Welcome to psql 7.3.2, the PostgreSQL interactive terminal.
youruser=> create table states (state_code varchar(2) primary key, state_name varchar(30) not null);

CREATE TABLE
youruser=> insert into states(state_code, state_name) values ('VA','Virgina');
INSERT 16981 1
youruser=> insert into states(state_code, state_name) values ('MD','Maryland');
INSERT 16982 1

youruser=> select * from states;
state_code | state_name
------------+----------
VA | Virgina
MD | Maryland

(2 rows)

youruser=> \q




Please use the Mandrake Control Center to perform an update of your software. By clicking on “Mandrake Update” the system will be connected to the nearest FTP server and will get security updates, bugfixes and normal updates.




1.1 Get Webmin running



It is time to get Webmin running. Webmin is a web-based interface for system administration for UNIX. Using any browser that supports tables and forms (and Java for the File Manager module), you can setup user accounts, Apache, DNS, MySQL, file sharing and so on. Webmin consists of a simple web server, and a number of CGI programs which directly update system files like /etc/inetd.conf and /etc/passwd. The web server and all CGI programs are written in Perl version 5, and use no non-standard Perl modules. Please get more information about Webmin here:



http://www.webmin.com/



Honestly, we really do not need Webmin to get everything running, but it is a wonderful tool for a LINUX system administrator and it will help us to configure stuff. After the installation please check if Webmin is already running:

/etc/init.d/webmin status

If not, please start it like this:

/etc/init.d/webmin start

You can now use the Webmin interface with your favorite browser via the following URLs:

https://localhost:10000 or https://IP-address:10000



1.3 Configure PostgreSQL

Please edit the following configuration file:

/var/lib/pgsql/data/postgresql.conf

and make sure that the this line is anabled:

tcpip_socket = true

In the file /var/lib/pgsql/data/pg_hba.conf we need this the following:

local all all trust
host all all 127.0.0.1 255.255.255.255 trust

Please use Webmin to open PostgreSQL Database Server by clicking on Servers - PostgreSQL Database Server. In this phase just make sure that PostgresSQL starts and stops without an error.

Note: You need the perl-DBD-Pg package installed to avoid error messages.

1.4 Configuring Apache2

To configure Apache2 use Webmin – Servers – Apache Webserver and click on Module Config.

Please change the following entries:

Path to httpd executable to: /usr/sbin/httpd2

Path to httpd.conf to: /etc/httpd/2.0/conf/httpd2.conf


Configure the necessary modules (just leave it like it is) and you will find the global configuration overview. In this phase just make sure that Apache starts and stops without an error message. We will configure it later.

2.1 Java stuff

Lets go to Sun first. Download the following files and store them in your favourite installation directory: (i.e. /installations)

http://java.sun.com/j2se/1.4.2/download.html
download j2sdk-1_4_2_05-linux-i586.bin

http://java.sun.com/products/javamail/downloads/index.html
download javamail-1_3_1-upd.zip

http://java.sun.com/products/javabeans/glasgow/jaf.html
download jaf-1_0_2-upd.zip

http://java.sun.com/products/jta/
download the class files and javadocs.

http://java.sun.com/products/servlet/archive.html
download Java Servlet Development Kit 2.0 for Solaris (jsdk20-solaris2-sparc.tar.Z).

Install j2sdk like this:

cd /installations

chmod 700 j2sdk-1_4_2_05-linux-i586.bin

./j2sdk-1_4_2_05-linux-i586.bin

(need to add create java_home and add to path

create /etc/profile.d/java.sh

JAVA_HOME=/download/j2sdk1.4.2_05
export JAVA_HOME
PATH=$PATH:$JAVA_HOME/bin
export PATH

chmod 755 /etc/profile.d/java.sh
)




Install javamail like this:



cd /installations

unzip javamail-1_3_1-upd.zip

cd javamail-1.3.1/

cp mail.jar /usr/share/java





Install jaf like this:



cd /installations

unzip jaf-1_0_2-upd.zip

cd jaf-1.0.2

cp –R * /usr/share/java





Install Jta like this:



Unzip the following files and copy the content to /usr/share/java:

jta-1_0_1B-classes.zip

jta-1_0_1B-doc.zip


Install jsdk20



cd /installations

tar xzf jsdk20-solaris2-sparc.tar.Z

chown –R root:root JSDK2.0/

cp -R JSDK2.0 /usr/local/





2.2 Install additional RPM packages from Installation CD



Please use RPMDrake in Mandrake Control Center to install the following files:



jdom-1.0.0.b8.2jpp
ant-1.5.4-2jpp
postgresql-jdbc-7.3.4-2mdk
apache2-devel-2.0.47-6.6.92mdk

Note: If RPMDrake asks to install depended files, please do it.

2.4 Installing Jakarta Tomcat 5

Please download jakarta-tomcat-5.0.28.tar.gz from here and store it in you installation directory:

http://jakarta.apache.org/site/binindex.cgi

Install Tomcat like this:

cd /installation

tar xzf jakarta-tomcat-5.0.28.tar.gz

cd jakarta-tomcat-5.0.28

mkdir /usr/local/tomcat

cp –R * /usr/local/tomcat

/usr/local/tomcat/bin/startup.sh

Use your favourite browser to check if tomcat is installed properly.

http://yourserver:8080


At the end do not forget to restart Tomcat 5 like this:

/usr/local/tomcat/bin/shutdown.sh
/usr/local/tomcat/bin/startup.sh


2.6 Install Apache Module Mod_jk

I couldn’t find this Apache Module on the CDs. So I searched for files I can download out of the net. Here is my solution:

I downloaded jakarta-tomcat-connectors-jk2-2.0.4-src.zip
from here:

http://www.apache.de/dist/jakarta/tomcat-connectors/jk2/source/


To compile the source we need to do the following steps:

cd /installation
unzip jakarta-tomcat-connectors-jk2-2.0.4-src.zip

This will create a folder called jakarta-tomcat-connectors-jk2-2.0.4-src. Rename it to jakarta-tomcat-connector.

Move this folder to wherever you store source files on your system. I used /usr/src.

copy –R jakarta-tomcat-connector /usr/src

Then run the buildconf script to create the configuration file.

cd /usr/src/jakarta-tomcat-connector/jk/native2
./buildconf.sh
Run the configure script with the path to the apxs file on your system and the options below:

./configure --with-apxs2=/usr/sbin/apxs2
Note: You need to install rpm package apache2-devel-2.0.47 first!

Build mod_jk2 with the following command:

make

If all went well, the mod_jk2.so file was successfully created. Manually copy it to Apache's shared object files directory:



cp /usr/src/jakarta-tomcat-connector/jk/build/jk2/apache2/mod_jk2.so /etc/httpd/2.0/modules

cp /usr/src/jakarta-tomcat-connectors-jk2-2.0.4-src/jk/native2/server/apache2/mod_jk2.c /etc/httpd/2.0/modules

cp /usr/src/jakarta-tomcat-connector/jk/native2/server/apache2/mod_jk2.c /etc/httpd/2.0/modules

Add the following line to the file /etc/httpd/2.0/conf/httpd2.conf:

LoadModule jk2_module modules/mod_jk2.so

Copy the file workers2.properties to /etc/httpd/conf

Restart Apache like this:

service httpd restart

Tuesday, December 14, 2004

Linux Tutorial: PostgreSQL Database and Linux

Linux Tutorial: PostgreSQL Database and Linux: "YoLinux Tutorial: The PostgreSQL Database and Linux"

Linux Forum: Apache, Webmin and Mandrake - Linux Operating System Help

Linux Forum: Apache, Webmin and Mandrake - Linux Operating System Help: "To configure the Webmin module for Mandrake's (10.0) default installation of Apache2 (it was expecting Apache 1.x,) change the following:

Apache server root directory: /etc/httpd/2.0
Path to httpd executable: /usr/sbin/httpd2
Path to httpd.conf: /etc/httpd/conf/httpd2.conf" (slight change here)

PostgreSQL 7.3 Documentation

PostgreSQL 7.3 Documentation: "PostgreSQL 7.3 Documentation"

Monday, December 13, 2004

Learn the basic steps necessary to download, install, and configure a basic Apache server

Dev Shed: "Learn the basic steps necessary to download, install, and configure a basic Apache server"

Sunday, December 12, 2004

How to install OPEN-XCHANGE™ with Webmin, APACHE2, OpenLDAP and PostgreSQL on Mandrake 9.2

How to install OPEN-XCHANGE™ with Webmin, APACHE2, OpenLDAP and PostgreSQL on Mandrake 9.2?





By Frank Neugebauer


http://www.linux-tip.net

linux-tip@web.de


Last Modified: 28/09/2004 8:11 PM




0. Introduction





OPEN-XCHANGE™ is a collaboration and integration server environment with a continuous right management for modules and objects.
OPEN-XCHANGE™ ("OX") is a GPL Groupware solution provided by Netline.
It's the "community" version of Novell/SUSE LINUX OPEN-XCHANGE™ Server ("SLOX").
The product is based on existing components like a web server, mail server, directory server and a database.
OPEN-XCHANGE™ is JAVA™ based with some pieces of C for security components.


OPEN-XCHANGE™ provides the following modules:

- Portal
- Calendar
- Contacts
- Addresses
- Tasks
- Projects
- Documents
- Knowledge
- Bookmarks
- Pinbord
- Forums
- Webmailer

This guide contains all the necessary information for installing and understanding the architectural layout of the implementation. It was written with the assumption that you understand how to install programs and have a basic understanding of Linux Mandrake. This includes installing Linux Mandrake and RPM packages, editing files, making directories, compiling software and understanding general UNIX commands. This guide doesn’t explain how to use or configure OPEN-XCHANGE™, Apache, Postfix, Cyrus and all the other server but information on where to obtain this information can be found in the “Additional information” section.

Please note, the way the software is installed here is good enough for testing purposes, but certainly not for a production environment. I am also not responsible of possible data losses caused by the use of this guide.

The guide is divided in three parts. In the first part we will perform a basic Mandrake 9.2 installation and the basic configuration of the needed servers. The second part continues with Java installation and compiling. This guide ends with the Post-Installation process and the basic OPEN-XCHANGE™ configuration.









1.0 Basic Mandrake 9.2 Installation


I’m using Mandrake Linux PowerPack 9.2 (9 CDs) for this installation. You can already find this distribution (DVD) in some computer magazines or please purchase the software here:

http://store.mandrakesoft.com


I don’t want to explain how to install Mandrake. It is very easy theses days. If you need help, please use the following link:




http://www.mandrakelinux.com/en/fdoc.php3

It is now time to specify which programs you wish to install on your system. There are thousands of packages available for Mandrake Linux, and to make it simpler to manage the packages have been placed into groups of similar applications. We just need a basis system. For that reason you should select the following groups:



· Console Tools

· Development

· KDE Workstation (or Gnome)



Additionally you need the following packages:



· Webmin

· Apache2

· PostgreSQL

· Open-LDAP
(urpmi openldap-servers openldap-migration)

· Postfix

· Cyrus


PostgreSQL server is not setup on Mandrake by default (Client is, but not server), used control centre install to dowload server and jdbc.

login as root

/etc/rc.d/init.d/postgresql restart

# su - postgres
$ createuser youruser

Shall the new user be allowed to create databases? (y/n) y
Shall the new user be allowed to create more new users? (y/n) n
CREATE USER
$ createdb youruser
CREATE DATABASE

$ exit
# exit
# su youruser
$ psql
Welcome to psql 7.3.2, the PostgreSQL interactive terminal.
youruser=> create table states (state_code varchar(2) primary key, state_name varchar(30) not null);

CREATE TABLE
youruser=> insert into states(state_code, state_name) values ('VA','Virgina');
INSERT 16981 1
youruser=> insert into states(state_code, state_name) values ('MD','Maryland');
INSERT 16982 1

youruser=> select * from states;
state_code | state_name
------------+----------
VA | Virgina
MD | Maryland

(2 rows)

youruser=> \q




Please use the Mandrake Control Center to perform an update of your software. By clicking on “Mandrake Update” the system will be connected to the nearest FTP server and will get security updates, bugfixes and normal updates.




1.1 Get Webmin running



It is time to get Webmin running. Webmin is a web-based interface for system administration for UNIX. Using any browser that supports tables and forms (and Java for the File Manager module), you can setup user accounts, Apache, DNS, MySQL, file sharing and so on. Webmin consists of a simple web server, and a number of CGI programs which directly update system files like /etc/inetd.conf and /etc/passwd. The web server and all CGI programs are written in Perl version 5, and use no non-standard Perl modules. Please get more information about Webmin here:



http://www.webmin.com/



Honestly, we really do not need Webmin to get everything running, but it is a wonderful tool for a LINUX system administrator and it will help us to configure Apache, PostgresSQL, Open-LDAP and all other servers. After the installation please check if Webmin is already running:



/etc/init.d/webmin status



If not, please start it like this:



/etc/init.d/webmin start



You can now use the Webmin interface with your favorite browser via the following URLs:



https://localhost:10000 or https://IP-address:10000






1.2 Create users and databases



OPEN-XCHANGE™ needs few users and groups on Mandrake and PostgresSQL to make the installation go without an error message.



useradd ox
su postgres
createuser -A -D -P openexchange
createdb openexchange exit



Note: Please remember the passwords.





1.3 Configure PostgreSQL

Please edit the following configuration file:

/var/lib/pgsql/data/postgresql.conf

and make sure that the this line is anabled:

tcpip_socket = true

In the file /var/lib/pgsql/data/pg_hba.conf we need this the following:

local all all trust
host all all 127.0.0.1 255.255.255.255 trust




Please use Webmin to open PostgreSQL Database Server by clicking on Servers - PostgreSQL Database Server. You will find the database openexchange (just empty) and the openexchange user already installed. In this phase just make sure that PostgresSQL starts and stops without an error.



Note: You need the perl-DBD-Pg package installed to avoid error messages.



1.4 Configuring Apache2



To configure Apache2 use Webmin – Servers – Apache Webserver and click on Module Config.



Please change the following entries:



Path to httpd executable to: /usr/sbin/httpd2

Path to httpd.conf to: /etc/httpd/2.0/conf/httpd2.conf


Configure the necessary modules (just leave it like it is) and you will find the global configuration overview. In this phase just make sure that Apache starts and stops without an error message. We will configure it later.




1.5 Configuring Open-LDAP



To configure Open-LDAP use Webmin – Servers – OpenLDAP Server. Leave everything like it is. Just make sure that the daemon starts and stops without error.







2.0 Installing Java and compiling OPEN-XCHANGE™



This part is not so easy like the first part. We need to download a lot more rpm packages and other files from different locations. It is not always uncomplicated to find the correct file on the 9 Mandrake 9.2 CDs. I downloaded some software from Sun as well.





2.1 Java stuff



Lets go to Sun first. Download the following files and store them in your favourite installation directory: (i.e. /installations)

http://java.sun.com/j2se/1.4.2/download.html
download j2sdk-1_4_2_05-linux-i586.bin

http://java.sun.com/products/javamail/downloads/index.html
download javamail-1_3_1-upd.zip

http://java.sun.com/products/javabeans/glasgow/jaf.html
download jaf-1_0_2-upd.zip

http://java.sun.com/products/jta/
download the class files and javadocs.

http://java.sun.com/products/servlet/archive.html
download Java Servlet Development Kit 2.0 for Solaris (jsdk20-solaris2-sparc.tar.Z).



Install j2sdk like this:



cd /installations

chmod 700 j2sdk-1_4_2_05-linux-i586.bin

./j2sdk-1_4_2_05-linux-i586.bin

(need to add create java_home and add to path

create /etc/profile.d/java.sh

JAVA_HOME=/download/j2sdk1.4.2_05
export JAVA_HOME
PATH=$PATH:$JAVA_HOME/bin
export PATH
)




Install javamail like this:



cd /installations

unzip javamail-1_3_1-upd.zip

cd javamail-1.3.1/

cp mail.jar /usr/share/java





Install jaf like this:



cd /installations

unzip jaf-1_0_2-upd.zip

cd jaf-1.0.2

cp –R * /usr/share/java





Install Jta like this:



Unzip the following files and copy the content to /usr/share/java:

jta-1_0_1B-classes.zip

jta-1_0_1B-doc.zip


Install jsdk20



cd /installations

tar xzf jsdk20-solaris2-sparc.tar.Z

chown –R root:root JSDK2.0/

cp -R JSDK2.0 /usr/local/





2.2 Install additional RPM packages from Installation CD



Please use RPMDrake in Mandrake Control Center to install the following files:



jdom-1.0.0.b8.2jpp
ant-1.5.4-2jpp
postgresql-jdbc-7.3.4-2mdk
apache2-devel-2.0.47-6.6.92mdk advx-build,libgdbm2-devel


We also need some perl libraries:



perl-Concert-ASN1-0.16-4mdk
perl-ldap-0.29-1mdk
perl-IO-Socket-SSL-0.95-1mdk
perl-Authen-SASL-2.04-2mdk
perl-Net_SSLeay-1.25-1mdk


Note: If RPMDrake asks to install depended files, please do it.





2.3 Compiling OPEN-XCHANGE™ and first check



Please download the OPEN-XCHANGE™ from the following website and store it in your installation directory:



http://mirror.open-xchange.org/ox/EN/community/



cd /installations

tar xzf open-xchange-0.7.1.tar.gz

cd open-xchange.0.7.1/

./configure --prefix=/usr/local/ox --with-mailjar=/usr/share/java/mail.jar --with-activationjar=/usr/share/java/activation.jar --with-jdomjar=/usr/share/java/jdom.jar --with-xercesjar=/usr/share/java/xerces-j2.jar --with-jsdkjar=/usr/local/JSDK2.0/lib/jsdk.jar --with-jdbcjar=/usr/share/pgsql/pg73jdbc3.jar --with-runuid=ox --with-rungid=ox

make

make install
chown –R ox:ox /usr/local/ox/var


Note: To avoid the following error message, you should start PostgrSQL sever first:



configure: WARNING: it seems that the database can not be reached ... maybe the application will not work as expected



Next we need to copy the following files to Apache’s cgi-bin directory: login.pl and login.pm



cd /usr/local/ox/share/perl

cp login.* /var/www/cgi-bin



Please try to enter the login screen using your favourite browser:



http://servername/cgi-bin/login.pl or http://IPaddress/cgi-bin/login.pl





I had an Internal Server error. Checking the Apache error log file I discovered the following message:



Can't locate auto/Net/SSLeay/randomize.al in @INC (@INC contains:
/usr/lib/perl5/5.8.1/i386-linux-thread-multi /usr/lib/perl5/5.8.1


I found out that the RPM package perl-Net_SSLeay-1.25-mdk.i586.rpm doesn't have the file randomize.al.

Here is my workaround:

I regenerated the file SSLeay.pm with the following commands:

cd /usr/lib/perl5/vendor_perl/5.8.1/i386-linux-thread-multi
perl -e 'use AutoSplit; autosplit("Net/SSLeay", "auto", 0, 1, 1)'


2.4 Installing Jakarta Tomcat 5

Please download jakarta-tomcat-5.0.28.tar.gz from here and store it in you installation directory:

http://jakarta.apache.org/site/binindex.cgi


Install Tomcat like this:





cd /installation

tar xzf jakarta-tomcat-5.0.28.tar.gz

cd jakarta-tomcat-5.0.28

mkdir /usr/local/tomcat

cp –R * /usr/local/tomcat

/usr/local/tomcat/bin/startup.sh



Use your favourite browser to check if tomcat is installed properly.



http://yourserver:8080







2.5 Installling Servlets

Copy intranet.class and webmail.class in the tomcat webapps tree :

cd /usr/local/tomcat/webapps
mkdir servlet
mkdir servlet/WEB-INF
mkdir servlet/WEB-INF/classes
cd servlet/WEB-INF/classes
cp /usr/local/ox/share/servlets/*.class .



Now create the file web.xml in
/usr/local/tomcat/webapps/servlet/WEB-INF.

Use this as an example:






Servlet OpenXchange

Servlet OpenXchange 0.7.1




intranet
intranet



webmail
webmail



intranet
/intranet



webmail
/webmail








The servlets won't work until you modify the classpath. So do this:



cd /usr/local/tomcat/webapps/servlet/WEB-INF
mkdir lib
cd lib
cp /usr/local/ox/lib/*.jar .





At the end do not forget to restart Tomcat 5 like this:



/usr/local/tomcat/bin/shutdown.sh
/usr/local/tomcat/bin/startup.sh



To check if everything is working fine, open you favourite Browser and go to the following URL:



http://myhost:8080/servlet/intranet



You should see a message "No running Server found“: it means that all is OK.




2.6 Install Apache Module Mod_jk

I couldn’t find this Apache Module on the CDs. So I searched for files I can download out of the net. Here is my solution:

I downloaded jakarta-tomcat-connectors-jk2-2.0.4-src.zip
from here:

http://www.apache.de/dist/jakarta/tomcat-connectors/jk2/source/


To compile the source we need to do the following steps:

cd /installation
unzip jakarta-tomcat-connectors-jk2-2.0.4-src.zip

This will create a folder called jakarta-tomcat-connectors-jk2-2.0.4-src. Rename it to jakarta-tomcat-connector.

Move this folder to wherever you store source files on your system. I used /usr/src.

copy –R jakarta-tomcat-connector /usr/src

Then run the buildconf script to create the configuration file.

cd /usr/src/jakarta-tomcat-connector/jk/native2
./buildconf.sh
Run the configure script with the path to the apxs file on your system and the options below:

./configure --with-apxs2=/usr/sbin/apxs2
Note: You need to install rpm package apache2-devel-2.0.47 first!

Build mod_jk2 with the following command:

make

If all went well, the mod_jk2.so file was successfully created. Manually copy it to Apache's shared object files directory:



cp /usr/src/jakarta-tomcat-connector/jk/build/jk2/apache2/mod_jk2.so /etc/httpd/2.0/modules

cp /usr/src/jakarta-tomcat-connectors-jk2-2.0.4-src/jk/native2/server/apache2/mod_jk2.c /etc/httpd/2.0/modules

cp /usr/src/jakarta-tomcat-connector/jk/native2/server/apache2/mod_jk2.c /etc/httpd/2.0/modules

Add the following line to the file /etc/httpd/2.0/conf/httpd2.conf:

LoadModule jk2_module modules/mod_jk2.so

Copy the file workers2.properties to /etc/httpd/conf

Restart Apache like this:

service httpd restart




3.0 Post-Installation and first run

3.1 Postgresql database

In the last part we’ll finally configure Postgresql, LDAP and will start the necessary services.

Lets start to populate the database. Just do the following:

psql -dopenexchange -h localhost -Uopenexchange -W -f /usr/local/ox/share/init_database.sql
psql -dopenexchange -h localhost -Uopenexchange -W
INSERT INTO sys_gen_rights_template values
('now','admin','now','','default_template','y','y','y','y',
'y','y','y','y','y','y','y','y','y','y','y','y','y','y','y',
'y','y','y','y','y','y','y','y','y','y','y','y','y','y','y',
'y','y','y','y','y','y','y','y','y','y','y','y','y');
\q



3.2 Configuring LDAP
Edit your /etc/openldap/slapd.conf and add the following lines:

include /usr/local/ox/share/openxchange.schema

suffix "dc=example,dc=org"
rootdn "cn=Manager,dc=example,dc=org"
rootpw secret

index uid,mailEnabled,cn,sn,givenname,lnetMailAccess,alias,loginDestination eq,sub

Now create a password as stated in the INSTALL file:

$perl -e 'print crypt("mypassword",pack("C2",(int(rand 26)+65),(int(rand 26)+65)))."\n";'
CGPbeX4Qyrui2
$

Edit /usr/local/ox/share/init_ldap.ldif and modify the line

userPassword: {CRYPT}newmailadminpass

... to the result of the perl command. In my example it is:

userPassword: {CRYPT}CGPbeX4Qyrui2
Now insert the LDAP data :

slapadd -l /usr/local/ox/share/init_ldap.ldif
If you have an error, check your config and try again until it works ... If you need to reset the LDAP database, here's the solution:

/etc/init.d/lapd stop
rm /var/lib/ldap/*
/etc/init.d/lapd start

(you need to remove any duplicated entries from the indicated files,dont understand why these things are wrong out of the box?)

Note: Please check if all files in /var/lib/ldap are owned by ldap.

Now modify your /etc/openldap/ldap.conf like this:

BASE dc=example,dc=org
HOST localhost

Note: Do not put any space after the comma in dc=example,dc=org !!!

Create a symbolic link like this:

ln -s /etc/openldap/ldap.conf /usr/local/ox/etc/groupware/ldap.conf



3.3 Create a user

Let's try your PostgreSQL / LDAP config by adding a user:

adduser_ox --username="john" --passwd="password" --name="doe" --sname="john" --maildomain="example.org" --ox_timezone="Europe/Paris"



Check carefully the feedback of the command. Even if you have a green "OK" message, you can have an error message ... If this is the case, don't go further until it is corrected!

If we still follow the INSTALL file, we now add a openxchange group:

addgroup_ox --group=developers




3.4 Website files preparation

Copy the following files to wwwroot (Mandrake normally uses /var/www/html)

cd /var/www/html

mkdir cfintranet
mkdir cfintranet/webmail

cd /usr/local/ox/share/groupware/data
cp -R images css javascript /var/www/html/cfintranet

cd /usr/local/ox/share/webmail/data
cp -R images css javascript /var/www/html/cfintranet/webmail





3.5 Creating the filespool

The documentation says this script can "take some time". It's true! If you have a slow server, it is time for a tea or coffee.

cd /usr/local/ox/sbin

sh correctfilespool



Now, all should be OK for starting. First, start the openxchange service :

/usr/local/ox/etc/init.d/openexchange start
Then open the login page http://myhost/cgi-bin/login.pl, and login with the username and password supplied previously to the command adduser_ox :



4.0 Face Lifting

OK, what you now see is not nice. (no icons but ugly squares instead). Fortunately somebody did allady great work.

Please download the file ox_zenith_iconset-0.1.tar.gz from here:

http://ox.cutmasta.org/

Install the new icons like this:

tar xzf ox_zenith_iconset-0.1.tar.gz
cd ox_zenith_iconset/top
cp * /var/www/html/cfintranet/images/top/EN/
cp * /var/www/html/cfintranet/images/top/DE/

installing tomcat on linux - restart

I wasnt happy with the way the install of apache/tomcat/database (postgresql) had gone so far so I decided to start again.

Basically im reinstalling Mandrake 10.0 on my p200 64mb PC.

The first problem that I had previously encountered is that a vncserver is not installed as default in Mandrake. The thing that makes this confusing is that the tightvnc client is!

By googling I discovered that

urpmi tightvnc-server

would perform an install of tightvnc server, and it did, excellent.

Typed vncserver and setup my passwords, and im in business connected to my linux box in the office from the the laptop

Daemon scripts

Daemon scripts: Files in /etc/rc.d/init.d (tomcatd, postgresql, httpd)

tomcatd
#You can add this line for status in tomcatd. It outputs all tomcat processes
ps ax --width=1000 grep "[o]rg.apache.catalina.startup.Bootstrap start" awk '{printf $1 " "}'


postgresql
Here's a brief explanation of unusual features in my daemon scripts
You can make these changes in a daemon script to allow it to connect with jdbc
Edit /etc/rc.d/init.d/postgresql. JDBC needs to connect via tcp/ip, so
add "-i" next to "-p ${PGPORT}" so that the line contains this:
'-i -p ${PGPORT}'


/etc/rc.d/init.d/tomcatd

#!/bin/bash
#
# Startup script for Tomcat
#
# chkconfig: 345 84 16
# description: Tomcat jakarta JSP server
TOMCAT_HOME=/usr/local/tomcat
TOMCAT_START=$TOMCAT_HOME/bin/startup.sh
TOMCAT_STOP=$TOMCAT_HOME/bin/shutdown.sh
#Necessary environment variables
export JAVA_HOME="/usr/local/java/java"
export CATALINA_HOME="/usr/local/tomcat"
#export LD_KERNEL_ASSUME="2.2.5"
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
#Check for tomcat script
if [ ! -f $TOMCAT_HOME/bin/catalina.sh ]
then
echo "Tomcat not available..."
exit
fi
start() {
echo -n "Starting Tomcat: "
su - tomcat -c $TOMCAT_START
echo
touch /var/lock/subsys/tomcatd
# We may need to sleep here so it will be up for apache
sleep 3
#Instead should check to see if apache is up by looking for httpd.pid
}
stop() {
echo -n $"Shutting down Tomcat: "
su - tomcat -c $TOMCAT_STOP
rm -f /var/lock/subsys/tomcatd
echo
}
status() {
ps ax --width=1000 grep "[o]rg.apache.catalina.startup.Bootstrap start" awk '{printf $1 " "}' wc awk '{print $2}' > /tmp/tomcat_process_count.txt
read line < /tmp/tomcat_process_count.txt
if [ $line -gt 0 ]; then
echo -n "tomcatd ( pid "
ps ax --width=1000 grep "[o]rg.apache.catalina.startup.Bootstrap start" awk '{printf $1 " "}'
echo -n ") is running..."
echo
else
echo "Tomcat is stopped"
fi
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
sleep 3
start
;;
status)
status
;;
*)
echo "Usage: tomcatd {startstoprestartstatus}"
exit 1
esac

/etc/rc.d/init.d/postgresqld

#! /bin/sh
# postgresqld This is the init script for starting up the PostgreSQL
# server
#
# chkconfig: 345 83 17
# description: Starts and stops the PostgreSQL backend daemon that handles # all database requests.
# processname: postmaster
# pidfile: /var/run/postmaster.pid
PG_HOME="/usr/local/pgsql"
# Source function library.
INITD=/etc/rc.d/init.d
. $INITD/functions
# Get function listing for cross-distribution logic.
TYPESET=`typeset -F`
# Get config.
. /etc/sysconfig/network
# Find the name of the script
#NAME=`basename $0`
NAME="PostgreSQLd"
# Set defaults for port and database directory
PGPORT=5432
export PGDATA=/usr/local/pgsql/data
# Check that networking is up.
# Pretty much need it for postmaster.
[ "${NETWORKING}" = "no" ] && exit 0
[ -f /$PG_HOME/bin/postmaster ] exit 0
start(){
PSQL_START=$"Starting ${NAME} service: "
echo -n $"Initializing database: "
if [ ! -d $PGDATA ]
then
mkdir -p $PGDATA
chown postgres.postgres $PGDATA
chmod go-rwx $PGDATA
fi
# Make sure the locale from the initdb is preserved for later startups...
[ -f $PG_HOME/i18n ] && cp $PG_HOME/i18n $PGDATA/../initdb.i18n
# Just in case no locale was set, use en_US
[ ! -f $PG_HOME/i18n ] && echo "LANG=en_US" > $PGDATA/../initdb.i18n
# Is expanded this early to be used in the command su runs
echo "export LANG LC_ALL LC_CTYPE LC_COLLATE LC_NUMERIC LC_CTYPE LC_TIME" >> $PGDATA/../initdb.i18n
# Initialize the database
su -l postgres -s /bin/sh -c "$PG_HOME/bin/initdb --pgdata=$PGDATA > /dev/null 2>&1" < /dev/null
[ -f $PGDATA/PG_VERSION ] && echo_success
[ ! -f $PGDATA/PG_VERSION ] && echo_failure
echo
# Check for postmaster already running...
# note that pg_ctl only looks at the data structures in PGDATA
# you really do need the pidof()
pid=`pidof -s $PG_HOME/bin/postmaster`
if [ $pid ] && $PG_HOME/pg_ctl status -D $PGDATA > /dev/null 2>&1
then
echo $"Postmaster already running."
else
#all systems go -- remove any stale lock files
rm -f /tmp/.s.PGSQL.${PGPORT} > /dev/null
echo -n "$PSQL_START"
su -l postgres -s /bin/sh -c "$PG_HOME/bin/pg_ctl -D $PGDATA -p $PG_HOME/bin/postmaster -o '-i -p ${PGPORT}' start > /dev/null 2>&1" < /dev/null
sleep 1
pid=`pidof -s $PG_HOME/bin/postmaster`
if [ $pid ]
then
if echo "$TYPESET"grep "declare -f success" >/dev/null
then
success "$PSQL_START"
else
echo " [ OK ]"
fi
touch /var/lock/subsys/${NAME}
echo $pid > /var/run/postmaster.${PGPORT}.pid
echo
else
if echo "$TYPESET"grep "declare -f failure" >/dev/null
then
failure "$PSQL_START"
else
echo " [ FAILED ]"
fi
echo
fi
fi
}
stop(){
echo -n "Stopping $NAME..."
PSQL_STOP=$"Stopping ${NAME} service: "
su -l postgres -s /bin/sh -c "$PG_HOME/bin/pg_ctl stop -D $PGDATA -s -m fast" > /dev/null 2>&1
ret=$?
if [ $ret -eq 0 ]
then
if echo "$TYPESET"grep "declare -f success" >/dev/null
then
success "$PSQL_STOP"
else
echo " [ OK ]"
fi
else
if echo "$TYPESET"grep "declare -f failure" >/dev/null
then
failure "$PSQL_START"
else
echo " [ FAILED ]"
fi
fi
echo
rm -f /var/run/postmaster.${PGPORT}.pid
rm -f /var/lock/subsys/${NAME}
echo
}
restart(){
stop
start
}
condrestart(){
[ -e /var/lock/subsys/${NAME} ] && restart
}
reload(){
su -l postgres -s /bin/sh -c "$PG_HOME/bin/pg_ctl reload -D $PGDATA -s" > /dev/null 2>&1
}
# This script is slightly unusual in that the name of the daemon (postmaster)
# is not the same as the name of the subsystem (postgresql)
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status postmaster
;;
restart)
restart
;;
condrestart)
condrestart
;;
reloadforce-reload)
reload
;;
*)
echo $"Usage: $0 {startstopstatusrestartcondrestartreloadforce-reload}"
exit 1
esac
exit 0

/etc/rc.d/init.d/httpd

#!/bin/bash
#
# Startup script for the Apache Web Server
#
# chkconfig: 345 85 15
# description: Apache is a World Wide Web server. It is used to serve # HTML files and CGI.
# processname: httpd
# pidfile: /var/run/httpd.pid
# config: /usr/local/apache2/conf/access.conf
# config: /usr/local/apache2/conf/httpd.conf
# config: /usr/local/apache2/conf/srm.conf
# Source function library.
. /etc/rc.d/init.d/functions
# This will prevent initlog from swallowing up a pass-phrase prompt if
# mod_ssl needs a pass-phrase from the user.
INITLOG_ARGS=""
# Path to the apachectl script, server binary, and short-form for messages.
apachectl=/usr/local/apache2/bin/apachectl
httpd=/usr/local/apache2/bin/httpd
prog=httpd
RETVAL=0
# Find the installed modules and convert their names into arguments httpd
# can use.
moduleargs() {
moduledir=/usr/local/apache2/modules
moduleargs=`
/usr/bin/find ${moduledir} -type f -perm -0100 -name "*.so" env -i tr '[:lower:]' '[:upper:]' awk '{gsub(/.*\//,"");gsub(/^MOD_/,"");gsub(/^LIB/,"");gsub(/\.SO$/,"");print "-DHAVE_" $0}'`echo ${moduleargs}
}
# The semantics of these two functions differ from the way apachectl does
# things -- attempting to start while running is a failure, and shutdown
# when not running is also a failure. So we just do it the way init scripts
# are expected to behave here.
start() {
echo -n $"Starting $prog: with SSL"
daemon $httpd -DSSL `moduleargs` $OPTIONS
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch /var/lock/subsys/httpd
return $RETVAL
}
stop() {
echo -n $"Stopping $prog: "
killproc $httpd
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f /var/lock/subsys/httpd /var/run/httpd.pid
}
reload() {
echo -n $"Reloading $prog: "
killproc $httpd -HUP
RETVAL=$?
echo
}
# See how we were called.
case "$1" in
start)
start
;;
startssl)
start
;;
stop)
stop
;;
status)
status $httpd
RETVAL=$?
;;
restart)
stop
start
;;
condrestart)
if [ -f /var/run/httpd.pid ] ; then
stop
start
fi
;;
reload)
reload
;;
gracefulhelpconfigtest)
$apachectl $@
RETVAL=$?
;;
*)
echo $"Usage: $prog {startstartsslstoprestartcondrestartreloadstatusfullstatusgracefulhelpconfigtest}"
exit 1
esac
exit $RETVAL

chkconfig
This installs scripts to start at startup and shutdown when system is halted
After you've copied all daemon scripts to /etc/rc.d/init.d, make sure you've changed the chkconfig line to reflect the appropriate runlevels
First make sure they are disabled, or else chkconfig sometimes gets confused
/sbin/chkconfig --del tomcatd
/sbin/chkconfig --del httpd
/sbin/chkconfig --del postgresql
Now add them
/sbin/chkconfig --add tomcatd
/sbin/chkconfig --add httpd
/sbin/chkconfig --add postgresql

JDBC Configuration

JDBC Configuration

ln -s /usr/local/pgsql/share/java/postgresql.jar /usr/local/tomcat/common/lib/postgresql.jar

I use the dbcp-commons connection pool.

This is in /usr/local/tomcat/webapps/mywebapp/WEB-INF/web.xml

Saturday, December 11, 2004

Setting up java tomcat on linux X - Install Pgaccess

Install Pgaccess

cd /usr/local/src
gunzip pgaccess-0_99_0_20040219.tgz
tar -xf pgaccess-0_99_0_20040219.tar

cp -R pgaccess-0_99_0_20040219 /usr/local/pgaccess

cd pgaccess-0_99_0_20040219

make clean
make all
cat "/usr/local/pgaccess/lib" >> /etc/ld.so.conf
ldconfig

Setting up java tomcat on linux IX - Install Postgresql


Creating the “postgres” User
Create a UNIX user account to own and manage the PostgreSQL database files. Typically, this user is named postgres, but it can be named anything that you choose.

You will need to have root privileges to create the PostgreSQL superuser. You can use the command shown to add the postgres user.

su - -c "useradd postgres"

Install Postgresql

cd /usr/local/src
tar xvfz postgresql-7.3.4.tar.gz
cd postgresql-7.3.4

then logoff and login as the postgres user (this wont work if your java and ant environment variables and path additions are not setup properly)

./configure --with-tcl --with-java

gmake
su -c "gmake install"
su -c "chown -R postgres.postgres /usr/local/pgsql"

Setting Environment Variables
The use of the PostgreSQL environment variables is not required. However, they are helpful when performing tasks within PostgreSQL, including starting and shutting down the postmaster processes.
The environment variables that should be set are for the man pages and the bin directory. You can do so by adding the following statements into the /etc/profile file.

PATH=$PATH:/usr/local/pgsql/bin
MANPATH=$MANPATH:/usr/local/pgsql/man
export PATH MANPATH

Initializing and Starting PostgreSQL
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data

Running postmaster in the background
/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l /tmp/pgsql.log start

Configuring the PostgreSQL SysV Script
The SysV script will allow the graceful control of the PostgreSQL database through the use of the SysV runlevel system. The SysV script can be used for starting, stopping, and status-checking of PostgreSQL. It is known to work with most Red Hat based versions of Linux, including Mandrake; however, it should work with other SysV systems (e.g., UnixWare, Solaris, etc.) with little modification. The script is named linux. To use it, you will first need to copy the linux script to your init.d directory. You may require root access to do this.
First, change to the directory where you unpacked the PostgreSQL source. eg /usr/local/src/postgresql-7.1.3/. Then, issue a cp command to copy the script from contrib/start-scripts into the init.d

Copying the linux script
cd /usr/local/src/postgresql-7.4.6
su -c "cp contrib/start-scripts/linux /etc/rc.d/init.d/postgresql"

Making the linux script executable
su -c "chmod a+x /etc/rc.d/init.d/postgresql"

There are no additional requirements to use the SysV script with Red Hat, if you do not intend on using it to start PostgreSQL automatically (i.e., if you wish to use the script manually). However, if you do wish for the script to startup PostgreSQL automatically when the machine boots up (or changes runlevels), you will need to have the chkconfig program installed. If chkconfig is installed, you will also need to add the following two lines, including the hash (#) symbol, at the beginning of the /etc/rc.d/init.d/postgresql file:

# chkconfig: 345 85 15
# description: PostgreSQL RDBMS

Starting PostgreSQL with the SysV script:

service postgresql start
Starting PostgreSQL: ok

service postgresql stop
Stopping PostgreSQL: ok

The next step will be to create a new database. This will be a simple test database. We do not recommend using the default template1 database for testing purposes. As you have not created any users with database-creation rights, you will want to make sure that you are logged in as the postgres user when adding a new database.

To create a new database named testdb, enter the command shown:
createdb testdb

psql testdb

You can now start entering SQL commands (e.g., such as SELECT) at the psql prompt
To verify that the database is working correctly, you can issue the command shown in which should give you a listing of the languages installed in the database

SELECT * FROM pg_language;

lanname lanispl lanpltrusted lanplcallfoid lancompiler
----------+---------+--------------+---------------+-------------
internal f f 0 n/a
C f f 0 /bin/cc
sql f f 0 postgres

10 Steps to Installing PostgreSQL

10 Steps to Installing PostgreSQL

Problem setting PATH on Mandrake 10

I posted these instructions earlier

Configure Environment Variables

Edit and add the lines below to '/etc/profile'

Make sure you logout and login for this to take effect.

It's really good to get this straight from the beginning.
JAVA_HOME=/usr/local/java/java
CATALINA_HOME=/usr/local/tomcat
PATH=$JAVA_HOME/bin:$PATH:$HOME/bin:/sbin:/usr/sbin
CLASSPATH=$CATALINA_HOME/bin/bootstrap.jar:$JAVA_HOME/lib/tools.jar:$CATALINA_HOME/common/lib/servlet.jar:/usr/local/pgsql/share/java/postgresql.jar:../lib/struts.jar:.
Now add the PATH JAVA_HOME CATALINA_HOME & CLASSPATH if any aren't in the export line
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC JAVA_HOME CATALINA_HOME CLASSPATH"

I had problems with this because when I logged off and on again, the variables had been created, but the path wasnt being changed.

Turns out this happens because I was logged on as root, so the PATH gets overridden after its set. Logging on as another user showed that the PATH does indeed get set properly. Helpdesk closed!

Thursday, December 09, 2004

The K-Zone: Understanding the Linux boot process

The K-Zone: Understanding the Linux boot process: "Understanding the Linux boot process"

Formatting and sorting dates in Displaytag

I use Displaytag for displaying data in an as400 Work-With Subfile type format in web pages, and it works very well.

One problem I came across was formatting the dates, whilst still using the automatic sorting. I thought I would have to format my data in my POJO and lose the automatic sorting.

But in fact Displaytag solves this problem by allowing you to apply decorators to columns

eg:

package com.decorator;

import java.util.Date;

import org.apache.commons.lang.time.FastDateFormat;
import org.displaytag.decorator.ColumnDecorator;


/**
* Simple column decorator which formats a date.
* @author epesh
* @author Fabrizio Giustina
* @version $Revision: 1.11 $ ($Author: fgiust $)
*/
public class DatetoDMY implements ColumnDecorator
{

/**
* FastDateFormat used to format the date object.
*/
private FastDateFormat dateFormat = FastDateFormat.getInstance("dd.MM.yyyy HH:mm:ss"); //$NON-NLS-1$

/**
* transform the given object into a String representation. The object is supposed to be a date.
* @param columnValue Object
* @return String
*/
public final String decorate(Object columnValue)
{
Date date = (Date) columnValue;
return this.dateFormat.format(date);
}
}

Wednesday, December 08, 2004

Setting up java tomcat on linux VIII - Configure Tomcat for mod_jk Connector

Configure Tomcat for mod_jk Connector

Directly below this line in '/usr/local/tomcat/conf/server.xml'

<Server port='8005' shutdown='SHUTDOWN' debug='1'\>

Add these lines:
<Listener className='org.apache.ajp.tomcat4.config.ApacheConfig'
modJk='/usr/local/apache2/modules/mod_jk.so'
workersConfig='/usr/local/tomcat/conf/jk/workers.properties'/>

Directly below this line in '/usr/local/tomcat/conf/server.xml'

<Host name='localhost' debug='0' appBase='webapps'>

Add this line

<Listener className='org.apache.ajp.tomcat4.config.ApacheConfig'
append='true' forwardAll='false'
modJk='/usr/local/apache2/modules/mod_jk.so' />

Comment out JK2 connector, and uncomment AJP1.3 connector (jk).(Does not appear to be required for tomcat5)
Change instances of localhost to whatever your domain name is

Create file '/usr/local/tomcat/conf/jk/workers.properties' with these contents:

# Setting Tomcat & Java Home
workers.tomcat_home=/usr/local/tomcat
workers.java_home=/usr/local/java/java
ps=/
worker.list=ajp13
worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13

Setting up java tomcat on linux VII - HowTo make your own Self-Signed SSL Certificate

cd /usr/local/ssl/bin

### Create server key

openssl genrsa -out mysite.key 1024

Generating RSA private key, 1024 bit long modulus
........................................++++++
....++++++
e is 65537 (0x10001)

### Create certificate request

openssl req -new -key mysite.key -out mysite.csr

You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:GB
State or Province Name (full name) [Some-State]:Norfolk
Locality Name (eg, city) []:Norwich
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Manic Miner Ltd
Organizational Unit Name (eg, section) []:Web Development
Common Name (eg, YOUR name) []:dooley.com
Email Address []:webmaster@dooley.com

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:freedom1
An optional company name []:Manic Miner Ltd

### self sign key (increment the serial number "N" for each new cert)

openssl x509 -req -days 365 -set_serial 001 -in mysite.csr -signkey mysite.key -out mysite.crt

Signature ok
subject=/C=GB/ST=Norfolk/L=Norwich/O=Manic Miner Ltd/OU=Web Development/CN=mysite/emailAddress=webmaster@mysite
Getting Private key

cp myhost.mydomain.* /usr/local/apache2/conf

#edit http.conf (or ssl.conf) file

SSLCeritifcateFile /usr/local/apache2/conf/myhost.mydomain.cert
SSLCertificateKeyFile /usr/local/apache2/conf/myhost.mydomain.key

Tuesday, December 07, 2004

Basic Vim

Vim (Vi improved) is a very popular, full featured text editor for Linux/Unix systems. It is practically guaranteed to be installed on most systems. If you are using a Linux/Unix shell account, you will appreciate Vim's ability to open, edit, create, and save files. Unfortunately, Vim is not very intuitive. Most will remember the helpless feeling they had on their first encounter.

There are an astounding number of commands for Vim. Even advanced users only use a subset of the available commands. This tutorial will endeavor to teach you enough to be productive and point you in the right direction should you desire to learn more.

Vim operates from within a shell. All commands are made from the keyboard. There is no mouse support, no fancy GUI, and no hints appear on the screen.

To start Vim, simply type vi at the command line.
This will open Vim with a new document and give you some basic version information and a hint or two. As soon as you begin inserting text, the information will disappear.
A variation on this is to type vi filename which will open Vim with that file loaded.
This is where most people will get stuck. Right at the beginning with no idea of how to insert text, save a file, or even exit the program! It seems to be some sort of a cruel joke. Windows users may even resort to rebooting the system or crashing the shell. (Linux systems can run for years without rebooting, this is never a good option.)

Here are the most important commands that you need to know. Commands for saving, writing and exiting are available when you are not in insert mode and are in the form ":command". That is a colon followed by the command. To toggle from command mode to insert mode, press i to enter insert mode. Press the "Esc key" to get back to command mode..

To change to INSERT mode press i or "insert".
To change out of INSERT mode press "Esc".
To exit the program type: :q.
To exit without saving type: :q!.
To write your file type: :w.
To write a new file and name it, type: :w filename.
OK, that will get you started. You can now do the most important things that you would want to do with a text editor. You can now open, create, edit, and save files as well as start and exit the program. Whew...

Moving around within a document:

You will quickly notice that the arrow keys, and the "home" and "end" keys do just about what you would expect them to do. Some of the behavior, however, is not really what you are looking for. Notice that when you arrow up or down the cursor jumps to the carriage returns rather than the screen lines.

There are an over abundance of ways to move around a document. Most will require that you are not in insert mode. Get use to moving in and out of insert mode! Note that you can add a number before most commands to modify the command.

*Screen lines are different than lines terminated by a carriage return!
To move to the left type: h, Ctrl-H, "back space", or the left arrow key.
To move to the right type: l, "space key", or the right arrow key.
To move to the end of a line type: $ or "End".
To move to the beginning of a line type: 0 or ^.
To move to the first character in a screen line type: g0, or 0.
To move to the last character in a screen line type: g$, or $.
To move to the middle of a screen line type: gm.
To move to a character number (position) in a line type: num |. (pipe symbol)
To move to the n-th occurrence of a character from the right type: num t char.
To move to the n-th occurrence of a character from the left type: num T char.
To move to the right a number of words type: num W.
To move to the left a number of words type: num B.
To move forward a number of sentences type: num ).
To move backward a number of sentences type: num (.
To move forward a number of paragraphs type: num }.
To move backward a number of paragraphs type: num {.
There are many more... This is a good start though.


To move down a line type: j.
To move up a line type: k.
To move down a screen line type: gj, or g[down_arrow].
To move up a screen line type: gk, or g[up_arrow].
To goto a specified line type: num G.
To goto a percentage of the document type: num %.
There are many more...


To scroll the screen down type: Ctrl-E.
To scroll the screen up type: Ctrl-Y.

This is enough to get you started with Vim. This is, however, not even the tip of the iceberg. Vim includes a complete scripting language and is highly configurable. You can work with multiple files, make command line commands, incorporate other programs, and much more.

Search for text in vi or vim

Very useful for a guy with little vim knowledge

Description
vi and vim have powerful searching capabilities because they bring to bear the richness of regular expressions.


Directions
To search for the next occurence of the text 'maybe' from the current cursor position, type:


/maybe<ENTER>


Search backward from the current position by using ? instead of / in the command.

Once you have searched for something, you can find the next occurrence by pressing n or the previous occurrence with N.

Searching in vi/vim is enhanced with regular expressions. For example, to find the next occurence of the text 'Total' that occurs at the beginning of a line, use:


/^Total

Saturday, December 04, 2004

Setting up java tomcat on linux VI - Configure APACHE SSL

Configure Apache/SSL

mkdir /usr/local/htdocs/secure
mkdir /usr/local/htdocs/secure/myhost.mydomain
#Now make changes in ssl.conf
#Look for similar lines and make sure it looks like this:

# General setup for the virtual host
DocumentRoot '/usr/local/htdocs/secure/myhost'
ServerName myhost.mydomain:443
ServerAdmin me@myhost.mydomain
ErrorLog logs/error_log
TransferLog logs/access_log

#Redirect / https://myhost.mydomain/mywebapp

# Static files
Alias /mywebapp "/usr/local/tomcat/webapps/mywebapp"



Options Indexes FollowSymLinks
DirectoryIndex index.jsp


# Deny direct access to WEB-INF and META-INF

AllowOverride None
deny from all



AllowOverride None
deny from all


JkMount /mywebapp/*.do ajp13
JkMount /mywebapp/*.jsp ajp13

JkMount /mywebapp ajp13
JkMount /mywebapp/* ajp13

Thursday, December 02, 2004

Setting up java tomcat on linux V - Configure APACHE non-ssl

Configure APACHE/NON-SSL

  • md /www
  • md /www/hosts
  • md /www/hosts/nonsecure
  • md /www/hosts/nonsecure/www.mydomain.com
  • md /www/hosts/nonsecure/www.mydomain.com/docs
  • md /www/hosts/cgi-bin
  • md /www/hosts/cgi-bin/www.mydomain.com
  • md /www/hosts/cgi-bin/www.mydomain.com/cgi-bin

#Make sure you have VirtualHost like this

NameVirtualHost 192.168.2.101


<VirtualHost *:80>
ServerName www.mydomain.com
ServerAdmin webmaster@www.mydomain.com
DocumentRoot /www/hosts/nonsecure/www.mydomain.com/docs
ErrorLog logs/www.mydomain.com_public-err_log
CustomLog logs/www.mydomain.com_public-access_log common
ScriptAlias /cgi-bin/ /www/hosts/cgi-bin/www.mydomain.com/cgi-bin


# Static files
Alias /mywebapp "/usr/local/tomcat/webapps/mywebapp" <


Directory "/usr/local/tomcat/webapps/mywebapp">
Options Indexes FollowSymLinks
DirectoryIndex index.jsp
</Directory>


#Deny direct access to WEB-INF and META-INF
<Location "/mywebapp/WEB-INF/*">
Allowoverride None
deny from all
</Location>


<Location "/mywebpp/META-iNF/*">
AllowOverride None
deny from all
</Location>

JkMount /mywebapp_nonsecure/*.do ajp13
JkMount /mywebapp_nonsecure/*.jsp ajp13
JkMount /mywebapp_nonsecure ajp13
JkMount /mywebapp_nonsecure/* ajp13
</VirtualHost>

JkWorkersFile "/usr/local/tomcat/conf/jk/workers.properties"
JkLogFile "/usr/local/tomcat/logs/mod_jk.log"

Wednesday, December 01, 2004

Setting up java tomcat on linux IV - Install APACHE

Install APACHE

  • cd /usr/local/src
  • tar xfz httpd-2.0.52.tar.gz
  • cd httpd-2.0.52
  • ./configure --prefix=/usr/local/apache2 --enable-so --enable-rewrite --enable-ssl --with-ssl=/usr/local/ssl --enable-proxy
  • make
  • make install (supposed to places in /usr/local/apache2, but make install placed it into /usr/locacl/apache2, see if this causes any problems later)


Build/Install MOD_JK Connector

  • cd /usr/local/src
  • unzip jakarta-tomcat-connectors-jk-1.2-src-current.zip
  • cd jakarta-tomcat-connectors-jk-1.2.6-src/jk/native
  • ./buildconf.sh
  • ./configure --with-apxs=/usr/locacl/apache2/bin/apxs
  • make
  • cp apache-2.0/mod_jk.so /usr/local/apache2/modules


Configure Apache for mod_jk

Put these lines in /usr/locacl/apache2/conf/http.conf just before NameVirtualHost

<IfModule !mod_jk.c>

LoadModule jk_module modules/mod_jk.so

</IfModule>

Tuesday, November 30, 2004

Setting up java tomcat on linux III - Install JAVA

Install JAVA


  • mkdir /usr/local/java
  • cd /usr/local/src
  • sh j2sdk-1_4_2-linux-i586.bin
  • mv j2sdk1.4.2_06 /usr/local/java
  • cd /usr/local/java
  • ln -s j2sdk1.4.02-06 java

Now the java directory will be in /usr/local/java/java. I do it like this so I can keep all my different JDKs/JREs in one directory and then just change the symbolic link to point to the current one.

Install Tomcat

  • cd /usr/local/src
  • tar xfz jakarta-tomcat-5.5.4.tar.gz
  • mv jakarta-tomcat-5.5.4 /usr/local/
  • ln -s jakarta-tomcat-4.1.29 tomcat

Install ANT

  • cd /usr/local/src
  • unzip apache-ant-1.6.2-bin.zip
  • mv apache-ant-1.6.2 /usr/local
  • cd /usr/local
  • ln -s jakarta-ant-1.6.0 ant
  • ln -s /usr/local/ant/bin/ant /usr/local/bin/ant

Install OPENSSL

  • cd /usr/local/src
  • tar xfz openssl-0.9.7e.tar.gz
  • cd openssl-0.9.7e
  • ./config
  • make
  • make test
  • make install

Setting up java tomcat on linux II

Configure Environment Variables

Edited and add the lines below to '/etc/profile'
Make sure you logout and login for this to take effect.
JAVA_HOME=/usr/local/java/java
CATALINA_HOME=/usr/local/tomcat
PATH=$JAVA_HOME/bin:$PATH:$HOME/bin:/sbin:/usr/sbin
CLASSPATH=$CATALINA_HOME/bin/bootstrap.jar:$JAVA_HOME/lib/tools.jar:$CATALINA_HOME/common/lib/servlet.jar:/usr/local/pgsql/share/java/postgresql.jar:../lib/struts.jar:.
Now add the PATH JAVA_HOME CATALINA_HOME & CLASSPATH if any aren't in the export line
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC JAVA_HOME CATALINA_HOME CLASSPATH

Type env to check your environment variables

Setting up java tomcat on linux I

Downloaded the files
Got all appropriate files from web and place them in /usr/local/src/.
httpd-2.0.48.tar.Z (source) Download Apache Httpd
openssl-0.9.7d.tar.gz (source) Download Openssl
j2sdk-1_4_2_03-linux-i586.bin (binary) Download Java
jakarta-tomcat-4.1.29.tar.gz (binary) Download Tomcat
jakarta-ant-1.6.0-bin.zip (binary) Download Ant
jakarta-tomcat-connectors-1.2.5 (source) Download mod_jk
struts 1.1 (binary) Download Struts
postgresql-7.4.1.tar.gz (source) Download postrgresql
pgaccess-0.98.8.20030520.tar.gz (source) Download pgaccess This is a gui client to access db.

Saturday, November 27, 2004

home networking with TCP/IP and Microsoft Windows

home networking with TCP/IP and Microsoft Windows

Using your Network for file sharing

Have you rebooted your computers recently? We just made a load of configuration changes so be sure to reboot them! When your computers start up, give them a minute or so to become 'aware' of each other. Sometimes you will get error messages if you try to access your network neighborhood too soon.

Next, open your 'Network Neighborhood' or 'My Network Places'. If you do not immediately see your other computers, you may have to drill through the 'entire network' selection.

Once you locate another computer, double click it to view the network shares available. You can right click a network share and select 'Map Network Drive'. This lets you map the share to a local drive letter - like F:. Now you can use that share just like a local hard drive.


In this picture, drive F: is a network share called 'shared' on a computer called 'dual800'

I can't find the other computer!

Try using the 'search for computer' command

Try to map the share into a drive letter manually


--------------------------------------------------------------------------------

Search for a Computer on your network

Sometimes using the "Search for Computers..." command will force your system to find the other computer. Simply right click the "Network Neighborhood" or "My Network Places" icon on your desktop and select "Search for Computers".



You should now see a screen that looks like the this


Type in the full name of the computer you need to find and click search. Remember when I said to keep the computer names simple? This is why!!

Once the computer is found, double click it and map the share into a network drive. You may start seeing this computer in your network neighborhood now too!


If you still can not locate the computer, try manually mapping the drive





--------------------------------------------------------------------------------

Map a Network Drive

First, collect the COMPUTER NAME and SHARE NAME that you wish to map. Next, right click the "Network Neighborhood" or "My Network Places" icon on your desktop and select "Map Network Drive".


Select an drive letter and then type in the full path to the network share on the other computer. The syntax of the share should be \\computername\sharename as shown above.

home networking with TCP/IP and Microsoft Windows

home networking with TCP/IP and Microsoft Windows: "TCP/IP Home Networking
and File Sharing Tutorial"

Im trying to setup my home pcs at home that are connected to the internet via a wireless router, into a little home network. here goes:

First,
Check Your Internet Connection
Ensure all of your computers can connect to the Internet. This is the best way to ensure that your computers have good connectivity between them and have TCP/IP loaded. If all of your computers can connect to the Internet, the rest of this tutorial will be a breeze.

DONE

Next,
Update Windows
All versions of Microsoft Windows have networking bugs - Windows 98, 98SE, ME, NT, 2000, XP all need important updates to work correctly. It is VERY IMPORTANT that you update Microsoft Windows with the latest patches to get your home network running correctly. Do this with the 'Windows Update' selection on your Start Menu Or see How to Update Windows for a step by step tutorial for each Microsoft operating system.

DONE

Configure Windows 2000
with NetBIOS over TCP/IP
From your desktop, right click the "My Network Places" and select Properties.
Be sure 'Client for Microsoft Networks" and "File and Printer Sharing" are both installed. If they are not installed, click the "Install Button" to install them now.
Next, select the "Internet Protocol (TCP/IP)" and click Properties.
Next, click the Advanced Button
Select the WINS tab. Under the "NetBios Setting" area, select the "Enable NetBIOS over TCP/IP"

DONE

Make sure each computer is in the same workgroup
A 'workgroup' is simply a logical grouping of computers. On a home network, only a single workgroup is needed. If all of your computers are not in the same workgroup, they may not be able to see each other correctly. Just make one up and stick to it. Keep it simple and easy to remember.
Each computer should get the SAME WORKGROUP name and a DIFFERENT computer name. Again, keep all names simple and easy to remember.
Fun Network Naming Examples
Workgroup: Atom
Computers: Neutrino, Quark, Electron, Proton, Neutron, etc...
Workgroup: Sol
Computers: Earth, Mars, Venus, Jupiter, Saturn, etc...
Workgroup: Milkeyway
Computers: Sirus, Centauri, Vega, Deneb, Canopus, Proxima, Rigil, etc...

Windows 2000
From your desktop, right click the "My Computer" icon and select Properties.
Next, Select the "Network Identification Tab" and click the "Properties button"
Type in the workgroup name you have selected and a unique computer name that is easy to remember.

THEN
Share a Folder on Each Computer
(All computers are configured)
A folder or printer must be shared on each computer for them to show up in your network neighborhood. The next set of pages will show you how to share a folder. Windows 2000 NOTE: You need to create a NEW SHARE. The default drive shares are not 'network shares'.

What is a network share?
A network share is a logical way for other computers to access portions of your hard drive. Other computers see the share on the network and can load and save data files just like a local hard drive. Remember, a network share just represents shared hard drive space - not shared programs. If a program was installed on computer A, you can't normally run it on computer B unless it gets installed there too.
Share a folder or the whole hard drive?
Many people turn their entire hard drive into a network share. I consider this fairly unwise - especially if you have a wireless (802.11b) network. Wireless networking is vulnerable to hackers. With only a few folders shared, only those folders can be easily attacked.
I always suggest creating a folder on your hard drive called 'shared' and sharing that. In this way, you will never have to wonder what files are shared and what files are not.
Create The Network Share
Create a folder on your hard drive and name it SHARE. Next, right click the new folder and select "Sharing". You should see a display like this.


Select "Share This Folder"
Then click the "Permissions Button"

DONE

User Security - IMPORTANT

An account needs to be created for each uniqe 'login' name on your network. For instance, if you log into a Windows 98 computer with the login name 'ted', then you must create a Windows 2000 login called 'ted'.
From the control panel, double click the admin tools icon. Next, click the Computer management icon. This will bring up a screen like the one below. From here, open the Local Users and Groups tree and add a new user by right clicking on the 'Users folder' and select 'Add new user' .

Create a user name that MATCHES the user name used to log into your other Windows computer. I would suggest assigning a password to this ID. I have sometimes had trouble using 'blank passwords'. You should also UNCHECK the 'User must change password' line and CHECK 'password never expires'.

DONE

User Security - IMPORTANT

An account needs to be created for each uniqe 'login' name on your network. For instance, if you log into a Windows 98 computer with the login name 'ted', then you must create a Windows 2000 login called 'ted'.
From the control panel, double click the admin tools icon. Next, click the Computer management icon. This will bring up a screen like the one below. From here, open the Local Users and Groups tree and add a new user by right clicking on the 'Users folder' and select 'Add new user' .

Create a user name that MATCHES the user name used to log into your other Windows computer. I would suggest assigning a password to this ID. I have sometimes had trouble using 'blank passwords'. You should also UNCHECK the 'User must change password' line and CHECK 'password never expires'.

From your windows 98/98se/me computer, you will see this IPC$ dialog box when trying to access a Windows 2000 network share.
Just use the password you assigned to the user name you logged into the Windows 98/98SE/ME computer with

DONE

THEN
Mapping Drives, Browsing the network
First of all, reboot your computers! We just made a load of configuration changes! When your computers start up, give them a minute or so to become 'aware' of each other. Sometimes you will get error messages if you try to access your network neighborhood too soon.
Tell me more about Network Browsing, Searching and Mapping network drives

DONE


Using your Network for file sharing
Have you rebooted your computers recently? We just made a load of configuration changes so be sure to reboot them! When your computers start up, give them a minute or so to become 'aware' of each other. Sometimes you will get error messages if you try to access your network neighborhood too soon.
Next, open your 'Network Neighborhood' or 'My Network Places'. If you do not immediately see your other computers, you may have to drill through the 'entire network' selection.
Once you locate another computer, double click it to view the network shares available. You can right click a network share and select 'Map Network Drive'. This lets you map the share to a local drive letter - like F:. Now you can use that share just like a local hard drive.

In this picture, drive F: is a network share called 'shared' on a computer called 'dual800'
I can't find the other computer!
Try using the 'search for computer' command
Try to map the share into a drive letter manually
Search for a Computer on your network
Sometimes using the "Search for Computers..." command will force your system to find the other computer. Simply right click the "Network Neighborhood" or "My Network Places" icon on your desktop and select "Search for Computers".
You should now see a screen that looks like the this

Type in the full name of the computer you need to find and click search. Remember when I said to keep the computer names simple? This is why!!
Once the computer is found, double click it and map the share into a network drive. You may start seeing this computer in your network neighborhood now too!
If you still can not locate the computer, try manually mapping the drive
Map a Network Drive
First, collect the COMPUTER NAME and SHARE NAME that you wish to map. Next, right click the "Network Neighborhood" or "My Network Places" icon on your desktop and select "Map Network Drive".
A screen like this should appear
Select an drive letter and then type in the full path to the network share on the other computer. The syntax of the share should be \\computername\sharename as shown above. In this example drive F: will be mapped to a network share called 'shared' on a computer called 'dual800'
Example of a mapped share in Explorer

In this picture, drive F: is a network share called 'shared' on a computer called 'dual800'
You are Finished with this tutorial!
Return to the tutorial

Tuesday, November 23, 2004

Hibernate 3 sql-query not working

I have had a problem using order by on one of my mappings.

So as an attempted solution I have tried upgrading the application to Hibernate3, and tried to use the sql-query, so that I could use my own sql statement to load the object.

For some reason it is not working as hibernate is still generating its own SQL and ignoring the fact that I have specified loader in the class mapping. Is this a bug or am I doing something wrong.

The documentation seems very precise on how to use this, so any help would be most appreciated.

Failing this I may have to switch over to Ibatis so that I can get complete control of the SQL, as im pretty stuck at the moment, and all im trying to do is retrieve shopping baskets in description order? Hibernate version: Hibernate 3.0 alpha Mapping documents: <hibernate-mapping package="com.bertrams.bertweb.domain.order"> <class name="Basket" table="BBSHBM"> <composite-id name="id" class="BasketKey"> <key-property name="account" type="long" column="SBACCT"/> <key-property name="branch" type="long" column="SBBRAN"/> <key-property name="uuid" type="com.bertrams.bertweb.dao.hibernate.TrimmedString" column="SBUUID"/> </composite-id> <property name="description" type="com.bertrams.bertweb.dao.hibernate.TrimmedString"> <column name="SBDESC" sql-type="char(50)" not-null="true"/> </property> <property name="type" type="com.bertrams.bertweb.dao.hibernate.TrimmedString"> <column name="SBTYPE" sql-type="char(20)" not-null="true"/> </property> <map name="basketItems" inverse="true" lazy="false" cascade="all"> <key> <column name="SGACCT"/> <column name="SGBRAN"/> <column name="SGUUID"/> </key> <composite-index class="BasketItemIndex"> <key-property name="seqn" type="long" column="SGSEQN"/> <key-property name="isbn" type="com.bertrams.bertweb.dao.hibernate.TrimmedString" column="SGISBN"/> </composite-index> <one-to-many class="BasketItem"/> </map> [b]<loader query-ref="basketLoader"/>[/b] </class> [b] <sql-query name="basketLoader"> <return alias="b" class="Basket"/> SELECT {b}.SBACCT AS {b.id.account}, {b}.SBBRAN AS {b.id.branch}, {b}.SBUUID AS {b.id.uuid}, {b}.SBTYPE AS {b.type}, {b}.SBTYPEID AS {b.typeId}, {b}.SBSTAT AS {b.status}, {b}.SBCDAT AS {b.created}, {b}.SBCUSR AS {b.createdBy}, {b}.SBCPGM AS {b.createdByPgm}, {b}.SBMDAT AS {b.modified}, {b}.SBMUSR AS {b.modifiedBy}, {b}.SBMPGM AS {b.modifiedByPgm} FROM BBSHBM {b} WHERE {b}.SBACCT=? and {b}.SBBRAN=? AND {b}.SBSTAT='OPN' ORDER BY SBDESC </sql-query> [/b] </hibernate-mapping> Code between sessionFactory.openSession() and session.close(): Customer customer = (Customer)currentSession().get(Customer.class, ck); Full stack trace of any exception that occurs: Name and version of the database you are using: db2/400 v5r1 The generated SQL (show_sql=true): Hibernate: select baskets0_.SBACCT as SBACCT__, baskets0_.SBBRAN as SBBRAN__, baskets0_.SBUUID as SBUUID__, baskets0_.SBACCT as SBACCT0_, baskets0_.SBBRAN as SBBRAN0_, baskets0_.SBUUID as SBUUID0_, baskets0_.SBDESC as SBDESC3_0_, baskets0_.SBTYPE as SBTYPE3_0_, baskets0_.SBTYPEID as SBTYPEID3_0_, baskets0_.SBSTAT as SBSTAT3_0_, baskets0_.SBCDAT as SBCDAT3_0_, baskets0_.SBCUSR as SBCUSR3_0_, baskets0_.SBCPGM as SBCPGM3_0_, baskets0_.SBMDAT as SBMDAT3_0_, baskets0_.SBMUSR as SBMUSR3_0_, baskets0_.SBMPGM as SBMPGM3_0_ from BBSHBM baskets0_ where baskets0_.SBACCT=? and baskets0_.SBBRAN=? and baskets0_.SBSTAT='OPN' Debug level Hibernate log excerpt

Order-by problem in hibernate on as400

I am having a problem using order-by on as400. I have used it previously in other mapping files, no problem, but for some reason hibernate seems to be using the wrong field name in the order-by. It looks as if it is giving the result field a new name in the sql statement, but using the original name in the order-by
Anyone have any workarounds for this, or suggest what im doing wrong?
the order-by is on SBDESC , a description field that I want to sort on?
Hibernate version:
2.1.6 (also tried on 2.1.2 and 3 with the same result)
Mapping documents:
<hibernate-mapping package="com.bertrams.bertweb.domain.customer">
<class name="Customer" table="BBEDPDL5">
<composite-id name="id" class="CustomerKey">
<key-property name="account" type="long" column="BEACCN"/>
<key-property name="branch" type="long" column="BEBRAC"/>
</composite-id>

<map name="baskets" where="SBSTAT='OPN'" [b]order-by="SBDESC"[/b]>
<key>
<column name="SBACCT"/>
<column name="SBBRAN"/>
</key>
<index column="SBUUID" type="com.bertrams.bertweb.dao.hibernate.TrimmedString"/>
<one-to-many class="com.bertrams.bertweb.domain.order.Basket"/>
</map>
</class>
</hibernate-mapping>
<hibernate-mapping package="com.bertrams.bertweb.domain.order">
<class name="Basket" table="BBSHBM">
<composite-id name="id" class="BasketKey">
<key-property name="account" type="long" column="SBACCT"/>
<key-property name="branch" type="long" column="SBBRAN"/>
<key-property name="uuid" type="com.bertrams.bertweb.dao.hibernate.TrimmedString" column="SBUUID"/>
</composite-id>

<property name="description" type="com.bertrams.bertweb.dao.hibernate.TrimmedString">
<column name="SBDESC" sql-type="char(50)" not-null="true"/>
</property>
</class>
</hibernate-mapping>

Code between sessionFactory.openSession() and session.close():
Customer customer = (Customer)currentSession().get(Customer.class, ck);

Full stack trace of any exception that occurs:
Hibernate: select baskets0_.SBACCT as SBACCT__, baskets0_.SBBRAN as SBBRAN__, baskets0_.SBUUID as SBUUID__, baskets0_.SBACCT as SBACCT0_, baskets0_.SBBRAN as SBBRAN0_, baskets0_.SBUUID as SBUUID0_, baskets0_.SBDESC as SBDESC0_, baskets0_.SBTYPE as SBTYPE0_, baskets0_.SBTYPEID as SBTYPEID0_, baskets0_.SBSTAT as SBSTAT0_, baskets0_.SBCDAT as SBCDAT0_, baskets0_.SBCUSR as SBCUSR0_, baskets0_.SBCPGM as SBCPGM0_, baskets0_.SBMDAT as SBMDAT0_, baskets0_.SBMUSR as SBMUSR0_, baskets0_.SBMPGM as SBMPGM0_ from BBSHBM baskets0_ where baskets0_.SBACCT=? and baskets0_.SBBRAN=? and baskets0_.SBSTAT='OPN' order by baskets0_.SBDESC
[22/11/04 15:38:41:562 GMT] 5a795a79 SystemOut O as400: PreparedStatement STMT0005 (1741514701) open. Parent: Connection S44B4901 (744107098) .
as400: PreparedStatement STMT0005 (1741514701) : Escape processing = "true".
as400: PreparedStatement STMT0005 (1741514701) : Fetch direction = "1000".
as400: PreparedStatement STMT0005 (1741514701) : Fetch size = "0".
as400: PreparedStatement STMT0005 (1741514701) : Max field size = "0".
as400: PreparedStatement STMT0005 (1741514701) : Max rows = "0".
as400: PreparedStatement STMT0005 (1741514701) : Query timeout = "0".
as400: PreparedStatement STMT0005 (1741514701) : Result set conncurrency = "1007".
as400: PreparedStatement STMT0005 (1741514701) : Result set type = "1003".
as400: PreparedStatement STMT0005 (1741514701) : Preparing [select baskets0_.SBACCT as SBACCT__, baskets0_.SBBRAN as SBBRAN__, baskets0_.SBUUID as SBUUID__, baskets0_.SBACCT as SBACCT0_, baskets0_.SBBRAN as SBBRAN0_, baskets0_.SBUUID as SBUUID0_, baskets0_.SBDESC as SBDESC0_, baskets0_.SBTYPE as SBTYPE0_, baskets0_.SBTYPEID as SBTYPEID0_, baskets0_.SBSTAT as SBSTAT0_, baskets0_.SBCDAT as SBCDAT0_, baskets0_.SBCUSR as SBCUSR0_, baskets0_.SBCPGM as SBCPGM0_, baskets0_.SBMDAT as SBMDAT0_, baskets0_.SBMUSR as SBMUSR0_, baskets0_.SBMPGM as SBMPGM0_ from BBSHBM baskets0_ where baskets0_.SBACCT=? and baskets0_.SBBRAN=? and baskets0_.SBSTAT='OPN' order by baskets0_.SBDESC].
SQLException: SQLState(42707) vendor code(-208)
[22/11/04 15:38:41:656 GMT] 5a795a79 JDBCException W net.sf.hibernate.util.JDBCExceptionReporter SQL Error: -208, SQLState: 42707
[22/11/04 15:38:41:687 GMT] 5a795a79 JDBCException E net.sf.hibernate.util.JDBCExceptionReporter [SQL0208] ORDER BY column SBDESC or expression not in result table.
[22/11/04 15:38:41:718 GMT] 5a795a79 JDBCException W net.sf.hibernate.util.JDBCExceptionReporter SQL Error: -208, SQLState: 42707
[22/11/04 15:38:41:718 GMT] 5a795a79 JDBCException E net.sf.hibernate.util.JDBCExceptionReporter [SQL0208] ORDER BY column SBDESC or expression not in result table.
[22/11/04 15:38:41:734 GMT] 5a795a79 JDBCException E net.sf.hibernate.util.JDBCExceptionReporter could not initialize collection: [com.bertrams.bertweb.domain.customer.Customer.baskets#[account:63173][branch:1]]
[22/11/04 15:38:41:734 GMT] 5a795a79 JDBCException E net.sf.hibernate.util.JDBCExceptionReporter TRAS0014I: The following exception was logged java.sql.SQLException: [SQL0208] ORDER BY column SBDESC or expression not in result table.
at java.lang.Throwable.<init>(Throwable.java)
at java.lang.Throwable.<init>(Throwable.java)
at java.sql.SQLException.<init>(SQLException.java:52)
at com.ibm.as400.access.JDError.throwSQLException(JDError.java:388)
at com.ibm.as400.access.AS400JDBCStatement.commonPrepare(AS400JDBCStatement.java:1075)
at com.ibm.as400.access.AS400JDBCPreparedStatement.<init>(AS400JDBCPreparedStatement.java:208)
at com.ibm.as400.access.AS400JDBCConnection.prepareStatement(AS400JDBCConnection.java:1419)
at com.ibm.as400.access.AS400JDBCConnectionHandle.prepareStatement(AS400JDBCConnectionHandle.java:669)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.prepareStatement(WSJdbcConnection.java:1458)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.prepareStatement(WSJdbcConnection.java:1424)
at net.sf.hibernate.impl.BatcherImpl.getPreparedStatement(BatcherImpl.java:257)
at net.sf.hibernate.impl.BatcherImpl.getPreparedStatement(BatcherImpl.java:232)
at net.sf.hibernate.impl.BatcherImpl.prepareQueryStatement(BatcherImpl.java:65)
at net.sf.hibernate.loader.Loader.prepareQueryStatement(Loader.java:779)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:265)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
at net.sf.hibernate.loader.Loader.loadCollection(Loader.java:990)
at net.sf.hibernate.loader.Loader.loadCollection(Loader.java:965)
at net.sf.hibernate.loader.OneToManyLoader.initialize(OneToManyLoader.java:93)
at net.sf.hibernate.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:284)
at net.sf.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:3268)
at net.sf.hibernate.collection.PersistentCollection.forceInitialization(PersistentCollection.java:336)
at net.sf.hibernate.impl.SessionImpl.initializeNonLazyCollections(SessionImpl.java:3123)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:138)
at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:911)
at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:931)
at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:59)
at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:51)
at net.sf.hibernate.persister.EntityPersister.load(EntityPersister.java:419)
at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:2117)
at net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:1991)
at net.sf.hibernate.impl.SessionImpl.get(SessionImpl.java:1927)
at com.bertrams.bertweb.dao.CustomerDAO.getCustomer(CustomerDAO.java:20)
at com.bertrams.bertweb.delegate.CustomerDelegate.getCustomerBaskets(CustomerDelegate.java)
at com.bertrams.bertweb.controller.action.ShoppingBasketAction.list(ShoppingBasketAction.java)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:41)
at java.lang.reflect.Method.invoke(Method.java:386)
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)
at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:983)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:564)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:200)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:119)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:276)
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:182)
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:618)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:439)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java)
.
java.sql.SQLException: [SQL0208] ORDER BY column SBDESC or expression not in result table.
at java.lang.Throwable.<init>(Throwable.java)
at java.lang.Throwable.<init>(Throwable.java)
at java.sql.SQLException.<init>(SQLException.java:52)
at com.ibm.as400.access.JDError.throwSQLException(JDError.java:388)
at com.ibm.as400.access.AS400JDBCStatement.commonPrepare(AS400JDBCStatement.java:1075)
at com.ibm.as400.access.AS400JDBCPreparedStatement.<init>(AS400JDBCPreparedStatement.java:208)
at com.ibm.as400.access.AS400JDBCConnection.prepareStatement(AS400JDBCConnection.java:1419)
at com.ibm.as400.access.AS400JDBCConnectionHandle.prepareStatement(AS400JDBCConnectionHandle.java:669)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.prepareStatement(WSJdbcConnection.java:1458)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.prepareStatement(WSJdbcConnection.java:1424)
at net.sf.hibernate.impl.BatcherImpl.getPreparedStatement(BatcherImpl.java:257)
at net.sf.hibernate.impl.BatcherImpl.getPreparedStatement(BatcherImpl.java:232)
at net.sf.hibernate.impl.BatcherImpl.prepareQueryStatement(BatcherImpl.java:65)
at net.sf.hibernate.loader.Loader.prepareQueryStatement(Loader.java:779)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:265)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
at net.sf.hibernate.loader.Loader.loadCollection(Loader.java:990)
at net.sf.hibernate.loader.Loader.loadCollection(Loader.java:965)
at net.sf.hibernate.loader.OneToManyLoader.initialize(OneToManyLoader.java:93)
at net.sf.hibernate.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:284)
at net.sf.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:3268)
at net.sf.hibernate.collection.PersistentCollection.forceInitialization(PersistentCollection.java:336)
at net.sf.hibernate.impl.SessionImpl.initializeNonLazyCollections(SessionImpl.java:3123)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:138)
at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:911)
at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:931)
at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:59)
at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:51)
at net.sf.hibernate.persister.EntityPersister.load(EntityPersister.java:419)
at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:2117)
at net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:1991)
at net.sf.hibernate.impl.SessionImpl.get(SessionImpl.java:1927)
at com.bertrams.bertweb.dao.CustomerDAO.getCustomer(CustomerDAO.java:20)
at com.bertrams.bertweb.delegate.CustomerDelegate.getCustomerBaskets(CustomerDelegate.java)
at com.bertrams.bertweb.controller.action.ShoppingBasketAction.list(ShoppingBasketAction.java)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:41)
at java.lang.reflect.Method.invoke(Method.java:386)
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)
at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:983)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:564)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:200)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:119)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:276)
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:182)
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:618)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:439)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java)
Name and version of the database you are using:
db2/400 v5r1
The generated SQL (show_sql=true):
Hibernate: select baskets0_.SBACCT as SBACCT__, baskets0_.SBBRAN as SBBRAN__, baskets0_.SBUUID as SBUUID__, baskets0_.SBACCT as SBACCT0_, baskets0_.SBBRAN as SBBRAN0_, baskets0_.SBUUID as SBUUID0_, baskets0_.SBDESC as SBDESC0_, baskets0_.SBTYPE as SBTYPE0_, baskets0_.SBTYPEID as SBTYPEID0_, baskets0_.SBSTAT as SBSTAT0_, baskets0_.SBCDAT as SBCDAT0_, baskets0_.SBCUSR as SBCUSR0_, baskets0_.SBCPGM as SBCPGM0_, baskets0_.SBMDAT as SBMDAT0_, baskets0_.SBMUSR as SBMUSR0_, baskets0_.SBMPGM as SBMPGM0_ from BBSHBM baskets0_ where baskets0_.SBACCT=? and baskets0_.SBBRAN=? and baskets0_.SBSTAT='OPN' order by baskets0_.SBDESC
Debug level Hibernate log excerpt:
[/b]