数据专栏

智能大数据搬运工,你想要的我们都有

科技资讯:

科技学院:

科技百科:

科技书籍:

网站大全:

软件大全:

HDC调试需求开发(15万预算),能者速来!>>> java.lang.ClassNotFoundException: com.mysql.jdbc.Driver 配置: 可是 项目是有的 tomcat部署的项目 lib下面也是有的 有点不能理解 求教
来源:开源中国
发布时间:2016-09-19 20:02:00
HDC调试需求开发(15万预算),能者速来!>>> 一般在运行压力较大的时候,会有链接被耗尽的现象,网上一查发现它的实现机制引起的,不知道哪个版本是否修复了
来源:开源中国
发布时间:2016-07-20 09:17:00
HDC调试需求开发(15万预算),能者速来!>>> Spring中 通过 在applicationContext.xml文件中 引入db.properties.xml外部属性文件来链接数据库 < context :property-placeholder location ="classpath:db.properties" /> db.properties.xml文件内容如下: user = root password = 123456 driverClass = com.mysql.cj.jdbc.Driver jdbcUrl = jdbc:mysql://shop?autoReconnect=true&useSSL=false 配置bean时,用"${user}", "${password}" ,"${driverClass}"来获取属性值, 但是在运行时,发现c3p0不能链接数据库,debug发现在获取user属性值时出错,而其他的属性值是正确的 < property name ="user" value ="${user}" /> 只有这里获取的值是错误的 < property name ="password" value ="${password}" /> < property name ="driverClass" value ="${driverClass}" /> < property name ="jdbcUrl" value ="${jdbcUrl}" /> 如果不使用外部属性文件配置,直接写成 < property name ="user" value ="root" /> 时,c3p0是可以链接到mysql上的 有人遇到过同样的问题吗?
来源:开源中国
发布时间:2016-07-15 23:58:00
HDC调试需求开发(15万预算),能者速来!>>> C3P0中ComboPooledDataSource的getConnection是线程安全的吗 以下这段代码的synchronized是不是没有必要? // 获取连接,里面的dataSource是ComboPooledDataSource的实例 public synchronized Connection getConnection(){ try { return dataSource.getConnection(); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } return null; }
来源:开源中国
发布时间:2016-06-28 10:34:05
HDC调试需求开发(15万预算),能者速来!>>> 2011-5-11 16:28:15 com.mchange.v2.resourcepool.BasicResourcePool removeResource INFO: A checked-out resource is overdue, and will be destroyed: com.mchange.v2.c3p0.impl.NewPooledConnection@153f5e2 2011-5-11 16:28:15 com.mchange.v2.resourcepool.BasicResourcePool removeResource INFO: Logging the stack trace by which the overdue resource was checked-out. java.lang.Exception: DEBUG ONLY: Overdue resource check-out stack trace. at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:543) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutAndMarkConnectionInUse(C3P0PooledConnectionPool.java:681) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:608) at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128) ------------------------------------- 以下配置文件 c3p0.minPoolSize=3 c3p0.maxPoolSize=50 c3p0.testConnectionOnCheckout=true #c3p0.testConnectionOnCheckin=true #c3p0.checkoutTimeout=2000 #c3p0.idleConnectionTestPeriod=5 c3p0.maxConnectionAge=10 #c3p0.maxIdleTime=2 #c3p0.maxIdleTimeExcessConnections=1 #c3p0.propertyCycle=1 #c3p0.numHelperThreads=10 c3p0.unreturnedConnectionTimeout=15 c3p0.debugUnreturnedConnectionStackTraces=true c3p0.maxStatements=50 c3p0.maxStatementsPerConnection=5 我检查过,好像没有连接没被关掉...
来源:开源中国
发布时间:2011-05-11 16:35:00
HDC调试需求开发(15万预算),能者速来!>>> spring.datasource.type=com.alibaba.druid.pool.DruidDataSource spring.datasource.url=jdbc:mysql://127.0.0.1:3306/xx?serverTimezone=utc&characterEncoding=utf8&useUnicode=true&useSSL=false spring.datasource.username=xxx spring.datasource.password=xxx spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver spring.datasource.initialSize=5 spring.datasource.minIdle=5 spring.datasource.maxActive=20 spring.datasource.maxWait=60000 spring.datasource.filters=stat,wall spring.datasource.timeBetweenEvictionRunsMillis=60000 spring.datasource.minEvictableIdleTimeMillis=300000 spring.datasource.validationQuery=select 'x' spring.datasource.testWhileIdle=true spring.datasource.testOnBorrow=false spring.datasource.testOnReturn=false spring.datasource.poolPreparedStatements=true spring.datasource.maxPoolPreparedStatementPerConnectionSize=20 spring.datasource.connectionProperties=druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 spring.druidLoginName=admin spring.druidPassword=admin @Bean public SqlSessionFactoryBean sqlSessionFactory(DruidDataSource datasource){ SqlSessionFactoryBean bean=new SqlSessionFactoryBean(); datasource.setInitialSize(initialSize); datasource.setMinIdle(minIdle); datasource.setMaxActive(maxActive); datasource.setMaxWait(maxWait); datasource.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis); datasource.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis); datasource.setValidationQuery(validationQuery); datasource.setTestWhileIdle(testWhileIdle); datasource.setTestOnBorrow(testOnBorrow); datasource.setTestOnReturn(testOnReturn); datasource.setPoolPreparedStatements(poolPreparedStatements); datasource.setMaxPoolPreparedStatementPerConnectionSize(maxPoolPreparedStatementPerConnectionSize); try { datasource.setFilters(filters); } catch (SQLException e) { e.printStackTrace(); } datasource.setConnectionProperties(connectionProperties); bean.setDataSource(datasource); return bean; } @Bean public SqlSessionTemplate sqlSession(SqlSessionFactoryBean sqlSessionFactory){ SqlSessionTemplate bean=null; try { bean = new SqlSessionTemplate(sqlSessionFactory.getObject()); } catch (Exception e) { e.printStackTrace(); } return bean; } 报错如下: [2019-03-16 17:14:38] ERROR org.springframework.boot.SpringApplication - Application run failed java.util.ConcurrentModificationException: null at java.util.LinkedHashMap$LinkedHashIterator.nextNode(LinkedHashMap.java:719) at java.util.LinkedHashMap$LinkedKeyIterator.next(LinkedHashMap.java:742) at org.springframework.context.support.AbstractApplicationContext.registerListeners(AbstractApplicationContext.java:810) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543) at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) at net.hb.xuelebaoapp.config.MainApplication.main(MainApplication.java:19) 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:498) at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) [2019-03-16 17:14:38] INFO org.apache.catalina.loader.WebappClassLoaderBase - Illegal access: this web application instance has been stopped already. Could not load [com.mysql.jdbc.MySQLConnection]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access. java.lang.IllegalStateException: Illegal access: this web application instance has been stopped already. Could not load [com.mysql.jdbc.MySQLConnection]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access. at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading(WebappClassLoaderBase.java:1363) at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForClassLoading(WebappClassLoaderBase.java:1351) at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:820) at org.springframework.boot.web.embedded.tomcat.TomcatEmbeddedWebappClassLoader.findClassIgnoringNotFound(TomcatEmbeddedWebappClassLoader.java:121) at org.springframework.boot.web.embedded.tomcat.TomcatEmbeddedWebappClassLoader.doLoadClass(TomcatEmbeddedWebappClassLoader.java:86) at org.springframework.boot.web.embedded.tomcat.TomcatEmbeddedWebappClassLoader.loadClass(TomcatEmbeddedWebappClassLoader.java:68) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1173) at com.alibaba.druid.util.Utils.loadClass(Utils.java:220) at com.alibaba.druid.pool.vendor.MySqlValidConnectionChecker.(MySqlValidConnectionChecker.java:50) at com.alibaba.druid.pool.DruidDataSource.initValidConnectionChecker(DruidDataSource.java:1231) at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:885) at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:1300) at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:1296) at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:109) at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:157) at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:115) at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:78) at org.mybatis.spring.transaction.SpringManagedTransaction.openConnection(SpringManagedTransaction.java:82) at org.mybatis.spring.transaction.SpringManagedTransaction.getConnection(SpringManagedTransaction.java:68) at org.apache.ibatis.executor.BaseExecutor.getConnection(BaseExecutor.java:338) at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:84) at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:62) at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:326) at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109) at com.github.pagehelper.PageInterceptor.intercept(PageInterceptor.java:108) at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61) at com.sun.proxy.$Proxy96.query(Unknown Source) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:136) 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:498) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:433) at com.sun.proxy.$Proxy93.selectList(Unknown Source) at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:222) at net.hb.xuelebaoapp.system.dao.impl.FredaDaoImpl.queryForList(FredaDaoImpl.java:105) at net.hb.xuelebaoapp.manager.sys.service.impl.ParamServiceImpl.list(ParamServiceImpl.java:41) at net.hb.xuelebaoapp.system.listener.SystemInitListener$launchSPMonitor.run(SystemInitListener.java:82) at java.lang.Thread.run(Thread.java:748) [2019-03-16 17:14:39] INFO com.alibaba.druid.pool.DruidDataSource - {dataSource-1} inited [2019-03-16 17:14:39] INFO com.alibaba.druid.pool.DruidDataSource - {dataSource-1} closed 通过换mysql驱动包和druid驱动包版本,试了都不行
来源:开源中国
发布时间:2019-03-16 17:18:00
HDC调试需求开发(15万预算),能者速来!>>> org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.dao.mapper.user.UserInfoMapper.checkEmail
来源:开源中国
发布时间:2018-11-28 17:28:00
HDC调试需求开发(15万预算),能者速来!>>> maven包含spring boot子模块的一个项目, 项目本身是可以运行, 并且功能都可以实现 , 现在要对项目进行打包处理, 在install到dao模块的时候, Running com.xiao.DaoAeriesTest的时候却抛出了 com.ibatis.sqlmap.client.SqlMapException: There is no statement named MemberRightsMapper.select in this SqlMap. 如果直接跑test的话是可以跑得通的,使用的是spring-orm-3.0.5,下面是sqlMapClient的配置 conf/SqlMapConfig.xml classpath*:com/xiao/**/*SQL.xml 另外我的SQL.xml文件是在pojo模块中的,因为放入dao模块中的话,本地启动就会抛出 There is no statement named XXX in this SqlMap.这个异常,install也是一样的. 现在把test模块去掉之后可以打包成功, 但是在使用java -jar XXX.jar启动spring boot打成的包后 ,调用的dao层的方法,控制台又会直接抛出这个异常 org.springframework.data.redis.RedisSystemException: Unknown jedis exception; nested exception is com.ibatis.sqlmap.client.SqlMapException: There is no statement named ACTIVITY.selectAvailableActivities in this SqlMap. at org.springframework.data.redis.connection.jedis.JedisExceptionConverter.convert(JedisExceptionConverter.java:58) at org.springframework.data.redis.connection.jedis.JedisExceptionConverter.convert(JedisExceptionConverter.java:37) at org.springframework.data.redis.connection.jedis.JedisConverters.toDataAccessException(JedisConverters.java:117) at org.springframework.data.redis.connection.jedis.JedisConnectionFactory.translateExceptionIfPossible(JedisConnectionFactory.java:156) at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:61) at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:242) at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:153) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688) at com.miyun.biz.activity.dao.ibatis.ActivityDAOImpl$$EnhancerBySpringCGLIB$$5b37250d.selectAvailableActivities() at com.miyun.biz.activity.manager.impl.ActivityManagerImpl.selectAvailableJoinActivities(ActivityManagerImpl.java:168) at com.miyun.biz.activity.manager.impl.ActivityManagerImpl.join(ActivityManagerImpl.java:331) at com.jinju.demojms.Receive.joinActivity(Receive.java:194) at com.jinju.demojms.Receive.joinInvsetActivity(Receive.java:67) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:181) at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:114) at org.springframework.amqp.rabbit.listener.adapter.HandlerAdapter.invoke(HandlerAdapter.java:51) at org.springframework.amqp.rabbit.listener.adapter.MessagingMessageListenerAdapter.invokeHandler(MessagingMessageListenerAdapter.java:182) at org.springframework.amqp.rabbit.listener.adapter.MessagingMessageListenerAdapter.onMessage(MessagingMessageListenerAdapter.java:120) at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:1414) at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.actualInvokeListener(AbstractMessageListenerContainer.java:1337) at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:1324) at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.executeListener(AbstractMessageListenerContainer.java:1303) at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.doReceiveAndExecute(SimpleMessageListenerContainer.java:817) at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.receiveAndExecute(SimpleMessageListenerContainer.java:801) at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.access$700(SimpleMessageListenerContainer.java:77) at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run(SimpleMessageListenerContainer.java:1042) at java.lang.Thread.run(Unknown Source) Caused by: com.ibatis.sqlmap.client.SqlMapException: There is no statement named ACTIVITY.selectAvailableActivities in this SqlMap. at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.getMappedStatement(SqlMapExecutorDelegate.java:231) at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:558) at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:541) at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:118) at org.springframework.orm.ibatis.SqlMapClientTemplate$3.doInSqlMapClient(SqlMapClientTemplate.java:295) at org.springframework.orm.ibatis.SqlMapClientTemplate$3.doInSqlMapClient(SqlMapClientTemplate.java:1) at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:200) at org.springframework.orm.ibatis.SqlMapClientTemplate.queryForList(SqlMapClientTemplate.java:293) at com.miyun.biz.activity.dao.ibatis.ActivityDAOImpl.selectAvailableActivities(ActivityDAOImpl.java:67) at com.miyun.biz.activity.dao.ibatis.ActivityDAOImpl$$FastClassBySpringCGLIB$$f4e9b4c6.invoke() at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:746) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:139) ... 25 more 怀疑和install dao模块时抛出的异常是一个原理, 两天了 都没解决
来源:开源中国
发布时间:2018-08-01 11:09:00
HDC调试需求开发(15万预算),能者速来!>>> 这个sql有个语法错误 ,大佬帮忙看看 看了一下午没看出来
来源:开源中国
发布时间:2018-06-29 19:08:00
HDC调试需求开发(15万预算),能者速来!>>> 我们知道,通过如下配置可以启用下划线与驼峰式命名规则的映射(如first_name => firstName) 这个配置在执行查询的操作的时候很好用,可以将数据库中下划线命名的字段直接对应到JavaBean中的驼峰命名的参数里。 但是执行insert操作的时候问题来了,我传入的是JavaBean对象,这个时候无法将驼峰命名的参数自动转成带下划线的( 大概是因为不知道往哪儿加下划线 )。 比如,我预期是写成这样: INSERT INTO user_info ( user_id, user_name ) VALUES ( #{user_id}, #{user_name}, ) 但是,这样会报错There is no getter for property named 'user_id' in 'class com.dx.User',因为我JavaBean中的参数名分别是userId和userName,所以我必须写成下面这样: INSERT INTO user_info ( user_id, user_name ) VALUES ( #{userId}, #{userName}, ) 但是下面这种字段名不一致写法会让我很难受,这里该怎么操作才能实现我的预期写法呢?
来源:开源中国
发布时间:2018-04-17 16:06:00
HDC调试需求开发(15万预算),能者速来!>>> 就是在UserBasicInfo这个实体类里面加了个扩展属性,跟表不想关的,结果ibatis就报这个操蛋的问题,咋整都没用。然后又试了下,换了个另外的实体类加一个属性,还是报这样的错误,不过ClassNotFoundException报的又是另外那个实体类,我就纳闷了个去了。ibatis配置文件和别的什么的都没改动,就是改个实体类多加个属性,跟ibatis也不想关吧,为啥会报这样的问题,哪位哥哥姐姐知道?
来源:开源中国
发布时间:2017-04-14 18:24:00
HDC调试需求开发(15万预算),能者速来!>>> 公司着手搭建一套有关金融业务的产品框架,现在流行的 S pring, struts2 , webwork 、 jsf 、 Tapestry 、 easyjweb、 H ibernate, ibatis , jpa、 J sp, jsp tag , jquery , extjs , yui , prototype等等技术框架用哪些比较好?并给点理由,在此先谢谢各位了。
来源:开源中国
发布时间:2011-12-08 18:58:00
HDC调试需求开发(15万预算),能者速来!>>> Junit测试成功,注入成功。 但是启动应用后,注入的实体报空指针异常。 请问这种问题是什么原因呢,谢谢。 三个配置类分别如下 一、WebInit 类 import com.lotus.api.RootConfig; import com.lotus.api.WebConfig; import org.springframework.web.filter.CharacterEncodingFilter; import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer; import org.springframework.web.util.Log4jConfigListener; import javax.servlet.Filter; import javax.servlet.ServletContext; import javax.servlet.ServletRegistration; public class WebInit extends AbstractAnnotationConfigDispatcherServletInitializer { @Override protected Class[] getRootConfigClasses() { return new Class[]{RootConfig.class}; } @Override protected Class[] getServletConfigClasses() { return new Class[]{WebConfig.class}; } @Override protected String[] getServletMappings() { return new String[]{"/"}; } @Override protected Filter[] getServletFilters() { //字符集拦截器 CharacterEncodingFilter characterEncodingFilter = new CharacterEncodingFilter(); characterEncodingFilter.setEncoding("UTF-8"); characterEncodingFilter.setForceEncoding(true); return new Filter[]{characterEncodingFilter}; } @Override protected void registerContextLoaderListener(ServletContext servletContext) { servletContext.setInitParameter("log4jConfigLocation" , "classpath:log4j.properties"); servletContext.addListener(Log4jConfigListener.class); } @Override protected void customizeRegistration(ServletRegistration.Dynamic registration) { registration.setInitParameter("throwExceptionIfNoHandlerFound", "true"); } } 二、WebConfig package com.lotus.api; import com.lotus.api.interceptor.SecretInterceptor; import com.lotus.service.ServiceNativeConfig; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; @Configuration @EnableWebMvc @ComponentScan("com.lotus.api.web") public class WebConfig extends WebMvcConfigurerAdapter { @Override public void addInterceptors(InterceptorRegistry registry) { registry.addInterceptor(new SecretInterceptor()).addPathPatterns("/**"); } } 三、RootConfig package com.lotus.api; import com.lotus.service.ServiceNativeConfig; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.FilterType; import org.springframework.context.annotation.Import; import org.springframework.web.servlet.config.annotation.EnableWebMvc; @Configuration @ComponentScan(basePackages = {"com.lotus.api"}, excludeFilters = {@ComponentScan.Filter(type = FilterType.ANNOTATION, value = EnableWebMvc.class)}) @Import(ServiceNativeConfig.class) public class RootConfig { } 使用Junit测试的代码如下: import com.lotus.api.RootConfig; import com.lotus.service.attachment.AttachmentService; import com.lotus.service.content.ContentService; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = {RootConfig.class}) public class WebTest { @Autowired private AttachmentService attachmentService; @Autowired private ContentService contentService; @Test public void test(){ attachmentService.add(); System.out.println("SECCESS"); System.out.println(contentService); }
来源:开源中国
发布时间:2017-10-14 21:57:00
HDC调试需求开发(15万预算),能者速来!>>> 用junit4进行单元测试一直报错,我快疯啦,跪求指导~~~~ 2017-06-07-16-37-29 [INFO] [main] [XmlBeanDefinitionReader_316] - Loading XML bean definitions from class path resource [applicationContext.xml] 2017-06-07-16-37-29 [INFO] [main] [XmlBeanDefinitionReader_316] - Loading XML bean definitions from class path resource [spring-mvc.xml] 2017-06-07-16-37-29 [INFO] [main] [XmlBeanDefinitionReader_316] - Loading XML bean definitions from class path resource [spring-database.xml] 2017-06-07-16-37-29 [INFO] [main] [XmlBeanDefinitionReader_316] - Loading XML bean definitions from class path resource [spring-aop.xml] 2017-06-07-16-37-29 [INFO] [main] [XmlBeanDefinitionReader_316] - Loading XML bean definitions from class path resource [spring-redis.xml] 2017-06-07-16-37-29 [INFO] [main] [GenericApplicationContext_524] - Refreshing org.springframework.context.support.GenericApplicationContext@1bd0dd4: startup date [Wed Jun 07 16:37:29 CST 2017]; root of context hierarchy 2017-06-07-16-37-30 [INFO] [main] [PropertyPlaceholderConfigurer_172] - Loading properties file from class path resource [config.properties] 2017-06-07-16-37-30 [INFO] [main] [DruidDataSource_652] - {dataSource-1} inited 2017-06-07-16-37-35 [INFO] [main] [DefaultListableBeanFactory_452] - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@e61a35: defining beans [org.springframework.context.annotation.internalAsyncAnnotationProcessor,org.springframework.context.annotation.internalScheduledAnnotationProcessor,mewTaskAPI,cashJob,timedTaskJob,FCashLogServiceImpl,FUserServiceImpl,FUserTaskServiceImpl,FUserTaskStepsServiceImpl,JZCatService,taskServiceImpl,timedTaskServiceImpl,apiController,frontController,kindEditorController,timedTaskController,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,propertyConfigurer,org.springframework.web.servlet.resource.ResourceHttpRequestHandler#0,org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#0,org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping,org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter,org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter,org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping#0,org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter#0,mvcContentNegotiationManager,org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0,org.springframework.format.support.FormattingConversionServiceFactoryBean#0,org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter#0,org.springframework.web.servlet.handler.MappedInterceptor#0,org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver#0,org.springframework.web.servlet.mvc.annotation.ResponseStatusExceptionResolver#0,org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver#0,multipartResolver,freemarkerConfig,fmXmlEscape,freemakerViewResolver,dataSource,druid-stat-interceptor,druid-stat-pointcut,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0,sqlSessionFactory,sqlSession,org.mybatis.spring.mapper.MapperScannerConfigurer#0,transactionManager,serviceOperation,org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#1,txAdvice,poolConfig,connectionFactory,redisTemplate,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor,org.springframework.context.annotation.ConfigurationClassPostProcessor.enhancedConfigurationProcessor,BShopMapper,FAccountMapper,FCashLogMapper,FUserImgsMapper,FUserMapper,FUserTaskMapper,FUserTaskStepsMapper,taskMapper,taskStepsMapper,timedTaskMapper]; root of factory hierarchy 2017-06-07-16-37-35 [INFO] [main] [DruidDataSource_1316] - {dataSource-1} closed 2017-06-07-16-37-35 [ERROR] [main] [TestContextManager_314] - Caught exception while allowing TestExecutionListener [org.springframework.test.context.web.ServletTestExecutionListener@ad483] to prepare test instance [cn.com.l9e.zwk.zwkInterface.TestTimed@10613aa] java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:99) at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:122) at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:108) at org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:75) at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:312) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:209) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:286) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:288) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:229) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:86) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:172) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'timedTaskJob': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: cn.com.l9e.zwk.service.TimedTaskService cn.com.l9e.zwk.job.TimedTaskJob.timedTaskService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'timedTaskServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private cn.com.l9e.zwk.dao.TimedTaskMapper cn.com.l9e.zwk.service.impl.TimedTaskServiceImpl.timedTaskMapper; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [cn.com.l9e.zwk.dao.TimedTaskMapper] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'BShopMapper' defined in file [E:\java_workspace\zwk\target\classes\cn\com\l9e\zwk\dao\BShopMapper.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-database.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [mybatis-config.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.lang.RuntimeException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'java.util.String'. Cause: java.lang.ClassNotFoundException: Cannot find class: java.util.String Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'FAccountMapper' defined in file [E:\java_workspace\zwk\target\classes\cn\com\l9e\zwk\dao\FAccountMapper.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-database.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [mybatis-config.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.lang.RuntimeException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'java.util.String'. Cause: java.lang.ClassNotFoundException: Cannot find class: java.util.String Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'FCashLogMapper' defined in file [E:\java_workspace\zwk\target\classes\cn\com\l9e\zwk\dao\FCashLogMapper.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-database.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [mybatis-config.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.lang.RuntimeException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'java.util.String'. Cause: java.lang.ClassNotFoundException: Cannot find class: java.util.String Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'FUserImgsMapper' defined in file [E:\java_workspace\zwk\target\classes\cn\com\l9e\zwk\dao\FUserImgsMapper.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-database.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [mybatis-config.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.lang.RuntimeException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'java.util.String'. Cause: java.lang.ClassNotFoundException: Cannot find class: java.util.String Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'FUserMapper' defined in file [E:\java_workspace\zwk\target\classes\cn\com\l9e\zwk\dao\FUserMapper.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-database.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [mybatis-config.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.lang.RuntimeException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'java.util.String'. Cause: java.lang.ClassNotFoundException: Cannot find class: java.util.String Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'FUserTaskMapper' defined in file [E:\java_workspace\zwk\target\classes\cn\com\l9e\zwk\dao\FUserTaskMapper.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-database.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [mybatis-config.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.lang.RuntimeException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'java.util.String'. Cause: java.lang.ClassNotFoundException: Cannot find class: java.util.String Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'FUserTaskStepsMapper' defined in file [E:\java_workspace\zwk\target\classes\cn\com\l9e\zwk\dao\FUserTaskStepsMapper.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-database.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [mybatis-config.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.lang.RuntimeException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'java.util.String'. Cause: java.lang.ClassNotFoundException: Cannot find class: java.util.String Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'taskMapper' defined in file [E:\java_workspace\zwk\target\classes\cn\com\l9e\zwk\dao\TaskMapper.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-database.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [mybatis-config.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.lang.RuntimeException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'java.util.String'. Cause: java.lang.ClassNotFoundException: Cannot find class: java.util.String Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'taskStepsMapper' defined in file [E:\java_workspace\zwk\target\classes\cn\com\l9e\zwk\dao\TaskStepsMapper.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-database.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [mybatis-config.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.lang.RuntimeException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'java.util.String'. Cause: java.lang.ClassNotFoundException: Cannot find class: java.util.String Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'timedTaskMapper' defined in file [E:\java_workspace\zwk\target\classes\cn\com\l9e\zwk\dao\TimedTaskMapper.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-database.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [mybatis-config.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.lang.RuntimeException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'java.util.String'. Cause: java.lang.ClassNotFoundException: Cannot find class: java.util.String Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'BShopMapper' defined in file [E:\java_workspace\zwk\target\classes\cn\com\l9e\zwk\dao\BShopMapper.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-database.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [mybatis-config.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.lang.RuntimeException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'java.util.String'. Cause: java.lang.ClassNotFoundException: Cannot find class: java.util.String Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'FAccountMapper' defined in file [E:\java_workspace\zwk\target\classes\cn\com\l9e\zwk\dao\FAccountMapper.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-database.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [mybatis-config.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.lang.RuntimeException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'java.util.String'. Cause: java.lang.ClassNotFoundException: Cannot find class: java.util.String Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'FCashLogMapper' defined in file [E:\java_workspace\zwk\target\classes\cn\com\l9e\zwk\dao\FCashLogMapper.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-database.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [mybatis-config.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.lang.RuntimeException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'java.util.String'. Cause: java.lang.ClassNotFoundException: Cannot find class: java.util.String Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'FUserImgsMapper' defined in file [E:\java_workspace\zwk\target\classes\cn\com\l9e\zwk\dao\FUserImgsMapper.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-database.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [mybatis-config.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.lang.RuntimeException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'java.util.String'. Cause: java.lang.ClassNotFoundException: Cannot find class: java.util.String Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'FUserMapper' defined in file [E:\java_workspace\zwk\target\classes\cn\com\l9e\zwk\dao\FUserMapper.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-database.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [mybatis-config.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.lang.RuntimeException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'java.util.String'. Cause: java.lang.ClassNotFoundException: Cannot find class: java.util.String Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'FUserTaskMapper' defined in file [E:\java_workspace\zwk\target\classes\cn\com\l9e\zwk\dao\FUserTaskMapper.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-database.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [mybatis-config.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.lang.RuntimeException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'java.util.String'. Cause: java.lang.ClassNotFoundException: Cannot find class: java.util.String Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'FUserTaskStepsMapper' defined in file [E:\java_workspace\zwk\target\classes\cn\com\l9e\zwk\dao\FUserTaskStepsMapper.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-database.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [mybatis-config.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.lang.RuntimeException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'java.util.String'. Cause: java.lang.ClassNotFoundException: Cannot find class: java.util.String Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'taskMapper' defined in file [E:\java_workspace\zwk\target\classes\cn\com\l9e\zwk\dao\TaskMapper.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-database.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [mybatis-config.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.lang.RuntimeException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'java.util.String'. Cause: java.lang.ClassNotFoundException: Cannot find class: java.util.String Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'taskStepsMapper' defined in file [E:\java_workspace\zwk\target\classes\cn\com\l9e\zwk\dao\TaskStepsMapper.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-database.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [mybatis-config.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.lang.RuntimeException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'java.util.String'. Cause: java.lang.ClassNotFoundException: Cannot find class: java.util.String Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'timedTaskMapper' defined in file [E:\java_workspace\zwk\target\classes\cn\com\l9e\zwk\dao\TimedTaskMapper.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-database.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [mybatis-config.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.lang.RuntimeException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'java.util.String'. Cause: java.lang.ClassNotFoundException: Cannot find class: java.util.String at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:291) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1139) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:299) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:295) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:644) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:493) at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:121) at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:60) at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:100) at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:250) at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContextInternal(CacheAwareContextLoaderDelegate.java:64) at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:91) ... 25 more Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: cn.com.l9e.zwk.service.TimedTaskService cn.com.l9e.zwk.job.TimedTaskJob.timedTaskService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'timedTaskServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private cn.com.l9e.zwk.dao.TimedTaskMapper cn.com.l9e.zwk.service.impl.TimedTaskServiceImpl.timedTaskMapper; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [cn.com.l9e.zwk.dao.TimedTaskMapper] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:517) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:288) ... 41 more Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'timedTaskServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private cn.com.l9e.zwk.dao.TimedTaskMapper cn.com.l9e.zwk.service.impl.TimedTaskServiceImpl.timedTaskMapper; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [cn.com.l9e.zwk.dao.TimedTaskMapper] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:291) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1139) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:299) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:295) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195) at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:931) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:874) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:789) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:489) ... 43 more Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private cn.com.l9e.zwk.dao.TimedTaskMapper cn.com.l9e.zwk.service.impl.TimedTaskServiceImpl.timedTaskMapper; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [cn.com.l9e.zwk.dao.TimedTaskMapper] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:517) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:288) ... 54 more Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [cn.com.l9e.zwk.dao.TimedTaskMapper] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:1009) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:877) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:789) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:489) ... 56 more
来源:开源中国
发布时间:2017-06-07 16:42:00
HDC调试需求开发(15万预算),能者速来!>>> 这两天因为需求做一个数据采集的工具,之前也针对一些网站做过一些类似的东西,虽然过程上嗑嗑绊绊,但最后都达到了效果。 因为算不上经验丰富,这回遇到的麻烦让我比较困惑。 大概需要抓取二十多万数据,数据源网站服务器用的是IIS7,.net平台,请求大概一千到两千次左右,IP会被禁止,服务器直接返回503,采集中断,封禁时间大概为12个小时。 我采集的速度并不快,尝试过多种暂缓方式。每抓取10条停顿3s/5s/10s,或100条停顿30s/60s,或200条停顿300s/600s,后来发现无论如何去设置间隔时间都是徒劳,我每一次重启路由器开始抓取数量不会超过2000条,就会被服务器拒绝,直接返回503,然后封禁12个小时左右。 为此,我尝试使用代理来完成我的工作,做一个代理控制器,然后google百度的可用代理服务器ip地址列表,这些地址质量惨不忍睹,少有可以正常工作的服务器,以非常缓慢的速度响应,这显然不能为我所用,只好弃之,再寻它法。 由于我是使用远程服务器24小时开机来做数据抓取,所以并不能像adsl重启路由来获得新的ip地址,目前服务器IP刚被解封。即使使用adsl线路依靠重启路由的方式来完成数据抓取,20万的量也足够让我困扰了,除非再写一个定时重启路由的程序,这意味着我随时准备断网,想着都痛苦。 有哪位朋友研究过iis/asp.net/iis插件来限制客户端ip请求次数的原理的?希望能绕过去。 或者,能否伪造http请求的IP?这都比较靠近底层的协议了,小弟对这些目前白纸一张,恳请指教。 每个ip在一天内限制不到2000次,20余万的数据,买代理服务器可否现实?有卖的不?
来源:开源中国
发布时间:2013-01-03 01:30:00
HDC调试需求开发(15万预算),能者速来!>>> 需求:C#实现在本地IIS上搭建一个FTP站点,并启动该站点 问题:网上很多关于C#操作IIS创建web站点的例子,其中提到可用该方法创建FTP,尝试后发现网上说的路径找不到,代码如下: DirectoryEntry Services = new DirectoryEntry("IIS://localhost/MSFTPSVC"); foreach (DirectoryEntry server in Services.Children) { //MessageBox.Show(server.SchemaClassName); } 异常:第二行就提示异常信息:系统找不到指定的路径。 参考的链接如下: https://www.cnblogs.com/chenkai/archive/2010/07/26/1785074.html
来源:开源中国
发布时间:2020-02-22 14:36:00
HDC调试需求开发(15万预算),能者速来!>>> 应用程序池“###”将被自动禁用,原因是为此应用程序池提供服务的进程中出现一系列错误,来源是WAS,事件是5002
来源:开源中国
发布时间:2016-08-27 11:35:00
HDC调试需求开发(15万预算),能者速来!>>> 我单位内部系统,用户5000多人,平时在线600+ 经查需要上班期间临时更新补丁,每次重启IIS都要10分钟左右,期间要提前发通知。 能否设置访问网站超过2-3秒无法打开系统时,自动跳转到提示系统正在自动更新的网页,其他时间正常访问 IIS上有没有相关功能或者其他的变通方法 谢谢,大侠们
来源:开源中国
发布时间:2019-05-16 15:40:09
HDC调试需求开发(15万预算),能者速来!>>> IIS 8.0 上配置对 Analysis Services 的 HTTP 访问 出错,出现以下错误,百度谷歌没有找到任何的解决办法。 求问各路大神,有没有碰到过,或者是知道哪里出现问题的。 红包感谢!!!!
来源:开源中国
发布时间:2019-05-11 16:13:00
HDC调试需求开发(15万预算),能者速来!>>> 公司有一个几百兆的外网ip,然后原有项目都是用iis发布的,只有一个80端口对外,我不得不用iis做反向代理,转发到我自己的tomcat服务上面去,现在是转发成功了,但是配置https 我有点迷茫了。我是在哪配https了?是转发的iis上面配置,还是在内网的tomcat上面配置了?头好痛....没办法公司不想在买外网ip了。
来源:开源中国
发布时间:2018-12-25 15:02:00
HDC调试需求开发(15万预算),能者速来!>>> Hangfire可以实现按秒级来执行任务吗?如果不可以,在web项目中怎么实现定时按秒来执行?
来源:开源中国
发布时间:2017-01-13 09:32:00
HDC调试需求开发(15万预算),能者速来!>>> 我没在线上实际部署过nginx反向代理,看到网上的文章也是云云雾里!有的部署前段,有的部署后端,写来写去都没突出个重点。 有实际在线上部署过的大佬帮忙解答下这个小白问题!还有就是能否普及下nginx安全之类的知识?,毕竟暴露在公网提供服务的。
来源:开源中国
发布时间:2017-06-18 09:56:00
HDC调试需求开发(15万预算),能者速来!>>> 我最近没事想用git弄一个自己的网站,做到一半发现打不开本机地址http://localhost4000。我百度看到好像是电脑没有安装lls,但是在我安装lls时又出现0x80070057错误代码,查了好多回答,都不管用,有的说要重装系统才行,我的是家庭版的的,有的说是家庭版功能不全,求大神解决一下!不用重装系统最好,或者怎样解决打开localhost4000,谢谢了~
来源:开源中国
发布时间:2017-05-28 22:30:00
HDC调试需求开发(15万预算),能者速来!>>> 想通过命令行修改IIS某个站点的物理路径,使用如下命令修改不了,请问是哪里出了问题呢?谢谢! .\appcmd.exe set APP "Default Web Site/A4" /physicalPath:"E:\Arc"
来源:开源中国
发布时间:2016-11-03 09:31:00
HDC调试需求开发(15万预算),能者速来!>>> 之前一直在用lnmp,最近尝试了一下win2008+iis7.5+php+mysql,配置https成功,可以访问,但是在网上并没有找到在iis下如何优化https,以下是用nginx时的设置: ssl_session_timeout 20m; ssl_session_cache shared:SSL:20m; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on; ssl_ciphers ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-RC4-SHA:!ECDHE-RSA-RC4-SHA:ECDH-ECDSA-RC4-SHA:ECDH-RSA-RC4-SHA:ECDHE-RSA-AES256-SHA:!RC4-SHA:HIGH:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!CBC:!EDH:!kEDH:!PSK:!SRP:!kECDH; ssl_ecdh_curve secp384r1; ssl_session_tickets off; ssl_stapling on; ssl_stapling_verify on; ssl_stapling_file /www/ssl/stapling_ocsp; ssl_trusted_certificate /www/ssl/chain.pem; resolver 172.16.0.111 172.16.0.110 valid=300s; resolver_timeout 5s; 请问在iis7.5下是否需要这些设置?要如何去设置?谢谢。
来源:开源中国
发布时间:2017-03-20 11:48:00
HDC调试需求开发(15万预算),能者速来!>>> IIS怎么整合JAVA,可以上传JAVA进行编译,可以上传打包好的war包进行整合编译
来源:开源中国
发布时间:2017-02-24 14:00:00
HDC调试需求开发(15万预算),能者速来!>>> 在一台服务器上用安装了nginx和iis,用nginx做反向代理,监听80端口,iis的站点只好使用8000端口。域名解析www.a.com,因为iis站点是别人开发的,不知道为什么在提交一个表单之后,跳转到一个新页面后,URL自带了端口,变成了www.a.com:8000,这样就绕过了nginx的监听,直接访问的iis了,有没有什么办法把8000端口改成80端口
来源:开源中国
发布时间:2017-02-16 23:35:00
HDC调试需求开发(15万预算),能者速来!>>> 80端口没对外开放,在配置Let’s Encrypt出现下面提示,该怎么处理? The ACME server was probably unable to reach http://XXXXX.XXXXX.XXX/.well-known/acme-challenge/eue_UrCJxw9Xpu3F7QxxIoXPq77GwaEuXSzj4RTj6so Check in a browser to see if the answer file is being served correctly. This could be caused by IIS not being setup to handle extensionless static files. Here's how to fix that: 1. In IIS manager goto Site/Server->Handler Mappings->View Ordered List 2. Move the StaticFile mapping above the ExtensionlessUrlHandler mappings. (like this http://i.stack.imgur.com/nkvrL.png ) 3. if you need to make changes to your web,config file, update the one at D:\letsencrypt-win-simple.V1.9.1\web_config.xml
来源:开源中国
发布时间:2017-01-05 08:53:00
HDC调试需求开发(15万预算),能者速来!>>> 在Nginx中配置了2个WEB应用地址。现在其中一个应用地址IIS停止了。结果客户访问的时候到关闭的那地址时候会超时1分钟。这个如何解决。 upstream a.com{ #ip_hash; server 192.168.1.10:80; server 192.168.1.11:80; } 详细的Nginx配置 #user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; upstream a.com{ #ip_hash; server 192.168.1.10:80; server 192.168.1.11:80; } server { listen 80; #server_name localhost; server_name a.com; #charset koi8-r; #access_log logs/host.access.log main; location / { # root html; # index index.html index.htm; proxy_pass http://a.com; proxy_redirect default; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # #location ~ \.php$ { # root html; # fastcgi_pass 127.0.0.1:9000; # fastcgi_index index.php; # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; # include fastcgi_params; #} # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} } # another virtual host using mix of IP-, name-, and port-based configuration # #server { # listen 8000; # listen somename:8080; # server_name somename alias another.alias; # location / { # root html; # index index.html index.htm; # } #} # HTTPS server # #server { # listen 443 ssl; # server_name localhost; # ssl_certificate cert.pem; # ssl_certificate_key cert.key; # ssl_session_cache shared:SSL:1m; # ssl_session_timeout 5m; # ssl_ciphers HIGH:!aNULL:!MD5; # ssl_prefer_server_ciphers on; # location / { # root html; # index index.html index.htm; # } #} }
来源:开源中国
发布时间:2016-09-20 15:48:00
HDC调试需求开发(15万预算),能者速来!>>> 测试环境是在WINDOWS2003,IIS6,NGINX 1.0下. location ~/ { proxy_set_header Accept-Encoding "none"; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real_IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_connect_timeout 120s; proxy_read_timeout 120s; proxy_send_timeout 120s; proxy_buffering off; proxy_pass http://127.0.0.1:8080; } 在测试的时候,如果直接访问,127.0.0.1:80,即访问nginx,就很容易出现错误: upstream timed out (10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond) while connecting to upstream 上面这是NGINX的错误日志.在浏览器上反应就是502,504错误. 但如果在测试的时候,把测试地址改成http://127.0.0.1:8080,即访问IIS,根本不会出现超时什么的. 有人说是IIS脚本执行时间太长,但问题时,使用静态页面也出现同样的问题.就不应该是IIS的问题了. 后来又把同样的程序,放到另外一台2003上运行,把NGINX的代理地址也改了,情况就好多. 为什么直接代理本机却出现一大堆超时错误.不要说把timeout的值改大,那个改大了,浏览器上的反应就是一直在等待.还不如直接输出错误呢. 请问这种问题应该怎么解决呢?
来源:开源中国
发布时间:2011-07-28 13:17:00
HDC调试需求开发(15万预算),能者速来!>>> 因为历史遗留问题 以及现状 背景:目前遇到一个很囧的情况 有一台服务器是server2003的,装的是IIS6。目前已经跑了三个用.net写的项目在iis上,都是用的80端口的,我需要跑一个java的项目在tomcat上,因为要和微信交互,所以必须要也要80端口。目前三个网站所使用的二级域名是a.test.com,b.test.com,c.test.com。 问题:我不能动原来的项目也不能升级iis或者系统,而且暂时不能给我指配另一个二级域名,而且要求我和c.test.com共用一个二级域名。。。我该怎么让一个.net写的和一个java写的项目跑在c.test.com这个域名上?或者让java的跑在c.test.com/mine 这种子项目上? 谢谢各位大神
来源:开源中国
发布时间:2016-10-17 21:52:00
HDC调试需求开发(15万预算),能者速来!>>> iis php怎样取得取得伪静态后的Url 如:index.php?id=12&n=34 伪静态后 i-12-34.html apache可以直接取得 i-12-34.html,但iis好像取得这样的结果只能取得动态的Url
来源:开源中国
发布时间:2011-12-27 11:40:00
HDC调试需求开发(15万预算),能者速来!>>> 早上好 http://www.test.com/test.txt 可以下载 http://www.test.com/test.ini 下载显示404 怎么回事啊?
来源:开源中国
发布时间:2016-09-22 08:13:00
HDC调试需求开发(15万预算),能者速来!>>> 目前已知的 1.项目放到服务器上(centos7)发现mina客户端无法收到服务端的信息,但是把mina客户端放在本机运行连接远程的mina服务端是可以的,客户端和服务端通信是8080/UDP端口,centos端口已打开. 2.通过抓包确定,服务端确实成功发出了信息,但是部署在centos上的mina客户端确实没有收到 3.客户端发送的数据,服务端可以正常收到 4.mina客户端集成在springboot上边 5.最后在说一句....本机调试mina客户端是没有问题的
来源:开源中国
发布时间:2019-09-15 19:45:00
HDC调试需求开发(15万预算),能者速来!>>> mina接收消息:开始符号,和结束符号问题,TextLineCodecFactory默认是/r/n 客户机消息是 STX是开头 ETX是结尾,对应16进制02 03,这时候TextLineCodecFactory需要怎么设置呢? 核心代码: TextLineCodecFactory tlcf = new TextLineCodecFactory(Charset.forName("gb2312"),new LineDelimiter("STXETX"),new LineDelimiter("STXETX")); 目前收到消息如下:没有正常调用接收消息的messageReceived方法 完整代码: package com.yice.cloud.websocket; import java.io.IOException; import java.net.InetSocketAddress; import java.nio.charset.Charset; import org.apache.mina.core.service.IoAcceptor; import org.apache.mina.core.service.IoHandlerAdapter; import org.apache.mina.core.session.IdleStatus; import org.apache.mina.core.session.IoSession; import org.apache.mina.filter.codec.ProtocolCodecFilter; import org.apache.mina.filter.codec.textline.LineDelimiter; import org.apache.mina.filter.codec.textline.TextLineCodecFactory; import org.apache.mina.filter.logging.LoggingFilter; import org.apache.mina.transport.socket.nio.NioSocketAcceptor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class MinaTimeTest { private static final int PORT = 9123; public static void main(String[] args) throws IOException { //首先,我们为服务端创建IoAcceptor,NioSocketAcceptor是基于NIO的服务端监听器 IoAcceptor acceptor = new NioSocketAcceptor(); //接着,如结构图示,在Acceptor和IoHandler之间将设置一系列的Fliter"\r\n", "\r\n" //包括记录过滤器和编解码过滤器。其中TextLineCodecFactory是mina自带的文本解编码器 acceptor.getFilterChain().addLast("logger", new LoggingFilter()); TextLineCodecFactory tlcf = new TextLineCodecFactory(Charset.forName("gb2312"),new LineDelimiter("STXETX"),new LineDelimiter("STXETX")); //CustomProtocolCodecFactory tlcf = new CustomProtocolCodecFactory(Charset.forName("gb2312")); acceptor.getFilterChain().addLast("codec", new ProtocolCodecFilter(tlcf)); /*acceptor.getFilterChain().addLast("codec", new ProtocolCodecFilter(new ObjectSerializationCodecFactory()));*/ //配置事务处理Handler,将请求转由TimeServerHandler处理。 acceptor.setHandler(new TimeServerHandler()); //配置Buffer的缓冲区大小 acceptor.getSessionConfig().setReadBufferSize(2048); //设置等待时间,每隔IdleTime将调用一次handler.sessionIdle()方法 acceptor.getSessionConfig().setIdleTime(IdleStatus.BOTH_IDLE, 10); //绑定端口 acceptor.bind(new InetSocketAddress(PORT)); } static class TimeServerHandler extends IoHandlerAdapter { private Logger logger = LoggerFactory.getLogger(this.getClass()); public void exceptionCaught(IoSession session, Throwable cause) throws Exception { cause.printStackTrace(); } public void messageReceived(IoSession session, Object message) throws Exception { logger.info("接受消息成功..." + message.toString()); super.messageReceived(session, message); } public void sessionIdle(IoSession session, IdleStatus status) throws Exception { System.out.println("IDLE ==============" + session.getIdleCount(status)); } } }
来源:开源中国
发布时间:2019-07-30 21:19:00
HDC调试需求开发(15万预算),能者速来!>>> 想跑一下TLD目标跟踪的程序,下了一个C++实现的代码 https://github.com/jmfs/OpenTLD 程序是在vs2010下写的,我电脑上装的是vs2012,配置的opencv2.4.10. 打开run_tld时按照提示更新了,平台工具集如果用Visual Studio 2012 (v110) 就会报错,如下 1>------ 已启动全部重新生成: 项目: ZERO_CHECK (Visual Studio 2010), 配置: Debug Win32 ------ 1>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Platform.targets(42,5): error MSB8020: The builds tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found. To build using the v100 build tools, either click the Project menu or right-click the solution, and then select "Update VC++ Projects...". Install Visual Studio 2010 to build using the Visual Studio 2010 build tools. 2>------ 已启动全部重新生成: 项目: LKTracker (Visual Studio 2010), 配置: Debug Win32 ------ 3>------ 已启动全部重新生成: 项目: ferNN (Visual Studio 2010), 配置: Debug Win32 ------ 2>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets(1395,5): warning : The referenced project 'C:/Users/Dev/OpenTLD C++/src/ZERO_CHECK.vcxproj' does not exist. 2>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Platform.targets(42,5): error MSB8020: The builds tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found. To build using the v100 build tools, either click the Project menu or right-click the solution, and then select "Update VC++ Projects...". Install Visual Studio 2010 to build using the Visual Studio 2010 build tools. 3>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets(1395,5): warning : The referenced project 'C:/Users/Dev/OpenTLD C++/src/ZERO_CHECK.vcxproj' does not exist. 3>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Platform.targets(42,5): error MSB8020: The builds tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found. To build using the v100 build tools, either click the Project menu or right-click the solution, and then select "Update VC++ Projects...". Install Visual Studio 2010 to build using the Visual Studio 2010 build tools. 4>------ 已启动全部重新生成: 项目: tld (Visual Studio 2010), 配置: Debug Win32 ------ 5>------ 已启动全部重新生成: 项目: tld_utils (Visual Studio 2010), 配置: Debug Win32 ------ 4>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets(1395,5): warning : The referenced project 'C:/Users/Dev/OpenTLD C++/src/ZERO_CHECK.vcxproj' does not exist. 4>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Platform.targets(42,5): error MSB8020: The builds tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found. To build using the v100 build tools, either click the Project menu or right-click the solution, and then select "Update VC++ Projects...". Install Visual Studio 2010 to build using the Visual Studio 2010 build tools. 5>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets(1395,5): warning : The referenced project 'C:/Users/Dev/OpenTLD C++/src/ZERO_CHECK.vcxproj' does not exist. 5>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Platform.targets(42,5): error MSB8020: The builds tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found. To build using the v100 build tools, either click the Project menu or right-click the solution, and then select "Update VC++ Projects...". Install Visual Studio 2010 to build using the Visual Studio 2010 build tools. 6>------ 已启动全部重新生成: 项目: run_tld, 配置: Debug Win32 ------ 6>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets(1395,5): warning : The referenced project 'C:/Users/Dev/OpenTLD C++/src/LKTracker.vcxproj' does not exist. 6>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets(1395,5): warning : The referenced project 'C:/Users/Dev/OpenTLD C++/src/ZERO_CHECK.vcxproj' does not exist. 6>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets(1395,5): warning : The referenced project 'C:/Users/Dev/OpenTLD C++/src/ferNN.vcxproj' does not exist. 6>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets(1395,5): warning : The referenced project 'C:/Users/Dev/OpenTLD C++/src/tld.vcxproj' does not exist. 6>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets(1395,5): warning : The referenced project 'C:/Users/Dev/OpenTLD C++/src/tld_utils.vcxproj' does not exist. 6> Building Custom Rule C:/Users/Dev/OpenTLD C++/src/CMakeLists.txt 6> 系统找不到指定的路径。 6>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets(172,5): error MSB6006: “cmd.exe”已退出,代码为 3。 7>------ 已跳过全部重新生成: 项目: ALL_BUILD (Visual Studio 2010), 配置: Debug Win32 ------ 7>没有为此解决方案配置选中要生成的项目 ========== 全部重新生成: 成功 0 个,失败 6 个,跳过 1 个 ========== 改成v100也还是报错 1>------ 已启动全部重新生成: 项目: ZERO_CHECK (Visual Studio 2010), 配置: Debug Win32 ------ 1>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Platform.targets(42,5): error MSB8020: The builds tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found. To build using the v100 build tools, either click the Project menu or right-click the solution, and then select "Update VC++ Projects...". Install Visual Studio 2010 to build using the Visual Studio 2010 build tools. 2>------ 已启动全部重新生成: 项目: LKTracker (Visual Studio 2010), 配置: Debug Win32 ------ 3>------ 已启动全部重新生成: 项目: ferNN (Visual Studio 2010), 配置: Debug Win32 ------ 3>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets(1395,5): warning : The referenced project 'C:/Users/Dev/OpenTLD C++/src/ZERO_CHECK.vcxproj' does not exist. 3>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Platform.targets(42,5): error MSB8020: The builds tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found. To build using the v100 build tools, either click the Project menu or right-click the solution, and then select "Update VC++ Projects...". Install Visual Studio 2010 to build using the Visual Studio 2010 build tools. 4>------ 已启动全部重新生成: 项目: tld (Visual Studio 2010), 配置: Debug Win32 ------ 2>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets(1395,5): warning : The referenced project 'C:/Users/Dev/OpenTLD C++/src/ZERO_CHECK.vcxproj' does not exist. 2>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Platform.targets(42,5): error MSB8020: The builds tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found. To build using the v100 build tools, either click the Project menu or right-click the solution, and then select "Update VC++ Projects...". Install Visual Studio 2010 to build using the Visual Studio 2010 build tools. 4>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets(1395,5): warning : The referenced project 'C:/Users/Dev/OpenTLD C++/src/ZERO_CHECK.vcxproj' does not exist. 4>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Platform.targets(42,5): error MSB8020: The builds tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found. To build using the v100 build tools, either click the Project menu or right-click the solution, and then select "Update VC++ Projects...". Install Visual Studio 2010 to build using the Visual Studio 2010 build tools. 5>------ 已启动全部重新生成: 项目: tld_utils (Visual Studio 2010), 配置: Debug Win32 ------ 5>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets(1395,5): warning : The referenced project 'C:/Users/Dev/OpenTLD C++/src/ZERO_CHECK.vcxproj' does not exist. 5>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Platform.targets(42,5): error MSB8020: The builds tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found. To build using the v100 build tools, either click the Project menu or right-click the solution, and then select "Update VC++ Projects...". Install Visual Studio 2010 to build using the Visual Studio 2010 build tools. 6>------ 已启动全部重新生成: 项目: run_tld (Visual Studio 2010), 配置: Debug Win32 ------ 6>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets(1395,5): warning : The referenced project 'C:/Users/Dev/OpenTLD C++/src/LKTracker.vcxproj' does not exist. 6>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets(1395,5): warning : The referenced project 'C:/Users/Dev/OpenTLD C++/src/ZERO_CHECK.vcxproj' does not exist. 6>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets(1395,5): warning : The referenced project 'C:/Users/Dev/OpenTLD C++/src/ferNN.vcxproj' does not exist. 6>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets(1395,5): warning : The referenced project 'C:/Users/Dev/OpenTLD C++/src/tld.vcxproj' does not exist. 6>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets(1395,5): warning : The referenced project 'C:/Users/Dev/OpenTLD C++/src/tld_utils.vcxproj' does not exist. 6>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Platform.targets(42,5): error MSB8020: The builds tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found. To build using the v100 build tools, either click the Project menu or right-click the solution, and then select "Update VC++ Projects...". Install Visual Studio 2010 to build using the Visual Studio 2010 build tools. 7>------ 已跳过全部重新生成: 项目: ALL_BUILD (Visual Studio 2010), 配置: Debug Win32 ------ 7>没有为此解决方案配置选中要生成的项目 ========== 全部重新生成: 成功 0 个,失败 6 个,跳过 1 个 ========== 应该怎么解决呢?
来源:开源中国
发布时间:2017-01-24 22:43:00
HDC调试需求开发(15万预算),能者速来!>>> opencv中的train函数,训练的是一个人脸的多张图片(比如不用表情的图片),还是不同人脸的照片啊
来源:开源中国
发布时间:2016-04-16 19:36:00
HDC调试需求开发(15万预算),能者速来!>>> 小弟最近想要学习openCV,使用的开发环境是PyCharm,通过PyCharm下的 "Project Interpreter"安装的opencv-python。安装后下图所示: 当我 import cv2 后,没有错误提示,但是对于cv2模块里面的函数没有提示,如下图所示: 如果我输入“ cv2.cv2. ”之后就会出现正常的提示,如下图所示: 而当我使用 “ cv2.cv2.imread() “ 函数并运行,就会出现错误,提示 cv2没有cv2属性: 如果我不管软件的自动补全,直接使用 “cv2.imread()”函数则能运行,而且可以通过“cv2.imshow”函数把图片显示出来。 请问各位大侠,是我的PyCharm软件有些配置没有设置好吗???
来源:开源中国
发布时间:2017-02-10 17:29:00
HDC调试需求开发(15万预算),能者速来!>>> 用ffmpeg怎么无缝切换视频源呢?我试过先把进程关闭然后重新推流,但是这样会导致中间卡顿20秒左右,也试过用javacv循环推流,但是帧数一直上不去,请问一下还有什么方法解决。
来源:开源中国
发布时间:2016-12-29 13:45:00
HDC调试需求开发(15万预算),能者速来!>>> 情况是这样的, 从摄像头获取到的视频, 经过opencv的处理后, 通过使用 opencv的 videoWriter 创建一个视频流, 将获取到的mat数据保存在android开发板上, 但是发现在android开发板上 videoWriter 都无法创建视频文件, 更别说保存视频了。在电脑上是可以保存的, 而且使用c++ 的系统函数ofstream 是可以在android的开发板上同一个目录下读写文件的, 不是目录文件权限问题。 这种问题应该怎么解决, 或者有其他的替代方案, 将获取的mat数据保存为一个视频文件, 方便以后读取回放。 还望大神们不吝赐教
来源:开源中国
发布时间:2016-12-28 10:52:00