Sunday, April 29, 2007


Installing Oracle 10.2.0.1 on CentOS 5.0 (x86_64)



During OS install both GNOME and KDE desktops were selected
as well as all components of all available groups except
"Virtualisation","Clustering","Cluster Storage"
KDE Session has been selected for system login.
Firewall and SELINUX have been disabled.


Hard disk partitions layout before installing Oracle.







CentOS 5.0 preinstall configuration.



File /etc/redhat-release has been edited to contain:-
redhat-4
to avoid installer's exit at startup.
Following lines added to the /etc/security/limits.conf file:-



* soft nproc 2047
* hard nproc 16384
* soft nofile 1024
* hard nofile 65536






Following line added to the /etc/pam.d/login file:-



session required /lib/security/pam_limits.so




1. Check for required rpms to be installed.





2. Install rpms , which have not been attached to system during CentOS 5.0 installation, from DVD.





3.Tune /etc/sysctl.conf





Then run:-


# /sbin/sysctl -p





5. Run as root following script:-



groupadd oinstall
groupadd dba
groupadd oper
useradd -g oinstall -G dba oracle
passwd oracle
mkdir -p /u01/app/oracle/product/10.2.0/db_1
chown -R oracle.oinstall /u01
mkdir -p /u02/oradata
chown -R oracle.oinstall /u02




6. Configure oracle's .bash_profile.
Actually, Oracle recommends export only ORACLE_BASE and ORACLE_SID,
what makes installer able to generate ORACLE_HOME by itself
But,anyway you will have modify .bash_profile after installation.
Line: ulimit -u 16384 -n 65536 has not been included into .bash_profile
due to testing environment





7.Copy archive to disk and extract it:-










# xhost +
# su - oracle
#./runInstaller




Installation screenshots:-









































Login to EM console:-









Saturday, April 21, 2007


Marvell Yukon Driver (SK-9E22) for Solaris (x64) 8.19.1.3
installation procedure in Solaris Express (SNV 59)



At mean time many people are experiencing problems with installing Solaris Express
on PC with boards based on Marvell Yukon Gigabit PCI-X Ethernet adapter.
Version for download from :


http://www.syskonnect.de


may be installed but actually doesn’t work. Workaround for this issue follows bellow


Run to find out vendor-id and device-id :



# prtconf –pv
device-id : 4364
vendor-id: 11ab




on your board


Modify script ./SKGEsolx/installation/postinstallation :-
Edit add_drv parameters list and put yours "pci11ab,4364" on the list.
Run:



# pkgadd -d . SKGEsolx




It will exit and report:
that original checksum of postinstallation script is XXXXX and differs from actual YYYYY.
Then edit ./SKGEsolx/pkgmap and put in postinstallation line instead of XXXXX value YYYYY.
Run again:-



# pkgadd -d . SKGEsolx




Script should complete OK and report , that skge0 was plumbed and brought up.





Proceed as was advised by John Brewer :-
Run as root:-



# sys-unconfig




This program will unconfigure your system. It will cause it
to revert to a "blank" system - it will not have a name or know
about other systems or networks.
This program will also halt the system.
Do you want to continue (y/n) ? y
Then the system will shutdown and when you reboot,
it asks all new server questions out of the box:


What your server name is ?
Are you on the network ?
Ask for DHCP or IP ?
What is your netmask ?
Do you have a defaultrouter ?
Root passwd?
Which interface ? ( skge0 will be there, it in the kernel now and have to be selected)


Finally it run the kdmconfig and tries to configure your X-display adapter and monitor size,mouse ps/2 USB or serial


When system reboots interface skge0 will be really up and running
Interface skge0 has been assigned new IP-address: 192.168.0.59


Saturday, April 14, 2007


Snoop -P -d skge0 statistics when pinging SNV 59 (64 bit) from remote Windows box










Would it be enough ?

Monday, March 19, 2007


Multi Booting CentOS 4.4 and several openSUSE 10.2 instances,each one installed on it's own SATA drive attached to Intel's ICH8R on ASUS P5B Deluxe




In this case we do have to perform CentOS install from SATA Optical Drive,
otherwise CentOS won't work properly with several SATA drives.
So,option:-


boot: linux all-generic-ide pci=nommconf




