Showing posts with label solved. Show all posts
Showing posts with label solved. Show all posts

Tuesday, April 4, 2017

Opencart Product Options are not showing in Firefox

Issue in Opencart

Dropdown (select) with Options for products is not available. Writing in the search box does not show any options. Maybe other functionality in administrative is affected.

Sunday, March 5, 2017

Solved: MediaWiki sets all date to Thu, 01 Jan 1970 00:00:00 GMT

All dates (datetimes, timestamps) in your revisions in MediaWiki are shown as:
  • Thu, 01 Jan 1970 00:00:00 GMT
  • 00:33, 1 January 1970 
  • 31 December 1969
  • or something similar (depends on locale you use)
The issue is that a column in database is defined with shorter limit and date is truncated extremely. Updating your mediawiki will not solve the issue.

Solution: In your SQL db for your wiki look for the table called yourdbprefix_revision in that table find the column rev_timestamp and check its datatype, if it's set to anything less then VarChar(14) change it (to "VarChar(14)") and save the changes. Now when you edit a page the revision will show the correct date.

Special thanks to krikit.

Tuesday, December 29, 2015

NoClassDefFoundError exception in your Maven project

After you have added a new dependency, you could have exception like this:

NetBeans error:

--- exec-maven-plugin:1.2.1:exec (default-cli) @ integration ---
java.lang.NoClassDefFoundError: path/to/the/class/ClassName
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
    at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
    at java.lang.Class.getMethod0(Class.java:3018)
    at java.lang.Class.getMethod(Class.java:1784)
    at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
    at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException: package.ClassName
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 7 more

IntellijIdea error:

Tuesday, October 14, 2014

Hibernate: Executing an update/delete query exception solved

If you get this exception:
nested exception is javax.persistence.TransactionRequiredException: Executing an update/delete query

It may be because you do not have @Transaction annotation in your repository class (interface). I tried adding @Transaction annotation to calling service or calling controller, but it did not solve the exception. If this do not help you, check step-by-step solution described in this stackoverflow thread.

Monday, August 25, 2014

Mantis bugtracker mail configuration

I paste successful configuration for Mantis Bugtracker for sending mails (registering users, notifications, etc).

Enter (and replace with your data) this lines in config_inc.php:

$g_administrator_email = 'sender-email@mail.bg';
$g_from_email = 'sender-email@mail.bg';
$g_webmaster_email = 'sender-email@mail.bg';
$g_return_path_email = 'sender-email@mail.bg';
$g_phpMailer_method = PHPMAILER_METHOD_SMTP;
$g_smtp_host = 'smtp.mail.bg';
$g_smtp_username = 'sender-email@mail.bg';
$g_smtp_password = 'sender-email-password';
$g_smtp_connection_mode = 'ssl';
$g_smtp_port = 465;
$g_email_send_using_cronjob = OFF;
$g_log_level = LOG_EMAIL;



Friday, June 13, 2014

"Thread stuck in device driver" for Dell with Windows 8.1 - solved

You get "THREAD STUCK IN DEVICE DRIVER" after every sleep / hibernate in Dell Inspiron 15R notebook after upgrading Windows 8 to Windows 8.1. Restoring previous state before sleep was not possible and a restart os Windows was forced. I give the solution, which helped me (copy-past-ed):

I have been reading through many, many forums to have this annoying message disappear. For 3 month I was pulling my hair because of this silly message! I also have a Dell Inspiron 15R and when I turn it on, it showed this blue message saying THREAD STUCK IN DEVICE DRIVER, it then reboots itself followed by 5-10seconds of black screen. This issue only began after I updated from Windows 8 to Windows 8.1. I kept records of what I read through many forums to fix this and hopefully this will work for you.

1. I went to the Dell website and re-installed the BIOS. I believe after upgrading from Win 8 to Win 8.1, the BIOS does get a little messed up. Find out your BIOS version by pressing the Windows key + R, and type msinfo32 then and go to Dell website then reinstall it. In my case, I went to the Dell UK website and reinstalled it.
2. I went to the Intel website and installed the Intel Update Tool below. http://supportkb.intel.com/wireless/wireless-display/templates/selfservice/intelwidi/#portal/1026/article/16168.
3. I uninstalled the AMD drivers which were currently installed via Control Panel, then I restarted the laptop.
4. After logging in, I downloaded the AMD Clean Install Utility from the AMD website below.
http://support.amd.com/en-us/kb-articles/Pages/AMD-Clean-Uninstall-Utility.aspx
5. I then installed the latest AMD Catalyst Suite from the AMD website below. In my case, it’s the 64bit AMD.
http://support.amd.com/en-us/download/desktop?os=Windows+7+-+64
6. Finally from the AMD website, I installed the AMD Auto Driver Detector from the below.
http://support.amd.com/en-us/download/auto-detect-tool
7. Back to the Intel website, I clicked on the “Check Your System For Updates” link. This detected all the Intel Drivers and showed me which ones needed updating. In my case, it detected that I needed to download 3 separate drivers.
http://www.intel.com/p/en_US/support/detect
Finally, I restarted my laptop. I did them all in this order and this worked for me like a charm.

This is solution from J.King Jr which helped me. It is posted here in Microsoft's forum.

The key was to Update BIOS, and after that to make a clean install of ATI driver. I tried to skip some steps of provided how-to, but the issue continue to persist.

Tuesday, February 25, 2014

Avoiding CORS security issues

CORS is security policy, according which a page could not be iframe-d from page from another site.

ajax requests are implemented via iframe, so if we want to do ajax requests to another site, we encounter CORS error.

How to enable this?

Solution is to tell server to allow the page/JSON/webservice to be iframed. This is done this way:
    public String getUserById(@PathVariable("id") Long id, HttpServletResponse httpResponse) throws JsonProcessingException {
        httpResponse.addHeader("Access-Control-Allow-Origin", "*");
        // do real work

    }

Access-Control-Allow-Origin is the header that allows this. Check wikipedia for other solutions.

solved: Spring + Hibernate used with JPA and EntityManager => HibernateException: collection is not associated with any session

When I started using lazy loading in Spring + Hibernate project, I encounter this error.

What does NOT solve my issue:
  • @Transactional annotation
  • OpenSessionInViewInterceptor


The error message was:

HTTP ERROR 500

Problem accessing /user/1. Reason:
    Server Error

Caused by:

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.hibernate.HibernateException: collection is not associated with any session
 at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:894)


Solution for Spring with JPA approach and EntityManager, is to use OpenEntityManagerInViewFilter. Register it in web.xml this way: