spring-mybatis.xml配置出错了,请大神看看

这是第一个错

org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.fishoad.services.QuartzService] for bean with name 'quartzTask' defined in class path resource [spring-quartz.xml]; nested exception is java.lang.ClassNotFoundException: com.fishoad.services.QuartzService
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1327)
Caused by: java.lang.ClassNotFoundException: com.fishoad.services.QuartzService
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
`



三月 07, 2016 10:49:24 上午 org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-mybatis.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'org.springframework.core.io.Resource[]' for property 'mapperLocations'; nested exception is java.lang.IllegalArgumentException: Could not resolve resource location pattern [classpath:/com/fishoad/dao/*.xml]: class path resource [com/fishoad/dao/] cannot be resolved to URL because it does not exist
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:547)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)

第二个错

Caused by: org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'org.springframework.core.io.Resource[]' for property 'mapperLocations'; nested exception is java.lang.IllegalArgumentException: Could not resolve resource location pattern [classpath:/com/fishoad/dao/*.xml]: class path resource [com/fishoad/dao/] cannot be resolved to URL because it does not exist
at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:479)
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:511)
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:505)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1502)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1461)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1197)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
... 21 more
Caused by: java.lang.IllegalArgumentException: Could not resolve resource location pattern [classpath:/com/fishoad/dao/*.xml]: class path resource [com/fishoad/dao/] cannot be resolved to URL because it does not exist
at org.springframework.core.io.support.ResourceArrayPropertyEditor.setAsText(ResourceArrayPropertyEditor.java:140)
at org.springframework.beans.TypeConverterDelegate.doConvertTextValue(TypeConverterDelegate.java:430)
at org.springframework.beans.TypeConverterDelegate.doConvertValue(TypeConverterDelegate.java:403)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:181)
at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:459)
... 27 more


8个回答

在pom.xml 下面的build便签下加上


src/main/resources

/*.properties
/*.xml
**/*.tld

false

class path resource [com/fishoad/dao/] cannot be resolved to URL because it does not exist
提升路径不存在啊。

fnzf14428547
fnzf14428547 在的啊
3 年多之前 回复

对了你第一个错误 com.fishoad.services.QuartzService 这个也没有。

rui888
无法显示此用户 回复fnzf14428547: 你这个QuartzService 是定时任务用到的吗?现在没有找到,你先去掉看看,不清楚为什么
3 年多之前 回复
fnzf14428547
fnzf14428547 可是我也有啊,是不是他没找到我的文件啊,这些都有啊,文件错了也不报错,我不知道什么情况
3 年多之前 回复

配置文件路径修正下:classpath:/com/fishoad/dao/*.xml去掉第一个斜杠试试。

wojiushiwo945you
毕小宝 回复fnzf14428547: 那你把项目clean下,重新编译项目试试。
3 年多之前 回复
fnzf14428547
fnzf14428547 好像是classes文件下都没有编译这些文件
3 年多之前 回复

在POM.XML文件追加

  <resources>  
    <!--编译之后包含xml-->  
    <resource>  
      <directory>src/main/java</directory>  
      <includes>  
        <include>**/*.xml</include>  
      </includes>  
      <filtering>true</filtering>  
    </resource>  
  </resources>  

更新一下

    <resources>
        <!--编译之后包含xml-->
        <resource>
            <directory>src/main/java</directory>
            <includes>
                <include>**/*.xml</include>
            </includes>
            <filtering>true</filtering>
        </resource>
    </resources>

</build>
<build>
    <resources>
        <!--编译之后包含xml-->
        <resource>
            <directory>src/main/java</directory>
            <includes>
                <include>**/*.xml</include>
            </includes>
            <filtering>true</filtering>
        </resource>
    </resources>

</build>
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
locate出错了,请看看!
谢谢
sql出错了,请看看!
下面语句中要求在xg1.db中满足“名次”(字符型,但都是数字)中大于10的记录,运行时出错,请问我应该怎么写,谢谢!!rn query1.close;rn query1.sql.clear;rn query1.sql.add('select * from xg1');rn query1.sql.add(' where '+strtoint(名次)>10);rn query1.open;rn
复制文件出错了,请看看!!
我用下面语句将image1的图形文件复制到d:\abcd.jpg文件中,无法实现,请教如何解决!!谢谢rn copyfile(pchar(image1.Picture.Graphic),pchar('d:\abcd.jpg'),false);
求大神们看看哪里出错了
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
帮我看看 哪里出错了,求大神!!
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
求大神帮忙看看哪里出错了。
我想实现用户之间的通信,思想是建立一个消息表,然后把收件人用户名、发件人用户名、消息等放进去,然后谁想看发给自己的消息就去消息表中查找收件人是自己的记录。现在做到发消息这一块儿了,发完消息我发现[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]
大神帮忙看看哪里出错了
<%@ page language="java" import="java.sql.*" pageEncoding="utf-8"%>rnrnrnrnrn rn rn rn My JSP 'delete2.jsp' starting pagern rn rnrn rn rn rn <% String driverName="com.mysql.jdbc.Driver";rn String userName="root";rn String userPwd="";rn String dbName="students";rn String url1="jdbc:mysql://localhost:3306/"+dbName;rn String url2="?user="+userName+"&password="+userPwd;rn String url3="&useUnicode=true&characterEncoding=UTF-8";rn String url=url1+url2+url3;rn Class.forName(driverName);rn Connection conn=DriverManager.getConnection(url);rn request.setCharacterEncoding("utf-8");rn String name=request.getParameter("name");rn String sex=request.getParameter("sex");rn String ww1=request.getParameter("w1");rn String ww2=request.getParameter("w2");rn String s="1=1";rn if(!name.equals(""))s=s+"and name="+name+"";rn if(sex!=null)s=s+"and sex="+sex+"";rn float w1,w2;rn if(!ww1.equals(""))w1=Float.parseFloat(ww1);s=s+"and weight>="+w1;rn if(!ww2.equals(""))w2=Float.parseFloat(ww2);s=s+"and weight>="+w2;rn String sql="dalete from stu_info where"+s;rn PreparedStatement stmt=conn.prepareStatement(sql);rn int n=stmt.executeUpdate();rn if(n==1)%>数据删除成功! <%rn else%>数据删除失败 <%rn if(stmt!=null)stmt.close();rn if(conn!=null)conn.close(); rn %> rn rnrn
配置php+apache2.2 时出错了 求大神
php版本 5.4 apache2.2 配置步骤都做了 排除任何路径问题rn启动apache提示 弹出框提示 “the requested operation has failed”rnrn然后键入cmd 命令写出查询 httpd.conf文件错误行 rnD:\php\apache\bin>httpd.exe -w -n "Apache2" -k start rnrn路径没错但是dos下提示我命令不是内部命令或外部命令rn这是怎么回事?
请各位大神看看这个问题哪里出错了?
select u.id,rn u.username,rn u.password,rn u.work_mode,rn u.ip_address,rn u.stop_date,rn u.calling_station_id,rn u.is_binding,rn u.is_enable,rn u.account,rn u.company,rn u.department,rn u.orderno,rn u.accountnonexpired,rn u.accountnonlocked,rn u.credentialsnonexpired,rn u.enabled,rn u.name,rn u.gender,rn u.birthday,rn u.cardid,rn u.mobile,rn u.tel,rn u.email,rn u.description,rn u.NOT_FIRST_FLAG,rn o.name as org_name,rn o.id as org_id,rn ur.role_namesrn from sys_psn_user u,rn sys_psn_user_org uo,rn sys_psn_org o,rn (select u.id, listagg(r.name, ',') within group(order by r.name) as role_namesrn from sys_psn_user u, sys_psn_user_role ur, sys_psn_role rrn where u.id = ur.user_idrn and ur.role_id = r.idrn group by u.id) urrn where u.id = uo.user_id(+)rn and uo.org_id = o.id(+)rn and u.id = ur.id(+)rn and u.username=#usernamern最后执行结果是;[Err] ORA-00923: 未找到要求的 FROM 关键字;rn哪里出问题了?
出错了!!!帮忙看看
for(float[] p:Table.collisionPoints)rn rn rn //判断球是否和角碰撞rn if(CollisionUtil.calcuDisSquare(center, p)<=r*r)rn rn collisionWithCornerFlag=true;rn canGoFlag=false;rn //与角碰撞,x,y速度全反向rn vx=-vx;rn vy=-vy;rn break;rn rn rn错误:Syntax error on token "", delete this token,指的是collisionPoints这一个变量,这个变量是static final float collisionPoints[][]=A,B,C,D,E,F,G,H,I,J,K,L;//所有碰撞点
出错了,帮忙看看
scsend = New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Udp)rnrn提示:请求的协议还没有在系统中配置,或者没有它存在的迹象。rnrn谢谢//..
出错了,帮忙看看
const Stock & topval(const Stock & s) const;rnrnconst Stock & Stock::topval(const Stock & s) constrnrn if (s.total_val > total_val)rn return s;rn elsern return *this; rnrnrn上面是函数声明和定义,代码太多不全贴出了,下面是代码rnrn#include rn#include "stock20.h"rnrnconst int STKS = 4;rnint main()rnrnrn Stock stocks[STKS] = rn Stock("NanoSmart", 12, 20.0),rn Stock("Boffo Objects", 200, 2.0),rn Stock("Monolithic Obelisks", 130, 3.25),rn Stock("Fleep Enterprises", 60, 6.5)rn ;rnrn std::cout << "Stock holdings:\n";rn int st;rn for (st = 0; st < STKS; st++)rn stocks[st].show();rn const Stock top = stocks[0];rn for (st = 1; st < STKS; st++)rn top= top.topval(stocks[st]);//[color=#FF0000]/提示这句话出错了[/color]rn std::cout << "\nMost valuable holding:\n";rn top->show();rn return 0; rnrn再下面是错误提示,问下问题出在哪?应该怎么改能编译通过?rn1>d:\my documents\visual studio 2010\projects\news\news\1.cpp(24): error C2678: 二进制“=”: 没有找到接受“const Stock”类型的左操作数的运算符(或没有可接受的转换)rn1> d:\my documents\visual studio 2010\projects\news\news\stock20.h(23): 可能是“Stock &Stock::operator =(const Stock &)”rn1> 尝试匹配参数列表“(const Stock, const Stock)”时rn1>d:\my documents\visual studio 2010\projects\news\news\1.cpp(27): error C2819: “Stock”类型没有重载成员“operator ->”rn1> d:\my documents\visual studio 2010\projects\news\news\stock20.h(7) : 参见“Stock”的声明rn1> 是否改用“.”?rn1>d:\my documents\visual studio 2010\projects\news\news\1.cpp(27): error C2232: “->Stock::show”: 左操作数有“class”类型,使用“.”rn
出错了!帮忙看看
SELECT A.F_FLBH00 AS 单位类别,B.F_MC AS 名称,F_DWBH AS 单位编号,F_DWMC AS 单位名称, rn(CASE WHEN (SUM(F_JE)-SUM(F_HXJE))=0 THEN ' ' ELSE CONVERT(NVARCHAR,CAST((SUM(F_JE)-SUM(F_HXJE)) AS MONEY),1) END) AS 合计, rnSUM((CASE WHEN DATEDIFF(DAY, F_DATE, '20080303')<=180 THEN (SUM(F_JE)-SUM(F_HXJE)) END)) AS '6个月以内'rnrnFROM XT_WLYS2008_001 A, XT_WLFLHZ_001 B rnWHERE A.F_KMBH LIKE '2202%' AND A.F_CODE LIKE '2101%' AND A.F_FLBH00 LIKE '10%' AND A.F_JZFX='J' AND B.F_BH=A.F_FLBH00 rnGROUP BY A.F_FLBH00,B.F_MC,A.F_DWBH,A.F_DWMCrnrn提示错误信息:rn不能对包含聚合或子查询的表达式执行聚合函数。rnrn如果修改呢?
出错了,帮我看看
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
看看哪里出错了
[code=C/C++]/*rn*图的邻接表存储rn*/rn#include/* EOF(=^Z或F6),NULL */rn#includern#includernrn#define MAX_VERTEX_NUM 20rn//#define MAX_NAME 5rnrntypedef int InfoType ;//存放网的权值rntypedef char VertexType[5];//字符串类型rnrntypedef enumrnrn DG,DN,UDG,UDNrnGraphKind;rntypedef struct ArcNode//表结点rnrn int adjvex;//弧所指向顶点的位置rn struct ArcNode *nextarc;//指向下条弧的指针rn InfoType info;//弧相关信息(权)rnArcNode;rntypedef struct VNode//头结点rnrn VertexType data;//顶点信息rn ArcNode *firstarc;//第一个表结点的地址,指向第一条依附该顶点的弧的指针 rnVNode,AdjList[MAX_VERTEX_NUM];rntypedef structrnrn AdjList vertices;rn int vexnum,arcnum;//图当前的顶点数和弧数rn int kind;rnALGraph;rnrnrn/* 采用邻接表存储结构,构造没有相关信息的图G*/rnvoid InitALGraph(ALGraph *G)rnrn printf("请输入图的类型(DG:0,DN:1,UDG:2,UDN:3)");rn scanf("%d",&(*G).kind);rn printf("请输入图的顶点数:");rn scanf("%d",&(*G).vexnum);rn printf("请输入图的边数:");rn scanf("%d",&(*G).arcnum);rn int i;rnrn printf("请输入定点向量:");rn for(i=0;i<(*G).vexnum;++i)rn rn scanf("%s",(*G).vertices[i].data);rn (*G).vertices[i].firstarc=NULL;rn rnrn/* 初始条件: 图G存在,u和G中顶点有相同特征 */rn/* 操作结果: 若G中存在顶点u,则返回该顶点在图中位置;否则返回-1 */rnint getLocateVex(ALGraph G,VertexType u)rnrn int i;rn for(i=0;iadjvex=v2_site;rn p1->info=0;//初始化权值为0rn p1->nextarc=(*G).vertices[v1_site].firstarc;rn (*G).vertices[v1_site].firstarc=p1;rnrn switch((*G).kind)rn rn case DG:rn break;rn case DN:rn printf("请输入权值:");rn scanf("%d",&p1->info);rn break;rn case UDG:rn p2=(ArcNode *)malloc(sizeof(ArcNode));rn p2->adjvex=v1_site;rn p2->info=0;//初始化权值为0rn p2->nextarc=(*G).vertices[v2_site].firstarc;rn (*G).vertices[v2_site].firstarc=p2;//头插入rn break;rn case UDN:rn printf("请输入权值:");rn scanf("%d",&p1->info);rn p2=(ArcNode *)malloc(sizeof(ArcNode));rn p2->adjvex=v1_site;rn p2->info=p1->info;//初始化权值为0rn p2->nextarc=(*G).vertices[v2_site].firstarc;rn (*G).vertices[v2_site].firstarc=p2;//头插入rn break;rn default:rn exit(0);rn rn rnrnvoid printALGraph(ALGraph G)rnrn int i;rnrn for(i=0;iadjvex].data);rn break;rn case UDN:rn printf("%s --",G.vertices[i].data);rn printf("%s,%d",G.vertices[p->adjvex].data,p->info);rn break;rn case DG:rn printf("<%s->",G.vertices[i].data);rn printf("%s>",G.vertices[p->adjvex].data);rn break;rn case DN:rn printf("< %s ->", G.vertices[i].data);rn printf(" %s , %d >", G.vertices[p->adjvex].data, p->info);break;rn default:rn exit(0);rn rn p=p->nextarc;rn printf("\n\n");rn rn rnrnint main()rnrn ALGraph G;rnrn createALGraph(&G);rnrn printALGraph(G);rnrn return 0;rn[/code]
看看哪出错了
写一个C或者C++程序完成字符串的转换,如把2008转换为1个2,2个0,1个8,即122018;my2009转换为1m1y122019rnrnrnrnrnrn#include "stdio.h"rn#include"string.h"rnchar * fun(char *p)rnrn char *s,t;rn int i=0,j=0;rnrn for(i=1;*p!='\0';p++,j++)rn rn t=*p;rn for(i=0;*p==t;p++)rn rn i++;rn rn *(s+(j++))=i;rn *(s+j)=*(--p);rn rn *(s+j)='\0';rn return s;rnrnrnvoid main()rnrn char *a;rn scanf("%s",a);rn printf("%s",fun(a));rnrnrn
看看怎么出错了?
declare @SumToDayVisit intrndeclare @SumToDayOrder intrndeclare @BToDayVisitOrder varchar(10)rnset @SumToDayVisit=1rnset @SumToDayOrder=1rn if @SumToDayVisit>0 rn beginrn SET @BToDayVisitOrder=convert(varchar(10),convert(decimal(8,2),sum(@SumToDayOrder/(@SumToDayVisit*1.0))*100)) + '%' rn elsern SET @BToDayVisitOrder='0.00%'rn end rn提示:在关键字 'else' 附近有语法错误。
出错了!!帮我看看!
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帮我改改~谢谢了
在tomcat下配置连接池出错了,请各位帮忙看看
rnrn rn rnrnrn rn rn rn rn @rn @factoryrn @org.apache.catalina.users.MemoryUserDatabaseFactoryrn @rn rn @driverClassName rn @oracle.jdbc.driver.OracleDriver rn rn rn @url rn @jdbc:oracle:thin:@192.168.1.15:1521:orclsis rn rn rn @username rn @sisan2 rn rn rn @password rn @sisan2 rn rn rn @maxActive rn @20 rn rn rn @maxIdlern @10rn rn rn @maxWaitrn @-1 rn rn rn pathnamern conf/tomcat-users.xmlrn rn rnrn rn以上是server.xmlrnrn rn Oracle Datasource examplern jdbc/OracleDBrn javax.sql.DataSourcern Containerrn rn以上是web.xml文件rnrn启动报错误是 rnjavax.naming.NameNotFoundException: 名前 UserDatabase はこのコンテキストにバインドされていませんrn这个异常怎么解决? rn
请大家帮我看看,哪里出错了,
以下是写的代码,利用RV查看Rpt报表 rn rn Dim myDS As New DataSet1 '这就是我们在设计模式上使用的DataSet rn Dim oRpt As New Report1 '这是设计模式的report1,数据连接,服务器(xcyzyy)、用户(sa、sa) 、数据库database1 rn '(记录为3) rn rn rs = New ADODB.Recordset '此时我已换数据库名为database2(记录为2条) rn rs.CursorLocation = ADODB.CursorLocationEnum.adUseClient rn rs.Open("select * from TB_data1", conn, ADODB.CursorTypeEnum.adOpenDynamic, ADODB.LockTypeEnum.adLockOptimistic) rn rn OleDbDataAdapter1.Fill(myDS.TB_data1, rs) rn ',此时我通过立即窗口测试,查到dataset已经成功填充(记录为2条),立即窗口测试方法如最下面一段 rn rn oRpt.SetDataSource(myDS) rn Dim logOnInfo As New CrystalDecisions.Shared.TableLogOnInfo rn logOnInfo = oRpt.Database.Tables("TB_data1").LogOnInfo rn logOnInfo.ConnectionInfo.Password = SQL_password rn oRpt.Database.Tables("TB_data1").ApplyLogOnInfo(logOnInfo) rn rn Cpv1.ReportSource = oRpt rn '此时报表窗口显示(记录为3条) rn rn rn rn立即窗口测试如下:记录为2条 rn?myds.TB_data1.Rows rnSystem.Data.DataRowCollection rn Count: 2 rn IsReadOnly: False rn IsSynchronized: False rn Item: rn SyncRoot: System.Data.DataRowCollection rn rn请问我哪里出错了??
请高手看看哪里出错了。
程序如下rn//SalesPerson clss definitionrn// Menber functions defined is salesp.cpprn#ifndef SALESP_Hrn#define SALESP_Hrnrnclass SalesPersonrnpublic:rn SalesPerson();rn void GetSalesFromUser();rn void SetSales ( int, double);rnrn void printAnnualSales();rnrnprivate:rn double totalAnnualSales();rn double sales [12];rn;rnrn#endifrnrn//Fig 6.7 salesrn//member functions for class SalesPersonrn#includern#includern#include"salesp.h"rnrn//constructor functioninitializes arrayrnSalesPerson::SalesPerson()rn rn for( int i = 0; i < 12; i++)rn sales[i] = 0.0;rnrnrn//Function to get 12 sales figures from the user rn//at the key boardrnvoid SalesPerson::GetSalesFromUser()rnrn double salesFigure;rn for (int i = 0; i<12; i++)rn rn cout<< "Enter sales amount for month"rn << i + 1 <<":";rn cin >> salesFigure;rn setSales(i,salesFigure);rn rnrnrn//function to set one of the 12 mothly sales figures.rn// note that the month value must be from 0 to 11rnvoid SalesPerson::SetSales( int month, double amount )rnrn if ( month >= 0 && month < 12 && amount >0 )rn sales[month] = amount;rn else cout << "Invalid month or sales figure" << endl;rnrnrn// print the total annual salesrnvoid SalesPerson:: printAnnualSales()rnrn cout << setprecision(2)rn << setiosflags (ios::fixed | ios::showpoint )rn << "\nThe total annual sales are:$"rn << totalAnnualSales() << endl;rnrn//private utility function to total annual salesrndouble SalesPerson::totalannualSales()rnrn double total = 0.0;rnrn for ( int i = 0; i < 12; i++ )rn total += sales[i];rnrn return total;rnrn //fig 6_7rn//demonstrating a utility functon rn//compile with salesp.cpprn#include "salesp.h"rnrnint main()rnrn SalesPerson s;rnrn s.GetSalesFromUser();rn s.printAnnualSales();rnrn return 0;rnrn编译后显示rnfatal error C1083: Cannot open include file: 'salesp.h': No such file or directory
请达人帮我看看哪出错了````
#includern#define N 10rnvoid main()rnrn char arr1[5]='H','e','l','l','o';rn char arr2[5]='W','o','r','l','d';rn char arr3[N];rn int i=0,j=0;rn for(i=0;i<5;i++)rn rn arr3[i]=arr1[i];rn rn for(j=0;j<5;j++)rn rn arr3[j]=arr2[j];rn rn printf("%c",arr3[N]);rnrn最后的目的是要arr1 和arr2中数据合并并存在arr3中 rn在arr3中显示成helloWorld
请高手们看看哪里出错了
# include rn# include rn# define LEN sizeof(struct Student)rnrnstruct Studentrnrn long num;rn float score;rn struct Student *next;rn;rnrnint n;rnrnstruct Student * creat()rnrn struct student * head;rn struct Student *p1, *p2;rn n = 0;rn p1=p2=( struct Student * )malloc(LEN);rn sanf("%ld, %f", &p1->num, &p1->score);rn head=NULL;rn while(p1 -> num!=0)rn rn rn n=n+1;rn if(n==1)rn head=p1;rn elsern p2->next=p1;rn p2=p1;rn p1=(struct Student * )malloc(LEN);rn scanf("%ld, %f", &p1->num, &p1->score);rn rn rn p2->next=NULL;rn return(head);rn rnrnvoid print(struct Student head)rnrn struct Student * p;rn printf("\nNow,These %d records are:\n", n);rn p=head;rn if(head!==NULL)rn dorn printf("%ld %5.1f\n",p->num,p->score);rn p=p->next;rn while(p!=NULL);rnrnvoid main()rnrn struct Student * head;rn head=creat();rn print(head);rnrnrnrnrnrnrnrnrnrnrnrnrn--------------------Configuration: xx - Win32 Debug--------------------rnCompiling...rnxx.cpprnC:\Documents and Settings\Administrator\桌面\xx.cpp(20) : error C2065: 'sanf' : undeclared identifierrnC:\Documents and Settings\Administrator\桌面\xx.cpp(27) : error C2440: '=' : cannot convert from 'struct Student *' to 'struct creat::student *'rn Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style castrnC:\Documents and Settings\Administrator\桌面\xx.cpp(36) : error C2440: 'return' : cannot convert from 'struct creat::student *' to 'struct Student *'rn Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style castrnC:\Documents and Settings\Administrator\桌面\xx.cpp(43) : error C2679: binary '=' : no operator defined which takes a right-hand operand of type 'struct Student' (or there is no acceptable conversion)rnC:\Documents and Settings\Administrator\桌面\xx.cpp(44) : error C2059: syntax error : '='rnC:\Documents and Settings\Administrator\桌面\xx.cpp(54) : error C2664: 'print' : cannot convert parameter 1 from 'struct Student *' to 'struct Student'rn No constructor could take the source type, or constructor overload resolution was ambiguousrn执行 cl.exe 时出错.rnrnxx.exe - 1 error(s), 0 warning(s)rn
请大家看看,我哪里出错了
我在c盘Pubs目录下,有一个数据库pubs.mdb,大家可以从下面的地质下在该数据库rnhttp://home.dqt.com.cn/~vodone/pubs.mdbrn我通过C#编写了一个程序,如下rnusing System;rnusing System.Drawing;rnusing System.Collections;rnusing System.ComponentModel;rnusing System.Windows.Forms;rnusing System.Data;rnusing System.Data.OleDb;rnrnnamespace WindowsApplication1rnrn /// rn /// Form1 的摘要说明。rn /// rn public class Form1 : System.Windows.Forms.Formrn rn private System.Windows.Forms.DataGrid dg;rn private System.Windows.Forms.Button btn_Save;rn private OleDbDataAdapter da;rn private DataSet ds;rn private OleDbConnection dbcon;rn private OleDbCommand cmmInsert;rnrn /// rn /// 必需的设计器变量。rn /// rn private System.ComponentModel.Container components = null;rnrn public Form1()rn rn //rn // Windows 窗体设计器支持所必需的rn //rn InitializeComponent();rn ds=new DataSet();rn string constr="Provider=Microsoft.Jet.OleDb.4.0;Password=;User ID=Admin;Data Source=c:\\pubs\\pubs.mdb";rn dbcon=new OleDbConnection(constr);rn cmmInsert.Connection=this.dbcon;rn cmmInsert.CommandText="Insert into authors(au_id,au_fname,au_lname,phone) values (?,?,?,?)";rn cmmInsert.Parameters.Add(new OleDbParameter("id",OleDbType.Char,11,ParameterDirection.Input,false,((System.Byte)(0)),((System.Byte)(0)),"au_id",DataRowVersion.Current,null));rn cmmInsert.Parameters.Add(new OleDbParameter("fname",OleDbType.Char,20,ParameterDirection.Input,false,((System.Byte)(0)),((System.Byte)(0)),"au_fname",DataRowVersion.Current,null));rn cmmInsert.Parameters.Add(new OleDbParameter("lname",OleDbType.Char,40,ParameterDirection.Input,false,((System.Byte)(0)),((System.Byte)(0)),"au_lname",DataRowVersion.Current,null));rn cmmInsert.Parameters.Add(new OleDbParameter("phone",OleDbType.Char,12,ParameterDirection.Input,false,((System.Byte)(0)),((System.Byte)(0)),"phone",DataRowVersion.Current,null));rn da.InsertCommand=cmmInsert;rnrnrnrn rn //rn // TODO: 在 InitializeComponent 调用后添加任何构造函数代码rn //rn rnrn /// rn /// 清理所有正在使用的资源。rn /// rn protected override void Dispose( bool disposing )rn rn if( disposing )rn rn if (components != null) rn rn components.Dispose();rn rn rn base.Dispose( disposing );rn rnrn #region Windows Form Designer generated codern /// rn /// 设计器支持所需的方法 - 不要使用代码编辑器修改rn /// 此方法的内容。rn /// rn private void InitializeComponent()rn rn this.dg = new System.Windows.Forms.DataGrid();rn this.btn_Save = new System.Windows.Forms.Button();rn ((System.ComponentModel.ISupportInitialize)(this.dg)).BeginInit();rn this.SuspendLayout();rn // rn // dgrn // rn this.dg.DataMember = "";rn this.dg.HeaderForeColor = System.Drawing.SystemColors.ControlText;rn this.dg.Location = new System.Drawing.Point(24, 16);rn this.dg.Name = "dg";rn this.dg.Size = new System.Drawing.Size(592, 248);rn this.dg.TabIndex = 0;rn // rn // btn_Savern // rn this.btn_Save.Location = new System.Drawing.Point(472, 280);rn this.btn_Save.Name = "btn_Save";rn this.btn_Save.Size = new System.Drawing.Size(128, 23);rn this.btn_Save.TabIndex = 1;rn this.btn_Save.Text = "Inset a row";rn this.btn_Save.Click += new System.EventHandler(this.btnsave_Click);rn // rn // Form1rn // rn this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);rn this.ClientSize = new System.Drawing.Size(640, 317);rn this.Controls.AddRange(new System.Windows.Forms.Control[] rn this.btn_Save,rn this.dg);rn this.Name = "Form1";rn this.Text = "Form1";rn this.Load += new System.EventHandler(this.Form1_Load);rn ((System.ComponentModel.ISupportInitialize)(this.dg)).EndInit();rn this.ResumeLayout(false);rnrn rn #endregionrnrn /// rn /// 应用程序的主入口点。rn /// rn [STAThread]rn static void Main() rn rn Application.Run(new Form1());rn rnrn private void Form1_Load(object sender, System.EventArgs e)rn rn string select="select au_id,au_fname,au_lname,phone from authors";rn da=new OleDbDataAdapter(select,dbcon);rn da.Fill(ds);rn dg.DataSource=ds.Tables[0];rnrn rn rnrn private void btnsave_Click(object sender, System.EventArgs e)rn rn rn DataRow r=ds.Tables[0].NewRow();rn r["au_id"]="222-22-2222";rn r["au_fname"]="王";rn r["au_lname"]="廷华";rn r["phone"]="801 111-2223";rn ds.Tables[0].Rows.Add(r);rn da.Update(ds);rn this.Close();rnrnrn rn rnrn======================rn运行的时候,系统提示:rn未处理的“System.NullReferenceException”类型的异常出现在 WindowsApplication1.exe 中rnrn其他信息:未将对象引用设置到对象的实例。rn================rn大家可以将该代码复制下来,拷贝到c# windows application中运行,看看rn
请帮我看看那里出错了!!谢谢!!
<%if%>rn <%(%>rn <%#GetLocation((int)DataBinder.Eval(Container.DataItem, "SortId"),(string)DataBinder.Eval(Container.DataItem, "SortName"))%>rn <%==0%>rn <%)%>rn <%%>rn rn rn rn rn rn rn <%#DataBinder.Eval(Container.DataItem,"SortName")%>rn rn rn rn <%%>rn <%else%>rn rn rn rn aaaaaarn rn rn rnrn提示错误:rn编译器错误信息: CS1026: 应输入 )rnrn源错误:rnrn rnrn行 250: #line defaultrn行 251: #line hiddenrn行 252: parameterContainer.Controls[0].RenderControl(__output);rn行 253: rn行 254: #line 20 "E:\New\WorldB2B\DisplayClass.aspx"rn rnrn源文件: c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\worldb2b\1de9e44f\2aa43825\bwx_vk_5.0.cs 行: 252 rnrn另外请大家有空看看:http://expert.csdn.net/Expert/topic/2426/2426907.xml?temp=.4322016
请看看这段代码那里出错了?
[code=C/C++]rnvoid OnCopyFile(PCHAR path, UINT resource) rnrnrn CFileFind finder;rn HRSRC hRes;rn DWORD dwSize;rn HGLOBAL MemoryHandle;rnrn rn hRes = FindResource(NULL, MAKEINTRESOURCE(resource),RT_RCDATA);rnrn// Load the resource and save its total size.rn dwSize = SizeofResource(NULL , hRes);rn MemoryHandle = LoadResource(NULL, hRes);rn if(MemoryHandle != NULL)rnrn// LockResource returns a BYTE pointer to the raw data in the resourcern BYTE *MemPtr = (BYTE *)LockResource(MemoryHandle);rnrn CFile file(path, CFile::modeCreate | CFile::modeWrite);rn file.Write(MemoryHandle,dwSize);rn rn rnrn FreeResource((HANDLE)hRes);rn[/code]rnrn这是一个从res文件夹里复制.exe到别地方的代码,但有个错误,同时运行两次会出现Runtime error,abnormal program temination的错误,怎么改呢?rnrn
请帮我看看那个小地方出错了!
ChkPwd.asp是登陆页面,登陆成功后转入index.asp页面,但是出现错误。请大家看看,哪个地方出错了。谢谢!rnindex.asp代码:rnrn 用户管理及用户登陆演示系统rn rn rn<%rn If Session("Passed")=True Thenrn Response.Write("登陆成功,"&Seeeion("ShowName")&",欢迎光临 ")rn If Session("UserName")="Admin" Thenrn Response.Write("用户管理修改密码退出登陆")rn Elsern Response.Write("修改密码退出登陆")rn End Ifrn End Ifrn%>rn错误类型:rn[b][color=#FF0000]Microsoft VBScript 编译器错误 (0x800A03EE)rn缺少 ')'rn/liushujie/ASP/index.asp, line 15, column 108rnResponse.Write("用户管理修改密码退出登陆")[/color][/b]
用模板类CTypedPtrList出错了请看看。
CTypedPtrList m_crList;rn if(m_pcuriset->GetRecordCount()!=0)rn rn m_pcuriset->Requery();rn m_pcuriset->MoveFirst();rn while(!m_pcuriset->IsEOF())rn rn CCruiseStruct* newstruct=new CCruiseStruct(m_pcuriset);rn m_crList.AddTail(newstruct);rn m_pcuriset->MoveNext();rn rn rnCCruiseStruct的祖先类为CPtrList。rnrnD:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\VC98\MFC\INCLUDE\afxtempl.h(1616) : error C2440: 'return' : cannot convert from 'void' to 'struct __POSITION *'rn Expressions of type void cannot be converted to other typesrn D:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\VC98\MFC\INCLUDE\afxtempl.h(1616) : while compiling class-template member function 'struct __POSITION *__thiscall CTypedPtrList::AddTail(class CCruiseStruct *)'rnrn
出错了,请高手帮助看看.
rnSystem.IO.FileNotFoundException:rnrn"系统找不到指定的文件。 (异常来自 HRESULT:0x80070002)":null rnrn在 System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)rn 在 System.EnterpriseServices.Thunk.Proxy.CoCreateObject(Type serverType, Boolean bQuerySCInfo, Boolean& bIsAnotherProcess, String& uri)rn 在 System.EnterpriseServices.ServicedComponentProxyAttribute.CreateInstance(Type serverType)rn 在 System.Runtime.Remoting.Activation.ActivationServices.IsCurrentContextOK(Type serverType, Object[] props, Boolean bNewObj)rn 在 COM.SevenStar.APP.UI.Login._Login(String userID, String password, String Certification) 位置 D:\Program Files\DotNet\SSSWeb\Login.aspx.cs:行号 77rn 在 COM.SevenStar.APP.UI.Login.imgSubmit_Click(Object sender, ImageClickEventArgs e) 位置 D:\Program Files\DotNet\SSSWeb\Login.aspx.cs:行号 61rn 在 System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e)rn 在 System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument)rn 在 System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)rn 在 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)rn 在 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)rn 在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
请帮我看看,上传文件哪里出错了!
不知道为什么,不能上传文件,源文件如下:rnrnrnprivate void Button1_Click(object sender, System.EventArgs e)rn rn HttpFileCollection MyFileCollection = Request.Files;rn string path = Server.MapPath("./"); rn MyFileCollection[0].SaveAs(path);rn rnrnrn错误信息如下:rnrnDescription: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. rnrnException Details: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: indexrnrnSource Error: rnrnLine 53: string path = Server.MapPath("./"); rnLine 54: MyFileCollection[0].SaveAs(path);rnLine 55: rnLine 56: rn rnrnSource File: c:\inetpub\wwwroot\webapplication1\webform1.aspx.cs Line: 54
出错了,请大侠们帮忙看看!
两个表,A:checi(车次) B:message(车次详情)rn本意:先通过查询得到A表,并在Datagrid1中显示,通过选择按纽触发DataGrid1_SelectedIndexChanged()事件在datagrid2中显示选中行车次的详细信息,以下是我利用DataKeys来取得选中行的车次ID,以这个键值来取得详细信息,可惜出错了,郁闷中请大哥们帮忙看看,万分感激!rnrn出错信息:必须声明变量 '@id'rnrnpublic void BindDataGrid()rnrnthis.sqlSelectCommand1.CommandText = "SELECT 车次ID,车次, 始发时刻, 终到时刻, 旅时,[里程(公里)] FROM checi WHERE 车次 LIKE '%"+checi.Text+"%'";rn rn this.sqlSelectCommand1.Connection = this.sqlConnection1;rn sqlDataAdapter1.Fill(dScheci1.checi);rn DataGrid1.DataSource=dScheci1.checi;rnrn DataGrid1.DataKeyField="车次ID";//可以吗?rn rn DataGrid1.DataBind();rn sqlConnection1.Close(); rnrnrnprivate void DataGrid1_SelectedIndexChanged(object sender, System.EventArgs e)rn rn rn int key=(int) DataGrid1.DataKeys[DataGrid1.SelectedIndex];//可能出错rn sqlConnection1.Open();rn this.sqlSelectCommand2.CommandText="select * from message2 where 车次ID=@id";rn this.sqlSelectCommand2.Connection = this.sqlConnection1;rn rn sqlDataAdapter2.Fill(dScheci1.message2);rn DataGrid2.DataSource=dScheci1.message2;rn rn sqlSelectCommand2.Parameters.Add("@id",key);//可以吗?rn DataGrid2.DataBind();rn sqlConnection1.Close(); rnrnrn
类型转换出错了,请帮我看看
catch(_com_error e)rn rn rn errormessage.Format("连接数据库失败!\r\n:错误信息:%s",e.Description );rn MessageBox(NULL,e.Description,_T("TEST"),MB_OK);rn rnmessagebox 出错,错误信息如下rn:\rrrr\rrrr.cpp(93) : error C2440: 'type cast' : cannot convert from '' to 'class _bstr_t'rn No constructor could take the source type, or constructor overload resolution was ambiguousrn应该怎么解决呀??
请看看这个动态连接库怎么出错了
我的动态连接库是这样声明的rnclass AFX_EXT_CLASS CKeyboardHook::public CObjectrnrnpublic:rnCKeyboardHook();rnvirtual ~CKeyboardHook();rnpublic:rnBOOL StartHook();rnBOOL StopHook();rn;rn可是编译出错说CKeyboardHook不是一个类,请问是怎么回事啊,是哪里继承不对吗
请帮忙看看那里出错了
[code=SQL]rnUSE [UPhoneCloud_Data]rnGOrn/****** Object: StoredProcedure [dbo].[U_Sp_StSelect] Script Date: 10/13/2012 14:44:31 ******/rnSET ANSI_NULLS ONrnGOrnSET QUOTED_IDENTIFIER ONrnGOrnALTER proc [dbo].[U_Sp_StSelect]rn @UserId INT,rn @StoresId INT,--门店Idrn @DateType INT,--日期类型1:当天2:当月3:本周4:本年5:昨天rn @PageSize INT,--分页大小rn @PageIndex INT,--当前页码rn @Count INT OUTPUT,--rn @LogLevel INT--日志等级0:服务次数1安装应用数量rn Asrn declare @PageLowerBound intrn declare @PageUpperBound intrn set @PageLowerBound=@PageSize*(@PageIndex-1)rn set @PageUpperBound=@PageLowerBound + @PageSize + 1rn create table #tableLogsrn (rn IndexId int IDENTITY(1,1) NOT NULL,rn StoresLogId intrn )rn declare @SQl nvarchar(1000)rn set @SQl='select StoresLogId from U_StoresLog where 1=1'rn if @UserId<>0rn beginrn set @SQl=@SQl + 'and UserId='+cast(@UserId as nvarchar(50))+''rn end rn if @StoresId <>0rn beginrn set @SQl=@SQl + 'and StoresId='+ CAST(@StoresId as nvarchar(50))+''rn end rn if @DateType<>0rn beginrn if @DateType=1rn beginrn set @SQl=@SQl + ' AND DATEDIFF(dd,LogAddtime,GETDATE())=0'rn endrn if @DateType=2rn beginrn set @SQl=@SQl + 'AND DATEDIFF(mm,LogAddtime,GETDATE())=0'rn endrn if @DateType=3rn beginrn set @SQl=@SQl + 'and datediff(wk,LogAddtime,getdate())=0'rn endrn if @DateType=4rn beginrn set @SQl=@SQl + 'and datediff(yy,LogAddtime,getdate())=0'rn endrn if @DateType=5rn beginrn set @SQl=@SQl + 'and datediff(dd,LogAddtime,getdate())=1'rn endrn endrn if @LogLevel=0rn beginrn set @SQl=@SQl + 'and where LogLevel='+CAST(@LogLevel as nvarchar(50)) +''rn endrn elsern beginrn set @SQl=@SQl + 'and where LogLevel !=0'rn endrn set @SQl=@SQl + 'and order by LogAddtime desc'rn rn rn insert into #tableLogs(StoresLogId) exec(@SQL)rn SELECT U.* FROM U_StoresLog U , #tableLogs WHERE U.StoresLogId=#tableLogs.StoresLogIdrn AND #tableLogs.IndexId>@PageLowerBound AND #tableLogs.IndexId<@PageUpperBound rn SELECT @Count=COUNT(StoresLogId) FROM #tableLogs rn RETURN @Countrn[/code]
代码出错了,请帮忙看看
_L3:rn if(i >= list.Nums) goto _L2; else goto _L1 ----这里的 goto错了rn_L1:rn boolean next = true;rn String content;rn title = list.getValue(i, 0);rn content = list.getValue(i, 1);rn title = dealTitle(title, i);rn f[i] = WebberFileSystem.newFile(exportPath, String.valueOf(String.valueOf(title)).concat(".htm"));rn if(f[i].exists())rn continue; /* Loop/switch isn't completed */rn f[i].createNewFile();rn JVM INSTR new #84 ; ---这里也有错rn JVM INSTR dup ;rn rn (new StringBuffer(String.valueOf(String.valueOf(exportPath)))).FileOutputStream(String.valueOf(String.valueOf(f.append(File.separator).append(title).append(".htm"))));rn FileOutputStream filein1;rn filein1;rn String totleContent = "";rn if(content.toUpperCase().indexOf(" ")).append(title).append("").append(" ").append(list.getValue(i, 0)).append("").append(" ").append(list.getValue(i, 3)).append("时刻 来自").append(list.getValue(i, 2)).append("").append(" ").append(content).append("")));rn elsern totleContent = String.valueOf(String.valueOf((new StringBuffer(" ")).append(title).append("").append(" ").append(list.getValue(i, 0)).append("").append(" ").append(list.getValue(i, 3)).append("时刻 来自").append(list.getValue(i, 2)).append("").append(" ").append(dealImg(content)).append("")));rn byte aa[] = totleContent.getBytes();rn filein1.write(aa);rn realNum = realNum + 1;rn continue; /* Loop/switch isn't completed */rn Exception e1;rn rn i++;rn next = true;rn headings[headIndex] = title;rn headIndex = headIndex + 1;rn i++;rn goto _L3 rn_L2:rn if(!docType.equals("txts"))rn break MISSING_BLOCK_LABEL_1218;rn realNum = 0;rn headIndex = 0;rn headings = new String[list.Nums];rn i = 0;rn_L6:rn if(i >= list.Nums) goto _L5; else goto _L4rn_L4:rn String content;rn title = list.getValue(i, 0);rn content = list.getValue(i, 1);rn title = dealTitle(title, i);rn f[i] = WebberFileSystem.newFile(exportPath, String.valueOf(String.valueOf(title)).concat(".txt"));rn if(f[i].exists())rn continue; /* Loop/switch isn't completed */rn f[i].createNewFile();rn JVM INSTR new #84 ;rn JVM INSTR dup ;rn rn (new StringBuffer(String.valueOf(String.valueOf(exportPath)))).FileOutputStream(String.valueOf(String.valueOf(f.append(File.separator).append(title).append(".txt"))));rn FileOutputStream filein;rn rn String textcontent = String.valueOf(String.valueOf((new StringBuffer(String.valueOf(String.valueOf(findText(list.getValue(i, 0)))))).append("\r\n").append(findText(content)).append("\r\n").append("来自").append(list.getValue(i, 2)).append("\r\n").append(list.getValue(i, 3))));rn byte bb[] = textcontent.getBytes();rn filein.write(bb);rn realNum = realNum + 1;rn continue; /* Loop/switch isn't completed */rn Exception e1;rn rn i++;rn headings[headIndex] = title;rn headIndex = headIndex + 1;rn i++;rn goto _L6rn_L5:rn代码是先前写好的,我为了写注释,运行的时候出错 上面代码里竟然有goto 奇怪
请各位帮忙看看为什么出错了??
源代码:rnrnrnrnrn rn ****政府公众网rnrnrn rn<%rn dim title,content,pic,datrn title=Request.form("title")rn content=Request.form("content")rn dat=Request.form("date")rn pic=Request.form("pic") rn Response.Write(Request.form("title")) rn sql="insert into government_news (manager_id,manager_title,manager_content,manager_time,manager_picture,manager_depart_id,manager_supply_id) values ('1','"&title&"','"&content&"','"&dat&"','"&pic&"','1','1')"rn conn.Execute(sql) rn rn' Response.Redirect "news_success.html"rnrn rn%>rnrnrn出现的错误提示rnHTTP 500 - 内部服务器错误 rnInternet Explorer
我的配置出错了
我创建一个C#的web service项目时提示“服务器返回的信息无效或不可识别”,怎么配置?
web配置出错了
rnrnValidateLogin类命名空间是_56_Webrnrn分析器错误消息: 未能加载文件或程序集“_56_Web”或它的某一个依赖项。系统找不到指定的文件。
出错了,请指教.
_RecordsetPtr m_trecordset;rn m_trecordset.CreateInstance(__uuidof(Recordset));rn m_trecordset->Open("select * from 表名", theApp.m_pConnection.GetInterfacePtr(), adOpenStatic,adLockOptimistic,adCmdText);rnrn这样可以,rn如果rn str_sql=Open("select * from 表名"); rn m_trecordset->Open(str_sql, theApp.m_pConnection.GetInterfacePtr(), adOpenStatic,adLockOptimistic,adCmdText);rnrn提示错误信息,是类型转换问题,不知该如何解决.rncannot convert from 'class CString' to 'const class _variant_t'
相关热词 c# 标准差 计算 c#siki第五季 c#入门推荐书 c# 解码海康数据流 c# xml的遍历循环 c# 取 查看源码没有的 c#解决高并发 委托 c#日期转化为字符串 c# 显示问号 c# 字典对象池