Tuesday, 25 August 2009

MS Excel vlookup Demo



=VLOOKUP(A2, 's1'!$A$2:$B$25, 2,)


Assume this is vlookup in sheet s2. A2 is the exact value searched for in the first column of the reference array.'s1'!$A$2:$B$25 is the reference array, which must include at least two columns (because have to include A2). $ in the array range is absolute, ensures that all vlookup look up from the EXACT same reference array. 2 is is the column index in the array that contains the value to be returned. In other word, vlookup finds the match A2 in the array in sheet s1 and return the value in column 2.

Monday, 27 July 2009

Seam 2 + MySQL 5 + jBPM 3

Seam (jboss-seam-2.1.2) could not start jBPM (jbpm-3.2.6.SP1) causes application deployment fails



02:08:48,718 ERROR [jbpm]] Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener
org.jboss.seam.InstantiationException: Could not instantiate Seam component: org.jboss.seam.bpm.jbpm


Caused by: org.hibernate.PropertyAccessException: could not get a field value by reflection getter of org.jbpm.job.Job.id

jboss-seam-2.1.2 comes with an older version of jbpm-jpdl.jar. Copy the newer one from jbpm-3.2.6.SP1 to replace the one in seam.



Seam (jboss-seam-2.1.2) example Hotel Booking, it causes exceptions during undeployment during JBoss shutdown



17:35:36,421 WARN [Component] Exception calling stateful session bean default @Remove method: hotelBooking
org.jboss.ejb3.common.registrar.spi.NotBoundException: Requested value bound at name "jboss.j2ee:ear=seam.example.hotel-ear.ear,jar=seam.example.hotel-ejb.jar,name=HotelBookingAction,service=EJB3" is not bound.


17:35:36,437 WARN [Component] Exception calling stateful session bean default @Remove method: bookingList
org.jboss.ejb3.common.registrar.spi.NotBoundException: Requested value bound at name "jboss.j2ee:ear=seam.example.hotel-ear.ear,jar=seam.example.hotel-ejb.jar,name=BookingListAction,service=EJB3" is not bound.


17:35:36,437 WARN [Component] Exception calling stateful session bean default @Remove method: hotelSearch
org.jboss.ejb3.common.registrar.spi.NotBoundException: Requested value bound at name "jboss.j2ee:ear=seam.example.hotel-ear.ear,jar=seam.example.hotel-ejb.jar,name=HotelSearchingAction,service=EJB3" is not bound.

Only the Stateful session beans like hotelSearch cause the exception. Inside the example there are jboss.xml which contains session bean registrations. Places this file to seam.example.hotel-ear\EarContent\META-INF.



Seam (jboss-seam-2.1.2) jBPM file for page flow could not be parsed



Caused by: org.jbpm.jpdl.JpdlException: [[ERROR] Unable to parse process definition pageflow.jpdl.xml]
at org.jboss.seam.bpm.Jbpm.getPageflowDefinitionFromResource(Jbpm.java:169)
at org.jboss.seam.bpm.Jbpm.installPageflowDefinitions(Jbpm.java:278)

Check if the process definition contains any sub process. If it does, in components.xml, all sub processes MUST be defined before the main process. For example: if cheat.jpdl.xml is a sub process of pageflow.jpd.xml, the follow one will cause the trouble




pageflow.jpdl.xml
cheat.jpdl.xml


And this one is correct.




cheat.jpdl.xml
pageflow.jpdl.xml

Saturday, 25 July 2009

Eclipse + Seam + TestNG Tricky

TestNG gives "Connection Refused" while running on Eclipse


org.testng.TestNGException:
Cannot establish connection: 127.0.0.1:4359
at org.testng.remote.strprotocol.StringMessageSenderHelper.connect(StringMessageSenderHelper.java:93)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:57)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at org.testng.remote.strprotocol.StringMessageSenderHelper.connect(StringMessageSenderHelper.java:56)
... 2 more

While running TestNG in Eclipse there
will always be 2 VMs involved: the VM of Eclipse and the VM running
the tests. In order to update the plugin UI the 2 VMs are
communicating over a port using a very simple string based protocol.
The exception you are seeing is telling that the 2 VMs are not able to
talk to each other. This is a weird exception that would translate
into: there was impossible to open a communication port between the 2
VMs involved. Off hand, the cause may be: a bug in Eclipse/plugin or
maybe a firewall/antivirus that blocks this.



TestNG/Seam reports ClassNotFoundException issues


[Parser] Running:
D:\showman\My Documents\workspace_3.5\seam.examples.helloworld-test\temp-testng-customsuite.xml


ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Described: name=BeanDeployer state=PreInstall


ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Described: name=ServiceDeployer state=PreInstall
java.lang.RuntimeException: java.lang.reflect.UndeclaredThrowableException


Caused by: java.lang.ClassNotFoundException: [Ljava.lang.Class;
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)


ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Start: name=UserTransaction state=Create
java.lang.RuntimeException: Unable to locate the transaction manager


FAILED CONFIGURATION: @BeforeSuite startSeam
org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):

*** CONTEXTS MISSING DEPENDENCIES: Name -> Dependency{Required State:Actual State}

UserTransactionBinding
-> UserTransaction{Configured:**ERROR**}

UserTransactionBinding2
-> UserTransaction{Configured:**ERROR**}


*** CONTEXTS IN ERROR: Name -> Error

