在使用git上传文件时发生的错误

刚开始接触git这个东西,对我来说还是有点困难,先简单记录一下。
1.在本地创建了一个文件demo1

$mkdir demo1
cd demo1

2.通过git init命令把这个目录变成Git可以管理的仓库:

 $ git init

3.在该目录下创建一个index.html,并将它添加到仓库:

$git add index.html

4.把文件提交到仓库

git commit -m "a html demo"

5.在远程github上面创建一个名为demo的仓库
6.把本地仓库与远程仓库关联起来:

$ git remote add origin git@github.com:Glenmy11111/demo.git

7.此时出现了错误:

fatal: remote origin already exists.

8.解决办法:
在git的命令行输入以下命令
删除远程的git仓库:$ git remote rm origin
然后再添加远程git仓库:
$ git remote add origin git@github.com:Glenmy11111/demo.git

9.最后执行:

$ git push -u origin master

10.最后问题解决了,在命令行出现了这样的信息:
这里写图片描述
10.在github上面就可以看到你提交的信息了。


问题二:向github上面传一个项目文件夹时的情况:
前面的步骤同上
上传文件夹时使用如下命令,

$git push -u origin master

发生了这样的错误:

fatal: Tfahte remoal:t esha1 fi end le ‘’ write error: Broken pipe
nexpectedly
fatal: The remote end hung up unexpectedly
远程突然挂起

当使用$git push origin master时,问题就解决了。

展开阅读全文

使用jstl时发生的错误

08-04

2008-8-4 22:17:57 org.apache.catalina.core.AprLifecycleListener lifecycleEventrn信息: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.5.0_05\bin;C:\Program Files\Apache Software Foundation\Tomcat 5.5\binrn[org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News / Redirect URL: http://www.cnn.com], [org.apache.webapp.balancer.rules.RequestParameterRule: Target param name: paramName / Target param value: paramValue / Redirect URL: http://www.yahoo.com], [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL: http://jakarta.apache.org]]rnlog4j:WARN No appenders could be found for logger (org.apache.commons.digester.Digester.sax).rnlog4j:WARN Please initialize the log4j system properly.rnlog4j:WARN No appenders could be found for logger (org.apache.commons.digester.Digester.sax).rnlog4j:WARN Please initialize the log4j system properly.rn2008-8-4 22:18:03 org.apache.catalina.loader.WebappClassLoader validateJarFilern信息: validateJarFile(C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\TestWeb\WEB-INF\lib\servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.classrn2008-8-4 22:18:17 org.apache.catalina.core.StandardWrapperValve invokern严重: Servlet.service() for servlet jsp threw exceptionrnjava.lang.ClassNotFoundException: org.apache.taglibs.standard.tlv.JstlCoreTLVrn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1352)rn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1198)rn at org.apache.jasper.compiler.TagLibraryInfoImpl.createValidator(TagLibraryInfoImpl.java:653)rn at org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.java:246)rn at org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:162)rnrnrn[color=#339966]--------------------------------------------------------------------rn以下内容为自动编辑的内容,并非楼主的发贴内容,此仅用于显示而已,并无任何其他特殊作用rn楼主【jiubuzhuce】截止到2008-08-04 22:26:31的历史汇总数据(不包括此帖):rn发帖的总数量:1 发帖的总分数:20 每贴平均分数:20 rn回帖的总数量:7 得分贴总数量:2 回帖的得分率:28% rn结贴的总数量:1 结贴的总分数:20 rn无满意结贴数:0 无满意结贴分:0 rn未结的帖子数:0 未结的总分数:0 rn结贴的百分比:100.00% 结分的百分比:100.00% rn无满意结贴率:0.00 % 无满意结分率:0.00 % rn敬礼![img=http://p.blog.csdn.net/images/p_blog_csdn_net/java2000_net/381633/o_medal1.gif][/img][/color]rn取消马甲机器人,请点这里:[url=http://www.java2000.net/mycsdn/robotStop.jsp?usern=jiubuzhuce][/url] 论坛

使用struts上传文件的发生的奇怪错误,请大家帮忙!

01-12

当我在使用struts的一个上传例子的时候,发生了一个很奇怪的错误!rn 当上传小文件的时候没有问题,但当大文件的时候,就会直接在rnrn if(file==null)rn rn return mapping.findForward("uploadFileSuccess");rn rn rn这里跳转。rn请各位帮忙!谢谢,请大家看看有什么更好的办法上传大的文件吗?rnrnUploadFileAction.java rn/*rn * Generated by MyEclipse Strutsrn * Template path: templates/java/JavaClass.vtlrn */rnpackage com.yemaoqing.struts.action;rnrnimport javax.servlet.http.HttpServletRequest;rnimport javax.servlet.http.HttpServletRequestWrapper;rnimport javax.servlet.http.HttpServletResponse;rnimport javax.servlet.http.HttpSession;rnimport org.apache.struts.upload.FormFile;rnimport org.apache.struts.action.Action;rnimport org.apache.struts.action.ActionForm;rnimport org.apache.struts.action.ActionForward;rnimport org.apache.struts.action.ActionMapping;rnimport org.apache.struts.action.ActionMessage;rnimport org.apache.struts.action.ActionMessages;rnrnimport com.yemaoqing.struts.form.UploadFileForm;rnimport java.io.*;rnimport basic.BasicParameter;rnimport file.UploadFile;rnrn;rnrnrnpublic class UploadFileAction extends Action rn /*rn * Generated Methodsrn */rnrn /**rn * Method executern * rn * @param mappingrn * @param formrn * @param requestrn * @param responsern * @return ActionForwardrn */rn public ActionForward execute(ActionMapping mapping, ActionForm form,rn HttpServletRequest request, HttpServletResponse response) rn rn ActionMessages errors=new ActionMessages();rn tryrn rn rn HttpServletRequestWrapper hs=new HttpServletRequestWrapper(request);rn HttpSession session=hs.getSession();rn rn UploadFile uf=new UploadFile();rn String path=session.getAttribute("path").toString();rn rn rn rnrn rn UploadFileForm uff=(UploadFileForm)form;rn FormFile file = uff.getFile();rn rn rn if(file==null)rn rn return mapping.findForward("uploadFileSuccess");rn rn rn String fname=file.getFileName();rn rn fname=fname.replace(" ","");rn rn String size=Integer.toString(file.getFileSize())+"bytes";rnrn InputStream streamIn=file.getInputStream();rn OutputStream streamOut=new FileOutputStream(path+File.separator+fname);rn rn int bytesRead=0;rn byte[] buffer=new byte[BasicParameter.defaultBuffer];rn while((bytesRead=streamIn.read(buffer,0,BasicParameter.defaultBuffer))!=-1)rn rn streamOut.write(buffer,0,bytesRead);rn rn rn rn streamOut.close();rn streamIn.close();rn rn uff.setFname(fname);rn uff.setSize(size);rn rn file.destroy();rn rn rn return (mapping.findForward("uploadFileSuccess"));rn rn catch(Exception e)rn rn e.printStackTrace();rn errors.add("uploadFail",new ActionMessage("error.loginFail"));rn saveErrors(request,errors);rn return (mapping.getInputForward());rn rn rn rn rn 论坛

没有更多推荐了,返回首页