Product Subscription Issue

180 views
Skip to first unread message

Nethaji Moorthi

unread,
May 12, 2017, 5:01:27 AM5/12/17
to Kill Bill users mailing-list
Exception throwsing while subscribe a product/plan,

{
"className": "net.sf.ehcache.CacheException",
"code": null,
"message": "Exception on load for key 4",
"causeClassName": "java.lang.IllegalStateException",
"causeMessage": "Failed to de-serialize catalog for tenantRecordId='4'",
"stackTrace": []
}

Please assist to find root cause of this issue.


Regards,
Nethaji Moorthi.

Nethaji Moorthi

unread,
May 12, 2017, 5:07:51 AM5/12/17
to Kill Bill users mailing-list
Input json

{
"accountId": "08564894-e721-46f2-b83d-ca8db1d3f5cf",
"planName": "_fe4a0d17-2071-40ad-bb54-9d45e324b66f"
}

Nethaji Moorthi

unread,
May 12, 2017, 5:19:18 AM5/12/17
to Kill Bill users mailing-list

Here i mentioned catalog xml for reference:


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<catalog>
<effectiveDate>2013-02-08T00:00:00Z</effectiveDate>
<catalogName>SpyCarBasic</catalogName>
<recurringBillingMode>IN_ADVANCE</recurringBillingMode>
<currencies>
<currency>USD</currency>
<currency>GBP</currency>
</currencies>
<units/>
<products>
<product name="Sports">
<category>BASE</category>
<included/>
<available/>
<limits/>
</product>
<product name="Standard">
<category>BASE</category>
<included/>
<available/>
<limits/>
</product>
<product name="Super">
<category>BASE</category>
<included/>
<available/>
<limits/>
</product>
<product name="SurPaaS Summer">
<category>BASE</category>
<included/>
<available/>
<limits/>
</product>
</products>
<rules>
<changePolicy>
<changePolicyCase>
<policy>IMMEDIATE</policy>
</changePolicyCase>
</changePolicy>
<changeAlignment>
<changeAlignmentCase>
<alignment>START_OF_BUNDLE</alignment>
</changeAlignmentCase>
</changeAlignment>
<cancelPolicy>
<cancelPolicyCase>
<policy>IMMEDIATE</policy>
</cancelPolicyCase>
</cancelPolicy>
<createAlignment>
<createAlignmentCase>
<alignment>START_OF_BUNDLE</alignment>
</createAlignmentCase>
</createAlignment>
<billingAlignment>
<billingAlignmentCase>
<alignment>ACCOUNT</alignment>
</billingAlignmentCase>
</billingAlignment>
<priceList>
<priceListCase>
<toPriceList>DEFAULT</toPriceList>
</priceListCase>
</priceList>
</rules>
<plans>
<plan name="_fe4a0d17-2071-40ad-bb54-9d45e324b66f">
<product>SurPaaS Summer</product>
<initialPhases/>
<finalPhase type="FIXEDTERM">
<duration>
<unit>MONTHS</unit>
<number>1</number>
</duration>
<fixed type="ONE_TIME">
<fixedPrice>
<price>
<currency>USD</currency>
<value>1250.0</value>
</price>
</fixedPrice>
</fixed>
<recurring>
<billingPeriod>WEEKLY</billingPeriod>
<recurringPrice>
<price>
<currency>USD</currency>
<value>25.0</value>
</price>
</recurringPrice>
</recurring>
<usages/>
</finalPhase>
<plansAllowedInBundle>-1</plansAllowedInBundle>
</plan>
<plan name="sports-monthly">
<product>Sports</product>
<initialPhases>
<phase type="TRIAL">
<duration>
<unit>DAYS</unit>
<number>30</number>
</duration>
<fixed type="ONE_TIME">
<fixedPrice/>
</fixed>
<usages/>
</phase>
</initialPhases>
<finalPhase type="EVERGREEN">
<duration>
<unit>UNLIMITED</unit>
<number>-1</number>
</duration>
<recurring>
<billingPeriod>MONTHLY</billingPeriod>
<recurringPrice>
<price>
<currency>GBP</currency>
<value>375.00</value>
</price>
<price>
<currency>USD</currency>
<value>500.00</value>
</price>
</recurringPrice>
</recurring>
<usages/>
</finalPhase>
<plansAllowedInBundle>-1</plansAllowedInBundle>
</plan>
<plan name="standard-monthly">
<product>Standard</product>
<initialPhases>
<phase type="TRIAL">
<duration>
<unit>DAYS</unit>
<number>30</number>
</duration>
<fixed type="ONE_TIME">
<fixedPrice/>
</fixed>
<usages/>
</phase>
</initialPhases>
<finalPhase type="EVERGREEN">
<duration>
<unit>UNLIMITED</unit>
<number>-1</number>
</duration>
<recurring>
<billingPeriod>MONTHLY</billingPeriod>
<recurringPrice>
<price>
<currency>GBP</currency>
<value>75.00</value>
</price>
<price>
<currency>USD</currency>
<value>100.00</value>
</price>
</recurringPrice>
</recurring>
<usages/>
</finalPhase>
<plansAllowedInBundle>-1</plansAllowedInBundle>
</plan>
<plan name="super-monthly">
<product>Super</product>
<initialPhases>
<phase type="TRIAL">
<duration>
<unit>DAYS</unit>
<number>30</number>
</duration>
<fixed type="ONE_TIME">
<fixedPrice/>
</fixed>
<usages/>
</phase>
</initialPhases>
<finalPhase type="EVERGREEN">
<duration>
<unit>UNLIMITED</unit>
<number>-1</number>
</duration>
<recurring>
<billingPeriod>MONTHLY</billingPeriod>
<recurringPrice>
<price>
<currency>GBP</currency>
<value>750.00</value>
</price>
<price>
<currency>USD</currency>
<value>1000.00</value>
</price>
</recurringPrice>
</recurring>
<usages/>
</finalPhase>
<plansAllowedInBundle>-1</plansAllowedInBundle>
</plan>
</plans>
<priceLists>
<defaultPriceList name="DEFAULT">
<plans>
<plan>_fe4a0d17-2071-40ad-bb54-9d45e324b66f</plan>
<plan>sports-monthly</plan>
<plan>standard-monthly</plan>
<plan>super-monthly</plan>
</plans>
</defaultPriceList>
</priceLists>
</catalog>