SARDeployer -> java.lang.ClassNotFoundException: [Ljava.lang.Class;

ServiceDeploymentDeployer -> java.lang.ClassNotFoundException: [Ljava.lang.Class;

ServiceClassLoaderDeployer -> java.lang.ClassNotFoundException: [Ljava.lang.Class;

BeanDeployer -> java.lang.ClassNotFoundException: [Ljava.lang.Class;

ServiceDeployer -> java.lang.ClassNotFoundException: [Ljava.lang.Class;

BeanMetaDataDeployer -> java.lang.ClassNotFoundException: [Ljava.lang.Class;

UserTransaction -> java.lang.RuntimeException: Unable to locate the transaction manager

KernelDeploymentDeployer -> java.lang.ClassNotFoundException: [Ljava.lang.Class;

This is mostly caused by Class Path configuration, also, Java 6 may be the cause, use Java 5!!



Could not find several required files


ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Parse: name=vfsfile:/D:/showman/My%20Documents/workspace_3.5/seam.examples.helloworld-test/bootstrap/deploy/jboss-local-jdbc.rar state=Not Installed mode=Manual requiredState=Parse
org.jboss.deployers.spi.DeploymentException: Error parsing meta data jboss-local-jdbc.rar/META-INF/ra.xml

Caused by: java.io.FileNotFoundException: File does not exist: D:\showman\My%20Documents

It seems that it does not like space in the path T_T, try to set the workspace to somewhere with NO space!! FUCK!



When running test case in Eclipse, TestNG complains bad version in .class file even Java 5 is used


java.lang.UnsupportedClassVersionError: Bad version number in .class file

Make sure everything is Java 5 compliant, such as:



  • Project build path

  • JAVA_HOME, JRE_HOME

  • Java's in PATH (check by java -version)

  • The Application Server (i.e. must be JDK5 compiled JBoss AS 5)

Monday, 13 July 2009

JBoss jBPM Info Center

jBPM 4.0

jBPM User Guide (jBPM 4.0)



jBPM Developers Guide (jBPM 4.0)



jBPM Wiki



Getting Started with jBPM 4.0 - (Part I)



Getting Started with jBPM 4.0 - (Part II)



Getting Started with jBPM 4.0 - (Part III)



Getting Started with jBPM 4.0 - (Part IV)



jBPM 3.X

jBPM3 Getting Started



jBPM deployment in production environments



FAQ

When running jBPM (3.2.6.SP1) within Seam (2.1.2), the process does not run in persistent state. For example: all process instances are lost after JBoss AS restarts


In jBPM side, hibernate.cfg.xml takes the main responsibility for jBPM's persistent properties. Make sure all settings are configured properly especially:

<property name="hibernate.connection.datasource">java:JbpmDS</property>


When trying jBPM's websale example, exception occurs when clicking evaluation button


Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: -3f57fffd:daa:4a702b15:1fe status: ActionStatus.ABORT_ONLY >

Could not enlist in transaction on entering meta-aware object!;

Unable to persist timer


XA data sources and jBPM



When trying jBPM's websale example (jbpm-3.2.6.SP1), AFTER clicking evaluation button and complete the task successfully, manager's task with timer causes exceptions


java.lang.UnsupportedClassVersionError: Bad version number in .class file
java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClass(ClassLoader.java:620)

jBPM distribution maybe compiled by Java 6, use JDK6 compiled JBoss AS 5 and set JAVA_HOME and JRE_HOME to JDK6.

Friday, 26 June 2009

K10 AM2(+) Overclock Info Center

LP UT 790FX-M2R + 955BE Possible?....Sure it is ;-)


OC on DFI LP DK 790FXB-M2RSH Hand Holding Tutorial



DFI LANparty UT 790FX-M2R (ATI/AMD 790FX) with OCZ 8000 ReaperX


8000 Platinum, 8000 Reaper X, and 8500 Reaper tRFC 54 SPD flashing instructions


HEX codes, for changing NB voltage question.


Regarding FSB, although theoretically speaking it should be able to operate 1066 without overclocking the FSB, many times it makes it much more stable with a higher FSB speed. This is especially apparent with AMD platforms.

Windows XP Installtion Note on K10 (Domain User)

Here I just record several steps need to go through after installation is done. AMD K10 system ONLY!!


Several things have to be changed since now I am using domain account, SoftCloud Software Platform, Windows XP SP3 etc. System configuration should be done by using administrator account.



Hardware Driver Setup



  • Install Windows XP SP3

  • Disable System Restore

  • Format D: and E: Drives (Or Document and ProgramFiles Drives)

  • Set Virtual Memory in D: Drive

  • Install CPU Drivers (AMD K8 Driver, XP Fix and DualCore Optimizer

  • Install 790FX Chipset Driver

  • Install .Net Framework package (ATI Gfx Card ONLY!)

  • Install Gfx Card Driver

  • Install Audio Driver

  • Install LAN Driver

  • Install Mouse & Keyboard Driver


Set Up User Profile



  • Setup correct IP, Gateway and DNS address that points to DC

  • Join to domain NERV.HQ

  • Logon as domain account after system reboot so new profile is setup

  • Reboot, Logon as local administrator

  • Copy domain user folder from C:\Documents and Settings to D: Drive

  • Open regedit -> HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList. Change ProfileImagePath to new location from above step

  • Copy back up My Documents to that new location

  • Add domain user into local administrator group


Partition Size List



  • 10400 --> 10GB

  • 5154 --> 5GB

  • 41002 --> 40GB

  • 20600 --> 20GB

  • 30800 --> 30GB

  • 51300 --> 50GB

Install MS SyncToy 2.0

MS SyncToy 2.0 requires MS .Net Framework 2.0 SP1. Install .Net Framework may requires Windows Installer. So the safest way to do it is: