一个异常大佬来看看啊

十一月 29, 2017 2:53:14 下午 com.microsoft.sqlserver.jdbc.TDSChannel enableSSL
信息: java.security path: D:\Java\jdk1.8.0_121\jre\lib\security
Security providers: [SUN version 1.8, SunRsaSign version 1.8, SunEC version 1.8, SunJSSE version 1.8, SunJCE version 1.8, SunJGSS version 1.8, SunSASL version 1.8, XMLDSig version 1.8, SunPCSC version 1.8, SunMSCAPI version 1.8]
SSLContext provider info: Sun JSSE provider(PKCS12, SunX509/PKIX key/trust factories, SSLv3/TLSv1/TLSv1.1/TLSv1.2)
SSLContext provider services:
[SunJSSE: KeyFactory.RSA -> sun.security.rsa.RSAKeyFactory
aliases: [1.2.840.113549.1.1, OID.1.2.840.113549.1.1]
, SunJSSE: KeyPairGenerator.RSA -> sun.security.rsa.RSAKeyPairGenerator
aliases: [1.2.840.113549.1.1, OID.1.2.840.113549.1.1]
, SunJSSE: Signature.MD2withRSA -> sun.security.rsa.RSASignature$MD2withRSA
aliases: [1.2.840.113549.1.1.2, OID.1.2.840.113549.1.1.2]
, SunJSSE: Signature.MD5withRSA -> sun.security.rsa.RSASignature$MD5withRSA
aliases: [1.2.840.113549.1.1.4, OID.1.2.840.113549.1.1.4]
, SunJSSE: Signature.SHA1withRSA -> sun.security.rsa.RSASignature$SHA1withRSA
aliases: [1.2.840.113549.1.1.5, OID.1.2.840.113549.1.1.5, 1.3.14.3.2.29, OID.1.3.14.3.2.29]
, SunJSSE: Signature.MD5andSHA1withRSA -> sun.security.ssl.RSASignature
, SunJSSE: KeyManagerFactory.SunX509 -> sun.security.ssl.KeyManagerFactoryImpl$SunX509
, SunJSSE: KeyManagerFactory.NewSunX509 -> sun.security.ssl.KeyManagerFactoryImpl$X509
aliases: [PKIX]
, SunJSSE: TrustManagerFactory.SunX509 -> sun.security.ssl.TrustManagerFactoryImpl$SimpleFactory
, SunJSSE: TrustManagerFactory.PKIX -> sun.security.ssl.TrustManagerFactoryImpl$PKIXFactory
aliases: [SunPKIX, X509, X.509]
, SunJSSE: SSLContext.TLSv1 -> sun.security.ssl.SSLContextImpl$TLS10Context
aliases: [SSLv3]
, SunJSSE: SSLContext.TLSv1.1 -> sun.security.ssl.SSLContextImpl$TLS11Context
, SunJSSE: SSLContext.TLSv1.2 -> sun.security.ssl.SSLContextImpl$TLS12Context
, SunJSSE: SSLContext.TLS -> sun.security.ssl.SSLContextImpl$TLSContext
aliases: [SSL]
, SunJSSE: SSLContext.Default -> sun.security.ssl.SSLContextImpl$DefaultSSLContext
, SunJSSE: KeyStore.PKCS12 -> sun.security.pkcs12.PKCS12KeyStore
]
java.ext.dirs: D:\Java\jdk1.8.0_121\jre\lib\ext;C:\Windows\Sun\Java\lib\ext
2017-11-29 14:53:14 [ERROR] -com.zhwy.dao.BaseDao.listEntity(BaseDao.java:161)
查询实体出错:sql语句:SELECT id,disasterName,disasterCode FROM ZaiQing_DisasterType
org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (驱动程序无法通过使用安全套接字层(SSL)加密与 SQL Server 建立安全连接。错误:“Connection reset by peer: socket write error ClientConnectionId:966610ce-9b7d-49b7-8a3d-d02bf9506918”。)
at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:80)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:394)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:474)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:484)
at com.zhwy.dao.BaseDao.listEntity(BaseDao.java:157)
at com.zhwy.dao.impl.DisasterTypeDaoImpl.listDisasterType(DisasterTypeDaoImpl.java:41)
at com.zhwy.service.impl.DisasterTypeServiceImpl.listDisasterType(DisasterTypeServiceImpl.java:21)
at com.zhwy.controller.ZaiQingShaiXuanController.zaiQingShaiXuan(ZaiQingShaiXuanController.java:30)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:876)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:618)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1790)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (驱动程序无法通过使用安全套接字层(SSL)加密与 SQL Server 建立安全连接。错误:“Connection reset by peer: socket write error ClientConnectionId:966610ce-9b7d-49b7-8a3d-d02bf9506918”。)
at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111)
at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77)
... 40 more
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: 驱动程序无法通过使用安全套接字层(SSL)加密与 SQL Server 建立安全连接。错误:“Connection reset by peer: socket write error ClientConnectionId:966610ce-9b7d-49b7-8a3d-d02bf9506918”。
at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:1667)
at com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL(IOBuffer.java:1668)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1323)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:991)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:827)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:1012)
at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556)
at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545)
... 44 more
Caused by: java.io.IOException: Connection reset by peer: socket write error ClientConnectionId:966610ce-9b7d-49b7-8a3d-d02bf9506918
at com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeInputStream.ensureSSLPayload(IOBuffer.java:638)
at com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeInputStream.readInternal(IOBuffer.java:708)
at com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeInputStream.read(IOBuffer.java:700)
at com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream.readInternal(IOBuffer.java:895)
at com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream.read(IOBuffer.java:883)
at sun.security.ssl.InputRecord.readFully(InputRecord.java:465)
at sun.security.ssl.InputRecord.read(InputRecord.java:503)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)
at com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL(IOBuffer.java:1618)
... 52 more
请大佬告诉我这个怎么解决 度娘googel都找不到办法

2个回答

看看你数据库连接咋配置的,贴出来

 <context:property-placeholder location="classpath:database.properties"/>
 <bean id="dataSource" destroy-method="close" class="org.apache.commons.dbcp.BasicDataSource">
    <property name="driverClassName" value="${sql.driverclass}" />
    <property name="url" value="${sql.jdbcurl}" />
    <property name="username" value="${sql.username}" />
    <property name="password" value="${sql.password}" />
    <!-- 连接初始值,连接池启动时创建的连接数量 -->
    <property name="initialSize" value="20"></property>
    <!-- 最大连接数量 -->
    <property name="maxActive" value="100"></property>
    <!-- 最大的空闲值-->
    <property name="maxIdle" value="50"></property>
    <!-- 最小的空闲值 -->
    <property name="minIdle" value="30"></property>
 </bean>

 <!-- <bean id="simpleJdbcTemplate" class="org.springframework.jdbc.core.simple.SimpleJdbcTemplate">
    <constructor-arg><ref bean="dataSource"/></constructor-arg>
 </bean>  -->

 <!-- 看了spring源码,该 org.springframework.jdbc.core.JdbcTemplate类的继承类有dataSource属性,所以可以属性注入-->
 <bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
     <property name="dataSource">
         <ref bean="dataSource"/>
     </property>
 </bean>

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
请大佬看一下这个c++异常处理程序段存在什么问题

![图片说明](https://img-ask.csdn.net/upload/202005/12/1589291930_665698.png) ![图片说明](https://img-ask.csdn.net/upload/202005/12/1589291877_323620.png) 最上面那个程序段,是在tmp = tmp.toNext()抛出异常的,然后catch到之后会打印出信息,但是catch到之后就会报错跳转到xmemory界面,如果在trycatch后面加上那段do while,则会不停的打印e.what(),请大佬帮忙看一下是什么问题。怎么在捕获异常的时候终止返回,

求助大佬帮忙看看这个汇编程序会得到哪6个数字

![图片说明](https://img-ask.csdn.net/upload/201709/03/1504451481_555691.png)

java.lang.IllegalArgumentException: Filter must not be null异常,有大佬帮忙看看是啥问题吗?

Caused by: org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to start embedded Tomcat at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.initialize(TomcatEmbeddedServletContainer.java:138) at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.<init>(TomcatEmbeddedServletContainer.java:87) at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getTomcatEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:554) at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:179) at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:164) at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:134) ... 8 more Caused by: java.lang.IllegalArgumentException: Filter must not be null at org.springframework.util.Assert.notNull(Assert.java:134) at org.springframework.boot.web.servlet.AbstractFilterRegistrationBean.onStartup(AbstractFilterRegistrationBean.java:219) at org.springframework.boot.web.servlet.FilterRegistrationBean.onStartup(FilterRegistrationBean.java:42) at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.selfInitialize(EmbeddedWebApplicationContext.java:229) at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.access$000(EmbeddedWebApplicationContext.java:89) at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext$1.onStartup(EmbeddedWebApplicationContext.java:213) at org.springframework.boot.context.embedded.tomcat.TomcatStarter.onStartup(TomcatStarter.java:55) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5204) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1421) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1411) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)

ssm框架整合出现的创建Bean失败,说是springmvc抛出的异常,大佬们看一下怎么解决

javax.servlet.ServletException: Servlet.init() for servlet springmvc threw exception org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528) org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1099) org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672) org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2508) org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2497) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) java.lang.Thread.run(Thread.java:745) root cause org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ceshi': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.lzh.dao.ClassifyDao com.lzh.serlvet.ceshi.classifyDao; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.lzh.dao.ClassifyDao] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:305) org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:301) org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:196) org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772) org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:834) org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:537) org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:667) org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:633) org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:681) org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:552) org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:493) org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136) javax.servlet.GenericServlet.init(GenericServlet.java:158) org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528) org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1099) org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672) org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2508) org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2497) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) java.lang.Thread.run(Thread.java:745) root cause org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.lzh.dao.ClassifyDao com.lzh.serlvet.ceshi.classifyDao; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.lzh.dao.ClassifyDao] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:571) org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88) org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:305) org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:301) org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:196) org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772) org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:834) org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:537) org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:667) org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:633) org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:681) org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:552) org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:493) org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136) javax.servlet.GenericServlet.init(GenericServlet.java:158) org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528) org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1099) org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672) org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2508) org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2497) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) java.lang.Thread.run(Thread.java:745) root cause org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.lzh.dao.ClassifyDao] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:1326) org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1072) org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:967) org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:543) org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88) org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:305) org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:301) org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:196) org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772) org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:834) org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:537) org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:667) org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:633) org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:681) org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:552) org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:493) org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)![图片说明](https://img-ask.csdn.net/upload/201905/23/1558609129_236690.png) javax.servlet.GenericServlet.init(GenericServlet.java:158) org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528) org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1099) org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672) org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2508) org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2497) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) java.lang.Thread.run(Thread.java:745)

大佬来帮我看看这个警告是怎么产生的!