is obviously unacceptable for production environment .


1.Install first instance of openSUSE 10.2 on /dev/sda putting GRUB into MBR (/dev/sda)
2.Install CentOS 4.4 on /dev/sdb putting GRUB into MBR (/dev/sda)
3.Install second instance of openSUSE 10.2 on /dev/sdb putting GRUB in root
partition of current instance.


Load CentOS and modify grub.conf as follows:-





Then run:-


# grub-install /dev/sda




and reboot the box.

Disk layout snapshots in different linux instances:






Sunday, February 25, 2007


Install CentOS 4.4 on ASUS P5B Deluxe utilizing IDE-CDROM
connected to Jmicron JMB363 PATA port



At initial boot prompt specify:


boot: linux all-generic-ide pci=nommconf




This will start graphical install.When you will be brought
to screen that defines "Kernel boot options" type in
corresponding window:


all-generic-ide pci=nommconf




and proceed with installation.
Instance of CentOS 4.4 been created will recognize IDE-CDROM:



File /boot/grub/menu.lst should look like:-



Installing SKGE driver for Marvell Youkon Gigabit Ethernet Adapter may be done as
described in post:


Install CentOS 4.4 on ASUS P5B Deluxe


Note: This way of creating CentOS 4.4 instance on P5B Deluxe has not been tested
in production environment. The way decribed by the link above does work in production.

Thursday, February 15, 2007


Install CentOS 4.4 on ASUS P5B Deluxe



CentOS 4.4 has been istalled on the box as a second operating system
utilizing SATA DVD RW connected to Intel's ICH8R SouthBridge
(SATA,RAID) port. Both Intel ICH8R and Jmicron JMB363 controllers
have been turned into AHCI mode before first OS (Windows 2003) install.
Driver for Marvell Youkon Gigabit Ethernet Adapter has been downloaded from:-



Following symlink was created to compile skge driver:-



Kernel config appears to be OK to load sky98lin module at next reboot , kernel recompilation was not needed:-



Detailed hardware detection of chipsets on P5B Deluxe MB may be viewed on screenshots:-











Network adapter view after SKGE driver install:-



Telnet connection screen from remote host:-



Sound card detection:-

Thursday, January 11, 2007


Regarding proper packaging files with project in NETBEANS 5.5



To package file with project having requered PATH in WAR you have
click on "Item" content field after typing PATH in PATH in WAR field.
Screen should look like on Windows:-





on Linux:-

In this case when you get back to this screen later it will look like on Windows:-





on Linux:-





If you just click "OK" after typing in PATH in WAR field , when you get back to this
screen you will find "PATH in WAR" field empty.
In this case packaging will place file in root folder of corresponding WAR archive.
instead of "WEB-INF" for example.
It works this way on Linux and on Windows.

Thursday, January 04, 2007


Facelets, (JBOSS) Seam, Netbeans and Glassfish



This posting demonstrates that we don't have to package components.xml
with sampleProject-war.



Working on second sample from :

Recent publication: Facelets, (JBOSS) Seam, Netbeans and Glassfish

I have commented out second entry in components.xml:-


<!DOCTYPE components PUBLIC
"-//JBoss/Seam Component Configuration DTD 1.1//EN"
"http://jboss.com/products/seam/components-1.1.dtd">

<components>

<component name="org.jboss.seam.core.init">
<property name="debug"> true </property>
</component>

<!--
<component name="org.jboss.seam.core.init">
<property name="jndiPattern"> java:comp/env/sampleProject-ejb/#{ejbName}/local </property>
</component>
-->

<component name="entityManager" class="org.jboss.seam.core.ManagedPersistenceContext">
<property name="persistenceUnitJndiName"> java:/sampleProject-ejbPU</property>
</component>

</components>




and kept web.xml's corresponding entry in place:-


