Hi Taher,

https://issues.apache.org/jira/browse/OFBIZ-6687 created.

Best regards,

Derek

-----Original Message-----
From: Taher Alkhateeb [mailto:[email protected]] 
Sent: Tuesday, 20 October 2015 1:05 PM
To: [email protected]
Subject: Re: org.ofbiz.entity.GenericModelException: Could not find definition 
for entity name FixedAssetMaintWorkEffort

Hi Derek, 

Again it is best to open a JIRA for these bugs because it might affect other 
versions and we need to backport the fix. Furthermore, please always show the 
_repeat_ steps and if relevant the environment information as I don't even know 
where to start or what triggered the error in your log or for which version of 
OFBiz etc.. 

Taher Alkhateeb 

----- Original Message -----

From: "Derek Lew" <[email protected]>
To: [email protected]
Sent: Tuesday, 20 October, 2015 5:40:03 AM
Subject: RE: org.ofbiz.entity.GenericModelException: Could not find definition 
for entity name FixedAssetMaintWorkEffort 

Think to fix this, just need to change the FixedAssetMaintWorkEffort to 
FixedAssetMaint. 

-----Original Message-----
From: Derek Lew [mailto:[email protected]]
Sent: Tuesday, 20 October 2015 9:56 AM
To: [email protected]
Subject: org.ofbiz.entity.GenericModelException: Could not find definition for 
entity name FixedAssetMaintWorkEffort 

Hi 



There is an exception that FixedAssetMaintWorkEffort cannot be found. 





2015-10-20 09:13:22,404 |OFBiz-JobQueue-0 |GenericDelegator 
|E| Error getting entity definition from model

org.ofbiz.entity.GenericModelException: Could not find definition for entity 
name FixedAssetMaintWorkEffort 

at
org.ofbiz.entity.model.ModelReader.getModelEntity(ModelReader.java:489)
~[ofbiz-entity-test.jar:?] 

at
org.ofbiz.entity.GenericDelegator.getModelEntity(GenericDelegator.java:396)
[ofbiz-entity-test.jar:?] 

at
org.ofbiz.entity.finder.ListFinder.runFind(ListFinder.java:124)
[ofbiz-entity-test.jar:?] 

at
org.ofbiz.minilang.method.entityops.EntityCondition.exec(EntityCondition.jav
a:59) [ofbiz-minilang.jar:?] 

at
org.ofbiz.minilang.method.envops.Iterate.exec(Iterate.java:117)
[ofbiz-minilang.jar:?] 

at
org.ofbiz.minilang.method.envops.Iterate.exec(Iterate.java:117)
[ofbiz-minilang.jar:?] 

at
org.ofbiz.minilang.SimpleMethod.runSubOps(SimpleMethod.java:307)
[ofbiz-minilang.jar:?] 

at
org.ofbiz.minilang.SimpleMethod.exec(SimpleMethod.java:454)
[ofbiz-minilang.jar:?] 

at
org.ofbiz.minilang.SimpleMethod.runSimpleMethod(SimpleMethod.java:271)
[ofbiz-minilang.jar:?] 

at
org.ofbiz.minilang.SimpleMethod.runSimpleService(SimpleMethod.java:290)
[ofbiz-minilang.jar:?] 

at
org.ofbiz.minilang.SimpleServiceEngine.serviceInvoker(SimpleServiceEngine.ja
va:79) [ofbiz-minilang.jar:?] 

at
org.ofbiz.minilang.SimpleServiceEngine.runSync(SimpleServiceEngine.java:48)
[ofbiz-minilang.jar:?] 

at
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:400)
[ofbiz-service.jar:?] 

at
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:232)
[ofbiz-service.jar:?] 

at
org.ofbiz.service.GenericDispatcherFactory$GenericDispatcher.runSync(Generic
DispatcherFactory.java:83) [ofbiz-service.jar:?] 

at
org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:69)
[ofbiz-service.jar:?] 

at
org.ofbiz.service.job.AbstractJob.run(AbstractJob.java:87)
[ofbiz-service.jar:?] 

at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:11
42) [?:1.8.0_40] 

at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:6
17) [?:1.8.0_40] 

at java.lang.Thread.run(Thread.java:745) [?:1.8.0_40] 

2015-10-20 09:13:22,428 |OFBiz-JobQueue-0 |TransactionUtil 
|E| [TransactionUtil.rollback]

java.lang.Exception: Stack Trace 

at
org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:3
40) [ofbiz-entity-test.jar:?] 

at
org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:3
17) [ofbiz-entity-test.jar:?] 

at
org.ofbiz.minilang.SimpleMethod.exec(SimpleMethod.java:578)
[ofbiz-minilang.jar:?] 

at
org.ofbiz.minilang.SimpleMethod.runSimpleMethod(SimpleMethod.java:271)
[ofbiz-minilang.jar:?] 

at
org.ofbiz.minilang.SimpleMethod.runSimpleService(SimpleMethod.java:290)
[ofbiz-minilang.jar:?] 

at
org.ofbiz.minilang.SimpleServiceEngine.serviceInvoker(SimpleServiceEngine.ja
va:79) [ofbiz-minilang.jar:?] 

at
org.ofbiz.minilang.SimpleServiceEngine.runSync(SimpleServiceEngine.java:48)
[ofbiz-minilang.jar:?] 

at
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:400)
[ofbiz-service.jar:?] 

at
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:232)
[ofbiz-service.jar:?] 

at
org.ofbiz.service.GenericDispatcherFactory$GenericDispatcher.runSync(Generic
DispatcherFactory.java:83) [ofbiz-service.jar:?] 

at
org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:69)
[ofbiz-service.jar:?] 

at
org.ofbiz.service.job.AbstractJob.run(AbstractJob.java:87)
[ofbiz-service.jar:?] 

