Page 1 of 2

Deploy of Admin, and demo error

Posted: Sat Nov 28, 2009 10:42 pm
by shaggydog97
When deploying the Admin webapp after, deploying the demo, or vice versa I recieve this error:

Code: Select all

SEVERE: Exception sending context initialized event to listener instance of class org.broadleafcommerce.extensibility.web.MergeContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'exporter' defined in resource loaded from byte array: Invocation of init method failed; nested exception is org.springframework.jmx.export.UnableToRegisterMBeanException: Unable to register MBean [org.broadleafcommerce.order.service.CartServiceImpl@139f2f4] with key 'blCartService'; nested exception is javax.management.InstanceAlreadyExistsException: org.broadleafcommerce:name=CartService
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
   at java.security.AccessController.doPrivileged(Native Method)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
   at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
   at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
   at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
   at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
   at org.broadleafcommerce.extensibility.web.MergeContextLoader.createWebApplicationContext(MergeContextLoader.java:103)
   at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
   at org.broadleafcommerce.extensibility.web.MergeContextLoaderListener.contextInitialized(MergeContextLoaderListener.java:41)
   at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
   at org.apache.catalina.core.StandardContext.start(StandardContext.java:4338)
   at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
   at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
   at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:830)
   at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:719)
   at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
   at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1217)
   at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293)
   at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
   at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
   at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
   at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
   at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
   at java.lang.Thread.run(Thread.java:636)
Caused by: org.springframework.jmx.export.UnableToRegisterMBeanException: Unable to register MBean [org.broadleafcommerce.order.service.CartServiceImpl@139f2f4] with key 'blCartService'; nested exception is javax.management.InstanceAlreadyExistsException: org.broadleafcommerce:name=CartService
   at org.springframework.jmx.export.MBeanExporter.registerBeanNameOrInstance(MBeanExporter.java:625)
   at org.springframework.jmx.export.MBeanExporter.registerBeans(MBeanExporter.java:541)
   at org.springframework.jmx.export.MBeanExporter.afterPropertiesSet(MBeanExporter.java:428)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
   ... 31 more
Caused by: javax.management.InstanceAlreadyExistsException: org.broadleafcommerce:name=CartService
   at com.sun.jmx.mbeanserver.Repository.addMBean(Repository.java:467)
   at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.internal_addObject(DefaultMBeanServerInterceptor.java:1520)
   at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:986)
   at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:938)
   at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:330)
   at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:516)
   at org.springframework.jmx.support.MBeanRegistrationSupport.doRegister(MBeanRegistrationSupport.java:171)
   at org.springframework.jmx.export.MBeanExporter.registerBeanInstance(MBeanExporter.java:678)
   at org.springframework.jmx.export.MBeanExporter.registerBeanNameOrInstance(MBeanExporter.java:615)
   ... 35 more



I can deploy either the admin or the demo, but not both at the same time in the same tomcat container.

Re: Deploy of Admin, and demo error

Posted: Mon Jan 11, 2010 12:53 pm
by jefffischer
This is the same as defect #72 (http://broadleafcommerce.org/trac/ticket/72), which has been fixed. There was a hardcoded JMX value that was causing problems when 2 or more instances of Broadleaf Commerce were deployed in the same web container. Do you have the latest codebase? You'll need to specify a unique "appName" parameter for each store you want to install inside the same app container (basically, each separate war or ear that is using the Broadleaf Commerce framework). Please review the web.xml from the Broadleaf Commerce demo source so see an example of how this parameter is specified. It is specified as an env-entry element.

Re: Deploy of Admin, and demo error

Posted: Wed Mar 31, 2010 1:25 pm
by jefffischer
It appears this exception resurfaced, but is resolved in the latest development release (and beyond). For now, you can refer to my temporary build instructions in this forum post:

viewtopic.php?f=13&t=42

The permanent build instructions will be finalized in the codebase soon and will be included with the distribution.

Re: Deploy of Admin, and demo error

Posted: Sun Jul 25, 2010 7:26 pm
by junaid.jp
Hi .

I am getting the same Exception that was discussed above .
WEb.xml for Admin
<env-entry>
<env-entry-name>appName</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>broadleafadmin</env-entry-value>
</env-entry>




web.xml for demo .

<env-entry>
<env-entry-name>appName</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>broadleafdemo</env-entry-value>
</env-entry>


The values are different for both of these applications .and I have the latest source code . I cannot seem to deploy both the application in the same container at the same time . Any help in this regard would be highly appreciated

thanks
Junaid Pasha

Re: Deploy of Admin, and demo error

Posted: Sun Jul 25, 2010 10:52 pm
by jefffischer
What container are you trying to deploy to? I'll need the specifics of your steps.

Re: Deploy of Admin, and demo error

Posted: Mon Jul 26, 2010 4:14 pm
by junaid.jp
Jeff .

thank you for your response .

I am using Apache tomcat 6 .

Eclipse WTP for both demo and Admin . No Maven is involved in this process . Since I keep getting artifact missing Exception while trying to run Maven .
And I am not keen on using Maven for the deployment .


thanks
Junaid Pasha

Re: Deploy of Admin, and demo error

Posted: Mon Jul 26, 2010 4:24 pm
by jefffischer
An operational jndi is required to run the demo and admin in the same container - which should be the case with the default installation of Tomcat 6. We're definitely not seeing this problem here with Tomcat in any of our environments. Not sure what's going wrong for you, but I also don't know the specifics of how you're trying to setup the project and bypass maven. We have a tutorial for a WTP-only setup of Eclipse running the demo. Have you taken a look at this already? Please review and compare with your setup and see if there are any glaring differences.

http://www.broadleafcommerce.org/conflu ... ipse+-+WTP

Re: Deploy of Admin, and demo error

Posted: Mon Jul 26, 2010 8:22 pm
by junaid.jp
Jeff ,

Thanks again for the reply .
I followed the same steps as described for demo to run the broadleafdemo application .
For Admin . I installed the Broadleafadmin by creating a new dynamic web project under eclipse and importing the project .

The directory structure for admin application is provided in the attachment below .

If I do change the JNDI . a Separate JNDI name for datasource for a demo and a admin application . The admin application does not start at all.

My admin would work if I just run the admin application but it wont when I try running the demo . and vice versa .

Re: Deploy of Admin, and demo error

Posted: Mon Jul 26, 2010 8:32 pm
by jefffischer
I'll try to follow your steps to reproduce and let you know what I come up with.

Re: Deploy of Admin, and demo error

Posted: Mon Jul 26, 2010 9:05 pm
by junaid.jp
thanks
I'd appreciate it very much .