Saturday, February 16, 2013

MongoDB in EJB project with EclipseLink


First you need to update persistense related jar files
in Glassfish modules folder

Update 7 persistence related jar files
in glassfish/modules
This folder in my PC is located
in c:\Program Files\glassfish-3.1.2.2\glassfish\modules

first backup current files just in case - create a new sub-folder _backup

move the files from modules to this new folder:
org.eclipse.persistence.antlr.jar
org.eclipse.persistence.jpa.jar
org.eclipse.persistence.asm.jar
org.eclipse.persistence.jpa.modelgen.jar
org.eclipse.persistence.core.jar
org.eclipse.persistence.oracle.jar
javax.persistence.jar

Then from eclipselink website download new zip file,
look for OSGI bundle:
http://www.eclipse.org/eclipselink/downloads/index.php#2.4

unzip that downloaded zip into some directory like
c:\javalibs

Then copy the updated versions on the same 7 .jar files
to
glassfish\modules directory
In case here:
c:\Program Files\glassfish-3.1.2.2\glassfish\modules
and then rename each of these .jar files to remove the versioning part of
file name, for example
org.eclipse.persistence.asm_3.3.1.v201206041142.jar
should be renamed to
org.eclipse.persistence.asm.jar

Do the same of the other updated files

Finally add these 2 .jar files to your project libs via NetBeans:
org.eclipse.persistense.nosql_xxxxxxx.jar (xxxxx is a version string like _2.4.1.v20121003-ad44345.jar
and also download the java client .jar from mongodb download site
and also add the mongo-java-driver-2.6.2.jar to your project library (the actual latest version may
be greater than 2.6.2 by now)



Restart Glassfish server, this can be done from inside NetBeans

The mongodb can be used now, so a regular @Entity annotation can be used
to persist data to mongo

So far so good.

Mongodb does not have transaction support so you will be use translation-type="RESOURCE_LOCAL"
in the persistence-unit section in persistence.xml

Then you have to provide your own transaction support in the classes

Some examples and basic documentation
is here

http://wiki.eclipse.org/EclipseLink/Examples/JPA/NoSQL

Sunday, January 27, 2013

My answer to "linking linkedin accounts"

This is my answer to a Question on Support site for LampCMS project


I know. I just found yesterday about changes to LinkedIN API. I wrote an answer about that, here:
http://support.lampcms.com/viewquestion/quest2274/LinkedIn-posts-do-not-work

Basically LinkedIN did not provide email address when user connects with LInkedIN API, but after the recent changes to their API they started providing email address.

I am making changes to the logic so that we can detect (using email address) when existing user is adding a LinkedIn account.

Saturday, January 26, 2013

My answer to "Search AutoComplete Behavior Broken?, Inconsistant with Code Comments"

This is my answer to a Question on Support site for LampCMS project


OK, I just looked at the javascript in qa.js again and it looks like it's not a bug
The behavior that you described (in the comments) applies only to autocomplete in the "title" of the questions form.
When you asking a new questions there is another auto-complete form that searches for similar questions as you typing the title of your question. That autocomplete will take you to the question when you click on one of the suggested results.

The search form's autocomplete just enters the suggested results into the search form. It was always working like that, it's not a bug.

There is a third autocomplete - for the tags form on the "ask question" form. That one inserts suggested tags into the tags field.

My answer to "LinkedIn posts do not work"

This is my answer to a Question on Support site for LampCMS project


So it turned out that LinkedIn has updated their oauth based authentication/authorization API
It now requires to ask for specific permissions. I am already working on updating our LinkedIN integration script.

The one good news about this is that now LinkedIN shares user's email address with the API client. So basically the popup permission window tells user that the Applications wants to access their profile, get their email address and post to LinkedIN on their behalf. User can agree or decline.

Having email address provided by the API makes it easier to register new user - we no longer need to use the extra step that we used before to ask user for their email address right after the Join with LinkedIN was completed.

Also knowing the email address during the Sign In with Linked IN can help determine if the user with this email address already registered on our site, in which case we will just connect their existing account with their LinkedIN account.

I'm working on having the updates ready. Will probably take about a week to make changes and test them.

Friday, January 25, 2013

My answer to "LinkedIn posts do not work"

This is my answer to a Question on Support site for LampCMS project


Thank you for this update. I will test this fix and if it works will push changes to github

Sunday, January 13, 2013

My answer to "Can't login with ID/PWD and can't change password"

This is my answer to a Question on Support site for LampCMS project


The fixed version has been pushed to github

Saturday, December 8, 2012

How to install MongoDB on CentOS Linux

My Question on Support site for LampCMS project

I just made a short video tutorial on how to install a MongoDB easily from 10gen yum repository

You can watch it here.

YouTube videoPlay

Click here to post your reply