Showing posts with label e-commerce software. Show all posts
Showing posts with label e-commerce software. Show all posts

Thursday, 11 November 2010

JadaSite shops without Payment Gateways

(JadaSite 2.03)

I didn't set any Payment Gateway in my shops. While shopping, I go Null Pointer Exception:

2010-11-11 10:39:25,452 ERROR [http-8180-Processor24] (ContentLookupDispatchAction.java:165) - Exception encountered in null
2010-11-11 10:39:25,452 ERROR [http-8180-Processor24] (ContentLookupDispatchAction.java:166) - Exception
java.lang.NullPointerException
    at com.jada.content.checkout.ShoppingCartCancelCheckoutAction.cancel(ShoppingCartCancelCheckoutAction.java:48)

To fix this, add check for line 48 in ShoppingCartCancelCheckoutAction:

PaymentEngine paymentEngine = shoppingCart.getPaymentEngine();
if (paymentEngine != null) {
    paymentEngine.abort();
}

Wednesday, 10 November 2010

velocity.log Permission denied

(within JadaSite 2.03 using Apache Valocity 1.5)

I got a lot of Permission denied stacktraces for velocity.log within my catalina.out. It is not big problem for now, but these messages could lead to large catalina.log file which will effect performances of Web application.

Velocity's log file is written into current folder (for me /etc/init.d) by default setup. If tomcat user does not have the right to create that file, you'll get Permission denied error. According to the Apache's documentation, Velocity's setup can be changed within Java. But, I didn't like the idea of changing Jada's code just for that.

Instead, I have overridden Velocity default properties:

  • I got the original velocity.properties file from
    velocity-1.5.jar (in folder org/apache/velocity/runtime/defaults/)
  • I created new directories within Jada's WEB-INF/classes folder to have the same structure
  • I created a new file velocity.properties within just created folder
    WEB-INF/classes/org/apache/velocity/runtime/defaults/
  • In that new file, I put the contents from the original file, and changed the value in the line 32 to
    runtime.log = /tmp/velocity.log

Edit: Within this velocity log I got an error saying that class org.apache.log.format.Formatter is not found. The class can be found in avalon-logkit-2.2.1.jar (or any newer version I suppose). To fix this, download this jar and add it to the class path (I've put it in Jada's WEB-INF/lib/ folder).

JadaSite internationalization within JSON problem

(JadaSite 2.03)

While opening Items for editing, I got error: Unexcepted Error: unable to show selected category.
I have Categories that include some Serbian UTF-8 characters.

The problem is that length of JSON data response is calculated as length of JSON string, and the same string is then transfered via HTTP as bytes. This results in missing characters at the end of JSON output, and therefore the unrecognized input on edit page.

For fix: JSON is heavily used in stated way within the code, and this problem can be solved only by large refactoring. The quick fix would be to change JSONEscapeObject class - method toHtmlString. Check the difference in length between string and byte array, and add the difference as spaces at the end of string afterwards:



// if this is less or equal to 0 it is ok; else, add this much spaces at the end
// so the length of string would represent the size of byte array from the string itself
// (without trailing spaces that would be added here)
public String toHtmlString() {
    String output = toString();
    output = output.replaceAll("'", "\\\\'");
    //---additional code
    int additionalByteSymbolsCount = output.getBytes().length - output.length();
    for (int i = 0; i < additionalByteSymbolsCount; i++) {
        output += ' ';
    }
    //---
    return output;
}

This also may (and will) fix some other problems (i.e. I could not select some categories from the list for the item because category names contained Serbian letters).

Tuesday, 9 November 2010

Currency Attributes problem when editing Items in JadaSite

For the problem stated at:
http://www.jadasite.com/forum/viewtopic.php?f=6&t=112
the simple solution would be to use "User Input" as Attribut type for Currency Custom Attributes.

Before that I have used default "User selects from dropdown" as Attribute type for Currency - it is kind of strange to use it that way, isn't it? But there is no validation for this kind of error yet. So be carefull what you choose.

The logged error was:
javax.servlet.jsp.JspException
at com.jada.taglib.language.OptionsCollection.doEndTag(OptionsCollection.java:80)

Monday, 8 November 2010

Apache OFBiz problems with port 1099 on startup

(Apache OFBiz 9.04 Stable Release)

During my first start of OFBiz, I got error message that port 1099 is busy. I got this after turning of GMail, also (found somewhere that it is using this port). Yet, I didn't so any process using this port in list from netstat.

Oddly enough, looks like OFBiz is using it. And so I find where to change this:
file: framework/base/config/ofbiz-containers.xml
replace: 1099 to 10990 (check if this port is not used with netstat - you can change this to any free port)
(I found 1099 in two places in the file - lines 40 and 47)


After saving the configuration file I could start OFBiz without any problems.

Later on (after restart I suppose), I changed previously mentioned ports back to 1099. There was no problems this time.
So, if you got the error message for the first time, before changing port try to restart first, and write a comment here if only the restart fixed this.

Popular Posts