问:
Unable to start Hybris Tomcat Server due to Solr Server
I am not able to start the Hybris server due to the starting issue with SOLR server.

Kindly help me in this regard so that I can start the Hybris tomcat server.

error log:

```INFO  [localhost-startStop-1] [DefaultSolrServerService] Starting Solr server for instance: [name: default, port: 8983]
Waiting up to 30 seconds to see Solr running on port 8983 [/]
Started Solr server on port 8983 (pid=8405). Happy searching!
.
.
.
INFO  [localhost-startStop-1] [AbstractSolrServerController] Solr server not yet started for instance: [name: default, port: 8983] [retry: 7, interval: 5000ms]

INFO: (Enh120375):  AspectJ attempting reweave of 'org/tanukisoftware/wrapper/WrapperSimpleApp'
INFO: (Enh120375):  AspectJ attempting reweave of 'org/apache/catalina/startup/Catalina'
INFO: (Enh120375):  AspectJ attempting reweave of 'org/tanukisoftware/wrapper/WrapperManager'
INFO: (Enh120375):  AspectJ attempting reweave of 'org/apache/catalina/util/LifecycleBase'
INFO: (Enh120375):  AspectJ attempting reweave of 'org/apache/catalina/core/StandardContext'
.
.
INFO  [localhost-startStop-1] [AbstractSolrServerController] Solr server not yet started for instance: [name: default, port: 8983] [retry: 10, interval: 5000ms]

ERROR [localhost-startStop-1] [AbstractSolrServerController] Solr server is still not running after calling start command for instance: [name: default, port: 8983]
ERROR [localhost-startStop-1] [DefaultSolrServerService] de.hybris.platform.solrserver.SolrServerException: Solr server is still not running after calling start command for instance: [name: default, port: 8983]

WARN  [localhost-startStop-1] [CloseAwareApplicationContext] Exception encountered during context initialization - cancelling refresh attempt
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultSolrServerService' defined in class path resource [global-solrserver-spring.xml]: InvINFO   | jvm 1    | main    | 2016/08/16 14:14:10.627 | ERROR [localhost-startStop-1] [AbstractSolrServerController] Solr server is still not running after calling start command for instance: [name: default, port: 8983]

INFO   | jvm 1    | main    | 2016/08/16 14:14:10.627 | ERROR [localhost-startStop-1] [DefaultSolrServerService] de.hybris.platform.solrserver.SolrServerException: Solr server is still not running after calling start command for instance: [name: default, port: 8983]
INFO   | jvm 1    | main    | 2016/08/16 14:14:10.627 | WARN  [localhost-startStop-1] [CloseAwareApplicationContext] Exception encountered during context initialization - cancelling refresh attempt
INFO   | jvm 1    | main    | 2016/08/16 14:14:10.627 | org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultSolrServerService' defined in class path resource [global-solrserver-spring.xml]: Invocation of init method failed; nested exception is de.hybris.platform.solrserver.SolrServerException: Solr server is still not running after calling start command for instance: [name: default, port: 8983]
INFO   | jvm 1    | main    | 2016/08/16 14:14:10.627 |         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
INFO   | jvm 1    | main    | 2016/08/16 14:14:10.627 |         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
INFO   | jvm 1    | main    | 2016/08/16 14:14:10.627 |         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
INFO   | jvm 1    | main    | 2016/08/16 14:14:10.627 |         at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
INFO   | jvm 1    | main    | 2016/08/16 14:14:10.627 |         at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
INFO   | jvm 1    | main    | 2016/08/16 14:14:10.627 |         at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
INFO   | jvm 1    | main    | 2016/08/16 14:14:10.627 |         at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
INFO   | jvm 1    | main    | 2016/08/16 14:14:10.627 |         at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:755)
INFO   | jvm 1    | main    | 2016/08/16 14:14:10.627 |         at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
INFO   | jvm 1    | main    | 2016/08/16 14:14:10.627 |         at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
INFO   | jvm 1    | main    | 2016/08/16 14:14:10.627 |         at de.hybris.platform.core.HybrisContextFactory.refreshContext(HybrisContextFactory.java:98)
INFO   | jvm 1    | main    | 2016/08/16 14:14:10.627 |         at de.hybris.platform.core.HybrisContextFactory$GlobalContextFactory.build(HybrisContextFactory.java:176)
INFO   | jvm 1    | main    | 2016/08/16 14:14:10.627 |         at de.hybris.platform.core.HybrisContextHolder.getGlobalInstanceCached(HybrisContextHolder.java:134)
INFO   | jvm 1    | main    | 2016/08/16 14:14:10.627 |         at de.hybris.platform.core.HybrisContextHolder.getGlobalInstance(HybrisContextHolder.java:113)
INFO   | jvm 1    | main    | 2016/08/16 14:14:10.627 |         at de.hybris.platform.core.Registry.getSingletonGlobalApplicationContext(Registry.java:1059)
INFO   | jvm 1    | main    | 2016/08/16 14:14:10.627 |         at de.hybris.platform.cache.impl.RegionCacheAdapter.getController(RegionCacheAdapter.java:76)
INFO   | jvm 1    | main    | 2016/08/16 14:14:10.627 |         at de.hybris.platform.cache.impl.RegionCacheAdapter.getOrAddUnit(RegionCacheAdapter.java:206)
INFO   | jvm 1    | main    | 2016/08/16 14:14:10.627 |         atocation of init method failed; nested exception is de.hybris.platform.solrserver.SolrServerException: Solr server is still not running after calling start command for instance: [name: default, port: 8983]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
.
.
.
        at de.hybris.platform.core.Registry.setCurrentTenant(Registry.java:544)
        at de.hybris.platform.core.Registry.activateMasterTenant(Registry.java:607)
        at de.hybris.platf de.hybris.platform.cache.AbstractCacheUnit.get(AbstractCacheUnit.java:180)

INFO   | jvm 1    | main    | 2016/08/16 14:14:10.628 | WARN  [localhost-startStop-1] [CloseAwareApplicationContext] Exception encountered during context initialization - cancelling refresh attempt
INFO   | jvm 1    | main    | 2016/08/16 14:14:10.628 | org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultSolrServerService' defined in class path resource [global-solrserver-spring.xml]: Invocation of init method failed; nested exception is de.hybris.platform.solrserver.SolrServerException: Solr server is still not running after calling start command for instance: [name: default, port: 8983]
INFO   | jvm 1    |orm.core.Registry.startup(Registry.java:422)
        at de.hybris.platform.spring.HybrisContextLoaderListener.startRegistry(HybrisContextLoaderListener.java:237)
        at de.hybris.platform.spring.HybrisContextLoaderListener.doInitWebApplicationContext(HybrisContextLoaderListener.java:135)
        at de.hybris.platform.spring.HybrisContextLoaderListener.initWebApplicationContext(HybrisContextLoaderListener.java:125)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
        at de.hybris.platform.spring.HybrisContextLoaderListener.contextInitialized(HybrisContextLoaderListener.java:80)
        at org.apache.catalina.core.StandardContext.null(Unknown Source)
        at org.apache.catalina.core.StandardContext.null(Unknown Source)
        at org.apache.catalina.util.LifecycleBase.null(Unknown Source)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
Caused by: de.hybris.platform.solrserver.SolrServerException: Solr server is still not running after calling start command for instance: [name: default, port: 8983]
        at de.hybris.platform.solrserver.impl.AbstractSolrServerController.retryGetStatusUntilConditionIsTrue(AbstractSolrServerController.java:378)
        at de.hybris.platform.solrserver.impl.AbstractSolrServerController.ensureToStartSolr(AbstractSolrServerController.java:122)
        at de.hybris.platform.solrserver.impl.AbstractSolrServerController.start(AbstractSolrServerController.java:99)
        at de.hybris.platform.solrserver.impl.DefaultSolrServerService.startServer(DefaultSolrServerService.java:107)
        at de.hybris.platform.solrserver.impl.DefaultSolrServerService.startServers(DefaultSolrServerService.java:132)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1702)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1641)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1570)
        ... 53 more

.
.
.
INFO   | jvm 1    | main    t.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1702)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1641)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1570)
        ... 53 more

ERROR [localhost-startStop-1] [DeploymentMigrationUtil] Error while migrating deployments of extension core
org.springframework.beans.FatalBeanException: Context hybris Global Context Factory  couldn't  be created correctly due to, Error creating bean with name 'defaultSolrServerService' defined in class path resource [global-solrserver-spring.xml]: Invocation of init method failed; nested exception is de.hybris.platform.solrserver.SolrServerException: Solr server is still not running after calling start command for instance: [name: default, port: 8983]
        at de.hybris.platform.core.HybrisContextFactory.build(HybrisContextFactory.java:317)
        at de.hybris.platform.core.HybrisContextFactory$GlobalContextFactory.buildSelf(HybrisContextFactory.java:189)
        at de.hybris.platform.core.HybrisContextFactory$GlobalContextFactory.build(HybrisContextFactory.java:175)
        at de.hybris.platform.core.HybrisContextHolder.getGlobalInstanceCached(HybrisContextHolder.java:134)
        at de.hybris.platform.core.HybrisContextHolder.getGlobalInstance(HybrisContextHolder.java:113)
        at de.hybris.platform.core.Registry.getSingletonGlobalApplicationContext(Registry.java:1059)
        at de.hybris.platform.cache.impl.RegionCacheAdapter.getController(RegionCacheAdapter.java:76)
        at de.hybris.platform.cache.impl.RegionCacheAdapter.removeUnit(RegionCacheAdapter.java:259)
        at de.hybris.platform.cache.AbstractCacheUnit.get(AbstractCacheUnit.java:199)
        at de.hybris.platform.persistence.type.ComposedType_HJMPWrapper$FindByCodeExact1FinderResult.getFinderResult(ComposedType_HJMPWrapper.java:1811)
        at de.hybris.platform.persistence.type.ComposedType_HJMPWrapper.ejbFindByCodeExact(ComposedType_HJMPWrapper.java:1870)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at de.hybris.platform.util.Utilities.callMethod(Utilities.java:1069)
        at de.hybris.platform.util.Utilities.callMethod(Utilities.java:1059)
        at de.hybris.platform.persistence.framework.HomeInvocationHandler.invoke(HomeInvocationHandler.java:93)
        at com.sun.proxy.$Proxy17.findByCodeExact(Unknown Source)
        at de.hybris.platform.persistence.type.TypeManagerEJB.findByCodeExact(TypeManagerEJB.java:271)
        at de.hybris.platform.persistence.type.TypeManagerEJB.getComposedType(TypeManagerEJB.java:459)
        at de.hybris.platform.util.migration.DeploymentMigrationUtil.migrateSelectedDeployments(DeploymentMigrationUtil.java:458)
        at de.hybris.platform.core.AbstractTenant.migrateCoreTypes(AbstractTenant.java:910)
        at de.hybris.platform.core.Abst| 2016/08/16 14:14:11.231 |      at de.hybris.platform.persistence.type.ComposedType_HJMPWrapper$FindByCodeExact1FinderResult.getFinderResult(ComposedType_HJMPWrapper.java:1811)
.
.
.
Caused by: org.springframework.beans.FatalBeanException: Context hybris Global Context Factory  couldn't  be created correctly due to, Error creating bean with name 'defaultSolrServerService' defined in class path resource [global-solrserver-spring.xml]: Invocation of init method failed; nested exception is de.hybris.platform.solrserver.SolrServerException: Solr server is still not running after calling start cINFO   | jvm 1    | main    | 2016/08/16 14:14:11.732 | INFO  [localhost-startStop-1] [HybrisContextFactory] Initializing <<global>> Spring ApplicationContext took: (34.50 μs)
INFO   | jvm 1    | main    | 2016/08/16 14:14:11.732 | de.hybris.platform.core.UninstantiableCoreApplicationContextException: Error creating Spring application context.

INFO   | jvm 1    | main    | 2016/08/16 14:14:11.733 | Caused by: org.springframework.beans.FatalBeanException: Context hybris Global Context Factory  couldn't  be created correctly due to, Error creating bean with name 'defaultSolrServerService' defined in class path resource [global-solrserver-spring.xml]: Invocation of init method failed; nested exception is de.hybris.platform.solrserver.SolrServerException: Solr server is still not running after calling start command for instance: [name: default, port: 8983]
INFO   | jvm 1    | main    | 2016/08/16 14:14:11.733 | Error creating Spring application context. Shutting down hybris platform since the system cannot be used without working Spring context...
INFO   | jvm 1    | main    | 2016/08/16 14:14:11.733 | shutting down hybris registry..
INFO   | jvm 1    | main    | 2016/08/16 14:14:11.733 | INFO  [Thread-2] [HybrisContextFactory] Initializing <<global>> Spring ApplicationContext took: (44.32 μs)
INFO   | jvm 1    | main    | 2016/08/16 14:14:11.733 | ERROR [Thread-2] [JMXBeanLoader] Can't unregister jmxbeans on shutdown of the tenant <<master>>
INFO   | jvm 1    | main    | 2016/08/16 14:14:11.733 | org.springframework.beans.FatalBeanException: Context hybris Global Context Factory  couldn't  be created correctly due to, Error creating bean with name 'defaultSolrServerService' defined in class path resource [global-solrserver-spring.xml]: Invocation of init method failed; nested exception is de.hybris.platform.solrserver.SolrServerException: Solr server is still not running after calling start command for instance: [name: default, port: 8983]
.
.
.
INFO   | jvm 1    | main    | 2016/08/16 14:14:11.733 |         at de.hybommand for instance: [name: default, port: 8983]
        at de.hybris.platform.core.HybrisContextFactory.build(HybrisContextFactory.java:317)
        at de.hybris.platform.core.HybrisContextFactory$GlobalContextFactory.buildSelf(HybrisContextFactory.java:189)
        at de.hybris.platform.core.HybrisContextFactory$GlobalContextFactory.build(HybrisContextFactory.java:175)
        at de.hybris.platform.core.HybrisContextHolder.getGlobalInstanceCached(HybrisContextHolder.java:134)
        at de.hybris.platform.core.HybrisContextHolder.getGlobalInstance(HybrisContextHolder.java:113)
        at de.hybris.platform.core.HybrisContextHolder.getAppCtxFactory(HybrisContextHolder.java:164)
        at de.hybris.platform.core.HybrisContextHolder.getApplicationInstance(HybrisContextHolder.java:90)
        at de.hybris.platform.core.AbstractTenant.createCoreApplicationContext(AbstractTenant.java:686)
        at de.hybris.platform.core.AbstractTenant.doStartupSafe(AbstractTenant.java:724)
        ... 20 more
Error creating Spring application context. Shutting down hybris platform since the system cannot be used without working Spring context...
shutting down hybris registry..
INFO  [Thread-2] [HybrisContextFactory] Initializing <<global>> Spring ApplicationContext took: (44.32 μs)
ERROR [Thread-2] [JMXBeanLoader] Can't unregister jmxbeans on shutdown of the tenant <<master>>
org.springframework.beans.FatalBeanException: Context hybris Global Context Factory  couldn't  be created correctly due to, Error creating bean with name 'defaultSolrServerService' defined in class path resource [global-solrserver-spring.xml]: Invocation of init method failed; nested exception is de.hybris.platform.solrserver.SolrServerException: Solr server is still not running after calling start command for instance: [name: default, port: 8983]
        at de.hybris.platform.core.HybrisContextFactory.build(HybrisContextFactory.java:317)
        at de.hybris.platform.core.HybrisContextFactory$GlobalContextFactory.buildSelf(HybrisContextFactory.java:189)
        at de.hybris.platform.core.HybrisContextFactory$GlobalContextFactory.build(HybrisContextFactory.java:175)
        at de.hybris.platform.core.HybrisContextHolder.getGlobalInstanceCached(HybrisContextHolder.java:134)
        at de.hybris.platform.core.HybrisContextHolder.getGlobalInstance(HybrisContextHolder.java:113)
        at de.hybris.platform.core.Registry.getSingletonGlobalApplicationContext(Registry.java:1059)
        at de.hybris.platform.core.JMXBeanLoader.getMBeanRegistry(JMXBeanLoader.java:155)
        at de.hybris.platform.core.JMXBeanLoader.beforeTenantShutDown(JMXBeanLoader.java:116)
        at de.hybris.platform.core.AbstractTenant.notifyTenantListenersBeforeShutdown(AbstractTenant.java:1236)
        at de.hybris.platform.core.AbstractTenant.doShutdown(AbstractTenant.java:987)
        at de.hybris.platform.core.AbstractTenant.doShutDown(AbstractTenant.java:948)
        at de.hybris.platform.core.Registry.destroy(Registry.java:309)
        at de.hybris.platform.util.RedeployUtilities.shutdown(RedeployUtilities.java:74)
        at de.hybris.platform.util.RedeployUtilities$1.run(RedeployUtilities.java:38)
INFO  [Thread-2] [HybrisContextFactory] Initializing <<global>> Spring ApplicationContext took: (61.35 μs)
ERROR [Thread-2] [RegionCacheAdapter] Unable to clear cache. Failed on region null. Last key null null
org.springframework.beans.FatalBeanException: Context hybris Global Context Factory  couldn't  be created correctly due to, Error creating bean with name 'defaultSolrServerService' defined in class path resource [global-solrserver-spring.xml]: Invocation of init method failed; nested exception is de.hybris.platform.solrserver.SolrServerException: Solr server is still not running after calling start command for instance: [name: default, port: 8983]
        at de.hybris.platform.core.HybrisContextFactory.build(HybrisContextFactory.java:317)
        at de.hybris.platform.core.HybrisContextFactory$GlobalContextFactory.buildSelf(HybrisContextFactory.java:189)
        at de.hybris.platform.core.HybrisContextFactory$GlobalContextFactory.build(HybrisContextFactory.java:175)
        at de.hybris.platform.core.HybrisContextHolder.getGlobalInstanceCached(ris.platform.util.RedeployUtilities.shutdown(RedeployUtilities.java:74)
INFO   | jvm 1    | main    | 2016/08/16 14:14:11.733 |         at de.hybris.platform.util.RedeployUtilities$1.run(RedeployUtilities.java:38)
INFO   | jvm 1    | main    | 2016/08/16 14:14:12.035 | INFO  [Thread-2] [HybrisContextFactory] Initializing <<global>> Spring ApplicationContext took: (61.35 μs)
INFO   | jvm 1    | main    | 2016/08/16 14:14:12.035 | ERROR [Thread-2] [RegionCacheAdapter] Unable to clear cache. Failed on region null. Last key null null
INFO   | jvm 1    | main    | 2016/08/16 14:14:12.035 | org.springframework.beans.FatalBeanException: Context hybris Global Context Factory  couldn't  be created correctly due to, Error creating bean with name 'defaultSolrServerService' defined in class path resource [global-solrserver-spring.xml]: Invocation of init method failed; nested exception is de.hybris.platform.solrserver.SolrServerException: Solr server is still not running after calling start command for instance: [name: default, port: 8983]
.
.
INFO   | jvm 1    | main    |HybrisContextHolder.java:134)
        at de.hybris.platform.core.HybrisContextHolder.getGlobalInstance(HybrisContextHolder.java:113)
        at de.hybris.platform.core.Registry.getSingletonGlobalApplicationContext(Registry.java:1059)
        at de.hybris.platform.cache.impl.RegionCacheAdapter.getController(RegionCacheAdapter.java:76)
        at de.hybris.platform.cache.impl.RegionCacheAdapter.clear(RegionCacheAdapter.java:288)
        at de.hybris.platform.core.AbstractTenant.shutdownCache(AbstractTenant.java:1061)
        at de.hybris.platform.core.AbstractTenant.doShutdown(AbstractTenant.java:1003)
        at de.hybris.platform.core.AbstractTenant.doShutDown(AbstractTenant.java:948)
        at de.hybris.platform.core.Registry.destroy(Registry.java:309)
        at de.hybris.platform.util.RedeployUtilities.shutdown(RedeployUtilities.java:74)
        at de.hybris.platform.util.RedeployUtilities$1.run(RedeployUtilities.java:38)
org.springframework.beans.FatalBeanException: Context hybris Global Context Factory  couldn't  be created correctly due to, Error creating bean with name 'defaultSolrServerService' defined in class path resource [global-solrserver-spring.xml]: Invocation of init method failed; nested exception is de.hybris.platform.solrserver.SolrServerException: Solr server is still not running after calling start command for instance: [name: default, port: 8983]
        at de.hybris.platform.core.HybrisContextFactory.build(HybrisContextFactory.java:317)
        at de.hybris.platform.core.HybrisContextFactory$GlobalContextFactory.buildSelf(HybrisContextFactory.java:189)
        at de.hybris.platform.core.HybrisContextFactory$GlobalContextFactory.build(HybrisContextFactory.java:175)
        at de.hybris.platform.core.HybrisContextHolder.getGlobalInstanceCached(HybrisContextHolder.java:134)
        at de.hybris.platform.core.HybrisContextHolder.getGlobalInstance(HybrisContextHolder.java:113)
        at de.hybris.platform.core.Registry.getSingletonGlobalApplicationContext(Registry.java:1059)
        at de.hybris.platform.cache.impl.RegionCacheAdapter.getController(RegionCacheAdapter.java:76)
        at de.hybris.platform.cache.impl.RegionCacheAdapter.clear(RegionCacheAdapter.java:288)
        at de.hybris.platform.core.AbstractTenant.shutdownCache(AbstractTenant.java:1061)
        at de.hybris.platform.core.AbstractTenant.doShutdown(AbstractTenant.java:1003)
        at de.hybris.platform.core.AbstractTenant.doShutDown(AbstractTenant.java:948)
        at de.hybris.platform.core.Registry.destroy(Registry.java:309)
        at de.hybris.platform.util.RedeployUtilities.shutdown(RedeployUtilities.java:74)
        at de.hybris.platform.util.RedeployUtilities$1.run(RedeployUtilities.java:38)
INFO  [Thread-2] [HybrisContextFactory] Initializing <<global>> Spring ApplicationContext took: (21.21 μs)
ERROR [Thread-2] [RegionCacheAdapter] Unable to clear cache. Failed on region null. Last key null null
org.springframework.beans.FatalBeanException: Context hybris Global Context Factory  couldn't  be created correctly due to, Error creating bean with name 'defaultSolrServerService' defined in class path resource [global-solrserver-spring.xml]: Invocation of init method failed; nested exception is de.hybris.platform.solrserver.SolrServerException: Solr server is still not running after calling start command for instance: [name: default, port: 8983]
        at de.hybris.platform.core.HybrisContextFactory.build(HybrisContextFactory.java:317)
        at de.hybris.platform.core.HybrisContextFactory$GlobalContextFactory.buildSelf(HybrisContextFactory.java:189)
        at de.hybris.platform.core.HybrisContextFactory$GlobalContextFactory.build(HybrisContextFactory.java:175)
        at de.hybris.platform.core.HybrisContextHolder.getGlobalInstanceCached(HybrisContextHolder.java:134)
        at de.hybris.platform.core.HybrisContextHolder.getGlobalInstance(HybrisContextHolder.java:113)
        at de.hybris.platform.core.Registry.getSingletonGlobalApplicationContext(Registry.java:1059)
        at de.hybris.platform.cache.impl.RegionCacheAdapter.getController(RegionCacheAdapter.java:76)
        at de.hybris.platform.cache.impl.RegionCacheAdapter.clear(RegionCacheAdapter.java:288)
        at de.hybris.platform.cache.impl.RegionCacheAdapter.destroy(Region 2016/08/16 14:14:12.036 |    at de.hybris.platform.core.HybrisContextHolder.getGlobalInstanceCached(HybrisContextHolder.java:134)
.
.
.
INFO   | jvm 1    | main    | 2016/08/16 14:14:12.537 |
STATUS | wrapper  | main    | 2016/08/16 14:14:14.169 | <-- Wrapper Stopped
```

