C# SQL数据库间歇性异常 A network-related or instance-specific error

求助!原本稳定运行一段时间的程序突然出现SQL数据库连接异常
程序异常信息 如下

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

  1. 可以ping到远程数据库服务器的ip(局域网)
  2. 使用SQL Server 2014 Management Studio无法连接到远程数据库 (异常提示与程序异常一致),但本地的数据库可以连接上
  3. 重启本机后可以正常连接远程数据库
  4. 程序是定时请求数据库视图 大概是间隔10分钟请求一次
  5. 目前只是这台电脑存在问题,有运行本程序更久的电脑 没有出现过类似情况
  6. 运行程序的电脑系统是Server 2008、本地数据库是 Server 2008 R2、远程数据库的版本不清楚(别人家的)
  7. 远程数据库应该没问题 因为异常期间局域网内其他电脑可以正常访问

尝试了多种百度类似题主的解决方法 都没效果(注!没有对程序做任何修改),最后没法重启了一次电脑,程序数据库可以正常访问,原本以为没问题了, 可是后面又出现了一次异常,但是程序日志显示 出现异常后一段时间 又可以正常访问数据库了

网上一样异常信息的有不少,但是实际和我的情况是不一样,有没有大佬遇到过 求教

sql

1个回答

网络不稳定或者服务器不稳定,检查网线、交换机、还有计算机上是否运行了防火墙、劣质国产杀毒软件等。

huyuan55555
huyuan55555 回复caozhy: 嗯 但可能性应该比较小 硬件这些没有做过调整(不在现场),距离上一次出现问题 到目前为止没有再出现这种情况
一年多之前 回复
caozhy
贵阳老马马善福专业维修游泳池堵漏防水工程 回复huyuan55555: 网络连接不稳,丢包都可能出问题
一年多之前 回复
huyuan55555
huyuan55555 出现异常的时候计算机内网是没问题的,可以互ping,没有安装杀毒软件,自带防火墙都是关着的
一年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
Manage m=new Manage();提示 Multiple markers at this line,Manage can not be resolved to a type,

package com.test;import java.awt.Dimension;import java.awt.Toolkit;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import java.io.IOException;import javax.swing.ButtonGroup;import javax.swing.JButton;import javax.swing.JFrame;import javax.swing.JLabel;import javax.swing.JOptionPane;import javax.swing.JPanel;import javax.swing.JPasswordField;import javax.swing.JRadioButton;import javax.swing.JTextField;/** * 教 师: * 账号:143821 * 密码:143821 * * 管理员: * 账号:14 * 密码:123 * * 学 生: * 账号:学号 * 密码:学号 */public class Login extends JFrame { public static void main(String[] args) { // TODO Auto-generated method stub final boolean[] rb=new boolean[3]; final String userName = "abc"; final String passwrod = "123"; JFrame jFrame = new JFrame("教务管理系统--登陆界面");// jFrame.setSize(1000,1000); Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize(); jFrame.setBounds(((int)dimension.getWidth() - 200) / 2, ((int)dimension.getHeight() - 300) / 2, 220, 180); //去掉最大化 jFrame.setResizable(false); jFrame.setLayout(null); jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JLabel label1 = new JLabel("账号"); label1.setBounds(10, 10, 100, 30); jFrame.add(label1); JLabel label2 = new JLabel("密码"); label2.setBounds(10, 40, 100, 30); jFrame.add(label2); final JTextField text1 = new JTextField(); text1.setBounds(50, 15, 150, 20); jFrame.add(text1); final JPasswordField text2 = new JPasswordField(); text2.setBounds(50, 45, 150, 20); jFrame.add(text2); JRadioButton rb1=new JRadioButton("管理员"); JRadioButton rb2=new JRadioButton("老师"); JRadioButton rb3=new JRadioButton("学生"); JPanel jp=new JPanel(); jp.add(rb1); jp.add(rb2); jp.add(rb3); jp.setBounds(0, 75, 220, 40); jFrame.add(jp); ButtonGroup group = new ButtonGroup();// 创建单选按钮组 group.add(rb1);// 将radioButton1增加到单选按钮组中 group.add(rb2);// 将radioButton2增加到单选按钮组中 group.add(rb3);// 将radioButton3增加到单选按钮组中 rb1.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e) { // TODO Auto-generated method stub if("14".equals(text1.getText())&&"123".equals(text2.getText())) rb[0]=true; } }); rb2.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e) { // TODO Auto-generated method stub if("143821".equals(text1.getText())&&"143821".equals(text2.getText())) rb[1]=true; }

spring boot Neo4j的异常

今天在调试项目时发现使用@Transactional这个注解时会报下面这个错误 ``` org.springframework.transaction.CannotCreateTransactionException: Could not open Neo4j Session for transaction; nested exception is org.neo4j.ogm.drivers.http.request.HttpRequestException: http://localhost:7474/db/data/transaction: Connect to localhost:7474 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect at org.springframework.data.neo4j.transaction.Neo4jTransactionManager.doBegin(Neo4jTransactionManager.java:199) at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:373) at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:461) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:277) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673) at com.xuebank.kindergartenadmin.service.impl.UserMenuServiceImpl$$EnhancerBySpringCGLIB$$2ce9ff08.updateMenuAuthorize(<generated>) at com.xuebank.kindergartenadmin.web.controller.handle.UserPermissionController.updateMenuAuthorize(UserPermissionController.java:150) at com.xuebank.kindergartenadmin.web.controller.handle.UserPermissionController$$FastClassBySpringCGLIB$$258eaa60.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:97) at com.xuebank.kindergartenadmin.aop.MenuAuthorizeInterceptor.doAround(MenuAuthorizeInterceptor.java:99) 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.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:629) at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:618) at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:168) at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:97) at com.xuebank.kindergartenadmin.aop.CheckLoginInterceptor.doAround(CheckLoginInterceptor.java:88) 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.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:629) at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:618) at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:168) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673) at com.xuebank.kindergartenadmin.web.controller.handle.UserPermissionController$$EnhancerBySpringCGLIB$$32caf83f.updateMenuAuthorize(<generated>) 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.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872) at javax.servlet.http.HttpServlet.service(HttpServlet.java:661) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:108) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.session.web.http.SessionRepositoryFilter.doFilterInternal(SessionRepositoryFilter.java:167) at org.springframework.session.web.http.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:80) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Unknown Source) ``` 后来调查发现是引入了下面这个包的问题 ``` <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-neo4j</artifactId> </dependency> ``` 那位大神能告诉我为什么引入spring-boot-starter-data-neo4j这个包注解事务就不能用了。。。 springboot版本1.5.10

springboot 整合mybatis 报错提示包扫描不进去

![图片说明](https://img-ask.csdn.net/upload/201908/14/1565777159_224084.png) ``` package com.liupeng; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import tk.mybatis.spring.annotation.MapperScan; @SpringBootApplication() @MapperScan(basePackages = "com.liupeng.mapper") public class Application { public static void main(String[] args) { SpringApplication.run(Application.class,args); } } ``` ``` package com.liupeng.service; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.liupeng.mapper.UserMapper; import com.liupeng.pojo.User; @Service(value = "Userservice") public class UserServiceImpl implements Userservice { @Autowired private UserMapper userMapper; @Override public User getNamePassword(User user) { // TODO Auto-generated method stub return userMapper.selectgetNamePassword(user); } @Override public void saveUser(User user) { // TODO Auto-generated method stub } } ``` mapper.xml ``` <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.liupeng.mapper.UserMapper"> ``` ``` #------------------配置虚拟文件路径--start------------------------------ spring.http.multipart.location=E:\Java\java代码\Chaoyang\src\main\resources #-----------------------------------------数据库--start---------------------- spring.datasource.driver-class-name=com.mysql.cj.jdbc.Drive spring.datasource.url=jdbc:mysql://localhost:3306/ssm_mybatis?serverTimezone=GMT spring.datasource.username=root spring.datasource.password=liupeng.123 spring.datasource.druid.stat-view-servlet.allow=true #获取连接等待超时时间 spring.datasource.dbcp2.max-wait-millis=60000 #mybatis配置 mybatis.type-aliases-package=com.liupeng.pojo mybatis.mapper-locations=classpath:mapper/*.xml #通用Mapper配置 #mapper.mappers=com.liupeng.utils.MyMapper #mapper.not-empty=false #mapper.identity=MYSQL #分页插件配置 pagehelper.helperDialect=mysq1 pagehelper.reasonable=true pagehelper.supportMethodsArguments=true pagehelper.params=count=countSql #文件上传配置 spring.http.multipart.maxFileSize=100Mb spring.http.multipart.maxRequestSize=1000Mb #配置api端口号 server.port=8080 #tomcat的URI编码 server.tomcat.uri-encoding=UTF-8 ``` ``` ERROR [main] - Application startup failed org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'registLoginController': Unsatisfied dependency expressed through field 'userservice'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'Userservice': Unsatisfied dependency expressed through field 'userMapper'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userMapper' defined in file [E:\Java\java代码\Chaoyang\target\classes\com\liupeng\mapper\UserMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [tk/mybatis/mapper/autoconfigure/MapperAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [E:\Java\java代码\Chaoyang\target\classes\mapper\UserMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.liupeng.mapper.UserMapper.BaseResultMap at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:586) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:364) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1268) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:551) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:481) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:756) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542) at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:123) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:666) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:353) at org.springframework.boot.SpringApplication.run(SpringApplication.java:300) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1082) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1071) at com.liupeng.Application.main(Application.java:13) Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'Userservice': Unsatisfied dependency expressed through field 'userMapper'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userMapper' defined in file [E:\Java\java代码\Chaoyang\target\classes\com\liupeng\mapper\UserMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [tk/mybatis/mapper/autoconfigure/MapperAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [E:\Java\java代码\Chaoyang\target\classes\mapper\UserMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.liupeng.mapper.UserMapper.BaseResultMap at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:586) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:364) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1268) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:551) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:481) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:211) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1131) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1059) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:583) ... 19 more Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userMapper' defined in file [E:\Java\java代码\Chaoyang\target\classes\com\liupeng\mapper\UserMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [tk/mybatis/mapper/autoconfigure/MapperAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [E:\Java\java代码\Chaoyang\target\classes\mapper\UserMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.liupeng.mapper.UserMapper.BaseResultMap at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1361) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1253) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:551) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:481) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:211) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1131) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1059) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:583) ... 32 more Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [tk/mybatis/mapper/autoconfigure/MapperAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [E:\Java\java代码\Chaoyang\target\classes\mapper\UserMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.liupeng.mapper.UserMapper.BaseResultMap at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1177) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1072) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:511) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:481) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:211) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1131) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1059) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1346) ... 43 more Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [E:\Java\java代码\Chaoyang\target\classes\mapper\UserMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.liupeng.mapper.UserMapper.BaseResultMap at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588) ... 55 more Caused by: org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [E:\Java\java代码\Chaoyang\target\classes\mapper\UserMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.liupeng.mapper.UserMapper.BaseResultMap at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:523) at org.mybatis.spring.SqlSessionFactoryBean.afterPropertiesSet(SqlSessionFactoryBean.java:380) at org.mybatis.spring.SqlSessionFactoryBean.getObject(SqlSessionFactoryBean.java:547) at tk.mybatis.mapper.autoconfigure.MapperAutoConfiguration.sqlSessionFactory(MapperAutoConfiguration.java:155) at tk.mybatis.mapper.autoconfigure.MapperAutoConfiguration$$EnhancerBySpringCGLIB$$90d064bb.CGLIB$sqlSessionFactory$1(<generated>) at tk.mybatis.mapper.autoconfigure.MapperAutoConfiguration$$EnhancerBySpringCGLIB$$90d064bb$$FastClassBySpringCGLIB$$b0514ca6.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:358) at tk.mybatis.mapper.autoconfigure.MapperAutoConfiguration$$EnhancerBySpringCGLIB$$90d064bb.sqlSessionFactory(<generated>) 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.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162) ... 56 more Caused by: org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.liupeng.mapper.UserMapper.BaseResultMap at org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:120) at org.apache.ibatis.builder.xml.XMLMapperBuilder.parse(XMLMapperBuilder.java:92) at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:521) ... 69 more Caused by: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.liupeng.mapper.UserMapper.BaseResultMap at org.apache.ibatis.session.Configuration$StrictMap.put(Configuration.java:872) at org.apache.ibatis.session.Configuration$StrictMap.put(Configuration.java:844) at org.apache.ibatis.session.Configuration.addResultMap(Configuration.java:626) at org.apache.ibatis.builder.MapperBuilderAssistant.addResultMap(MapperBuilderAssistant.java:214) at org.apache.ibatis.builder.ResultMapResolver.resolve(ResultMapResolver.java:47) at org.apache.ibatis.builder.xml.XMLMapperBuilder.resultMapElement(XMLMapperBuilder.java:285) at org.apache.ibatis.builder.xml.XMLMapperBuilder.resultMapElement(XMLMapperBuilder.java:252) at org.apache.ibatis.builder.xml.XMLMapperBuilder.resultMapElements(XMLMapperBuilder.java:244) at org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:116) ... 71 more ```

安卓activity启动的奇怪问题

sigletask和singleinstance 模式的activityA启动activityB后 按home回桌面,再次打开程序 显示的activityA 这是怎么解释。如何才能在再次打开时直接显示activityB? 现在更蹊跷的是,为activityA加了一个隐藏的侧拉栏,通过拖拽屏幕把侧拉栏显示,从这个侧拉栏上启动activityC,当我们按下home在点击app图标回来时,activityC是存在的,为什么这个activityC没有被回收呢?

HTTP Status 500 – Internal Server Error

Type Exception Report Message java.lang.NullPointerException Description The server encountered an unexpected condition that prevented it from fulfilling the request. Exception org.apache.jasper.JasperException: java.lang.NullPointerException org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:601) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:481) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:385) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:329) javax.servlet.http.HttpServlet.service(HttpServlet.java:742) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter.doFilter(StrutsPrepareFilter.java:91) Root Cause java.lang.NullPointerException org.apache.struts2.components.UIBean.evaluateParams(UIBean.java:827) org.apache.struts2.components.UIBean.end(UIBean.java:535) org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:42) org.apache.jsp.index_jsp._jspx_meth_s_005ftextfield_005f0(index_jsp.java:278) org.apache.jsp.index_jsp._jspx_meth_s_005fform_005f0(index_jsp.java:228) org.apache.jsp.index_jsp._jspService(index_jsp.java:163) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) javax.servlet.http.HttpServlet.service(HttpServlet.java:742) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:443) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:385) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:329) javax.servlet.http.HttpServlet.service(HttpServlet.java:742) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter.doFilter(StrutsPrepareFilter.java:91) Note The full stack trace of the root cause is available in the server logs. Apache Tomcat/8.5.13

QT中以ODBC Excel为数据源将数据显示到QTableView时,无数据内容

QT中以ODBC Excel为数据源将数据显示到QTableView时,首行首列及表格都有显示,但是没有数据内容。代码如下,求指教。![](http://photo.blog.sina.com.cn/photo/1025677740/0017pDDmzy6OtUn96Lhf3) db = QSqlDatabase::addDatabase("QODBC"); if(!db.isValid()) { qDebug() << "export2Excel failed: QODBC not supported."; return false; } QString dsn = QString("DRIVER={Microsoft Excel Driver (*.xls)};DBQ=%1").arg(xlsFile); db.setDatabaseName(dsn); if(!db.open()) { //错误处理 } QSqlQueryModel *model = new QSqlQueryModel(tableview); model->setQuery(QString("select * from [sheet1$];")); while(model->canFetchMore()) model->fetchMore(); tableview->setModel(model); tableview->setSelectionMode(QAbstractItemView::SingleSelection); tableview->setSelectionBehavior(QAbstractItemView::SelectRows); tableview->setColumnHidden(Stu_Id, false); tableview->resizeColumnsToContents(); tableview->setEditTriggers(QAbstractItemView::NoEditTriggers); db.close();

(Ruby on rails) 错误“ArgumentError (wrong number of arguments (1 for 0))”如何解决

是因为我没有安装'digest/sha1'和'digest/md5'么?当代码中有如下语句,需要安装这几个文件么?谢谢各位的帮助! require 'digest/sha1' require 'digest/md5' require 'rubygems' require 'atom/feed' ################################################################################################# 运行时出现错误500 internal erro,log记录如下: /app/models/bookmark.rb:20:in `initialize' /app/models/bookmark.rb:20:in `new' /app/models/bookmark.rb:20:in `uri=' C:/INSTAN~1.0-W/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:2117:in `send' C:/INSTAN~1.0-W/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:2117:in `attributes=' C:/INSTAN~1.0-W/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:2116:in `each' C:/INSTAN~1.0-W/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:2116:in `attributes=' C:/INSTAN~1.0-W/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:1926:in `initialize' /app/controllers/bookmarks_controller.rb:37:in `new' /app/controllers/bookmarks_controller.rb:37:in `create' C:/INSTAN~1.0-W/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1158:in `send' ################################################################################################# 我在模型Bookmark.rb中有如下定义: def uri=(new_uri) super self.uri_hash = Digest::MD5.new(new_uri).to_s (第20行) end ################################################################################################# bookmarks_controller代码片断如下: def create bookmark = Bookmark.find_by_user_id_and_uri(params[:bookmark][:user_id], params[:bookmark][:uri]) if bookmark # This user has already bookmarked this URI. They should be # using PUT instead. headers['Location'] = bookmark_url(@user.name, bookmark.uri) render :nothing => true, :status => "409 Conflict" else # Enforce default values for 'timestamp' and 'public' params[:bookmark][:timestamp] ||= Time.now params[:bookmark][:public] ||= "1" # Create the bookmark in the database. bookmark = Bookmark.new(params[:bookmark]) (第37行) if bookmark.save # Add tags. bookmark.tag_with(params[:taglist]) if params[:taglist] # Send a 201 response code that points to the location of the # new bookmark. headers['Location'] = bookmark_url(@user.name, bookmark.uri) render :nothing => true, :status => "201 Created" else render :xml => bookmark.errors.to_xml, :status => "400 Bad Request" end end end

QT TableWidget数据导出为EXCEL出错

运行时的错误: [NSE]KVirtualFolder::Initialize(5610),AssociationItemIcon(C:\) CoCreateInstance failure (拒绝访问。) QAxBase::setControl: requested control Excel.Application could not be instantiated 代码如下: ``` void MainWindow::Export(QTableWidget *table,QString title) { //第一个参数是页面上的表格,第二个是导出文件的表头数据 QString fileName = QFileDialog::getSaveFileName(table, "保存",QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation),"Excel(*.xls *.xlsx)"); // qDebug() << "开始"; // qDebug() << fileName; if (fileName!="") { QAxObject *excel = new QAxObject; if (excel->setControl("Excel.Application")) //连接Excel控件 { excel->dynamicCall("SetVisible (bool Visible)","false");//不显示窗体 excel->setProperty("DisplayAlerts", false);//不显示任何警告信息。如果为true那么在关闭是会出现类似“文件已修改,是否保存”的提示 QAxObject *workbooks = excel->querySubObject("WorkBooks");//获取工作簿集合 workbooks->dynamicCall("Add");//新建一个工作簿 QAxObject *workbook = excel->querySubObject("ActiveWorkBook");//获取当前工作簿 QAxObject *worksheet = workbook->querySubObject("Worksheets(int)", 1); int i,j; //QTablewidget 获取数据的列数 int colcount=table->columnCount(); //QTablewidget 获取数据的行数 int rowscount=table->rowCount(); // QTableView 获取列数 // int colount=ui->tableview->model->columnCount(); // QTableView 获取行数 // int rowcount=ui->tableview->model->rowCount(); QAxObject *cell,*col; //标题行 cell=worksheet->querySubObject("Cells(int,int)", 1, 1); cell->dynamicCall("SetValue(const QString&)", title); cell->querySubObject("Font")->setProperty("Size", 18); //调整行高 worksheet->querySubObject("Range(const QString&)", "1:1")->setProperty("RowHeight", 30); //合并标题行 QString cellTitle; cellTitle.append("A1:"); cellTitle.append(QChar(colcount - 1 + 'A')); cellTitle.append(QString::number(1)); QAxObject *range = worksheet->querySubObject("Range(const QString&)", cellTitle); range->setProperty("WrapText", true); range->setProperty("MergeCells", true); range->setProperty("HorizontalAlignment", -4108);//xlCenter range->setProperty("VerticalAlignment", -4108);//xlCenter //列标题 for(i=0;i<colcount;i++) { QString columnName; columnName.append(QChar(i + 'A')); columnName.append(":"); columnName.append(QChar(i + 'A')); col = worksheet->querySubObject("Columns(const QString&)", columnName); col->setProperty("ColumnWidth", table->columnWidth(i)/6); cell=worksheet->querySubObject("Cells(int,int)", 2, i+1); //QTableWidget 获取表格头部文字信息 columnName=table->horizontalHeaderItem(i)->text(); //QTableView 获取表格头部文字信息 // columnName=ui->tableView_right->model()->headerData(i,Qt::Horizontal,Qt::DisplayRole).toString(); cell->dynamicCall("SetValue(const QString&)", columnName); cell->querySubObject("Font")->setProperty("Bold", true); cell->querySubObject("Interior")->setProperty("Color",QColor(191, 191, 191)); cell->setProperty("HorizontalAlignment", -4108);//xlCenter cell->setProperty("VerticalAlignment", -4108);//xlCenter } //数据区 //QTableWidget 获取表格数据部分 for(i=0;i<rowscount;i++){ for (j=0;j<colcount;j++) { worksheet->querySubObject("Cells(int,int)", i+3, j+1)->dynamicCall("SetValue(const QString&)", table->item(i,j)?table->item(i,j)->text():""); } } //QTableView 获取表格数据部分 // for(i=0;i<rowcount;i++) //行数 // { // for (j=0;j<colcount;j++) //列数 // { // QModelIndex index = ui->tableView_right->model()->index(i, j); // QString strdata=ui->tableView_right->model()->data(index).toString(); // worksheet->querySubObject("Cells(int,int)", i+3, j+1)->dynamicCall("SetValue(const QString&)", strdata); // } // } //画框线 QString lrange; lrange.append("A2:"); lrange.append(colcount - 1 + 'A'); lrange.append(QString::number(table->rowCount() + 2)); range = worksheet->querySubObject("Range(const QString&)", lrange); range->querySubObject("Borders")->setProperty("LineStyle", QString::number(1)); range->querySubObject("Borders")->setProperty("Color", QColor(0, 0, 0)); //调整数据区行高 QString rowsName; rowsName.append("2:"); rowsName.append(QString::number(table->rowCount() + 2)); range = worksheet->querySubObject("Range(const QString&)", rowsName); range->setProperty("RowHeight", 20); workbook->dynamicCall("SaveAs(const QString&)",QDir::toNativeSeparators(fileName));//保存至fileName workbook->dynamicCall("Close()");//关闭工作簿 excel->dynamicCall("Quit()");//关闭excel delete excel; excel=NULL; if (QMessageBox::question(NULL,"完成","文件已经导出,是否现在打开?",QMessageBox::Yes|QMessageBox::No)==QMessageBox::Yes) { QDesktopServices::openUrl(QUrl("file:///" + QDir::toNativeSeparators(fileName))); } } else { QMessageBox::warning(NULL,"错误","未能创建 Excel 对象,请安装 Microsoft Excel。",QMessageBox::Apply); } } } ```

java.lang.IllegalStateException项目运行一会儿后,自动报的错误

java.lang.IllegalStateException: Illegal access: this web application instance has been stopped already. Could not load [com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask]. 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:1305) at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForClassLoading(WebappClassLoaderBase.java:1293) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1158) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119) at com.mchange.v2.resourcepool.BasicResourcePool.destroyResource(BasicResourcePool.java:1040) at com.mchange.v2.resourcepool.BasicResourcePool.removeResource(BasicResourcePool.java:1507) at com.mchange.v2.resourcepool.BasicResourcePool.removeResource(BasicResourcePool.java:1477) at com.mchange.v2.resourcepool.BasicResourcePool.cullExpired(BasicResourcePool.java:1565) at com.mchange.v2.resourcepool.BasicResourcePool.access$1900(BasicResourcePool.java:44) at com.mchange.v2.resourcepool.BasicResourcePool$CullTask.run(BasicResourcePool.java:2089) at java.util.TimerThread.mainLoop(Timer.java:555) at java.util.TimerThread.run(Timer.java:505) Exception in thread "C3P0PooledConnectionPoolManager[identityToken->1hge2h29m1zvigj1c8yih|3bfe9985]-AdminTaskTimer" java.lang.NoClassDefFoundError: com/mchange/v2/resourcepool/BasicResourcePool$1DestroyResourceTask at com.mchange.v2.resourcepool.BasicResourcePool.destroyResource(BasicResourcePool.java:1040) at com.mchange.v2.resourcepool.BasicResourcePool.removeResource(BasicResourcePool.java:1507) at com.mchange.v2.resourcepool.BasicResourcePool.removeResource(BasicResourcePool.java:1477) at com.mchange.v2.resourcepool.BasicResourcePool.cullExpired(BasicResourcePool.java:1565) at com.mchange.v2.resourcepool.BasicResourcePool.access$1900(BasicResourcePool.java:44) at com.mchange.v2.resourcepool.BasicResourcePool$CullTask.run(BasicResourcePool.java:2089) at java.util.TimerThread.mainLoop(Timer.java:555) at java.util.TimerThread.run(Timer.java:505) Caused by: java.lang.ClassNotFoundException: Illegal access: this web application instance has been stopped already. Could not load [com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask]. 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.checkStateForClassLoading(WebappClassLoaderBase.java:1295) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1158) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119) ... 8 more Caused by: java.lang.IllegalStateException: Illegal access: this web application instance has been stopped already. Could not load [com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask]. 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:1305) at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForClassLoading(WebappClassLoaderBase.java:1293) ... 10 more 这个问题,时不时的发生。也不知道是什么原因 自从换了C3P0连接池之后,就会发生这个问题 <property name="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property> <property name="hibernate.c3p0.max_size">100</property> <property name="hibernate.c3p0.min_size">5</property> <property name="hibernate.c3p0.timeout">120</property> <property name="c3p0.maxIdleTime">1800</property> <!-- <property name="automaticTestTable">Test</property> --> <!-- JDBC的标准参数,用以控制数据源内加载的PreparedStatements数量。但由于预缓存的statements属于单个connection而不是整个连接池。所以设置这个参数需要考虑到多方面的因素。如果maxStatements与maxStatementsPerConnection均为0,则缓存被关闭。 --> <property name="hibernate.c3p0.max_statements">0</property> <!-- 每隔多少秒检查连接池中的空闲连接 --> <property name="hibernate.c3p0.idle_test_period">1800</property> <!-- 当c3p0连接池枯竭时,一次获得多少连接的数量 --> <property name="hibernate.c3p0.acquire_increment">3</property> <!-- 因性能消耗大请只在需要的时候使用它。如果设为true那么在每个connection提交的时候都将校验其有效性。建议使用idleConnectionTestPeriod或automaticTestTable等方法来提升连接测试的性能。Default: false --> <property name="c3p0.testConnectionOnCheckout">false</property> <property name="c3p0.idle"></property> <!-- 每次都验证连接是否可用 --> <property name="hibernate.c3p0.validate">false</property> <property name="dialect"> org.hibernate.dialect.SQLServerDialect </property> 我是初学者,也不知道哪里配的有问题 这也是,我第一次在CSDN上提问。望各位前辈,指点一二

Error:DefaultSdkLoader already created using C:

Error:DefaultSdkLoader already created using C:\Users\Administrator\AppData\Local\Android\Sdk; cannot also use F:\AndroidStudio\SDK 急!在线等!

(Ruby on rails) 错误“NoMethodError (undefined method `on' for #<Tag id:, name:>)”

安装了acts_as_taggable_on_steroids插件(ruby 1.8.6, rails 2.0.2),其中模型代码bookmark.rb包括: def tag_with(tags) (bookmark.rb第27行) Tag.transaction do taggings.destroy_all tags.each { |name| Tag.find_or_create_by_name(name).on(self) } end end 程序主要实现为网页添加标签,在运行时发生错误,其中log记录如下: #################################################################################################### NoMethodError (undefined method `on' for #<Tag id: 16, name: "good,god">): C:/INSTAN~1.0-W/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/attribute_methods.rb:205:in `method_missing' /app/models/bookmark.rb:29:in `tag_with' /app/models/bookmark.rb:29:in `each' /app/models/bookmark.rb:29:in `tag_with' C:/INSTAN~1.0-W/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:66:in `transaction' C:/INSTAN~1.0-W/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:80:in `transaction' /app/models/bookmark.rb:27:in `tag_with' /app/controllers/bookmarks_controller.rb:40:in `create' #################################################################################################### 在控制器bookmark_controller.rb中调用方法tag_with: # POST /users/{username}/bookmarks def create bookmark = Bookmark.find_by_user_id_and_uri(params[:bookmark][:user_id], params[:bookmark][:uri]) if bookmark # This user has already bookmarked this URI. They should be # using PUT instead. headers['Location'] = bookmark_url(@user.name, bookmark.uri) render :nothing => true, :status => "409 Conflict" else # Enforce default values for 'timestamp' and 'public' params[:bookmark][:timestamp] ||= Time.now params[:bookmark][:public] ||= "1" # Create the bookmark in the database. bookmark = Bookmark.new(params[:bookmark]) if bookmark.save # Add tags. bookmark.tag_with(params[:taglist]) if params[:taglist] (调用方法tag_with) # Send a 201 response code that points to the location of the # new bookmark. headers['Location'] = bookmark_url(@user.name, bookmark.uri) render :nothing => true, :status => "201 Created" else render :xml => bookmark.errors.to_xml, :status => "400 Bad Request" end end end

Object c 错误unrecognized selector sent to instance

本人ios编程小白一个,正在学,跟着视频打代码,运行出了这么个错,找了半天也没看出来,各位大大帮忙看下,代码就是tom猫的一个小程序 错误日志 unrecognized selector sent to instance 0x7fbd20627180 2015-07-21 10:52:58.264 Tom[8325:418012] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[ViewController drink:]: unrecognized selector sent to instance 0x7fbd20627180' 代码 ``` #import "ViewController.h" @interface ViewController () @property (weak, nonatomic) IBOutlet UIImageView *tom; @end @implementation ViewController -(void)tomAnimation:(NSString *)img count:(int)count { if([self.tom isAnimating]) return; NSMutableArray *arrayM = [NSMutableArray array]; for (int i = 0; i < count; i++) { NSString *imageName = [NSString stringWithFormat:@"%@_%02d.jpg",img,i]; // UIImage *image = [UIImage imageNamed:imageName]; NSString *path = [[NSBundle mainBundle] pathForResource:imageName ofType:nil]; UIImage *image = [UIImage imageNamed:path]; NSLog(@"image is %@ and id is %02d",image,i); [arrayM addObject:image]; } [self.tom setAnimationImages:arrayM]; [self.tom setAnimationDuration:arrayM.count * 0.1]; [self.tom setAnimationRepeatCount:1]; //2.开始动画 [self.tom startAnimating]; //动画完成之后,再清除动画数组内容 [self performSelector:@selector(clearTom) withObject:nil afterDelay:self.tom.animationDuration]; } -(void)clearTom { self.tom.animationImages = nil; } - (IBAction)drink { //序列帧动画,所谓序列帧动画,就是让一组图片一张一张的顺序播放 //1.图片的数组 [self tomAnimation:@"drink" count:81]; } @end ```

mysql5.7 如何查询同一台设备时间间隔两小时的数据? 也就说同一台设备 24小时取12条数据

需求描述:数据是每十分钟写入一次(数据已存在),现在新需求是只展示时间间隔为两个小时的数据, 也就说24小时取12条数据 表结构CREATE TABLE `lara_realdata` ( `id` int(11) NOT NULL AUTO_INCREMENT, `equipment_id` varchar(255) DEFAULT NULL COMMENT '设备编号', `collection_time` int(11) DEFAULT NULL COMMENT '采集时间', `instan_flow` varchar(11) DEFAULT NULL COMMENT '瞬时流量', PRIMARY KEY (`id`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; 添加语句 INSERT INTO `laracms`.`lara_realdata`( `equipment_id`, `collection_time`, `instan_flow`) VALUES ('00000829', 1543466428, '0.06'); INSERT INTO `laracms`.`lara_realdata`(`equipment_id`, `collection_time`, `instan_flow`) VALUES ('00000652', 1543466802, '0.52'); INSERT INTO `laracms`.`lara_realdata`(`equipment_id`, `collection_time`, `instan_flow`) VALUES ('00000652', 1543466879, '0.16'); INSERT INTO `laracms`.`lara_realdata`( `equipment_id`, `collection_time`, `instan_flow`) VALUES ('00000829', 1543466428, '0.06'); INSERT INTO `laracms`.`lara_realdata`(`equipment_id`, `collection_time`, `instan_flow`) VALUES ('00000652', 1543466802, '0.52'); INSERT INTO `laracms`.`lara_realdata`(`equipment_id`, `collection_time`, `instan_flow`) VALUES ('00000652', 1543466879, '0.16');

python报错 TypeError: sequence item 0: expected str instance, bytes found

网上的代码 运行报错 import wave from pyaudio import PyAudio, paInt16 framerate = 8000 # 采样率 NUM_SAMPLES = 2000 # 一个缓存存储采样点数量 channels = 1 # 一个通道 sampwidth = 2 # 两个字节16位 TIME = 2 def save_wave_file(filename, data): '''''save the data to the wav file''' wf = wave.open(filename, 'wb') wf.setnchannels(channels) wf.setsampwidth(sampwidth) wf.setframerate(framerate) wf.writeframes("".join(data)) wf.close() def my_record(): # 定义读文件函数 pa = PyAudio() # PyAudio类实例化 stream = pa.open(format=paInt16, channels=1, # channels设置为1 方便百度识别 或许对象 rate=framerate, input=True, frames_per_buffer=NUM_SAMPLES) my_buf = [] # 定义列表 存放数据 count = 0 while count < TIME * 20: string_audio_data = stream.read(NUM_SAMPLES) # 2000采样点较短,要重复循环读取 my_buf.append(string_audio_data) #my_buf += string_audio_data count += 1 print('正在录音') #my_buff = [str(i) for i in my_buf] save_wave_file('01.wav', my_buf) stream.close() my_record() print('录音结束啦') Traceback (most recent call last): File "D:/pycharmproject/bishetest02/audiotest01.py", line 39, in <module> my_record() File "D:/pycharmproject/bishetest02/audiotest01.py", line 35, in my_record save_wave_file('01.wav', my_buf) File "D:/pycharmproject/bishetest02/audiotest01.py", line 17, in save_wave_file wf.writeframes("".join(data)) TypeError: sequence item 0: expected str instance, bytes found

严重: Exception sending context initialized event

试了好多办法求帮助 严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanDefinitionStoreException: Line 9 in XML document from class path resource [applicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException: Document root element "beans", must match DOCTYPE root "null". org.xml.sax.SAXParseException; lineNumber: 9; columnNumber: 4; Document root element "beans", must match DOCTYPE root "null". at org.apache.xerces.parsers.DOMParser.parse(Unknown Source) at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:222) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:173) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:148) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:126) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:142) at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:126) at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94) at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:89) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:269) at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:134) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4973) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5467) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1247) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1898) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) applicationContext.xml ``` <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd "> <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations" value="classpath:/datasource.properties" /> </bean> <bean id="jdbcDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close" > <property name="driverClassName" value="${datasource.driverClassName}"></property> <property name="url" value="${datasource.url}"></property> <property name="username" value="${datasource.username}"></property> <property name="password" value="${datasource.password}"></property> </bean> <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> <property name="dataSource" ref="jdbcDataSource" /> <property name="configLocation" value="classpath:/mybatisMapper.xml"></property> </bean> <!-- 注入映射接口将映射文件和映射接口放在一个包内可自动注入映射文件 --> <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> <property name="basePackage" value="web.ssm.mapper" /> </bean> </beans> ```

Laravel错误:参数1传递给App \ Services \ Booking \ BookingService :: save()必须是App \ Http \ Requests \的实例

<div class="post-text" itemprop="text"> <p>How to fix the error: </p> <blockquote> <p>Argument 1 passed to App\Services\Booking\BookingService::save() must be an instance of App\Http\Requests\StoreBookingRequestType, instance of Illuminate\Http\Request given, called in C:\xampp_n\htdocs\get-served-admin\app\Http\Controllers\BookingController.php on line 75.</p> </blockquote> <p>I keep getting the error when I <strong>try to save a booking</strong>.</p> <p>in the app\Services\Booking\BookingService.php</p> <pre><code>/** * Save Booking to database * * @param StoreBookingRequestType $request * @return string */ public function save(StoreBookingRequestType $request) { DB::beginTransaction(); try { $request['user'] = $request-&gt;get('user_id'); Booking::create($request-&gt;all()); } catch (\Exception $e) { DB::rollback(); Log::error('Booking Error: Storing New Record - '.$e-&gt;getMessage()); return BookingResponseType::ERROR; } DB::commit(); return BookingResponseType::SUCCESS; } </code></pre> <p>in the controller app\Http\Controllers\BookingController.php</p> <pre><code>namespace App\Http\Controllers; use App\Booking; use App\Client; use App\Enums\BookingResponseType; use App\PaymentMethod; use App\PaymentStatus; use App\Services\Booking\BookingService; use App\User; use Illuminate\Http\Request; use Illuminate\Support\Facades\DB; class BookingController extends Controller{ private $payment_methods; private $payment_statuses; private $clients; private $users; private $booking_service; private $booking_service; public function __construct() { view()-&gt;share('page_title','Bookings'); $this-&gt;payment_methods = PaymentMethod::all()-&gt;pluck('name','id'); $this-&gt;payment_statuses = PaymentStatus::all()-&gt;pluck('name','id'); $this-&gt;clients = Client::all()-&gt;pluck('fullname','id'); $this-&gt;users = User::all()-&gt;pluck('fullname','id'); $this-&gt;booking_service = new BookingService(); } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return BookingResponseType */ public function store(Request $request) { DB::beginTransaction(); try { $action = $this-&gt;booking_service-&gt;save($request); if($action=="Success") { flash('Record has been successfully saved.')-&gt;success(); } else { flash('Error'); } } catch (\Exception $e) { DB::rollback(); flash('Error: '.$e-&gt;getMessage())-&gt;error(); return redirect()-&gt;back()-&gt;withInput($request-&gt;all()); } DB::commit(); return redirect()-&gt;back(); } } </code></pre> </div>

Tomcat部署工程时报错: Exception sending context...

工程师SVN上检出的,按理说应该是没有问题的,怎么会发生如下错误。 Tomcat启动部署工程时报错: ``` 信息: Deploying web application directory D:\apache-tomcat-7.0.30\webapps\MC 九月 01, 2016 8:43:42 上午 org.apache.catalina.core.ApplicationContext log 信息: No Spring WebApplicationInitializer types detected on classpath 九月 01, 2016 8:43:42 上午 org.apache.catalina.core.ApplicationContext log 信息: Initializing Spring root WebApplicationContext 九月 01, 2016 8:43:45 上午 org.apache.catalina.core.StandardContext listenerStart 严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mcServiceHsf' defined in file [D:\apache-tomcat-7.0.30\webapps\MC\WEB-INF\classes\com\inspur\gcloud\ext\service\impl\MessageCenterServiceImpl.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.inspur.gcloud.ext.service.impl.MessageCenterServiceImpl]: Constructor threw exception; nested exception is java.lang.ExceptionInInitializerError at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1013) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:959) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:490) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:626) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:618) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1100) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1618) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.inspur.gcloud.ext.service.impl.MessageCenterServiceImpl]: Constructor threw exception; nested exception is java.lang.ExceptionInInitializerError at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:163) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:87) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1006) ... 26 more Caused by: java.lang.ExceptionInInitializerError at com.inspur.gcloud.ext.service.impl.MessageCenterServiceImpl.<init>(MessageCenterServiceImpl.java:43) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:148) ... 28 more Caused by: com.inspur.hsf.service.rpc.RpcException: 没有找到可用服务,服务:logCenter.primaryService at com.inspur.hsf.service.cluster.impl.AvailableClusterInvoker.doInvoke(AvailableClusterInvoker.java:88) at com.inspur.hsf.service.cluster.impl.AbstractClusterInvoker.invoke(AbstractClusterInvoker.java:222) at com.inspur.hsf.service.rpc.transcation.humanredo.StoreFailureInvoker.invoke(StoreFailureInvoker.java:34) at com.inspur.hsf.service.rpc.proxy.jdk.JdkProxyFactory$1.invoke(JdkProxyFactory.java:82) at com.sun.proxy.$Proxy8.isModuleExistByCode(Unknown Source) at com.inspur.gcloud.logcenter.primary.core.PrimaryManager.init(PrimaryManager.java:29) at com.inspur.gcloud.logcenter.util.GCloudLogUtil.<init>(GCloudLogUtil.java:26) at com.inspur.gcloud.logcenter.util.GCloudLogUtil.getInstance(GCloudLogUtil.java:62) at com.inspur.gcloud.mc.common.util.McLoggerUtil.<init>(McLoggerUtil.java:28) at com.inspur.gcloud.mc.common.util.McLoggerUtil.<clinit>(McLoggerUtil.java:30) ... 34 more ```

vs+qt QAxObject对Excel的操作出现问题

只要以添加这句代码,就会报错QAxObject excel("Microsoft Excel Application"); 错误 1 error LNK2019: 无法解析的外部符号 "public: virtual __thiscall QAxObject::~QAxObject(void)" (??1QAxObject@@UAE@XZ),该符号在函数 "public: __thiscall scheduling::scheduling(class QWidget *,class QFlags<enum Qt::WindowType>)" (??0scheduling@@QAE@PAVQWidget@@V?$QFlags@W4WindowType@Qt@@@@@Z) 中被引用 E:\VSC\scheduling\scheduling\scheduling.obj scheduling 错误 2 error LNK2019: 无法解析的外部符号 "public: __thiscall QAxObject::QAxObject(class QString const &,class QObject *)" (??0QAxObject@@QAE@ABVQString@@PAVQObject@@@Z),该符号在函数 "public: __thiscall scheduling::scheduling(class QWidget *,class QFlags<enum Qt::WindowType>)" (??0scheduling@@QAE@PAVQWidget@@V?$QFlags@W4WindowType@Qt@@@@@Z) 中被引用 E:\VSC\scheduling\scheduling\scheduling.obj scheduling 现怀疑是是QAxObject 无法连接Excel控件,求大佬解答

Could not start Quartz Scheduler after delay; nested exception is org.quartz.SchedulerException: The Scheduler cannot be restarted after shutdown() has been called.

Exception in thread "Quartz Scheduler [liuqlScheduler]" org.springframework.scheduling.SchedulingException: Could not start Quartz Scheduler after delay; nested exception is org.quartz.SchedulerException: The Scheduler cannot be restarted after shutdown() has been called. at org.springframework.scheduling.quartz.SchedulerFactoryBean$1.run(SchedulerFactoryBean.java:753) Caused by: org.quartz.SchedulerException: The Scheduler cannot be restarted after shutdown() has been called. at org.quartz.core.QuartzScheduler.start(QuartzScheduler.java:529) at org.quartz.impl.StdScheduler.start(StdScheduler.java:142) at org.springframework.scheduling.quartz.SchedulerFactoryBean$1.run(SchedulerFactoryBean.java:750) 断开与目标 VM 的连接,地址:'127.0.0.1:55575', transport: 'socket' 进程已结束,退出代码 1

当用户首次通过Paypal重定向时,如何获取传递的数据?

<div class="post-text" itemprop="text"> <p>I've been trying to tackle this for some time now. I have an order page where the customer must enter information like name, address, etc. and some more unique fields. I have set up IPN with Paypal and the customer is redirected to the page I specified. But the data does not come along with it. I hope I'm asking my question properly so that I don't get "closed." Here is the HTML in the Paypal submit button that redirects to their page. </p> <pre><code>&lt;form action="https://www.paypal.com/cgi-bin/webscr" method="post"&gt; &lt;input type="hidden" name="cmd" value="_s-xclick"&gt; &lt;input type="hidden" name="hosted_button_id" value="NT2YC6LP7SWBE"&gt; &lt;input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_paynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"&gt; &lt;input type="hidden" name="child_name" id="child_name" value ="&lt;? echo $child_name; ?&gt;" maxlength="20"/&gt; &lt;input type="hidden" name="age" id="age" value ="&lt;? echo $age; ?&gt;" maxlength="4"/&gt; &lt;input type="hidden" name="hometown" id="hometown" value ="&lt;? echo $hometown; ?&gt;" maxlength="32"/&gt; &lt;input type="hidden" name="boy_girl" id="boy_girl" value ="&lt;? echo $boy_girl; ?&gt;" maxlength="4"/&gt; &lt;input type="hidden" name="first_name" id="first_name" value ="&lt;? echo $first_name; ?&gt;" maxlength="32"/&gt; &lt;input type="hidden" name="last_name" id="last_name" value ="&lt;? echo $last_name; ?&gt;" maxlength="32"/&gt; &lt;input type="hidden" name="email" id="email" value ="&lt;? echo $email; ?&gt;" maxlength="64"/&gt; &lt;input type="hidden" name="address1" id="address1" value ="&lt;? echo $address1; ?&gt;" maxlength="64"/&gt; &lt;input type="hidden" name="address2" id="address2" value ="&lt;? echo $address2; ?&gt;" maxlength="32"/&gt; &lt;input type="hidden" name="city" id="city" value ="&lt;? echo $city; ?&gt;" maxlength="32"/&gt; &lt;input type="hidden" name="state" id="state" value ="&lt;? echo $state; ?&gt;" maxlength="20"/&gt; &lt;input type="hidden" name="zip" id="zip" value ="&lt;? echo $zip; ?&gt;" maxlength="10"/&gt; &lt;input type="hidden" name="country" id="country" value ="&lt;? echo $country; ?&gt;" maxlength="32"/&gt; &lt;input type="hidden" name="payment_type" id="payment_type" value ="paypal" maxlength="6"/&gt; &lt;input type="hidden" name="paid" id="paid" value ="yes" maxlength="3"/&gt; &lt;input type="hidden" name="mailed" id="mailed" value ="no" maxlength="3"/&gt; &lt;img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1"&gt; &lt;/form&gt; </code></pre> <p>It has been pointed out to me that some of the variables are not "Paypal variables" and I can fix that later, but none of my data is making it back to my specified page after visiting Paypal, even the variables that Paypal supports like "city." Here is the PHP that I have on the page that they get redirected to.</p> <pre><code>$raw_post_data = file_get_contents('php://input'); $raw_post_array = explode('&amp;', $raw_post_data); $myPost = array(); foreach ($raw_post_array as $keyval) { $keyval = explode ('=', $keyval); if (count($keyval) == 2) $myPost[$keyval[0]] = urldecode($keyval[1]); } $req = 'cmd=_notify-validate'; if(function_exists('get_magic_quotes_gpc')) { $get_magic_quotes_exists = true; } foreach ($myPost as $key =&gt; $value) { if($get_magic_quotes_exists == true &amp;&amp; get_magic_quotes_gpc() == 1) { $value = urlencode(stripslashes($value)); } else { $value = urlencode($value); } $req .= "&amp;$key=$value"; } $ch = curl_init('https://www.paypal.com/cgi-bin/webscr'); curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_POSTFIELDS, $req); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt($ch, CURLOPT_FORBID_REUSE, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: Close')); if( !($res = curl_exec($ch)) ) { // error_log("Got " . curl_error($ch) . " when processing IPN data"); curl_close($ch); exit; } curl_close($ch); if (strcmp ($res, "VERIFIED") == 0) { $child_name = htmlentities($_POST['child_name']); $age = $_POST['age']; $hometown = $_POST['hometown']; $boy_girl = $_POST['boy_girl']; $email = $_POST['email']; $first_name = htmlentities($_POST['first_name']); $last_name = htmlentities($_POST['last_name']); $address1 = htmlentities($_POST['address1']); $address2 = htmlentities($_POST['address2']); $city = htmlentities($_POST['city']); $state = $_POST['state']; $zip = htmlentities($_POST['zip']); $country = htmlentities($_POST['country']); $payment_type = $_POST['payment_type']; $paid = $_POST['paid']; $mailed = $_POST['mailed']; } else if (strcmp ($res, "INVALID") == 0) { } $query = "INSERT INTO customer_list ( number, child_name, age, hometown, boy_girl, first_name, last_name, email, address1, address2, city, state, zip, country, payment_type, paid, mailed) VALUES ('', '".mysql_real_escape_string($child_name)."', '".mysql_real_escape_string($age)."', '".mysql_real_escape_string($hometown)."', '".mysql_real_escape_string($boy_girl)."', '".mysql_real_escape_string($first_name)."', '".mysql_real_escape_string($last_name)."', '".mysql_real_escape_string($email)."', '".mysql_real_escape_string($address1)."', '".mysql_real_escape_string($address2)."', '".mysql_real_escape_string($city)."', '".mysql_real_escape_string($state)."', '".mysql_real_escape_string($zip)."', '".mysql_real_escape_string($country)."', '".mysql_real_escape_string($payment_type)."', '".mysql_real_escape_string($paid)."', '".mysql_real_escape_string($mailed)."')"; if ($query_run = mysql_query($query)) { $subject = "Thank You for Your Order"; $message = "Thank you for placing your order with My-Letter-From-Santa-Claus.com. You can expect to receive your personalized letter soon. Please make note of your customer number. Your customer number is: ".mysql_insert_id().". Please send all inquiries to : info@my-letter-from-santa-claus.com"; $from = "info@my-letter-from-santa-claus.com"; $headers = "From:" . $from; mail($email, $subject, $message, $headers); echo 'Thank you for your order.'; echo 'Letter For '.$child_name; } else { echo mysql_error(); } </code></pre> <p>I copied most of it directly from x.com except for changing to my own variables of course. Nothing is getting posted to the database but that's not the issue since I cannot even echo the data. A couple things are being entered into the database but it's not the data from my order page - it is the first name and last name that is entered as the credit card info on Paypal, and for payment_type it says "instan" (I maxed it at 6 characters) but as you can see from the hidden input field in the HTML, I wanted to post the value "paypal." How do I fix this?</p> </div>

C/C++学习指南全套教程

C/C++学习的全套教程,从基本语法,基本原理,到界面开发、网络开发、Linux开发、安全算法,应用尽用。由毕业于清华大学的业内人士执课,为C/C++编程爱好者的教程。

定量遥感中文版 梁顺林著 范闻捷译

这是梁顺林的定量遥感的中文版,由范闻捷等翻译的,是电子版PDF,解决了大家看英文费时费事的问题,希望大家下载看看,一定会有帮助的

YOLOv3目标检测实战:训练自己的数据集

YOLOv3是一种基于深度学习的端到端实时目标检测方法,以速度快见长。本课程将手把手地教大家使用labelImg标注和使用YOLOv3训练自己的数据集。课程分为三个小项目:足球目标检测(单目标检测)、梅西目标检测(单目标检测)、足球和梅西同时目标检测(两目标检测)。 本课程的YOLOv3使用Darknet,在Ubuntu系统上做项目演示。包括:安装Darknet、给自己的数据集打标签、整理自己的数据集、修改配置文件、训练自己的数据集、测试训练出的网络模型、性能统计(mAP计算和画出PR曲线)和先验框聚类。 Darknet是使用C语言实现的轻型开源深度学习框架,依赖少,可移植性好,值得深入探究。 除本课程《YOLOv3目标检测实战:训练自己的数据集》外,本人推出了有关YOLOv3目标检测的系列课程,请持续关注该系列的其它课程视频,包括: 《YOLOv3目标检测实战:交通标志识别》 《YOLOv3目标检测:原理与源码解析》 《YOLOv3目标检测:网络模型改进方法》 敬请关注并选择学习!

sql语句 异常 Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your

在我们开发的工程中,有时候会报 [Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ------ 这种异常 不用多想,肯定是我们的sql语句出现问题,下面...

浪潮集团 往年的软件类 笔试题 比较详细的哦

浪潮集团 往年的软件类 笔试题 比较详细的哦

2019 AI开发者大会

2019 AI开发者大会(AI ProCon 2019)是由中国IT社区CSDN主办的AI技术与产业年度盛会。多年经验淬炼,如今蓄势待发:2019年9月6-7日,大会将有近百位中美顶尖AI专家、知名企业代表以及千余名AI开发者齐聚北京,进行技术解读和产业论证。我们不空谈口号,只谈技术,诚挚邀请AI业内人士一起共铸人工智能新篇章!

I2c串口通信实现加速度传感器和FPGA的交流

此代码能实现加速度传感器与FPGA之间的交流,从而测出运动物体的加速度。

Python可以这样学(第一季:Python内功修炼)

董付国系列教材《Python程序设计基础》、《Python程序设计(第2版)》、《Python可以这样学》配套视频,讲解Python 3.5.x和3.6.x语法、内置对象用法、选择与循环以及函数设计与使用、lambda表达式用法、字符串与正则表达式应用、面向对象编程、文本文件与二进制文件操作、目录操作与系统运维、异常处理结构。

微信公众平台开发入门

本套课程的设计完全是为初学者量身打造,课程内容由浅入深,课程讲解通俗易懂,代码实现简洁清晰。通过本课程的学习,学员能够入门微信公众平台开发,能够胜任企业级的订阅号、服务号、企业号的应用开发工作。 通过本课程的学习,学员能够对微信公众平台有一个清晰的、系统性的认识。例如,公众号是什么,它有什么特点,它能做什么,怎么开发公众号。 其次,通过本课程的学习,学员能够掌握微信公众平台开发的方法、技术和应用实现。例如,开发者文档怎么看,开发环境怎么搭建,基本的消息交互如何实现,常用的方法技巧有哪些,真实应用怎么开发。

机器学习初学者必会的案例精讲

通过六个实际的编码项目,带领同学入门人工智能。这些项目涉及机器学习(回归,分类,聚类),深度学习(神经网络),底层数学算法,Weka数据挖掘,利用Git开源项目实战等。

eclipseme 1.7.9

eclipse 出了新的eclipseme插件,官方有下载,但特慢,我都下了大半天(可能自己网速差)。有急需要的朋友可以下哦。。。

Spring Boot -01- 快速入门篇(图文教程)

Spring Boot -01- 快速入门篇 今天开始不断整理 Spring Boot 2.0 版本学习笔记,大家可以在博客看到我的笔记,然后大家想看视频课程也可以到【慕课网】手机 app,去找【Spring Boot 2.0 深度实践】的课程,令人开心的是,课程完全免费! 什么是 Spring Boot? Spring Boot 是由 Pivotal 团队提供的全新框架。Spring Boot...

HoloLens2开发入门教程

本课程为HoloLens2开发入门教程,讲解部署开发环境,安装VS2019,Unity版本,Windows SDK,创建Unity项目,讲解如何使用MRTK,编辑器模拟手势交互,打包VS工程并编译部署应用到HoloLens上等。

最简单的倍频verilog程序(Quartus II)

一个工程文件 几段简单的代码 一个输入一个输出(50Mhz倍频到100Mhz)

计算机组成原理实验教程

西北工业大学计算机组成原理实验课唐都仪器实验帮助,同实验指导书。分为运算器,存储器,控制器,模型计算机,输入输出系统5个章节

4小时玩转微信小程序——基础入门与微信支付实战

这是一个门针对零基础学员学习微信小程序开发的视频教学课程。课程采用腾讯官方文档作为教程的唯一技术资料来源。杜绝网络上质量良莠不齐的资料给学员学习带来的障碍。 视频课程按照开发工具的下载、安装、使用、程序结构、视图层、逻辑层、微信小程序等几个部分组织课程,详细讲解整个小程序的开发过程

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

基于RSA通信密钥分发的加密通信

基于RSA通信密钥分发的加密通信,采用pycrypto中的RSA、AES模块实现

不同变质程度煤尘爆炸残留气体特征研究

为分析不同变质程度煤尘爆炸残留气体成分的特征规律,利用水平管道煤尘爆炸实验装置进行了贫瘦煤、肥煤、气煤、长焰煤4种不同变质程度的煤尘爆炸实验,研究了不同变质程度煤尘爆炸后气体残留物含量的差异,并对气体

设计模式(JAVA语言实现)--20种设计模式附带源码

课程亮点: 课程培训详细的笔记以及实例代码,让学员开始掌握设计模式知识点 课程内容: 工厂模式、桥接模式、组合模式、装饰器模式、外观模式、享元模式、原型模型、代理模式、单例模式、适配器模式 策略模式、模板方法模式、观察者模式、迭代器模式、责任链模式、命令模式、备忘录模式、状态模式、访问者模式 课程特色: 笔记设计模式,用笔记串连所有知识点,让学员从一点一滴积累,学习过程无压力 笔记标题采用关键字标识法,帮助学员更加容易记住知识点 笔记以超链接形式让知识点关联起来,形式知识体系 采用先概念后实例再应用方式,知识点深入浅出 提供授课内容笔记作为课后复习以及工作备查工具 部分图表(电脑PC端查看):

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

软件测试2小时入门

本课程内容系统、全面、简洁、通俗易懂,通过2个多小时的介绍,让大家对软件测试有个系统的理解和认识,具备基本的软件测试理论基础。 主要内容分为5个部分: 1 软件测试概述,了解测试是什么、测试的对象、原则、流程、方法、模型;&nbsp; 2.常用的黑盒测试用例设计方法及示例演示;&nbsp; 3 常用白盒测试用例设计方法及示例演示;&nbsp; 4.自动化测试优缺点、使用范围及示例‘;&nbsp; 5.测试经验谈。

几率大的Redis面试题(含答案)

本文的面试题如下: Redis 持久化机制 缓存雪崩、缓存穿透、缓存预热、缓存更新、缓存降级等问题 热点数据和冷数据是什么 Memcache与Redis的区别都有哪些? 单线程的redis为什么这么快 redis的数据类型,以及每种数据类型的使用场景,Redis 内部结构 redis的过期策略以及内存淘汰机制【~】 Redis 为什么是单线程的,优点 如何解决redis的并发竞争key问题 Red...

手把手实现Java图书管理系统(附源码)

【超实用课程内容】 本课程演示的是一套基于Java的SSM框架实现的图书管理系统,主要针对计算机相关专业的正在做毕设的学生与需要项目实战练习的java人群。详细介绍了图书管理系统的实现,包括:环境搭建、系统业务、技术实现、项目运行、功能演示、系统扩展等,以通俗易懂的方式,手把手的带你从零开始运行本套图书管理系统,该项目附带全部源码可作为毕设使用。 【课程如何观看?】 PC端:https://edu.csdn.net/course/detail/27513 移动端:CSDN 学院APP(注意不是CSDN APP哦) 本课程为录播课,课程2年有效观看时长,大家可以抓紧时间学习后一起讨论哦~ 【学员专享增值服务】 源码开放 课件、课程案例代码完全开放给你,你可以根据所学知识,自行修改、优化

jsp+servlet入门项目实例

jsp+servlet实现班级信息管理项目

winfrom中嵌套html,跟html的交互

winfrom中嵌套html,跟html的交互,源码就在里面一看就懂,很简单

Java面试题大全(2020版)

发现网上很多Java面试题都没有答案,所以花了很长时间搜集整理出来了这套Java面试题大全,希望对大家有帮助哈~ 本套Java面试题大全,全的不能再全,哈哈~ 一、Java 基础 1. JDK 和 JRE 有什么区别? JDK:Java Development Kit 的简称,java 开发工具包,提供了 java 的开发环境和运行环境。 JRE:Java Runtime Environ...

python实现数字水印添加与提取及鲁棒性测试(GUI,基于DCT,含测试图片)

由python写的GUI,可以实现数字水印的添加与提取,提取是根据添加系数的相关性,实现了盲提取。含有两种攻击测试方法(高斯低通滤波、高斯白噪声)。基于python2.7,watermark.py为主

Xshell6完美破解版,亲测可用

Xshell6破解版,亲测可用,分享给大家。直接解压即可使用

你连存活到JDK8中著名的Bug都不知道,我怎么敢给你加薪

CopyOnWriteArrayList.java和ArrayList.java,这2个类的构造函数,注释中有一句话 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 public ArrayList(Collection&lt;? ...

相关热词 c#对文件改写权限 c#中tostring c#支付宝回掉 c#转换成数字 c#判断除法是否有模 c# 横向chart c#控件选择多个 c#报表如何锁定表头 c#分级显示数据 c# 不区分大小写替换
立即提问
相关内容推荐