Friday, June 5, 2020

How to start sling with RDBMS

Use case: Start Sling using RDBMS (Mysql, Oracle) as a persistent manager.

Prerequisite: Make sure that you have mysql or oracle install. Here is instruction https://dev.mysql.com/doc/mysql-installation-excerpt/5.7/en/

Currently sling comes out of the box with Tar and Mongo persistent manager but setting up RDBMS instruction is hard to find.

Note that sling underneath has Oak for data persistence and OAK does support different type of RDB persistence that you can get it from here. https://jackrabbit.apache.org/oak/docs/nodestore/document/rdb-document-store.html

Here are steps to set up RDB persistence for sling,


Step 1: Checkout sling project from https://sling.apache.org/downloads.cgi
example
git clone https://github.com/apache/sling-org-apache-sling-starter.git
OR
git clone https://github.com/apache/sling-org-apache-sling-app-cms.git

Step 2: find oak.txt either under src/main/provisioning or builder/src/main/provisioning

Step 3: Add the following lines in oak.txt

[artifacts startLevel=15 runModes=oak_rdb]
mysql/mysql-connector-java/8.0.20
com.h2database/h2-mvstore/1.4.194
org.apache.sling/org.apache.sling.datasource/1.0.4

org.apache.sling.datasource.DataSourceFactory-mysql.config 
url="jdbc:mysql://localhost:3306/slingcms"         
driverClassName="com.mysql.jdbc.Driver"   
username="root"   
password=""   
datasource.name="oak"
validationQuery="show\ tables"
connectionProperties="serverTimezone\=UTC"
Step 4: Find  boot.txt which is under the same folder where oak.txt was and append the following in property sling.run.mode.install.options

sling.run.mode.install.options=oak_tar,oak_mongo,oak_rdb

Step 5: Build project using
mvn clean install

Step 6: Copy stand-alone jar files to the location where you want to run the project (Usually they are under target folder at root or builder directory)

Step 7: Run following command 
java -jar -Dsling.run.modes=oak_rdb <jar file> start
Step 8: To check if right tables are created you can down load any mysql explorer https://www.mysql.com/products/workbench/ and check





18 comments:

  1. Accounting paper writing services are essential and they have become very popular for those seeking accounting coursework writing services since most of them seek Accounting Writing Services.

    ReplyDelete
  2. There are many Online Coursework writing services and Help with Coursework Writing services to choose from for those stuck with their psychology coursework writing services and nursing coursework writing help services.

    ReplyDelete
  3. Thank you very much for writing such an interesting article on this topic. This has really made me think and I hope to read more. @ Packers and Movers Kolkata

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete
  5. Nice image visibility and well written blog. Thanks for sharing. I have recently come across a new online service provider company which provides Shifting Services @ Packers and Movers Kolkata
    Please Contact Us @ ☎ +91 8290173333

    ReplyDelete
  6. With similar advances made in the virtual world of gambling, who wouldn't wish to play for fun? It seems casinos have heard it and thus have enabled the demo mode in their gaming portfolio to cater to the desires of players. Despite such improvisation, a newbie might fail to use the advantages to the best. Thus, the write-up here addresses them all by providing a cue on how to play slots in demo mode. Also, it lists down top five free slots to experiment on.
    www.slotozilla.com/free-slots/book-of-dead

    ReplyDelete
  7. Packers and Movers Gurgaon Provide Reliable, Safe and Certified Service Provider list, Get Free ***Best Price Quotaition and Compare Charges. ???Hassle free Household Shifting Services, High Quality packing Material, Office Relocation, Car Transportaion, ###Local and Domestic Shifting Service @
    Packers And Movers Gurgaon

    ReplyDelete
  8. Get Shifting/Relocation Quotation from ###Packers and Movers Delhi. Packers and Movers Delhi 100% Affordable and Reliable ***Household Shifting Services. Compare Transportation Charges and Save Time, Verified and Trusted Packers and Movers in Delhi, Cheap and Safe Local, Domestic House Shifting @ Packers And Movers Delhi

    ReplyDelete
  9. Packers and Movers Hyderabad Give Certified and Verified Service Providers, Cheap and Best ###Office Relocation Charges, ***Home Shifting, ✔✔✔Goods Insurance worth Rs. 10,000, Assurance for Local and Domestic House Shifting. Safe and Reliable Household Shifting Services in Hyderabad with Reasonable Packers and Movers Price Quotation @ Packers And Movers Hyderabad

    ReplyDelete
  10. Packers and Movers Bangalore as a Services providing company can make all the difference to your ###Home Relocation experience. Bangalore based Company which offers versatile solutions, Right team that easily reduce the stress associated with a ???Household Shifting, ***Vehicle Transportation. we help things run smoothly and reduce breakages and offer you seamless, Affordable, Reliable Shifting Services, Compare Shifting Charges @ Packers And Movers Bangalore

    ReplyDelete
  11. Hi!!!
    Hey Nice Blog, your post is very usefull for us.
    Waiting for a more new post
    Keep on posting!


    web development company
    app development company
    software development company

    ReplyDelete
  12. We are Leading Escorts Service Provider agency in Jaipur. Who offer Diffrent Kind Escorts Services Like, Celebrity, Models, Housewife, Russian Escorts & VIP Call Girls.Contact US To Book any kind Escort girls For Full sexual satisfaction.

    Jaipur Escorts

    ReplyDelete
  13. Give us any subject, any topic or any fact. we will give you Advanced and researched genuine content. Custom essay are difficult any more because we gave subject matter expert team members to write your work. Assignment help

    ReplyDelete
  14. this is really nice and effective blog, i found lots of information in this blog and sites for commenting is best.Very nice I like a lot of these topics...@ Packers and Movers Ahmedabad

    ReplyDelete