答: Well as it clearly says error while creating bean with name default so or server service..so it a straight says bean error ..need to fix if there.without anything.like adding properties.</p>

Body:
I am not able to start the Hybris server due to the starting issue with SOLR server.

Kindly help me in this regard so that I can start the Hybris tomcat server.

error log:

INFO  [localhost-startStop-1] [DefaultSolrServerService] Starting Solr server for instance: [name: default, port: 8983]
Waiting up to 30 seconds to see Solr running on port 8983 [/]
Started Solr server on port 8983 (pid=8405). Happy searching!
.
.
.
INFO  [localhost-startStop-1] [AbstractSolrServerController] Solr server not yet started for instance: [name: default, port: 8983] [retry: 7, interval: 5000ms]

INFO: (Enh120375):  AspectJ attempting reweave of 'org/tanukisoftware/wrapper/WrapperSimpleApp'
INFO: (Enh120375):  AspectJ attempting reweave of 'org/apache/catalina/startup/Catalina'
INFO: (Enh120375):  AspectJ attempting reweave of 'org/tanukisoftware/wrapper/WrapperManager'
INFO: (Enh120375):  AspectJ attempting reweave of 'org/apache/catalina/util/LifecycleBase'
INFO: (Enh120375):  AspectJ attempting reweave of 'org/apache/catalina/core/StandardContext'
.
.
INFO  [localhost-startStop-1] [AbstractSolrServerController] Solr server not yet started for instance: [name: default, port: 8983] [retry: 10, interval: 5000ms]

ERROR [localhost-startStop-1] [AbstractSolrServerController] Solr server is still not running after calling start command for instance: [name: default, port: 8983]
ERROR [localhost-startStop-1] [DefaultSolrServerService] de.hybris.platform.solrserver.SolrServerException: Solr server is still not running after calling start command for instance: [name: default, port: 8983]

WARN  [localhost-startStop-1] [CloseAwareApplicationContext] Exception encountered during context initialization - cancelling refresh attempt
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultSolrServerService' defined in class path resource [global-solrserver-spring.xml]: InvINFO   | jvm 1    | main    | 2016/08/16 14:14:10.627 | ERROR [localhost-startStop-1] [AbstractSolrServerController] Solr server is still not running after calling start command for instance: [name: default, port: 8983]

INFO   | jvm 1    | main    | 2016/08/16 14:14:10.627 | ERROR [localhost-startStop-1] [DefaultSolrServerService] de.hybris.platform.solrserver.SolrServerException: Solr server is still not running after calling start command for instance: [name: default, port: 8983]
INFO   | jvm 1    | main    | 2016/08/16 14:14:10.627 | WARN  [localhost-startStop-1] [CloseAwareApplicationContext] Exception encountered during context initialization - cancelling refresh attempt
INFO   | jvm 1    | main    | 2016/08/16 14:14:10.627 | org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultSolrServerService' defined in class path resource [global-solrserver-spring.xml]: Invocation of init method failed; nested exception is de.hybris.platform.solrserver.SolrServerException: Solr server is still not running after calling start command for instance: [name: default, port: 8983]
INFO   | jvm 1    | main    | 2016/08/16 14:14:10.627 |         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
INFO   | jvm 1    | main    | 2016/08/16 14:14:10.627 |         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
INFO   | jvm 1    | main    | 2016/08/16 14:14:10.627 |         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
INFO   | jvm 1    | main    | 2016/08/16 14:14:10.627 |         at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
INFO   | jvm 1    | main    | 2016/08/16 14:14:10.627 |         at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
INFO   | jvm 1    | main    | 2016/08/16 14:14:10.627 |         at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
INFO   | jvm 1    | main    | 2016/08/16 14:14:10.627 |         at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
INFO   | jvm 1    | main    | 2016/08/16 14:14:10.627 |         at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:755)
INFO   | jvm 1    | main    | 2016/08/16 14:14:10.627 |         at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
INFO   | jvm 1    | main    | 2016/08/16 14:14:10.627 |         at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
INFO   | jvm 1    | main    | 2016/08/16 14:14:10.627 |         at de.hybris.platform.core.HybrisContextFactory.refreshContext(HybrisContextFactory.java:98)
INFO   | jvm 1    | main    | 2016/08/16 14:14:10.627 |         at de.hybris.platform.core.HybrisContextFactory$GlobalContextFactory.build(HybrisContextFactory.java:176)
INFO   | jvm 1    | main    | 2016/08/16 14:14:10.627 |         at de.hybris.platform.core.HybrisContextHolder.getGlobalInstanceCached(HybrisContextHolder.java:134)
INFO   | jvm 1    | main    | 2016/08/16 14:14:10.627 |         at de.hybris.platform.core.HybrisContextHolder.getGlobalInstance(HybrisContextHolder.java:113)
INFO   | jvm 1    | main    | 2016/08/16 14:14:10.627 |         at de.hybris.platform.core.Registry.getSingletonGlobalApplicationContext(Registry.java:1059)
INFO   | jvm 1    | main    | 2016/08/16 14:14:10.627 |         at de.hybris.platform.cache.impl.RegionCacheAdapter.getController(RegionCacheAdapter.java:76)
INFO   | jvm 1    | main    | 2016/08/16 14:14:10.627 |         at de.hybris.platform.cache.impl.RegionCacheAdapter.getOrAddUnit(RegionCacheAdapter.java:206)
INFO   | jvm 1    | main    | 2016/08/16 14:14:10.627 |         atocation of init method failed; nested exception is de.hybris.platform.solrserver.SolrServerException: Solr server is still not running after calling start command for instance: [name: default, port: 8983]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
.
.
.
        at de.hybris.platform.core.Registry.setCurrentTenant(Registry.java:544)
        at de.hybris.platform.core.Registry.activateMasterTenant(Registry.java:607)
        at de.hybris.platf de.hybris.platform.cache.AbstractCacheUnit.get(AbstractCacheUnit.java:180)

INFO   | jvm 1    | main    | 2016/08/16 14:14:10.628 | WARN  [localhost-startStop-1] [CloseAwareApplicationContext] Exception encountered during context initialization - cancelling refresh attempt
INFO   | jvm 1    | main    | 2016/08/16 14:14:10.628 | org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultSolrServerService' defined in class path resource [global-solrserver-spring.xml]: Invocation of init method failed; nested exception is de.hybris.platform.solrserver.SolrServerException: Solr server is still not running after calling start command for instance: [name: default, port: 8983]
INFO   | jvm 1    |orm.core.Registry.startup(Registry.java:422)
        at de.hybris.platform.spring.HybrisContextLoaderListener.startRegistry(HybrisContextLoaderListener.java:237)
        at de.hybris.platform.spring.HybrisContextLoaderListener.doInitWebApplicationContext(HybrisContextLoaderListener.java:135)
        at de.hybris.platform.spring.HybrisContextLoaderListener.initWebApplicationContext(HybrisContextLoaderListener.java:125)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
        at de.hybris.platform.spring.HybrisContextLoaderListener.contextInitialized(HybrisContextLoaderListener.java:80)
        at org.apache.catalina.core.StandardContext.null(Unknown Source)
        at org.apache.catalina.core.StandardContext.null(Unknown Source)
        at org.apache.catalina.util.LifecycleBase.null(Unknown Source)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
Caused by: de.hybris.platform.solrserver.SolrServerException: Solr server is still not running after calling start command for instance: [name: default, port: 8983]
        at de.hybris.platform.solrserver.impl.AbstractSolrServerController.retryGetStatusUntilConditionIsTrue(AbstractSolrServerController.java:378)
        at de.hybris.platform.solrserver.impl.AbstractSolrServerController.ensureToStartSolr(AbstractSolrServerController.java:122)
        at de.hybris.platform.solrserver.impl.AbstractSolrServerController.start(AbstractSolrServerController.java:99)
        at de.hybris.platform.solrserver.impl.DefaultSolrServerService.startServer(DefaultSolrServerService.java:107)
        at de.hybris.platform.solrserver.impl.DefaultSolrServerService.startServers(DefaultSolrServerService.java:132)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1702)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1641)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1570)
        ... 53 more

.
.
.
INFO   | jvm 1    | main    t.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1702)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1641)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1570)
        ... 53 more

ERROR [localhost-startStop-1] [DeploymentMigrationUtil] Error while migrating deployments of extension core
org.springframework.beans.FatalBeanException: Context hybris Global Context Factory  couldn't  be created correctly due to, Error creating bean with name 'defaultSolrServerService' defined in class path resource [global-solrserver-spring.xml]: Invocation of init method failed; nested exception is de.hybris.platform.solrserver.SolrServerException: Solr server is still not running after calling start command for instance: [name: default, port: 8983]
        at de.hybris.platform.core.HybrisContextFactory.build(HybrisContextFactory.java:317)
        at de.hybris.platform.core.HybrisContextFactory$GlobalContextFactory.buildSelf(HybrisContextFactory.java:189)
        at de.hybris.platform.core.HybrisContextFactory$GlobalContextFactory.build(HybrisContextFactory.java:175)
        at de.hybris.platform.core.HybrisContextHolder.getGlobalInstanceCached(HybrisContextHolder.java:134)
        at de.hybris.platform.core.HybrisContextHolder.getGlobalInstance(HybrisContextHolder.java:113)
        at de.hybris.platform.core.Registry.getSingletonGlobalApplicationContext(Registry.java:1059)
        at de.hybris.platform.cache.impl.RegionCacheAdapter.getController(RegionCacheAdapter.java:76)
        at de.hybris.platform.cache.impl.RegionCacheAdapter.removeUnit(RegionCacheAdapter.java:259)
        at de.hybris.platform.cache.AbstractCacheUnit.get(AbstractCacheUnit.java:199)
        at de.hybris.platform.persistence.type.ComposedType_HJMPWrapper$FindByCodeExact1FinderResult.getFinderResult(ComposedType_HJMPWrapper.java:1811)
        at de.hybris.platform.persistence.type.ComposedType_HJMPWrapper.ejbFindByCodeExact(ComposedType_HJMPWrapper.java:1870)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at de.hybris.platform.util.Utilities.callMethod(Utilities.java:1069)
        at de.hybris.platform.util.Utilities.callMethod(Utilities.java:1059)
        at de.hybris.platform.persistence.framework.HomeInvocationHandler.invoke(HomeInvocationHandler.java:93)
        at com.sun.proxy.$Proxy17.findByCodeExact(Unknown Source)
        at de.hybris.platform.persistence.type.TypeManagerEJB.findByCodeExact(TypeManagerEJB.java:271)
        at de.hybris.platform.persistence.type.TypeManagerEJB.getComposedType(TypeManagerEJB.java:459)
        at de.hybris.platform.util.migration.DeploymentMigrationUtil.migrateSelectedDeployments(DeploymentMigrationUtil.java:458)
        at de.hybris.platform.core.AbstractTenant.migrateCoreTypes(AbstractTenant.java:910)
        at de.hybris.platform.core.Abst| 2016/08/16 14:14:11.231 |      at de.hybris.platform.persistence.type.ComposedType_HJMPWrapper$FindByCodeExact1FinderResult.getFinderResult(ComposedType_HJMPWrapper.java:1811)
.
.
.
Caused by: org.springframework.beans.FatalBeanException: Context hybris Global Context Factory  couldn't  be created correctly due to, Error creating bean with name 'defaultSolrServerService' defined in class path resource [global-solrserver-spring.xml]: Invocation of init method failed; nested exception is de.hybris.platform.solrserver.SolrServerException: Solr server is still not running after calling start cINFO   | jvm 1    | main    | 2016/08/16 14:14:11.732 | INFO  [localhost-startStop-1] [HybrisContextFactory] Initializing <<global>> Spring ApplicationContext took: (34.50 μs)
INFO   | jvm 1    | main    | 2016/08/16 14:14:11.732 | de.hybris.platform.core.UninstantiableCoreApplicationContextException: Error creating Spring application context.

INFO   | jvm 1    | main    | 2016/08/16 14:14:11.733 | Caused by: org.springframework.beans.FatalBeanException: Context hybris Global Context Factory  couldn't  be created correctly due to, Error creating bean with name 'defaultSolrServerService' defined in class path resource [global-solrserver-spring.xml]: Invocation of init method failed; nested exception is de.hybris.platform.solrserver.SolrServerException: Solr server is still not running after calling start command for instance: [name: default, port: 8983]
INFO   | jvm 1    | main    | 2016/08/16 14:14:11.733 | Error creating Spring application context. Shutting down hybris platform since the system cannot be used without working Spring context...
INFO   | jvm 1    | main    | 2016/08/16 14:14:11.733 | shutting down hybris registry..
INFO   | jvm 1    | main    | 2016/08/16 14:14:11.733 | INFO  [Thread-2] [HybrisContextFactory] Initializing <<global>> Spring ApplicationContext took: (44.32 μs)
INFO   | jvm 1    | main    | 2016/08/16 14:14:11.733 | ERROR [Thread-2] [JMXBeanLoader] Can't unregister jmxbeans on shutdown of the tenant <<master>>
INFO   | jvm 1    | main    | 2016/08/16 14:14:11.733 | org.springframework.beans.FatalBeanException: Context hybris Global Context Factory  couldn't  be created correctly due to, Error creating bean with name 'defaultSolrServerService' defined in class path resource [global-solrserver-spring.xml]: Invocation of init method failed; nested exception is de.hybris.platform.solrserver.SolrServerException: Solr server is still not running after calling start command for instance: [name: default, port: 8983]
.
.
.
INFO   | jvm 1    | main    | 2016/08/16 14:14:11.733 |         at de.hybommand for instance: [name: default, port: 8983]
        at de.hybris.platform.core.HybrisContextFactory.build(HybrisContextFactory.java:317)
        at de.hybris.platform.core.HybrisContextFactory$GlobalContextFactory.buildSelf(HybrisContextFactory.java:189)
        at de.hybris.platform.core.HybrisContextFactory$GlobalContextFactory.build(HybrisContextFactory.java:175)
        at de.hybris.platform.core.HybrisContextHolder.getGlobalInstanceCached(HybrisContextHolder.java:134)
        at de.hybris.platform.core.HybrisContextHolder.getGlobalInstance(HybrisContextHolder.java:113)
        at de.hybris.platform.core.HybrisContextHolder.getAppCtxFactory(HybrisContextHolder.java:164)
        at de.hybris.platform.core.HybrisContextHolder.getApplicationInstance(HybrisContextHolder.java:90)
        at de.hybris.platform.core.AbstractTenant.createCoreApplicationContext(AbstractTenant.java:686)
        at de.hybris.platform.core.AbstractTenant.doStartupSafe(AbstractTenant.java:724)
        ... 20 more
Error creating Spring application context. Shutting down hybris platform since the system cannot be used without working Spring context...
shutting down hybris registry..
INFO  [Thread-2] [HybrisContextFactory] Initializing <<global>> Spring ApplicationContext took: (44.32 μs)
ERROR [Thread-2] [JMXBeanLoader] Can't unregister jmxbeans on shutdown of the tenant <<master>>
org.springframework.beans.FatalBeanException: Context hybris Global Context Factory  couldn't  be created correctly due to, Error creating bean with name 'defaultSolrServerService' defined in class path resource [global-solrserver-spring.xml]: Invocation of init method failed; nested exception is de.hybris.platform.solrserver.SolrServerException: Solr server is still not running after calling start command for instance: [name: default, port: 8983]
        at de.hybris.platform.core.HybrisContextFactory.build(HybrisContextFactory.java:317)
        at de.hybris.platform.core.HybrisContextFactory$GlobalContextFactory.buildSelf(HybrisContextFactory.java:189)
        at de.hybris.platform.core.HybrisContextFactory$GlobalContextFactory.build(HybrisContextFactory.java:175)
        at de.hybris.platform.core.HybrisContextHolder.getGlobalInstanceCached(HybrisContextHolder.java:134)
        at de.hybris.platform.core.HybrisContextHolder.getGlobalInstance(HybrisContextHolder.java:113)
        at de.hybris.platform.core.Registry.getSingletonGlobalApplicationContext(Registry.java:1059)
        at de.hybris.platform.core.JMXBeanLoader.getMBeanRegistry(JMXBeanLoader.java:155)
        at de.hybris.platform.core.JMXBeanLoader.beforeTenantShutDown(JMXBeanLoader.java:116)
        at de.hybris.platform.core.AbstractTenant.notifyTenantListenersBeforeShutdown(AbstractTenant.java:1236)
        at de.hybris.platform.core.AbstractTenant.doShutdown(AbstractTenant.java:987)
        at de.hybris.platform.core.AbstractTenant.doShutDown(AbstractTenant.java:948)
        at de.hybris.platform.core.Registry.destroy(Registry.java:309)
        at de.hybris.platform.util.RedeployUtilities.shutdown(RedeployUtilities.java:74)
        at de.hybris.platform.util.RedeployUtilities$1.run(RedeployUtilities.java:38)
INFO  [Thread-2] [HybrisContextFactory] Initializing <<global>> Spring ApplicationContext took: (61.35 μs)
ERROR [Thread-2] [RegionCacheAdapter] Unable to clear cache. Failed on region null. Last key null null
org.springframework.beans.FatalBeanException: Context hybris Global Context Factory  couldn't  be created correctly due to, Error creating bean with name 'defaultSolrServerService' defined in class path resource [global-solrserver-spring.xml]: Invocation of init method failed; nested exception is de.hybris.platform.solrserver.SolrServerException: Solr server is still not running after calling start command for instance: [name: default, port: 8983]
        at de.hybris.platform.core.HybrisContextFactory.build(HybrisContextFactory.java:317)
        at de.hybris.platform.core.HybrisContextFactory$GlobalContextFactory.buildSelf(HybrisContextFactory.java:189)
        at de.hybris.platform.core.HybrisContextFactory$GlobalContextFactory.build(HybrisContextFactory.java:175)
        at de.hybris.platform.core.HybrisContextHolder.getGlobalInstanceCached(ris.platform.util.RedeployUtilities.shutdown(RedeployUtilities.java:74)
INFO   | jvm 1    | main    | 2016/08/16 14:14:11.733 |         at de.hybris.platform.util.RedeployUtilities$1.run(RedeployUtilities.java:38)
INFO   | jvm 1    | main    | 2016/08/16 14:14:12.035 | INFO  [Thread-2] [HybrisContextFactory] Initializing <<global>> Spring ApplicationContext took: (61.35 μs)
INFO   | jvm 1    | main    | 2016/08/16 14:14:12.035 | ERROR [Thread-2] [RegionCacheAdapter] Unable to clear cache. Failed on region null. Last key null null
INFO   | jvm 1    | main    | 2016/08/16 14:14:12.035 | org.springframework.beans.FatalBeanException: Context hybris Global Context Factory  couldn't  be created correctly due to, Error creating bean with name 'defaultSolrServerService' defined in class path resource [global-solrserver-spring.xml]: Invocation of init method failed; nested exception is de.hybris.platform.solrserver.SolrServerException: Solr server is still not running after calling start command for instance: [name: default, port: 8983]
.
.
INFO   | jvm 1    | main    |HybrisContextHolder.java:134)
        at de.hybris.platform.core.HybrisContextHolder.getGlobalInstance(HybrisContextHolder.java:113)
        at de.hybris.platform.core.Registry.getSingletonGlobalApplicationContext(Registry.java:1059)
        at de.hybris.platform.cache.impl.RegionCacheAdapter.getController(RegionCacheAdapter.java:76)
        at de.hybris.platform.cache.impl.RegionCacheAdapter.clear(RegionCacheAdapter.java:288)
        at de.hybris.platform.core.AbstractTenant.shutdownCache(AbstractTenant.java:1061)
        at de.hybris.platform.core.AbstractTenant.doShutdown(AbstractTenant.java:1003)
        at de.hybris.platform.core.AbstractTenant.doShutDown(AbstractTenant.java:948)
        at de.hybris.platform.core.Registry.destroy(Registry.java:309)
        at de.hybris.platform.util.RedeployUtilities.shutdown(RedeployUtilities.java:74)
        at de.hybris.platform.util.RedeployUtilities$1.run(RedeployUtilities.java:38)
org.springframework.beans.FatalBeanException: Context hybris Global Context Factory  couldn't  be created correctly due to, Error creating bean with name 'defaultSolrServerService' defined in class path resource [global-solrserver-spring.xml]: Invocation of init method failed; nested exception is de.hybris.platform.solrserver.SolrServerException: Solr server is still not running after calling start command for instance: [name: default, port: 8983]
        at de.hybris.platform.core.HybrisContextFactory.build(HybrisContextFactory.java:317)
        at de.hybris.platform.core.HybrisContextFactory$GlobalContextFactory.buildSelf(HybrisContextFactory.java:189)
        at de.hybris.platform.core.HybrisContextFactory$GlobalContextFactory.build(HybrisContextFactory.java:175)
        at de.hybris.platform.core.HybrisContextHolder.getGlobalInstanceCached(HybrisContextHolder.java:134)
        at de.hybris.platform.core.HybrisContextHolder.getGlobalInstance(HybrisContextHolder.java:113)
        at de.hybris.platform.core.Registry.getSingletonGlobalApplicationContext(Registry.java:1059)
        at de.hybris.platform.cache.impl.RegionCacheAdapter.getController(RegionCacheAdapter.java:76)
        at de.hybris.platform.cache.impl.RegionCacheAdapter.clear(RegionCacheAdapter.java:288)
        at de.hybris.platform.core.AbstractTenant.shutdownCache(AbstractTenant.java:1061)
        at de.hybris.platform.core.AbstractTenant.doShutdown(AbstractTenant.java:1003)
        at de.hybris.platform.core.AbstractTenant.doShutDown(AbstractTenant.java:948)
        at de.hybris.platform.core.Registry.destroy(Registry.java:309)
        at de.hybris.platform.util.RedeployUtilities.shutdown(RedeployUtilities.java:74)
        at de.hybris.platform.util.RedeployUtilities$1.run(RedeployUtilities.java:38)
INFO  [Thread-2] [HybrisContextFactory] Initializing <<global>> Spring ApplicationContext took: (21.21 μs)
ERROR [Thread-2] [RegionCacheAdapter] Unable to clear cache. Failed on region null. Last key null null
org.springframework.beans.FatalBeanException: Context hybris Global Context Factory  couldn't  be created correctly due to, Error creating bean with name 'defaultSolrServerService' defined in class path resource [global-solrserver-spring.xml]: Invocation of init method failed; nested exception is de.hybris.platform.solrserver.SolrServerException: Solr server is still not running after calling start command for instance: [name: default, port: 8983]
        at de.hybris.platform.core.HybrisContextFactory.build(HybrisContextFactory.java:317)
        at de.hybris.platform.core.HybrisContextFactory$GlobalContextFactory.buildSelf(HybrisContextFactory.java:189)
        at de.hybris.platform.core.HybrisContextFactory$GlobalContextFactory.build(HybrisContextFactory.java:175)
        at de.hybris.platform.core.HybrisContextHolder.getGlobalInstanceCached(HybrisContextHolder.java:134)
        at de.hybris.platform.core.HybrisContextHolder.getGlobalInstance(HybrisContextHolder.java:113)
        at de.hybris.platform.core.Registry.getSingletonGlobalApplicationContext(Registry.java:1059)
        at de.hybris.platform.cache.impl.RegionCacheAdapter.getController(RegionCacheAdapter.java:76)
        at de.hybris.platform.cache.impl.RegionCacheAdapter.clear(RegionCacheAdapter.java:288)
        at de.hybris.platform.cache.impl.RegionCacheAdapter.destroy(Region 2016/08/16 14:14:12.036 |    at de.hybris.platform.core.HybrisContextHolder.getGlobalInstanceCached(HybrisContextHolder.java:134)
.
.
.
INFO   | jvm 1    | main    | 2016/08/16 14:14:12.537 |
STATUS | wrapper  | main    | 2016/08/16 14:14:14.169 | <-- Wrapper Stopped


来源: stackexchange

问:
How to align  value to center vertically?
I need to align td cell value to center, both horizontally and vertically.  has a rowspan attribute.

The output right now is like:

```<code>A  |  B  |  C  |  D
1  |  2  |  3  |  4
1  |  2  |  3  |
1  |  2  |  3  |
</code>```

Desired:

```<code>A  |  B  |  C  |  D
1  |  2  |  3  |
1  |  2  |  3  |  4
1  |  2  |  3  |
1  |  2  |  3  |
</code>```

ContentLicense: CC BY-SA 4.0

Title: How to align <td rowspan ="value"> value to center vertically?

Body:
I need to align td cell value to center, both horizontally and vertically.  has a rowspan attribute.

The output right now is like:

A  |  B  |  C  |  D
1  |  2  |  3  |  4
1  |  2  |  3  |
1  |  2  |  3  |

Desired:

A  |  B  |  C  |  D
1  |  2  |  3  |
1  |  2  |  3  |  4
1  |  2  |  3  |
1  |  2  |  3  |

Body:
Just add rowspan 4.

<table>
    <tr>
        <td>A</td>
        <td>B</td>
        <td>C</td>
        <td>D</td>
    </tr>
    <tr>
        <td>1</td>
        <td>1</td>
        <td>1</td>
        <td rowspan="4">1</td>
    </tr>
    <tr>
        <td>1</td>
        <td>1</td>
        <td>1</td>
    </tr>
    <tr>
        <td>1</td>
        <td>1</td>
        <td>1</td>
    </tr>
</table>

ContentLicense: CC BY-SA 3.0


问:
The best way to handle keys strings
I'm working in a web applications and always i need to use some keys to save some values into object like :

Session["CurrentUser"] = Users.CurrentUser;

I tried to put them into a resource file but it doesn't make sense as i will not need to localize them and the code generated by the resource file looks for the culture every time i get a string from the file.

what is the best way to handle those keys in order to avoid spelling mismatches?

I'm using Visual Studio 2010 and ASP.NET MVC2

答:
You could use constants:

```<code>public static class Constants
{
    public const string CurrentUserKey = "CurrentUser";
}
</code>```

and then:

```<code>Session[Constants.CurrentUserKey] = Users.CurrentUser;
</code>```

Also the compiler doesn't care much about spelling or grammar mistakes, as long as the strings match he is OK :-)

ContentLicense: CC BY-SA 2.5

Title: The best way to handle keys strings

Body:
You could use constants:

public static class Constants
{
    public const string CurrentUserKey = "CurrentUser";
}

and then:

Session[Constants.CurrentUserKey] = Users.CurrentUser;

Also the compiler doesn't care much about spelling or grammar mistakes, as long as the strings match he is OK :-)


问:
ImportError: cannot import name 'create_connection'
I am using Python 3.4 and websocket-client 0.44. I am trying a Python webscoket script to fetch stream data from Bitfinex
using socket. Here is my script which which i have written:

```<code>import json

from websocket import create_connection

ws = create_connection("wss://api.bitfinex.com/ws/2")
#ws.connect("wss://api2.bitfinex.com:3000/ws")
ws.send(json.dumps({
    "event": "subscribe",
    "channel": "book",
    "symbol": "tBTCUSD",
}))

while True:
    result = ws.recv()
    result = json.loads(result)
    xxx = result
    print(xxx)
    #print(result[1])

ws.close()
</code>```

and what i am getting is, error:

```<code>Traceback (most recent call last):
  File "D:/bitstamp/socket.py", line 3, in <module>
    from websocket import create_connection
  File "C:\Python34\lib\site-packages\websocket_client-0.44.0-py3.4.egg\websocket\__init__.py", line 23, in <module>
    from ._app import WebSocketApp
  File "C:\Python34\lib\site-packages\websocket_client-0.44.0-py3.4.egg\websocket\_app.py", line 35, in <module>
    from ._core import WebSocket, getdefaulttimeout
  File "C:\Python34\lib\site-packages\websocket_client-0.44.0-py3.4.egg\websocket\_core.py", line 24, in <module>
    import socket
  File "D:\bitstamp\socket.py", line 3, in <module>
    from websocket import create_connection
ImportError: cannot import name 'create_connection'
</code>```

Is there an issue in Python 3.4 or am I doing this incorrectly?

答: Don't call your script socket.py.  There is already a socket in Python's standard library, and you are conflicting with it.  You can tell that this is the problem by following the traceback: It starts in your script, descends into websocket, eventually tries to import socket, and gets your script again.

Body:
I am using Python 3.4 and websocket-client 0.44. I am trying a Python webscoket script to fetch stream data from Bitfinex
using socket. Here is my script which which i have written:

import json

from websocket import create_connection

ws = create_connection("wss://api.bitfinex.com/ws/2")
#ws.connect("wss://api2.bitfinex.com:3000/ws")
ws.send(json.dumps({
    "event": "subscribe",
    "channel": "book",
    "symbol": "tBTCUSD",
}))

while True:
    result = ws.recv()
    result = json.loads(result)
    xxx = result
    print(xxx)
    #print(result[1])

ws.close()

and what i am getting is, error:

Traceback (most recent call last):
  File "D:/bitstamp/socket.py", line 3, in <module>
    from websocket import create_connection
  File "C:\Python34\lib\site-packages\websocket_client-0.44.0-py3.4.egg\websocket\__init__.py", line 23, in <module>
    from ._app import WebSocketApp
  File "C:\Python34\lib\site-packages\websocket_client-0.44.0-py3.4.egg\websocket\_app.py", line 35, in <module>
    from ._core import WebSocket, getdefaulttimeout
  File "C:\Python34\lib\site-packages\websocket_client-0.44.0-py3.4.egg\websocket\_core.py", line 24, in <module>
    import socket
  File "D:\bitstamp\socket.py", line 3, in <module>
    from websocket import create_connection
ImportError: cannot import name 'create_connection'

Is there an issue in Python 3.4 or am I doing this incorrectly?


问:
laravel 4 artisan -- how to rollback to a specific migration state?
Say i got a.php, b.php, c.php and d.php migration classes files.  How to rollback to a specific migration state, the state defined within b.php for example, with artisan command ?

答:
Use the php artisan migrate:rollback command.

```<code>php artisan migrate:rollback
</code>```

To see what rollback will do, use the --pretend option.

```<code>php artisan migrate:rollback --pretend
</code>```

You can also specify a database connection other than the default one.

```<code>php artisan migrate:rollback --pretend --database=other-one
</code>```

Body:
Use the php artisan migrate:rollback command.

php artisan migrate:rollback

To see what rollback will do, use the --pretend option.

php artisan migrate:rollback --pretend

You can also specify a database connection other than the default one.

php artisan migrate:rollback --pretend --database=other-one


问:
Unable to Set-AzureRmKeyVaultAccessPolicy
We recently purchased an Azure App Service Certificate. I created a new Key Vault Store in the set up process for this certificate, and imported the certificate.

Now I'm trying to create a local copy of an App Service Certificate, using the powershell script provided here: https://blogs.msdn.microsoft.com/appserviceteam/2017/02/24/creating-a-local-pfx-copy-of-app-service-certificate/

However, I get an error:

Set-AzureRmKeyVaultAccessPolicy : Cannot find the Active Directory object '' in tenant 'my tenant id'. Please make sure that the user or application service principal you are authorizing is registered in the curren
  t subscription's Azure Active directory. The TenantID displayed by the cmdlet 'Get-AzureRmContext' is the current subsc
  ription's Azure Active directory.
  At C:\Projekt\Certificates\Azure\copyasc.ps1:22 char:1...

I'm not sure what else is relevant, but here's a few notes:

The username I'm sending into the failing Set-AzureRmKeyVaultAccessPolicy -UserPrincipalName temp@outlook.com, corresponds to the username of the only user I see in the default directory of Azure Active Directory.

This user's ObjectId is in the list of access policies for the keyvault (I see this by adding -Debug to the cmdlet that fails).

There are no keys in the keyvault. There is one (unmanaged) secret, the certificate.

Some threads mention stuff about AD applications. I'm not sure I understood what I read about these. Is this something I need to do when creating a keyvault?

Hope someone can help me? :)

答:
According to the error log,  your UserPrincipalName value is wrong. Please execute following command to get the  UserPrincipalName.

```<code>Get-Azureaduser
</code>```

temp@outlook.com is not a Azure AD account, its userprincipalname should be temp@outlook.com#EXT#@<your AD>.

Or you could replace UserPrincipalName to user's object id.

```<code>Set-AzureRmKeyVaultAccessPolicy -ResourceGroupName $keyVaultResourceGroupName -VaultName $keyVaultName -ObjectId $userobjectid -PermissionsToSecrets get
</code>```

Body:
According to the error log,  your UserPrincipalName value is wrong. Please execute following command to get the  UserPrincipalName.

Get-Azureaduser

temp@outlook.com is not a Azure AD account, its userprincipalname should be temp@outlook.com#EXT#@<your AD>.

Or you could replace UserPrincipalName to user's object id.

Set-AzureRmKeyVaultAccessPolicy -ResourceGroupName $keyVaultResourceGroupName -VaultName $keyVaultName -ObjectId $userobjectid -PermissionsToSecrets get


答:
<!DOCTYPE html>

    Company
    Contact
    Country

    Alfreds Futterkiste
    Maria Anders
    Germany

    Berglunds snabbköp
    Christina Berglund

    Centro comercial Moctezuma
    Francisco Chang

    Ernst Handel
    Roland Mendel

```

The text is centered aligned by default. Please check existing css as it is overwrite the align property.

Body:
<!DOCTYPE html>
<html>
<head>
<style>
#customers td, #customers th {
    border: 1px solid #ddd;
}
</style>
</head>
<body>

<table id="customers">
  <tr>
    <th>Company</th>
    <th>Contact</th>
    <th>Country</th>
  </tr>
  <tr>
    <td>Alfreds Futterkiste</td>
    <td>Maria Anders</td>
    <td rowspan ="4">Germany</td>
  </tr>
  <tr>
    <td>Berglunds snabbköp</td>
    <td>Christina Berglund</td>
  </tr>
  <tr>
    <td>Centro comercial Moctezuma</td>
    <td>Francisco Chang</td>
  </tr>
  <tr>
    <td>Ernst Handel</td>
    <td>Roland Mendel</td>
  </tr>

</table>

</body>
</html>

The text is centered aligned by default. Please check existing css as it is overwrite the align property.


问:
How to intercept all read and write access to objects at runtime?
I am working on an aging Java "Swing" application that, unfortunately, uses a non Thread-safe data model. As the number of clients with multi-threading and multi-core PCs grows, so does the number of spurious random errors due to non synchronized access to the data. We have a huge code-base, something like 6000 Java files, most of which are quite large and complicated.

I would like to create a global static ReentrantReadWriteLock to control access to the model. My plan would be to create a dummy ReadWriteLock implementation, which always succeeds and does not do anything, and use it on the productive system, while using the ReentrantReadWriteLock on the test systems, so that the transition can be gradual.

What I need is a way to "intercept" all accesses to the model in the test systems and log an error if the access is not within the scoop of an appropriate lock/unlock block. ReentrantReadWriteLock can tell you if you own a write lock. I am assuming I could track the read lock state myself by using a ThreadLocal or something.

So now comes the real question: How could I, in Java, write code that would intercept at runtime any access to any public method in a well-defined set of classes, and check if the access is within a lock/unlock block, by querying the global lock? Can this be done with AspectJ? Or anything else? And how?

答:
You might find java proxies useful.

You can't add invokation handlers to existing object, but you may 'wrap' instance of your class in a proxy. Created proxy object will still be of MyClass type.


问:
Xamarin : Adding condition inside isvisible in xaml
I am new with xamarin, I am facing an issue in my xamarin forms project.
I have an  inside listview-viewcell, having 250 width and height.
Sometimes the value of mediaUrl is null. I want to hide the Image for null mediaUrl values and make visible for other values.
My problem is if the value of the mediaUrl is null showing blank space in the UI. Inside isVisible property how can I apply this condition?
My code is giving below:        </p>

```<code>    <StackLayout>
        <ListView>
            <ListView.ItemTemplate>
                <DataTemplate>
                    <ViewCell>
                    <StackLayout>
                        <Image
                            WidthRequest="250"
                            HeightRequest="250"
                            Source="{Binding mediaUrl}"/>
                        </StackLayout>
                    </ViewCell>
                </DataTemplate>
            </ListView.ItemTemplate>
          </ListView>
    </StackLayout>
</code>```

<p>Anybody please suggest a solution with working code.
Thanks in advance       </p>

答:
You can also use trigger for that

```<code><Image.Triggers>
     <DataTrigger TargetType="Image" Binding="{Binding isMediaUrlNull}" Value="True">
        <Setter Property="IsVisible" Value="False" />
      </DataTrigger>
 </Image.Triggers>
</code>```

Edit

You can also add property in model isMediaUrlNull and try above code

```<code>public bool isMediaUrlNull {get {return !string.IsNullOrEmpty(mediaUrl);}}

<Image WidthRequest="250" HeightRequest="250" IsVisible="{Binding mediaUrl}" Source="{Binding mediaUrl}"/>
</code>```

Body:
I am new with xamarin, I am facing an issue in my xamarin forms project.
I have an  inside listview-viewcell, having 250 width and height.
Sometimes the value of mediaUrl is null. I want to hide the Image for null mediaUrl values and make visible for other values.
My problem is if the value of the mediaUrl is null showing blank space in the UI. Inside isVisible property how can I apply this condition?
My code is giving below:

    <StackLayout>
        <ListView>
            <ListView.ItemTemplate>
                <DataTemplate>
                    <ViewCell>
                    <StackLayout>
                        <Image
                            WidthRequest="250"
                            HeightRequest="250"
                            Source="{Binding mediaUrl}"/>
                        </StackLayout>
                    </ViewCell>
                </DataTemplate>
            </ListView.ItemTemplate>
          </ListView>
    </StackLayout>

Anybody please suggest a solution with working code.
Thanks in advance

Body:
You can also use trigger for that

<Image.Triggers>
     <DataTrigger TargetType="Image" Binding="{Binding isMediaUrlNull}" Value="True">
        <Setter Property="IsVisible" Value="False" />
      </DataTrigger>
 </Image.Triggers>

Edit

You can also add property in model isMediaUrlNull and try above code

public bool isMediaUrlNull {get {return !string.IsNullOrEmpty(mediaUrl);}}

<Image WidthRequest="250" HeightRequest="250" IsVisible="{Binding mediaUrl}" Source="{Binding mediaUrl}"/>


问:
spark.read.csv... reading 367 files and creating only 12 partitions - WHY?

The setup:

I am using AWS EMR and reading data from S3 for a table data

The table is represented with 367 files under one folder Each file <64MB
(which is the default block size of S3)

What I think should happen:

When I read spark.read.csv... it should create a dataframe with 367 partitions. But that doesn't happen! It uses 367 tasks to read as expected, however creates a dataframe with only 12 partitions!!

Here are the 367 tasks created when defining the dataframes using dataframe API:

```<code>val y_cdc = spark.read.csv("s3n..........")
</code>```

Here is my code that confirm that 12 partitions are created:

```<code>y_cdc.rdd.toDebugString
</code>```

RDD API works well:

Whats going on here?

答:
Return an array that contains all of the elements in this RDD.
*

@note This method should only be used if the resulting array is expected to be small, as

all the data is loaded into the driver's memory.
From the collect definition, so we can see that all the data will be loaded into the driver's memory. So the tasks will be reduced.

Body:
The setup:

I am using AWS EMR and reading data from S3 for a table data

The table is represented with 367 files under one folder Each file <64MB
(which is the default block size of S3)

What I think should happen:

When I read spark.read.csv... it should create a dataframe with 367 partitions. But that doesn't happen! It uses 367 tasks to read as expected, however creates a dataframe with only 12 partitions!!

Here are the 367 tasks created when defining the dataframes using dataframe API:

val y_cdc = spark.read.csv("s3n..........")

Here is my code that confirm that 12 partitions are created:

y_cdc.rdd.toDebugString

RDD API works well:

Whats going on here?


问:
Laravel 5 Form request validation with parameters
I am using form request validation and there are some rules that needs external values as a parameters.

Here are my validation rules for editing a business profile inside a form request class,

```<code>public function rules()
{
    return [
        'name' => 'required|unique:businesses,name,'.$business->id,
        'url' => 'required|url|unique:businesses'
    ];
}
</code>```

I can use this on the controller by type hinting it.

```<code>public function postBusinessEdit(BusinessEditRequest $request, Business $business)
{
    //
}
</code>```

But how to pass the $business object as a parameter to the rules method?

答:
Let say if we have a scenario like we want to change our validation rules depends on the type that we pass in with the route. For example:

```<code>app.dev/business/{type}
</code>```

For different type of business, we have different validation rules. All we need to do is type-hint the request on your controller method.

```<code>public function store(StoreBusiness $request)
{
    // The incoming request is valid...
}
</code>```

For the custom form request

```<code>class StoreBussiness extends FormRequest
{

    public function rules()
    {
        $type = $this->route()->parameter('type');

        $rules = [];
        if ($type === 'a') {
        }

        return rules;
    }
}
</code>```

Body:
I am using form request validation and there are some rules that needs external values as a parameters.

Here are my validation rules for editing a business profile inside a form request class,

public function rules()
{
    return [
        'name' => 'required|unique:businesses,name,'.$business->id,
        'url' => 'required|url|unique:businesses'
    ];
}

I can use this on the controller by type hinting it.

public function postBusinessEdit(BusinessEditRequest $request, Business $business)
{
    //
}

But how to pass the $business object as a parameter to the rules method?

Body:
Let say if we have a scenario like we want to change our validation rules depends on the type that we pass in with the route. For example:

app.dev/business/{type}

For different type of business, we have different validation rules. All we need to do is type-hint the request on your controller method.

public function store(StoreBusiness $request)
{
    // The incoming request is valid...
}

For the custom form request

class StoreBussiness extends FormRequest
{

    public function rules()
    {
        $type = $this->route()->parameter('type');

        $rules = [];
        if ($type === 'a') {
        }

        return rules;
    }
}


问:
Googleusercontent breaking image links in newsletter
We send automatic emails to our customers.
Google is rewriting the email's image links and completely breaking them, giving a 404 error

Google is rewriting to:

https://ci5.googleusercontent.com/proxy/lVDjm7qabVoI9h7Coj2diPm68n9EGr70vaBDLDFWRsy4fPRbABMENW-f24JPGUgCWLdw7bPE5RvA5me4D9vVsS_pec0Xpc1uheArG_tIGk71Hjs=s0-d-e1-ft#http://www.example.com/image.png

404 error

So there is something wrong with the links that are being created by Google or the images are just not being uploaded to the googleusercontent server, but I have no idea how to solve the issue.

答:
After much struggling, I discovered a solution for google injecting its own proxy server image URL.

For me, it was hosting the image privately (on my own server) that was causing the problem. After hosting the image publicly (on Mailchimp's Content Manager, for example) I was able to serve my images much more reliably.

I really hope this helps as it was causing me all kinds of problems.

Good luck!


问:
How to access azure VM directory from my machine
I want to give read-write access to a specific folder in Azure VM to someone from his/her machine at home. I do not want him to give access to login to the machine, but some way so he/she can reach the directory and make changes. Any ideas?</p>

答:
I do not want him to give access to login to the machine, but some way
  so he/she can reach the directory and make changes. Any ideas?

According to your description, maybe we can deploy FTP on that VM. In this way, he/she can access this folder on internet, we can give them read-write permission.

Here a similar case about how to deploy FTP on windows server, please refer to it.


问:
Python Selenium, Scraping dynamic drop down
I am using Selenium and python for web scraping and the page that i am using for testing this link

But the problem is i am not able to handle the dynamic content of the drop down, here is the problem arises

While selecting the state, the city is loaded based on the state, Some Php and js are going in the back end as far as i know.

So, i searched the web and came with a solution to wait for the sometime please use this link as reference.

The following is a part of my code

```<code>from selenium import webdriver
from selenium.webdriver.support.ui import Select
from selenium.webdriver.support.ui import WebDriverWait

from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC

chrome_path = r"E:\chromedriver.exe"

driver = webdriver.Chrome(chrome_path)

driver.get("http://www.blooddonors.in")
select = Select(driver.find_element_by_xpath('/html/body/table[3]/tbody/tr/td[2]/table[1]/tbody/tr/td/form/table/tbody/tr[2]/td[1]/select'))

select.select_by_visible_text('Tamil Nadu')
driver.implicitly_wait(60)
drop = Select(driver.find_element_by_xpath('//*[@id="div_city"]/select'))
select.select_by_visible_text('Coimbotore')
</code>```

I am using a windows sys and i tried using CMD. It doesn't need a wait function it works fine without it.

The error that i am facing is:

```<code>raise NoSuchElementException("Could not locate element with visible text: %s" % text)
selenium.common.exceptions.NoSuchElementException: Message: Could not locate element with visible text: Coimbotore
</code>```

But their it is actually their.

If someone can help me resolve the issue it would be great and i can move on to the next.

Thanks

答:
Your second drop-down defined as drop while you're still trying to handle first drop-down (select) which doesn't have "Coimbotore" option...

Just replace

```<code>drop = Select(driver.find_element_by_xpath('//*[@id="div_city"]/select'))
select.select_by_visible_text('Coimbotore')
</code>```

with

```<code>drop = Select(driver.find_element_by_xpath('//select[@name="city" and count(option) > 1]'))
drop.select_by_visible_text('Coimbotore')
</code>```

Body:
I am using Selenium and python for web scraping and the page that i am using for testing this link

But the problem is i am not able to handle the dynamic content of the drop down, here is the problem arises

While selecting the state, the city is loaded based on the state, Some Php and js are going in the back end as far as i know.

So, i searched the web and came with a solution to wait for the sometime please use this link as reference.

The following is a part of my code

from selenium import webdriver
from selenium.webdriver.support.ui import Select
from selenium.webdriver.support.ui import WebDriverWait

from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC

chrome_path = r"E:\chromedriver.exe"

driver = webdriver.Chrome(chrome_path)

driver.get("http://www.blooddonors.in")
select = Select(driver.find_element_by_xpath('/html/body/table[3]/tbody/tr/td[2]/table[1]/tbody/tr/td/form/table/tbody/tr[2]/td[1]/select'))

select.select_by_visible_text('Tamil Nadu')
driver.implicitly_wait(60)
drop = Select(driver.find_element_by_xpath('//*[@id="div_city"]/select'))
select.select_by_visible_text('Coimbotore')

I am using a windows sys and i tried using CMD. It doesn't need a wait function it works fine without it.

The error that i am facing is:

raise NoSuchElementException("Could not locate element with visible text: %s" % text)
selenium.common.exceptions.NoSuchElementException: Message: Could not locate element with visible text: Coimbotore

But their it is actually their.

If someone can help me resolve the issue it would be great and i can move on to the next.

Thanks

Body:
Your second drop-down defined as drop while you're still trying to handle first drop-down (select) which doesn't have "Coimbotore" option...

Just replace

drop = Select(driver.find_element_by_xpath('//*[@id="div_city"]/select'))
select.select_by_visible_text('Coimbotore')

with

drop = Select(driver.find_element_by_xpath('//select[@name="city" and count(option) > 1]'))
drop.select_by_visible_text('Coimbotore')


问:
Empty DataFrame doesn't admit its empty
I must not understand something about emptiness when it comes to pandas DataFrames. I have a DF with empty rows but when I isolate one of these rows its not empty.

Here I've made a dataframe:

```<code>>>> df = pandas.DataFrame(columns=[1,2,3], data=[[1,2,3],[1,None,3],[None, None, None],[3,2,1],[4,5,6],[None,None,None],[None,None,None]])
>>> df
     1    2    3