Pierre-Alexandre Meyer

unread,
May 12, 2017, 11:01:23 AM5/12/17
to Nethaji Moorthi, Kill Bill users mailing-list
Hi Nethaji,

Your catalog looks correct -- it seems though that the entry in the cache and/or in the database is corrupted.

Could you try:
  • Restarting Kill Bill to see if it helps (it should clear the cache)
  • Deleting the CATALOG entries in the tenant_kvs table and re-uploading your catalog
Additionally, it would be helpful to get some steps to reproduce it. We've had similar reports in the past (https://github.com/killbill/killbill/issues/722), but we haven't been able to find the root cause.

Thanks,


--
You received this message because you are subscribed to the Google Groups "Kill Bill users mailing-list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to killbilling-users+unsubscribe@googlegroups.com.
To post to this group, send email to killbilling-users@googlegroups.com.
Visit this group at https://groups.google.com/group/killbilling-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/killbilling-users/f29b2db9-a491-42b5-a14f-9fd9abd898d4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Pierre

Nethaji Moorthi

unread,
May 12, 2017, 11:34:00 AM5/12/17
to Kill Bill users mailing-list, jmne...@gmail.com
Hi Pierre-Alexandre Meyer,
     Great, thanks for the immediate response. May i know why Product/plan/catalog PUT,DELETE is not supported in KillBill ?. hence we are keeping our product details in other database 
and at the time of subscription we are calling killbill product plan create then immediately subscription post will call. here i can explain in detail.