at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:11
42) [?:1.8.0_40] 

at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:6
17) [?:1.8.0_40] 

at java.lang.Thread.run(Thread.java:745) [?:1.8.0_40] 

2015-10-20 09:13:22,430 |OFBiz-JobQueue-0 |ServiceDispatcher 
|E| Error in Service [createMaintsFromTimeInterval]: Error running the
simple-method: In find entity by condition could not find definition for entity 
with name [FixedAssetMaintWorkEffort].null 

2015-10-20 09:13:22,431 |OFBiz-JobQueue-0 |GenericServiceJob 
|E| Async-Service failed. 

java.lang.Exception: Error running the simple-method: In find entity by 
condition could not find definition for entity with name 
[FixedAssetMaintWorkEffort].null 

at
org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:72)
[ofbiz-service.jar:?] 

at
org.ofbiz.service.job.AbstractJob.run(AbstractJob.java:87)
[ofbiz-service.jar:?] 

at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:11
42) [?:1.8.0_40] 

at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:6
17) [?:1.8.0_40] 

at java.lang.Thread.run(Thread.java:745) [?:1.8.0_40] 





Here is the codes from
applications\accounting\script\org\ofbiz\accounting\fixedasset\FixedAssetSer
vices.xml 



<simple-method method-name="createMaintsFromTimeInterval" 
short-description="Create Fixed Asset Maintenances From A Product Maint Time 
Interval"> 

<now-timestamp field="nowTimestamp"/> 

<entity-condition list="fixedAssets" entity-name="FixedAsset"> 

<condition-list combine="and"> 

<condition-expr field-name="instanceOfProductId" 
operator="not-equals" from-field="null"/> 

<condition-expr field-name="actualEndOfLife" 
operator="equals" from-field="null"/> 

</condition-list> 

</entity-condition> 

<iterate list="fixedAssets" entry="fixedAsset"> 

<entity-condition list="productMaints" 
entity-name="ProductMaint"> 

<condition-list combine="and"> 

<condition-expr field-name="productId" 
from-field="fixedAsset.instanceOfProductId"/> 

<condition-expr field-name="intervalUomId" 
operator="like" value="TF_%"/> 

</condition-list> 

</entity-condition> 

<iterate list="productMaints" entry="productMaint"> 

<set field="repeatCount" 
from-field="productMaint.repeatCount" default-value="0" type="Long"/> 

<entity-condition list="maintList" 
entity-name="FixedAssetMaintWorkEffort"> 

<condition-list combine="and"> 

<condition-expr field-name="fixedAssetId" 
operator="equals" from-field="fixedAsset.fixedAssetId"/> 

<condition-expr field-name="productMaintTypeId" 
operator="equals" from-field="productMaint.productMaintTypeId"/> 

<condition-expr field-name="intervalUomId" 
operator="equals" from-field="productMaint.intervalUomId"/> 

<condition-expr field-name="statusId" 
operator="not-equals" value="FAM_CANCELLED"/> 

</condition-list> 

<order-by field-name="maintHistSeqId"/> 

</entity-condition> 

<set field="intervalQuantity" 
from-field="productMaint.intervalQuantity" default-value="0" 
type="Integer"/> 

<if-compare field="productMaint.intervalUomId" 
operator="equals" value="TF_day"> 

<set-calendar field="compareDate" 
from-field="nowTimestamp" days="-${intervalQuantity}"/> 

<else> 

<if-compare field="productMaint.intervalUomId" 
operator="equals" value="TF_mon"> 

<set-calendar field="compareDate" 
from-field="nowTimestamp" months="-${intervalQuantity}"/> 

<else> 

<if-compare
field="productMaint.intervalUomId" operator="equals" value="TF_yr"> 

<set-calendar field="compareDate" 
from-field="nowTimestamp" years="-${intervalQuantity}"/> 

</if-compare> 

</else> 

</if-compare> 

</else> 

</if-compare> 

<if-not-empty field="compareDate"> 

<set field="listSize" value="0" type="Long"/> 

<if-not-empty field="maintList"> 

<set field="listSize" 
value="${util:size(maintList)}" type="Long"/> 

</if-not-empty> 

<set field="lastSvcLong" value="0" type="Long"/> 

<set field="lastSvcDate" from-field="lastSvcLong" 
type="Timestamp"/> 

<iterate list="maintList" entry="maintValue"> 

<set field="lastSvcDate" 
from-field="maintValue.actualCompletionDate" set-if-null="true"/> 

</iterate> 

<if-not-empty field="lastSvcDate"> 

<if-compare-field field="lastSvcDate" 
operator="less" to-field="compareDate" type="Timestamp"> 

<set field="maintDue" value="false"/> 

<if-compare field="repeatCount" 
operator="greater" value="0" type="Long"> 

<if-compare-field field="listSize" 
operator="less" to-field="repeatCount" type="Long"> 

<set field="maintDue" value="true"/> 

</if-compare-field> 

<else> 

<set field="maintDue" value="true"/> 

</else> 

</if-compare> 

<if-compare field="maintDue" operator="equals" 
value="true"> 

<set-service-fields
service-name="createFixedAssetMaint" to-map="createMaintCxt" 
map="productMaint"/> 

<set field="createMaintCxt.fixedAssetId" 
from-field="fixedAsset.fixedAssetId"/> 

<set field="createMaintCxt.statusId" 
value="FAM_CREATED"/> 

<call-service
service-name="createFixedAssetMaint" in-map-name="createMaintCxt"/> 

<check-errors/> 

</if-compare> 

</if-compare-field> 

</if-not-empty> 

</if-not-empty> 

</iterate> 

</iterate> 

</simple-method> 


Reply via email to