0  1.0  2.0  3.0
1  1.0  NaN  3.0
2  NaN  NaN  NaN
3  3.0  2.0  1.0
4  4.0  5.0  6.0
5  NaN  NaN  NaN
6  NaN  NaN  NaN
</code>```

Then I know row '2' is full of  nothing so I check for that...

```<code>>>> df[2:3].empty
    False
</code>```

Odd. So I split it out into its own dataframe:

```<code>>>> df1 = df[2:3]
>>> df1
    1   2   3
2 NaN NaN NaN

>>> df1.empty
False
</code>```

How do I check for emptiness (all the elements in a row being None or NaN?)

http://pandas.pydata.org/pandas-docs/version/0.18/generated/pandas.DataFrame.empty.html

答:
If you have a dataframe and want to drop all rows containing NaN in each of the columns, you can do this

```<code>df.dropna(how='all')
</code>```

Noticed that your dataframe also has NaN in one the columns in some cases. If you need to drop the entire row in such case:

```<code>df.dropna(how='any')
</code>```

After you do this (which ever is your preference) you could check length of dataframe (number of rows it contains) using:

```<code>len(df)
</code>```

Title: Empty DataFrame doesn't admit its empty

Body:
I must not understand something about emptiness when it comes to pandas DataFrames. I have a DF with empty rows but when I isolate one of these rows its not empty.

Here I've made a dataframe:

>>> df = pandas.DataFrame(columns=[1,2,3], data=[[1,2,3],[1,None,3],[None, None, None],[3,2,1],[4,5,6],[None,None,None],[None,None,None]])
>>> df
     1    2    3
0  1.0  2.0  3.0
1  1.0  NaN  3.0
2  NaN  NaN  NaN
3  3.0  2.0  1.0
4  4.0  5.0  6.0
5  NaN  NaN  NaN
6  NaN  NaN  NaN

Then I know row '2' is full of  nothing so I check for that...

>>> df[2:3].empty
    False

Odd. So I split it out into its own dataframe:

>>> df1 = df[2:3]
>>> df1
    1   2   3
2 NaN NaN NaN

>>> df1.empty
False

How do I check for emptiness (all the elements in a row being None or NaN?)

http://pandas.pydata.org/pandas-docs/version/0.18/generated/pandas.DataFrame.empty.html

Body:
If you have a dataframe and want to drop all rows containing NaN in each of the columns, you can do this

df.dropna(how='all')

Noticed that your dataframe also has NaN in one the columns in some cases. If you need to drop the entire row in such case:

df.dropna(how='any')

After you do this (which ever is your preference) you could check length of dataframe (number of rows it contains) using:

len(df)


问:
Can't create Azure Functions in USGovVirginia in Azure Government
I tried to walk-through for Microsoft's Azure Functions Quickstarts for Azure Government which crashes with the following error when executing az functionapp create:

Operation failed with status: 'Bad Request'.

Details: 400 Client Error: Bad Request for url: https://management.usgovcloudapi.net/subscriptions/<subscriptionId>/resourceGroups/*<resourcegroupname>*/providers/Microsoft.Web/sites/<newFunctionName>?api-version=2016-08-01

答:
We're investigating why USGovVirginia isn't working.

In the interim, use USGovArizona or USGovTexas.

Update 2017-11-21

This was a transient issue that has now been resolved.


问:
Parsing the column values dynamically in the same table
I have a stored procedure which accepts the InputTable as a parameter:

```<code>create table inputTable (id int, ItemQty varchar(100))

insert into inputTable(id, ItemQty)
values (1, 'a,b,c'), (2, 'x,y'), (3, 'l,m,n,o,p'),
       (4, 'a,b'), (5, 'm')
</code>```

The stored procedure I have written is like this:

```<code>ALTER PROCEDURE [dbo].[dynamic_tbl]
    (@tablename VARCHAR(50))
AS
BEGIN
    /* To get the maximum value of ItemQty with comma's [IN THIS CASE IT IS 5 ] */
    DECLARE @ColumnCount int
    DECLARE @rowcount TABLE (Value int);

    INSERT INTO @rowcount
        EXEC('SELECT MAX(len(ITEMQTY) - len(replace(ITEMQTY, '','', '''')) +1) from '+@tablename);

    SELECT @ColumnCount = Value FROM @rowcount;

    DECLARE @ColumnName NVARCHAR(10)='qty_'
    DECLARE @count INT = 0

    IF (@ColumnCount > 0)
    BEGIN
        SET @count = @count + 1;

        WHILE (@ColumnCount >= @count)
        BEGIN
            SET @ColumnName = 'qty_'+CONVERT(varchar(2),@count)
            EXEC ('ALTER TABLE '+@tablename+' ADD ['+@ColumnName +'] varchar(20)')

            DECLARE @myvar AS VARCHAR(MAX)

            --set @myvar='update '+@tablename+' set '+@ColumnName +' =itemQty'

            /* HERE ACTUALLY I AM GETTING PROBLEM, BECAUSE I WANT TO PARSE VALUES IN THE RESPECTIVE COLUMNS. */
           EXEC(@myvar)

           /* HERE, I wish to write the Actual update statement DYNAMICALLY*/
           EXEC ('UPDATE '+@tablename+' set'+@ColumnName+'=     ' )
           SET @count = @count + 1;
       END
   END
END
</code>```

My input and (desired Output should be like below figures)

Output :

something like this in dynamic way to the code

```<code> declare @myvar as varchar(max)

                SET @MYVAR= 'update '+@tablename+ 'set' +@ColumnName+'=case  when '+@count+' = 1 then itemQty else  end'

                exec(@myvar)
</code>```

答:
Please check following SQL Select statement

```<code>;with cte as (
select
    i.id, i.ItemQty, s.id as rn, s.val
from inputTable as i
cross apply dbo.Split(ItemQty,',') as s
)
select
    id, ItemQty,
    max(qty1) qty1,
    max(qty2) qty2,
    max(qty3) qty3,
    max(qty4) qty4,
    max(qty5) qty5
from (
select
    id,
    ItemQty,
    case when rn = 1 then val else null end as qty1,
    case when rn = 2 then val else null end as qty2,
    case when rn = 3 then val else null end as qty3,
    case when rn = 4 then val else null end as qty4,
    case when rn = 5 then val else null end as qty5
from cte
) t
group by id, ItemQty
</code>```

Output is as follows

Please note that you need a SQL string split function for this solution.
Check the referenced user-defined function which can be used for splitting string values.
Although you can use STRING_SPLIT function if you have a SQL Server 2016 or later database platform, tI prefer to use own split function because the function returns the order of the splitted string fragments too.

I hope it helps,

Body:
I have a stored procedure which accepts the InputTable as a parameter:

create table inputTable (id int, ItemQty varchar(100))

insert into inputTable(id, ItemQty)
values (1, 'a,b,c'), (2, 'x,y'), (3, 'l,m,n,o,p'),
       (4, 'a,b'), (5, 'm')

The stored procedure I have written is like this:

ALTER PROCEDURE [dbo].[dynamic_tbl]
    (@tablename VARCHAR(50))
AS
BEGIN
    /* To get the maximum value of ItemQty with comma's [IN THIS CASE IT IS 5 ] */
    DECLARE @ColumnCount int
    DECLARE @rowcount TABLE (Value int);

    INSERT INTO @rowcount
        EXEC('SELECT MAX(len(ITEMQTY) - len(replace(ITEMQTY, '','', '''')) +1) from '+@tablename);

    SELECT @ColumnCount = Value FROM @rowcount;

    DECLARE @ColumnName NVARCHAR(10)='qty_'
    DECLARE @count INT = 0

    IF (@ColumnCount > 0)
    BEGIN
        SET @count = @count + 1;

        WHILE (@ColumnCount >= @count)
        BEGIN
            SET @ColumnName = 'qty_'+CONVERT(varchar(2),@count)
            EXEC ('ALTER TABLE '+@tablename+' ADD ['+@ColumnName +'] varchar(20)')

            DECLARE @myvar AS VARCHAR(MAX)

            --set @myvar='update '+@tablename+' set '+@ColumnName +' =itemQty'

            /* HERE ACTUALLY I AM GETTING PROBLEM, BECAUSE I WANT TO PARSE VALUES IN THE RESPECTIVE COLUMNS. */
           EXEC(@myvar)

           /* HERE, I wish to write the Actual update statement DYNAMICALLY*/
           EXEC ('UPDATE '+@tablename+' set'+@ColumnName+'=     ' )
           SET @count = @count + 1;
       END
   END
END

My input and (desired Output should be like below figures)

Output :

something like this in dynamic way to the code

 declare @myvar as varchar(max)

                SET @MYVAR= 'update '+@tablename+ 'set' +@ColumnName+'=case  when '+@count+' = 1 then itemQty else  end'

                exec(@myvar)

Body:
Please check following SQL Select statement

;with cte as (
select
    i.id, i.ItemQty, s.id as rn, s.val
from inputTable as i
cross apply dbo.Split(ItemQty,',') as s
)
select
    id, ItemQty,
    max(qty1) qty1,
    max(qty2) qty2,
    max(qty3) qty3,
    max(qty4) qty4,
    max(qty5) qty5
from (
select
    id,
    ItemQty,
    case when rn = 1 then val else null end as qty1,
    case when rn = 2 then val else null end as qty2,
    case when rn = 3 then val else null end as qty3,
    case when rn = 4 then val else null end as qty4,
    case when rn = 5 then val else null end as qty5
from cte
) t
group by id, ItemQty

Output is as follows

Please note that you need a SQL string split function for this solution.
Check the referenced user-defined function which can be used for splitting string values.
Although you can use STRING_SPLIT function if you have a SQL Server 2016 or later database platform, tI prefer to use own split function because the function returns the order of the splitted string fragments too.

I hope it helps,