GVKun编程网logo

javascript-Ext.grid.View ext 4(autoFill)中丢失的configurationOptions(丢失的此函数窗口说明)

10

以上就是给各位分享javascript-Ext.grid.Viewext4(autoFill)中丢失的configurationOptions,其中也会对丢失的此函数窗口说明进行解释,同时本文还将给你

以上就是给各位分享javascript-Ext.grid.View ext 4(autoFill)中丢失的configurationOptions,其中也会对丢失的此函数窗口说明进行解释,同时本文还将给你拓展: No JAAS configuration section named ''Client'' was found in specified JAAS configuration file:、AddDbContext was called with configuration, but the context type ''NewsContext'' only decla...、applciation.xml foundation configuration and description、c# – container.RegisterWebApiControllers(GlobalConfiguration.Configuration)导致InvalidOperationException等相关知识,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!

本文目录一览:

javascript-Ext.grid.View ext 4(autoFill)中丢失的configurationOptions(丢失的此函数窗口说明)

javascript-Ext.grid.View ext 4(autoFill)中丢失的configurationOptions(丢失的此函数窗口说明)

在我的一个ext3应用程序中,我将这些参数用于GridView:

autoFill:true,//使所有列都和孔表一样宽
forceFit:true,//使所有列都和孔表一样宽
scrollOffset:0 //没有滚动条时删除为滚动条保留的空间

不幸的是我找不到它们(或ext4中的任何等效的东西).有谁知道如何在新的Ext.grid.View中替换这些属性?

解决方法:

在ExtJS4中,使用Ext.layout.container.HBox布局对列进行布局.
所以,

> autoFill:是-至少有一种列配置具有flex:1时就不需要
> forceFit:不需要为true(如果为共同超过总网格宽度的列指定绝对宽度,则将在网格下方看到水平滚动条.但是对于v3也是这样.
>您不再需要scrollOffset:0.现在这会自动发生.

总结

以上是小编为你收集整理的javascript-Ext.grid.View ext 4(autoFill)中丢失的configurationOptions全部内容。

如果觉得小编网站内容还不错,欢迎将小编网站推荐给好友。

原文地址:https://codeday.me/bug/20191102/1992486.html

: No JAAS configuration section named ''Client'' was found in specified JAAS configuration file:

: No JAAS configuration section named ''Client'' was found in specified JAAS configuration file:

zookeeper.ClientCnxn(line:957) : SASL configuration failed: javax.security.auth.login.LoginException: No JAAS configuration section named ''Client'' was found in specified JAAS configuration file: ''C:\Users\ADMINI~1\AppData\Local\Temp\jaas9138331021728969462.conf''. Will continue connection to Zookeeper server without SASL authentication, if Zookeeper server allows it.
java.net.SocketTimeoutException: callTimeout=60000, callDuration=60110: Call to master/192.168.7.202:16020 failed on local exception: org.apache.hadoop.hbase.ipc.CallTimeoutException: Call id=2, waitTime=60009, rpcTimeout=60000 row

AddDbContext was called with configuration, but the context type ''NewsContext'' only decla...

AddDbContext was called with configuration, but the context type ''NewsContext'' only decla...

问题

An error occurred while starting the application.

ArgumentException: AddDbContext was called with configuration, but the context type ''NewsContext'' only declares a parameterless constructor. This means that the configuration passed to AddDbContext will never be used. If configuration is passed to AddDbContext, then ''NewsContext'' should declare a constructor that accepts a DbContextOptions<NewsContext> and must pass it to the base constructor for DbContext.
Microsoft.Extensions.DependencyInjection.EntityFrameworkServiceCollectionExtensions.CheckContextConstructors<TContext>()

ArgumentException: AddDbContext was called with configuration, but the context type ''NewsContext'' only declares a parameterless constructor. This means that the configuration passed to AddDbContext will never be used. If configuration is passed to AddDbContext, then ''NewsContext'' should declare a constructor that accepts a DbContextOptions<NewsContext> and must pass it to the base constructor for DbContext.
Microsoft.Extensions.DependencyInjection.EntityFrameworkServiceCollectionExtensions.CheckContextConstructors<TContext>()
Microsoft.Extensions.DependencyInjection.EntityFrameworkServiceCollectionExtensions.AddDbContext<TContextService, TContextImplementation>(IServiceCollection serviceCollection, Action<IServiceProvider, DbContextOptionsBuilder> optionsAction, ServiceLifetime contextLifetime, ServiceLifetime optionsLifetime)
Microsoft.Extensions.DependencyInjection.EntityFrameworkServiceCollectionExtensions.AddDbContext<TContextService, TContextImplementation>(IServiceCollection serviceCollection, Action<DbContextOptionsBuilder> optionsAction, ServiceLifetime contextLifetime, ServiceLifetime optionsLifetime)
Microsoft.Extensions.DependencyInjection.EntityFrameworkServiceCollectionExtensions.AddDbContext<TContext>(IServiceCollection serviceCollection, Action<DbContextOptionsBuilder> optionsAction, ServiceLifetime contextLifetime, ServiceLifetime optionsLifetime)
News.Startup.ConfigureServices(IServiceCollection services) in Startup.cs
+
            services.AddDbContext<NewsContext>(options =>
Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services)
Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()
Microsoft.AspNetCore.Hosting.Internal.WebHost.Initialize()
Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()

 

 

 

原因

NewsContext.cs

using Microsoft.EntityFrameworkCore;

namespace News.Service
{
    public class NewsContext : DbContext
    {
        public DbSet<News.Model.Entity.News> News { get; set; }
        public DbSet<News.Model.Entity.Banner> Banner { get; set; }
        public DbSet<News.Model.Entity.Comment> Comment { get; set; }
        public DbSet<News.Model.Entity.NewsClassify> NewsClassify { get; set; }
    }
}

 

Startup.cs

public void ConfigureServices(IServiceCollection services)
        {
            ......

            services.AddDbContext<NewsContext>(options =>
            {
              options.UseSqlServer(Configuration.GetConnectionString("MsSqlConnection"), db => db.UseRowNumberForPaging());
            });

            ......

        }

 

该错误表示,如果通过 AddDbContext 配置 NewsContext,那么需要添加一个 DbContextOptions<NewsContext> 类型参数的构造函数到 NewsContext 类。否则.net core 不能注入时带上 AddDbContext 添加的配置

 

解决方法

如上面所说,NewsContext 类添加一个 DbContextOptions<NewsContext> 类型参数的构造函数

using Microsoft.EntityFrameworkCore;

namespace News.Service
{
    public class NewsContext : DbContext
    {
        public NewsContext(DbContextOptions<NewsContext> options) : base(options)
        {
        }

        public DbSet<News.Model.Entity.News> News { get; set; }
        public DbSet<News.Model.Entity.Banner> Banner { get; set; }
        public DbSet<News.Model.Entity.Comment> Comment { get; set; }
        public DbSet<News.Model.Entity.NewsClassify> NewsClassify { get; set; }
    }
}

 

applciation.xml foundation configuration and description

applciation.xml foundation configuration and description

<?xml version="1.0" encoding="UTF-8"?>  
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"  
    xmlns:tx="http://www.springframework.org/schema/tx" xmlns:p="http://www.springframework.org/schema/p" xmlns:util="http://www.springframework.org/schema/util" xmlns:jdbc="http://www.springframework.org/schema/jdbc"  
    xmlns:cache="http://www.springframework.org/schema/cache"  
    xsi:schemaLocation="  
    http://www.springframework.org/schema/context  
    http://www.springframework.org/schema/context/spring-context.xsd  
    http://www.springframework.org/schema/beans  
    http://www.springframework.org/schema/beans/spring-beans.xsd  
    http://www.springframework.org/schema/tx  
    http://www.springframework.org/schema/tx/spring-tx.xsd  
    http://www.springframework.org/schema/jdbc  
    http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd  
    http://www.springframework.org/schema/cache  
    http://www.springframework.org/schema/cache/spring-cache-3.1.xsd  
    http://www.springframework.org/schema/aop  
    http://www.springframework.org/schema/aop/spring-aop.xsd  
    http://www.springframework.org/schema/util  
    http://www.springframework.org/schema/util/spring-util.xsd">  
  
    <!-- 自动扫描web包,将带有注解的类 纳入spring容器管理 -->  
    <context:component-scan base-package="com.eduoinfo.finances.bank.web"></context:component-scan>  
  
    <!-- 引入jdbc配置文件 -->  
    <bean id="propertyConfigurer"https://www.jb51.cc/tag/fig/" target="_blank">fig.PropertyPlaceholderConfigurer">  
        <property name="locations">  
            <list>  
                <value>classpath*:jdbc.properties</value>  
            </list>  
        </property>  
    </bean>  
  
    <!-- dataSource 配置 -->  
    <bean id="dataSource"init-method="init" destroy-method="close">  
        <!-- 基本属性 url、user、password -->  
        <property name="url" value="${jdbc.url}" />  
        <property name="username" value="${jdbc.username}" />  
        <property name="password" value="${jdbc.password}" />  
  
        <!-- 配置初始化大小、最小、最大 -->  
        <property name="initialSize" value="1" />  
        <property name="minIdle" value="1" />  
        <property name="maxActive" value="20" />  
  
        <!-- 配置获取连接等待超时的时间 -->  
        <property name="maxWait" value="60000" />  
  
        <!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 -->  
        <property name="timeBetweenevictionRunsMillis" value="60000" />  
  
        <!-- 配置一个连接在池中最小生存的时间,单位是毫秒 -->  
        <property name="minevictableIdleTimeMillis" value="300000" />  
  
        <property name="validationQuery" value="SELECT 'x'" />  
        <property name="testWhileIdle" value="true" />  
        <property name="testOnBorrow" value="false" />  
        <property name="testOnReturn" value="false" />  
  
        <!-- 打开PSCache,并且指定每个连接上PSCache的大小 -->  
        <property name="poolPreparedStatements" value="false" />  
        <property name="maxPoolPreparedStatementPerConnectionSize" value="20" />  
  
        <!-- 配置监控统计拦截的filters -->  
        <property name="filters" value="stat" />  
    </bean>  
  
    <!-- mybatis文件配置,扫描所有mapper文件 -->  
    <bean id="sqlSessionFactory"https://www.jb51.cc/tag/sql/" target="_blank">sqlSessionfactorybean" p:dataSource-ref="dataSource" p:configLocation="classpath:mybatis-config.xml" p:mapperLocations="classpath:com/eduoinfo/finances/bank/web/dao/*.xml" />  
  
    <!-- spring与mybatis整合配置,扫描所有dao -->  
    <beanhttps://www.jb51.cc/tag/fig/" target="_blank">figurer" p:basePackage="com.eduoinfo.finances.bank.web.dao" p:sqlSessionfactorybeanName="sqlSessionFactory" />  
  
    <!-- 对dataSource 数据源进行事务管理 -->  
    <bean id="transactionManager"p:dataSource-ref="dataSource" />  
  
    <!-- 配置使Spring采用cglib代理 -->  
    <aop:aspectj-autoproxy proxy-target-/>  
  
    <!-- 启用对事务注解的支持 -->  
    <tx:annotation-driven transaction-manager="transactionManager" />  
  
    <!-- Cache配置 -->  
    <cache:annotation-driven cache-manager="cacheManager" />  
    <bean id="ehCacheManagerFactory"https://www.jb51.cc/tag/factorybean/" target="_blank">factorybean" p:configLocation="classpath:ehcache.xml" />  
    <bean id="cacheManager"p:cacheManager-ref="ehCacheManagerFactory" />  
  
</beans>  

c# – container.RegisterWebApiControllers(GlobalConfiguration.Configuration)导致InvalidOperationException

c# – container.RegisterWebApiControllers(GlobalConfiguration.Configuration)导致InvalidOperationException

在我的集成测试中,我使用的是我正在测试的Web API项目中构建的相同的SimpleInjector.Container.

但是组合根类中的这一行:

container.RegisterWebApiControllers(GlobalConfiguration.Configuration);

导致异常:

System.TypeInitializationException : The type initializer for 'MyProject.Api.Test.Integration.HttpClientFactory' threw an exception.
---- system.invalidOperationException : This method cannot be called during the application's pre-start initialization phase.
Result StackTrace:  
at MyProject.Api.Test.Integration.HttpClientFactory.Create()
   at MyProject.Api.Test.Integration.Controllers.ProductControllerIntegrationTest.<GetProductBarcode_Should_Return_Status_BadRequest_When_Barcode_Is_Empty>d__0.MoveNext() in d:\Projects\My\MyProject.Api.Test.Integration\Controllers\ProductControllerIntegrationTest.cs:line 26
----- Inner Stack Trace -----
   at System.Web.Compilation.BuildManager.EnsuretopLevelFilesCompiled()
   at System.Web.Compilation.BuildManager.GetReferencedAssemblies()
   at System.Web.Http.WebHost.WebHostAssembliesResolver.System.Web.Http.dispatcher.IAssembliesResolver.GetAssemblies()
   at System.Web.Http.dispatcher.DefaultHttpControllerTypeResolver.GetControllerTypes(IAssembliesResolver assembliesResolver)
   at System.Web.Http.WebHost.WebHostHttpControllerTypeResolver.GetControllerTypes(IAssembliesResolver assembliesResolver)
   at SimpleInjector.SimpleInjectorWebApiExtensions.GetControllerTypesFromConfiguration(HttpConfiguration configuration)
   at SimpleInjector.SimpleInjectorWebApiExtensions.RegisterWebApiControllers(Container container,HttpConfiguration configuration)
   at MyProject.Api.ContainerConfig.RegisterTypes(Container container) in d:\Projects\My\MyProject.Api\App_Start\ContainerConfig.cs:line 128
   at MyProject.Api.ContainerConfig.CreateWebApiContainer() in d:\Projects\My\MyProject.Api\App_Start\ContainerConfig.cs:line 63
   at MyProject.Api.Test.Integration.HttpClientFactory..cctor() in d:\Projects\My\MyProject.Api.Test.Integration\HttpClientFactory.cs:line 17

评论后,一切正常,网络应用程序本身和测试.

所以问题是:

>例外的原因是什么?
>(这种方法真的需要吗?)

这是HttpClientFactory的代码(一个辅助类,用于创建具有适当头的HttpClient,例如api密钥或授权):

internal static class HttpClientFactory
{
    private static readonly Container _container = ContainerConfig.CreateWebApiContainer();

    public static HttpClient Create()
    {
        var client = new HttpClient { BaseAddress = GetUrl() };
        //...
        return client;
    }
}

解决方法

如果我们仔细观察堆栈跟踪,我们可以准确地看到这里发生了什么. RegisterWebApiControllers扩展方法在从HttpConfiguration获取的IHttpControllerTypeResolver实例上调用GetControllerTypes方法,并传递也从配置中检索的IAssembliesResolver.调用GetControllerTypes方法(WebHostHttpControllerTypeResolver)调用DefaultHttpControllerTypeResolver的GetControllerTypes,最终将调用System.Web.Compilation.BuildManager类的GetReferencedAssemblies.

但是,System.Web.Compilation.BuildManager不能在ASP.NET管道的早期调用,也不能在ASP.NET的上下文之外调用.由于您正在进行测试,BuildManage将抛出您遇到的异常.

所以这里的解决方案(或’技巧’)将在单元测试时替换默认的IAssembliesResolver.我认为旋转变压器看起来像这样:

public class TestAssembliesResolver : IAssembliesResolver
{
    public ICollection<Assembly> GetAssemblies()
    {
        return AppDomain.CurrentDomain.GetAssemblies();
    }
}

[TestMethod]
public void TestMethod1()
{
    // Replace the original IAssembliesResolver.
    GlobalConfiguration.Configuration.Services.Replace(typeof(IAssembliesResolver),new TestAssembliesResolver());

    var container = SimpleInjectorWebApiInitializer.BuildContainer();

    container.Verify();
}

你不得不处理这个问题有点不幸,特别是因为Simple Injector的设计是可测试的.我们似乎忽略了这一点,将RegisterWebApiControllers扩展方法与Web API深深地集成在一起.我们必须退后一步,思考如何更轻松地验证单元测试中的Web API配置.

关于javascript-Ext.grid.View ext 4(autoFill)中丢失的configurationOptions丢失的此函数窗口说明的问题就给大家分享到这里,感谢你花时间阅读本站内容,更多关于: No JAAS configuration section named ''Client'' was found in specified JAAS configuration file:、AddDbContext was called with configuration, but the context type ''NewsContext'' only decla...、applciation.xml foundation configuration and description、c# – container.RegisterWebApiControllers(GlobalConfiguration.Configuration)导致InvalidOperationException等相关知识的信息别忘了在本站进行查找喔。

本文标签: