问:
Failure when processing annotations for application.The error is Conflict found while merging web fragment
I am having an application which works fine with version prior to
WebLogic-12.2.1.2 but once I upgrade to WebLogic 12.2.1.2 It throws the following exception.

```<Error> <HTTP> <BEA-101371> <There was a failure when processing annotations for application. Ensure that the annotations are valid. The error is Conflict found while merging web fragment, weblogic.j2ee.descriptor.WebFragmentBeanImpl@7740fbd5() : Version>
<Aug 28, 2017, 3:49:13,275 PM IST> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID "881239794681866" for task "3" on [partition-name: DOMAIN]. Error is: "weblogic.application.ModuleException: weblogic.servlet.internal.fragment.MergeException: Conflict found while merging web fragment, weblogic.j2ee.descriptor.WebFragmentBeanImpl@7740fbd5() : Version"
weblogic.application.ModuleException: weblogic.servlet.internal.fragment.MergeException: Conflict found while merging web fragment, weblogic.j2ee.descriptor.WebFragmentBeanImpl@7740fbd5() : Version
at weblogic.application.internal.ExtensibleModuleWrapper.prepare(ExtensibleModuleWrapper.java:114)
at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:100)
at weblogic.application.internal.flow.ModuleStateDriver$1.next(ModuleStateDriver.java:192)
at weblogic.application.internal.flow.ModuleStateDriver$1.next(ModuleStateDriver.java:187)
at weblogic.application.utils.StateMachineDriver$ParallelChange.run(StateMachineDriver.java:83)
Truncated. see log file for complete stacktrace
Caused By: weblogic.servlet.internal.fragment.MergeException: Conflict found while merging web fragment, weblogic.j2ee.descriptor.WebFragmentBeanImpl@7740fbd5() : Version
at weblogic.servlet.internal.fragment.GeneralRuleMerger.handleChangeEvent(GeneralRuleMerger.java:58)
at weblogic.servlet.internal.fragment.AbstractMerger.merge(AbstractMerger.java:15)
at weblogic.servlet.internal.fragment.WebFragmentMergeDispatcher.merge(WebFragmentMergeDispatcher.java:61)
at weblogic.servlet.internal.fragment.WebFragmentManager.mergeFragment(WebFragmentManager.java:245)
at weblogic.servlet.internal.AnnotationProcessingManager.processAnnotations(AnnotationProcessingManager.java:122)
Truncated. see log file for complete stacktrace
>
<Aug 28, 2017, 3:49:13,296 PM IST> <Warning> <Deployer> <BEA-149004> <Failures were detected while initiating deploy task for application "***".>
<Aug 28, 2017, 3:49:13,296 PM IST> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004
weblogic.application.ModuleException: weblogic.servlet.internal.fragment.MergeException: Conflict found while merging web fragment, weblogic.j2ee.descriptor.WebFragmentBeanImpl@7740fbd5() : Version
at weblogic.application.internal.ExtensibleModuleWrapper.prepare(ExtensibleModuleWrapper.java:114)
at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:100)
at weblogic.application.internal.flow.ModuleStateDriver$1.next(ModuleStateDriver.java:192)
at weblogic.application.internal.flow.ModuleStateDriver$1.next(ModuleStateDriver.java:187)
at weblogic.application.utils.StateMachineDriver$ParallelChange.run(StateMachineDriver.java:83)
Truncated. see log file for complete stacktrace
Caused By: weblogic.servlet.internal.fragment.MergeException: Conflict found while merging web fragment, weblogic.j2ee.descriptor.WebFragmentBeanImpl@7740fbd5() : Version
at weblogic.servlet.internal.fragment.GeneralRuleMerger.handleChangeEvent(GeneralRuleMerger.java:58)
at weblogic.servlet.internal.fragment.AbstractMerger.merge(AbstractMerger.java:15)
at weblogic.servlet.internal.fragment.WebFragmentMergeDispatcher.merge(WebFragmentMergeDispatcher.java:61)
at weblogic.servlet.internal.fragment.WebFragmentManager.mergeFragment(WebFragmentManager.java:245)
at weblogic.servlet.internal.AnnotationProcessingManager.processAnnotations(AnnotationProcessingManager.java:122)
Truncated. see log file for complete stacktrace
>
<Aug 28, 2017, 3:49:13,309 PM IST> <Error> <Console> <BEA-240003> <Administration Console encountered the following error: weblogic.application.ModuleException: weblogic.servlet.internal.fragment.MergeException: Conflict found while merging web fragment, weblogic.j2ee.descriptor.WebFragmentBeanImpl@7740fbd5() : Version
at weblogic.application.internal.ExtensibleModuleWrapper.prepare(ExtensibleModuleWrapper.java:114)
at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:100)
at weblogic.application.internal.flow.ModuleStateDriver$1.next(ModuleStateDriver.java:192)
at weblogic.application.internal.flow.ModuleStateDriver$1.next(ModuleStateDriver.java:187)
at weblogic.application.utils.StateMachineDriver$ParallelChange.run(StateMachineDriver.java:83)
at weblogic.application.utils.StateMachineDriver.nextStateInParallel(StateMachineDriver.java:144)
at weblogic.application.internal.flow.ModuleStateDriver.parallelPrepare(ModuleStateDriver.java:46)
at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:75)
at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:55)
at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:727)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:239)
at weblogic.application.internal.SingleModuleDeployment.prepare(SingleModuleDeployment.java:52)
at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:158)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:65)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:229)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:103)
at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:241)
at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:794)
at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1340)
at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:267)
at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:177)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:186)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:14)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:47)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:666)
at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:348)
at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:333)
at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:54)
at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:640)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:406)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:346)
Caused by: weblogic.servlet.internal.fragment.MergeException: Conflict found while merging web fragment, weblogic.j2ee.descriptor.WebFragmentBeanImpl@7740fbd5() : Version
at weblogic.servlet.internal.fragment.GeneralRuleMerger.handleChangeEvent(GeneralRuleMerger.java:58)
at weblogic.servlet.internal.fragment.AbstractMerger.merge(AbstractMerger.java:15)
at weblogic.servlet.internal.fragment.WebFragmentMergeDispatcher.merge(WebFragmentMergeDispatcher.java:61)
at weblogic.servlet.internal.fragment.WebFragmentManager.mergeFragment(WebFragmentManager.java:245)
at weblogic.servlet.internal.AnnotationProcessingManager.processAnnotations(AnnotationProcessingManager.java:122)
at weblogic.servlet.internal.AnnotationProcessingManager.processAnnotations(AnnotationProcessingManager.java:105)
at weblogic.servlet.internal.WebAppModule.processAnnotations(WebAppModule.java:1975)
at weblogic.servlet.internal.WebAppModule.processAnnotations(WebAppModule.java:1937)
at weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:800)
at weblogic.application.internal.ExtensibleModuleWrapper$PrepareStateChange.next(ExtensibleModuleWrapper.java:295)
at weblogic.application.internal.ExtensibleModuleWrapper$PrepareStateChange.next(ExtensibleModuleWrapper.java:285)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
at weblogic.application.internal.ExtensibleModuleWrapper.prepare(ExtensibleModuleWrapper.java:109)
>
<Aug 28, 2017, 3:49:13,475 PM IST> <Warning> <Munger> <BEA-2156203>
<Aug 28, 2017, 3:49:13,617 PM IST> <Error> <J2EE> <BEA-160228> <AppMerge failed to merge your application. If you are running AppMerge on the command-line, merge again with the -verbose option for more details. See the error message(s) below.>
weblogic.utils.compiler.ToolFailureException: Conflict found while merging web fragment, weblogic.j2ee.descriptor.WebFragmentBeanImpl@7b55af1f() : Version
at weblogic.servlet.tools.WARModule.processAnnotations(WARModule.java:504)
at weblogic.servlet.tools.WARModule.processAnnotations(WARModule.java:589)
at weblogic.servlet.tools.WARModule.merge(WARModule.java:537)
at weblogic.application.compiler.ToolsModuleWrapper.merge(ToolsModuleWrapper.java:96)
at weblogic.application.utils.CustomModuleManager.merge(CustomModuleManager.java:78)
at weblogic.application.compiler.flow.SingleModuleMergeFlow.proecessModule(SingleModuleMergeFlow.java:27)
at weblogic.application.compiler.flow.SingleModuleFlow.compile(SingleModuleFlow.java:64)
at weblogic.application.compiler.FlowDriver$FlowStateChange.next(FlowDriver.java:70)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:37)
at weblogic.application.compiler.BaseMerger.merge(BaseMerger.java:20)
at weblogic.application.compiler.flow.AppMergerFlow.mergeInput(AppMergerFlow.java:75)
at weblogic.application.compiler.flow.AppMergerFlow.compile(AppMergerFlow.java:40)
at weblogic.application.compiler.FlowDriver$FlowStateChange.next(FlowDriver.java:70)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:37)
at weblogic.application.compiler.AppMerge.runBody(AppMerge.java:146)
at weblogic.utils.compiler.Tool.run(Tool.java:159)
at weblogic.utils.compiler.Tool.run(Tool.java:116)
at weblogic.application.compiler.AppMerge.merge(AppMerge.java:158)
at weblogic.deploy.api.internal.utils.AppMerger.merge(AppMerger.java:94)
at weblogic.deploy.api.internal.utils.AppMerger.getMergedApp(AppMerger.java:58)
at weblogic.deploy.api.model.internal.WebLogicDeployableObjectFactoryImpl.createDeployableObject(WebLogicDeployableObjectFactoryImpl.java:186)
at weblogic.deploy.api.model.internal.WebLogicDeployableObjectFactoryImpl.createDeployableObject(WebLogicDeployableObjectFactoryImpl.java:167)
at weblogic.deploy.api.tools.SessionHelper.initialize(SessionHelper.java:847)
at weblogic.deploy.api.tools.SessionHelper.initializeConfiguration(SessionHelper.java:668)
at weblogic.deploy.api.tools.SessionHelper.initializeConfiguration(SessionHelper.java:656)
at weblogic.deploy.api.tools.SessionHelper.initializeConfiguration(SessionHelper.java:739)
at com.bea.console.utils.DeploymentConfigurationHelper$1.execute(DeploymentConfigurationHelper.java:860)
at com.bea.console.utils.DeploymentUtils.runDeploymentAction(DeploymentUtils.java:5646)
at com.bea.console.utils.DeploymentConfigurationHelper.initDeploymentConfiguration(DeploymentConfigurationHelper.java:848)
at com.bea.console.utils.DeploymentConfigurationHelper.completeInitialization(DeploymentConfigurationHelper.java:444)
at com.bea.console.utils.DeploymentConfigurationManager.getDeploymentConfiguration(DeploymentConfigurationManager.java:151)
at com.bea.console.utils.DeploymentConfigurationManager.getDeploymentConfiguration(DeploymentConfigurationManager.java:104)
at com.bea.console.utils.DeploymentConfigurationManager.getDeploymentConfiguration(DeploymentConfigurationManager.java:65)
at com.bea.console.utils.PersistenceUtils.getPersistenceUnitNames(PersistenceUtils.java:76)
at com.bea.console.utils.PersistenceUtils.hasPersistenceUnits(PersistenceUtils.java:52)
at com.bea.console.utils.AppDeploymentBackingFile.preRender(AppDeploymentBackingFile.java:131)
at com.bea.netuix.servlets.controls.Backable$Impl.preRender(Backable.java:191)
at com.bea.netuix.servlets.controls.AdministeredBackableControl.preRender(AdministeredBackableControl.java:104)
at com.bea.netuix.servlets.controls.window.Window.preRender(Window.java:445)
at com.bea.netuix.servlets.controls.page.Page.preRender(Page.java:239)
at com.bea.netuix.nf.ControlLifecycle$6.visit(ControlLifecycle.java:428)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:727)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walk(ControlTreeWalker.java:146)
at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:399)
at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:361)
at com.bea.netuix.nf.Lifecycle.runOutbound(Lifecycle.java:208)
at com.bea.netuix.nf.Lifecycle.run(Lifecycle.java:162)
at com.bea.netuix.servlets.manager.UIServlet.runLifecycle(UIServlet.java:465)
at com.bea.netuix.servlets.manager.UIServlet.doPost(UIServlet.java:291)
at com.bea.netuix.servlets.manager.UIServlet.doGet(UIServlet.java:231)
at com.bea.netuix.servlets.manager.UIServlet.service(UIServlet.java:216)
at com.bea.netuix.servlets.manager.SingleFileServlet.service(SingleFileServlet.java:275)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at com.bea.console.utils.MBeanUtilsInitSingleFileServlet.service(MBeanUtilsInitSingleFileServlet.java:64)
at weblogic.servlet.AsyncInitServlet.service(AsyncInitServlet.java:125)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:286)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:260)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:137)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:350)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:25)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
at com.bea.console.internal.ParamFilter.doFilter(ParamFilter.java:38)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:32)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3683)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3649)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:326)
at weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197)
at weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)
at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71)
at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2433)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2281)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2259)
at weblogic.servlet.internal.ServletRequestImpl.runInternal(ServletRequestImpl.java:1691)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1651)
at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:270)
at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:348)
at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:333)
at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:54)
at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:640)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:406)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:346)
<Aug 28, 2017, 3:49:13,621 PM IST> <Error> <Console> <BEA-240003> <Administration Console encountered the following error: java.io.IOException: Conflict found while merging web fragment, weblogic.j2ee.descriptor.WebFragmentBeanImpl@7b55af1f() : Version
at weblogic.deploy.api.internal.utils.AppMerger.getMergedApp(AppMerger.java:65)
at weblogic.deploy.api.model.internal.WebLogicDeployableObjectFactoryImpl.createDeployableObject(WebLogicDeployableObjectFactoryImpl.java:186)
at weblogic.deploy.api.model.internal.WebLogicDeployableObjectFactoryImpl.createDeployableObject(WebLogicDeployableObjectFactoryImpl.java:167)
at weblogic.deploy.api.tools.SessionHelper.initialize(SessionHelper.java:847)
at weblogic.deploy.api.tools.SessionHelper.initializeConfiguration(SessionHelper.java:668)
at weblogic.deploy.api.tools.SessionHelper.initializeConfiguration(SessionHelper.java:656)
at weblogic.deploy.api.tools.SessionHelper.initializeConfiguration(SessionHelper.java:739)
at com.bea.console.utils.DeploymentConfigurationHelper$1.execute(DeploymentConfigurationHelper.java:860)
at com.bea.console.utils.DeploymentUtils.runDeploymentAction(DeploymentUtils.java:5646)
at com.bea.console.utils.DeploymentConfigurationHelper.initDeploymentConfiguration(DeploymentConfigurationHelper.java:848)
at com.bea.console.utils.DeploymentConfigurationHelper.completeInitialization(DeploymentConfigurationHelper.java:444)
at com.bea.console.utils.DeploymentConfigurationManager.getDeploymentConfiguration(DeploymentConfigurationManager.java:151)
at com.bea.console.utils.DeploymentConfigurationManager.getDeploymentConfiguration(DeploymentConfigurationManager.java:104)
at com.bea.console.utils.DeploymentConfigurationManager.getDeploymentConfiguration(DeploymentConfigurationManager.java:65)
at com.bea.console.utils.PersistenceUtils.getPersistenceUnitNames(PersistenceUtils.java:76)
at com.bea.console.utils.PersistenceUtils.hasPersistenceUnits(PersistenceUtils.java:52)
at com.bea.console.utils.AppDeploymentBackingFile.preRender(AppDeploymentBackingFile.java:131)
at com.bea.netuix.servlets.controls.Backable$Impl.preRender(Backable.java:191)
at com.bea.netuix.servlets.controls.AdministeredBackableControl.preRender(AdministeredBackableControl.java:104)
at com.bea.netuix.servlets.controls.window.Window.preRender(Window.java:445)
at com.bea.netuix.servlets.controls.page.Page.preRender(Page.java:239)
at com.bea.netuix.nf.ControlLifecycle$6.visit(ControlLifecycle.java:428)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:727)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walk(ControlTreeWalker.java:146)
at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:399)
at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:361)
at com.bea.netuix.nf.Lifecycle.runOutbound(Lifecycle.java:208)
at com.bea.netuix.nf.Lifecycle.run(Lifecycle.java:162)
at com.bea.netuix.servlets.manager.UIServlet.runLifecycle(UIServlet.java:465)
at com.bea.netuix.servlets.manager.UIServlet.doPost(UIServlet.java:291)
at com.bea.netuix.servlets.manager.UIServlet.doGet(UIServlet.java:231)
at com.bea.netuix.servlets.manager.UIServlet.service(UIServlet.java:216)
at com.bea.netuix.servlets.manager.SingleFileServlet.service(SingleFileServlet.java:275)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at com.bea.console.utils.MBeanUtilsInitSingleFileServlet.service(MBeanUtilsInitSingleFileServlet.java:64)
at weblogic.servlet.AsyncInitServlet.service(AsyncInitServlet.java:125)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:286)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:260)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:137)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:350)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:25)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
at com.bea.console.internal.ParamFilter.doFilter(ParamFilter.java:38)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:32)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3683)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3649)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:326)
at weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197)
at weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)
at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71)
at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2433)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2281)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2259)
at weblogic.servlet.internal.ServletRequestImpl.runInternal(ServletRequestImpl.java:1691)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1651)
at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:270)
at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:348)
at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:333)
at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:54)
at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:640)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:406)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:346)
Caused by: weblogic.utils.compiler.ToolFailureException: Conflict found while merging web fragment, weblogic.j2ee.descriptor.WebFragmentBeanImpl@7b55af1f() : Version
at weblogic.servlet.tools.WARModule.processAnnotations(WARModule.java:504)
at weblogic.servlet.tools.WARModule.processAnnotations(WARModule.java:589)
at weblogic.servlet.tools.WARModule.merge(WARModule.java:537)
at weblogic.application.compiler.ToolsModuleWrapper.merge(ToolsModuleWrapper.java:96)
at weblogic.application.utils.CustomModuleManager.merge(CustomModuleManager.java:78)
at weblogic.application.compiler.flow.SingleModuleMergeFlow.proecessModule(SingleModuleMergeFlow.java:27)
at weblogic.application.compiler.flow.SingleModuleFlow.compile(SingleModuleFlow.java:64)
at weblogic.application.compiler.FlowDriver$FlowStateChange.next(FlowDriver.java:70)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:37)
at weblogic.application.compiler.BaseMerger.merge(BaseMerger.java:20)
at weblogic.application.compiler.flow.AppMergerFlow.mergeInput(AppMergerFlow.java:75)
at weblogic.application.compiler.flow.AppMergerFlow.compile(AppMergerFlow.java:40)
at weblogic.application.compiler.FlowDriver$FlowStateChange.next(FlowDriver.java:70)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:37)
at weblogic.application.compiler.AppMerge.runBody(AppMerge.java:146)
at weblogic.utils.compiler.Tool.run(Tool.java:159)
at weblogic.utils.compiler.Tool.run(Tool.java:116)
at weblogic.application.compiler.AppMerge.merge(AppMerge.java:158)
at weblogic.deploy.api.internal.utils.AppMerger.merge(AppMerger.java:94)
at weblogic.deploy.api.internal.utils.AppMerger.getMergedApp(AppMerger.java:58)
... 78 more
>
```

I actually include a project in my application which uses servlet-api 3.0(to use some functionality of Async servlet) and I am using servlet-api 2.4 in my application. Also the application doesn't have any web-fragment concept.
Can there be any conflicts because of this? Any help would be much appreciated.

答: Weblogic 12c onwards, the jars are scanned for presence of web fragments and then merged with the application's web.xml.If your application web.xml or other jars web-fragment.xml have diferent DTD version then this issue will come.Need to make all DTD version quals.</p>

Body:
I am having an application which works fine with version prior to
WebLogic-12.2.1.2 but once I upgrade to WebLogic 12.2.1.2 It throws the following exception.

<Error> <HTTP> <BEA-101371> <There was a failure when processing annotations for application. Ensure that the annotations are valid. The error is Conflict found while merging web fragment, weblogic.j2ee.descriptor.WebFragmentBeanImpl@7740fbd5() : Version>
<Aug 28, 2017, 3:49:13,275 PM IST> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID "881239794681866" for task "3" on [partition-name: DOMAIN]. Error is: "weblogic.application.ModuleException: weblogic.servlet.internal.fragment.MergeException: Conflict found while merging web fragment, weblogic.j2ee.descriptor.WebFragmentBeanImpl@7740fbd5() : Version"
weblogic.application.ModuleException: weblogic.servlet.internal.fragment.MergeException: Conflict found while merging web fragment, weblogic.j2ee.descriptor.WebFragmentBeanImpl@7740fbd5() : Version
at weblogic.application.internal.ExtensibleModuleWrapper.prepare(ExtensibleModuleWrapper.java:114)
at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:100)
at weblogic.application.internal.flow.ModuleStateDriver$1.next(ModuleStateDriver.java:192)
at weblogic.application.internal.flow.ModuleStateDriver$1.next(ModuleStateDriver.java:187)
at weblogic.application.utils.StateMachineDriver$ParallelChange.run(StateMachineDriver.java:83)
Truncated. see log file for complete stacktrace
Caused By: weblogic.servlet.internal.fragment.MergeException: Conflict found while merging web fragment, weblogic.j2ee.descriptor.WebFragmentBeanImpl@7740fbd5() : Version
at weblogic.servlet.internal.fragment.GeneralRuleMerger.handleChangeEvent(GeneralRuleMerger.java:58)
at weblogic.servlet.internal.fragment.AbstractMerger.merge(AbstractMerger.java:15)
at weblogic.servlet.internal.fragment.WebFragmentMergeDispatcher.merge(WebFragmentMergeDispatcher.java:61)
at weblogic.servlet.internal.fragment.WebFragmentManager.mergeFragment(WebFragmentManager.java:245)
at weblogic.servlet.internal.AnnotationProcessingManager.processAnnotations(AnnotationProcessingManager.java:122)
Truncated. see log file for complete stacktrace
>
<Aug 28, 2017, 3:49:13,296 PM IST> <Warning> <Deployer> <BEA-149004> <Failures were detected while initiating deploy task for application "***".>
<Aug 28, 2017, 3:49:13,296 PM IST> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004
weblogic.application.ModuleException: weblogic.servlet.internal.fragment.MergeException: Conflict found while merging web fragment, weblogic.j2ee.descriptor.WebFragmentBeanImpl@7740fbd5() : Version
at weblogic.application.internal.ExtensibleModuleWrapper.prepare(ExtensibleModuleWrapper.java:114)
at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:100)
at weblogic.application.internal.flow.ModuleStateDriver$1.next(ModuleStateDriver.java:192)
at weblogic.application.internal.flow.ModuleStateDriver$1.next(ModuleStateDriver.java:187)
at weblogic.application.utils.StateMachineDriver$ParallelChange.run(StateMachineDriver.java:83)
Truncated. see log file for complete stacktrace
Caused By: weblogic.servlet.internal.fragment.MergeException: Conflict found while merging web fragment, weblogic.j2ee.descriptor.WebFragmentBeanImpl@7740fbd5() : Version
at weblogic.servlet.internal.fragment.GeneralRuleMerger.handleChangeEvent(GeneralRuleMerger.java:58)
at weblogic.servlet.internal.fragment.AbstractMerger.merge(AbstractMerger.java:15)
at weblogic.servlet.internal.fragment.WebFragmentMergeDispatcher.merge(WebFragmentMergeDispatcher.java:61)
at weblogic.servlet.internal.fragment.WebFragmentManager.mergeFragment(WebFragmentManager.java:245)
at weblogic.servlet.internal.AnnotationProcessingManager.processAnnotations(AnnotationProcessingManager.java:122)
Truncated. see log file for complete stacktrace
>
<Aug 28, 2017, 3:49:13,309 PM IST> <Error> <Console> <BEA-240003> <Administration Console encountered the following error: weblogic.application.ModuleException: weblogic.servlet.internal.fragment.MergeException: Conflict found while merging web fragment, weblogic.j2ee.descriptor.WebFragmentBeanImpl@7740fbd5() : Version
at weblogic.application.internal.ExtensibleModuleWrapper.prepare(ExtensibleModuleWrapper.java:114)
at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:100)
at weblogic.application.internal.flow.ModuleStateDriver$1.next(ModuleStateDriver.java:192)
at weblogic.application.internal.flow.ModuleStateDriver$1.next(ModuleStateDriver.java:187)
at weblogic.application.utils.StateMachineDriver$ParallelChange.run(StateMachineDriver.java:83)
at weblogic.application.utils.StateMachineDriver.nextStateInParallel(StateMachineDriver.java:144)
at weblogic.application.internal.flow.ModuleStateDriver.parallelPrepare(ModuleStateDriver.java:46)
at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:75)
at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:55)
at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:727)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:239)
at weblogic.application.internal.SingleModuleDeployment.prepare(SingleModuleDeployment.java:52)
at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:158)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:65)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:229)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:103)
at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:241)
at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:794)
at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1340)
at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:267)
at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:177)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:186)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:14)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:47)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:666)
at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:348)
at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:333)
at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:54)
at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:640)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:406)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:346)
Caused by: weblogic.servlet.internal.fragment.MergeException: Conflict found while merging web fragment, weblogic.j2ee.descriptor.WebFragmentBeanImpl@7740fbd5() : Version
at weblogic.servlet.internal.fragment.GeneralRuleMerger.handleChangeEvent(GeneralRuleMerger.java:58)
at weblogic.servlet.internal.fragment.AbstractMerger.merge(AbstractMerger.java:15)
at weblogic.servlet.internal.fragment.WebFragmentMergeDispatcher.merge(WebFragmentMergeDispatcher.java:61)
at weblogic.servlet.internal.fragment.WebFragmentManager.mergeFragment(WebFragmentManager.java:245)
at weblogic.servlet.internal.AnnotationProcessingManager.processAnnotations(AnnotationProcessingManager.java:122)
at weblogic.servlet.internal.AnnotationProcessingManager.processAnnotations(AnnotationProcessingManager.java:105)
at weblogic.servlet.internal.WebAppModule.processAnnotations(WebAppModule.java:1975)
at weblogic.servlet.internal.WebAppModule.processAnnotations(WebAppModule.java:1937)
at weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:800)
at weblogic.application.internal.ExtensibleModuleWrapper$PrepareStateChange.next(ExtensibleModuleWrapper.java:295)
at weblogic.application.internal.ExtensibleModuleWrapper$PrepareStateChange.next(ExtensibleModuleWrapper.java:285)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
at weblogic.application.internal.ExtensibleModuleWrapper.prepare(ExtensibleModuleWrapper.java:109)
>
<Aug 28, 2017, 3:49:13,475 PM IST> <Warning> <Munger> <BEA-2156203>
<Aug 28, 2017, 3:49:13,617 PM IST> <Error> <J2EE> <BEA-160228> <AppMerge failed to merge your application. If you are running AppMerge on the command-line, merge again with the -verbose option for more details. See the error message(s) below.>
weblogic.utils.compiler.ToolFailureException: Conflict found while merging web fragment, weblogic.j2ee.descriptor.WebFragmentBeanImpl@7b55af1f() : Version
at weblogic.servlet.tools.WARModule.processAnnotations(WARModule.java:504)
at weblogic.servlet.tools.WARModule.processAnnotations(WARModule.java:589)
at weblogic.servlet.tools.WARModule.merge(WARModule.java:537)
at weblogic.application.compiler.ToolsModuleWrapper.merge(ToolsModuleWrapper.java:96)
at weblogic.application.utils.CustomModuleManager.merge(CustomModuleManager.java:78)
at weblogic.application.compiler.flow.SingleModuleMergeFlow.proecessModule(SingleModuleMergeFlow.java:27)
at weblogic.application.compiler.flow.SingleModuleFlow.compile(SingleModuleFlow.java:64)
at weblogic.application.compiler.FlowDriver$FlowStateChange.next(FlowDriver.java:70)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:37)
at weblogic.application.compiler.BaseMerger.merge(BaseMerger.java:20)
at weblogic.application.compiler.flow.AppMergerFlow.mergeInput(AppMergerFlow.java:75)
at weblogic.application.compiler.flow.AppMergerFlow.compile(AppMergerFlow.java:40)
at weblogic.application.compiler.FlowDriver$FlowStateChange.next(FlowDriver.java:70)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:37)
at weblogic.application.compiler.AppMerge.runBody(AppMerge.java:146)
at weblogic.utils.compiler.Tool.run(Tool.java:159)
at weblogic.utils.compiler.Tool.run(Tool.java:116)
at weblogic.application.compiler.AppMerge.merge(AppMerge.java:158)
at weblogic.deploy.api.internal.utils.AppMerger.merge(AppMerger.java:94)
at weblogic.deploy.api.internal.utils.AppMerger.getMergedApp(AppMerger.java:58)
at weblogic.deploy.api.model.internal.WebLogicDeployableObjectFactoryImpl.createDeployableObject(WebLogicDeployableObjectFactoryImpl.java:186)
at weblogic.deploy.api.model.internal.WebLogicDeployableObjectFactoryImpl.createDeployableObject(WebLogicDeployableObjectFactoryImpl.java:167)
at weblogic.deploy.api.tools.SessionHelper.initialize(SessionHelper.java:847)
at weblogic.deploy.api.tools.SessionHelper.initializeConfiguration(SessionHelper.java:668)
at weblogic.deploy.api.tools.SessionHelper.initializeConfiguration(SessionHelper.java:656)
at weblogic.deploy.api.tools.SessionHelper.initializeConfiguration(SessionHelper.java:739)
at com.bea.console.utils.DeploymentConfigurationHelper$1.execute(DeploymentConfigurationHelper.java:860)
at com.bea.console.utils.DeploymentUtils.runDeploymentAction(DeploymentUtils.java:5646)
at com.bea.console.utils.DeploymentConfigurationHelper.initDeploymentConfiguration(DeploymentConfigurationHelper.java:848)
at com.bea.console.utils.DeploymentConfigurationHelper.completeInitialization(DeploymentConfigurationHelper.java:444)
at com.bea.console.utils.DeploymentConfigurationManager.getDeploymentConfiguration(DeploymentConfigurationManager.java:151)
at com.bea.console.utils.DeploymentConfigurationManager.getDeploymentConfiguration(DeploymentConfigurationManager.java:104)
at com.bea.console.utils.DeploymentConfigurationManager.getDeploymentConfiguration(DeploymentConfigurationManager.java:65)
at com.bea.console.utils.PersistenceUtils.getPersistenceUnitNames(PersistenceUtils.java:76)
at com.bea.console.utils.PersistenceUtils.hasPersistenceUnits(PersistenceUtils.java:52)
at com.bea.console.utils.AppDeploymentBackingFile.preRender(AppDeploymentBackingFile.java:131)
at com.bea.netuix.servlets.controls.Backable$Impl.preRender(Backable.java:191)
at com.bea.netuix.servlets.controls.AdministeredBackableControl.preRender(AdministeredBackableControl.java:104)
at com.bea.netuix.servlets.controls.window.Window.preRender(Window.java:445)
at com.bea.netuix.servlets.controls.page.Page.preRender(Page.java:239)
at com.bea.netuix.nf.ControlLifecycle$6.visit(ControlLifecycle.java:428)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:727)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walk(ControlTreeWalker.java:146)
at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:399)
at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:361)
at com.bea.netuix.nf.Lifecycle.runOutbound(Lifecycle.java:208)
at com.bea.netuix.nf.Lifecycle.run(Lifecycle.java:162)
at com.bea.netuix.servlets.manager.UIServlet.runLifecycle(UIServlet.java:465)
at com.bea.netuix.servlets.manager.UIServlet.doPost(UIServlet.java:291)
at com.bea.netuix.servlets.manager.UIServlet.doGet(UIServlet.java:231)
at com.bea.netuix.servlets.manager.UIServlet.service(UIServlet.java:216)
at com.bea.netuix.servlets.manager.SingleFileServlet.service(SingleFileServlet.java:275)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at com.bea.console.utils.MBeanUtilsInitSingleFileServlet.service(MBeanUtilsInitSingleFileServlet.java:64)
at weblogic.servlet.AsyncInitServlet.service(AsyncInitServlet.java:125)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:286)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:260)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:137)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:350)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:25)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
at com.bea.console.internal.ParamFilter.doFilter(ParamFilter.java:38)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:32)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3683)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3649)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:326)
at weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197)
at weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)
at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71)
at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2433)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2281)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2259)
at weblogic.servlet.internal.ServletRequestImpl.runInternal(ServletRequestImpl.java:1691)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1651)
at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:270)
at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:348)
at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:333)
at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:54)
at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:640)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:406)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:346)
<Aug 28, 2017, 3:49:13,621 PM IST> <Error> <Console> <BEA-240003> <Administration Console encountered the following error: java.io.IOException: Conflict found while merging web fragment, weblogic.j2ee.descriptor.WebFragmentBeanImpl@7b55af1f() : Version
at weblogic.deploy.api.internal.utils.AppMerger.getMergedApp(AppMerger.java:65)
at weblogic.deploy.api.model.internal.WebLogicDeployableObjectFactoryImpl.createDeployableObject(WebLogicDeployableObjectFactoryImpl.java:186)
at weblogic.deploy.api.model.internal.WebLogicDeployableObjectFactoryImpl.createDeployableObject(WebLogicDeployableObjectFactoryImpl.java:167)
at weblogic.deploy.api.tools.SessionHelper.initialize(SessionHelper.java:847)
at weblogic.deploy.api.tools.SessionHelper.initializeConfiguration(SessionHelper.java:668)
at weblogic.deploy.api.tools.SessionHelper.initializeConfiguration(SessionHelper.java:656)
at weblogic.deploy.api.tools.SessionHelper.initializeConfiguration(SessionHelper.java:739)
at com.bea.console.utils.DeploymentConfigurationHelper$1.execute(DeploymentConfigurationHelper.java:860)
at com.bea.console.utils.DeploymentUtils.runDeploymentAction(DeploymentUtils.java:5646)
at com.bea.console.utils.DeploymentConfigurationHelper.initDeploymentConfiguration(DeploymentConfigurationHelper.java:848)
at com.bea.console.utils.DeploymentConfigurationHelper.completeInitialization(DeploymentConfigurationHelper.java:444)
at com.bea.console.utils.DeploymentConfigurationManager.getDeploymentConfiguration(DeploymentConfigurationManager.java:151)
at com.bea.console.utils.DeploymentConfigurationManager.getDeploymentConfiguration(DeploymentConfigurationManager.java:104)
at com.bea.console.utils.DeploymentConfigurationManager.getDeploymentConfiguration(DeploymentConfigurationManager.java:65)
at com.bea.console.utils.PersistenceUtils.getPersistenceUnitNames(PersistenceUtils.java:76)
at com.bea.console.utils.PersistenceUtils.hasPersistenceUnits(PersistenceUtils.java:52)
at com.bea.console.utils.AppDeploymentBackingFile.preRender(AppDeploymentBackingFile.java:131)
at com.bea.netuix.servlets.controls.Backable$Impl.preRender(Backable.java:191)
at com.bea.netuix.servlets.controls.AdministeredBackableControl.preRender(AdministeredBackableControl.java:104)
at com.bea.netuix.servlets.controls.window.Window.preRender(Window.java:445)
at com.bea.netuix.servlets.controls.page.Page.preRender(Page.java:239)
at com.bea.netuix.nf.ControlLifecycle$6.visit(ControlLifecycle.java:428)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:727)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walk(ControlTreeWalker.java:146)
at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:399)
at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:361)
at com.bea.netuix.nf.Lifecycle.runOutbound(Lifecycle.java:208)
at com.bea.netuix.nf.Lifecycle.run(Lifecycle.java:162)
at com.bea.netuix.servlets.manager.UIServlet.runLifecycle(UIServlet.java:465)
at com.bea.netuix.servlets.manager.UIServlet.doPost(UIServlet.java:291)
at com.bea.netuix.servlets.manager.UIServlet.doGet(UIServlet.java:231)
at com.bea.netuix.servlets.manager.UIServlet.service(UIServlet.java:216)
at com.bea.netuix.servlets.manager.SingleFileServlet.service(SingleFileServlet.java:275)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at com.bea.console.utils.MBeanUtilsInitSingleFileServlet.service(MBeanUtilsInitSingleFileServlet.java:64)
at weblogic.servlet.AsyncInitServlet.service(AsyncInitServlet.java:125)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:286)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:260)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:137)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:350)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:25)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
at com.bea.console.internal.ParamFilter.doFilter(ParamFilter.java:38)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:32)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3683)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3649)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:326)
at weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197)
at weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)
at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71)
at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2433)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2281)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2259)
at weblogic.servlet.internal.ServletRequestImpl.runInternal(ServletRequestImpl.java:1691)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1651)
at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:270)
at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:348)
at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:333)
at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:54)
at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:640)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:406)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:346)
Caused by: weblogic.utils.compiler.ToolFailureException: Conflict found while merging web fragment, weblogic.j2ee.descriptor.WebFragmentBeanImpl@7b55af1f() : Version
at weblogic.servlet.tools.WARModule.processAnnotations(WARModule.java:504)
at weblogic.servlet.tools.WARModule.processAnnotations(WARModule.java:589)
at weblogic.servlet.tools.WARModule.merge(WARModule.java:537)
at weblogic.application.compiler.ToolsModuleWrapper.merge(ToolsModuleWrapper.java:96)
at weblogic.application.utils.CustomModuleManager.merge(CustomModuleManager.java:78)
at weblogic.application.compiler.flow.SingleModuleMergeFlow.proecessModule(SingleModuleMergeFlow.java:27)
at weblogic.application.compiler.flow.SingleModuleFlow.compile(SingleModuleFlow.java:64)
at weblogic.application.compiler.FlowDriver$FlowStateChange.next(FlowDriver.java:70)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:37)
at weblogic.application.compiler.BaseMerger.merge(BaseMerger.java:20)
at weblogic.application.compiler.flow.AppMergerFlow.mergeInput(AppMergerFlow.java:75)
at weblogic.application.compiler.flow.AppMergerFlow.compile(AppMergerFlow.java:40)
at weblogic.application.compiler.FlowDriver$FlowStateChange.next(FlowDriver.java:70)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:37)
at weblogic.application.compiler.AppMerge.runBody(AppMerge.java:146)
at weblogic.utils.compiler.Tool.run(Tool.java:159)
at weblogic.utils.compiler.Tool.run(Tool.java:116)
at weblogic.application.compiler.AppMerge.merge(AppMerge.java:158)
at weblogic.deploy.api.internal.utils.AppMerger.merge(AppMerger.java:94)
at weblogic.deploy.api.internal.utils.AppMerger.getMergedApp(AppMerger.java:58)
... 78 more
>

I actually include a project in my application which uses servlet-api 3.0(to use some functionality of Async servlet) and I am using servlet-api 2.4 in my application. Also the application doesn't have any web-fragment concept.
Can there be any conflicts because of this? Any help would be much appreciated.


来源: stackexchange

答:
You can use array#reduce to group object based on month.

var data  = [{ date: "2016-08-13"},{ date: "2016-07-23"},{ date: "2016-08-11"},{ date: "2016-08-10"},{ date: "2016-07-20"},{ date: "2016-07-21"}];

var result = data.reduce((res,obj) => {
  let [year, month, day] = obj.date.split('-');
  if(res[month])
    res[month].push(obj);
  else
    res[month] = [obj];
  return res;
},{});
console.log(Object.values(result));```
<pre class="snippet-code-css lang-css prettyprint-override"><code>.as-console-wrapper { max-height: 100% !important; top: 0; }</code>```

var data  = [{ date: "2016-08-13"},{ date: "2016-07-23"},{ date: "2016-08-11"},{ date: "2016-08-10"},{ date: "2016-07-20"},{ date: "2016-07-21"}];

var result = data.reduce((res,obj) => {
  let [year, month, day] = obj.date.split('-');
  res[month] = res[month] || [];
  res[month].push(obj);
  return res;
},{});
console.log(Object.values(result));```

ContentLicense: CC BY-SA 3.0

Title: Group array of objects by string property value in JavaScript?

Body:
I hate this array of objects, each object has a date, I want to  be able to group these objects into months. Is there a way to convert this,

var data  = [
  { date: "2016-08-13",...},
  { date: "2016-07-23",...},
  { date: "2016-08-11",...},
  { date: "2016-08-10",...},
  { date: "2016-07-20",...},
  { date: "2016-07-21",...},
]

into something like this

var data  = [
  [{ date: "2016-08-13",...},
  { date: "2016-08-11",...},
  { date: "2016-08-10",...}],
  [{ date: "2016-07-20",...},
  { date: "2016-07-21",...},
  { date: "2016-07-23",...}[
]

Body:
You can use array#reduce to group object based on month.

var data  = [{ date: "2016-08-13"},{ date: "2016-07-23"},{ date: "2016-08-11"},{ date: "2016-08-10"},{ date: "2016-07-20"},{ date: "2016-07-21"}];

var result = data.reduce((res,obj) => {
  let [year, month, day] = obj.date.split('-');
  if(res[month])
    res[month].push(obj);
  else
    res[month] = [obj];
  return res;
},{});
console.log(Object.values(result));

.as-console-wrapper { max-height: 100% !important; top: 0; }

var data  = [{ date: "2016-08-13"},{ date: "2016-07-23"},{ date: "2016-08-11"},{ date: "2016-08-10"},{ date: "2016-07-20"},{ date: "2016-07-21"}];

var result = data.reduce((res,obj) => {
  let [year, month, day] = obj.date.split('-');
  res[month] = res[month] || [];
  res[month].push(obj);
  return res;
},{});
console.log(Object.values(result));


问:
how to set footer at the bottom when there is no content

Designed by Wiredelta

```

