[ 
https://issues.apache.org/jira/browse/OFBIZ-6071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14325509#comment-14325509
 ] 

Jacopo Cappellato commented on OFBIZ-6071:
------------------------------------------

[~diveshdut], [~rohit.koushal] thanks for your contribution, it looks good.
While testing this (before applying your patch) during the create-tenant task I 
got the following error:

{quote}
2015-02-18 07:48:31,501 |main                 |EntitySaxReader               
|I| Beginning import from URL: 
file:/Users/jacopoc/projects/ofbiz/release14.12/framework/entity/data/TenantDemoData.xml
2015-02-18 07:48:31,501 |main                 |EntitySaxReader               
|I| Transaction Timeout set to 2 hours (7200 seconds)
2015-02-18 07:48:31,501 |main                 |GenericDelegator              
|I| Can't access entity of entityGroup = org.ofbiz.tenant using tenant 
delegator default#TEST123, use base delegator instead
2015-02-18 07:48:31,502 |main                 |GenericDelegator              
|E| Failure in storeAll operation: org.ofbiz.entity.GenericEntityException: 
There is no datasource (Helper) configured for the entity-group 
[org.ofbiz.tenant]; was trying to find datasource (helper) for entity [Tenant]. 
Rolling back transaction.
org.ofbiz.entity.GenericEntityException: There is no datasource (Helper) 
configured for the entity-group [org.ofbiz.tenant]; was trying to find 
datasource (helper) for entity [Tenant]
        at 
org.ofbiz.entity.GenericDelegator.getEntityHelper(GenericDelegator.java:544) 
~[ofbiz-entity.jar:?]
        at 
org.ofbiz.entity.GenericDelegator.storeAll(GenericDelegator.java:1429) 
[ofbiz-entity.jar:?]
        at 
org.ofbiz.entity.util.EntitySaxReader.writeValues(EntitySaxReader.java:329) 
[ofbiz-entity.jar:?]
        at 
org.ofbiz.entity.util.EntitySaxReader.parse(EntitySaxReader.java:299) 
[ofbiz-entity.jar:?]
        at 
org.ofbiz.entity.util.EntitySaxReader.parse(EntitySaxReader.java:248) 
[ofbiz-entity.jar:?]
        at 
org.ofbiz.entity.util.EntityDataLoader.loadData(EntityDataLoader.java:257) 
[ofbiz-entity.jar:?]
        at 
org.ofbiz.entityext.data.EntityDataLoadContainer.loadContainer(EntityDataLoadContainer.java:490)
 [ofbiz-entityext.jar:?]
        at 
org.ofbiz.entityext.data.EntityDataLoadContainer.start(EntityDataLoadContainer.java:245)
 [ofbiz-entityext.jar:?]
        at 
org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:237) 
[ofbiz-base.jar:?]
        at org.ofbiz.base.start.Start.startStartLoaders(Start.java:343) 
[ofbiz.jar:?]
        at org.ofbiz.base.start.Start.start(Start.java:369) [ofbiz.jar:?]
        at org.ofbiz.base.start.Start.main(Start.java:136) [ofbiz.jar:?]
2015-02-18 07:48:31,504 |main                 |TransactionUtil               
|W| Calling transaction setRollbackOnly; this stack trace shows where this is 
happening:
java.lang.Exception: Failure in storeAll operation: 
org.ofbiz.entity.GenericEntityException: There is no datasource (Helper) 
configured for the entity-group [org.ofbiz.tenant]; was trying to find 
datasource (helper) for entity [Tenant]. Rolling back transaction.
        at 
org.ofbiz.entity.transaction.TransactionUtil.setRollbackOnly(TransactionUtil.java:360)
 [ofbiz-entity.jar:?]
        at 
org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:301) 
[ofbiz-entity.jar:?]
        at 
org.ofbiz.entity.GenericDelegator.storeAll(GenericDelegator.java:1481) 
[ofbiz-entity.jar:?]
        at 
org.ofbiz.entity.util.EntitySaxReader.writeValues(EntitySaxReader.java:329) 
[ofbiz-entity.jar:?]
        at 
org.ofbiz.entity.util.EntitySaxReader.parse(EntitySaxReader.java:299) 
[ofbiz-entity.jar:?]
        at 