while ((lineTxt = bufferedReader.readLine()) != null) { total_cnt++; if(!Common.columnInfo || total_cnt > 1){ Common.getCount("+"); } if (!Common.columnInfo) { // 第一行为非列信息 Common.WriteThreadErrorLog(current_thd, Common.tableName + "表对应的数据文件 " + filePath + " 必须首行包含表列信息!"); break; } if(total_cnt != 1 && total_cnt <= row){ continue; } data = lineTxt.split(Common.colSplit); insertdata = new String[Common.qxAssemblyField.length + data.length]; String sql = ""; if (total_cnt == 1) { dataidx = new String[insertdata.length]; /********************************** 查找表字段对应的文本字段 *****************************************/ /******************************************组装字段整理*******************************************/ for (int i = 0; i < Common.qxAssemblyField.length; i++) { for (int j = 0; j < col.size(); j++) { if (Common.qxAssemblyField[i].equalsIgnoreCase(col.get(j).get(0))) { dataidx[textCol.size()] = "-1"; textCol.add(col.get(j)); break; } } } /*****************************************文件表列信息*********************************************/ for (int i = 0; i < data.length; i++) { boolean findFileColumn = false; for (int j = 0; j < col.size(); j++) { if (data[i].equalsIgnoreCase(col.get(j).get(0))) { dataidx[textCol.size()] = Integer.toString(i); textCol.add(col.get(j)); findFileColumn = true; break; } } if(!findFileColumn){ Common.WriteThreadErrorLog(current_thd, "数据文件:" + filePath + "中,列:" + data[i] + " 在表" + Common.tableName + "中未定义!"); success = false; } } if(!success){ return success; } /****************************** 组装执行Prepare语句 ********************************/ aimSql = new StringBuffer(); aimSql.append("insert into " + Common.tableName + "("); for (int i = 0; i < textCol.size(); i++) { aimSql.append(textCol.get(i).get(0)); if (i != (textCol.size() - 1)) { aimSql.append(","); } } aimSql.append(") values("); for (int i = 0; i < textCol.size(); i++) { aimSql.append("?"); if (i != (textCol.size() - 1)) { aimSql.append(","); } } aimSql.append(")"); pstmt_aim = conn.prepareStatement(aimSql.toString()); } else { /********************************** 取组装字段值 *****************************************/ for (int i = 0; i < Common.qxAssemblyField.length; i++) { String assembData = Common.properties.getProperty(Common.tableName + "." + Common.qxAssemblyField[i]); if (assembData.contains("[")) { String[] idx = assembData.substring(assembData.indexOf("[") + 1, assembData.indexOf("]")).split(","); String strParameter = assembData.substring(assembData.indexOf("]") + 1); String[] paraType = null; if (strParameter.contains("[")) paraType = strParameter.substring(strParameter.indexOf("[") + 1, strParameter.indexOf("]")).split(","); if (idx[0].equals("")) { parameters = new String[paraType.length]; messageFormat = new MessageFormat(assembData.substring(assembData.lastIndexOf("]") + 1)); for (int m = 0; m < paraType.length; m++) { Statement st = conn.createStatement(); sql = "select " + paraType[m] + " from dual"; ResultSet rs = st.executeQuery(sql); while (rs.next()) { parameters[m] = rs.getString(1); } rs.close(); st.close(); } insertdata[i] = messageFormat.format(parameters); } else { parameters = new String[idx.length]; messageFormat = new MessageFormat(assembData.substring(assembData.lastIndexOf("]") + 1)); for (int m = 0; m < idx.length; m++) { if (paraType != null && m < paraType.length && paraType[m].contains("%")) { parameters[m] = String.format(paraType[m], Integer.parseInt(data[Integer.parseInt(idx[m])].trim())); } else { parameters[m] = data[Integer.parseInt(idx[m])].trim(); } } insertdata[i] = messageFormat.format(parameters); } } else { insertdata[i] = assembData; } } /********************************** 取文本字段值 *****************************************/ if(insertdata.length != dataidx.length){ Common.WriteThreadErrorLog(current_thd, "目标表(" + Common.tableName + ")数据录入过程中产生数据组装异常!位置:" + filePath + ",行:" + total_cnt + ",错误信息:当前行数据量与首行列字段数不一致!"); chktxtdata = false; } for (int i = Common.qxAssemblyField.length; i < dataidx.length; i++) { insertdata[i] = data[Integer.parseInt(dataidx[i])]; } // 设置数据参数 if (chktxtdata) { exec_str = insertTabByPst(pstmt_aim, insertdata, textCol); if(exec_str.equals("OK")){ insert_cnt ++; } else { err_cnt++; Common.WriteThreadErrorLog(current_thd, "目标表(" + Common.tableName + ")数据录入过程中产生SQL异常!位置:" + filePath + ",行:" + total_cnt + ",错误信息:" + exec_str); } } else { err_cnt++; } } // 提交数据 if ((total_cnt % Common.commit) == 0 && total_cnt > 1) { try { pstmt_aim.executeQuery(); PropertiesUtil.InsertOrUpdate(filePath, String.valueOf(total_cnt), pro,path); conn.commit(); } catch (SQLException e) { Common.WriteThreadErrorLog(current_thd, "目标表(" + Common.tableName + ")数据录入过程中产生COMMIT异常!位置:" + filePath + ",行:" + (total_cnt-Common.commit+1)+"——" + total_cnt + ",错误信息:" + e.getMessage()); } } } bufferedReader.close(); read.close(); 产生的警告为Resource leak: 'bufferedReader' is never closed

#Java web#麻烦大佬帮我看一下,出现下面异常的问题是什么啊

``` HTTP Status 500 - An exception occurred processing JSP page /Admin/adminUser.jsp at line 38 type Exception report message An exception occurred processing JSP page /Admin/adminUser.jsp at line 38 description The server encountered an internal error that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: An exception occurred processing JSP page /Admin/adminUser.jsp at line 38 35: </tr> 36: <tr> 37: <td height="30" align="center"> 38: <display:table name="admin" id="row" pagesize="15" export="true" class="displaytag" requestURI="/Admin/admin.do?method=browseAdmin" > 39: <display:column property="adminName" title="${label1}" sortable="true" headerClass="sortable" style="text-align:center;"/> 40: <display:column property="loginName" title="${label2}" sortable="true" headerClass="sortable" style="text-align:center;"/> 41: <display:column property="adminType" title="${label3}" sortable="true" headerClass="sortable" style="text-align:center;"/> ```

大佬,帮我看看数据库连接问题

springboot连接sqlserver,测试数据库是通的,连接地址里含有SQLEXPRESS,编译打包时报错,怎么办 ![图片说明](https://img-ask.csdn.net/upload/201811/07/1541561120_779431.png) ![![图片说明](https://img-ask.csdn.net/upload/201811/07/1541561141_165496.png) ![![图片说明](https://img-ask.csdn.net/upload/201811/07/1541561135_929636.png)

大佬帮我看看为什么不行

package youxi; import java.awt.BorderLayout; import java.awt.ComponentOrientation; import java.awt.Container; import java.awt.FlowLayout; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.GridLayout; import javax.swing.JButton; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JSplitPane; import javax.swing.JTextArea; import javax.swing.JToggleButton; import javax.swing.UIManager; import javax.swing.plaf.nimbus.NimbusLookAndFeel; public class ChatFrame { /**** 改变 GUI 的观感(LookAndFeel),请自行查阅相关 API 文档 ****/ static { try { UIManager.setLookAndFeel(NimbusLookAndFeel.class.getName()); } catch(Exception e) { // 上行调用的 API 可能抛出异常(具体见第 9 章) System.out.println("不支持的观感"); System.exit(-1); } } public static void main(String[] args) { new ChatFrame().init(); } void init() { BaseFrame f = new BaseFrame("仿 QQ 聊天窗口"); /**** 向窗口添加 2 个子面板 ****/ JPanel topPan = new JPanel(); // 外层顶部面板 JPanel centerPan = new JPanel(); // 外层中间面板 f.setLayout(new BorderLayout()); // 窗口用边框布局 f.add(topPan, BorderLayout.NORTH); f.add(centerPan, BorderLayout.CENTER); /**** 向顶部面板添加 3 个子面板 ****/ topPan.setLayout(new GridBagLayout()); // 顶部面板用网格包布局 JLabel faceLab = new JLabel( ImageFactory.create("face.png"));// 头像 JLabel nameLab = new JLabel("昵称"); // 昵称 // 顶部面板中的图标栏 JPanel topToolPan = new JPanel(new FlowLayout(FlowLayout.LEFT, 10, 10)); GridBagConstraints c = new GridBagConstraints(); c.gridx = c.gridy = 0; // 左上角网格 c.gridheight = 2; // 头像占 2 行 topPan.add(faceLab, c); // 添加头像 c.gridx = 1; // 昵称所在网格 c.gridy = 0; c.gridheight = 1; // 之前该字段为 2 c.weightx = 1.0; // 获得全部的水平方向改变量 c.fill = GridBagConstraints.HORIZONTAL; // 只改变水平大小 topPan.add(nameLab, c); // 添加昵称 c.gridx = c.gridy = 1; // 顶部面板中的图标栏所在网格 topPan.add(topToolPan, c); /**** 向外层顶部面板中的图标栏添加若干按钮 ****/ JButton[] topBtns = new JButton[5]; for (int i = 0; i < topBtns.length; i++) { topBtns[i] = new JButton(ImageFactory.create( (i + 1) + ".png")); topBtns[i].setBorder(null); topBtns[i].setContentAreaFilled(false); topToolPan.add(topBtns[i]); } /**** 向外层中间面板添加 2 个子面板 ****/ centerPan.setLayout(new BorderLayout()); // 外层中间面板的中间子面板(为分割面板) JSplitPane centerCenterPan = new JSplitPane(JSplitPane.VERTICAL_SPLIT); JPanel centerRightPan = new JPanel(); // 外层中间面板的右侧子面板 centerPan.add(centerCenterPan, BorderLayout.CENTER); centerPan.add(centerRightPan, BorderLayout.EAST); /**** 向分割面板添加 2 个子面板 ****/ JPanel centerTopPan = new JPanel(); // 分割面板上部 JPanel centerBottomPan = new JPanel(); // 分割面板下部 centerCenterPan.setResizeWeight(1.0); // 下部高度不变 centerCenterPan.setTopComponent(centerTopPan); centerCenterPan.setBottomComponent(centerBottomPan); /**** 向分割面板上部添加 2 个子组件 ****/ centerTopPan.setLayout(new BorderLayout()); JLabel tipLab = new JLabel("交谈中请勿轻信汇款信息。"); // 提示标签 JScrollPane historyPan = new JScrollPane(new JTextArea("消息历史记录...")); centerTopPan.add(tipLab, BorderLayout.NORTH); centerTopPan.add(historyPan, BorderLayout.CENTER); /**** 向分割面板下部添加 3 个子组件 ****/ centerBottomPan.setLayout(new BorderLayout()); JPanel centerToolPan = new JPanel(); // 工具栏 JScrollPane chatPan = new JScrollPane(new JTextArea("聊天消息...")); JPanel btnsPan = new JPanel(); // 2 个按钮所在的面板 centerBottomPan.add(centerToolPan, BorderLayout.NORTH); centerBottomPan.add(chatPan, BorderLayout.CENTER); centerBottomPan.add(btnsPan, BorderLayout.SOUTH); /**** 向分割面板下部的工具栏添加 2 个子组件 ****/ centerToolPan.setLayout(new BorderLayout()); JPanel p = new JPanel(new FlowLayout(FlowLayout.LEFT, 10, 10)); // 放置若干按钮 JButton[] centerBtns = new JButton[5]; for (int i = 0; i < centerBtns.length; i++) { centerBtns[i] = new JButton(ImageFactory.create((i + 1) + ".png")); centerBtns[i].setBorder(null); centerBtns[i].setContentAreaFilled(false); p.add(centerBtns[i]); // 添加按钮 } centerToolPan.add(p, BorderLayout.CENTER); centerToolPan.add(new JToggleButton("消息记录"), BorderLayout.EAST); /**** 向分割面板下部的按钮面板添加按钮 ****/ btnsPan.setLayout(new FlowLayout(FlowLayout.RIGHT)); // 右对齐的流式布局 btnsPan.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); // 组件从右到左 btnsPan.add(new JButton("发送")); btnsPan.add(new JButton("关闭")); /**** 向外层中间面板的右侧面板添加 2 个子组件 ****/ centerRightPan.setLayout(new GridLayout(2, 1)); // 2 行 1 列 JLabel qqShowLab = new JLabel("QQ 秀图片区"); JLabel videoLab = new JLabel("视频聊天区"); centerRightPan.add(qqShowLab); centerRightPan.add(videoLab); f.setSize(600, 400); f.showMe(); centerCenterPan.setDividerLocation(0.4); // 分割面板上下部比例 this.showBorder(f.getContentPane()); // 显示面板等容器的边框 } /**** 为便于观察容器,显示相关容器和组件的边框 ****/ void showBorder(Container p) { /* 省略了相关代码 */ } } package youxi; import javax.swing.ImageIcon; public class ImageFactory { private static final String ROOT = "images/"; private static final ClassLoader LOADER = ImageFactory.class.getClassLoader(); // 根据图片文件名创建图片对象 public static ImageIcon create(String file) { return new ImageIcon(LOADER.getResource(ROOT + file)); } }

C++实现Vector出现错误,哪位大佬看看怎么处理。

我自定义一个MyVector,用来存储任意类型的对象,但我实现的时候出现以下错误,哪位大佬能帮帮我呀?一共三个文件:MyVector.h,MyVector.cpp和main. cpp 1.MyVector.h ``` // // Created by Howard on 2019/7/5. // #ifndef TEST_MYVECTOR_H #define TEST_MYVECTOR_H #endif //TEST_MYVECTOR_H #include <iostream> using namespace std; template<typename T> class MyVector { friend ostream &operator << <T> (ostream &out, const MyVector<T> &obj); // 重载左移<< 右移>> 才将重载函数声明为友元函数 public: MyVector(int size = 0); // 构造函数 MyVector(const MyVector &obj); // 拷贝构造函数 ~MyVector(); // 析构函数 public: T &operator[](int index); MyVector &operator=(const MyVector &obj); public: int getlen() { return m_len; } protected: T *m_space; int m_len; }; ``` 2.MyVector.cpp ``` // // Created by Howard on 2019/7/5. // #include <iostream> using namespace std; #include "MyVector.h" int size = 100; // MyVector<int> myv1(10) template<typename T> MyVector<T>::MyVector(int size) // 构造函数 { m_space = new T[size]; m_len = size; } // MyVector<int> myv2 = myv1 template<typename T> MyVector<T>::MyVector(const MyVector &obj) // 拷贝构造函数 { // 根据myv1的大小分配内存 m_len = obj.m_len; m_space = new T[size]; // cpy数据 for (int i = 0; i < m_len; i++) { m_space[i] = obj[i]; } } template<typename T> MyVector<T>::~MyVector() // 析构函数 { if (m_space != NULL) { delete[] m_space; m_space = NULL; m_len = 0; } } template<typename T> T &MyVector<T>::operator[](int index) { return m_space[index]; } template<typename T> MyVector<T> &MyVector<T>::operator=(const MyVector<T> &obj) { // 先把a2旧的内存释放掉 if (m_space != NULL) { delete[] m_space; m_space = NULL; m_len = 0; } // 根据a1分配内存 m_len = obj.m_len; m_space = new T[size]; // cpy数据 for (int i = 0; i < obj.m_len; i++) { m_space[i] = obj.m_space[i]; } return *this; // a2 = a1 返回给a2的自身 } template<typename T> ostream &operator<< <T>(ostream &out, const MyVector<T> &obj) { for (int i = 0; i < obj.m_len; i++) { out << obj.m_space[i] << " "; } // out << endl; return out; } ``` 3.main.cpp ``` #include <iostream> using namespace std; #include "MyVector.cpp" int main() { MyVector<int> myv1(10); for (int i = 0; i < myv1.getlen(); i++) { myv1[i] = i + 1; cout << myv1[i] << " "; } cout << endl; MyVector<int> myv2 = myv1; for (int i = 0; i < myv2.getlen(); i++) { cout << myv2[i] << " "; } cout << myv2 << endl; system("pause"); return 0; } ``` 运行结果: In file included from F:\code\c++\test\main.cpp:5: F:\code\c++\test\MyVector.cpp:76:61: error: non-class, non-variable partial specialization 'operator<< <T>' is not allowed ostream &operator<< <T>(ostream &out, const MyVector<T> &obj) { ^ F:\code\c++\test\MyVector.cpp:76:61: error: non-class, non-variable partial specialization 'operator<< <T>' is not allowed ostream &operator<< <T>(ostream &out, const MyVector<T> &obj) { ^ In file included from F:\code\c++\test\MyVector.cpp:9, from F:\code\c++\test\main.cpp:5: F:\code\c++\test\MyVector.h: In instantiation of 'class MyVector<int>': F:\code\c++\test\main.cpp:8:23: required from here F:\code\c++\test\MyVector.h:16:21: error: template-id 'operator<< <int>' for 'std::ostream& operator<<(std::ostream&, const MyVector<int>&)' does not match any template declaration friend ostream &operator << <T> (ostream &out, const MyVector<T> &obj); // 閲嶈浇宸︾Щ<< 鍙崇Щ>> 鎵嶅皢閲嶈浇鍑芥暟澹版槑涓哄弸鍏冨嚱鏁� ^~~~~~~~~~~~~~~ In file included from D:/PROGRA~1/JETBRA~1/X86_64~1.0/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/iostream:39, from F:\code\c++\test\main.cpp:1: D:/PROGRA~1/JETBRA~1/X86_64~1.0/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/ostream:682:5: note: candidates are: 'template<class _Ostream, class _Tp> typename std::enable_if<std::__and_<std::__not_<std::is_lvalue_reference<_Tp> >, std::__is_convertible_to_basic_ostream<_Ostream>, std::__is_insertable<typename std::__is_convertible_to_basic_ostream<_Tp>::__ostream_type, const _Tp&, void> >::value, typename std::__is_convertible_to_basic_ostream<_Tp>::__ostream_type>::type std::operator<<(_Ostream&&, const _Tp&)' operator<<(_Ostream&& __os, const _Tp& __x) ^~~~~~~~ ![错误提示](https://img-ask.csdn.net/upload/201907/05/1562337978_764008.png) 谁能告诉我,我哪个地方写错了?

(C语言)在二叉搜索树的学习时遇到了问题,求大佬帮忙看看

如题,在学习二叉搜索树时想要自己添加一些内容,但是不知道为什么就是会出错,自己感觉好像问题出在创建二叉树的地方,但是不知道怎么改.希望大佬能帮忙看看,如果能配上讲解就更好了,感谢. 下面贴上代码,之后是罗列的一些问题,如果代码中还有问题希望大佬能指点下我,谢谢: 项目总共三个文件,二叉搜索树头文件.h和.c文件,然后一个用于测试的主函数.c (二叉搜索树头文件) BSTree.h ``` #ifndef BSTREE_H #define BSTREE_H typedef int DataType; //二叉排序树节点定义 struct BinSearchTreeNode { DataType data; struct BinSearchTreeNode *leftchild; struct BinSearchTreeNode *rightchild; }; typedef struct BinSearchTreeNode *BSTreeNode; typedef struct BinSearchTreeNode *BinSearchTree; /****************************************************************/ /* BinSearchTree *create() */ /* 功能:创建二叉排序树 */ /* 输入参数:无 */ /* 返回值:二叉排序树 */ /* 创建日期:2019-5-21 Author:Cyber Kaka */ /****************************************************************/ BinSearchTree create(); /****************************************************************/ /* void InOrder(BinSearchTree ptree) */ /* 功能:中序遍历二叉排序树 */ /* 输入参数ptree:二叉排序树 */ /* 返回值:无 */ /* 创建日期:2019-5-21 Author:Cyber Kaka */ /****************************************************************/ void InOrder(BinSearchTree ptree); /****************************************************************/ /* BSTreeNode BSTSearch(BinSearchTree bt, DataType key) */ /* 功能:检索二叉排序树 */ /* 输入参数bt:二叉排序树的根 */ /* 输入参数key:要检索的元素 */ /* 返回值:成功返回NULL,失败返回元素插入的父结点位置 */ /* 创建日期:2019-5-21 Author:Cyber Kaka */ /****************************************************************/ BSTreeNode BSTSearch(BinSearchTree bt, DataType key); /****************************************************************/ /* int BSTInsert(BinSearchTree bt, DataType key) */ /* 功能:在二叉排序树中插入元素key */ /* 输入参数bt:二叉排序树的根 */ /* 输入参数key:要插入的元素 */ /* 返回值:成功插入返回1,否则返回0 */ /* 创建日期:2019-5-21 Author:Cyber Kaka */ /****************************************************************/ int BSTInsert(BinSearchTree bt, DataType key); /****************************************************************/ /* int BSTgetMax(BinSearchTree *bt) */ /* 功能:查找二叉排序树的最大值 */ /* 输入参数bt:二叉排序树的根 */ /* 返回值:无 */ /* 创建日期:2019-5-21 Author:Cyber Kaka */ /****************************************************************/ void BSTgetMax(BinSearchTree *bt); /****************************************************************/ /* int BSTgetMin(BinSearchTree *bt) */ /* 功能:查找二叉排序树的最小值 */ /* 输入参数bt:二叉排序树的根 */ /* 返回值:无 */ /* 创建日期:2019-5-21 Author:Cyber Kaka */ /****************************************************************/ void BSTgetMin(BinSearchTree *bt); /****************************************************************/ /* int BSTDelete1(BinSearchTree *bt, DataType key) */ /* 功能:删除二叉排序树中的元素key,方法1 */ /* 输入参数bt:二叉排序树的根 */ /* 输入参数key:要删除的元素 */ /* 返回值:成功删除返回1,否则返回0 */ /* 创建日期:2019-5-21 Author:Cyber Kaka */ /****************************************************************/ int BSTDelete1(BinSearchTree *bt, DataType key); /****************************************************************/ /* int BSTDelete2(BinSearchTree *bt, DataType key) */ /* 功能:删除二叉排序树中的元素key,方法2 */ /* 输入参数bt:二叉排序树的根 */ /* 输入参数key:要删除的元素 */ /* 返回值:成功删除返回1,否则返回0 */ /* 创建日期:2019-5-21 Author:Cyber Kaka */ /****************************************************************/ int BSTDelete2(BinSearchTree *bt, DataType key); /****************************************************************/ /* void BST_Destory(BinSearchTree bt) */ /* 功能:销毁二叉排序树 */ /* 输入参数bt:二叉排序树的根 */ /* 返回值:无 */ /* 创建日期:2019-5-21 Author:Cyber Kaka */ /****************************************************************/ void BST_Destory(BinSearchTree bt); #endif // BSTREE_H ``` 对应的c文件 BSTree.c ``` #include <stdio.h> #include <stdlib.h> #include "BSTree.h" /****************************************************************/ /* BinSearchTree create() */ /* 功能:创建二叉排序树,注意这里输入的应该是先序序列,并且保证是一*/ /* 个二叉排序树的先序序列 */ /* 输入参数:无 */ /* 返回值:二叉排序树 */ /* 创建日期:2019-5-21 Author:Cyber Kaka */ /****************************************************************/ BinSearchTree create() { int ch = 0;//初始化 BinSearchTree bt; scanf_s("%d", &ch); if (ch == -1) { bt = NULL; } else { bt = (BSTreeNode *)malloc(sizeof(struct BinSearchTreeNode)); bt->data = ch; //递归赋值左子树 bt->leftchild = create(); //递归赋值右子树 bt->rightchild = create(); } //返回根节点 return bt; } /****************************************************************/ /* void InOrder(BinSearchTree ptree) */ /* 功能:中序遍历二叉排序树 */ /* 输入参数ptree:二叉排序树 */ /* 返回值:无 */ /* 创建日期:2019-5-21 Author:Cyber Kaka */ /****************************************************************/ void InOrder(BinSearchTree ptree) { if (ptree == NULL) { return; } InOrder(ptree->leftchild); printf("%d", ptree->data); InOrder(ptree->rightchild); } /****************************************************************/ /* BSTreeNode BSTSearch(BinSearchTree bt, DataType key) */ /* 功能:检索二叉排序树 */ /* 输入参数bt:二叉排序树的根 */ /* 输入参数key:要检索的元素 */ /* 返回值:成功返回NULL,失败返回元素插入的父结点位置 */ /* 创建日期:2019-5-21 Author:Cyber Kaka */ /****************************************************************/ BSTreeNode BSTSearch(BinSearchTree bt, DataType key) { BSTreeNode p, parent; p = bt; parent = p; //记录待插入结点的父结点 while (p) { parent = p; //当查找到时提示,返回NULL if (p->data == key) { printf("Exist this key\n"); return NULL; } //根结点大于要查的结点,进入左分支查找 if (p->data > key) { p = p->leftchild; } //根结点小于要查的结点,进入右分支查找 else { p = p->rightchild; } }//p=NULL,跳出循环 return parent; //查找失败,返回parent }//return NULL和parent是为了便于之后的操作 /****************************************************************/ /* int BSTInsert(BinSearchTree bt, DataType key) */ /* 功能:在二叉排序树中插入元素key */ /* 输入参数bt:二叉排序树的根 */ /* 输入参数key:要插入的元素 */ /* 返回值:成功插入返回1,否则返回0 */ /* 创建日期:2019-5-21 Author:Cyber Kaka */ /****************************************************************/ int BSTInsert(BinSearchTree bt, DataType key) { BSTreeNode p, temp; temp = BSTSearch(bt, key); //temp保存查找之后的结果 //已存在,返回0 if (temp == NULL) { printf("Exist this key\n"); return 0; } //申请结点的内存空间 p = (BSTreeNode *)malloc(sizeof(struct BinSearchTreeNode)); //申请失败提示 if (p == NULL) { printf("Alloc Failure!\n"); return 0; } p->data = key; //数据域赋值,左右指针域默认为空 //p->leftchild = NULL; //左子树指针域赋值 //p->rightchild = NULL; //右子树指针域赋值 if (key < temp->data) { temp->leftchild = p; //作为左子树插入 } else { temp->rightchild = p; //作为右子树插入 } return 1; } /****************************************************************/ /* int BSTgetMax(BinSearchTree bt) */ /* 功能:查找二叉排序树的最大值 */ /* 输入参数bt:二叉排序树的根 */ /* 返回值:无 */ /* 创建日期:2019-5-21 Author:Cyber Kaka */ /****************************************************************/ void BSTgetMax(BinSearchTree *bt) { BSTreeNode temp; temp = bt; if (temp) { while (temp->leftchild) { temp = temp->leftchild; } printf("%d", temp->data); } } /****************************************************************/ /* int BSTgetMin(BinSearchTree bt) */ /* 功能:查找二叉排序树的最小值 */ /* 输入参数bt:二叉排序树的根 */ /* 返回值:无 */ /* 创建日期:2019-5-21 Author:Cyber Kaka */ /****************************************************************/ void BSTgetMin(BinSearchTree *bt) { BSTreeNode temp; temp = bt; if (temp) { while (temp->rightchild) { temp = temp->rightchild; } printf("%d", temp->data); } } /****************************************************************/ /* int BSTDelete1(BinSearchTree *bt, DataType key) */ /* 功能:删除二叉排序树中的元素key,方法1 */ /* 输入参数bt:二叉排序树的根 */ /* 输入参数key:要删除的元素 */ /* 返回值:成功删除返回1,否则返回0 */ /* 创建日期:2019-5-21 Author:Cyber Kaka */ /****************************************************************/ int BSTDelete1(BinSearchTree *bt, DataType key) { BSTreeNode parent, p, maxpl; p = *bt; parent = NULL; //查找被删除的结点 while (p != NULL) { if (p->data == key) break; //查找到了,跳出循环 if (p->data > key) p = p->leftchild; else p = p->rightchild; }//查询结束 if (p == NULL) { printf("%d not exist\n", key); return 0; } //只有右子树的情况 if (p->leftchild == NULL) { //如果被删除的结点是根结点,那就要修改的是二叉排序树的根 if (parent == NULL) *bt = p->rightchild; //检查是左孩子还是右孩子 else if (parent->leftchild == p) parent->leftchild = p->rightchild; else parent->rightchild = p->rightchild; } //既有左子树也有右子树 if (p->leftchild != NULL) { BSTreeNode parentp; //parentp记录maxpl的父结点 parentp = p; maxpl = p->leftchild; //对称遍历中,右侧的总是大的数 //定位p的左子树中的最大结点maxpl while (maxpl->rightchild != NULL) { parentp = maxpl; maxpl = maxpl->rightchild; } p->data = maxpl->data; //修改p的数据域为maxpl的值 if (parentp == p) //如果maxpl的父结点是p p->leftchild = maxpl->leftchild; //修改p结点的左指针 else parentp->rightchild = maxpl->leftchild; //修改父结点的右指针 p = maxpl; //更新p指针为maxpl结点以便删除 } //释放空间 free(p); return 1; } /****************************************************************/ /* int BSTDelete2(BinSearchTree *bt, DataType key) */ /* 功能:删除二叉排序树中的元素key,方法2 */ /* 输入参数bt:二叉排序树的根 */ /* 输入参数key:要删除的元素 */ /* 返回值:成功删除返回1,否则返回0 */ /* 创建日期:2019-5-21 Author:Cyber Kaka */ /****************************************************************/ int BSTDelete2(BinSearchTree *bt, DataType key) { //parent记录p的父结点,maxpl记录p的左子树中的关键码最大结点 BSTreeNode parent, p, maxpl; p = *bt; parent = NULL; //查找被删除的结点 while (p != NULL) { if (p->data == key) break; //查找到了,跳出循环 parent = p; //注意这一句 if (p->data > key) p = p->leftchild; else p = p->rightchild; }//查找结束 if (p == NULL) { printf("%d not exist!\n", key); return 0; } //只有右子树的情况 if (p->leftchild == NULL) { //删除的是根结点,做特殊处理 if (parent == NULL) *bt = p->rightchild; //p是父结点parent的左孩子,则修改父结点的左指针 else if (parent->leftchild == p) parent->leftchild = p->rightchild; else parent->rightchild = p->rightchild; } //以上和方法1几乎完全相同 //有左子树和右子树 if (p->leftchild != NULL) { maxpl = p->leftchild; //定位左子树中的最大结点maxpl while (maxpl->rightchild != NULL) maxpl = maxpl->rightchild; maxpl->rightchild = p->rightchild; if (parent == NULL) *bt = p->leftchild; //p是父结点parent的左孩子,则修改父结点的左指针 else if (parent->leftchild == p) parent->leftchild = p->leftchild; //p是父结点parent的右孩子,则修改父结点的右指针 else parent->rightchild = p->leftchild; } free(p); //释放结点p return 1; } /****************************************************************/ /* void BST_Destory(BinSearchTree *bt) */ /* 功能:递归销毁二叉排序树 */ /* 输入参数bt:二叉排序树的根 */ /* 返回值:无 */ /* 创建日期:2019-5-21 Author:Cyber Kaka */ /****************************************************************/ void BST_Destory(BinSearchTree bt) { if (bt) { BST_Destory(bt->leftchild); BST_Destory(bt->rightchild); free(bt); } } ``` 主函数.c文件 main.c ``` #include <stdio.h> #include <stdlib.h> #include "BSTree.h" //用于测试的二叉树先序序列,-1表示空 //40 10 5 -1 -1 -1 55 45 -1 48 47 -1 -1 52 -1 -1 60 -1 70 -1 -1 void main() { BinSearchTree bt; int n = 0; printf("输入二叉排序树的先序序列:\n"); bt = create(); printf("输入要查找的元素,存在返回1,不存在返回0,插入:"); scanf_s("%d", &n); printf("%d\n", BSTSearch(bt, n)->data); printf("输入要插入的元素,成功插入返回1,否则返回0:"); scanf_s("%d", &n); printf("%d\n", BSTInsert(bt, n)); //printf("二叉排序树的中序遍历序列:\n"); //InOrder(bt); printf("\n第一种删除方法,输入要删除的元素,成功返回1,不成功返回0:"); scanf_s("%d", &n); printf("%d\n", BSTDelete1(&bt, n)); //printf("二叉排序树的中序遍历序列:\n"); //InOrder(bt); printf("\n第二种删除方法,输入要删除的元素,成功返回1,不成功返回0:"); scanf_s("%d", &n); printf("%d\n", BSTDelete2(&bt, n)); //printf("二叉排序树的中序遍历序列:\n"); //InOrder(bt); } ``` **问题:**<br> <br> * [0]生成解决方案的时候有警告,但是我忽略了,因为显示程序生成成功了,感觉这几个警告是最大的问题,第4个问题中我详细列出了这些内容<br> <br> * [1]二叉树的递归创建自己感觉有问题,尤其是内存申请这里<br> <br> <code>bt = (BSTreeNode *)malloc(sizeof(struct BinSearchTreeNode));</code><br> <br> * [2]中序遍历的内容在搜索到左子树底的时候本应返回上一步时会出现异常,建立断点异常内容如下:<br> 引发了异常: 读取访问权限冲突。<br> **ptree** 是 0xCDCDCDCD。<br> <br> * [3]由于中序遍历有异常,所以我注释掉了所有的相关内容,编译时没什么问题,但是删除结点的函数也会出现类似的异常,异常内容如下:<br> 引发了异常: 读取访问权限冲突。<br> **maxpl** 是 0xCDCDCDCD。<br> <br> <br> * [4]好吧,我就都注释掉了,看看别的代码是不是有问题,重新生成解决方案,熟悉的警告出现了,c语言是速成的结构体这块不是很明了,感觉应该是创建二叉搜索树的代码有问题,或者是结构体创建有问题,以下是警告的内容:<br> */bstree.c(24): warning C4047: “=”:“BinSearchTree”与“BSTreeNode *”的间接级别不同<br> */bstree.c(108): warning C4047: “=”:“BSTreeNode”与“BSTreeNode *”的间接级别不同<br> *\bstree.c(139): warning C4047: “=”:“BSTreeNode”与“BinSearchTree *”的间接级别不同<br> *\bstree.c(160): warning C4047: “=”:“BSTreeNode”与“BinSearchTree *”的间接级别不同<br> <br> 第24行:<br> BinSearchTree create()<br> {<br> &nbsp;&nbsp;...<br> &nbsp;&nbsp;&nbsp;&nbsp;bt = (BSTreeNode *)malloc(sizeof(struct BinSearchTreeNode));<br> &nbsp;&nbsp;...<br> }<br> <br> 第108行:<br> int BSTInsert(BinSearchTree bt, DataType key)<br> {<br> &nbsp;&nbsp;...<br> &nbsp;&nbsp;&nbsp;&nbsp;//申请结点的内存空间<br> &nbsp;&nbsp;&nbsp;&nbsp;p = (BSTreeNode *)malloc(sizeof(struct BinSearchTreeNode));<br> &nbsp;&nbsp;...<br> }<br> <br> 第139行:<br> void BSTgetMax(BinSearchTree *bt)<br> {<br> &nbsp;&nbsp;...<br> &nbsp;&nbsp;&nbsp;&nbsp;temp = bt;<br> &nbsp;&nbsp;...<br> }<br> <br> 第160行:<br> void BSTgetMin(BinSearchTree *bt)<br> {<br> &nbsp;&nbsp;...<br> &nbsp;&nbsp;&nbsp;&nbsp;temp = bt;<br> &nbsp;&nbsp;...<br> }<br> <br> 以上,求各位大佬指点迷津<br>

跪求大佬帮忙看一下表达式求解问题

在用栈求解表达式时,创建了两个栈,一个为char类型装运算符,一个为double类型装操作数,又写了一个函数把中缀表达式转换为后缀表达式,还有一个函数进行后缀表达式求解,代码如下。在vs上显示没有错误,运行后提示有异常,弄了一下午都没有解决,跪求各位大佬来帮我看看哪里错了,感谢各位大佬。 ``` #include "pch.h" #include <iostream> #define Maxsize 50 using namespace std; //创建一个char栈 typedef struct { char data[Maxsize]; //存放栈中的数据元素 int top; //栈顶指针 }SqStack; //顺序栈类型 void InitStack(SqStack * &s) //初始化栈 { s = (SqStack *)malloc(sizeof(SqStack)); s->top = -1; } void DestoryStack(SqStack * &s) //销毁栈 { free(s); } bool StackEmpty(SqStack * s) //判断栈是否为空 { return(s->top == -1); } bool Push(SqStack * &s, char e) //进栈 { if (s->top == Maxsize - 1) return false; s->top++; s->data[s->top] = e; return true; } bool Pop(SqStack * &s, char &e) //出栈 { if (s->top == -1) return false; e = s->data[s->top]; s->top--; return true; } bool GetTop(SqStack * s, char &e) //取栈顶元素 { if (s->top == -1) return false; e = s->data[s->top]; return true; } void trans(char * exp, char postexp[]) //把中缀表达式转换为后缀表达式 { char e; SqStack * Optr; InitStack(Optr); int i = 0; while (* exp!='\0') //扫描中缀表达式 { switch (* exp) { case '(': //遇到( 进栈 Push(Optr, ')'); exp++; break; case ')': //遇到 )出栈 Pop(Optr, e); while (e!='(') { postexp[i++] = e; Pop(Optr, e); } exp++; break; case '+': case '-': while (!StackEmpty(Optr)) { GetTop(Optr, e); if (e != '(') { postexp[i++] = e; Pop(Optr, e); } else break; } Push(Optr, *exp); exp++; break; case '*': case '/': while (!StackEmpty(Optr)) { GetTop(Optr, e); if (e == '*' || e == '/') { postexp[i++] = e; Pop(Optr, e); } else break; } Push(Optr, *exp); exp++; break; default: while (* exp>='0'&& * exp<='9') { postexp[i++] = * exp; exp++; } postexp[i++] = '#'; } } while (!StackEmpty(Optr)) { Pop(Optr, e); postexp[i++] = e; } postexp[i] = '\0'; DestoryStack(Optr); } //创建一个double栈 typedef struct { double data[Maxsize]; //存放栈中的数据元素 int top; //栈顶指针 }SqStack1; void InitStack1(SqStack1 * &s) //初始化栈 { s = (SqStack1 *)malloc(sizeof(SqStack1)); s->top = -1; } void DestoryStack1(SqStack1 * &s) //销毁栈 { free(s); } bool StackEmpty1(SqStack1 * s) //判断栈是否为空 { return(s->top == -1); } bool Push1(SqStack1 * &s, double e) //进栈 { if (s->top == Maxsize - 1) return false; s->top++; s->data[s->top] = e; return true; } bool Pop1(SqStack1 * &s, double &e) //出栈 { if (s->top == -1) return false; e = s->data[s->top]; s->top--; return true; } bool GetTop1(SqStack1 * s, double &e) //取栈顶元素 { if (s->top == -1) return false; e = s->data[s->top]; return true; } double compvalue(char * postexp) //计算后缀表达式 { double a, b, c, d, e; SqStack1 * Opnd; InitStack1(Opnd); while (* postexp!='\0') { switch (* postexp) { case '+': Pop1(Opnd, a); Pop1(Opnd, b); c = b + a; Push1(Opnd, c); break; case '-': Pop1(Opnd, a); Pop1(Opnd, b); c = b - a; Push1(Opnd, c); break; case '*': Pop1(Opnd, a); Pop1(Opnd, b); c = b * a; Push1(Opnd, c); break; case '/': Pop1(Opnd, a); Pop1(Opnd, b); if (a != 0) { c = b / a; Push1(Opnd, c); break; } else { cout << "除零错误!" << endl; exit(0); } default: d = 0; while (* postexp>='0'&& * postexp<='9') { d = 10 * d + *postexp - '0'; postexp++; } Push1(Opnd, d); break; } postexp++; } GetTop1(Opnd, e); DestoryStack1(Opnd); return e; } int main() { char exp[] = "(56-20)/(4+2)"; char postexp[Maxsize]; trans(exp, postexp); cout << exp << endl; cout << postexp << endl; cout << compvalue(postexp) << endl; } ```

求大佬看看什么问题idea软件编写的spring关于AspectJ通知类型的错误。

``` 2019-05-10 23:34:15,077 INFO [org.springframework.context.support.ClassPathXmlApplicationContext] - Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@4b4523f8: startup date [Fri May 10 23:34:15 CST 2019]; root of context hierarchy 2019-05-10 23:34:15,261 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] - Loading XML bean definitions from class path resource [com/cwj/beans5.xml] 2019-05-10 23:34:15,950 WARN [org.springframework.context.support.ClassPathXmlApplicationContext] - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userService' defined in class path resource [com/cwj/beans5.xml]: BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.aop.aspectj.AspectJPointcutAdvisor#1': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.aop.aspectj.AspectJPointcutAdvisor]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: error at ::0 formal unbound in pointcut Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userService' defined in class path resource [com/cwj/beans5.xml]: BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.aop.aspectj.AspectJPointcutAdvisor#1': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.aop.aspectj.AspectJPointcutAdvisor]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: error at ::0 formal unbound in pointcut at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:479) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83) at com.cwj.Text.Text5.main(Text5.java:28) Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.aop.aspectj.AspectJPointcutAdvisor#1': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.aop.aspectj.AspectJPointcutAdvisor]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: error at ::0 formal unbound in pointcut at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:279) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1201) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1103) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) at org.springframework.aop.framework.autoproxy.BeanFactoryAdvisorRetrievalHelper.findAdvisorBeans(BeanFactoryAdvisorRetrievalHelper.java:92) at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findCandidateAdvisors(AbstractAdvisorAutoProxyCreator.java:102) at org.springframework.aop.aspectj.autoproxy.AspectJAwareAdvisorAutoProxyCreator.shouldSkip(AspectJAwareAdvisorAutoProxyCreator.java:103) at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessBeforeInstantiation(AbstractAutoProxyCreator.java:248) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInstantiation(AbstractAutowireCapableBeanFactory.java:1045) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveBeforeInstantiation(AbstractAutowireCapableBeanFactory.java:1019) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:473) ... 10 more Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.aop.aspectj.AspectJPointcutAdvisor]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: error at ::0 formal unbound in pointcut at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:154) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:122) at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:271) ... 25 more Caused by: java.lang.IllegalArgumentException: error at ::0 formal unbound in pointcut at org.aspectj.weaver.tools.PointcutParser.parsePointcutExpression(PointcutParser.java:302) at org.springframework.aop.aspectj.AspectJExpressionPointcut.buildPointcutExpression(AspectJExpressionPointcut.java:217) at org.springframework.aop.aspectj.AspectJExpressionPointcut.checkReadyToMatch(AspectJExpressionPointcut.java:190) at org.springframework.aop.aspectj.AspectJExpressionPointcut.getMethodMatcher(AspectJExpressionPointcut.java:175) at org.springframework.aop.aspectj.AbstractAspectJAdvice.buildSafePointcut(AbstractAspectJAdvice.java:196) at org.springframework.aop.aspectj.AspectJPointcutAdvisor.<init>(AspectJPointcutAdvisor.java:50) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:142) ... 27 more Disconnected from the target VM, address: '127.0.0.1:53065', transport: 'socket' Process finished with exit code 1 ``` ``` <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd"> <bean id="userService" class="com.cwj.Service.UserServiceImpl"/> <bean id="myAscpect" class="com.cwj.Service.MyAspect"/> <aop:config> <aop:aspect ref="myAscpect"> <aop:pointcut id="myPointCut" expression="execution( * com.cwj.Service.UserServiceImpl.*(..))"/> <aop:before method="myBefore" pointcut-ref="myPointCut"/> <aop:after-returning method="myAfterReturnning" pointcut-ref="myPointCut"/> <aop:around method="myAround" pointcut-ref="myPointCut"/> <aop:after-throwing method="myAfterThrowing" pointcut-ref="myPointCut"/> <aop:after method="myAfter" pointcut-ref="myPointCut"/> </aop:aspect> </aop:config> </beans> ``` public class MyAspect{ public void before(){ System.out.println("开启事务"); } public void after(){ System.out.println("提交事务"); } //前置通知 public void myBefore(JoinPoint joinpoint){ System.out.println(joinpoint); System.out.println("前置通知"); } //后置通知 public void myAfterReturnning(JoinPoint joinpoint,Object object){ System.out.println("后置通知"+object); } //环绕通知 public Object myAround(ProceedingJoinPoint joinPoint) throws Throwable { System.out.println("环绕通知前"); Object o=joinPoint.proceed(); System.out.println("环绕通知后"); return o; } //异常通知 public void myAfterThrowing(JoinPoint joinPoint,Throwable e){ System.out.println("异常通知"+e.getMessage()); } //最终通知 public void myAfter(){ System.out.println("最终通知"); } ``` public class Text5 { public static void main(String[] args) { ApplicationContext context=new ClassPathXmlApplicationContext("com/cwj/beans5.xml"); UserService service= (UserService) context.getBean("userService"); service.addUser(); service.deletUser(); } ``` 被者几个错误烦的我都要烦死了。求大佬帮忙解答哪里出问题了

有大佬给看看吗?这个程序没有错误,但是不能运行

#include <stdio.h> #include <stdlib.h> #include <string.h> #include<conio.h> #include"windows.h" //*********************************************************************************** int initial_room(); //初始化80个房间信息 int welcome(); //验证用户登陆,登陆成功显示欢迎信息 int enter(); int check_in(); int check_out(); int inquire(); int diancai1(); int i=0; int caijia=0; int pay=0; typedef int ElemType; //*********************************************************************************** struct Room { int number; int rank; int price; int state; }; struct Customer { char name[13],ID[19]; int room_number; int pay; int change; int day; char caiming; int caijia; }; int set_name(struct Customer *cs, char *n) { strcpy(cs->name,n); return 14; } int set_ID(struct Customer *cs, char *p) { strcpy(cs->ID,p); return 13; } int set_room_number(struct Customer *cs, int n) { cs->room_number=n; return 12; } int set_day(struct Customer *cs, int d) { cs->day=d; return 11; } char *get_name(struct Customer *cs) { return cs->name; } char *get_ID(struct Customer *cs) { return cs->ID; } int get_room_number(struct Customer *cs) { return cs->room_number; } int get_day(struct Customer *cs) { return cs->day; } //*********************************************************************************** struct Room room[60]; struct Customer *customer[60]; //diancai struct cai /*cai结构体 实现对菜品 已点份数、名称、原材料 的记录*/ { int fenshu; char name[50]; int use; int price; }; struct List /*该线性表实现对菜品原材料的剩余量的记录,线性表【i】对应菜品的点餐菜单编码*/ { ElemType* list; int size; int MaxSize; }; /*以下为线性表的函数*/ void InitList(struct List* L,int ms) { if(ms<=0){printf("ms 值非法!\n");exit(1);} L->MaxSize=ms; L->list=(int*)malloc(ms*sizeof(ElemType*)); if(!L->list) { printf("动态存储分配失败!"); exit(1); } L->size=0; } void againMalloc(struct List *L) { ElemType *p=(int*)realloc(L->list,2*L->MaxSize*sizeof(ElemType)); if(!p){ printf("分配存储空间失败!"); exit(1); } L->list=p; L->MaxSize=2*L->MaxSize; } void InsertLastList(struct List *L,ElemType x) { if(L->size==L->MaxSize) againMalloc(L); L->list[L->size]=x; L->size++; } /*表格函数*/ int cddayin(struct cai a[]) { int i=0,j=0; for(i=0;i<30;i++) {if(a[i].fenshu>0) j++;} if(j!=0) { printf("已点菜/酒品编号 已点菜品名称 已点份数/瓶数 价格\n"); for(i=0;i<30;i++) if(a[i].fenshu>0) {printf(" %5d %10s%14d %d¥ \n",i,a[i].name,a[i].fenshu,a[i].fenshu*a[i].price); caijia=caijia+a[i].fenshu*a[i].price; } printf(" 您好,您点餐价格合计=%d¥\n",caijia); } return caijia; if(j==0) printf("顾客尚未点餐,无法进行菜单打印!\n"); } void ycliao(struct List *yuan,struct cai a[]) { int i=1,p=0,k=0,num; for(i=0;i<30;i++) { do{ p=a[i].use%100; yuan->list[p]=yuan->list[p]-a[i].fenshu; a[i].use=a[i].use/100; }while(a[i].use!=0); } printf("请输入房间号:"); scanf("%d",&num); if(num=101&&102&&103&&104&&105){ printf("|-------------------------------------------------------|--------------------|\n"); printf("|------------------原材料余量---------------------------|-----酒品余量-------|\n"); printf("|-------------------------------------------------------|--------------------|\n"); printf("| 10.鸡肉=%3d 11.猪肉=%3d 12.鱼肉=%3d | 50.雪花啤酒=%3d |\n",yuan->list[10],yuan->list[11],yuan->list[12],yuan->list[50]); printf("| 13.黄瓜=%3d 14.土豆=%3d 15.豆腐=%3d | 51.燕京啤酒=%3d |\n",yuan->list[13],yuan->list[14],yuan->list[15],yuan->list[51]); printf("| 16.茄子=%3d 17.青椒=%3d 18.牛肉=%3d | 52.二锅头=%3d |\n",yuan->list[16],yuan->list[17],yuan->list[18],yuan->list[52]); printf("| 19.大葱=%3d 20.鲜鸭血=%3d 21.花生=%3d | |\n",yuan->list[19],yuan->list[20],yuan->list[21]); printf("| 22.花椒=%3d 23.酱=%3d 24.胡萝卜=%3d | |\n",yuan->list[22],yuan->list[23],yuan->list[24]); printf("| 25.辣椒=%3d 26.芹菜=%3d 27.豆皮=%3d | |\n",yuan->list[25],yuan->list[26],yuan->list[27]); printf("|-------------------------------------------------------|--------------------|\n"); printf("|-------------------------------------------------------|--------------------|\n"); }} void diancai(struct cai a[],struct Customer *cs ) { int p=0,wep=0; /*printf("请输入房间号\n"); scanf("%d",num); for(i=0;i<60;i++) if(cs->room[n].number==num) */ do{ printf(" |----------------------------------------------|-------------------|\n"); printf(" |----------菜品(输入-1确认并结束点餐)----------|-------酒品--------|\n"); printf(" |----------------------------------------------|-------------------|\n"); printf(" | 1.红烧狮子头 2. 飘香桂鱼 3.京酱肉丝 21.长城干红 |\n"); printf(" | 4.爆炒竹鸡 5.水煮鱼 6.日本豆腐 | 22.喜力啤酒 |\n"); printf(" | 7.夫妻肺片 8.拍黄瓜 9.莲子羹 | 23.人头马 |\n"); printf(" |----------------------------------------------|-------------------|\n"); printf(" |----------------------------------------------|-------------------|\n"); scanf("%d",&p); system("CLS"); if(p>=1&&p<=9) { printf(" |------------------------------------------|\n"); printf(" |------------------份数--------------------|\n"); printf(" |------------------------------------------|\n"); printf(" | 1.一份 2.两份 |\n"); printf(" | 3.三份 4.其他请直接输入 |\n"); printf(" |------------------------------------------|\n"); printf(" |------------------------------------------|\n"); scanf("%d",&wep); if(wep>50) {system("CLS");printf("您输入的值异常或过大,请您检查输入的值!\n");continue;}/*防止误输入*/ else if(wep<=50) {a[p].fenshu+=wep; system("CLS"); } } else if(p>=21&&p<=23) { printf(" |--------------------------------------------------------|\n"); printf(" |-------------------------酒品数量-----------------------|\n"); printf(" |--------------------------------------------------------|\n"); printf(" | 1.一瓶 2.两瓶 3.三瓶 4.其他瓶数请直接输入 |\n"); printf(" |--------------------------------------------------------|\n"); printf(" |--------------------------------------------------------|\n"); scanf("%d",&wep); if(wep>50) {system("CLS");printf("您输入的值异常或过大,请您检查输入的值!\n");continue;}/*防止误输入*/ else if(wep<=50) { a[p].fenshu+=wep; system("CLS"); } } else if(p!=-1) printf("对不起,你输入的编码没有对应菜品,请重新输入!\n"); }while(p!=-1); system("CLS"); cs->caijia=cddayin(a); } void ycldayin(struct List yuan,struct cai a[]) { char l='\0'; printf("显示原材料余量?(Y/N)\n"); l=getch(); if(l=='Y'||l=='y') {system("CLS"); ycliao(&yuan,a);} else { system("CLS"); printf("\n\n\n\n");} } int diancai1(struct Customer *cs) { int i=0; char l='\0'; struct List yuan; /* yuan前不用加“*” */ struct cai a[60]={ {0,"\0",0}, {0,"宫爆鸡丁",10131421,15},{0,"飘香桂鱼",1124,14},{0,"京酱肉丝",112327,16}, {0,"爆炒竹鸡",141617,10},{0,"水煮鱼",122225,50},{0,"日本豆腐",152225,11}, {0,"夫妻肺片",18212625,17},{0,"拍黄瓜",13252223,8},{0,"莲子羹",20,20}, {0,"\0",0},{0,"\0",0},{0,"\0",0}, {0,"\0",0},{0,"\0",0},{0,"\0",0}, {0,"\0",0},{0,"\0",0},{0,"\0",0}, {0,"\0",0},{0,"\0",0}, {0,"长城干红",50,300},{0,"喜力啤酒",51,20},{0,"人头马",52,500}, {0,"\0",0},{0,"\0",0},{0,"\0",0}, {0,"\0",0},{0,"\0",0},{0,"\0",0}}; InitList(&yuan,60); for(i=0;i<60;i++) InsertLastList(&yuan,100);//+rand()%50 printf("\n\n\n\n\n\n\n\n"); printf(" |--------------------------------------------------------|\n"); printf(" |---------------- 欢迎您开始点餐! -----------------|\n"); printf(" |--------------- ----------------------------------------|\n"); Sleep(2500); system("CLS"); diancai(a ,cs); /*点餐函数,开始点餐吧!*/ ycldayin(yuan,a); printf("\n\n\n\n"); printf(" |--------------------------------------------------------|\n"); printf(" |-------------- 欢迎再次点餐,祝您用餐愉快! ---------------|\n"); printf(" |--------------------------------------------------------|\n"); printf("\n\n\n\n\n\n"); return 0; } int CCustomer(struct Customer *cs) { printf("请您输入顾客的姓名\n"); scanf("%s",cs->name); printf("请您输入顾客的身份证号码(18位数字)\n"); scanf("%s",cs->ID); cs->pay = cs->change = cs->day = 0; return 9; } int FCustomer() { printf("该顾客退房成功!"); return 8; } int main() //程序入口从这里开始运行 { //system("color 3E"); char choice='1'; system("color 3E"); initial_room(); //初始化60个房间的信息,分三个等级 welcome(); //验证用户登陆,登陆成功显示欢迎信息 while(choice=='1') { enter(); //根据用户的选择执行不同的功能 printf("\n"); printf("继续使用本系统请按\"1\",退出请按\"2\"! "); fflush(stdin); scanf("%c",&choice); printf("\n"); } return 0; } //系统登陆界面*********************************************************************** int welcome() //验证用户登陆,登陆成功显示欢迎信息 { char name[10],code[20]; printf("请输入用户名和密码:\n"); printf("用户名:"); scanf("%s",name); // scanf("%s%s",name,code); printf("密码:"); scanf("%s",code); while((strcmp(name,"Joe")!=0)||(strcmp(code,"Mercy")!=0)) { printf("用户名或密码输入有误,请重新输入!\n"); scanf("%s%s",name,code); } printf("\n"); printf("\n"); printf(" ▲***************************▲\n"); printf(" △ 欢迎使用酒店管理系统! △\n"); printf(" ▲***************************▲\n"); printf("\n"); return 7; } //系统入口*************************************************************************** int enter() { int kind_of_service; printf("请选择服务类别:入住、退房还是查询? \n"); printf("1->入住 2->退房 3->查询 4->点菜 "); scanf("%d",&kind_of_service); if((kind_of_service>4) || (kind_of_service<1)) { printf("您的输入有误,请重试!\n"); scanf("%d",&kind_of_service); } else { switch(kind_of_service) { case 1: check_in(); break; case 2: check_out(); break; case 3: inquire(); break; case 4: diancai1(); break; } } return 6; } //入住登记*************************************************************************** int check_in() { int pay; { int room_standard,day; customer[i] = (struct Customer*)malloc(sizeof(struct Customer)); CCustomer(customer[i]); printf("请您选择预定房间的标准:\n"); printf("1.单人间/天150元\n2.双人间/天200元\n3.标准间/天300元\n"); scanf("%d",&room_standard); printf("请输入住宿天数\n"); scanf("%d",&day); set_day(customer[i],day); switch(room_standard) { int n; case 1: pay=day*150; //set_pay(customer[i],pay); printf("请收房费 %d元整!\n",pay); for(n=0; n<20; n++) { if(room[n].state==0) { printf("入住房间号码为: %d\n",room[n].number); room[n].state=2; set_room_number(customer[i],room[n].number); break; } } break; case 2: pay=day*200; printf("请收房费 %d元整!\n",pay); for(n=20; n<40; n++) { if(room[n].state==0) { printf("入住房间号码为: %d\n",room[n].number); room[n].state=2; set_room_number(customer[i],room[n].number); break; } } break; case 3: pay=day*300; printf("请收房费 %d元整!\n",pay); for(n=40; n<60; n++) { if(room[n].state==0) { printf("入住房间号码为: %d\n",room[n].number); room[n].state=2; set_room_number(customer[i],room[n].number); break; } } break; } i++; } return 4; } //退房结算*************************************************************************** int check_out() { char name2[13],id2[19]; int standard,j,room_number,day1,day2,day; printf("请输入要退房的顾客姓名和身份证号码:\n"); scanf("%s%s",name2,id2); printf("请输入该顾客实住天数:\n"); scanf("%d",&day2); for(j=0; j<i; j++) { if((strcmp(get_name(customer[j]),name2)==0)&&(strcmp(get_ID(customer[j]),id2)==0)) { char account; room_number=get_room_number(customer[j]); standard=room_number/100; day1=get_day(customer[j]); day=day1-day2; switch(standard) { case 1: printf("顾客的房间号是%d :为单人间,每天150元\n",room_number); printf("实际住房消费 %d元整!\n",day2*150); printf("\n"); if(day2*150+caijia<pay) printf("请退给该顾客 %d 元整!\n",day*150); if(day2*150+caijia>pay) printf("请补收该顾客住房费 %d 元整!\n",day2*150+caijia-pay); printf("用餐费用为:%d\n",caijia); printf("消费总钱数为%d\n",day2*150+caijia); break; case 2: printf("顾客的房间号是%d :为双人间,每天200元%d\n",room_number); printf("实际住房消费 %d元整!\n",day2*200); printf("\n"); if(day2*200+caijia<pay) printf("请退给该顾客 %d 元整!\n",day*150); if(day2*200+caijia>pay) printf("请补收该顾客住房费 %d 元整!\n",day2*200+caijia-pay); printf("用餐费用为:%d\n",caijia); printf("消费总钱数为%d\n",day2*200+caijia); break; case 3: printf("顾客的房间号是%d :为标准间,每天300元%d\n"); printf("实际住房消费 %d元整!\n",day2*300); printf("\n"); if(day2*300+caijia<pay) printf("请退给该顾客 %d 元整!\n",day*300); if(day2*150+caijia>pay) printf("请补收该顾客住房费 %d 元整!\n",day2*300+caijia-pay); printf("用餐费用为:%d\n",caijia); printf("消费总钱数为%d\n",day2*300+caijia); break; } //printf("用餐费用为:%d\n",caijia); //printf("实际应收总价为") printf("退房核算清楚,请按1: "); fflush(stdin); scanf("%c",&account); if(account=='1') { int k; for(k=0; k<80; k++) { if(room[k].number==get_room_number(customer[j])) room[k].state=0; } i--; for(; j<i; j++) { customer[j]=customer[j+1]; } free(customer[i]); FCustomer(); } } } return 3; } //信息查询*************************************************************************** int inquire() { char inquire_choice; printf("房间信息查询请按1, 顾客信息查询请按2: "); fflush(stdin); scanf("%c",&inquire_choice); if(inquire_choice=='1') { int j,k=0; printf("\n"); printf("下列房间没人入住:\n"); for(j=0; j<60; j++) { if(room[j].state==0) { if(k%10==0) printf("\n"); printf("%d\t",room[j].number); k++; } } printf("\n"); printf("\n"); k=0; printf("\n"); printf("\n"); printf("下列房间有人入住:\n"); for(j=0; j<60; j++) { if(room[j].state==2) { if(k%10==0) printf("\n"); printf("%d\t",room[j].number); k++; } } printf("\n"); printf("\n"); } else if(inquire_choice=='2') { char inquire_choice; int j; printf("按姓名查询请按1, 按身份证查询请按2: \n"); fflush(stdin); scanf("%c",&inquire_choice); if(inquire_choice=='1') { char name3[13]; printf("请输入顾客的姓名: \n"); scanf("%s",name3); for(j=0; j<i; j++) { if(strcmp(get_name(customer[j]),name3)==0) { printf("%s的住房信息如下:\n",name3); printf("\t房间号为: %d\n",get_room_number(customer[j])); } } } if(inquire_choice=='2') { char id3[19]; int j; printf("请输入顾客的身份证: \n"); scanf("%s",id3); for(j=0; j<i; j++) { if(strcmp(get_ID(customer[j]),id3)==0) { printf("%s的住房信息如下:\n",get_name(customer[j])); printf("\t房间号为: %d\n",get_room_number(customer[j])); } } } } return 2; } //房间信息初始化********************************************************************* int initial_room() //对60个房间进行初始化,分3个等级 { int j,k=101; for(j=0; j<20; j++) { room[j].number=k++; room[j].rank=1; room[j].price=150; room[j].state=0; } k=201; for(j=20; j<40; j++) { room[j].number=k++; room[j].rank=2; room[j].price=200; room[j].state=0; } k=301; for(j=40; j<60; j++) { room[j].number=k++; room[j].rank=3; room[j].price=300; room[j].state=0; } return 1; } ``` ```

关于spring中的@Transactional注解,求大佬帮帮忙解惑

各位大佬你们好,现在我遇见了一个问题让我很困惑,请大佬们看图片1,这种写法是没有问题的,程序能正常回滚 ![图片说明](https://img-ask.csdn.net/upload/201910/23/1571838653_859329.png) 现在下面的写法,导致我很困惑,我预想的是:aa方法会往数据库插入一条数据,而bb方法因为出现异常,则不会插入数据,但是事实上,bb依然会往数据库插入数据,也就是说,@Transactional注解加到bb方法上,是无效的,这是为什么呢?? ![图片说明](https://img-ask.csdn.net/upload/201910/23/1571838665_660703.png)

用vs2019和opencv 调适时候出现问题 求大佬帮忙看看 这是什么错误

![图片说明](https://img-ask.csdn.net/upload/202005/19/1589875209_381916.png) ![图片说明](https://img-ask.csdn.net/upload/202005/19/1589875262_198193.png)

请大佬帮忙看一下这个运行错误该怎么改?

![图片说明](https://img-ask.csdn.net/upload/202003/27/1585313934_916686.png)

运行报错,大佬们帮忙看看什么原因java.util.concurrent.ExecutionException

"C:\Program Files\Java\jdk1.8.0_201\bin\java" "-Dmaven.multiModuleProjectDirectory=C:\Users\Administrator\Desktop\travel - 副本" -Dfile.encoding=gb2312 "-Dmaven.home=C:\Program Files\JetBrains\IntelliJ IDEA 2017.2.6\plugins\maven\lib\maven3" "-Dclassworlds.conf=C:\Program Files\JetBrains\IntelliJ IDEA 2017.2.6\plugins\maven\lib\maven3\bin\m2.conf" "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2017.2.6\lib\idea_rt.jar=51249:C:\Program Files\JetBrains\IntelliJ IDEA 2017.2.6\bin" -classpath "C:\Program Files\JetBrains\IntelliJ IDEA 2017.2.6\plugins\maven\lib\maven3\boot\plexus-classworlds-2.5.2.jar" org.codehaus.classworlds.Launcher -Didea.version=2017.2.6 tomcat7:run [INFO] Scanning for projects... [WARNING] [WARNING] Some problems were encountered while building the effective model for cn.itcast:travel:war:1.0-SNAPSHOT [WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 131, column 21 [WARNING] [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build. [WARNING] [WARNING] For this reason, future Maven versions might no longer support building such malformed projects. [WARNING] [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building travel 1.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] >>> tomcat7-maven-plugin:2.1:run (default-cli) > process-classes @ travel >>> [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ travel --- [WARNING] Using platform encoding (gb2312 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] Copying 3 resources [INFO] [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ travel --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 40 source files to C:\Users\Administrator\Desktop\travel - 副本\target\classes [WARNING] /C:/Users/Administrator/Desktop/travel - 副本/src/main/java/cn/itcast/travel/dao/impl/FindDaoImpl.java: 某些输入文件使用了未经检查或不安全的操作。 [WARNING] /C:/Users/Administrator/Desktop/travel - 副本/src/main/java/cn/itcast/travel/dao/impl/FindDaoImpl.java: 有关详细信息, 请使用 -Xlint:unchecked 重新编译。 [INFO] [INFO] <<< tomcat7-maven-plugin:2.1:run (default-cli) < process-classes @ travel <<< [INFO] [INFO] --- tomcat7-maven-plugin:2.1:run (default-cli) @ travel --- [INFO] Running war on http://localhost:80/travel [INFO] Using existing Tomcat server configuration at C:\Users\Administrator\Desktop\travel - 副本\target\tomcat [INFO] create webapp with contextPath: /travel 七月 21, 2019 5:00:20 下午 org.apache.coyote.AbstractProtocol init 信息: Initializing ProtocolHandler ["http-bio-80"] 七月 21, 2019 5:00:20 下午 org.apache.catalina.core.StandardService startInternal 信息: Starting service Tomcat 七月 21, 2019 5:00:20 下午 org.apache.catalina.core.StandardEngine startInternal 信息: Starting Servlet Engine: Apache Tomcat/7.0.37 七月 21, 2019 5:00:21 下午 org.apache.catalina.core.ContainerBase startInternal 严重: A child container failed during start java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[/travel]] at java.util.concurrent.FutureTask.report(FutureTask.java:122) at java.util.concurrent.FutureTask.get(FutureTask.java:192) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123) at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:800) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[/travel]] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154) ... 6 more Caused by: java.lang.IllegalArgumentException: Invalid <url-pattern> #write/* in servlet mapping at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:3223) at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:3198) at org.apache.catalina.deploy.WebXml.configureContext(WebXml.java:1366) at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1353) at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:878) at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:369) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5179) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ... 6 more 七月 21, 2019 5:00:21 下午 org.apache.catalina.core.ContainerBase startInternal 严重: A child container failed during start java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost]] at java.util.concurrent.FutureTask.report(FutureTask.java:122) at java.util.concurrent.FutureTask.get(FutureTask.java:192) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123) at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:302) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:732) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.startup.Tomcat.start(Tomcat.java:335) at org.apache.tomcat.maven.plugin.tomcat7.run.AbstractRunMojo.startContainer(AbstractRunMojo.java:1091) at org.apache.tomcat.maven.plugin.tomcat7.run.AbstractRunMojo.execute(AbstractRunMojo.java:512) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288) at org.apache.maven.cli.MavenCli.main(MavenCli.java:199) 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.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) at org.codehaus.classworlds.Launcher.main(Launcher.java:47) Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost]] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: org.apache.catalina.LifecycleException: A child container failed during start at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1131) at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:800) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ... 6 more [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 3.989 s [INFO] Finished at: 2019-07-21T17:00:21+08:00 [INFO] Final Memory: 32M/279M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.1:run (default-cli) on project travel: Could not start Tomcat: Failed to start component [StandardServer[-1]]: Failed to start component [StandardService[Tomcat]]: Failed to start component [StandardEngine[Tomcat]]: A child container failed during start -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException Process finished with exit code 1

Exception.printStackTrace返回自定义异常的toString的信息

![图片说明](https://img-ask.csdn.net/upload/201911/23/1574475475_805126.png) ![图片说明](https://img-ask.csdn.net/upload/201911/23/1574475495_39173.png) ![图片说明](https://img-ask.csdn.net/upload/201911/23/1574475588_689049.png) 大佬看下,为啥最后打印e.printStackTrace();打印出来的是“自定义的异常toString”,不是应该打印“亲"+name+"已经被注册了!”吗![图片说明](https://img-ask.csdn.net/upload/201911/23/1574477894_499455.png)![图片说明](https://img-ask.csdn.net/upload/201911/23/1574477904_797471.png) 看源码也没看明白,Throwable中的this是谁的对象啊,为啥转String之后就变成了“ExcpetionTest.CustomException: 自定义的异常toString”。 初始化的时候也没看见获取重写的那两个方法的相关代码,这俩重写的方法返回值是什么时候过去的?怎么过去的?

程序员的兼职技能课

程序员的兼职技能课

为linux系统设计一个简单的二级文件系统

实验目的: 通过一个简单多用户文件系统的设计,加深理解文件系统的内部功能及内部实现。 实验要求: 为linux系统设计一个简单的二级文件系统。要求做到以下几点: (1)可以实现下列几条命令(至少4条)

CCNA+HCNA+wireshark抓包综合网工技能提升套餐

本套餐包含思科路由交换CCNA,部分CCNP核心,华为HCNA以及wireshark抓包等类容,旨在培养具有综合能力的网络工程师。

董付国老师Python全栈学习优惠套餐

购买套餐的朋友可以关注微信公众号“Python小屋”,上传付款截图,然后领取董老师任意图书1本。

成年人用得到的6款资源网站!各个都是宝藏,绝对让你大饱眼福!

不管是学习还是工作,我们都需要一些资源帮助我们有效地解决实际问题。 很多人找资源只知道上百度,但是你们知道吗,有的资源是百度也搜索不出来的,那么今天小编就给大家介绍几款好用的资源网站,大家赶紧收入囊中吧! 1.网盘007 https://wangpan007.com/ 一款全能的资源搜索网站!只需要输入关键字,就能获得你想要的视频、音乐、压缩包等各种资源,网上...

矿车轴载荷计算方法的比较及选用

针对矿车轴的弯曲损坏,分析了固定式矿车车轴的受力,并对力叠加法以及当量负荷法2种计算方法进行了分析和比较,认为应采用当量负荷法进行车轴的设计计算。

Python数据清洗实战入门

Python数据清洗实战入门

C/C++跨平台研发从基础到高阶实战系列套餐

一 专题从基础的C语言核心到c++ 和stl完成基础强化; 二 再到数据结构,设计模式完成专业计算机技能强化; 三 通过跨平台网络编程,linux编程,qt界面编程,mfc编程,windows编程,c++与lua联合编程来完成应用强化 四 最后通过基于ffmpeg的音视频播放器,直播推流,屏幕录像,

Polar编码matlab程序

matlab实现的Polar codes源程序

2019全国大学生数学建模竞赛C题原版优秀论文

2019全国大学生数学建模竞赛C题原版优秀论文,PDF原版论文,不是图片合成的,是可编辑的文字版。共三篇。 C044.pdf C137.pdf C308.pdf

Linux常用命令大全(非常全!!!)

Linux常用命令大全(非常全!!!) 最近都在和Linux打交道,感觉还不错。我觉得Linux相比windows比较麻烦的就是很多东西都要用命令来控制,当然,这也是很多人喜欢linux的原因,比较短小但却功能强大。我将我了解到的命令列举一下,仅供大家参考: 系统信息 arch 显示机器的处理器架构 uname -m 显示机器的处理器架构 uname -r 显示正在使用的内核版本 d...

Linux下聊天室实现(基于C)

在linux下的基于TCP/IP,采用socket通信的聊天室,实现进入聊天室,进行多人群聊,指定人进行私聊,群主管理员功能,颗进行禁言,提出群聊等操作。个人账号可修改昵称或者修改密码,还可进行找回密

一个较完整的Qt用户登录界面设计

一个较完整的Qt用户登录界面,稍微移植可用,用sqlite数据库存储用户名和密码,具有增加和删除用户的功能,开发环境为ubuntu16.04+Qt5.6.1,win7下程序也编译可用。贡献出来,共同学

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

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

【C语言】贪吃蛇游戏代码(Visual C++6.0实现)

本游戏代码参考《C语言项目开发全程实录(第二版)》第六章。代码已在Visual C++6.0环境下编译测试通过,可在VC++6.0编译器中导入工程编译运行查看效果,或者也可以直接运行Release或D

Android小项目——新闻APP(源码)

Android小项目——新闻APP(源码),一个很简单的可以练手的Android Demo Ps:下载之前可以先看一下这篇文章——https://blog.csdn.net/qq_34149526/a

网络工程师小白入门--【思科CCNA、华为HCNA等网络工程师认证】

网络工程师小白入门--【思科CCNA、华为HCNA等网络工程师认证】

Android音视频开发全套

Android平台音视频开发全套,涉及:FFmpeg软解码解码、Mediacodec硬解码编码、Openssl音频播放、OpenGL ES视频渲染、RTMP推流等核心重要知识点。

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

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

2019 Python开发者日-培训

2019 Python开发者日-培训

2019 AI开发者大会

2019 AI开发者大会

Windows版YOLOv4目标检测实战:训练自己的数据集

Windows版YOLOv4目标检测实战:训练自己的数据集

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

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

因为看了这些书,我大二就拿了华为Offer

四年了,四年,你知道大学这四年我怎么过的么?

Python可以这样学(第四季:数据分析与科学计算可视化)

Python可以这样学(第四季:数据分析与科学计算可视化)

我说我不会算法,阿里把我挂了。

不说了,字节跳动也反手把我挂了。

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

YOLOv3目标检测实战系列课程

《YOLOv3目标检测实战系列课程》旨在帮助大家掌握YOLOv3目标检测的训练、原理、源码与网络模型改进方法。 本课程的YOLOv3使用原作darknet(c语言编写),在Ubuntu系统上做项目演示。 本系列课程包括三门课: (1)《YOLOv3目标检测实战:训练自己的数据集》 包括:安装darknet、给自己的数据集打标签、整理自己的数据集、修改配置文件、训练自己的数据集、测试训练出的网络模型、性能统计(mAP计算和画出PR曲线)和先验框聚类。 (2)《YOLOv3目标检测:原理与源码解析》讲解YOLOv1、YOLOv2、YOLOv3的原理、程序流程并解析各层的源码。 (3)《YOLOv3目标检测:网络模型改进方法》讲解YOLOv3的改进方法,包括改进1:不显示指定类别目标的方法 (增加功能) ;改进2:合并BN层到卷积层 (加快推理速度) ; 改进3:使用GIoU指标和损失函数 (提高检测精度) ;改进4:tiny YOLOv3 (简化网络模型)并介绍 AlexeyAB/darknet项目。

DirectX修复工具V4.0增强版

DirectX修复工具(DirectX Repair)是一款系统级工具软件,简便易用。本程序为绿色版,无需安装,可直接运行。 本程序的主要功能是检测当前系统的DirectX状态,如果发现异常则进行修复

C++语言基础视频教程

C++语言基础视频教程

形考任务一答案.zip

国开电大VisualBasic程序设计形考任务答案 请同学选择课程实验栏目“实验1 欢迎程序”或“实验2 计时秒表程序”的其中之一,在VB集成开发环境中认真完成实验。

相关热词 c# 按行txt c#怎么扫条形码 c#打包html c# 实现刷新数据 c# 两个自定义控件重叠 c#浮点类型计算 c#.net 中文乱码 c# 时间排序 c# 必备书籍 c#异步网络通信
立即提问