Tag - eclipse

eclipse maven nexus depoly    2017-07-19 22:25:41    1179
1、setting.xml文件(以下为关键代码):
<servers>
<server>  
  <id>releases</id>  
  <username>admin</username>  
  <password>admin123</password>  
</server>  
<server>  
  <id>snapshots</id>  
  <username>admin</username>  
  <password>admin123</password>  
</server>
<server>  
  <id>thirdparty</id>  
  <username>admin</username>  
  <password>admin123</password>  
</server>
<server>  
  <id>snapshots-host</id>  
  <username>admin</username>  
  <password>admin123</password>  
</server>
</servers> 
...........
<repositories>
  <repository>
   <id>snapshots</id>
   <name>Snapshots</name>
  </repository>
  <repository>
   <id>releases</id>
   <name>Releases</name>
  </repository>
  <repository>
   <id>snapshots-host</id>
   <name>SnapshotsHost</name>
  </repository>
 </repositories>

    上面的红色标注地方,为我自定义的一个re
java eclipse VM arguments    2017-07-19 21:27:01    1638
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
    at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074)
    at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2209)
    at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:776)
    at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:46)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun
java eclipse exception    2017-07-19 21:18:39    950
错误信息(我的错误类似,网络copy):

java.lang.Error: Unresolved compilation problems: 
The import javax.servlet.ServletContext cannot be resolved
The import javax.servlet.http.HttpSession cannot be resolved
The import javax.servlet.http.HttpSessionEvent cannot be resolved
The import javax.servlet.http.HttpSessionListener cannot be resolved
HttpSessionListener cannot be resolved to a type
ServletContext cannot be resolved to a type
HttpSessionEvent cannot be resolved to a type
HttpSession cannot be resolved to a type
context cannot be resolved
context cannot be resolved
context cannot be resolved
context cannot be resolved
context cannot be resolved
context cannot be resolved
context cannot be resolved
context cannot be resolved
context cannot be resolved
context cannot be resolved
context cannot be resolved
HttpSessionEvent cannot be resolved to a type
HttpSession cannot be resolved to a type




解决办法:
    原因有很多,解决办法也很多,参考地址:
        http://www.360doc.com/content/12/1015/17/4152160_241639166.shtml
        http://blog.csdn.net/chl
eclipse tomcat    2017-07-19 21:17:19    777
提示,此代码所在的都是rest接口(web项目)中,而不是在普通的Test类或者是main方法中

重现:

    @GET
    public Response sayHello(@Context HttpServletRequest request,
            @Context HttpServletResponse response){
        File file=new File("repository/configuration.xml");
        URI uri = file.toURI();
        System.out.println(uri);
        return Response.ok().status(200).build();
    }


返回结果为:
file:/E:/works/eclipse-jee-mars-2-win32-x86_64/eclipse/repository/configuration.xml

而我要获取的是tomcat下的目录,如我上端代码,直接启动tomcat运行获取到的是:
file:/N:/works/IDE/apache-tomcat-7.0.54-windows-x86/apache-tomcat-7.0.54/bin

那么就要修改配置,让在eclipse中也获取此目录

解决办法:
1、双击Servers下的tomcat

2、将会打开eclipse中的tomcat配置界面,然后点击“Open launch configuration”


3、打开标签页Arguments,选择“Working  directory“为Other,填入如下值:
    N:\works\IDE\apache-tomcat-7.0.54-windows-x86\apache-tomcat-7.0.54\bin
    然后保存即可
如图:


修改过后,再在eclipse中启动tomcat,运行此代码获取到的就是和tomcat运行时获取的目录相同了




 

by 刘迎光@萤火虫工作室 
OpenBI交流群:495266201 
MicroService 微服务交流群:217722918 
ma

eclipse nodejs nodeclipse 插件    2017-07-19 20:18:26    1052

最近参与前端开发任务,用到nodejs,虽然公司同事都用webstorm,自己也用了,但是总感觉不顺手,可能是常年使用eclipse开发有关(这里不讨论最佳开发工具,自己顺手才是王道),于是自己想要使用eclipse开发nodejs项目,想到之前听说的nodeclipse,就去官网看了下,安装步奏还是挺方便的,安装后初步试用了下,感觉挺顺手的

1、安装nodejs
2、安装jdk,配置eclipse,这里我用的是eclipse 4.5.2
3、下载nodeclipse离线安装包:
http://nchc.dl.sourceforge.net/project/nodeclipse/update-site-archive/org.nodeclipse.site-1.0.2-201509250223.zip
或者
http://pan.baidu.com/s/1dFiF7IL

4、安装nodeclipse,help-->Install New Software,如下图选择下载的压缩包
title

选择插件:
title
5、完成以上步奏即完成了安装

更多安装方式还请参考如下地址:
http://www.nodeclipse.org/updates/