<context-param>
<description>
</description>
<param-name>org.jboss.seam.core.init.jndiPattern</param-name>
<param-value>java:comp/env/sampleProject?ejb/#{ejbName}/local</param-value>
</context-param>
<listener>
<listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
</listener>
<filter>
<filter-name>SeamRedirectFilter </filter-name>
<filter-class>org.jboss.seam.servlet.SeamRedirectFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>SeamRedirectFilter </filter-name>
<url-pattern>*.xhtml</url-pattern>
</filter-mapping>
<filter>
<filter-name>SeamExceptionFilter</filter-name>
<filter-class>org.jboss.seam.servlet.SeamExceptionFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>SeamExceptionFilter </filter-name>
<url-pattern >*.xhtml</url-pattern>
</filter-mapping>
<ejb-local-ref>
<ejb-ref-name>sampleProject?ejb/ActionBean/local</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local>dummy.ActionLocal</local>
<ejb-link >ActionBean</ejb-link>
</ejb-local-ref>




Packaging components.xml with sampleProject-war, generated following
entry into C: \Solaris\AppServer\domains\domain1\logs\server.log during deployment:-


[#|2007-01-04T13:58:38.265+0300|WARNING|sun-appserver-pe9.0|javax.enterprise.resource.webcontainer.jsf.lifecycle|
_ThreadID=15;_ThreadName=httpWorkerThread-8080-1;_RequestID=02b398d6-1127-4c3d-9444-5c446d01a0a5;|
Could not instantiate Seam component:
action org.jboss.seam.InstantiationException:
Could not instantiate Seam component: action
at org.jboss.seam.Component.newInstance(Component.java:1722)
at org.jboss.seam.Component.getInstance(Component.java:1625)
at org.jboss.seam.Component.getInstance(Component.java:1592)
at org.jboss.seam.Component.getInstance(Component.java:1586)
at org.jboss.seam.jsf.SeamELResolver.getValue(SeamELResolver.java:39)
. . . . . . . . .




Configuration suggested above didn’t.
However entry:-


[#|2007-01-05T12:59:02.046+0300|WARNING|sun-appserver-pe9.0|javax.enterprise.system.core.classloading|
_ThreadID=11;_ThreadName=httpWorkerThread-4848-0;_RequestID=6735512c-cb12-4daf-9af8-406d320f710d;|
Input stream has been finalized or forced closed without being explicitly closed; stream instantiation
reported in following stack trace
java.lang.Throwable
at com.sun.enterprise.loader.EJBClassLoader$SentinelInputStream.(EJBClassLoader.java:1123)
at com.sun.enterprise.loader.EJBClassLoader.getResourceAsStream(EJBClassLoader.java:788)
. . . . . . . . . ..




showed up in both cases during deployment , but didn't affect running application
No packaging components.xml with sapmleProject-war has been done before running
project.Regarding proper packaging view also:-


Packaging files with projects issues in NetBeans 5.5


Snapshots:-














Unload NetBeans 5.5 and run deployed apps:-





Load NetBeans and perform database control:-



We are going to make a slight modification to original project.



*****************
ActionLocal.java
*****************


package dummy;
import javax.ejb.Local;
/**
* This is the business interface for Action enterprise bean.
*/
@Local
public interface ActionLocal {
public String registration ();
}




*********************
ActionBean.java
*********************


package dummy;
import dummy.entity.User;
import java.util.List;
import javax.ejb.Stateless;
import javax.faces.context.FacesContext;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.jboss.seam.annotations.Factory;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Outcome;
import org.jboss.seam.ejb.SeamInterceptor;

@Stateless
@Name( "action" )

public class ActionBean implements ActionLocal {
@In( create=true , required=true )
User user;

@PersistenceContext ( )
private EntityManager em;
public ActionBean ( ) { }
public String registration (){
List persons = em.createQuery("select x from User x where x.username=:username").setParameter("username", user.getUsername()).getResultList();
if (persons.size()==0)
{
em.persist(user);
return "success";
}
else
{
return "repeat";
}
}

}




***************************************************************
First client for sampleTemplate - template-client.xhtm
***************************************************************


<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html">
<body>
This text above will not be displayed.
<ui:composition template="/template.xhtml">
This text will not be displayed.
<ui:define name="title">
Registration Form
</ui:define>
This text will also not be displayed.
<ui:define name="body">
<ui:define name="content">
<h:form>
<h:inputText id="username" value="#{user.username}"/>
<h:inputText id="password" value="#{user.password}"/>
<h:commandButton value="Sign in" action="#{action.registration}"/>
</h:form>
</ui:define>
</ui:define>
This text will not be displayed.
</ui:composition>
This text below will also not be displayed.
</body>
</html>




****************************************************************
Second client for sampleTemplate -TemplateClientOk.xhtml
****************************************************************


<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html">

<body>

<ui:composition template="sampleTemplate.xhtml">

<ui:define name="top">
Registration done for:
</ui:define>

<ui:define name="content">
<h:form>
<h:outputText id="username" value="#{user.username}"/>
</h:form>
</ui:define>

</ui:composition>

</body>
</html>




**************************************************************
Third client for sampleTemplate -TemplateClientNO.xhtml
**************************************************************


<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html">

<body>

<ui:composition template="sampleTemplate.xhtml">

<ui:define name="top">
Already registered user's name:
</ui:define>
<ui:define name="content">
<h:form>
<h:outputText id="username" value="#{user.username}"/>
</h:form>
</ui:define>

</ui:composition>

</body>
</html>




*****************************
Add to faces-config.xml
*****************************


<navigation-rule>
<from-view-id>/template-client.xhtml</from-view-id>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/templateClientOK.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>repeat</from-outcome>
<to-view-id>/TemplateClientNO.xhtml</to-view-id>
</navigation-case>
</navigation-rule>





Now testing runs smoothly . Violation of primary key doesn't cause apps crash








Attempt to register twice is caught:-



Thursday, November 02, 2006

Catching Rollback Exceptions in TopLink Essentials



This post follows up:

Toplink JPA outside EJB3 Container in TomCat 5.5



We just do exactly what advised in OTN Toplink Essentials JPA Reference.
******************************************************************
Modify WEB-INF/classes/DataBean.java and replace methods:
******************************************************************



public void empSelected(ActionEvent actionEvent) {

this.departId =
((Integer)((UIParameter)actionEvent.getComponent().getFacet("extraParameter")).getValue()).intValue();
setEmpModificationResult(" ");
}

// Handling rollback when delete.

public void empRemove(ActionEvent actionEvent){
Integer empId = ((Integer)((UIParameter)actionEvent.getComponent().getFacet("extraParameter")).getValue()).intValue();
try {
requestEmpRemove(empId);
this.empModificationResult = "Success";
}catch (OptimisticLockException ex){
this.empModificationResult = "Failed to " + this.empEntryOperation.toLowerCase() + "Employee status has changed since last viewed";
}catch (Exception ex){
this.empModificationResult = "Failed to " + this.empEntryOperation.toLowerCase() + "An unexpected Error ocurred: " +ex.toString();
}
}

//Handling rollback wnen insert or update.

public void completeEmpUpdate(ActionEvent actionEvent) {

try {
SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy");
java.util.Date parsedDate = formatter.parse(hrString);
this.currentEmp.setHiredate(new java.sql.Date(parsedDate.getTime()));
}
catch (Exception err) { }

try{

if (this.empEntryOperation == this.UPDATE_OPERATION){

updateEmployee(this.currentEmp.getEmpno(),this.currentEmp.getEname(),this.currentEmp.getMgr(),this.currentEmp.getSal(), this.currentEmp.getHiredate());

} else {

createNewEmp(this.currentEmp);

}

this.empModificationResult = SUCCESS;

}catch (RollbackException ex){
if (ex.getCause() instanceof OptimisticLockException){
this.empModificationResult = "Failed to " + this.empEntryOperation.toLowerCase() + "Employee status has changed since last viewed";
} else {
this.empModificationResult = "Failed to " + this.empEntryOperation.toLowerCase() + " An unexpected Error ocurred: " +ex.toString();
}
} catch (Exception ex) {
this.empModificationResult = "Failed to " + this.empEntryOperation.toLowerCase() + " An unexpected Error ocurred: " +ex.toString();
}
}



public void setEmpModificationResult(String empModificationResult) {
this.empModificationResult = empModificationResult;
}

public String getEmpModificationResult() {
return empModificationResult;
}




***************************************
Add to the bottom of employee.jsp:-
***************************************



<f:verbatim>
<hr/>
</f:verbatim>
<h:outputText value="#{dataBean.empModificationResult}"/>




Now attempt to violate primary key "empno" when inserting record
into table scott.emp won't crash apps and will display message:-








In case of success we get message: