NullPointerException after payment confirmation

Bug and problem reporting

Moderators: hugo, alexandre, rmvanarkel

Post Reply
Xebax
Posts: 19
Joined: Fri Nov 16, 2012 1:19 pm

NullPointerException after payment confirmation

Post by Xebax »

Hi,

I'm a new Cyclos user and first of all, I want to thank you for your work and for this great software.

I'm using Cyclos 3.7.1, installed with the standalone package. I'm trying to configure Cyclos for a local currency named eusko that will be launched in January 2013. 1 eusko = 1 euro and the users will convert euros to eusko vouchers in "currency exchange offices".

I've created a new currency named eusko and several accounts, including :
1) a member account for "exchange office"
2) a system account for "vouchers in circulation"
I've also created a member group named "exchange office". The members of this group have a "exchange office" member account.
The people that use the currency have no account in the system for the moment.

I've defined two transactions between the accounts described above :
- from the "exchange office" member account to the "vouchers in circulation" system account (used when a member buys vouchers)
- from the "vouchers in circulation" system account to the "exchange office" member account (used when a member converts vouchers to euros)

In the group permissions of the "exchange office" group, in the "payments" section, I've checked the transaction 1 (in "System payments") and 2 (in "Chargeback received payment") because I want the members of this group to be able to make these transactions. I don't know if this the correct way to do that, I'm playing with the configuration to learn.

To test the configuration, I've created an "exchange office" member. When I'm logged with this member and I do a "system payment", the transaction 1 is selected (the 2 is not available) and when I perform this payment, there is an error. Here is the detailed error from the logs :

Code: Select all

Date : 25/11/2012 15:03:38
Utilisateur connecté : B00001

Chemin : /do/member/confirmPayment

Paramètres de requête : from=
                        selectMember= false

Détails d'erreur Java : java.lang.NullPointerException
at nl.strohalm.cyclos.services.transactions.PaymentServiceImpl.performInsert(PaymentServiceImpl.java:2126)
at nl.strohalm.cyclos.services.transactions.PaymentServiceImpl.performInsert(PaymentServiceImpl.java:2344)
at nl.strohalm.cyclos.services.transactions.PaymentServiceImpl.access$1000(PaymentServiceImpl.java:187)
at nl.strohalm.cyclos.services.transactions.PaymentServiceImpl$5.doInTransaction(PaymentServiceImpl.java:1363)
at nl.strohalm.cyclos.services.transactions.PaymentServiceImpl$5.doInTransaction(PaymentServiceImpl.java:1355)
at nl.strohalm.cyclos.utils.TransactionHelperImpl.maybeRunInNewTransaction(TransactionHelperImpl.java:183)
at nl.strohalm.cyclos.utils.TransactionHelperImpl.maybeRunInNewTransaction(TransactionHelperImpl.java:175)
at nl.strohalm.cyclos.services.transactions.PaymentServiceImpl.doInsert(PaymentServiceImpl.java:1355)
at nl.strohalm.cyclos.services.transactions.PaymentServiceImpl.doPayment(PaymentServiceImpl.java:1380)
at nl.strohalm.cyclos.services.transactions.PaymentServiceImpl.doPayment(PaymentServiceImpl.java:772)
at nl.strohalm.cyclos.services.transactions.PaymentServiceSecurity.doPayment(PaymentServiceSecurity.java:94)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at nl.strohalm.cyclos.spring.ServiceSecurityProxyInvocationHandler.invoke(ServiceSecurityProxyInvocationHandler.java:65)
at $Proxy71.doPayment(Unknown Source)
at nl.strohalm.cyclos.controls.payments.ConfirmPaymentAction.handleSubmit(ConfirmPaymentAction.java:116)
at nl.strohalm.cyclos.controls.BaseFormAction.executeAction(BaseFormAction.java:52)
at nl.strohalm.cyclos.controls.BaseAction.execute(BaseAction.java:192)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
at nl.strohalm.cyclos.struts.CyclosRequestProcessor.doExecuteAction(CyclosRequestProcessor.java:459)
at nl.strohalm.cyclos.struts.CyclosRequestProcessor.executeAction(CyclosRequestProcessor.java:496)
at nl.strohalm.cyclos.struts.CyclosRequestProcessor.processActionPerform(CyclosRequestProcessor.java:256)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
at nl.strohalm.cyclos.struts.CyclosRequestProcessor.process(CyclosRequestProcessor.java:144)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at nl.strohalm.cyclos.http.LoggedUserFilter.execute(LoggedUserFilter.java:117)
at nl.strohalm.cyclos.http.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:51)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at nl.strohalm.cyclos.http.RequestProcessingFilter.execute(RequestProcessingFilter.java:74)
at nl.strohalm.cyclos.http.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:51)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at nl.strohalm.cyclos.http.SanitizerFilter.execute(SanitizerFilter.java:66)
at nl.strohalm.cyclos.http.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:51)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:964)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:304)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source) 
I hope this description is clear. If you need more information, just ask and I will try to provide it.

Thanks.
Xebax
alexandre
Posts: 913
Joined: Wed Sep 06, 2006 9:06 am

Re: NullPointerException after payment confirmation

Post by alexandre »

HI,

Can you send more info on how you get this error? Because this error is related to transaction feedback, and this is not available on system payments.
You can try to edit the transfer type and change something like name or description, save and try to perform teh payment again.

regards.
Alexandre Caurrinhos
Cyclos development team.
Xebax
Posts: 19
Joined: Fri Nov 16, 2012 1:19 pm

Re: NullPointerException after payment confirmation

Post by Xebax »

Hi,

I tried to attach the database to this post but it is too big.
Is there a way I can send you the database ?

This way you could reproduce the bug easily.

Regards.
Xebax
admin
Site Admin
Posts: 1423
Joined: Mon Jan 24, 2005 10:31 am

Re: NullPointerException after payment confirmation

Post by admin »

Hi,

You can send it, preferably in a zip file, to the e-mail info@cyclos.org
Can you confirm that you did not access the database from anywhere but Cyclos?
Xebax
Posts: 19
Joined: Fri Nov 16, 2012 1:19 pm

Re: NullPointerException after payment confirmation

Post by Xebax »

Hi,

I have sent the database to the e-mail above.

I confirm that I worked on this database only with Cyclos, I did not access it from another tool.

Thank you for your support.
Best regards.
Xebax
alexandre
Posts: 913
Joined: Wed Sep 06, 2006 9:06 am

Re: NullPointerException after payment confirmation

Post by alexandre »

HI,

Analyzing your database I saw the problem. The transfer type used are checked for require transaction feedback, but this is not available for system payments, and there is no way to check this using cyclos.

To correct the problem, just go to the transfer type details and change something, like the name, save and edit again to revert the change. This will force the Transfer type update on database and will remove this require for transaction feedback.

Another question: In your database all transfer types are checked for requires_feedback. This can generate other errors. We cannot reproduce this scenario creating a new database. If you don't updated the database manually can you inform how was the steps that you made to created this DB? In what cyclos version?


regards.
Alexandre Caurrinhos
Cyclos development team.
Xebax
Posts: 19
Joined: Fri Nov 16, 2012 1:19 pm

Re: NullPointerException after payment confirmation

Post by Xebax »

Hi,

Thank you for your quick answer.

I did as you said and then the transaction worked. But as you noticed, my database was totally corrupted so I decided to start over from scratch (I could have fixed all the transactions with the same manipulation but I suspect others tables were also filled with invalid values).

I have also thought about your question and I have finally managed to reproduce the problem:
  • I installed Cyclos 3.7.1 on my PC with the standalone installation package; my PC runs Windows XP and I have installed XAMPP to run Apache, MySQL, etc...
  • I set the locale to fr_FR and configured the connection to MySQL
  • then I started Cyclos and the database was created
  • then I wanted to use Jelastic to share my work with my team and I installed Cyclos 3.7.1 on Jelastic by following the instructions given in the "Cyclos in the cloud" blog post
  • I set the locale to fr_FR as on my PC
  • I created a user named 'cyclos' in MySQL and I imported the database I had on my PC
  • then I restarted Tomcat and I connected to this new Cyclos instance.
I did an export of the DB on my PC to a file named db_created_on_my_pc.sql.
After the import of this DB on Jelastic, I exported it (from Jelastic) to a file named db_created_on_my_pc_and_imported_on_jelastic.sql.
I also did a fresh install on Jelastic and let Cyclos create the DB the first time it started. I exported this DB to a file named db_created_on_jelastic.sql.

These 3 files are different. The differences are in all the values of columns which type is bit(1) (like requires_feedback). The is_enabled and is_default columns in the custom_field_possible_values table are a good example of these differences. Here are the values of these columns in the 3 files, for the first row ('Male'), as displayed by Notepad++ in "normal" mode and in hexadecimal mode:

Code: Select all

db_created_on_my_pc.sql:
'1', '0'        ->    27 31 27 2c 20 27 30 27

db_created_on_jelastic.sql:
'SOH', '\0'     ->    27 01 27 2c 20 27 5c 30 27

db_created_on_my_pc_and_imported_on_jelastic.sql:
'SOH', 'SOH'    ->    27 01 27 2c 20 27 01 27
Note that SOH is the Start of Heading control code, not the "SOH" string.

I don't understand why these files are different. Which is the correct one? (I suppose it is the one created on my PC because it does not have this strange SOH character...)
I thought it was safe to copy the DB from one environment to another one, using phpMyAdmin. If that's not the case, what is the correct procedure to move an installation of Cyclos from one machine to another one?

Here are some details about the two environments, hoping that will help you:
  • on my PC:
    • MySQL 5.5.8
    • PHP 5.3.5
    • phpMyAdmin 3.3.9
    • Java 1.6.0_22
    • Tomcat ?
    • Cyclos 3.7.1 installed using the standalone package
  • on Jelastic:
    • MySQL 5.5.25
    • PHP 5.3.10
    • phpMyAdmin 3.5.2
    • Java ?
    • Tomcat 6.0.35
    • Cyclos 3.7.1 installed using the basic installation package
Best regards.
Xebax
Xebax
Posts: 19
Joined: Fri Nov 16, 2012 1:19 pm

Re: NullPointerException after payment confirmation

Post by Xebax »

Hi,

I was wrong : the export I obtained on my PC was incorrect, due to a bug in phpMyAdmin:
http://sourceforge.net/tracker/?func=de ... p_id=23067

If I fix the values in the export (replace '0' by b'0' and '1' by b'1'), the values in the DB are correct after importing the file.

The bug seems to be fixed in last versions of phpMyAdmin so I will upgrade it.

Best regards.
Xebax
admin
Site Admin
Posts: 1423
Joined: Mon Jan 24, 2005 10:31 am

Re: NullPointerException after payment confirmation

Post by admin »

Thanks for informing us.
Good to hear it is working now.
Post Reply