not getting footer at bottom of the page when there is no content is present in the body.so i need to fix footer at the bottom only, when i run the code the code.plzz give suggestion how to fix footer at the bottom exactly.

答:
A) Footer is fixed:

```<code>footer {
    background-color: skyblue;
    position:fixed;
    bottom: 0;
    width: 100%;
}
</code>```

footer {
 background-color: skyblue;
 position:fixed;
 bottom: 0;
 width: 100%;
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<footer>
  <div class="container">
  <div class="row container">
    <div class="col-sm-6 col-md-6 col-lg-6 col-xs-12 no-padding">
      <p>Designed by Wiredelta </p>
    </div>
    <div class="col-sm-6 col-md-6 col-lg-6 col-xs-12 no-padding">
      <div class="pull-right barMain">
        <ul class="social-bar">
          <li>

              <span class="fa-stack back-fa "><i class="fa fa-facebook fa-stack-1x"></i></span>

          </li>
          <li>

              <span class="fa-stack back-fa "><i class="fa fa fa-twitter fa-stack-1x"></i></span>

          </li>
          <li>

              <span class="fa-stack back-fa "><i class="fa fa-google-plus fa-stack-1x"></i></span>

          </li>
          <li>

              <span class="fa-stack back-fa "><i class="fa fa-instagram fa-stack-1x"></i></span>

          </li>
        </ul>
      </div>
    </div>
  </div>
  </div>
</footer></code>```

B) Footer is not fixed:

```<code>body {
    height: 1200px;
    position: relative;
}

footer {
    background-color: skyblue;
    position:absolute;
    bottom: 0;
    width: 100%;
}
</code>```

body {
  height: 1200px;
  position: relative;
}

footer {
  background-color: skyblue;
  position:absolute;
  bottom: 0;
  width: 100%;
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<footer>
  <div class="container">
  <div class="row container">
    <div class="col-sm-6 col-md-6 col-lg-6 col-xs-12 no-padding">
      <p>Designed by Wiredelta </p>
    </div>
    <div class="col-sm-6 col-md-6 col-lg-6 col-xs-12 no-padding">
      <div class="pull-right barMain">
        <ul class="social-bar">
          <li>

              <span class="fa-stack back-fa "><i class="fa fa-facebook fa-stack-1x"></i></span>

          </li>
          <li>

              <span class="fa-stack back-fa "><i class="fa fa fa-twitter fa-stack-1x"></i></span>

          </li>
          <li>

              <span class="fa-stack back-fa "><i class="fa fa-google-plus fa-stack-1x"></i></span>

          </li>
          <li>

              <span class="fa-stack back-fa "><i class="fa fa-instagram fa-stack-1x"></i></span>

          </li>
        </ul>
      </div>
    </div>
  </div>
  </div>
</footer></code>```

Body:
Designed by Wiredelta

not getting footer at bottom of the page when there is no content is present in the body.so i need to fix footer at the bottom only, when i run the code the code.plzz give suggestion how to fix footer at the bottom exactly.

Body:
A) Footer is fixed:

