Page 1 of 1

Broadleaf Admin 3.0 Beta3 integration

Posted: Fri Jun 07, 2013 11:41 am
by vsreddy
Hi All,

In my project want to use Broad leaf 3.0 BETA-3 admin features as maven components.
my application is having customized own admin UI, just want to use the service and dao layer to connect to database.

Could you please suggest steps to proceed smooth flow of integration?


Thanks,
Surender Reddy Vanga

Re: Broadleaf Admin 3.0 Beta3 integration

Posted: Fri Jun 07, 2013 3:09 pm
by phillipuniverse
If you are only planning on using just the services and daos, simply remove broadleaf-admin-module and broadleaf-open-admin-platform from your maven dependencies in your pom.xml but keep the others. Then just do normal dependency injection like you would in the 'site' project.

There might be some other changes you'll need to modify in the admin applicationContext (because you won't have some beans there) but that should be pretty straightforward to remove.

Re: Broadleaf Admin 3.0 Beta3 integration

Posted: Tue Jun 11, 2013 5:47 am
by vsreddy
Hi Phillip,
Thanks for the Reply. After integration with JBOSS 7-FINAL ,i encountered below problems related to the persistence.xml.

15:59:47,313 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.deployment.unit."flypp-estore-restservices-1.0.war".INSTAL
tException in service jboss.deployment.unit."flypp-estore-restservices-1.0.war".INSTALL: Failed to process phase INSTALL of deployment "flypp-estore-restservices-1.0.war"....
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011446: Failed to add persistence unit service for blSecurePU...........
Caused by: org.jboss.msc.service.DuplicateServiceException: Service jboss.persistenceunit."flypp-estore-restservices-1.0.war#blSecurePU" is already registered....
.


Steps followed for integration:
1. added Broadleaf Beta 3 dependencies in to my project POM.xml.
2. created datasources in jobss configuration file (i.e. standalone.xml)
<datasource jta="true" jndi-name="java:/jdbc/web" pool-name="jdbc/web_pool" enabled="true" use-java-context="true" use-ccm="true">
<datasource jta="true" jndi-name="java:/jdbc/secure" pool-name="jdbc/secure_pool" enabled="true" use-java-context="true" use-ccm="true">
<datasource jta="true" jndi-name="java:/jdbc/storage" pool-name="jdbc/storage_pool" enabled="true" use-java-context="true" use-ccm="true">


3.modified [b]applicationContext-datasource.xml with the below information.
<jee:jndi-lookup id="webDS" jndi-name="java:/jdbc/web"/>
<jee:jndi-lookup id="webSecureDS" jndi-name="java:/jdbc/secure"/>
<jee:jndi-lookup id="webStorageDS" jndi-name="java:/jdbc/storage"/>

4. modified applicationContext.xml with the below information.
<bean id="blMergedDataSources" class="org.springframework.beans.factory.config.MapFactoryBean">
<property name="sourceMap">
<map>
<entry key="java:/jdbc/web" value-ref="webDS"/>
<entry key="java:/jdbc/secure" value-ref="webSecureDS"/>
<entry key="java:/jdbc/storage" value-ref="webStorageDS"/>
</map>
</property>
</bean>

5.modified Web.xml <resouce-ref> entry with the below information.

<resource-ref>
<res-ref-name>java:/jdbc/web</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>


6. and changed the Meta-INF/persistence.xml with the below information.
<persistence-unit name="blPU" transaction-type="RESOURCE_LOCAL">
<non-jta-data-source>java:/jdbc/web</non-jta-data-source>
<exclude-unlisted-classes/>
</persistence-unit>

<persistence-unit name="blSecurePU" transaction-type="RESOURCE_LOCAL">
<non-jta-data-source>java:/jdbc/secure</non-jta-data-source>
<exclude-unlisted-classes/>
</persistence-unit>

<persistence-unit name="blCMSStorage" transaction-type="RESOURCE_LOCAL">
<non-jta-data-source>java:/jdbc/storage</non-jta-data-source>
<exclude-unlisted-classes/>
</persistence-unit>


7. When build it I amable to successfully build the war. but when i deploy it on JOBSS 7 am facing the issue.


Please help on this.

Thanks,
Surender Reddy Vanga

Re: Broadleaf Admin 3.0 Beta3 integration

Posted: Wed Jun 12, 2013 1:32 am
by phillipuniverse
All of that looks ok from a Broadleaf perspective. I'm not too familiar with JBOSS, but is it possible that you created the persistence unit in a war-specific configuration (similar to META-INF/context.xml for Tomcat) as well as for the JBOSS container itself?