求大神帮我看看 Spring中导入ApplicationContext出错了 怎么办

图片说明
第九行错误显示的是这个The package org.springframework.context is accessible from more than one module: spring.aspects, spring.context

0

2个回答

你把包都放到项目的lib目录下再构建路径试试

0

Build Path->Class Path 把这些包放到Class Path下 不要放到Module Path

0
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
Spring 创建出现的错误——ApplicationContext错误
在进行创建spring容器的时候出现了这样的错误提示: Type mismatch: cannot convert from ClassPathXmlApplicationContext to ApplicationContext (如下图所示) 出现这样出错误的原因在于我们在创建导入包的时候出现的错误: import org.apache.catalina.core.Applicat...
帮我看看 哪里出错了,求大神!!
message rndescription The server encountered an internal error () that prevented it from fulfilling this request.rnexception rnjavax.servlet.ServletException: java.lang.NullPointerExceptionrn org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:515)rn org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)rn com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:119)rn com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:55)rn org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:99)rn org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)rn org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)rn org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)rnroot cause rnrnjava.lang.NullPointerExceptionrn com.demo.struts2.actions.LoginAction.execute(LoginAction.java:36)rn sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)rn sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)rn java.lang.reflect.Method.invoke(Unknown Source)rn com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:404)rn com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:267)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:229)rn com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:150)rn org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:48)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:123)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:167)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:105)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:83)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:207)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:74)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:127)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:107)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:206)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:115)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:143)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:121)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:170)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:123)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn rnnote The full stack trace of the root cause is available in the JBoss Web/2.1.1.GA logs.rn
1.使用ApplicationContext的方式实例化Spring容器。
第一步:创建javaweb项目 第二步:导入必要的IOC包,这儿有五个 “commons-logging.jar” “spring-beans-3.2.8.RELEASE.jar” “spring-context-3.2.8.RELEASE.jar” “spring-core-3.2.8.RELEASE.jar” “spring-expression-3.2.8.RELEASE.ja
spring的配置文件applicationContext中没有快捷键问题
这个对于很多xml格式的配置文件编辑很有帮助,以spring配置文件为例:   myeclipse的童鞋进入:window -> Preferences-> MyEclipse -> Editors -> XML ->XML Catalog   eclipse的童鞋进入:window -> Preferences-> XML ->XML Catalog   或者再接再 Prefe
ApplicationContext.xml导入约束的一种方法
在 applicationContext.xml 里配置约束的一种方法
myeclipse中spring框架下依赖包添加源码,以及applicationContext.xml中设置bean的一些心得
刚学spring。有一些很弱的问题在这里做以记录。 一、在myeclipse下spring框架的工程中如何添加依赖包的源码。 工程目录如下: 要添加依赖包的源码应该在Referenced Libraries中,而不是在Junit4中,Jnuit4只是一个插件。两者中的类打开后区别如下: Referenced Libraries下的类打开后如为关联源码 则右侧有一个Attach Sour...
关于spring中初始化出差的问题applicationcontext.xml无法加载
关于spring出现  Exception in thread "main" java.lang.ExceptionInInitializerError,告错的问题: 在建立工程项目是,为了能够提供jar包支持,我创建了build path 添加了spring3.0 user library在这个名称下添加了所有spring的jar包支持。 为了能够发布项目我又在web的lib下添加了
Spring的配置文件ApplicationContext.xml配置头文件解析
spring中的applicationContext.xml配置头文件解析 xml version="1.0" encoding="UTF-8"?> beans xmlns="http://www.springframework.org/schema/beans"      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instan
【Spring实践】运用Spring封装好的ApplicationContext实现策略模式+反射
之前一篇文章写过有关设计模式的博客: 策略模式+简单工厂实现消费金额的计算 ps:这篇博客是最开始学习VB语言的时候写的,当时还不懂spring,写的比较简单。 本篇博客是有关在项目中通过spring来实现策略模式+反射,从而灵活扩展业务实现类。 spring本身已经将反射的功能很好的封装了。我们进一步封装一个关于反射的工具类 代码如下:SpringContextHolder 工具类 ...
Spring学习-03:ApplicationContext加载配置文件的两种方式
Spring框架加载配置文件: ApplicationContext应用上下文,加载Spring框架配置文件。它有两个子类: ClassPathXmlApplicationContext:加载classpath下面的配置文件 public void demo2(){ //创建一个工厂类 ApplicationContext applicationContext = new Cla
出错了,帮我看看
org.hibernate.exception.GenericJDBCException: Cannot open connectionrn at org.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:92)rn at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:80)rn at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)rn at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)rn at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:301)rn at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:110)rn at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:76)rn at org.hibernate.persister.entity.BasicEntityPersister.insert(BasicEntityPersister.java:1739)rn at org.hibernate.persister.entity.BasicEntityPersister.insert(BasicEntityPersister.java:2178)rn at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:34)rn at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:239)rn at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:240)rn at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:160)rn at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:95)rn at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:184)rn at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)rn at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:173)rn at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)rn at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:69)rn at org.hibernate.impl.SessionImpl.save(SessionImpl.java:481)rn at org.hibernate.impl.SessionImpl.save(SessionImpl.java:476)rn at cn.somsoft.myznt.dao.impl.IUserDAOImpl.register(IUserDAOImpl.java:12)rn at cn.somsoft.myznt.struts.action.UserAction.register(UserAction.java:73)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)rn at java.lang.reflect.Method.invoke(Unknown Source)rn at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:270)rn at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:187)rn at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)rn at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)rn at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)rn at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)rn at cn.somsoft.myznt.filter.EncodingFilter.doFilter(EncodingFilter.java:21)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)rn at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)rn at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)rn at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)rn at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)rn at java.lang.Thread.run(Unknown Source)rnCaused by: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'rn at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1150)rn at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)rn at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:81)rn at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:298)rn ... 47 morernCaused by: java.sql.SQLException: No suitable driverrn at java.sql.DriverManager.getDriver(Unknown Source)rn at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1143)rn ... 50 more
出错了!!帮我看看!
format('%s,%d bytes',[temps,getfilesize(temps)]);rn这一句出现了错误:[Error] Unit1.pas(302): E2010 Incompatible types: 'Cardinal' and 'string'rn我不知道是哪个参数错了,这里面好象没有Cardinal类型吧~rn这个是getfilesize的代码:rn[code=Delphi(Pascal)]rnfunction getfilesize(const filename:string):longint;rnvarrnsearchrec:Tsearchrec;rnbeginrnif findfirst(expandfilename(filename),faanyfile,searchrec)=0 thenrnresult:=searchrec.Sizernelse result:=-1rnend;rn[/code]rn帮我改改~谢谢了
applicationContext使用配置文件的值后报错
最近在搭建mavne项目,springmvc+spring+ibatis,测试什么都通过了,但是在数据库连接池使用properties文件引入后就报错 配置文件的配置如下: 当写死的时候测试时通过的,那么问题就一定是在读取的时候没有加载到配置文件,导致把${driberClass}当做了值,而不是用这个获取配置文件的值 最终解决方法就是配置文件加多了一个配置如下 只要把
刚学spring的问题
求看看spring的问题刚刚学习spring,在网上下的demo,感觉也对,就是不知道哪里错了
hibernate学生-课程-成绩
本人做一个hibernate学生-课程-成绩,的对于关系,数据能到数据库中去,但还是报了错,是配置文件出错了,求高手帮我改改。
求大神们看看哪里出错了
ImageView img1; Button bt1, bt2; int j=0; Drawable d[] = { this.getResources().getDrawable(R.drawable.horse1), this.getResources().getDrawable(R.drawable.horse2), this.getResources().getDrawable(
页面出错了 求大神帮忙看看
<%rnusername=replace(request.form("TxtUserName"),"'","''")rnpassword=replace(request.form("TxtPassword"),"'","''")rnsql="select * from user where(U_Name='"&username&"' and U_Pwd='"&password&"')"rnset rs=server.createobject("adodb.recordset")rnrs.open sql,conn,1,3rnif not rs.eof thenrn select case rs("U_Qx")rn case 0:rn session("check")="checked"rn response.Redirect "guanli.asp?id=<%=rs("U_ID")%>"rn case 1rn response.redirect "Default.asp?id=<%=rs("U_ID")%>"rn end selectrnelsernsession("check")=""rnresponse.Write " 对不起,请填写正确的信息"rnresponse.Write " 点击放回登陆页面 "rnend ifrnrs.closernconn.closern%>rn
求大神帮忙看看哪里出错了。
我想实现用户之间的通信,思想是建立一个消息表,然后把收件人用户名、发件人用户名、消息等放进去,然后谁想看发给自己的消息就去消息表中查找收件人是自己的记录。现在做到发消息这一块儿了,发完消息我发现[color=#FF0000]数据库消息表中并没有记录[/color],应该是没有正确插入表中,大神帮忙看看是哪里错了,我也是刚接触PHP的,以前上课学的东西都是基础的,运用到实践中总是出很多问题。rn下面附上相关的代码([color=#FF0000]其中sqltable是用户表,sqltable2是消息表,user_name是用户表中存储用户名的,s_name是消息表中存储发件人的,r_name是消息表中收件人[/color])rnrn[color=#FF0000]config.php[/color]rn[code=php][/code]rnrn[color=#FF0000]message.php[/color]rn[code=php]location.href='index.php';";rnexit;rnrn//上面的要验证过滤的rn?>rnrnrnrn rn 给管理员发信rnrnrnrn rn rn 发信(message.php)||返回rn rn rn 收件人:rn rn rn rn 消息内容:rn rn rn rn   rn rn rn rn rnrnrnrn[/code]rnrn[color=#FF0000]message_cl.php[/color]rn[code=php]location.href='index.php';";rnexit;rn$_SESSION["name"]=$row[user_name];rn//这里是SESSION来验证用户的合法性rnrninclude("config.php"); //参数页面提取过来rnrnif(empty($_POST["r_name"]))rnecho (" ");rnexit;rnrnif(empty($_POST["content"]))rnecho (" ");rnexit;rnrnrn$s_name=$_SESSION["name"];rn$r_names=$_POST["r_name"];rn$content=$_POST["content"];rn$add_time=date("Y-m-d");rn$is_open="no";rnrn$db=mysql_connect($servername,$sqlservername,$sqlserverpws);rnrnmysql_select_db($sqlname,$db) ;rn$sql="select * from $sqltable where user_name='$s_name'";rn$result=mysql_fetch_row(mysql_query($sql));rnrnif(!$result)rnecho (" ");rnrnelsern$sql="insert into $sqltable2(s_name,r_name,content,add_time,is_open) values('$s_name','$r_name','$content','$add_time','$is_open') ";rnmysql_query($sql);rnrnecho (" ");rnrn?>[/code]
求大神帮我看看这句SQL哪里出错了
insert into t_jiuzhen (id,brid, brname, by, ysid, bs) values (4,2,‘1’,‘1’,3, 0)这句SQL哪里错了。
手动加载spring, ApplicationContext怎么销毁
原帖地址http://blog.sina.com.cn/s/blog_5db0dfe40101bsb4.html 感谢原帖博主 AbstractApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml"); ctx.close(); 在非Web应用中,手工加载Spring
Spring中ApplicationContext加载机制
Spring中ApplicationContext加载机制
javaEE Spring,Spring好处,Spring简单搭建;注册对象到Spring容器,获取Spring容器中的对象(ApplicationContext)
Jar包下载:https://pan.baidu.com/s/1dhWvWuksAIJ0YnBzCsV_mg  密码:8h7b   IOC :控制反转,将对象的创建权交给了 Spring.DI :Dependency Injection 依赖注入.需要有 IOC 的环境,Spring 创建这个类的过程中,Spring 将类的依 赖的属性设置进去. Spring的好处(Spring其实就是...
求高手帮我看看哪里出错了
我用C语言编写的“QQ会员信息管理系统”rn其中内容包括:1. 每个QQ会员的信息包含会员名称,性别,年龄,Q币余额和会员期限这五项信息。rn2. 实现以下功能:显示(即打印)、查找(按会员名称)、更改、插入、删除、升序排序(按会员名称)。rn用结构体数组编写的。rn编译没有任何错误,但是运行显示的却不是我编写的菜单界面。下面是我的的代码。rn#include rn#include rn#include rn#include rnint QQhyNum=0;//全局变量,记录QQ会员人数。rnint flag =0;//全局变量,记录执行删除和插入后QQ会员人数的变化rnstruct addresslistrnrn int num;rn char name[20];//QQ会员名称rn char sex[10];//QQ会员性别rn int age[10];//QQ会员年龄rn float surp[10];//QQ会员余额rn float time[10];//QQ会员期限rnQQhy[100];rnint menu();//界面菜单rnvoid end();//退出系统rnvoid save();//保存QQ会员信息到文件中rnvoid print(struct addresslist *P);//打印某QQ会员的信息rnvoid input(struct addresslist *P,int n);//插入某QQ会员信息rnvoid find(struct addresslist *P);//查找某QQ会员信息rnvoid change(struct addresslist *P);//更改某QQ会员信息rnvoid sort(struct addresslist *P);//按照QQ会员名称排序rnvoid dele(struct addresslist *p);//删除某位会员的信息rnvoid insert();//插入某位会员的信息rnchar returnToMenu(void);//返回主菜单rnvoid main()rnrn int i,peopleNum;rn FILE *fp;rn char chose;rn if((fp=fopen("QQ会员信息表.txt","r+"))==NULL)rn rn printf("文件打不开!\n");rn exit(0);rn rn i=0;rn dorn rn i=0;rn while(!feof(fp))rn rn fread(&QQhy[i],sizeof(struct addresslist),1,fp);rn i++;rn QQhyNum++;rn rn switch(menu())rn rn case 1:rn system("cls");rn print(QQhy);rn chose=returnToMenu();rn break;rn case 2:rn find(QQhy-flag);rn chose=returnToMenu();rn break;rn case 3:rn system("cls");rn print(QQhy);rn chose=returnToMenu();rn break;rn case 4:rn dele(QQhy);rn chose=returnToMenu();rn break;rn case 5:rn system("cls");rn printf("请输入要录入的人数\n");rn scanf("%d",&peopleNum);rn while(peopleNum--)rn rn insert();rn rn chose=returnToMenu();rn break;rn case 6:rn system("cls");rn sort(QQhy);rn chose=returnToMenu();rn break;rn case 7:rn system("cls");rn end();rn break;rn default:rn printf("输入错误");rn chose=returnToMenu();rn break;rnrn rn rn while(chose!='Y' && chose!='y');rn if(chose=='Y' || chose=='y')rn rn system("cls");//*****rn end();rn rn fclose(fp);rnrn//菜单显示rn int menu()rn rn int num;rn system("cls");rn printf("****************************************QQ信息表***************************************\n\n");rn printf("\t1、录入");rn printf("\t2、查找");rn printf("\t3、更改");rn printf("\t4、删除");rn printf("\t5、插入");rn printf("\t6、排序");rn printf("\t7、退出\n\n");rn printf("***************************************************************************************\n\n");rn printf("请输入你想要执行的操作数:");rn fflush(stdin);rn scanf("%d",&num);rn return num;rn rn//把信息录入文件保存rn void save()rn rn int i;rn FILE *fp;rn if((fp=fopen("QQ会员信息表.txt","w"))==NULL)rn rn printf("\n\t\t文件打开失败!");rn rn for(i=0;i0;i--,p++)rn rn printf("名称:%s\n性别:%s\n年龄:%d\nQ币余额:%f\n会员期限:%f\n",p->name,p->sex,p->age,p->surp,p->time);rn printf("\n*********************************************************************************\n");rn rn rn //输入某QQ会员信息rn void input(struct addresslist *p,int n)rn rn static int i=0;rn printf("请输入第%d个QQ会员信息:\n",++i);rn printf("请输入名称:");rn scanf("%s",p->name);rn printf("请输入性别:");rn scanf("%s",p->sex);rn printf("请输入年龄:");rn scanf("%d",p->age);rn printf("请输入Q币余额:");rn scanf("%f",p->surp);rn printf("请输入会员期限:");rn scanf("%f",p->time);rn printf("\n");rn printf("**********************************************输入完成!!***************************************************\n");rn rn //按QQ会员名称对QQ信息排序rn void sort(struct addresslist *p)rn rn int j,i;rn struct addresslist temp;rn printf("\t\t\t按名称排序后:\n");rn for(i=0;i0)rn rn temp=QQhy[j];rn QQhy[j]=QQhy[j+1];rn QQhy[j+1]=temp;rn rn rn rn print(QQhy);rn rn /*按会员名称查找会员信息*/rn void find(struct addresslist *p)rn rn char name2[20];rn int i;rn system("cls");rn printf("请输入要查找的QQ会员名称:");rn fflush(stdin);rn scanf("%s",&name2);rn for(i=0;iname),name2)==0)rn rn printf("\n\n%sQQ会员信息如下:\n\n",name2);rn printf("名称:%s\n性别:%s\n年龄:%d\nQ币余额:%f\n会员期限:%f\n",p->name,p->sex,p->age,p->surp,p->time);rnrn rn if(i==QQhyNum)rn printf("没有找到相关会员信息!\n");rnrnrn rn /*删除某会员信息*/rn void dele(struct addresslist *p)//******rn rn char name3[20];rn int i=0,j;rn char choice;rn system("cls");rn printf("请输入要删除的QQ会员名称:");rn scanf("%s",&name3);rn for(i=0;i<=QQhyNum+flag;p++,i++)rn if(strcmp((p->name),name3)==0)rn rn printf("\n\n%sQQ会员信息如下:\n\n",name3);rn printf("名称:%s\n性别:%s\n年龄:%d\nQ币余额:%f\n会员期限:%f\n",p->name,p->sex,p->age,p->surp,p->time);rn printf("\n确定删除Y或N");rn fflush(stdin);rn choice=getchar();rn if(choice=='Y' || choice=='y')rn rn for(j=i-1;j<=QQhyNum+flag;j++)rn QQhy[j+1]=QQhy[j+2];rn printf("\t已成功删除!");rn flag--;rn save();rn rn elsern printf("已取消删除!");rn rnrn rn if(i==QQhyNum+flag)rn printf("没有找到相关会员信息!");rn rn rn /*插入会员信息*/rn void insert()//*****rn rn printf("请输入要插入会员信息:\n");rn input(&QQhy[QQhyNum+flag-1],1);rn flag++;rn save();rn rn /*更改某会员信息*/rn void change(struct addresslist *p)rn rn int i,enter;rn char add,name4[20],choice;//*****rn printf("请输入要删除的QQ会员名称:");rn scanf("%s",&name4);rn for(i=0;i<=QQhyNum+flag;p++,i++)rn if(p->name==name4)rn rn printf("\n\n%sQQ会员信息如下:\n\n",name4);rn printf("***************************************************************************************");rn printf("名称:%s\n性别:%s\n年龄:%d\nQ币余额:%f\n会员期限:%f\n",p->name,p->sex,p->age,p->surp,p->time);rn printf("***************************************************************************************");rn printf("\n1、更改会员名称\n2、更改会员性别\n3、更改会员年龄\n4、更改会员Q币余额\n5、更改会员期限\n");rn dorn rn printf("请输入要更改的序号:");rn scanf("%d",&enter);rn while(enter>5 || enter<1)rn rn printf("输入错误!!\n请再次选择:");rn getchar();rn scanf("%d",&enter);rn rn switch(enter)rn rn case 1:rn printf("请输入该会员新名称:");rn scanf("%d",&p->name);rn break;rn case 2:rn printf("请输入该会员性别:");rn scanf("%d",&p->sex);rn break;rn case 3:rn printf("请输入该会员年龄:");rn scanf("%d",&p->age);rn break;rn case 4:rn printf("请输入该会员新余额:");rn scanf("%d",&p->surp);rn break;rn case 5:rn printf("请输入该会员新期限:");rn scanf("%d",&p->time);rn break;rnrn rn printf("\n是否还要更改其他会员信息?需要请按Y/y:");rn getchar();rn scanf("%c",&choice);rn rn while(choice=='y' || choice=='Y');rn save();rn printf("更改后会员信息为:\n");rn printf("名称:%s\n性别:%s\n年龄:%d\nQ币余额:%f\n会员期限:%f\n",p->name,p->sex,p->age,p->surp,p->time);rn break;rn rn /*找不到更改的会员,询问是否添加*/rn if(i==QQhyNum)rn rn printf("没有此会员!\n是否添加Y/N:");rn //char add;rn getchar();rn scanf("%c",&add);rn if(add=='y' || add=='Y')rn rn insert();rn rn rn rnrn rn /*返回菜单*/rn char returnToMenu(void)rn rn char ch;rn printf("\n退出按Y,否则按其他键:");rn fflush(stdin);rn ch=getchar();rn return(ch);rn rn /*退出系统*/rn void end()rn rn printf("*******************************************谢谢使用!********************************************");rn exit(0);rn rnrnrn
关于applicationContext.xml文件中的一些标签及详解
&amp;lt;beans xmlns=&quot;http://www.springframework.org/schema/beans&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:aop=&quot;http://www.springframework.org/schema/aop&quot; xmlns:tx=&quot;http://www.spri...
Spring中ApplicationContext对事件传递
Spring中ApplicationContext对事件传递
path环境变量某路径下存在别的java.exe导致出错
在命令行下输:java -version 提示: Registry key ‘Software/JavaSoft/Java Runtime Environment/CurrentVersion’ has value ‘1.8’, but ‘1.7’ is required. Error: could not find java.dll Error: could not fi...
sping的applicationContext中没有属性和类提示的处理方法
状况描述: spring的属性文件applicatinContext中,bean标签这些能主动提示,但是标签内的一些属性和类提示没有出现。具体如下图所示: 想要达成的效果: 具体解决办法: 1.安装spring IDE插件 help-&amp;gt;install new software-&amp;gt;输入网址查询对应eclipse当前版本的spring IDE (网址:http://...
Spring中BeanFactory和ApplicationContext的生命周期及其区别详解
Bean的生命周期在很多技术中,都有生命周期这个概念,如在Android中,有Activity、Fragment等的生命周期;在Web容器中,有Servlet的生命周期。想要成为高级开发者,就必须要深入理解其生命周期。同样的,在Spring容器中的Bean也有一系列的生命周期,要掌握好Spring,就要先掌握Spring中Bean的生命周期。在Spring中,可以从两个层面定义Bean的生命周期:一
Spring 无法读取applicationContext.xml配置文件异常
异常描述: 无法读取xml文件 异常信息: 异常原因: Xml文件引入模块或者约束没改完全 解决方案: 解决人: 陈琪 备注:      ...
文件恢复利器
文件丢失了怎么办?U盘出错了怎么办?不要着急,有它,支持U盘丢失文件恢复
读取Spring的配置文件applicationContext.xml的5种方法
1.利用ClassPathXmlApplicationContext,这种方式配置文件应该放在类包同路径下 Java代码: ApplicationContext ct=new ClassPathXmlApplicationContext("applicationContext01.xml"); ct.getBean(""); 2.利用FileSystemXmlApplic
出错了!帮我看看小问题!
sql="select * from t1 where pvs_ID=" & request("pvs_ID") rnset rs=server.createobject("adodb.recordset") rnrs.open sql,conn,3 rnrnsql1="select * from t2 where mem_ID=" & rs("pvs_name")rnset rs1=server.createobject("adodb.recordset") rnrs1.open sql1,conn,3 rnrn出错了,好象是第二个,sql1的问题 rn
帮我看看哪里出错了??
给定一句英语,要求你编写程序,将句中所有单词的顺序颠倒输出。rnrn输入格式:测试输入包含一个测试用例,在一行内给出总长度不超过80的字符串。字符串由若干单词和若干空格组成,其中单词是由英文字母(大小写有区分)组成的字符串,单词之间用1个空格分开,输入保证句子末尾没有多余的空格。rnrn输出格式:每个测试用例的输出占一行,输出倒序后的句子。rnrn输入样例:rnHello World Here I Comern输出样例:rnCome I Here World Hellornrn这是题目rnrn[code=c]#include rn#include rn#define SIZE 80rnchar *s_gets(char *str,unsigned short n);rnrnint main(void)rn char a[SIZE];rn short i,j,k;rnrn s_gets(a,SIZE);rn i=strlen(a)-1;rn while(i)rn k=i;rn while(a[i]!=' ' && i>=0)rn i--;rn rn for(j=i+1;j<=k;j++)rn putchar(a[j]);rn i--;rn rnrn return 0;rnrnrnchar *s_gets(char *str,unsigned short n)rn char *p;rn unsigned short i=0;rnrn p=fgets(str,SIZE,stdin);rn if(p)rn while(p[i]!='\n' && p[i]!='\0')rn i++;rn if(p[i]=='\n')rn p[i]='\0';rn elsern while(getchar()!='\n')rn continue;rn rnrn return p;rnrn[/code]rnrn[img=https://img-bbs.csdn.net/upload/201804/13/1523590704_864240.png][/img]
帮我看看 哪里出错了
[code=VB.NET]rn e.Row.Attributes.Add("onclick", String.Format("javascript:document.getElementById('0').click()", e.Row.Cells(0).FindControl("btnDetial").ClientID))rnrn[/code]rnrn错误:rnObject reference not set to an instance of an object.
帮我看看那里出错了!
SqlCommand cmd = new SqlCommand("SELECT max(id) FROM TAB_Spmx",cn);rnmax = Convert.ToInt32(cmd.ExecuteScalar());rnrn数据库里面有个字段为id 类型为varcharrnidrn---rn78rn---rn79rn---rn80rn---rn100rnrn使用SqlCommand cmd = new SqlCommand("SELECT max(id) FROM TAB_Spmx",cn);这句的是时候,我应该得到“100”这个字符的值,但是,我得到的是“80”!rnmax()这个函数,到底是怎么解释的啊,为什么我得不到“100”这个值!?rn
帮我看看那出错了
帮我看看那出错了。这教材也太烂了。原样写出来编译就报错。rn#include rnusing namespace std; rnrnrnint main()rnrn struct coures_workrn rn char course1[20];rn char course2[20];rn struct course_work *prt;rn ;rn course_work semester[3]=rn "Computer 101","Math101",&semester[1],rn "System 101","Math 102",&semester[2],rn "Analysis 101","Calculus",&semester[0];rn int i;rn for(i=0;i<=2;i++)rn rn cout<<"contents being pointed to:"<course1<dis_1.cpprn1>d:\my documents\visual studio 2008\projects\c++ file\dis\dis\dis_1.cpp(14) : error C2552: “semester”: 不能用初始值设定项列表初始化非聚合rn1> “course_work”: 不聚合带用户定义的构造函数的类型rn1>d:\my documents\visual studio 2008\projects\c++ file\dis\dis\dis_1.cpp(14) : error C2036: “course_work *”: 未知的大小rn1>d:\my documents\visual studio 2008\projects\c++ file\dis\dis\dis_1.cpp(15) : error C2079: “semester”使用未定义的 struct“semester”rn1>d:\my documents\visual studio 2008\projects\c++ file\dis\dis\dis_1.cpp(15) : error C2078: 初始值设定项太多rn1>d:\my documents\visual studio 2008\projects\c++ file\dis\dis\dis_1.cpp(15) : error C2036: “course_work *”: 未知的大小rn1>d:\my documents\visual studio 2008\projects\c++ file\dis\dis\dis_1.cpp(16) : error C2036: “course_work *”: 未知的大小rn1>d:\my documents\visual studio 2008\projects\c++ file\dis\dis\dis_1.cpp(16) : error C2143: 语法错误 : 缺少“”(在“;”的前面)rn1>d:\my documents\visual studio 2008\projects\c++ file\dis\dis\dis_1.cpp(16) : error C2143: 语法错误 : 缺少“”(在“;”的前面)rn1>d:\my documents\visual studio 2008\projects\c++ file\dis\dis\dis_1.cpp(20) : error C2036: “course_work *”: 未知的大小rn1>d:\my documents\visual studio 2008\projects\c++ file\dis\dis\dis_1.cpp(20) : error C2027: 使用了未定义类型“course_work”rn1> d:\my documents\visual studio 2008\projects\c++ file\dis\dis\dis_1.cpp(11) : 参见“course_work”的声明rn1>d:\my documents\visual studio 2008\projects\c++ file\dis\dis\dis_1.cpp(20) : error C2228: “.prt”的左边必须有类/结构/联合rn1>d:\my documents\visual studio 2008\projects\c++ file\dis\dis\dis_1.cpp(20) : error C2227: “->course1”的左边必须指向类/结构/联合/泛型类型rn1>生成日志保存在“file://d:\My Documents\Visual Studio 2008\Projects\C++ file\dis\dis\Debug\BuildLog.htm”rn1>dis - 12 个错误,0 个警告rn========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========rn
代码出错了!帮我看看!
我做了一个上传图片的页面,出现如下错误rnrn错误类型:rnMicrosoft VBScript 运行时错误 (0x800A0005)rn无效的过程调用或参数: 'MidB'rn/tmsite/pages/upload.asp, 第 16 行rnrnrn第16行代码是rnrn FormFieldName = bin2str(MidB(FormData,FieldNameStart,FieldNameSize))rnrn是什么原因呀?
spring配置文件applicationContext.xml不能提示的解决方法
依次打开windows→preference→myeclipse→iles and editors→xml→xmlcatalog点击Add 在Add XML Catalog Element窗口中选择File System..选择对应spring的xsd文件Key 改为http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
spring项目中获取ApplicationContext对象,然后手动获取bean
   在服务器启动过程中,spring容器也会初始化,那么当然,Spring的ApplicationContext对象肯定也在这个过程中会被初始化了,那么我们如何在java类中手动去获取得到这个对象呢?    首先, 我们为什么要去获取这个ApplicationContext对象?,获取到了我们能干什么呢? -- 能手动从Spring获取所需要的bean // 获取bean 方法1 publ...
applicationContext.xml文件中怎么配置struts2和spring配置文件的加载路径
在appltionContext.xml文件中的配置方法如下: contextConfigLocation classpath*:springCfg/spring-*.xml org.springframework.web.context.ContextLoaderListener
文章热词 机器学习教程 Objective-C培训 交互设计视频教程 颜色模型 设计制作学习
相关热词 mysql关联查询两次本表 native底部 react extjs glyph 图标 java大神班 大数据大神班