footer {
    background-color: skyblue;
    position:fixed;
    bottom: 0;
    width: 100%;
}

footer {
 background-color: skyblue;
 position:fixed;
 bottom: 0;
 width: 100%;
}

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<footer>
  <div class="container">
  <div class="row container">
    <div class="col-sm-6 col-md-6 col-lg-6 col-xs-12 no-padding">
      <p>Designed by <a href="http://wiredelta.com/" target="_blank">Wiredelta</a> </p>
    </div>
    <div class="col-sm-6 col-md-6 col-lg-6 col-xs-12 no-padding">
      <div class="pull-right barMain">
        <ul class="social-bar">
          <li>
            <a href="https://www.facebook.com/" target="_blank">
              <span class="fa-stack back-fa "><i class="fa fa-facebook fa-stack-1x"></i></span>
            </a>
          </li>
          <li>
            <a href="https://twitter.com/" target="_blank">
              <span class="fa-stack back-fa "><i class="fa fa fa-twitter fa-stack-1x"></i></span>
            </a>
          </li>
          <li>
            <a href="https://plus.google.com/" target="_blank">
              <span class="fa-stack back-fa "><i class="fa fa-google-plus fa-stack-1x"></i></span>
            </a>
          </li>
          <li>
            <a href="https://www.instagram.com/" target="_blank">
              <span class="fa-stack back-fa "><i class="fa fa-instagram fa-stack-1x"></i></span>
            </a>
          </li>
        </ul>
      </div>
    </div>
  </div>
  </div>
</footer>

B) Footer is not fixed:

body {
    height: 1200px;
    position: relative;
}

footer {
    background-color: skyblue;
    position:absolute;
    bottom: 0;
    width: 100%;
}

body {
  height: 1200px;
  position: relative;
}

footer {
  background-color: skyblue;
  position:absolute;
  bottom: 0;
  width: 100%;
}

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<footer>
  <div class="container">
  <div class="row container">
    <div class="col-sm-6 col-md-6 col-lg-6 col-xs-12 no-padding">
      <p>Designed by <a href="http://wiredelta.com/" target="_blank">Wiredelta</a> </p>
    </div>
    <div class="col-sm-6 col-md-6 col-lg-6 col-xs-12 no-padding">
      <div class="pull-right barMain">
        <ul class="social-bar">
          <li>
            <a href="https://www.facebook.com/" target="_blank">
              <span class="fa-stack back-fa "><i class="fa fa-facebook fa-stack-1x"></i></span>
            </a>
          </li>
          <li>
            <a href="https://twitter.com/" target="_blank">
              <span class="fa-stack back-fa "><i class="fa fa fa-twitter fa-stack-1x"></i></span>
            </a>
          </li>
          <li>
            <a href="https://plus.google.com/" target="_blank">
              <span class="fa-stack back-fa "><i class="fa fa-google-plus fa-stack-1x"></i></span>
            </a>
          </li>
          <li>
            <a href="https://www.instagram.com/" target="_blank">
              <span class="fa-stack back-fa "><i class="fa fa-instagram fa-stack-1x"></i></span>
            </a>
          </li>
        </ul>
      </div>
    </div>
  </div>
  </div>
</footer>


问:
Retrieve URL from iframe using window.postMessage
I'm trying to access the URL of an iFrame that I open on my site.  The iFrame is from another domain so traditional methods violate the same origin policy and are flagged as cross site scripting.  However, I just discovered window.postMessage, but I don't quite know how to pull it all together.

My goal is to capture the final URL in the iFrame.  For example, a user clicks a button on my site to open an iFrame.  Say that iFrame loads a web site and the user clicks around on the site.  When they close the iFrame, I want to capture the URL so the next time they click the button on my site, I can open the iFrame to the same state that the site was in last time they visited.  Is this possible with window.postMessage?

Thanks!

ContentLicense: CC BY-SA 2.5

Body:
document.iframe[name].src
document.iframe[name].document.location.href


问:
How can I generate a sine wave with different frequencies using matlab?
For my project I need to generate a sine wave using matlab which has 100 000 samples and the frequency changes randomly after every 10 000 samples. The sampling rate and the frequencies can be as per convenience. Is there any function in matlab to generate this?</p>

答:
Here is an example for different sequential frequencies.</p>

```<code>% Generate a sequencial sinusoid
fs = 8000;                                        % sampling rate
amp = 1;                                          % amplitude
freqs = [262, 294, 330, 350, 392, 440, 494, 523]; % frequency in Hz
T = 1/fs;                                         % sampling period
dur = 0.5;                                        % duration in seconds
phi = 0;                                          % phase in radian
y = [];

for k = 1:size(freqs,2)
    x = amp*sin(2*pi*freqs(k)*[0:T:dur-T]+phi);
    y = horzcat(y,x);
end
</code>```

Body:
Here is an example for different sequential frequencies.

% Generate a sequencial sinusoid
fs = 8000;                                        % sampling rate
amp = 1;                                          % amplitude
freqs = [262, 294, 330, 350, 392, 440, 494, 523]; % frequency in Hz
T = 1/fs;                                         % sampling period
dur = 0.5;                                        % duration in seconds
phi = 0;                                          % phase in radian
y = [];

for k = 1:size(freqs,2)
    x = amp*sin(2*pi*freqs(k)*[0:T:dur-T]+phi);
    y = horzcat(y,x);
end


问:
How to add posix threads into eclipse on windows (MinGW)
Alright, so i'm running Eclipse Mars.1 (with MinGW compiler) on windows 8.1 OS and i'm trying to enable usage of POSIX threads.
I've downloaded pthreads win32 from : https://www.sourceware.org/pthreads-win32 since windows doesn't have pthread library included as linux does. After i downloaded the .zip file i've extracted the files like this:

pthreadGC2.dll into C:\MinGW\bin

pthread.h , sched.h, semaphore.h into C:\MinGW\include

libpthreadGC2.a into C:\MinGW\lib

Back to the Eclipse, i've right clicked the project -> properties -> C/C++ build -> settings -> MinGW C linker , now here comes the problem, i have no idea what should i put into Libraries/Miscellaneous section. Eclipse is recognizing #include <pthread.h> (its not red color - underlining it) and pthread.h functions, but once i try to build it, it says this :

15:10:11 **** Incremental Build of configuration Debug for project ASD ****
Info: Internal Builder is used for build
gcc -o ASD.exe qweqwe.o -lpthread
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lpthread
collect2.exe: error: ld returned 1 exit status

15:10:11 Build Finished (took 122ms)

I can't figure out what am i doing wrong, i've tried changing library name (in the linker settings tab) to pthreadGC2, but if i do that Eclipse just underlines pthread_create and says that it is undefined reference to _imp_pthread_create.

If anyone tried and succeeded doing this, please share your wisdom. Thank you in advance!

答: Or you could just use the MinGW installer to download it.</p>


问:
LWJGL glGetActiveUniform and glGetActiveAttrib crashes
Following usage of glGetActiveUniform crashes both with nVidia and AMD GPUs, using LWJGL 3.1.3:

```<code>val strLen = glGetProgrami(program, GL_ACTIVE_UNIFORM_MAX_LENGTH)

val length = Array.ofDim[Int](1)
val size = Array.ofDim[Int](1)
val `type` = Array.ofDim[Int](1)
val name = Array.ofDim[Byte](strLen)
length(0) = 0
size(0) = 0
`type`(0) = 0
name(0) = 0
glGetActiveUniform(program, i, length, size, `type`, java.nio.ByteBuffer.wrap(name))
</code>```

A bit more verbose version using three API calls works fine to me:

```<code>val xName = glGetActiveUniformName(program, i)
val xSize = glGetActiveUniformsi(program, i, GL_UNIFORM_SIZE)
val xType = glGetActiveUniformsi(program, i, GL_UNIFORM_TYPE)
</code>```

Recently I hit the same problem with glGetActiveAttrib, for which I cannot find any workaround API:

```<code>val strLen = glGetProgrami(program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH)

val length = Array.ofDim[Int](1)
val size = Array.ofDim[Int](1)
val `type` = Array.ofDim[Int](1)
val name = Array.ofDim[Byte](64)
glGetActiveAttrib(program, i, length, size, `type`, java.nio.ByteBuffer.wrap(name))
</code>```

I did not find any examples how this API is supposed to be used. What I am doing wrong? Do I perhaps need some more complex nio or other buffer manipulation? (My source code is Scala, I hope this will not be a problem for Java programmers to understand)

答:
My nio usage was naive, written without real understanding. After learning a bit, mostly from Memory management in LWJGL 3 and checking how glGetActiveUniformName is implemented, the code which works fine is:

```<code>import org.lwjgl.system._

val stackMem = MemoryStack.stackPush()
try {
  val strLen = glGetProgrami(program, GL_ACTIVE_UNIFORM_MAX_LENGTH)
  val length = stackMem.mallocInt(1)
  val size = stackMem.mallocInt(1)
  val `type` = stackMem.mallocInt(1)
  val name = stackMem.malloc(strLen)

  glGetActiveUniform(program, i, length, size, `type`, name)
  (size.get(0), `type`.get(0), MemoryUtil.memASCII(name, length.get(0)))
} finally {
  stackMem.close()
}
</code>```

The most important difference is LWJGL requires direct NIO buffers to be used.

Body:
Following usage of glGetActiveUniform crashes both with nVidia and AMD GPUs, using LWJGL 3.1.3:

val strLen = glGetProgrami(program, GL_ACTIVE_UNIFORM_MAX_LENGTH)

val length = Array.ofDim[Int](1)
val size = Array.ofDim[Int](1)
val `type` = Array.ofDim[Int](1)
val name = Array.ofDim[Byte](strLen)
length(0) = 0
size(0) = 0
`type`(0) = 0
name(0) = 0
glGetActiveUniform(program, i, length, size, `type`, java.nio.ByteBuffer.wrap(name))

A bit more verbose version using three API calls works fine to me:

val xName = glGetActiveUniformName(program, i)
val xSize = glGetActiveUniformsi(program, i, GL_UNIFORM_SIZE)
val xType = glGetActiveUniformsi(program, i, GL_UNIFORM_TYPE)

Recently I hit the same problem with glGetActiveAttrib, for which I cannot find any workaround API:

val strLen = glGetProgrami(program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH)

val length = Array.ofDim[Int](1)
val size = Array.ofDim[Int](1)
val `type` = Array.ofDim[Int](1)
val name = Array.ofDim[Byte](64)
glGetActiveAttrib(program, i, length, size, `type`, java.nio.ByteBuffer.wrap(name))

I did not find any examples how this API is supposed to be used. What I am doing wrong? Do I perhaps need some more complex nio or other buffer manipulation? (My source code is Scala, I hope this will not be a problem for Java programmers to understand)

Body:
My nio usage was naive, written without real understanding. After learning a bit, mostly from Memory management in LWJGL 3 and checking how glGetActiveUniformName is implemented, the code which works fine is:

import org.lwjgl.system._

val stackMem = MemoryStack.stackPush()
try {
  val strLen = glGetProgrami(program, GL_ACTIVE_UNIFORM_MAX_LENGTH)
  val length = stackMem.mallocInt(1)
  val size = stackMem.mallocInt(1)
  val `type` = stackMem.mallocInt(1)
  val name = stackMem.malloc(strLen)

  glGetActiveUniform(program, i, length, size, `type`, name)
  (size.get(0), `type`.get(0), MemoryUtil.memASCII(name, length.get(0)))
} finally {
  stackMem.close()
}

The most important difference is LWJGL requires direct NIO buffers to be used.


问:
VBA - copy text from website and added into word template
I'm trying to copy data from several IE pages containing contact info for some persons and then add it into a word template using VBA and word content control This needs to be done dynamically country of origin can be different.
The HMTL source code from where I would like to extract the data looks like:

```<code><td rowSpan="1" colSpan="1">
  Mrs Mallet Anonime
  <br></br>
  11, RUE FRANCOIS BOLLE
  <br></br>
  12345 PARIS 05 FRANCE
  <br></br>
</td>
</code>```

As I'm using a word template to do this the writing needs to look in the following order as in a letter:

Mrs Mallet Anonime

11, RUE FRANCOIS BOLLE

12345 PARIS 05

FRANCE

Unfortunately the country may not be same for all of these letters (ENGLAND,SWITZERLAND,etc.).Any ideas how to proceed with this??

答:
First, look how the general stuff works. Searchbar: VBA IE automation

The try

```<code>'First, create an object "ie" and use "ie.navigate" to get to your website. Then:

dim td_col as iHTMLElementCollection
dim td_elem as iHTMLElement

set td_col = ie.document.getElementsByTagName("td")
for each td_elem in td_col
    Word.Selection.TypeText (vbCrLf + td_elem.innertext)
Next td_elem
</code>```

Hope that helps.

Body:
I'm trying to copy data from several IE pages containing contact info for some persons and then add it into a word template using VBA and word content control This needs to be done dynamically country of origin can be different.
The HMTL source code from where I would like to extract the data looks like:

  Mrs Mallet Anonime

  11, RUE FRANCOIS BOLLE

  12345 PARIS 05 FRANCE

As I'm using a word template to do this the writing needs to look in the following order as in a letter:

Mrs Mallet Anonime

11, RUE FRANCOIS BOLLE

12345 PARIS 05

FRANCE

Unfortunately the country may not be same for all of these letters (ENGLAND,SWITZERLAND,etc.).Any ideas how to proceed with this??

Body:
First, look how the general stuff works. Searchbar: VBA IE automation

The try

'First, create an object "ie" and use "ie.navigate" to get to your website. Then:

dim td_col as iHTMLElementCollection
dim td_elem as iHTMLElement

set td_col = ie.document.getElementsByTagName("td")
for each td_elem in td_col
    Word.Selection.TypeText (vbCrLf + td_elem.innertext)
Next td_elem

Hope that helps.


问:
What is the proper way to make a Python frozen binaries for OSX that can accept arguments?
I've made a .app bundle from a python script using py2app. The issue is twofold:

Argument emulation doesn't appear to work correctly because it doesn't accept the arguments that work on the original python script.

The .app bundle format needs to be opened by "open". "open" only supports passing arguments from OSX 10.6 and on, and I need support for earlier OSX versions.

Whats the proper way to make a frozen binary for OSX that can accept command line arguments?

答:
Use pyinstaller it can easily create linux-like command line binary executables for OS X. It also can do it for linux and Windows OSes.

