oracle jdbc update bind 不成功

正常的oralce update语句:

update apmtest set apm_int=20 where apm_nchar='11' and apm_numeric='12';

不知道为什么jdbc update bind两个参数时,就是执行不成功?怀疑是单引号的问题

执行不成功:

PreparedStatement ps_update1 = con
.prepareStatement("update apmtest set apm_int=? where apm_nchar=? and apm_numeric=?");
ps_update1.setInt(1, 20);
ps_update1.setString(2, "11");
ps_update1.setString(3, "12");

ps_update1.execute();

执行成功:

PreparedStatement ps_update1 = con
.prepareStatement("update apmtest set apm_int=? where apm_nchar='11' and apm_numeric=?");
ps_update1.setInt(1, 20);
ps_update1.setString(2, "12");
ps_update1.execute();

1个回答

检查一下你的apm_nchar和apm_numeric字段的数据类型是文本类的还是数字类的,如果是数字类的,不需要加引号。
另外有些语言string和char使用不同的引号,比如string使用双引号,char使用单引号,如果你有字段是char的,把相应的地方改成单引号试一试

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
JDBC连接Oracle出现异常
exception ``` org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: Connections could not be acquired from the underlying database! org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:948) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:827) javax.servlet.http.HttpServlet.service(HttpServlet.java:624) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812) javax.servlet.http.HttpServlet.service(HttpServlet.java:731) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) root cause org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: Connections could not be acquired from the underlying database! org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:241) org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:372) org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:417) org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:255) org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) com.sun.proxy.$Proxy11.find(Unknown Source) cn.itcast.jk.controller.basicinfo.factory.FactoryController.list(FactoryController.java:23) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) java.lang.reflect.Method.invoke(Unknown Source) org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176) org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:440) org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:428) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:827) javax.servlet.http.HttpServlet.service(HttpServlet.java:624) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812) javax.servlet.http.HttpServlet.service(HttpServlet.java:731) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) root cause java.sql.SQLException: Connections could not be acquired from the underlying database! com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106) com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:529) com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128) org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:203) org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:372) org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:417) org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:255) org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) com.sun.proxy.$Proxy11.find(Unknown Source) cn.itcast.jk.controller.basicinfo.factory.FactoryController.list(FactoryController.java:23) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) java.lang.reflect.Method.invoke(Unknown Source) org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176) org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:440) org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:428) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:827) javax.servlet.http.HttpServlet.service(HttpServlet.java:624) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812) javax.servlet.http.HttpServlet.service(HttpServlet.java:731) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) root cause com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source. com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1319) com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:557) com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:477) com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:525) com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128) org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:203) org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:372) org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:417) org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:255) org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) com.sun.proxy.$Proxy11.find(Unknown Source) cn.itcast.jk.controller.basicinfo.factory.FactoryController.list(FactoryController.java:23) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) java.lang.reflect.Method.invoke(Unknown Source) org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176) org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:440) org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:428) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:827) javax.servlet.http.HttpServlet.service(HttpServlet.java:624) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812) javax.servlet.http.HttpServlet.service(HttpServlet.java:731) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) ``` jdbc配置文件如下: ``` jdbc.driverClassName=oracle.jdbc.driver.OracleDriver jdbc.url=jdbc:oracle:thin:@127.0.0.1:1521:XE jdbc.username=system jdbc.password=lxw1993822 c3p0.pool.maxPoolSize=20 c3p0.pool.minPoolSize=5 c3p0.pool.initialPoolSize=3 c3p0.pool.acquireIncrement=2 ``` 我使用sqlplus和pl/sql都可以连接到数据库,但是在javaweb项目中,用jdbc连接却出现这个异常,求大神帮我看看,万分感谢!!!!
SpringBoot中@Autowired注入bean失败:Error creating bean with name“XXXController”?
# 报错信息: ``` org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'authorizeController': Unsatisfied dependency expressed through field 'userMapper'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userMapper' defined in file [E:\STS-WorkSpace\Forum\target\classes\com\Forum\mapper\UserMapper.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:643) ~[spring-beans-5.2.2.RELEASE.jar:5.2.2.RELEASE] at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:116) ~[spring-beans-5.2.2.RELEASE.jar:5.2.2.RELEASE] at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399) ~[spring-beans-5.2.2.RELEASE.jar:5.2.2.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1422) ~[spring-beans-5.2.2.RELEASE.jar:5.2.2.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594) ~[spring-beans-5.2.2.RELEASE.jar:5.2.2.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) ~[spring-beans-5.2.2.RELEASE.jar:5.2.2.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) ~[spring-beans-5.2.2.RELEASE.jar:5.2.2.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory$$Lambda$141/1866850137.getObject(Unknown Source) ~[na:na] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.2.2.RELEASE.jar:5.2.2.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) ~[spring-beans-5.2.2.RELEASE.jar:5.2.2.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.2.RELEASE.jar:5.2.2.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:879) ~[spring-beans-5.2.2.RELEASE.jar:5.2.2.RELEASE] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:878) ~[spring-context-5.2.2.RELEASE.jar:5.2.2.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) ~[spring-context-5.2.2.RELEASE.jar:5.2.2.RELEASE] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) ~[spring-boot-2.2.2.RELEASE.jar:2.2.2.RELEASE] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) [spring-boot-2.2.2.RELEASE.jar:2.2.2.RELEASE] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.2.2.RELEASE.jar:2.2.2.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-2.2.2.RELEASE.jar:2.2.2.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) [spring-boot-2.2.2.RELEASE.jar:2.2.2.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) [spring-boot-2.2.2.RELEASE.jar:2.2.2.RELEASE] at com.Forum.ForumApplication.main(ForumApplication.java:19) [classes/:na] Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userMapper' defined in file [E:\STS-WorkSpace\Forum\target\classes\com\Forum\mapper\UserMapper.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1796) ~[spring-beans-5.2.2.RELEASE.jar:5.2.2.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:595) ~[spring-beans-5.2.2.RELEASE.jar:5.2.2.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) ~[spring-beans-5.2.2.RELEASE.jar:5.2.2.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) ~[spring-beans-5.2.2.RELEASE.jar:5.2.2.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory$$Lambda$141/1866850137.getObject(Unknown Source) ~[na:na] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.2.2.RELEASE.jar:5.2.2.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) ~[spring-beans-5.2.2.RELEASE.jar:5.2.2.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.2.RELEASE.jar:5.2.2.RELEASE] at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.2.2.RELEASE.jar:5.2.2.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1287) ~[spring-beans-5.2.2.RELEASE.jar:5.2.2.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1207) ~[spring-beans-5.2.2.RELEASE.jar:5.2.2.RELEASE] at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:640) ~[spring-beans-5.2.2.RELEASE.jar:5.2.2.RELEASE] ... 20 common frames omitted Caused by: java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required at org.springframework.util.Assert.notNull(Assert.java:198) ~[spring-core-5.2.2.RELEASE.jar:5.2.2.RELEASE] at org.mybatis.spring.support.SqlSessionDaoSupport.checkDaoConfig(SqlSessionDaoSupport.java:123) ~[mybatis-spring-2.0.1.jar:2.0.1] at org.mybatis.spring.mapper.MapperFactoryBean.checkDaoConfig(MapperFactoryBean.java:73) ~[mybatis-spring-2.0.1.jar:2.0.1] at org.springframework.dao.support.DaoSupport.afterPropertiesSet(DaoSupport.java:44) ~[spring-tx-5.2.2.RELEASE.jar:5.2.2.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1855) ~[spring-beans-5.2.2.RELEASE.jar:5.2.2.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1792) ~[spring-beans-5.2.2.RELEASE.jar:5.2.2.RELEASE] ... 31 common frames omitted ``` # Mapper代码: ``` package com.Forum.mapper; import org.apache.ibatis.annotations.Insert; import org.apache.ibatis.annotations.Mapper; import com.Forum.Model.User; @Mapper public interface UserMapper{ @Insert("insert into user (name,account_id,token,gmt_create,gmt_modified) values (#{name},#{accountId}),#{token},#{gmtCreate},#{gmtModified}") public void insert(User user); } ``` # 启动代码: ``` package com.Forum; import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.context.annotation.ComponentScan; @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}) @ComponentScan(basePackages = {"com.Forum.*"}) @MapperScan(basePackages = {"com.Forum.mapper"}) public class ForumApplication { public static void main(String[] args) { SpringApplication.run(ForumApplication.class, args); } } ``` # Controller代码: ```package com.Forum.Controller; import java.util.UUID; import javax.servlet.http.HttpServletRequest; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; import com.Forum.Dto.AccesstokenDTO; import com.Forum.Dto.GitHubUser; import com.Forum.Model.User; import com.Forum.Provider.GitHubProvider; import com.Forum.mapper.UserMapper; @Controller public class AuthorizeController{ @Autowired private GitHubProvider gitHubProvider; @Value("${github.client.id}") private String clientId; @Value("${github.client.secret}") private String clientSecret; @Value("${github.redirect.uri}") private String redirectUri; @Autowired public UserMapper userMapper; @GetMapping("/callback") public String callback(@RequestParam(name="code") String code, @RequestParam(name="state") String state, HttpServletRequest request ) { AccesstokenDTO accesstokenDTO = new AccesstokenDTO(); accesstokenDTO.setCode(code); accesstokenDTO.setRedirect_uri("redirectUri"); accesstokenDTO.setClient_id(clientId); accesstokenDTO.setClient_secret(clientSecret); accesstokenDTO.setState(state); String accessToken = gitHubProvider.getAccessToken(accesstokenDTO); GitHubUser githubUser = gitHubProvider.getUser(accessToken); if(githubUser != null) { // 登录成功,写cookie和session User user = new User(); user.setToken(UUID.randomUUID().toString()); user.setName(githubUser.getName()); user.setAccountId(String.valueOf(githubUser.getId())); user.setQmtCreate(System.currentTimeMillis()); user.setQmtModified(user.getQmtCreate()); userMapper.insert(user); request.getSession().setAttribute("user", githubUser); return "redirect:/"; // 去掉地址后缀 }else { // 登录失败,重新登录 return "redirect:/"; } } } ```
在spring mvc 中使用@ResponseBody将对象封装为json发送给前端,前端接并提取在页面时候变成了undefined,是不是版本或者什么原因?
spring mvc 中Controller的代码 ``` package cn.sxt.conntroller; import java.util.ArrayList; import java.util.List; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; @Controller public class JsonConntroller { @RequestMapping("/json") @ResponseBody public List<User> json(){ List<User> list = new ArrayList(); list.add(new User("jake", 10, "man")); list.add(new User("nico", 10, "woman")); list.add(new User("joker", 10, "man")); return list; } } ``` index.jsp代码 ``` <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Insert title here</title> <script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript"> $(function(){ $("#b").click(function(){ $.post("json.do",function(data){ var html=""; for(var i = 0;i<data.length;i++){ html+="<tr><td>"+data[i].name+"</td><td>"+data[i].age+"</td><td>"+data[i].sex+"</td></tr>" } $("#content").html(html); }); }); }); </script> </head> <body> <input type="button" id="b" value="获取信息"> <table width="80%" align="center"> <tr> <td>name</td> <td>age</td> <td>sex</td> </tr> <tbody id="content"></tbody> </table> </body> </html> ``` 在浏览器上面的展示图 ![图片说明](https://img-ask.csdn.net/upload/202001/13/1578907341_150073.png) 导入的jar包和jswen'jian jackson-annotations-2.9.9.jar jackson-core-2.9.9.jar jackson-databind-2.9.9.jar jquery-3.4.1.min.js
java连接SqlServer数据库的问题
最近在搞java,想连个SqlServer连不上,可以加载驱动,但是连不上数据库。 数据库版本为SqlServer2017 代码如下: ``` package util; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Connection; import java.sql.Statement; import java.sql.ResultSet; import java.sql.Date; public class DBManager { static int num; static Statement st=null; static ResultSet rs=null; static Connection con=null; static String url="jdbc:sqlserver://LAPTOP-LG07MEUA:1433;DataBaseName=Java_Data"; public static void exec(String s) throws SQLException { String user,passwd; user="sa"; passwd="1234567"; try { Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); System.out.println("数据库驱动加载成功。"); } catch (ClassNotFoundException e) { e.printStackTrace(); } //就是这里,无法链接数据库 con=DriverManager.getConnection(url, user, passwd); System.out.println("10"); st=con.createStatement(); System.out.println("1"); try { if(s.startsWith("select")||s.startsWith("SELECT")) rs=st.executeQuery(s); if(s.startsWith("delete")||s.startsWith("DELETE")) num=st.executeUpdate(s); if(s.startsWith("update")||s.startsWith("UPDATE")) num=st.executeUpdate(s); if(s.startsWith("insert")||s.startsWith("INSERT")) num=st.executeUpdate(s); System.out.println("修改成功!"); } catch(Exception e) { System.out.println("进行数据库修改时失败。"); } finally { try { if(rs!=null) rs.close(); if(st!=null) st.close(); if(con!=null) con.close(); } catch(SQLException e) { e.printStackTrace(); } } } public static void main(String[] args) throws SQLException { int i=0; int[] Resultage=new int [20]; String[] Resultxh=new String [20]; String[] Resultxm=new String [20]; String[] Resultxb=new String [20]; String[] Resultzy=new String [20]; Date[] Resultdate=new Date [20]; String s="SELECT * FROM xsb"; DBManager.exec(s); System.out.println("学号"+""+"姓名"+" "+"性别"+" "+"出生日期"+" "+"专业"+" "+"年龄"); while(rs.next()) { Resultxh[i]=rs.getString("学号"); Resultxm[i]=rs.getString("姓名"); Resultxb[i]=rs.getString("性别"); Resultdate[i]=rs.getDate("出生日期"); Resultzy[i]=rs.getString("专业"); Resultage[i]=rs.getInt("年龄"); System.out.print(Resultxh[i]+" "); System.out.print(Resultxm[i]+" "); System.out.print(Resultxb[i]+" "); System.out.print(Resultdate[i]+" "); System.out.print(Resultzy[i]+" "); System.out.println(Resultage[i]); } } } 报错为: 数据库驱动加载成功。 Exception in thread "main" java.lang.NullPointerException at javax.xml.bind.DatatypeConverter.parseHexBinary(DatatypeConverter.java:310) at com.microsoft.sqlserver.jdbc.SQLServerConnection.sendLogon(SQLServerConnection.java:4098) at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(SQLServerConnection.java:3160) at com.microsoft.sqlserver.jdbc.SQLServerConnection.access$100(SQLServerConnection.java:43) at com.microsoft.sqlserver.jdbc.SQLServerConnection$LogonCommand.doExecute(SQLServerConnection.java:3123) at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7505) at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:2445) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1981) at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:1628) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:1459) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:773) at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:1168) at java.sql/java.sql.DriverManager.getConnection(Unknown Source) at java.sql/java.sql.DriverManager.getConnection(Unknown Source) at util.DBManager.exec(DBManager.java:27) at util.DBManager.main(DBManager.java:72) ``` 求大佬帮忙解答。
eplise JDBC连接Sql Server问题
连接Sql Server 失败 JDK11 SQLjdbc6.0 已经按照相关步骤 完成 sa 用户的注册 且可以连接 连接代码 应该没有问题 ``` import java.sql.*; public class ConnecText { public static void main(String [] args) { String driverName="com.microsoft.sqlserver.jdbc.SQLServerDriver"; String dbURL="jdbc:sqlserver://127.0.0.1: 1433;DatabaseName=WebText"; String userName="sa"; String userPwd="5768722836"; try { Class.forName(driverName); System.out.println("加载驱动成功!"); }catch(Exception e){ e.printStackTrace(); System.out.println("加载驱动失败!"); } try{ Connection dbConn=DriverManager.getConnection(dbURL,userName,userPwd); System.out.println("连接数据库成功!"); }catch(Exception e) { e.printStackTrace(); System.out.print("SQL Server连接失败!"); } } } ``` 连接失败 运行结果为 ``` 加载驱动成功! Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter at com.microsoft.sqlserver.jdbc.SQLServerConnection.sendLogon(SQLServerConnection.java:4098) at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(SQLServerConnection.java:3160) at com.microsoft.sqlserver.jdbc.SQLServerConnection.access$100(SQLServerConnection.java:43) at com.microsoft.sqlserver.jdbc.SQLServerConnection$LogonCommand.doExecute(SQLServerConnection.java:3123) at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7505) at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:2445) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1981) at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:1628) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:1459) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:773) at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:1168) at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:677) at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:228) at Test.ConnecText.main(ConnecText.java:20) Caused by: java.lang.ClassNotFoundException: javax.xml.bind.DatatypeConverter at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ... 14 more ``` 已按照build path步骤将jdbc.jar 导入 为什么会出现 NOClassDefFoundError????qiu'zhu
jdbc连接数据库,可以加载驱动,数据库内却取不到值(NullPointException)?
我用两种途径连接数据库,一种是:<br> ![图片说明](https://img-ask.csdn.net/upload/201911/04/1572862039_634364.png)<br> 这一种应该没问题 <br><br> 但是在另一种途径遇到了以下问题:<br> ![图片说明](https://img-ask.csdn.net/upload/201911/04/1572862594_438226.jpg)<br><br> //以下是异常信息: 第一次提问,请问还需要什么信息orz <br><br> ----------------- 换了个电脑 代码进行修改之后 项目能够正常运行了 在原来的电脑上仍有以下报错: ```java 数据库驱动加载成功! Exceptionconn java.lang.NullPointerException findall failed at javax.xml.bind.DatatypeConverter.parseHexBinary(DatatypeConverter.java:310) at com.microsoft.sqlserver.jdbc.SQLServerConnection.sendLogon(SQLServerConnection.java:4061) at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(SQLServerConnection.java:3157) at com.microsoft.sqlserver.jdbc.SQLServerConnection.access$100(SQLServerConnection.java:82) at com.microsoft.sqlserver.jdbc.SQLServerConnection$LogonCommand.doExecute(SQLServerConnection.java:3121) at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7151) at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:2478) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:2026) at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:1687) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:1528) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:866) at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:569) at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:677) at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:228) at ch04.utils.BookUtils.getConnection(BookUtils.java:20) at ch04.dao.impl.BookDaoImpl.findByAll(BookDaoImpl.java:88) at ch04.service.impl.BookservicesImpl.findByAll(BookservicesImpl.java:38) at ch04.controller.BookAction.showall(BookAction.java:127) at ch04.controller.BookAction.doPost(BookAction.java:46) at javax.servlet.http.HttpServlet.service(HttpServlet.java:660) at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) 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:53) 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:202) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:526) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:860) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1587) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.base/java.lang.Thread.run(Thread.java:835) java.lang.NullPointerException at ch04.dao.impl.BookDaoImpl.findByAll(BookDaoImpl.java:92) at ch04.service.impl.BookservicesImpl.findByAll(BookservicesImpl.java:38) at ch04.controller.BookAction.showall(BookAction.java:127) at ch04.controller.BookAction.doPost(BookAction.java:46) at javax.servlet.http.HttpServlet.service(HttpServlet.java:660) at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) 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:53) 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:202) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:526) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:860) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1587) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.base/java.lang.Thread.run(Thread.java:835) [] ```
Java异常Could not execute JDBC batch update
org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94) ~[hibernate-3.3.2.jar:na] at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) ~[hibernate-3.3.2.jar:na] at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275) ~[hibernate-3.3.2.jar:na] at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:266) ~[hibernate-3.3.2.jar:na] at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:170) ~[hibernate-3.3.2.jar:na] at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321) ~[hibernate-3.3.2.jar:na] at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50) [hibernate-3.3.2.jar:na] at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1028) [hibernate-3.3.2.jar:na] at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:366) [hibernate-3.3.2.jar:na] at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:137) [hibernate-3.3.2.jar:na] at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:656) [spring.orm-3.0.5.jar:3.0.5.RELEASE] at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754) [spring.transaction-3.0.5.jar:3.0.5.RELEASE] at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723) [spring.transaction-3.0.5.jar:3.0.5.RELEASE] at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:393) [spring.transaction-3.0.5.jar:3.0.5.RELEASE] at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:120) [spring.transaction-3.0.5.jar:3.0.5.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) [spring.aop-3.0.5.jar:3.0.5.RELEASE] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) [spring.aop-3.0.5.jar:3.0.5.RELEASE] at com.sun.proxy.$Proxy21.updateAdmin(Unknown Source) [na:na] at com.jeecms.cms.action.admin.main.CmsAdminLocalAct.update(CmsAdminLocalAct.java:192) [CmsAdminLocalAct.class:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.6.0_45] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.6.0_45] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.6.0_45] at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.6.0_45] at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176) [spring.web-3.0.5.jar:3.0.5.RELEASE] at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:426) [spring.web.servlet-3.0.5.jar:3.0.5.RELEASE] at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:414) [spring.web.servlet-3.0.5.jar:3.0.5.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790) [spring.web.servlet-3.0.5.jar:3.0.5.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719) [spring.web.servlet-3.0.5.jar:3.0.5.RELEASE] at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644) [spring.web.servlet-3.0.5.jar:3.0.5.RELEASE] at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560) [spring.web.servlet-3.0.5.jar:3.0.5.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:643) [servlet-api.jar:na] at javax.servlet.http.HttpServlet.service(HttpServlet.java:723) [servlet-api.jar:na] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) [catalina.jar:6.0.37] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:6.0.37] at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198) [spring.orm-3.0.5.jar:3.0.5.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) [spring.web-3.0.5.jar:3.0.5.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) [catalina.jar:6.0.37] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:6.0.37] at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) [spring.web-3.0.5.jar:3.0.5.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) [spring.web-3.0.5.jar:3.0.5.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) [catalina.jar:6.0.37] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:6.0.37] at com.jeecms.common.web.ProcessTimeFilter.doFilter(ProcessTimeFilter.java:35) [ProcessTimeFilter.class:na] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) [catalina.jar:6.0.37] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:6.0.37] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) [catalina.jar:6.0.37] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) [catalina.jar:6.0.37] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) [catalina.jar:6.0.37] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) [catalina.jar:6.0.37] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [catalina.jar:6.0.37] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) [catalina.jar:6.0.37] at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:879) [tomcat-coyote.jar:6.0.37] at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:617) [tomcat-coyote.jar:6.0.37] at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1760) [tomcat-coyote.jar:6.0.37] at java.lang.Thread.run(Unknown Source) [na:1.6.0_45] Caused by: java.sql.BatchUpdateException: Duplicate entry '863455-186' for key 'PRIMARY' at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:2016) ~[mysql-connector-5.1.8.jar:na] at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1452) ~[mysql-connector-5.1.8.jar:na] at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeBatch(NewProxyPreparedStatement.java:1723) ~[c3p0-0.9.1.2.jar:0.9.1.2] at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70) ~[hibernate-3.3.2.jar:na] at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268) ~[hibernate-3.3.2.jar:na] ... 52 common frames omitted
vue中echarts图无法渲染
我在父组件中定义了一个容器,然后定义了echarts图的基本配置项,在created中调用一个方法,获取后台数据,然后将数据传递到子组件中渲染echarts图,现在数据都能成功传递,但是一直无法成功渲染echarts图 以下为父组件代码 ``` // 父组件代码 <template> <div> <div class="leftChart"> <linegraph :id="'leftChart'" :data="option1" style="height:330px;width:100%"></linegraph> </div> </div> </template> <script> // 引入子组件 import linegraph from "./EchartsShow.vue"; // 引入网络请求方法 import { getSumData } from "@/api/crd/orgLimitView/orgView" export default { data () { return { // echarts图基本配置项,未定义具体数据 option1: { title: { text: '授信额度结构', subtext: '行业维度', x: 'center', top: '3%' }, tooltip: { trigger: 'item', formatter: "{a} <br/>{b} : {c} ({d}%)" }, legend: { orient: 'vertical', left: '2%', top: '2%' }, series: [ { name: '行业', type: 'pie', radius: '55%', center: ['50%', '55%'], itemStyle: { emphasis: { shadowBlur: 10, shadowOffsetX: 0, shadowColor: 'rgba(0, 0, 0, 0.5)' } } } ] }, } }, created () { this.getSum() }, methods: { getSum () { // 调用get请求方法,获取后台数据,由于进度问题,目前只能传递固定的参数,才能获取到测试数据 getSumData('1', '01000').then(res => { if (res.status != 200) { return this.$message.error('获取数据失败,请重试') } const datas = res.data.data // 由于拿到的数据非常复杂繁多,需要进行一些处理,才能拿到需要的数据 this.option1.legend.data = this.tableDatas.map(item => { // 由于后台拿到的数据,都是数字类的码值,this.dicInd[item.industry] 用来翻译后台数据 return this.dicInd[item.industry] }) this.option1.series[0].data = this.tableDatas.map(item => { return { value: item.approveExpAmount, name: this.dicInd[item.industry] } }) console.log(this.option1.legend.data, '行业'); console.log(this.option1.series[0].data, '行业带数据'); }) } }, components: { linegraph } } </script> ``` 以下为子组件代码 ``` // 子组件代码 <template> <div v-bind:id="id" v-bind:data="data"></div> </template> <script> import echarts from "echarts"; export default { name: "echartsShow", data () { return { ChartLineGraph: null }; }, // 深度监听 父组件刚开始没有值,只有图标的配置项 // 父组件ajax请求后改变数据的值,传递过来,图标已生成,监听传过来的值的改变 watch: { data: { deep: true, handler: function (newVal, oldVal) { if (newvalue) { this.drawLineGraph(this.id, newVal) } else { this.drawLineGraph(this.id, oldVal) } } } }, props: ["id", "data"], created() { console.log(this.data, '打印传递过来的图表数据') }, mounted () { this.drawLineGraph(this.id, this.data); console.log(this.id, '打印id值') console.log(this.data, '打印data值') }, methods: { drawLineGraph (id, data) { let _this = this; let myChart = document.getElementById(id); this.ChartLineGraph = echarts.init(myChart); this.ChartLineGraph.setOption(data); window.addEventListener("resize", function () { _this.ChartLineGraph.resize(); }); } }, beforeDestroy () { if (this.ChartLineGraph) { this.ChartLineGraph.clear(); } } }; </script> ``` 从后台获取数据后,成功传递给子组件,但是echarts无法成功渲染 ![图片说明](https://img-ask.csdn.net/upload/202001/07/1578384445_959195.png) ![图片说明](https://img-ask.csdn.net/upload/202001/07/1578384684_683561.png) ![图片说明](https://img-ask.csdn.net/upload/202001/07/1578384616_880352.png) ![图片说明](https://img-ask.csdn.net/upload/202001/07/1578384792_786796.png) 经过多次尝试,我遇到了一个奇怪的问题 ![图片说明](https://img-ask.csdn.net/upload/202001/07/1578385072_241075.png) ![图片说明](https://img-ask.csdn.net/upload/202001/07/1578385147_470918.png) 求各位大佬指点,我的代码哪个地方写错了,如何才能成功渲染echarts
Mongodb 远程连接关于BInd_ip的配置
远程连接 mongodb需要修改bind_ip 但是该如何修改呢,我在配置文件修改后,没有什么用还是127.0.0.1
关于js里bind的问题,不太理解
在看代码的时候遇到这样一段代码: ``` function bindEventListeners() { this.bind('CancelUpload', onCancelUpload); } init : function() { var self = this; bindEventListeners.call(self); } ``` 一般bind第一个参数都是对象,为什么这里是一个字符串呢,bindEventListeners主要实现一个什么样的功能
求大神帮忙看一下:IDEA 中springboot maven mybatis整合项目 启动报错
``` UserController.java文件: @RestController @RequestMapping("/springboot") public class UserController { @Resource(name="userInfoService") UserInfoService userInfoService; @RequestMapping("printUserInfo/{userName}") public String printUserInfo(@PathVariable String userName) { return userInfoService.printUserInfo(userName); } } ``` ``` UserInfoService.java文件: @Component(value="userInfoService") public class UserInfoService { @Autowired UserInfoMapper userInfoMapper; public String printUserInfo(String userName) { UserInfoTableCriteria userInfoTableCriteria = new UserInfoTableCriteria(); userInfoTableCriteria.setName(userName); UserInfoTableDao userInfoTableDao = userInfoMapper.query(userInfoTableCriteria); return userInfoTableDao.toString(); } public UserInfoTableDao createUserInfo(UserInfoTableDao userInfoTableDao) { UserInfoTableDao userInfoTableDaoTmp = userInfoMapper.insert(userInfoTableDao); return userInfoTableDaoTmp; } } ``` ``` UserInfoMapper.java文件 @Repository @Mapper public interface UserInfoMapper { public UserInfoTableDao query(UserInfoTableCriteria userInfoTableCriteria); // public List<UserInfoTableDao> queryList(UserInfoTableCriteria userInfoTableCriteria); public UserInfoTableDao insert(UserInfoTableDao userInfoTableDao); public UserInfoTableDao update(UserInfoTableDao userInfoTableDao); public int delete(UserInfoTableDao userInfoTableDao); } ``` ``` SpringbootApplication.java文件: @EnableTransactionManagement @SpringBootApplication @ComponentScan(basePackages = "com.maven.springboot.service") //@MapperScan(basePackages = "com.maven.springboot.mapper") public class SpringbootApplication { public static void main(String[] args) { SpringApplication.run(SpringbootApplication.class, args); } } ``` ``` 文件中namespace,resultType,parameterType对应的文件路径也是完全正确的。 UserInfoMapper.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.maven.springboot.mapper.UserInfoMapper"> <select id="query" resultType="com.maven.springboot.entity.UserInfoTableDao" parameterType="com.maven.springboot.entity.UserInfoTableCriteria"> select id as id, name as name, sex as sex, age as age, tel as tel, address as address from userinfo where id = #{id} or name = #{name} </select> <insert id="insert" parameterType="com.maven.springboot.entity.UserInfoTableDao"> insert into userinfo(name,sex,age,tel,address) values (#{name}, #{sex}, #{age}, #{tel}, #{address}) </insert> <update id="update" parameterType="com.maven.springboot.entity.UserInfoTableDao"> update userinfo set tel = #{tel}, address = #{address} where id = #{id} </update> <delete id="delete" parameterType="com.maven.springboot.entity.UserInfoTableDao"> delete from userinfo where id = #{id} </delete> </mapper> ``` ``` application.properpties文件: #数据连接配置 spring.datasource.url=jdbc:mysql://localhost:3306/image_info_db spring.datasource.username=root spring.datasource.password=123456 #spring.datasource.driver-class-name=com.mysql.jdbc.Driver #MyBatis配置文件通配符 mybatis.mapper-locations=classpath:/mapping/*.xml ``` 一下是报错信息: 11-Nov-2019 17:52:52.140 严重 [RMI TCP Connection(2)-127.0.0.1] org.apache.tomcat.util.modeler.BaseModelMBean.invoke Exception invoking method [manageApp] java.lang.IllegalStateException: Error starting child at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:720) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:690) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:705) at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1728) 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.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:289) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:456) at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:405) 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.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:289) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468) at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76) at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309) at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1401) at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829) 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 sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:346) at sun.rmi.transport.Transport$1.run(Transport.java:200) at sun.rmi.transport.Transport$1.run(Transport.java:197) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:196) at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/springboot]] at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:717) ... 41 more Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userInfoService': Unsatisfied dependency expressed through field 'userInfoMapper'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userInfoMapper' defined in file [C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\springboot\WEB-INF\classes\com\maven\springboot\mapper\UserInfoMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'mybatis-plus-com.baomidou.mybatisplus.autoconfigure.MybatisPlusProperties': Could not bind properties to 'MybatisPlusProperties' : prefix=mybatis-plus, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'mybatis-plus.configuration.mapped-statements[0].parameter-map.parameter-mappings[0]' to org.apache.ibatis.mapping.ParameterMapping at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:639) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:116) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:397) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1429) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:879) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:878) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:152) at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:132) at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:92) at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:172) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5135) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ... 42 more Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userInfoMapper' defined in file [C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\springboot\WEB-INF\classes\com\maven\springboot\mapper\UserInfoMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'mybatis-plus-com.baomidou.mybatisplus.autoconfigure.MybatisPlusProperties': Could not bind properties to 'MybatisPlusProperties' : prefix=mybatis-plus, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'mybatis-plus.configuration.mapped-statements[0].parameter-map.parameter-mappings[0]' to org.apache.ibatis.mapping.ParameterMapping at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1533) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1413) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1287) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1207) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:636) ... 64 more Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'mybatis-plus-com.baomidou.mybatisplus.autoconfigure.MybatisPlusProperties': Could not bind properties to 'MybatisPlusProperties' : prefix=mybatis-plus, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'mybatis-plus.configuration.mapped-statements[0].parameter-map.parameter-mappings[0]' to org.apache.ibatis.mapping.ParameterMapping at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:787) at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:226) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1358) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1204) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:557) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:400) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1338) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1177) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:557) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1287) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1207) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1518) ... 75 more Caused by: org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'mybatis-plus-com.baomidou.mybatisplus.autoconfigure.MybatisPlusProperties': Could not bind properties to 'MybatisPlusProperties' : prefix=mybatis-plus, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'mybatis-plus.configuration.mapped-statements[0].parameter-map.parameter-mappings[0]' to org.apache.ibatis.mapping.ParameterMapping at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.bind(ConfigurationPropertiesBindingPostProcessor.java:110) at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.postProcessBeforeInitialization(ConfigurationPropertiesBindingPostProcessor.java:96) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:416) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1795) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:595) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1287) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1207) at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:874) at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:778) ... 97 more Caused by: org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'mybatis-plus.configuration.mapped-statements[0].parameter-map.parameter-mappings[0]' to org.apache.ibatis.mapping.ParameterMapping at org.springframework.boot.context.properties.bind.Binder.handleBindError(Binder.java:337) at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:297) at org.springframework.boot.context.properties.bind.Binder.lambda$null$1(Binder.java:385) at org.springframework.boot.context.properties.bind.Binder$Context.withSource(Binder.java:519) at org.springframework.boot.context.properties.bind.Binder$Context.access$1000(Binder.java:486) at org.springframework.boot.context.properties.bind.Binder.lambda$bindAggregate$2(Binder.java:386) at org.springframework.boot.context.properties.bind.IndexedElementsBinder.bindIndexed(IndexedElementsBinder.java:106) at org.springframework.boot.context.properties.bind.IndexedElementsBinder.bindIndexed(IndexedElementsBinder.java:86) at org.springframework.boot.context.properties.bind.IndexedElementsBinder.bindIndexed(IndexedElementsBinder.java:71) at org.springframework.boot.context.properties.bind.CollectionBinder.bindAggregate(CollectionBinder.java:49) at org.springframework.boot.context.properties.bind.AggregateBinder.bind(AggregateBinder.java:56) at org.springframework.boot.context.properties.bind.Binder.lambda$bindAggregate$3(Binder.java:388) at org.springframework.boot.context.properties.bind.Binder$Context.withIncreasedDepth(Binder.java:543) at org.springframework.boot.context.properties.bind.Binder$Context.access$200(Binder.java:486) at org.springframework.boot.context.properties.bind.Binder.bindAggregate(Binder.java:388) at org.springframework.boot.context.properties.bind.Binder.bindObject(Binder.java:349) at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:293) at org.springframework.boot.context.properties.bind.Binder.lambda$bindDataObject$4(Binder.java:421) at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:88) at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:77) at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:54) at org.springframework.boot.context.properties.bind.Binder.lambda$bindDataObject$5(Binder.java:425) at org.springframework.boot.context.properties.bind.Binder$Context.withIncreasedDepth(Binder.java:543) at org.springframework.boot.context.properties.bind.Binder$Context.withDataObject(Binder.java:529) at org.springframework.boot.context.properties.bind.Binder$Context.access$500(Binder.java:486) at org.springframework.boot.context.properties.bind.Binder.bindDataObject(Binder.java:423) at org.springframework.boot.context.properties.bind.Binder.bindObject(Binder.java:364) at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:293) at org.springframework.boot.context.properties.bind.Binder.lambda$bindDataObject$4(Binder.java:421) at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:88) at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:77) at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:54) at org.springframework.boot.context.properties.bind.Binder.lambda$bindDataObject$5(Binder.java:425) at org.springframework.boot.context.properties.bind.Binder$Context.withIncreasedDepth(Binder.java:543) at org.springframework.boot.context.properties.bind.Binder$Context.withDataObject(Binder.java:529) at org.springframework.boot.context.properties.bind.Binder$Context.access$500(Binder.java:486) at org.springframework.boot.context.properties.bind.Binder.bindDataObject(Binder.java:423) at org.springframework.boot.context.properties.bind.Binder.bindObject(Binder.java:364) at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:293) at org.springframework.boot.context.properties.bind.Binder.lambda$null$1(Binder.java:385) at org.springframework.boot.context.properties.bind.Binder$Context.withSource(Binder.java:519) at org.springframework.boot.context.properties.bind.Binder$Context.access$1000(Binder.java:486) at org.springframework.boot.context.properties.bind.Binder.lambda$bindAggregate$2(Binder.java:386) at org.springframework.boot.context.properties.bind.IndexedElementsBinder.bindIndexed(IndexedElementsBinder.java:106) at org.springframework.boot.context.properties.bind.IndexedElementsBinder.bindIndexed(IndexedElementsBinder.java:86) at org.springframework.boot.context.properties.bind.IndexedElementsBinder.bindIndexed(IndexedElementsBinder.java:71) at org.springframework.boot.context.properties.bind.CollectionBinder.bindAggregate(CollectionBinder.java:49) at org.springframework.boot.context.properties.bind.AggregateBinder.bind(AggregateBinder.java:56) at org.springframework.boot.context.properties.bind.Binder.lambda$bindAggregate$3(Binder.java:388) at org.springframework.boot.context.properties.bind.Binder$Context.withIncreasedDepth(Binder.java:543) at org.springframework.boot.context.properties.bind.Binder$Context.access$200(Binder.java:486) at org.springframework.boot.context.properties.bind.Binder.bindAggregate(Binder.java:388) at org.springframework.boot.context.properties.bind.Binder.bindObject(Binder.java:349) at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:293) at org.springframework.boot.context.properties.bind.Binder.lambda$bindDataObject$4(Binder.java:421) at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:88) at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:77) at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:54) at org.springframework.boot.context.properties.bind.Binder.lambda$bindDataObject$5(Binder.java:425) at org.springframework.boot.context.properties.bind.Binder$Context.withIncreasedDepth(Binder.java:543) at org.springframework.boot.context.properties.bind.Binder$Context.withDataObject(Binder.java:529) at org.springframework.boot.context.properties.bind.Binder$Context.access$500(Binder.java:486) at org.springframework.boot.context.properties.bind.Binder.bindDataObject(Binder.java:423) at org.springframework.boot.context.properties.bind.Binder.bindObject(Binder.java:364) at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:293) at org.springframework.boot.context.properties.bind.Binder.lambda$bindDataObject$4(Binder.java:421) at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:88) at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:77) at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:54) at org.springframework.boot.context.properties.bind.Binder.lambda$bindDataObject$5(Binder.java:425) at org.springframework.boot.context.properties.bind.Binder$Context.withIncreasedDepth(Binder.java:543) at org.springframework.boot.context.properties.bind.Binder$Context.withDataObject(Binder.java:529) at org.springframework.boot.context.properties.bind.Binder$Context.access$500(Binder.java:486) at org.springframework.boot.context.properties.bind.Binder.bindDataObject(Binder.java:423) at org.springframework.boot.context.properties.bind.Binder.bindObject(Binder.java:364) at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:293) at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:281) at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:211) at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:198) at org.springframework.boot.context.properties.ConfigurationPropertiesBinder.bind(ConfigurationPropertiesBinder.java:89) at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.bind(ConfigurationPropertiesBindingPostProcessor.java:107) ... 111 more Caused by: java.lang.IllegalStateException: Failed to extract parameter names for org.apache.ibatis.mapping.ParameterMapping(org.apache.ibatis.mapping.ParameterMapping$1) at org.springframework.util.Assert.state(Assert.java:94) at org.springframework.boot.context.properties.bind.ValueObjectBinder$DefaultValueObject.parseConstructorParameters(ValueObjectBinder.java:178) at org.springframework.boot.context.properties.bind.ValueObjectBinder$DefaultValueObject.<init>(ValueObjectBinder.java:173) at org.springframework.boot.context.properties.bind.ValueObjectBinder$DefaultValueObject.get(ValueObjectBinder.java:218) at org.springframework.boot.context.properties.bind.ValueObjectBinder$DefaultValueObject.get(ValueObjectBinder.java:206) at org.springframework.boot.context.properties.bind.ValueObjectBinder$ValueObject.get(ValueObjectBinder.java:112) at org.springframework.boot.context.properties.bind.ValueObjectBinder.bind(ValueObjectBinder.java:51) at org.springframework.boot.context.properties.bind.Binder.lambda$bindDataObject$5(Binder.java:425) at org.springframework.boot.context.properties.bind.Binder$Context.withIncreasedDepth(Binder.java:543) at org.springframework.boot.context.properties.bind.Binder$Context.withDataObject(Binder.java:529) at org.springframework.boot.context.properties.bind.Binder$Context.access$500(Binder.java:486) at org.springframework.boot.context.properties.bind.Binder.bindDataObject(Binder.java:423) at org.springframework.boot.context.properties.bind.Binder.bindObject(Binder.java:364) at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:293) ... 190 more 11-Nov-2019 17:52:52.452 严重 [RMI TCP Connection(2)-127.0.0.1] org.apache.tomcat.util.modeler.BaseModelMBean.invoke Exception invoking method [createStandardContext] javax.management.RuntimeOperationsException: Exception invoking method [manageApp] at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:298) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:456) at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:405) 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.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:289) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468) at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76) at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309) at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1401) at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829) 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 sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:346) at sun.rmi.transport.Transport$1.run(Transport.java:200) at sun.rmi.transport.Transport$1.run(Transport.java:197) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:196) at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.IllegalStateException: Error starting child at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:720) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:690) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:705) at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1728) 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.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:289) ... 33 more Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/springboot]] at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:717) ... 41 more Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userInfoService': Unsatisfied dependency expressed through field 'userInfoMapper'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userInfoMapper' defined in file [C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\springboot\WEB-INF\classes\com\maven\springboot\mapper\UserInfoMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'mybatis-plus-com.baomidou.mybatisplus.autoconfigure.MybatisPlusProperties': Could not bind properties to 'MybatisPlusProperties' : prefix=mybatis-plus, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'mybatis-plus.configuration.mapped-statements[0].parameter-map.parameter-mappings[0]' to org.apache.ibatis.mapping.ParameterMapping at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:639) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:116) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:397) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1429) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:879) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:878) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:152) at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:132) at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:92) at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:172) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5135) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ... 42 more Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userInfoMapper' defined in file [C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\springboot\WEB-INF\classes\com\maven\springboot\mapper\UserInfoMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'mybatis-plus-com.baomidou.mybatisplus.autoconfigure.MybatisPlusProperties': Could not bind properties to 'MybatisPlusProperties' : prefix=mybatis-plus, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'mybatis-plus.configuration.mapped-statements[0].parameter-map.parameter-mappings[0]' to org.apache.ibatis.mapping.ParameterMapping at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1533) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1413) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1287) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1207) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:636) ... 64 more Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'mybatis-plus-com.baomidou.mybatisplus.autoconfigure.MybatisPlusProperties': Could not bind properties to 'MybatisPlusProperties' : prefix=mybatis-plus, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'mybatis-plus.configuration.mapped-statements[0].parameter-map.parameter-mappings[0]' to org.apache.ibatis.mapping.ParameterMapping at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:787) at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:226) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1358) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1204) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:557) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:400) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1338) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1177) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:557) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1287) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1207) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1518) ... 75 more Caused by: org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'mybatis-plus-com.baomidou.mybatisplus.autoconfigure.MybatisPlusProperties': Could not bind properties to 'MybatisPlusProperties' : prefix=mybatis-plus, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'mybatis-plus.configuration.mapped-statements[0].parameter-map.parameter-mappings[0]' to org.apache.ibatis.mapping.ParameterMapping at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.bind(ConfigurationPropertiesBindingPostProcessor.java:110) at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.postProcessBeforeInitialization(ConfigurationPropertiesBindingPostProcessor.java:96) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:416) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1795) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:595) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1287) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1207) at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:874) at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:778) ... 97 more Caused by: org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'mybatis-plus.configuration.mapped-statements[0].parameter-map.parameter-mappings[0]' to org.apache.ibatis.mapping.ParameterMapping at org.springframework.boot.context.properties.bind.Binder.handleBindError(Binder.java:337) at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:297) at org.springframework.boot.context.properties.bind.Binder.lambda$null$1(Binder.java:385) at org.springframework.boot.context.properties.bind.Binder$Context.withSource(Binder.java:519) at org.springframework.boot.context.properties.bind.Binder$Context.access$1000(Binder.java:486) at org.springframework.boot.context.properties.bind.Binder.lambda$bindAggregate$2(Binder.java:386) at org.springframework.boot.context.properties.bind.IndexedElementsBinder.bindIndexed(IndexedElementsBinder.java:106) at org.springframework.boot.context.properties.bind.IndexedElementsBinder.bindIndexed(IndexedElementsBinder.java:86) at org.springframework.boot.context.properties.bind.IndexedElementsBinder.bindIndexed(IndexedElementsBinder.java:71) at org.springframework.boot.context.properties.bind.CollectionBinder.bindAggregate(CollectionBinder.java:49) at org.springframework.boot.context.properties.bind.AggregateBinder.bind(AggregateBinder.java:56) at org.springframework.boot.context.properties.bind.Binder.lambda$bindAggregate$3(Binder.java:388) at org.springframework.boot.context.properties.bind.Binder$Context.withIncreasedDepth(Binder.java:543) at org.springframework.boot.context.properties.bind.Binder$Context.access$200(Binder.java:486) at org.springframework.boot.context.properties.bind.Binder.bindAggregate(Binder.java:388) at org.springframework.boot.context.properties.bind.Binder.bindObject(Binder.java:349) at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:293) at org.springframework.boot.context.properties.bind.Binder.lambda$bindDataObject$4(Binder.java:421) at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:88) at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:77) at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:54) at org.springframework.boot.context.properties.bind.Binder.lambda$bindDataObject$5(Binder.java:425) at org.springframework.boot.context.properties.bind.Binder$Context.withIncreasedDepth(Binder.java:543) at org.springframework.boot.context.properties.bind.Binder$Context.withDataObject(Binder.java:529) at org.springframework.boot.context.properties.bind.Binder$Context.access$500(Binder.java:486) at org.springframework.boot.context.properties.bind.Binder.bindDataObject(Binder.java:423) at org.springframework.boot.context.properties.bind.Binder.bindObject(Binder.java:364) at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:293) at org.springframework.boot.context.properties.bind.Binder.lambda$bindDataObject$4(Binder.java:421) at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:88) at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:77) at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:54) at org.springframework.boot.context.properties.bind.Binder.lambda$bindDataObject$5(Binder.java:425) at org.springframework.boot.context.properties.bind.Binder$Context.withIncreasedDepth(Binder.java:543) at org.springframework.boot.context.properties.bind.Binder$Context.withDataObject(Binder.java:529) at org.springframework.boot.context.properties.bind.Binder$Context.access$500(Binder.java:486) at org.springframework.boot.context.properties.bind.Binder.bindDataObject(Binder.java:423) at org.springframework.boot.context.properties.bind.Binder.bindObject(Binder.java:364) at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:293) at org.springframework.boot.context.properties.bind.Binder.lambda$null$1(Binder.java:385) at org.springframework.boot.context.properties.bind.Binder$Context.withSource(Binder.java:519) at org.springframework.boot.context.properties.bind.Binder$Context.access$1000(Binder.java:486) at org.springframework.boot.context.properties.bind.Binder.lambda$bindAggregate$2(Binder.java:386) at org.springframework.boot.context.properties.bind.IndexedElementsBinder.bindIndexed(IndexedElementsBinder.java:106) at org.springframework.boot.context.properties.bind.IndexedElementsBinder.bindIndexed(IndexedElementsBinder.java:86) at org.springframework.boot.context.properties.bind.IndexedElementsBinder.bindIndexed(IndexedElementsBinder.java:71) at org.springframework.boot.context.properties.bind.CollectionBinder.bindAggregate(CollectionBinder.java:49) at org.springframework.boot.context.properties.bind.AggregateBinder.bind(AggregateBinder.java:56) at org.springframework.boot.context.properties.bind.Binder.lambda$bindAggregate$3(Binder.java:388) at org.springframework.boot.context.properties.bind.Binder$Context.withIncreasedDepth(Binder.java:543) at org.springframework.boot.context.properties.bind.Binder$Context.access$200(Binder.java:486) at org.springframework.boot.context.properties.bind.Binder.bindAggregate(Binder.java:388) at org.springframework.boot.context.properties.bind.Binder.bindObject(Binder.java:349) at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:293) at org.springframework.boot.context.properties.bind.Binder.lambda$bindDataObject$4(Binder.java:421) at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:88) at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:77) at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:54) at org.springframework.boot.context.properties.bind.Binder.lambda$bindDataObject$5(Binder.java:425) at org.springframework.boot.context.properties.bind.Binder$Context.withIncreasedDepth(Binder.java:543) at org.springframework.boot.context.properties.bind.Binder$Context.withDataObject(Binder.java:529) at org.springframework.boot.context.properties.bind.Binder$Context.access$500(Binder.java:486) at org.springframework.boot.context.properties.bind.Binder.bindDataObject(Binder.java:423) at org.springframework.boot.context.properties.bind.Binder.bindObject(Binder.java:364) at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:293) at org.springframework.boot.context.properties.bind.Binder.lambda$bindDataObject$4(Binder.java:421) at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:88) at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:77) at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:54) at org.springframework.boot.context.properties.bind.Binder.lambda$bindDataObject$5(Binder.java:425) at org.springframework.boot.context.properties.bind.Binder$Context.withIncreasedDepth(Binder.java:543) at org.springframework.boot.context.properties.bind.Binder$Context.withDataObject(Binder.java:529) at org.springframework.boot.context.properties.bind.Binder$Context.access$500(Binder.java:486) at org.springframework.boot.context.properties.bind.Binder.bindDataObject(Binder.java:423) at org.springframework.boot.context.properties.bind.Binder.bindObject(Binder.java:364) at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:293) at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:281) at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:211) at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:198) at org.springframework.boot.context.properties.ConfigurationPropertiesBinder.bind(ConfigurationPropertiesBinder.java:89) at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.bind(ConfigurationPropertiesBindingPostProcessor.java:107) ... 111 more Caused by: java.lang.IllegalStateException: Failed to extract parameter names for org.apache.ibatis.mapping.ParameterMapping(org.apache.ibatis.mapping.ParameterMapping$1) at org.springframework.util.Assert.state(Assert.java:94) at org.springframework.boot.context.properties.bind.ValueObjectBinder$DefaultValueObject.parseConstructorParameters(ValueObjectBinder.java:178) at org.springframework.boot.context.properties.bind.ValueObjectBinder$DefaultValueObject.<init>(ValueObjectBinder.java:173) at org.springframework.boot.context.properties.bind.ValueObjectBinder$DefaultValueObject.get(ValueObjectBinder.java:218) at org.springframework.boot.context.properties.bind.ValueObjectBinder$DefaultValueObject.get(ValueObjectBinder.java:206) at org.springframework.boot.context.properties.bind.ValueObjectBinder$ValueObject.get(ValueObjectBinder.java:112) at org.springframework.boot.context.properties.bind.ValueObjectBinder.bind(ValueObjectBinder.java:51) at org.springframework.boot.context.properties.bind.Binder.lambda$bindDataObject$5(Binder.java:425) at org.springframework.boot.context.properties.bind.Binder$Context.withIncreasedDepth(Binder.java:543) at org.springframework.boot.context.properties.bind.Binder$Context.withDataObject(Binder.java:529) at org.springframework.boot.context.properties.bind.Binder$Context.access$500(Binder.java:486) at org.springframework.boot.context.properties.bind.Binder.bindDataObject(Binder.java:423) at org.springframework.boot.context.properties.bind.Binder.bindObject(Binder.java:364) at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:293) ... 190 more
求问,webService接口调用第一次总是失败,之后就成功,为什么??
我调用webservice服务的接口,发送请求数据,为什么第一次调用接口的时候,总是失败,报错,然后紧接着我在继续调用,就成功了,不报错了,有大神能解释一下为什么吗?代码和报错如下: 报错: webService方法推送技术标准开始了================= 推送失败: javax.xml.ws.soap.SOAPFaultException: Marshalling Error: Error writing request body to server at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:161) at com.sun.proxy.$Proxy482.syncTechStds(Unknown Source) at cn.com.ebpm.ep.factor.pgc.law.powerController.pushTechDataByWebService(powerController.java:631) at cn.com.ebpm.ep.factor.pgc.law.TEST.submitTechData(TEST.java:94) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:777) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:706) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:943) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:877) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:857) at javax.servlet.http.HttpServlet.service(HttpServlet.java:621) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:306) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at cn.com.ebpm.ep.filter.XssFilter.doFilter(XssFilter.java:79) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:244) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.jasig.cas.client.javafilter.util.AssertionThreadLocalFilter.doFilter(AssertionThreadLocalFilter.java:56) at com.sgcc.isc.ualogin.client.filter.IsoSSOAssertionThreadLocalFilter.doFilter(IsoSSOAssertionThreadLocalFilter.java:23) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:244) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.jasig.cas.client.javafilter.util.HttpServletRequestWrapperFilter.doFilter(HttpServletRequestWrapperFilter.java:76) at com.sgcc.isc.ualogin.client.filter.IscSSOHttpServletRequestWrapperFilter.doFilter(IscSSOHttpServletRequestWrapperFilter.java:22) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:244) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.jasig.cas.client.javafilter.validation.AbstractTicketValidationFilter.doFilter(AbstractTicketValidationFilter.java:203) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:244) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.jasig.cas.client.javafilter.authentication.AuthenticationFilter.doFilter(AuthenticationFilter.java:127) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:244) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.jasig.cas.client.javafilter.session.SingleSignOutFilter.doFilter(SingleSignOutFilter.java:80) at com.sgcc.isc.ualogin.client.filter.IscSingleSignOutFilter.doFilter(IscSingleSignOutFilter.java:47) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:244) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at cn.com.ebpm.ep.filter.SqlInjectionFilter.doFilter(SqlInjectionFilter.java:62) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:244) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at cn.com.ebpm.ep.filter.LoginTimeOutFilter.doFilter(LoginTimeOutFilter.java:70) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:244) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at cn.com.ebpm.ep.filter.SessionFilter.doFilterInternal(SessionFilter.java:18) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:244) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:244) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:550) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:380) at org.apache.coyote.http11.Http11NioProcessor.process(Http11NioProcessor.java:388) at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:354) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1551) 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:724) Caused by: javax.xml.bind.MarshalException - with linked exception: [java.io.IOException: Error writing request body to server] at com.sun.xml.internal.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:313) at com.sun.xml.internal.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:236) at javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshallerImpl.java:95) at org.apache.cxf.jaxb.JAXBEncoderDecoder.writeObject(JAXBEncoderDecoder.java:617) at org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:241) at org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:238) at org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:118) at org.apache.cxf.wsdl.interceptors.BareOutInterceptor.handleMessage(BareOutInterceptor.java:68) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:514) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:423) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:324) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:277) at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96) at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:139) ... 70 more Caused by: java.io.IOException: Error writing request body to server at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.checkError(HttpURLConnection.java:3191) at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.write(HttpURLConnection.java:3174) at org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOutputStream.java:51) at org.apache.cxf.io.AbstractThresholdOutputStream.write(AbstractThresholdOutputStream.java:69) at com.sun.xml.internal.bind.v2.runtime.output.UTF8XmlOutput.write(UTF8XmlOutput.java:396) at com.sun.xml.internal.bind.v2.runtime.output.Encoded.write(Encoded.java:152) at com.sun.xml.internal.bind.v2.runtime.output.UTF8XmlOutput.writeName(UTF8XmlOutput.java:226) at com.sun.xml.internal.bind.v2.runtime.output.UTF8XmlOutput.endTag(UTF8XmlOutput.java:270) at com.sun.xml.internal.bind.v2.runtime.output.NamespaceContextImpl$Element.endElement(NamespaceContextImpl.java:489) at com.sun.xml.internal.bind.v2.runtime.XMLSerializer.endElement(XMLSerializer.java:303) at com.sun.xml.internal.bind.v2.runtime.property.ArrayElementProperty.serializeListBody(ArrayElementProperty.java:160) at com.sun.xml.internal.bind.v2.runtime.property.ArrayERProperty.serializeBody(ArrayERProperty.java:144) at com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:343) at com.sun.xml.internal.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:685) at com.sun.xml.internal.bind.v2.runtime.property.SingleElementNodeProperty.serializeBody(SingleElementNodeProperty.java:143) at com.sun.xml.internal.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanInfoImpl.java:146) at com.sun.xml.internal.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanInfoImpl.java:116) at com.sun.xml.internal.bind.v2.runtime.ElementBeanInfoImpl.serializeBody(ElementBeanInfoImpl.java:318) at com.sun.xml.internal.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementBeanInfoImpl.java:325) at com.sun.xml.internal.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementBeanInfoImpl.java:61) at com.sun.xml.internal.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:483) at com.sun.xml.internal.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:308) ... 84 more ========开始调用技术标准接口了======== webService方法推送技术标准开始了================= 推送完成,返回值:OK 看上面:紧跟着在调用返回ok,就表示成功了。 调用的代码如下: cn.com.ebpm.webservice.teachstd.YDTFIGATE ydtfigate = new cn.com.ebpm.webservice.teachstd.YDTFIGATE(); cn.com.ebpm.webservice.teachstd.SOAServicePort service = ydtfigate.getSOAService(); SyncTechStdsRequest requestData = new SyncTechStdsRequest(); TechStd techBean = null; TechStdCategorys techstdcategorysBean = null; TechStdItem techItemBean = null; List techCategorysList = this.sqlSession.selectList("cn.com.ebpm.ep.factor.pgc.law.power.getTechStdCategory", null); List techList = this.sqlSession.selectList("cn.com.ebpm.ep.factor.pgc.law.power.getTechStd", null); List techItemList = this.sqlSession.selectList("cn.com.ebpm.ep.factor.pgc.law.power.getTechStdItem", null); for (Map map : techList) { techBean = new TechStd(); techBean.setAt152((String)map.get("AT_152")); techBean.setAt55((String)map.get("AT_55")); techBean.setAt593((String)map.get("AT_593")); techBean.setObjectGuid((String)map.get("OBJECT_GUID")); techBean.setObjectName((String)map.get("OBJECT_NAME")); techBean.setParentGuid((String)map.get("PARENT_GUID")); requestData.getTechStds().add(techBean); } for (Map map : techCategorysList) { techstdcategorysBean = new TechStdCategorys(); techstdcategorysBean.setIsparent((String)map.get("ISPARENT")); techstdcategorysBean.setObjectGuid((String)map.get("OBJECT_GUID")); techstdcategorysBean.setObjectName((String)map.get("OBJECT_NAME")); techstdcategorysBean.setObjFlag((String)map.get("OBJ_FLAG")); techstdcategorysBean.setParentGuid((String)map.get("PARENT_GUID")); requestData.getTechStdCategorys().add(techstdcategorysBean); } for (Map map : techItemList) { techItemBean = new TechStdItem(); techItemBean.setAt55((String)map.get("AT_55")); techItemBean.setAt9((String)map.get("AT_9")); techItemBean.setFactorGuid((String)map.get("FACTOR_GUID")); techItemBean.setItemGuid((String)map.get("ITEM_GUID")); techItemBean.setItemName((String)map.get("ITEM_NAME")); requestData.getTechStdItems().add(techItemBean); } Client proxy = ClientProxy.getClient(service); HTTPConduit conduit = (HTTPConduit)proxy.getConduit(); HTTPClientPolicy policy = new HTTPClientPolicy(); policy.setConnectionTimeout(180000L); policy.setReceiveTimeout(300000L); conduit.setClient(policy); SyncTechStdsResponse response = service.syncTechStds(requestData); replayCode = response.getReplyCode(); System.out.println("推送完成,返回值:" + replayCode);
在校大学生求各位大佬,C++socket bind绑定ip地址失败,错误码10038,怎么解决?
#include <winsock2.h> #include <ws2tcpip.h> #include <stdio.h> #include <stdlib.h> #include <iostream> #pragma comment(lib,"WS2_32.lib") #define BUFFER_MAX 2048 #define IP_HDRINCL 2 #define SIO_RCVALL _WSAIOW(IOC_VENDOR,1) using namespace std; int main(){ SOCKET sock; int n_read,proto; int flag = 1; char buffer[BUFFER_MAX]; char LocalName[256]; char *ethhead,*iphead,*tcphead,*udphead,*icmphead,*p; WSADATA WSAData; if(WSAStartup(MAKEWORD(2,2),&WSAData)!=0) { printf("WSAStartup ERROR.\\n"); //如果初始化WSADATA结构得到错误码,则显示出错信息 return -1; } // if(sock = socket(AF_INET, SOCK_RAW, IPPROTO_RAW)<0){ // cout<<"Socket创建失败"<<endl; // exit(0); // } // setsockopt(sock, IPPROTO_IP, IP_HDRINCL, (char*)&flag, sizeof(flag)); //设置 IP 头操作选项 ////////////////////////创建并设置原始套接字 sock = socket(AF_INET, SOCK_RAW, IPPROTO_IP);//启用winsock创建原始套接字,SOCK_RAW 类型表示原始套接字类型混杂模式,也就是接收所有包 setsockopt(sock, IPPROTO_IP, IP_HDRINCL, (char*)&flag, sizeof(flag));//设置原始套接字,设置 IP 头操作选项 ////////////////////////把原始套接字绑定到本地主机网卡上,实现将本地网卡置于混杂模式 if(gethostname((char*)LocalName, sizeof(LocalName)-1)!=0) //获取本地主机IP { printf("获取主机名失败 Error:%d.\\n",WSAGetLastError()); return -1; } gethostname((char*)LocalName, 256);//把本地主机名存放入指定的缓冲区中 hostent *pHost = gethostbyname((char*)LocalName); SOCKADDR_IN addr_in; //获取本地 IP 地址 addr_in.sin_addr = *(in_addr *)pHost->h_addr_list[0]; addr_in.sin_family = AF_INET; addr_in.sin_port = htons(40000); if(bind(sock, (PSOCKADDR)&addr_in, sizeof(addr_in))!=0) //把原始套接字绑定在本地主机网卡上 { printf("绑定失败:%d.\\n",WSAGetLastError()); //绑定失败时显示提示信息 return -1; } //////////////////////////设置原始套接字能够接受所有的数据 DWORD dwValue = 1; if(ioctlsocket(sock, SIO_RCVALL, &dwValue)!=0) { printf("ioctlsocket Error:%d.\\n",WSAGetLastError()); //设置失败时显示提示信息 return -1; } while(true){ int ret = recv(sock,buffer,BUFFER_MAX,0); if(ret>0){ ethhead = buffer; p = ethhead; int n = 0XFF; //链路层前6+6+2个字节为目的MAC 源MAC type // printf("MAC: %.2X:%-02X-%.02X-%.02X-%.02X-%.02X ==> %.2X-%.2X-%.2X-%.2X-%.2X-%.2X-\n",p[6]&n,p[7]&n,p[8]&n,p[9]&n,p[10]&n,p[11]&n, // p[0]&n,p[1]&n,p[2]&n,p[3]&n,p[4]&n,p[5]&n); iphead = ethhead;// + 14; p = iphead + 12; //数据包前14个字节后为20字节的第九个字节为协议,第12-16,17-20个字节为源IP,目的IP printf("IP: %d.%d.%d.%d ==> %d.%d.%d.%d\n",p[0]&0XFF,p[1]&0XFF,p[2]&0XFF,p[3]&0XFF,p[4]&0XFF,p[5]&0XFF,p[6]&0XFF,p[7]&0XFF); short length = (short)(iphead+2)[0]; printf("总长度:%d\n",length); proto = (iphead+9)[0]; p = iphead + 20; printf("Protocol:"); switch(proto){ case 1: printf("ICMP\n");break; case 2: printf("IGMP\n");break; case 4: printf("IP\n");break; case 6: printf("TCP\n");break; case 8: printf("EGP\n");break; case 9: printf("IGP\n");break; case 17: printf("UDP\n");break; case 41: printf("IPv6\n");break; case 50: printf("ESP\n");break; case 89: printf("OSPF\n");break; default: printf("不知道,协议编号是%d,请自己查文档\n",proto);break; } } cout<<endl; Sleep(200); } } ``` ```
Web开发-登录界面点击登录按钮没反应
**login.html** ``` <!DOCTYPE html> <html> <head> <title>登录</title> <link rel="stylesheet" type="text/css" href="css/login.css"> <script src="js/bootstrap.min.js"></script> <script src="js/jquery.min.js"></script> <script src="js/frame.js"></script> <meta charset="UTF-8"> </head> <body> <div class="contain"> <div class="logintop"> </div> <div class="loginbody"> <div class="logindiv"> <form id="loginform" name="loginform" class="loginform"> <ul> <li> <input name="username" type="text" class="loginuser" value="" placeholder="输入账号" maxlength="100" id="username" errormsg="密码长度在6-16位之间"/> </li> <li> <input name="password" type="password" class="loginpwd" value="" placeholder="输入密码" id="password" errormsg="密码长度在6-16位之间"/> </li> <li> <input name="btnRtSubmit" type="button" class="loginbtn" id="btnRtSubmit" value="登录"/> </li> </ul> </form> </div> </div> <div class="loginbottom"> 版权所有 2019 Star-Net </div> </div> </body> </html> ``` **frame.js** ``` (function($){ alert("1"); function login(event){ alert("2"); event.preventDefault(); var userName = $("#username").val();//获取用户名 var password = $("#password").val();//获取密码 //Ajax向后台提交用户名、密码 alert("userName:"+userName+" password:"+password); $.post("/UserManager/loginController.do",{ username:userName, password:password }, function(data){ if((typeof(data)!="undefined")&&(null!= data) &&(0==data)){ //登录成功后隐藏登录表单 $(".contain").hide(); //登录成功后跳转到用户列表页 $("#content").load("/UserManager/listUserController.do"); } }); } $("#btnRtSubmit").bind("click",login);//为btnRtSubmit绑定事件 })($); ``` **我觉得问题应该出在frame.js上,但找不出问题在哪,大佬救我**
redis外部连接不上 telnet 6379失败
redis已经启动 防火墙也关闭了 配置文件bind 注释掉了 但是telnet ip 6379 连接不上... ![图片说明](https://img-ask.csdn.net/upload/201912/16/1576487730_794710.jpg) em... ![图片说明](https://img-ask.csdn.net/upload/201912/16/1576487815_276475.jpg)
Minecraft服务器开启报错-java.net.BindException: Cannot assign requested address: bind 排查不出问题?
每次开启mc服务器都会报错 经过排查我填入的端口没有被占用,防火墙已经将相关端口开放,在阿里云的防火墙设置也添加了相关规则 hosts文件内没有内容 jdk用的是jdk12 如果将server-ip改为内网ip或者127.0.0.1就可以正常开启,但是公网ip不可以 我在服务器上部署的tomcat和mysql都可以正常访问 如能解决,万分感谢!!!!!! > **** FAILED TO BIND TO PORT! > The exception was: java.net.BindException: Cannot assign requested address: bind > Perhaps a server is already running on that port?
C#通过Socket实现多文件传输
大概需求是客户端发送一个xml文件名给服务器,服务器返回xml文件。这一步没问题。 后面客户端需要解析xml文件,根据解析出的文件名,去服务器获取指定文件。现在问题是第一次服务器发送xml文件之后就侦听不到客户端后面的请求了 服务端代码: ``` #region 窗体加载 private void Form1_Load(object sender, EventArgs e) { Socket socketWatch = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);//Socket设置、IPv4、Stream类型套接字、TCP协议 IPAddress ip = IPAddress.Any;//获取本机IP IPEndPoint point = new IPEndPoint(ip, 18002);//设置IP和端口 socketWatch.Bind(point);//绑定端口 memoEdit1.Text = "开始侦听..."; socketWatch.Listen(100);//最大连接数 Thread th = new Thread(SendFileFuncssss);//创建新线程 th.Start(socketWatch);//启动线程 th.IsBackground = true;//设置后台运行线程 } #endregion #region 根据客户端传输文件名发送指定文件 public void SendFileFuncssss(object obj) { Socket socket = obj as Socket; while (true) { Socket socketServices = socket.Accept(); byte[] buffer = new byte[1024]; int num = socketServices.Receive(buffer);//接收到字节数 string str = Encoding.UTF8.GetString(buffer, 1, num - 1);//接收到字符串 if (buffer[0] == 0)//表示接收到的是消息数据 { TxtAddContent(socketServices.RemoteEndPoint + "连接成功"); string FileName = str; if (FileName.Equals("AutoUpdater.xml"))//获取xml配置文件 { //发送XML文件到客户端 using (FileStream fs = new FileStream(AppDomain.CurrentDomain.BaseDirectory + FileName, FileMode.Open)) { byte[] arrFile = new byte[1024 * 1024 * 5]; int length = fs.Read(arrFile, 0, arrFile.Length); byte[] arrFileSend = new byte[length + 1]; arrFileSend[0] = 1; // 用来表示发送的是xml文件数据 Buffer.BlockCopy(arrFile, 0, arrFileSend, 1, length); socketServices.Send(arrFileSend);// 发送数据到客户端 } } if (!FileName.Equals("AutoUpdater.xml")) { //发送更新文件到客户端 using (FileStream fs = new FileStream(AppDomain.CurrentDomain.BaseDirectory + "\\FileFolder\\" + FileName, FileMode.Open)) { byte[] arrFile = new byte[1024 * 1024 * 50]; int length = fs.Read(arrFile, 0, arrFile.Length);//获取文件长度 byte[] arrFileSend = new byte[length + 1]; arrFileSend[0] = 1; // 用来表示发送的是xml文件数据 Buffer.BlockCopy(arrFile, 0, arrFileSend, 1, length); socketServices.Send(arrFileSend);// 发送数据到服务端 } } } } } #endregion ``` 客户端代码: ``` Socket socketClient = obj as Socket; socketClient.Connect(ipEndPoint); #region 修改本地文件名称 string Oldpath = AppDomain.CurrentDomain.BaseDirectory + "AutoUpdater.xml";//修改前名称 string Newpath = AppDomain.CurrentDomain.BaseDirectory + "AutoUpdater_Back.xml";//修改后名称 if (File.Exists(Oldpath)) { File.Delete(Newpath); File.Move(Oldpath, Newpath);//更改文件名 } #endregion if (socketClient.Connected) { try { TxtReceiveAddContent("连接成功"); //发送链接成功提示 byte[] arrMsg = Encoding.UTF8.GetBytes("AutoUpdater.xml"); byte[] arrSendMsg = new byte[arrMsg.Length + 1];//加一位标识用于表示是文字消息还是文件 arrSendMsg[0] = 0; // 用来表示发送的是消息数据 Buffer.BlockCopy(arrMsg, 0, arrSendMsg, 1, arrMsg.Length); socketClient.Send(arrSendMsg); //获取文件 string dirPath = Application.StartupPath; byte[] buffer = new byte[1024 * 1024 * 5]; int lenght = socketClient.Receive(buffer); if (buffer[0] == 1) { using (FileStream fs = new FileStream(dirPath + "\\AutoUpdater.xml", FileMode.Create)) { fs.Write(buffer, 1, lenght - 1); } TxtReceiveAddContent("配置文件接收成功:AutoUpdater.xml");//追加提示备注 } #region 获取XML里需要更新的文件和需要删除的文件 List<string> updatelist = new List<string>();//需要更新的文件集合 List<string> deletelist = new List<string>();//需要更新的文件集合 //获取历史xml文件更新时间以及更新版本 XDocument Olddocument = XDocument.Load(AppDomain.CurrentDomain.BaseDirectory + "AutoUpdater_Back.xml"); //获取到XML的根元素进行操作 XElement Oldroot = Olddocument.Root; XElement Oldele = Oldroot.Element("UpdateInfo"); //获取旧更新时间标签的值 XElement OldUpdateTime = Oldele.Element("UpdateTime"); //获取旧版本号标签的值 XElement OldVersion = Oldele.Element("Version"); //获取最新xml文件更新时间以及更新版本 XDocument Newdocument = XDocument.Load(AppDomain.CurrentDomain.BaseDirectory + "AutoUpdater.xml"); //获取到XML的根元素进行操作 XElement Newroot = Newdocument.Root; XElement Newele = Newroot.Element("UpdateInfo"); //获取旧更新时间标签的值 XElement NewUpdateTime = Newele.Element("UpdateTime"); //获取旧版本号标签的值 XElement NewVersion = Newele.Element("Version"); if (NewUpdateTime != OldUpdateTime || NewVersion != OldVersion) { //获取需要更新的文件列表 XElement NewUpList = Newroot.Element("UpdateList"); IEnumerable<XElement> UpList = NewUpList.Elements(); foreach (XElement item in UpList) { updatelist.Add(item.Value); } //获取需要删除的文件列表 XElement NewDelList = Newroot.Element("DeleteList"); IEnumerable<XElement> DelList = NewDelList.Elements(); foreach (XElement item in DelList) { deletelist.Add(item.Value); } } #endregion #region 循环获取更新文件 for (int i = 0; i < updatelist.Count; i++) { //发送链接成功提示 byte[] FileName = Encoding.UTF8.GetBytes(updatelist[i]); byte[] SendFileName = new byte[FileName.Length + 1];//加一位标识用于表示是文字消息还是文件 SendFileName[0] = 0; // 用来表示发送的是消息数据 Buffer.BlockCopy(FileName, 0, SendFileName, 1, FileName.Length); socketClient.Send(SendFileName); //获取文件 string FilePath = Application.StartupPath + "\\WebFile"; byte[] bufferByFile = new byte[1024 * 1024 * 50]; int lenghtByFile = socketClient.Receive(bufferByFile); if (bufferByFile[0] == 1) { using (FileStream fs = new FileStream(FilePath + "\\" + updatelist[i], FileMode.Create)) { fs.Write(bufferByFile, 1, lenghtByFile - 1); } TxtReceiveAddContent("文件接收成功:" + updatelist[i]); } } #endregion #region 循环删除指定文件 for (int i = 0; i < deletelist.Count; i++) { try { string path = AppDomain.CurrentDomain.BaseDirectory + "\\WebFile\\" + deletelist[i]; File.Delete(path); TxtReceiveAddContent("删除文件[" + deletelist[i] + "]成功"); } catch (Exception) { TxtReceiveAddContent("删除文件[" + deletelist[i] + "]失败"); continue; } } #endregion } catch (Exception ex) { File.Move(Newpath, Oldpath);//连接失败,还原文件名 MessageBox.Show(ex.ToString()); throw; } ``` 调试在客户端进循环的时候服务端侦听不到了 刚接触socket,多谢大佬们解答
发送端TCP的发送缓存设置为10K, 接收端接收缓存设置为10K,接收端一直不调用RECV去接收,那么发送端到底能发送出多少数据?
1. 编写TCP server和Client程序 2. server端在accept之前调用setsockopt(slisten, SOL_SOCKET, SO_RCVBUF,(char*)&uiRcvBuf, uiRcvBufLen);将接收缓存设置为10K. 3. cleint端在bind之前调用setsockopt(slisten, SOL_SOCKET, SO_SNDBUF,(char*)&uiSendBuf, uiSendBufLen);将发送缓存设置为10K 4. cleint端调用send函数发送,相关代码如下: ``` int n = 50; char sendData[1024]; int len = sizeof(sendData); printf("sendlen = %u",len); for (int i = 0;i < len; i++) { sendData[i] = 0x01; } while (n) { int iResult = send(sclient, sendData, len, 0 ); if (iResult == SOCKET_ERROR) { printf("send failed with error: %d\n", WSAGetLastError()); getchar(); closesocket(sclient); WSACleanup(); return 1; } n--; printf("Bytes Sent: %d,%d\n", iResult,50-n); } ``` 5. server端不调用recv函数接收 7. wireshark抓包显示如下: ![图片说明](https://img-ask.csdn.net/upload/201912/19/1576743174_639138.jpg) 8. cleint测试端发送了30k数据后停住了(send是阻塞式) **疑问:** 1. wireshark图中为什么在第一个红色框图的时候win才开始变化(win从10240变成7736)?这之前的数据是存在哪里的?不是接收缓存?不应该从接收第一个包开始就开始减少吗? 2. wireshark图中第一个红色框图为什么会有大于20k的数据(ack=21049)? 3. 为什么从wireshark看到server接收了20k多的数据,而不是10k? 4. cleint端为什么能够send出30k数据才停下来?
内网的dns 负载均衡 改怎么做?
有个服务,想多部署几台,由于访问的时候是一个域名下的,所以想弄成dns智能负载均衡, 但是bind9 没有健康监测,智能是轮询的;有没有其他的方式,或者有没有知道coreDNS 有这个功能吗?
相见恨晚的超实用网站
搞学习 知乎:www.zhihu.com 简答题:http://www.jiandati.com/ 网易公开课:https://open.163.com/ted/ 网易云课堂:https://study.163.com/ 中国大学MOOC:www.icourse163.org 网易云课堂:study.163.com 哔哩哔哩弹幕网:www.bilibili.com 我要自学网:www.51zxw
花了20分钟,给女朋友们写了一个web版群聊程序
参考博客 [1]https://www.byteslounge.com/tutorials/java-ee-html5-websocket-example
爬虫福利二 之 妹子图网MM批量下载
爬虫福利一:27报网MM批量下载    点击 看了本文,相信大家对爬虫一定会产生强烈的兴趣,激励自己去学习爬虫,在这里提前祝:大家学有所成! 目标网站:妹子图网 环境:Python3.x 相关第三方模块:requests、beautifulsoup4 Re:各位在测试时只需要将代码里的变量 path 指定为你当前系统要保存的路径,使用 python xxx.py 或IDE运行即可。
字节跳动视频编解码面经
引言 本文主要是记录一下面试字节跳动的经历。 三四月份投了字节跳动的实习(图形图像岗位),然后hr打电话过来问了一下会不会opengl,c++,shador,当时只会一点c++,其他两个都不会,也就直接被拒了。 七月初内推了字节跳动的提前批,因为内推没有具体的岗位,hr又打电话问要不要考虑一下图形图像岗,我说实习投过这个岗位不合适,不会opengl和shador,然后hr就说秋招更看重基础。我当时
开源一个功能完整的SpringBoot项目框架
福利来了,给大家带来一个福利。 最近想了解一下有关Spring Boot的开源项目,看了很多开源的框架,大多是一些demo或者是一个未成形的项目,基本功能都不完整,尤其是用户权限和菜单方面几乎没有完整的。 想到我之前做的框架,里面通用模块有:用户模块,权限模块,菜单模块,功能模块也齐全了,每一个功能都是完整的。 打算把这个框架分享出来,供大家使用和学习。 为什么用框架? 框架可以学习整体
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过
Python——画一棵漂亮的樱花树(不同种樱花+玫瑰+圣诞树喔)
最近翻到一篇知乎,上面有不少用Python(大多是turtle库)绘制的树图,感觉很漂亮,我整理了一下,挑了一些我觉得不错的代码分享给大家(这些我都测试过,确实可以生成喔~) one 樱花树 动态生成樱花 效果图(这个是动态的): 实现代码 import turtle as T import random import time # 画樱花的躯干(60,t) def Tree(branch
深深的码丨Java HashMap 透析
HashMap 相关概念 HashTab、HashMap、TreeMap 均以键值对像是存储或操作数据元素。HashTab继承自Dictionary,HashMap、TreeMap继承自AbstractMap,三者均实现Map接口 **HashTab:**同步哈希表,不支持null键或值,因为同步导致性能影响,很少被使用 **HashMap:**应用较多的非同步哈希表,支持null键或值,是键值对...
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...
linux系列之常用运维命令整理笔录
本博客记录工作中需要的linux运维命令,大学时候开始接触linux,会一些基本操作,可是都没有整理起来,加上是做开发,不做运维,有些命令忘记了,所以现在整理成博客,当然vi,文件操作等就不介绍了,慢慢积累一些其它拓展的命令,博客不定时更新 顺便拉下票,我在参加csdn博客之星竞选,欢迎投票支持,每个QQ或者微信每天都可以投5票,扫二维码即可,http://m234140.nofollow.ax.
Python 基础(一):入门必备知识
目录1 标识符2 关键字3 引号4 编码5 输入输出6 缩进7 多行8 注释9 数据类型10 运算符10.1 常用运算符10.2 运算符优先级 1 标识符 标识符是编程时使用的名字,用于给变量、函数、语句块等命名,Python 中标识符由字母、数字、下划线组成,不能以数字开头,区分大小写。 以下划线开头的标识符有特殊含义,单下划线开头的标识符,如:_xxx ,表示不能直接访问的类属性,需通过类提供
程序员接私活怎样防止做完了不给钱?
首先跟大家说明一点,我们做 IT 类的外包开发,是非标品开发,所以很有可能在开发过程中会有这样那样的需求修改,而这种需求修改很容易造成扯皮,进而影响到费用支付,甚至出现做完了项目收不到钱的情况。 那么,怎么保证自己的薪酬安全呢? 我们在开工前,一定要做好一些证据方面的准备(也就是“讨薪”的理论依据),这其中最重要的就是需求文档和验收标准。一定要让需求方提供这两个文档资料作为开发的基础。之后开发
网页实现一个简单的音乐播放器(大佬别看。(⊙﹏⊙))
今天闲着无事,就想写点东西。然后听了下歌,就打算写个播放器。 于是乎用h5 audio的加上js简单的播放器完工了。 欢迎 改进 留言。 演示地点跳到演示地点 html代码如下`&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;music&lt;/title&gt; &lt;meta charset="utf-8"&gt
Python十大装B语法
Python 是一种代表简单思想的语言,其语法相对简单,很容易上手。不过,如果就此小视 Python 语法的精妙和深邃,那就大错特错了。本文精心筛选了最能展现 Python 语法之精妙的十个知识点,并附上详细的实例代码。如能在实战中融会贯通、灵活使用,必将使代码更为精炼、高效,同时也会极大提升代码B格,使之看上去更老练,读起来更优雅。 1. for - else 什么?不是 if 和 else 才
数据库优化 - SQL优化
前面一篇文章从实例的角度进行数据库优化,通过配置一些参数让数据库性能达到最优。但是一些“不好”的SQL也会导致数据库查询变慢,影响业务流程。本文从SQL角度进行数据库优化,提升SQL运行效率。 判断问题SQL 判断SQL是否有问题时可以通过两个表象进行判断: 系统级别表象 CPU消耗严重 IO等待严重 页面响应时间过长
2019年11月中国大陆编程语言排行榜
2019年11月2日,我统计了某招聘网站,获得有效程序员招聘数据9万条。针对招聘信息,提取编程语言关键字,并统计如下: 编程语言比例 rank pl_ percentage 1 java 33.62% 2 c/c++ 16.42% 3 c_sharp 12.82% 4 javascript 12.31% 5 python 7.93% 6 go 7.25% 7
通俗易懂地给女朋友讲:线程池的内部原理
餐厅的约会 餐盘在灯光的照耀下格外晶莹洁白,女朋友拿起红酒杯轻轻地抿了一小口,对我说:“经常听你说线程池,到底线程池到底是个什么原理?”我楞了一下,心里想女朋友今天是怎么了,怎么突然问出这么专业的问题,但做为一个专业人士在女朋友面前也不能露怯啊,想了一下便说:“我先给你讲讲我前同事老王的故事吧!” 大龄程序员老王 老王是一个已经北漂十多年的程序员,岁数大了,加班加不动了,升迁也无望,于是拿着手里
经典算法(5)杨辉三角
杨辉三角 是经典算法,这篇博客对它的算法思想进行了讲解,并有完整的代码实现。
腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹?
昨天,有网友私信我,说去阿里面试,彻底的被打击到了。问了为什么网上大量使用ThreadLocal的源码都会加上private static?他被难住了,因为他从来都没有考虑过这个问题。无独有偶,今天笔者又发现有网友吐槽了一道腾讯的面试题,我们一起来看看。 腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹? 在互联网职场论坛,一名程序员发帖求助到。二面腾讯,其中一个算法题:64匹
面试官:你连RESTful都不知道我怎么敢要你?
面试官:了解RESTful吗? 我:听说过。 面试官:那什么是RESTful? 我:就是用起来很规范,挺好的 面试官:是RESTful挺好的,还是自我感觉挺好的 我:都挺好的。 面试官:… 把门关上。 我:… 要干嘛?先关上再说。 面试官:我说出去把门关上。 我:what ?,夺门而去 文章目录01 前言02 RESTful的来源03 RESTful6大原则1. C-S架构2. 无状态3.统一的接
JDK12 Collectors.teeing 你真的需要了解一下
前言 在 Java 12 里面有个非常好用但在官方 JEP 没有公布的功能,因为它只是 Collector 中的一个小改动,它的作用是 merge 两个 collector 的结果,这句话显得很抽象,老规矩,我们先来看个图(这真是一个不和谐的图????): 管道改造经常会用这个小东西,通常我们叫它「三通」,它的主要作用就是将 downstream1 和 downstre...
为啥国人偏爱Mybatis,而老外喜欢Hibernate/JPA呢?
关于SQL和ORM的争论,永远都不会终止,我也一直在思考这个问题。昨天又跟群里的小伙伴进行了一番讨论,感触还是有一些,于是就有了今天这篇文。 声明:本文不会下关于Mybatis和JPA两个持久层框架哪个更好这样的结论。只是摆事实,讲道理,所以,请各位看官勿喷。 一、事件起因 关于Mybatis和JPA孰优孰劣的问题,争论已经很多年了。一直也没有结论,毕竟每个人的喜好和习惯是大不相同的。我也看
项目中的if else太多了,该怎么重构?
介绍 最近跟着公司的大佬开发了一款IM系统,类似QQ和微信哈,就是聊天软件。我们有一部分业务逻辑是这样的 if (msgType = "文本") { // dosomething } else if(msgType = "图片") { // doshomething } else if(msgType = "视频") { // doshomething } else { // doshom...
致 Python 初学者
欢迎来到“Python进阶”专栏!来到这里的每一位同学,应该大致上学习了很多 Python 的基础知识,正在努力成长的过程中。在此期间,一定遇到了很多的困惑,对未来的学习方向感到迷茫。我非常理解你们所面临的处境。我从2007年开始接触 python 这门编程语言,从2009年开始单一使用 python 应对所有的开发工作,直至今天。回顾自己的学习过程,也曾经遇到过无数的困难,也曾经迷茫过、困惑过。开办这个专栏,正是为了帮助像我当年一样困惑的 Python 初学者走出困境、快速成长。希望我的经验能真正帮到你
“狗屁不通文章生成器”登顶GitHub热榜,分分钟写出万字形式主义大作
一、垃圾文字生成器介绍 最近在浏览GitHub的时候,发现了这样一个骨骼清奇的雷人项目,而且热度还特别高。 项目中文名:狗屁不通文章生成器 项目英文名:BullshitGenerator 根据作者的介绍,他是偶尔需要一些中文文字用于GUI开发时测试文本渲染,因此开发了这个废话生成器。但由于生成的废话实在是太过富于哲理,所以最近已经被小伙伴们给玩坏了。 他的文风可能是这样的: 你发现,...
程序员:我终于知道post和get的区别
是一个老生常谈的话题,然而随着不断的学习,对于以前的认识有很多误区,所以还是需要不断地总结的,学而时习之,不亦说乎
《程序人生》系列-这个程序员只用了20行代码就拿了冠军
你知道的越多,你不知道的越多 点赞再看,养成习惯GitHub上已经开源https://github.com/JavaFamily,有一线大厂面试点脑图,欢迎Star和完善 前言 这一期不算《吊打面试官》系列的,所有没前言我直接开始。 絮叨 本来应该是没有这期的,看过我上期的小伙伴应该是知道的嘛,双十一比较忙嘛,要值班又要去帮忙拍摄年会的视频素材,还得搞个程序员一天的Vlog,还要写BU...
加快推动区块链技术和产业创新发展,2019可信区块链峰会在京召开
11月8日,由中国信息通信研究院、中国通信标准化协会、中国互联网协会、可信区块链推进计划联合主办,科技行者协办的2019可信区块链峰会将在北京悠唐皇冠假日酒店开幕。   区块链技术被认为是继蒸汽机、电力、互联网之后,下一代颠覆性的核心技术。如果说蒸汽机释放了人类的生产力,电力解决了人类基本的生活需求,互联网彻底改变了信息传递的方式,区块链作为构造信任的技术有重要的价值。   1...
程序员把地府后台管理系统做出来了,还有3.0版本!12月7号最新消息:已在开发中有github地址
第一幕:缘起 听说阎王爷要做个生死簿后台管理系统,我们派去了一个程序员…… 996程序员做的梦: 第一场:团队招募 为了应对地府管理危机,阎王打算找“人”开发一套地府后台管理系统,于是就在地府总经办群中发了项目需求。 话说还是中国电信的信号好,地府都是满格,哈哈!!! 经常会有外行朋友问:看某网站做的不错,功能也简单,你帮忙做一下? 而这次,面对这样的需求,这个程序员...
相关热词 c# 输入ip c# 乱码 报表 c#选择结构应用基本算法 c# 收到udp包后回包 c#oracle 头文件 c# 序列化对象 自定义 c# tcp 心跳 c# ice连接服务端 c# md5 解密 c# 文字导航控件
立即提问