First i'll call /simplePlan POST, after getting 200/201 response i'll call /1.0/kb/subscriptions POST api immediately
with account id and product plan name[tenant_kvs] to subscribe. during product plan validation, three products only loading which is  from[\profiles\killbill\src\main\resources\SpyCarBasic.xml]. may be in cache but it's loaded while tomcat starts. actually catalog get from tenant_kvs table. 
hence the exception occur like

{
  "className": "org.killbill.billing.subscription.api.user.SubscriptionBaseApiException",
  "code": 2021,
  "message": "Could not find any plans named '_2919cfba-3dba-4ef7-a905-bcb415f31a79'",
  "causeClassName": "org.killbill.billing.catalog.api.CatalogApiException",
  "causeMessage": "Could not find any plans named '_2919cfba-3dba-4ef7-a905-bcb415f31a79'",
  "stackTrace": []
}


some times cacheexception

{
  "className": "net.sf.ehcache.CacheException",
  "code": null,
  "message": "Exception on load for key 4",
  "causeClassName": "java.lang.IllegalStateException",
  "causeMessage": "Failed to de-serialize catalog for tenantRecordId='4'",
  "stackTrace": []
}

Thanks and Regards,
Nethaji Moorthi



To unsubscribe from this group and stop receiving emails from it, send an email to killbilling-us...@googlegroups.com.
To post to this group, send email to killbill...@googlegroups.com.



--
Pierre

Pierre-Alexandre Meyer

unread,
May 12, 2017, 11:51:36 AM5/12/17
to Nethaji Moorthi, Kill Bill users mailing-list
On Fri, May 12, 2017 at 8:34 AM, Nethaji Moorthi <jmne...@gmail.com> wrote:
May i know why Product/plan/catalog PUT,DELETE is not supported in KillBill ?

The Kill Bill catalog model is very complicated, allowing you to define lots of different pricing schemes. It would be quite tricky to fully denormalize it in database tables, that's the reason why we settled on an XML configuration file originally.

We do offer a simple plan API to create plans on the fly though, but it only exposes limited features of the catalog (see our screencasts: https://www.youtube.com/channel/UChXICgGipKvJbtzKfM1SNoQ). Advanced users will almost always fallback to editing the XML or implementing their own catalog through a plugin (see http://docs.killbill.io/latest/catalog_plugin.html).

Note also that PUT/DELETE on plans and products would involve versioning the catalog for grandfathering of prices for instance, see http://docs.killbill.io/latest/userguide_subscription.html#_catalog_versions.
 
First i'll call /simplePlan POST, after getting 200/201 response i'll call /1.0/kb/subscriptions POST api immediately
with account id and product plan name[tenant_kvs] to subscribe. during product plan validation, three products only loading which is  from[\profiles\killbill\src\main\resources\SpyCarBasic.xml].

If you don't want Kill Bill to use the default test catalog upon tenant creation, you need specify the following query parameter: 'useGlobalDefault=false':

curl -v \
    -X POST \
    -u admin:password \
    -H 'Content-Type: application/json' \
    -H 'X-Killbill-CreatedBy: admin' \
    -d '{"apiKey": "bob", "apiSecret": "lazar"}' \

Note that if you are using the KAUI tenant screen to create your tenant, it will do that automatically for you. 

At this point, you have a tenant with no default catalog and you can then proceed with uploading your XML catalog or use the UI (or API) to add 'simple' plans.

--
Pierre

mnet...@corenttech.com

unread,
May 15, 2017, 1:41:15 AM5/15/17
to Kill Bill users mailing-list, jmne...@gmail.com
Hi Pierre,
Thanks for the response, i will try to create a tenants with useGlobalDefult=false parameter. let's see will it resolve my problem.

Thanks & Regards,
Nethaji Moorthi.

Nethaji Moorthi

unread,
May 16, 2017, 3:14:23 AM5/16/17
to Kill Bill users mailing-list, jmne...@gmail.com
Hi Pierre, 
    I tried with useGlobalDefault=false, but we faced the same issue again.
Reply all
Reply to author
Forward
0 new messages