I've used both py2app and pyinstaller to do OS X executables and as for me pyinstaller is better and easier to configure.
However py2app also can handle arguments, even it create app bundles. So think you have just wrong building settings.


问:
navigation is not working using redux-saga
I am trying to navigate to Main Screen and code still work fine if the JS DEBUGGER is ON(running) but the problem is when i try to run my application when JS DEBUGGER is OFF(disable) and try to login at that time "yield put(NavigationActions.navigate({ routeName: 'Main' }));"
this piece code is not redirecting to Main screen.

Given below is my code:

```<code>import { NavigationActions } from 'react-navigation';
import { call, put, takeEvery, take } from 'redux-saga/effects';
import { getFirebase } from 'react-redux-firebase';

export function* watchLoginAsync({email, password}) {
  try {
    const response = yield getFirebase().login({email,password});
    if (response.uid) {
      // dispatchToMain();
      yield put(NavigationActions.navigate({ routeName: 'Main' }));
      // yield put({type: LOGIN_SUCCESS });
    } else {
      yield put({type: LOGIN_FAIL, error: 'Something went wrong seriously!!'});
    }
  } catch(err => console.log(err))
}

export default function* watchLogin() {
  yield takeEvery(LOGIN_REQUESTING, watchLoginAsync);
}
</code>```

And this the store.js file(where i have integrated redux-saga with react-redux-firebase)

```<code>const sagaMiddleware = createSagaMiddleware();
const middleware = [ sagaMiddleware ];

const firebaseConfig = {
 apiKey: '******',
 authDomain: '****',
 databaseURL: '****',
 projectId: '****',
 storageBucket: '****',
 messagingSenderId: '****',
};

const reduxFirebaseConfig = {
 userProfile: 'users',
 enableLogging: true,
 enableRedirectHandling: false,
};

// Add redux Firebase to compose
const createStoreWithFirebase = compose(
 reactReduxFirebase(fbConfig, reduxFirebaseConfig),
 applyMiddleware(...middleware)
)(createStore);

// Add Firebase to reducers
const rootReducer = combineReducers({
 firebase: firebaseStateReducer,
 ......
});

// Create store with reducers and initial state
const initialState = {}
export default createStoreWithFirebase(rootReducer, initialState);

// when calling saga, pass getFirebase
sagaMiddleware.run(Sagas, getFirebase)
</code>```

NOTE:
code is totally working fine if JS DEBUGGER IS ON iOS simulator while app is running.

答:
NOTE: code is totally working fine if JS DEBUGGER IS ON iOS simulator while app is running.

In general debugging mode differs from normal execution by timings - e.g. in debug mode some asynchronous action is performed while you are watching values on breakpoint, and also execution in debug mode is much slower due interception ES262-engine actions. You can try to debug more verbosely by using console.log instructions.

Also, supplied source code

```<code>const createStoreWithFirebase = compose(
 reactReduxFirebase(fbConfig, reduxFirebaseConfig),
 applyMiddleware(...middleware)
)(createStore);
</code>```

does not include mandatory saga initial invoke operation, like sagaMiddleware.run(rootSaga), what's why maybe nothing is executed.

In original documentation it's present: https://github.com/prescottprue/react-redux-firebase/blob/master/docs/recipes/redux-saga.md

Body:
I am trying to navigate to Main Screen and code still work fine if the JS DEBUGGER is ON(running) but the problem is when i try to run my application when JS DEBUGGER is OFF(disable) and try to login at that time "yield put(NavigationActions.navigate({ routeName: 'Main' }));"
this piece code is not redirecting to Main screen.

Given below is my code:

import { NavigationActions } from 'react-navigation';
import { call, put, takeEvery, take } from 'redux-saga/effects';
import { getFirebase } from 'react-redux-firebase';

export function* watchLoginAsync({email, password}) {
  try {
    const response = yield getFirebase().login({email,password});
    if (response.uid) {
      // dispatchToMain();
      yield put(NavigationActions.navigate({ routeName: 'Main' }));
      // yield put({type: LOGIN_SUCCESS });
    } else {
      yield put({type: LOGIN_FAIL, error: 'Something went wrong seriously!!'});
    }
  } catch(err => console.log(err))
}

export default function* watchLogin() {
  yield takeEvery(LOGIN_REQUESTING, watchLoginAsync);
}

And this the store.js file(where i have integrated redux-saga with react-redux-firebase)

const sagaMiddleware = createSagaMiddleware();
const middleware = [ sagaMiddleware ];

const firebaseConfig = {
 apiKey: '******',
 authDomain: '****',
 databaseURL: '****',
 projectId: '****',
 storageBucket: '****',
 messagingSenderId: '****',
};

const reduxFirebaseConfig = {
 userProfile: 'users',
 enableLogging: true,
 enableRedirectHandling: false,
};

// Add redux Firebase to compose
const createStoreWithFirebase = compose(
 reactReduxFirebase(fbConfig, reduxFirebaseConfig),
 applyMiddleware(...middleware)
)(createStore);

// Add Firebase to reducers
const rootReducer = combineReducers({
 firebase: firebaseStateReducer,
 ......
});

// Create store with reducers and initial state
const initialState = {}
export default createStoreWithFirebase(rootReducer, initialState);

// when calling saga, pass getFirebase
sagaMiddleware.run(Sagas, getFirebase)

NOTE:
code is totally working fine if JS DEBUGGER IS ON iOS simulator while app is running.

Body:
NOTE: code is totally working fine if JS DEBUGGER IS ON iOS simulator while app is running.

In general debugging mode differs from normal execution by timings - e.g. in debug mode some asynchronous action is performed while you are watching values on breakpoint, and also execution in debug mode is much slower due interception ES262-engine actions. You can try to debug more verbosely by using console.log instructions.

Also, supplied source code

const createStoreWithFirebase = compose(
 reactReduxFirebase(fbConfig, reduxFirebaseConfig),
 applyMiddleware(...middleware)
)(createStore);

does not include mandatory saga initial invoke operation, like sagaMiddleware.run(rootSaga), what's why maybe nothing is executed.

In original documentation it's present: https://github.com/prescottprue/react-redux-firebase/blob/master/docs/recipes/redux-saga.md


问:
How to download file from azure's blob storage
I am trying to download a file from azure's blob storage using jquery's $.ajax() method.

I am using the following c# code to download the blob which I believe the problem lies.

```<code>  [System.Web.Services.WebMethod]
        public static void DownLoadBlob(string blobStorageName, string companyID)
        {
            CloudStorageAccount storageAccount = CloudStorageAccount.Parse(
                CloudConfigurationManager.GetSetting("StorageConnectionString"));
            CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
            CloudBlobContainer container = blobClient.GetContainerReference(System.Text.RegularExpressions.Regex.Replace(companyID.ToLower(), @"\s+", ""));
            CloudBlockBlob blockBlob = container.GetBlockBlobReference(blobStorageName);
            MemoryStream memStream = new MemoryStream();
            blockBlob.DownloadToStream(memStream);
            HttpResponse response = HttpContext.Current.Response;
            response.ContentType = blockBlob.Properties.ContentType;
            response.AddHeader("Content-Disposition", "Attachment; filename=" + blobStorageName.ToString());
            response.AddHeader("Content-Length", blockBlob.Properties.Length.ToString());
            response.BinaryWrite(memStream.ToArray());
        }
</code>```

The above code is triggered by the following ajax call.

```<code>  var objRecordJSON = JSON.parse(response.d);
                $.ajax({
                    type: "POST",
                    url: "FroalaImageUpload.aspx/DownLoadBlob",
                    data: '{"blobStorageName":"' + objRecordJSON[0].uploaded_file + '", ' +
                    '"companyID" : "' + $("#trainingcompanyid").val() + '" }',
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function (response) {

                    },
                    failure: function (response) {

                    }
                });
</code>```

I have a break point on my server side c# code and it is hitting that piece of code. However the file does not download on the client end. I don't get any errors in the console either.

Any help or advice would be appreciated.

Thanks

答:
I am trying to download a file from azure's blob storage using jquery's $.ajax() method.

AFAIK, we could not directly download a file via an Ajax call. I assumed that you could create a single WebForm page and move your code for outputting blob file(s) to Page_Load, and leverage the querystring to pass your parameters as follows:

```<code>protected void Page_Load(object sender, EventArgs e)
{
    var blobStorageName = Request.QueryString["blobStorageName"];
    var companyID = Request.QueryString["companyID"];
    CloudStorageAccount storageAccount = CloudStorageAccount.Parse(Microsoft.Azure.CloudConfigurationManager.GetSetting("StorageConnectionString"));
    CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
    CloudBlobContainer container = blobClient.GetContainerReference(System.Text.RegularExpressions.Regex.Replace(companyID.ToLower(), @"\s+", ""));
    CloudBlockBlob blockBlob = container.GetBlockBlobReference(blobStorageName);
    System.IO.MemoryStream memStream = new System.IO.MemoryStream();
    blockBlob.DownloadToStream(memStream);
    HttpResponse response = HttpContext.Current.Response;
    response.ContentType = blockBlob.Properties.ContentType;
    response.AddHeader("Content-Disposition", "Attachment; filename=" + blobStorageName.ToString());
    response.AddHeader("Content-Length", blockBlob.Properties.Length.ToString());
    response.BinaryWrite(memStream.ToArray());
}
</code>```

Then for your client, you could download the file as follows:

```<code>window.location = "/FroalaImageUpload.aspx?blobStorageName=2017%2F11%2F7%2F2017-7-10-1.png&companyID=images";
</code>```

Moreover, you could also leverage iframe to download the file. Details you could refer to this similar issue.

Body:
I am trying to download a file from azure's blob storage using jquery's $.ajax() method.

