Pages

Showing posts with label windows. Show all posts
Showing posts with label windows. Show all posts

Thursday, January 22, 2015

Encountering Unsupported major.minor version 51.0

So I have to run Adempiere 361LTS in a Windows 8 machine who runs on Java 7 already.
I've copied my jdk1.6 folder from Windows 7 PC to Win8.

But even though project I've added in eclipse is already being built in Java 6, the eclipse is running Java 7 vm when running the tomcat 6 server. I wanted to debug the system in zkwebui..

So I'm left with logs and result in localhost:8080/webui
UnsupportedClassVersionError... further down the console log of eclipse I read this Unsupported major.minor version 51.0

In this link I read that...
The version number shown describes the version of the JRE the class file is compatible with.
The reported major numbers are:
J2SE 8 = 52,J2SE 7 = 51,J2SE 6.0 = 50,J2SE 5.0 = 49,JDK 1.4 = 48,JDK 1.3 = 47,JDK 1.2 = 46,JDK 1.1 = 45
So this gave me a hint that eclipse though was building the projects in Java 6 it's compiling in Java 7.

Then I found in this link with instructions on how to adjust eclipse version compiler...
Go to Menu-> Window -> Preferences -> Java -> Installed JREs -> Remove the old JRE -> Add new JRE


Finally, I'm able to run the system without error! :D

Hope this helps. :)

Monday, November 24, 2014

Updating iDempiere 2.0 to 2.1

First of, all of the solutions are here
http://www.globalqss.com/wiki/index.php/IDempiere/Importing_DB_Seed_Manually

Except for some bumps I've encountered in applying the database migration script
1) I'm using windows so running
sh syncApplied_2.1.sh 
means I have to download CYGwin, there are other tools but this is what I used.

2) After successfully running sync applied, I feel like I need a complete version of migration scripts, because I don't want a problem. So I have to double check the last check point I had when I ran my first migration script and that was i2.0z (found under idempiere\migration\i2.0z). So I have to update my trunk to latest 2.1 branch release by using
hg pull && hg update release-2.1 
inside my local idempiere home folder.

3) After having all the scripts needed, apparently I realized that I don't need step 1 if I have updated my trunk. So I've created a bat that will execute all the sql files in i2.0z folder, since there are lots of sql file.

4) But, I've encountered this generate_uuid() function missing or not existing, so I have to search all over the net to find the solution...

first I found this: https://idempiere.atlassian.net/browse/IDEMPIERE-274
the above link didn't work for me, and I'm not sure why so I tried this

second solution: psql -d idempiere -U adempiere -c 'CREATE EXTENSION "uuid-ossp"'
from: http://www.globalqss.com/wiki/index.php/IDempiere/Importing_DB_Seed_Manually

But again it didn't work because I'm having problem with those freaking quotes!
So my third solution is: http://blog.hardmax.com.pe/2013/11/04/postgres-error-function-uuid_generate_v4-does-not-exist-despues-de-restaurar-idempiere-solucionado/

And it almost did not work in step 3 when I tried using this (instead of what is in the website)
idempiere=# SELECT adempiere.generate_uuid();
But the problem with that is, I have to put adempiere schema in all sql files in migration folder, and I cannot do that. That's crazy!

5) I found a site that modifies postgresql.conf here http://www.mkyong.com/database/postgresql-how-to-change-default-schema/

But when I restarted my server, I had problems running SELECT adempiere.generate_uuid(); again. So I had to close the cmd and recreate the extension. And viola! It WORKS!!! :D

So, I hope this documentation will help other struggling implementer who are updating their idempiere system to 2.1.

Tuesday, May 13, 2014

POSTGRESQL WINDOWS X64: ENABLING UUID-OSSP.SQL

This documentation came from this web page: GraceBatumbya
I've posted it here as a back-up, if ever something happens to the website. All credits goes back to the website I mentioned above.

The background to this is that for that for over 6 months now, I have been working on developing a PostgreSQL Adapter for NexJ Express, a part of Open Health Tools. Though most of the development is done in Java, I have also learnt a lot about PostgreSQL.


The Problem:
Although PostgreSQL has a UUID type, the UUID generation is dependent on the UUID-OSSP.sql module which in turn depends on the OSSP-UUID library.

The PostgreSQL installer for Windows includes the UUID-OSSP.sql module for x86 builds but not for x64 builds (lastest version that I checked was PostgreSQL 9.0.4).

When I asked on #postgresql irc channel, one of the things I was told was that there was not OSSP-UUID library build for windows x64.

The Solution: (tested with PG 9.0.4 x64 build)

Turns out that there was a build of OSSP-UUID for x64 windows in the wild. Thanks to Hiroshi Saito, who replied to my message on the pg_general mailing list.
  1. Download pg90_uuid_ossp_x64.zip,
  2. Unzip the contents of the zip to path/to/PostgreSQL/9.0/
  3. Open psql and install uuid-ossp.sql using the command:
    \i 'path/to/PostgeSQL/9.0/share/contrib/uuid-ossp.sql'
Also, Hiroshi provides the source if you interested on compiling OSSP-UUID on x64 windows for yourself.