Page 1 of 3

How obtain stable version?

Posted: Thu May 30, 2013 10:35 am
by Eustace
Hi all.
How to obtain stable version?
I fetched sources from GIT
https://github.com/BroadleafCommerce/Br ... mmerce.git
Is it correct? I found compilation error (class class SandBoxConnection).
I believe I have to use the stable version.

Re: How obtain stable version?

Posted: Thu May 30, 2013 2:23 pm
by jfridye
2.2.0-GA is stable.

In order for us to better help you, can you include the stack trace you are getting?

Re: How obtain stable version?

Posted: Thu May 30, 2013 2:28 pm
by phillipuniverse
You are probably compiling on Java 7, which is why you are getting that compilation error.

As Joseph said, 2.2.0-GA is the latest stable version but it will currently only compile with Java 6. 2.2.1-SNAPSHOT and above (2.3.0-SNAPSHOT and 3.0.0-SNAPSHOT) are all up to date with Java 7. For more info on the specific change, check out this pull request: https://github.com/BroadleafCommerce/Br ... ce/pull/47.

If you are starting a new projet, we highly recommend starting with Broadleaf version 3.0.0, which is currently in its 2nd beta (pom version 3.0.0-BETA2, you could just check out the 3.0.0-BETA2 DemoSite tag which would also get you going at https://github.com/broadleafcommerce/de ... .0.0-BETA2). We recommend version 3.0.0 because we have HEAVILY modified the admin to not rely on GWT and instead be SpringMVC based.

let us know if you have any other questions.

Re: How obtain stable version?

Posted: Fri May 31, 2013 3:06 am
by Eustace
Thank you for answer.
Yes, I use JDK 7.
First time I tried to use the code from github
BroadleafCommerce :
https://github.com/BroadleafCommerce/Br ... mmerce.git
and DemoSite
https://github.com/BroadleafCommerce/DemoSite.git
I built the engine jars (BroadleafCommerce) by maven.
After that I built the demosite by maven and used the jars from first build.
After that I tried to deploy to Tomcat-7 and connect to Postgresql 9.1.
I changed applicationContext-datasource.xml and instead of

Code: Select all

<jee:jndi-lookup id="webDS" jndi-name="jdbc/web"/>

added

Code: Select all

<bean id="webDS" class="com.mchange.v2.c3p0.ComboPooledDataSource"  destroy-method="close">
        <property name="driverClass" value="org.postgresql.Driver"/>
        <property name="jdbcUrl" value="jdbc:postgresql://localhost:5432/broadleaf"/>
        <property name="user" value="sa"/>
        <property name="password" value="sa"/>
    </bean>

Exception appears

Code: Select all

java.sql.SQLTransientConnectionException: java.net.ConnectException: Connection refused: connect
        at org.hsqldb.jdbc.Util.sqlException(Unknown Source)


Why hsqldb still trying to connect? What and where the changes I have to made to use postgresgl?

And in general, please advise
-where I have to take proper source for kernel BroadleafCommerce?
-how to start investigation? Should I use DemoSite and make changes for my purposes?
-from where should I download proper DemoSite?
Thanks in advance?

Re: How obtain stable version?

Posted: Fri May 31, 2013 11:29 am
by Eustace
Any help?

Re: How obtain stable version?

Posted: Fri May 31, 2013 12:46 pm
by phillipuniverse
HSQL is still trying to connect probably because of context.xml in your META-INF directory inside of site. Tomcat will read this context.xml file that we provided in order to set up some JNDI resources. I would recommend changing this context.xml file (which provides the JNDI datasources for the application) rather than removing the JNDI lookup to replace with a datasource definition. If you do not use JNDI lookup and instead hard-code it in your application as you have done, you'll end up running into other problems when you attempt to deploy to a different environment.

If you dont' want to use the context.xml that gets deployed with your war (the one in the META-INF directory) then you could instead copy its contents into tomcat's global context.xml (which is in the conf folder) and then delete that file in your META-INF directory.

Also, in order to fully move to Postgres you'll need to modify your environment.properties file (development.properties in your case I assume). This is in order to tell Hibernate to use the PostgreSQL dialect rather than HSQL (which it is configured for by default). You should be able to find a thread on the forum on how exactly to do that.

Re: How obtain stable version?

Posted: Fri May 31, 2013 12:48 pm
by phillipuniverse
Check out our getting started documentation for how to obtain the correct DemoSite version at http://docs.broadleafcommerce.org/curre ... arted.html. The latest stable version of Broadleaf is 2.2.0-GA.

That being said, we make a callout in the documentation about trying out Broadleaf 3.0 (which is currently in beta 2). For any new projects we HIGHLY recommend using Broadleaf 3.0 as we have changed the entire admin application to remove any dependency on GWT.

Re: How obtain stable version?

Posted: Sat Jun 01, 2013 3:35 pm
by Eustace
Thank you for answer.
Therefore I should not make changes in code from https://github.com/BroadleafCommerce/Br ... mmerce.git.
I should work inside DemoApplication - make changes for my purposes.
But the BroadleafCommerce jars will be downloaed by maven from your repository. Correct?

What about this link http://docs.broadleafcommerce.org/curre ... arted.html
I tried to get the DemoApplication from http://www.broadleafcommerce.org/workspace-download.
I built and uploaded admin.war and site.war. If I tried to upload only admin.war it was ok.
But for second war I received OutOfMemory exception.
The same situation was if I uploaded firstly site.war. The second upload (admin.war) caused the OutOfNMemory exception.
So I could not run them both at once.

Re: How obtain stable version?

Posted: Sat Jun 01, 2013 4:08 pm
by Eustace
I downloaded DemoSite from
http://www.broadleafcommerce.org/worksp ... ersion=dev
I made changes for datasource as you suggested.
I built it my maven (install of ecomerce parent project).
The build was completed. I uploaded mycompany.war to Tomcat-7.0.34
Exceptions occured.
For example

Code: Select all

[ERROR] 23:46:58 SchemaExport - HHH000231: Schema export unsuccessful
org.hibernate.tool.hbm2ddl.ImportScriptException: Error during statement execution (file: '/sql/load_catalog_data.sql'): INSERT INTO BLC_FIE
LD (FIELD_ID, ENTITY_TYPE, PROPERTY_NAME, ABBREVIATION, SEARCHABLE, FACET_FIELD_TYPE) VALUES (1, 'PRODUCT', 'manufacturer', 'mfg', 1, 's')


But http://localhost:8080/mycompany/ works.

After that I tried to deploy admin.war to the same Tomcat-7.0.34. I believe mycompany.war and admin.war should to be launcged simultaneously, correct?

Exception occured:

Code: Select all

[ERROR] 23:49:00 ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'blConfiguration' defined in resource loaded from byt
e array: Invocation of init method failed; nested exception is java.lang.OutOfMemoryError: PermGen space
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.ja
va:1488)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java
:524)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:4
................
SEVERE: Error waiting for multi-thread deployment of WAR files to complete
java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: PermGen space
        at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:252)
        at java.util.concurrent.FutureTask.get(FutureTask.java:111)
        at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:766)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:477)


The datasource is th same for mycompany.war and for admin.war.
What did I do incorrect?

Re: How obtain stable version?

Posted: Sat Jun 01, 2013 4:20 pm
by Eustace
I deployed admin.war before mycompany.war. "http://localhost:8080/admin" works properly.
After that I deployed mycompany.war. Exception occured:

Code: Select all

[ERROR] 00:05:45 ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in resource loaded fro
m byte array: Invocation of init method failed; nested exception is java.lang.OutOfMemoryError: PermGen space
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.ja
va:1488)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java
:524)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:4
61)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)


In general I cannot understand: admin.war and mycompany.war uses the same database (and they have the same jndi names).
During deploy the admin war creates tables. But the mycompany.war during deploy should create the tables in the same database. I believe it's incorrect. Plese suggest what settings should be done.
Thanks in advance.