I am using the following c# code to download the blob which I believe the problem lies.

  [System.Web.Services.WebMethod]
        public static void DownLoadBlob(string blobStorageName, string companyID)
        {
            CloudStorageAccount storageAccount = CloudStorageAccount.Parse(
                CloudConfigurationManager.GetSetting("StorageConnectionString"));
            CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
            CloudBlobContainer container = blobClient.GetContainerReference(System.Text.RegularExpressions.Regex.Replace(companyID.ToLower(), @"\s+", ""));
            CloudBlockBlob blockBlob = container.GetBlockBlobReference(blobStorageName);
            MemoryStream memStream = new MemoryStream();
            blockBlob.DownloadToStream(memStream);
            HttpResponse response = HttpContext.Current.Response;
            response.ContentType = blockBlob.Properties.ContentType;
            response.AddHeader("Content-Disposition", "Attachment; filename=" + blobStorageName.ToString());
            response.AddHeader("Content-Length", blockBlob.Properties.Length.ToString());
            response.BinaryWrite(memStream.ToArray());
        }

The above code is triggered by the following ajax call.

  var objRecordJSON = JSON.parse(response.d);
                $.ajax({
                    type: "POST",
                    url: "FroalaImageUpload.aspx/DownLoadBlob",
                    data: '{"blobStorageName":"' + objRecordJSON[0].uploaded_file + '", ' +
                    '"companyID" : "' + $("#trainingcompanyid").val() + '" }',
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function (response) {

                    },
                    failure: function (response) {

                    }
                });

I have a break point on my server side c# code and it is hitting that piece of code. However the file does not download on the client end. I don't get any errors in the console either.

Any help or advice would be appreciated.

Thanks

Body:
I am trying to download a file from azure's blob storage using jquery's $.ajax() method.

AFAIK, we could not directly download a file via an Ajax call. I assumed that you could create a single WebForm page and move your code for outputting blob file(s) to Page_Load, and leverage the querystring to pass your parameters as follows:

protected void Page_Load(object sender, EventArgs e)
{
    var blobStorageName = Request.QueryString["blobStorageName"];
    var companyID = Request.QueryString["companyID"];
    CloudStorageAccount storageAccount = CloudStorageAccount.Parse(Microsoft.Azure.CloudConfigurationManager.GetSetting("StorageConnectionString"));
    CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
    CloudBlobContainer container = blobClient.GetContainerReference(System.Text.RegularExpressions.Regex.Replace(companyID.ToLower(), @"\s+", ""));
    CloudBlockBlob blockBlob = container.GetBlockBlobReference(blobStorageName);
    System.IO.MemoryStream memStream = new System.IO.MemoryStream();
    blockBlob.DownloadToStream(memStream);
    HttpResponse response = HttpContext.Current.Response;
    response.ContentType = blockBlob.Properties.ContentType;
    response.AddHeader("Content-Disposition", "Attachment; filename=" + blobStorageName.ToString());
    response.AddHeader("Content-Length", blockBlob.Properties.Length.ToString());
    response.BinaryWrite(memStream.ToArray());
}

Then for your client, you could download the file as follows:

window.location = "/FroalaImageUpload.aspx?blobStorageName=2017%2F11%2F7%2F2017-7-10-1.png&companyID=images";

Moreover, you could also leverage iframe to download the file. Details you could refer to this similar issue.


问:
how to find related field month by in mysql
this is my table schema

    Month      BD Name   Payment Amount      Total Paid      Due Amount

```<code>July,2017   Mohit Siwal       70                 210      -140
August,2017 Mohit Siwal       350                150      200
September 2017  Mohit Siwal    277               556        -279
September 2017  Mohit Siwal     500                 250    250
September 2017  Mohit Siwal   250               500         -250
November 2017   Mohit Siwal     200              100    100
</code>```

i want to add all September month and add also related field in this table;

come like this output

```<code>Month        BD Name    Payment Amount        Total Paid    Due Amount
July 2017   Mohit Siwal      70                      210    -140
August 2017 Mohit Siwal      350                     150    200
September 2017  Mohit Siwal   1027                 1306     -279
November 2017   Mohit Siwal    200                    100   100
</code>```

I am written this query

```<code>$countryquery="select id, project_name, SUM(total_paid) as t, bd_id, payment_date from `tbl_payments`where bd_id=$bid Group By project_name order by payment_date" ;
</code>```

答:
You can group by month and bd_name and find sum of the amounts:</p>

```<code>select month,
    bd_name,
    sum(payment_amount) as payment_amount,
    sum(total_paid) as total_paid,
    sum(due_amount) as due_amount
from your_table
group by month,
    bd_name
order by month;
</code>```

Body:
this is my table schema

    Month      BD Name   Payment Amount      Total Paid      Due Amount

July,2017   Mohit Siwal       70                 210      -140
August,2017 Mohit Siwal       350                150      200
September 2017  Mohit Siwal    277               556        -279
September 2017  Mohit Siwal     500                 250    250
September 2017  Mohit Siwal   250               500         -250
November 2017   Mohit Siwal     200              100    100

i want to add all September month and add also related field in this table;

come like this output

Month        BD Name    Payment Amount        Total Paid    Due Amount
July 2017   Mohit Siwal      70                      210    -140
August 2017 Mohit Siwal      350                     150    200
September 2017  Mohit Siwal   1027                 1306     -279
November 2017   Mohit Siwal    200                    100   100

I am written this query

$countryquery="select id, project_name, SUM(total_paid) as t, bd_id, payment_date from `tbl_payments`where bd_id=$bid Group By project_name order by payment_date" ;

Body:
You can group by month and bd_name and find sum of the amounts:

select month,
    bd_name,
    sum(payment_amount) as payment_amount,
    sum(total_paid) as total_paid,
    sum(due_amount) as due_amount
from your_table
group by month,
    bd_name
order by month;


答:
Group by Month:</p>

```<code>var groupedData = [];

for(i=0;i<12;i++)
   groupedData.push([]);

for(var index = 0;index<data.length;index++){
   var date = new Date(data[index].date);
   groupedData[date.getMonth()] = data[index];
}
</code>```

Body:
Group by Month:

var groupedData = [];

for(i=0;i<12;i++)
   groupedData.push([]);

for(var index = 0;index<data.length;index++){
   var date = new Date(data[index].date);
   groupedData[date.getMonth()] = data[index];
}


问:
How to add a prefix to a subset of variables
I learned via this post (Adding a prefix to column names) how to change the names of all the variables in a dataset at once, but I can't seem to change the name of only a subset of those variables. The dataset has 358 variables in total, and I am able to add a prefix to all of the variables, but not just a subset.

I am using the following code, but the names don't seem to be changing.

```<code>colnames(y6t1data[,75:358]) <- paste("Y6T1",colnames(y6t1data[,75:358]), sep = "_")
</code>```

答:
If you are using data.table framework, an intuitive way to do that is:

```<code>setnames(y6t1data, 75:358, paste("Y6T1",names(y6t1data)[75:358], sep = "_")
</code>```

This syntax alows you to transform names, by regex...

For more info, pleace check:

```<code>? setnames
</code>```

Body:
I learned via this post (Adding a prefix to column names) how to change the names of all the variables in a dataset at once, but I can't seem to change the name of only a subset of those variables. The dataset has 358 variables in total, and I am able to add a prefix to all of the variables, but not just a subset.

I am using the following code, but the names don't seem to be changing.

colnames(y6t1data[,75:358]) <- paste("Y6T1",colnames(y6t1data[,75:358]), sep = "_")

Body:
If you are using data.table framework, an intuitive way to do that is:

setnames(y6t1data, 75:358, paste("Y6T1",names(y6t1data)[75:358], sep = "_")

This syntax alows you to transform names, by regex...

For more info, pleace check:

? setnames


问:
Flex ItemRenderer Images not appearing at runtime
in datagrid I have an ItemRenderer (which extends UIComponent) which loads images based on a data value, eg:

```<code> _img.source = "assets/images/flags/" + value[dglistData.dataField] + ".gif";
</code>```

When I run my application the images (flags) are appearing in the ItemRenderer. When I build and deploy the application into BlazeDS as an SWF file - the images do not appear. Instead there is the standard "missing icon" link that appears in Internet explorer.

As far as I can tell, my ANT build script includes the above directory "assets/images/flags/" and all the images into the SWF file.

Is this a relative path issue? Not sure, any help would be appreaciated.

Thanks
Mike

答:
When you are assigning a path as source Flash Player is trying to load the images via HTTP requests. Therefore, embedding your images in the SWF has no effect.

There are two possible solutions. Either deploy the folder containing your images to the server and use the corresponding path as your source or embed all your images into the SWF.

A simple example for the second solution. The code assumes that value[dglistData.dataField] corresponds to one of the variables with the [Embed] metadata.

```<code>[Embed(source='assets/images/flags/Image1.png')]
private var image1:Class;

[Embed(source='assets/images/flags/Image2.png')]
private var image2:Class;

[Embed(source='assets/images/flags/Image3.png')]
private var image3:Class;

// access the image like this...
_img.source = this[value[dglistData.dataField]];
</code>```

Body:
in datagrid I have an ItemRenderer (which extends UIComponent) which loads images based on a data value, eg:

 _img.source = "assets/images/flags/" + value[dglistData.dataField] + ".gif";

When I run my application the images (flags) are appearing in the ItemRenderer. When I build and deploy the application into BlazeDS as an SWF file - the images do not appear. Instead there is the standard "missing icon" link that appears in Internet explorer.

As far as I can tell, my ANT build script includes the above directory "assets/images/flags/" and all the images into the SWF file.

Is this a relative path issue? Not sure, any help would be appreaciated.

Thanks
Mike

Body:
When you are assigning a path as source Flash Player is trying to load the images via HTTP requests. Therefore, embedding your images in the SWF has no effect.

There are two possible solutions. Either deploy the folder containing your images to the server and use the corresponding path as your source or embed all your images into the SWF.

A simple example for the second solution. The code assumes that value[dglistData.dataField] corresponds to one of the variables with the [Embed] metadata.

[Embed(source='assets/images/flags/Image1.png')]
private var image1:Class;

[Embed(source='assets/images/flags/Image2.png')]
private var image2:Class;

[Embed(source='assets/images/flags/Image3.png')]
private var image3:Class;

// access the image like this...
_img.source = this[value[dglistData.dataField]];