[JBoss jBPM] - JBPM Configuration with Hibernate 3.0 & OC4J Appl-Serverver
by sharifzadeh
Dear users,
Usually, I use JDedveloper IDE, Oracle Database (9 or higher) and OC4J ApplicationServer for running J2EE Applications, Recently I have downloded JBPM-Workflow (jbpm-3.1.2.zip), and I tried to run a workflow sample, At first I made a simple Table in Oracle DB (TEST) and I created
a hbm.xml file as below symmetry with same Table:
==================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="org.jbpm.graph.action.Test" table="TEST" dynamic-update="true" dynamic-insert="true">
</hibernate-mapping>
==================================
Also I defined my hibernate.cfg.xml configuration as below:
==================================
<hibernate-configuration>
<session-factory>
<!-- jdbc connection properties -->
org.hibernate.dialect.Oracle9Dialect
oracle.jdbc.driver.OracleDriver
jdbc:oracle:thin:@200.20.20.7:1521:ora10g
user
pass
</session-factory>
</hibernate-configuration>
==================================
when I try to initialize my application with these, I get this error when "SessionFactory" is making:
SessionFactoryImpl:153 - building session factory
net.sf.ehcache.CacheException: Cannot configure
CacheManager: Resource /'ehcache-failsafe.xml' not found
It seem it's not because of missing this file and I think this is another problem.
however I can not solve this problem.
please guide me.
Regards
-- Amir Sharif
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3978740#3978740
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3978740
19 years, 8 months
[JBossCache] - NPE when using optimistic locking with JbossCache 1.4.0.SP1,
by pkorros
I am trying to setup JbossCache 1.4.0.sp1 to work with hibernate 3.2.GA using optimistic locking. When I use pessimistic locking I don;t have any errors but when I use OPTIMISTIC then I get many NullPointerExceptions when using optimistic locking with JbossCache 1.4.0.SP1, hibernate 3.2.GA.
The errors look like:
[org.jboss.cache.interceptors.TxInterceptor] There was a problem handling this request
java.lang.NullPointerException
at org.jboss.cache.interceptors.OptimisticNodeInterceptor.invoke(OptimisticNodeInterceptor.java:68) at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:68)
at org.jboss.cache.interceptors.OptimisticCreateIfNotExistsInterceptor.invoke(OptimisticCreateIfNotExistsInterceptor.java:69)
at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:68)
at org.jboss.cache.interceptors.OptimisticValidatorInterceptor.invoke(OptimisticValidatorInterceptor.java:75)
at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:68)
at org.jboss.cache.interceptors.OptimisticLockingInterceptor.invoke(OptimisticLockingInterceptor.java:122)
at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:68)
at org.jboss.cache.interceptors.TxInterceptor.handleNonTxMethod(TxInterceptor.java:345)
at org.jboss.cache.interceptors.TxInterceptor.invoke(TxInterceptor.java:156)
at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:68)
at org.jboss.cache.interceptors.CacheMgmtInterceptor.invoke(CacheMgmtInterceptor.java:183)
at org.jboss.cache.TreeCache.invokeMethod(TreeCache.java:5520)
at org.jboss.cache.TreeCache.remove(TreeCache.java:3742)
at org.jboss.cache.TreeCache.remove(TreeCache.java:3297)
at org.hibernate.cache.OptimisticTreeCache.writeLoad(OptimisticTreeCache.java:76)
at org.hibernate.cache.TransactionalCache.put(TransactionalCache.java:55)
at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:156)
at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:842)
at org.hibernate.loader.Loader.doQuery(Loader.java:717)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.doList(Loader.java:2144)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2028)
at org.hibernate.loader.Loader.list(Loader.java:2023)
at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:95)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1569)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283)
My config file is like:
treecache.xml
...
org.jboss.cache.GenericTransactionManagerLookup
OPTIMISTIC
LOCAL
...
hibernate.cfg.xml
...
org.hibernate.cache.OptimisticTreeCacheProvider
...
any ideas on what is causing the error?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3978739#3978739
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3978739
19 years, 8 months
[EJB 3.0] - Re: How to lazily load collections?
by Wolfgang Knauf
Hi Michael,
here is a sample snippet where accessing the relationship fails with your exception:
public MyEntity getEntity(object pk) {
| MyEntity entity = (MyEntity) entityManager.find(MyEntity.class, pk);
| //Will NOT load the data !
| entity.getTdmAlerts();
| return entity;
| }
I found that just accessing the collection property of the entity does NOT fetch its content.
You have to do something which forces the collection to load its items. In the following piece of code I access the collections size:
public MyEntity getEntity(object pk) {
| MyEntity entity = (MyEntity) entityManager.find(MyEntity.class, pk);
| int iSize = entity.getTdmAlerts().size();
| return entity;
| }
I suggest to add a parameter "boolean bFetchAlerts" to "getEntity" which controls whether the alerts are loaded or not.
I hope this helps
Wolfgang
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3978736#3978736
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3978736
19 years, 8 months