Question

I am following the http://docs.broadleafcommerce.org/current/Getting-Started.html and all the steps were successfully completed, and i also migrated to MySQL database as well, and configured mysite with jrebel successfully.

Now after i start my site & admin projects, i start playing with the framework by adding few more product under demo site only, and the newly created product is added successfully to my site, but every time i re-start my demo site, the products goes back to the default in the original state, i mean the product which i have added to this table "broadleaf.blc_product" is gone after restart, so how do I keep the changes in database?

I did these changes in my development.properties

blPU.hibernate.hbm2ddl.auto=create-update
blPU.hibernate.hbm2ddl.import_files=/sql/load_admin_security.sql,\
/sql/load_admin_users.sql,\
/sql/load_code_tables.sql,\
/sql/load_table_sequences.sql,\
/sql/load_catalog_data.sql,\
/sql/load_content_structure.sql,\
/sql/load_content_data.sql

blCMSStorage.hibernate.hbm2ddl.auto=create-update
blCMSStorage.hibernate.hbm2ddl.import_files=/sql/import_storage.sql

after this changes my demo site page has stop working. it is giving me an error when I trying to open my site on web browser:-

HTTP ERROR 404

Problem accessing /. Reason:

Not Found

Can you please let me know where did I had made a mistake.

Thanks in advance

Regards,

Ankit Patni

Was it helpful?

Solution

Take your project environment to tomcat server .. by deploying the .war file of ur demosite in tomcat webapp folder.

once you have delpoyed the full demosite in your tomcat server after starting the tomcat services make one change in development.properties in below blPU.hibernate.hbm2ddl.auto=create-drop

to blPU.hibernate.hbm2ddl.auto=update.

This will work for you..

OTHER TIPS

Go to development-shared properties of demo site

blPU.hibernate.hbm2ddl.auto=update
blCMSStorage.hibernate.hbm2ddl.auto=update
blSecurePU.hibernate.hbm2ddl.auto=update

make the changes as given above and Run As--> Maven install and start the jetty server

hope this works

I am posting my findings and a method to achieve this,

First of all we need to keep in mind three files for this. a. common-shared.properties b. development-shared.properties c. development.properties

Step1: start the app, let the app create the database and load all the data. Step2: Stop the database server. Step3: Stop the application server. Step4: Changes in the properties file mentioned above.

a. set following values.
    blPU.hibernate.hbm2ddl.auto=none
    blCMSStorage.hibernate.hbm2ddl.auto=none
    blSecurePU.hibernate.hbm2ddl.auto=none
    and comment out the following line :

    blPU.hibernate.hbm2ddl.import_files=/config/bc/sql/load_admin_permissions.sql,\
                                /config/bc/sql/load_admin_roles.sql,\
                                /config/bc/sql/load_admin_menu.sql,\
                                /config/bc/sql/load_menu_admin_security.sql,\
                                /sql/load_admin_users.sql,\
                                /sql/load_code_tables.sql,\
                                /sql/load_i18n_countries.sql,\
                                /sql/load_table_sequences.sql,\
                                /sql/load_content_structure.sql,\
                                /sql/load_catalog_data.sql,\
                                /sql/load_content_data.sql,\
                                /sql/load_content_structure_i18n.sql,\
                                /sql/load_content_data_i18n.sql,\
                                /sql/load_catalog_i18n_data_FR.sql,\
                                /sql/load_catalog_i18n_data_ES.sql,\
                                /sql/load_sitemap_data.sql,\
                                /sql/load_menu_data.sql

b.  Set the following properties to "none"
    blPU.hibernate.hbm2ddl.auto=none
    blCMSStorage.hibernate.hbm2ddl.auto=none
    blSecurePU.hibernate.hbm2ddl.auto=none

c. Set the only property in development.properties to "none"
    blPU.hibernate.hbm2ddl.auto=none

Step 5: Restart the DB server.

Step 6: Redeploy the application.

and Boom .... you have done it.. :) :) :) :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top