org.ofbiz.entity.util.EntitySaxReader.parse(EntitySaxReader.java:248) 
[ofbiz-entity.jar:?]
        at 
org.ofbiz.entity.util.EntityDataLoader.loadData(EntityDataLoader.java:257) 
[ofbiz-entity.jar:?]
        at 
org.ofbiz.entityext.data.EntityDataLoadContainer.loadContainer(EntityDataLoadContainer.java:490)
 [ofbiz-entityext.jar:?]
        at 
org.ofbiz.entityext.data.EntityDataLoadContainer.start(EntityDataLoadContainer.java:245)
 [ofbiz-entityext.jar:?]
        at 
org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:237) 
[ofbiz-base.jar:?]
        at org.ofbiz.base.start.Start.startStartLoaders(Start.java:343) 
[ofbiz.jar:?]
        at org.ofbiz.base.start.Start.start(Start.java:369) [ofbiz.jar:?]
        at org.ofbiz.base.start.Start.main(Start.java:136) [ofbiz.jar:?]
2015-02-18 07:48:31,506 |main                 |EntitySaxReader               
|E| An error occurred saving the data, rolling back transaction (true)
{quote}
It happens in trunk and 14.12: are you getting the same? [~jacques.le.roux], is 
this the issue you are having?


> Issue in decrypting entity fields where encrypt="true" is used in tenant 
> -------------------------------------------------------------------------
>
>                 Key: OFBIZ-6071
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-6071
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: Trunk, Upcoming Branch
>            Reporter: Divesh Dutta
>            Assignee: Jacques Le Roux
>            Priority: Blocker
>         Attachments: OFBIZ-6071.patch
>
>
> Error while adding a credit card from order manager when logged in with 
> tenant account.
> The error is as following:
> ERROR rendering error page [/error/error.jsp], but here is the error text: 
> org.ofbiz.widget.renderer.ScreenRenderException: Error rendering screen 
> [component://party/widget/partymgr/PaymentMethodScreens.xml#editcreditcard]: 
> org.ofbiz.widget.renderer.ScreenRenderException: Error rendering screen 
> [component://party/widget/partymgr/PaymentMethodScreens.xml#PaymentMethodDecorator]:
>  org.ofbiz.entity.transaction.GenericTransactionException: The current 
> transaction is marked for rollback, not beginning a new transaction and 
> aborting current operation; the rollbackOnly was caused by: Failure in 
> findByCondition operation for entity [CreditCard]: 
> org.ofbiz.entity.GenericEntityException: Error creating GenericValue 
> (org.ofbiz.base.util.GeneralException: javax.crypto.BadPaddingException: 
> Given final block not properly padded (Given final block not properly padded) 
> (javax.crypto.BadPaddingException: Given final block not properly padded 
> (Given final block not properly padded))). Rolling back 
> transaction.org.ofbiz.entity.GenericEntityException: Error creating 
> GenericValue (org.ofbiz.base.util.GeneralException: 
> javax.crypto.BadPaddingException: Given final block not properly padded 
> (Given final block not properly padded) (javax.crypto.BadPaddingException: 
> Given final block not properly padded (Given final block not properly 
> padded))) 
> It seems there is some issue with encryption-decryption mechanism for the 
> fields of an entity for which encrypt="true" is set. From the exception it 
> seemed that incorrect key is being used for decryption i.e. the key is not 
> appropriate with respect to the one which was used for encryption.
> After tracing the process flow we suspect that in SqlJdbcUtil.java while 
> calling 'decryptFieldValue' the delegator which is being used is 
> baseDelegator instead of tenant's delegator, but at the time of encryption 
> using 'encryptFieldValue' the delegator was tenant's delegator. May be this 
> is the reason why it is generating "javax.crypto.BadPaddingException".
> Steps to regenerate:
> 1. Create a tenant and login to tenant's admin account.
> 2. Navigate to ORDER > Order Entry > Sales Order
> 3. Use Demo Customer as Customer and continue.
> 4. Add some item to order and proceed for Quick Finalize Order.
> 5. Try to add new credit card.
> 6. On saving credit card information it will generate the above error. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to