Thursday 28 July 2011

java.lang.ClassNotFoundException: org.jboss.el.ExpressionFactoryImpl

Problem
=======
java.lang.ClassNotFoundException: org.jboss.el.ExpressionFactoryImpl

Solution
========
[dependency>
[groupId>org.jboss.el[/groupId]
[artifactId]com.springsource.org.jboss.el[/artifactId]
[version]2.0.0.GA[/version]
[/dependency]

java.lang.ClassNotFoundException: org.ajax4jsf.Filter

Problem
=======
java.lang.ClassNotFoundException: org.ajax4jsf.Filter

Solution
========
[dependency]
[groupId]org.richfaces.framework[/groupId]
[artifactId]richfaces-api[/artifactId]
[version]3.3.1.GA[/version]
[/dependency]
[dependency]
[groupId]org.richfaces.framework[/groupId]
[artifactId]richfaces-impl[/artifactId]
[version]3.3.1.GA[/version]
[/dependency]
[dependency]
[groupId]org.richfaces.ui[/groupId]
[artifactId]richfaces-ui[/artifactId]
[version]3.3.1.GA[/version]
[/dependency]

Tuesday 26 July 2011

Firefox internal info

about:cache
about:config

http://kb.mozillazine.org/About:config

Monday 25 July 2011

java.io.InvalidObjectException: Could not find a SessionFactory named: null org.hibernate.impl.SessionFactoryImpl.readResolve(SessionFactoryImpl.java:642)

Problem
=======
org.springframework.webflow.execution.repository.snapshot.SnapshotUnmarshalException: IOException thrown deserializing the flow execution stored in this snapshot -- this should not happen!
org.springframework.webflow.execution.repository.snapshot.SerializedFlowExecutionSnapshot.unmarshal(SerializedFlowExecutionSnapshot.java:100)
org.springframework.webflow.execution.repository.snapshot.SerializedFlowExecutionSnapshotFactory.restoreExecution(SerializedFlowExecutionSnapshotFactory.java:80)

java.io.InvalidObjectException: Could not find a SessionFactory named: null
org.hibernate.impl.SessionFactoryImpl.readResolve(SessionFactoryImpl.java:642)


Solution
========
???

Alternative
===========
[webflow:listener ref="hibernateFlowExecutionListener"/]

[bean id="hibernateFlowExecutionListener"
class="org.springframework.webflow.persistence.HibernateFlowExecutionListener"]
[constructor-arg ref="sessionFactory"/]
[constructor-arg ref="transactionManager"/]
[/bean]


[beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd"]

[bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource"]
[property name="driverClassName"
value="org.apache.derby.jdbc.ClientDriver"/]
[property name="url"
value="jdbc:derby://localhost:1527/library"/]
[property name="username" value="app"/]
[property name="password" value="app"/]
[/bean]

[bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"]
[property name="dataSource" ref="dataSource"/]
[property name="annotatedClasses"]
[list]
[value]com.apress.springrecipes.library.domain.BorrowingRecord[/value]
[/list]
[/property]
[property name="hibernateProperties"]
[props]
[prop key="hibernate.session_factory_name"]mySessionFactory[/prop]
[prop key="hibernate.dialect"]org.hibernate.dialect.DerbyDialect[/prop]
[prop key="hibernate.show_sql"]true[/prop]
[prop key="hibernate.hbm2ddl.auto"]update[/prop]
[/props]
[/property]
[/bean]

[bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager"]
[property name="sessionFactory" ref="sessionFactory"/]
[/bean]

org.hibernate.MappingException: Unknown entity:

Problem
=======
org.hibernate.MappingException: Unknown entity: com.apress.springrecipes.library.domain.BorrowingRecord
org.hibernate.impl.SessionFactoryImpl.getEntityPersister(SessionFactoryImpl.java:580)

Solution
========
[property name="annotatedClasses"]
[list]
[value]com.apress.springrecipes.library.domain.BorrowingRecord[/value]
[/list]
[/property]

java.lang.IllegalStateException: unread block data java.io.ObjectInputStream$BlockDataInputStream.setBlockDataMode(ObjectInputStream.java:2376)

SWF with persistence

Problem
=======
java.lang.IllegalStateException: unread block data
java.io.ObjectInputStream$BlockDataInputStream.setBlockDataMode(ObjectInputStream.java:2376)
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1360)


Solution
========
Under
[bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"]
Add

[property name="hibernateProperties"]
[props]
[prop key="hibernate.session_factory_name"]mySessionFactory[/prop]

base variable 'persistenceContext' spelled correctly

org.springframework.binding.expression.EvaluationException: The expression 'persistenceContext.persist(borrowingRecord)' did not resolve... is the base variable 'persistenceContext' spelled correctly?
org.springframework.binding.expression.el.ELExpression.getValue(ELExpression.java:60)

Solution
========
add the tag
[persistence-context /]

Friday 22 July 2011

Error creating bean with name 'securityFlowExecutionListener'

Problem
SEVERE: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flowExecutor': Cannot create inner bean '(inner bean)' of type [org.springframework.webflow.config.FlowExecutionListenerLoaderFactoryBean] while setting bean property 'flowExecutionListenerLoader'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Cannot resolve reference to bean 'securityFlowExecutionListener' while setting bean property 'listeners'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'securityFlowExecutionListener' defined in ServletContext resource [/WEB-INF/library-webflow.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/security/vote/AffirmativeBased

Need the patch : http://jira.springframework.org/browse/SWF-1182

Thursday 21 July 2011

Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/security]

Problem
=====
SEVERE: Context initialization failed
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/security]
Offending resource: ServletContext resource [/WEB-INF/library-security.xml]



Solution
=====
[dependency]
[groupId]org.springframework.security[/groupId]
[artifactId]spring-security-config[/artifactId]
[version]3.0.2.RELEASE[/version]
[/dependency]
[dependency]
[groupId]org.springframework.security[/groupId]
[artifactId]spring-security-web[/artifactId]
[version]3.0.2.RELEASE[/version]

Wednesday 20 July 2011

Effective SME tools

Part 1 Easy Filing Systems

Part 2: Accounting & Finance Help

Part 3 Effective Time Management Tips

Mindy Lilyquist

Reuse IQOExtract

Reset 3 fields
1.Status -> EXTAP
2.StartDate -> NULL
3.LastUpdateUser -> LCCuser

To check
1. Drive R map to Build
2. Drive S map to Source
3. Grant the Security
4. Grant the Pemission

Tuesday 19 July 2011

Web MVC & Flow maven

[packaging]war[/packaging]
[name]jackflow[/name]
[url]http://maven.apache.org[/url]
[properties]
[project.build.sourceEncoding]UTF-8[/project.build.sourceEncoding]
[spring.version]3.0.2.RELEASE[/spring.version]
[/properties]
[dependencies]
[dependency]
[groupId]org.springframework[/groupId]
[artifactId]spring-webmvc[/artifactId]
[version]${spring.version}[/version]
[/dependency]
[dependency]
[groupId]junit[/groupId]
[artifactId]junit[/artifactId]
[version]3.8.1[/version]
[scope]test[/scope]
[/dependency]
[dependency]
[groupId]org.springframework[/groupId]
[artifactId]spring-aop[/artifactId]
[version]${spring.version}[/version]
[/dependency]
[dependency]
[groupId]org.springframework[/groupId]
[artifactId]spring-web[/artifactId]
[version]${spring.version}[/version]
[/dependency]
[dependency]
[groupId]org.springframework[/groupId]
[artifactId]spring-context-support[/artifactId]
[version]${spring.version}[/version]
[/dependency]
[dependency]
[groupId]org.springframework[/groupId]
[artifactId]spring-beans[/artifactId]
[version]${spring.version}[/version]
[/dependency]
[dependency]
[groupId]org.springframework[/groupId]
[artifactId]spring-context[/artifactId]
[version]${spring.version}[/version]
[/dependency]
[dependency]
[groupId]org.springframework[/groupId]
[artifactId]spring-core[/artifactId]
[version]${spring.version}[/version]
[/dependency]
[!-- MVC --]

[dependency]
[groupId]org.springframework[/groupId]
[artifactId]spring-web[/artifactId]
[version]${spring.version}[/version]
[/dependency]
[!-- Web Flow --]
[dependency]
[groupId]org.springframework.webflow[/groupId]
[artifactId]spring-faces[/artifactId]
[version]2.0.8.RELEASE[/version]
[/dependency]
[!-- Unified EL --]
[dependency]
[groupId]org.jboss.el[/groupId]
[artifactId]com.springsource.org.jboss.el[/artifactId]
[version]2.0.0.GA[/version]
[/dependency]
[!-- [dependency] [groupId]org.jboss.seam[/groupId] [artifactId]jboss-el[/artifactId]
[version]2.0.0.GA[/version] [exclusions] [exclusion] [groupId]javax.el[/groupId]
[artifactId]el-api[/artifactId] [/exclusion] [/exclusions] [/dependency] --]
[!-- Using OGNL for EL --]
[!-- [dependency]
[groupId]ognl[/groupId]
[artifactId]ognl[/artifactId]
[version]2.6.9[/version]
[/dependency] --]
[!-- Security --]
[dependency]
[groupId]org.springframework.security[/groupId]
[artifactId]spring-security-core[/artifactId]
[version]3.0.2.RELEASE[/version]
[/dependency]
[/dependencies]
[repositories]
[repository]
[url]http://repository.jboss.org/maven2/[/url]
[id]jboss[/id]
[name]JBoss Repository[/name]
[/repository]
[/repositories]

ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet

SEVERE: Error loading WebappClassLoader
context: /jackflow
delegate: false
repositories:
/WEB-INF/classes/
----------> Parent Classloader:
org.apache.catalina.loader.StandardClassLoader@1e63e3d
org.springframework.web.servlet.DispatcherServlet
java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1645)

Solution
========
(1)After put the spring-webmvc to the folder lib, then resolved.
*For MAVEN, remember to check package as “war”.

Thursday 14 July 2011

The requested resource (/city-struts/distance.do) is not available

Problem
=======
The requested resource (/city-struts/distance.do) is not available.

Solution
========
Project Facets
1.Dynamic Web
2.Java
3.Java Script

Deployment Assembly
1.Remove WebContent

Caused by: java.lang.ClassNotFoundException: org.springframework.web.context.ContextCleanupListener

Problem
=======
Caused by: java.lang.ClassNotFoundException: org.springframework.web.context.ContextCleanupListener

Solution
========
[dependency]
[groupid]org.springframework[/groupId]
[artifactid]spring-web[/artifactId]
[/dependency]
[dependency]
[groupid]org.springframework[/groupId]
[artifactid]spring-context-support[/artifactId]
[/dependency]
[dependency]
[groupid]org.springframework[/groupId]
[artifactid]spring-beans[/artifactId]
[/dependency]
[dependency]
[groupid]org.springframework[/groupId]
[artifactid]spring-context[/artifactId]
[/dependency]

Thursday 7 July 2011

Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/security]

Problem
=======
Context initialization failed org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/security]

Solution
========
[dependency>
[groupId>org.springframework.security[/groupId]
[artifactId]spring-security-core[/artifactId]
[/dependency]
[dependency]
[groupId]org.springframework.security[/groupId]
[artifactId]spring-security-acl[/artifactId]
[/dependency]
[dependency]
[groupId]org.springframework.security[/groupId]
[artifactId]spring-security-config[/artifactId]
[/dependency]
[dependency]
[groupId]org.springframework.security[/groupId]
[artifactId]spring-security-web[/artifactId]
[/dependency]
[dependency]
[groupId]org.springframework.security[/groupId]
[artifactId]spring-security-acl[/artifactId]
[/dependency]

Wednesday 6 July 2011

Spring AspectJ load-time weaving

Spring includes an AspectJ aspect, AnnotationBeanConfigurerAspect,
(even if these objects are created outside the IoC container).

1.Enable [context:spring-configured]
2.Enable weave domain classes at load time [context:load-timeweaver>]
3.Enable @Autowired auto-wire JDBC template into domain objects [context:annotation-config]

Declaratively Managing Transactions by @Transactional Annotation

1.Enabling [tx:annotation-driven]
2.Simply annotating the methods with @Transactional

*not recommended practice - annotation an interface
*only annotate Public methods due to the proxy-based limitations

Tuesday 5 July 2011

Use JPA-persist objects & JPA annotations & Hibernate as Engine (II)

1.Annotate each DAO method or the entire DAO class with @Transactional to make all
methods transactional.
(ensures operations within a DAO method in same transaction by same entity manager)

2.Enable declarative transaction management - [tx:annotationdriven]

3.[context:annotation-config /] - to allow inject entity managers into properties annotated with @PersistenceContext & allow inject entity manager factory into a property with the @PersistenceUnit annotation.

4.Enable [context:component-scan] - to allow @Repository annotation.

5.Register [bean class="org.springframework.dao.annotation.PersistenceException
TranslationPostProcessor" /] - to translate the native JPA exceptions into DataAccessException

6.Remember : transaction manager is needed no matter which transaction
management strategy (programmatic or declarative).
[bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager"]
[property name="sessionFactory" ref="sessionFactory"/]

Use JPA-persist objects & JPA annotations & Hibernate as Engine (I)

JPA annotations
===============
import javax.persistence.Entity;
@Entity
@Table(name = "COURSE")
public class Course {

JPA-persist
===========
import javax.persistence.PersistenceContext;
import javax.persistence.EntityManager;
import org.springframework.transaction.annotation.Transactional;

public class JpaCourseDao implements CourseDao {

@PersistenceContext
private EntityManager entityManager;
@Transactional
public void store(Course course) {
entityManager.merge(course);

Hibernate as Engine
===================
[bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"]
[property name="persistenceUnitName" value="course"/]
[property name="dataSource" ref="dataSource"/]
[property name="jpaVendorAdapter"]
[bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"]
[property name="databasePlatform" value="org.hibernate.dialect.DerbyDialect"/]

Monday 4 July 2011

7 Characters

1.Truthfulness
Boss asked you to tell lie? How did you handle it?

2.Work Ethic
Define for what you believe doing a good job is?
In last position, what you did a great job with?

3.Teachability
Please name some books/CDs/DVDs in personal development library.
What is the last serious book read? What did like best about it? What have you applied as a result of reading it?

4.Keeping Commitments
Under what circumstances is it acceptable to not keep a commitment?
What is the last commitment you failed? Why?

5.Forgiving Spirit
What is the hardest thing to forgive in the workplace? How did you handle it?

6.Meeting Deadlines
When was the last time you late to anything? Why?
“Being late is the arrogant choice.” Do you agree?
Do you believe late is a sign of arrogance?
Have you missed a work-related deadline?

7.Responsibility
List three factors that have prevented you from being even further along than you are now, what are they?
Note: Responsibility by blaming their own internal, or shift blame to outside conditions?)
Describe some of the bigger mistakes made in past jobs and what you learned from them.

From "How to Lead by THE BOOK: Proverbs, Parables, and Principles to Tackle Your Toughest Business Challenges"