调试环境

ubuntu 12.04

JDK1.7

apache-maven-3.10

eclipse 4.2 Juno

mysql 5

apache ant

JDK的配置和安装

安装可以参考:

http://my.oschina.net/jamesju/blog/94916

我是安装在~//java/jdk1.7.0_21下,执行java -version可以看到当前的JDK版本。

Maven的配置和安装

安装可以参考:

http://blog.csdn.net/sin90lzc/article/details/7429620

Eclipse及插件安装

到eclipse官网下载4.2或者最新的4.3版本的eclipse.

下载地址:

http://www.eclipse.org/downloads/

安装PyDev插件,用来查看python角本,因为底层操作是使用python写的。

安装地址:

http://pydev.org/updates/

然后安装eclipse的m2e插件,就是eclipse的maven插件。

安装地址:

http://download.eclipse.org/technology/m2e/releases

然后在eclipse的

因为源码是上传到git上的,所以要安装Egit插件。

安装地址:Preferences里边配置maven的路径,就是刚安装的maven的路径。

http://download.eclipse.org/egit/updates

安装完成后可以到菜单Help->About Eclipse->Installation Details,点击

下载源码

使用File->Import

选择Next,选择URI

输入:

https://git-wip-us.apache.org/repos/asf/cloudstack.git

选择要调试的版本,这里要调试是4.02版本,比较稳定的一个版本,如下图:

然后选择本地路径,Finish。

接下来就等着下载源码,这个时间跟网速有关。

然后再选择File->Import,选择Existing Maven Projects,选择刚才保存的git本地路径,导入刚下载的工程。

编译和运行jetty

使用maven编译,点击Run->Run Configuration

compile -U,-U表示强制更新,如果有未更新完成的包也会重新下载,这个可以根据自己的情况选择加或不加。

然后点Run,编译成功后会出现如下结果:

[INFO] Reactor Summary:
[INFO]
[INFO] Apache CloudStack ................................. SUCCESS [.038s]
[INFO] Apache CloudStack Utils ........................... SUCCESS [.485s]
[INFO] Apache CloudStack API ............................. SUCCESS [.633s]
[INFO] Apache XenSource XAPI ............................. SUCCESS [.135s]
[INFO] Apache CloudStack Core ............................ SUCCESS [.495s]
[INFO] Apache CloudStack Agents .......................... SUCCESS [.546s]
[INFO] Apache CloudStack SystemVM Patches ................ SUCCESS [.209s]
[INFO] Apache CloudStack Console Proxy ................... SUCCESS [.347s]
[INFO] Apache CloudStack Server .......................... SUCCESS [.470s]
[INFO] Apache CloudStack Usage Server .................... SUCCESS [.214s]
[INFO] Apache CloudStack Plugin POM ...................... SUCCESS [.196s]
[INFO] Apache CloudStack Plugin - User Concentrated Pod Deployment Planner SUCCESS [.165s]
[INFO] Apache CloudStack Plugin - User Dispersing Deployment Planner SUCCESS [.236s]
[INFO] Apache CloudStack Plugin - Host Allocator Random .. SUCCESS [.355s]
[INFO] Apache CloudStack Plugin - Hypervisor OracleVM .... SUCCESS [.477s]
[INFO] Apache CloudStack Plugin - Open vSwitch ........... SUCCESS [.328s]
[INFO] Apache CloudStack Plugin - Hypervisor Xen ......... SUCCESS [.412s]
[INFO] Apache CloudStack Plugin - Hypervisor KVM ......... SUCCESS [.395s]
[INFO] Apache CloudStack Plugin - Network Elastic Load Balancer SUCCESS [.174s]
[INFO] Apache CloudStack Plugin - Network Nicira NVP ..... SUCCESS [.175s]
[INFO] Apache CloudStack Plugin - Storage Allocator Random SUCCESS [.158s]
[INFO] Apache CloudStack Plugin - User Authenticator LDAP SUCCESS [.161s]
[INFO] Apache CloudStack Plugin - User Authenticator MD5 . SUCCESS [.169s]
[INFO] Apache CloudStack Plugin - User Authenticator Plain Text SUCCESS [.166s]
[INFO] Apache CloudStack AWS API Bridge .................. SUCCESS [.046s]
[INFO] Apache CloudStack Test ............................ SUCCESS [.167s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: .256s
[INFO] Finished at: Fri Aug :: CST
[INFO] Final Memory: 25M/357M
[INFO] ------------------------------------------------------------------------

然后运行jetty,这个默认是在cloud-client-ui这个工程里边配置的,所以配置如下:

如果中间出现问题,岀到出错的工程中选择maven clean然后再maven install一下,然后再执行cloudrun运行jetty,这样反复几次,就可以成功运行jetty了。

这时启动会报错,因为没有安装数据库。

安装数据库:

$ sudo apt-get install mysql-server
在弹出的界面中输入密码,如: cloudstack

然后

修改MySQL配置文件参数
$ sudo vim /etc/mysql/my.cnf
在[mysqld]模块中加入以下参数
innodb_rollback_on_timeout=
innodb_lock_wait_timeout=
max_connections=
log-bin=mysql-bin
binlog-format = 'ROW' 重启MySQL
$ sudo service mysql restart

在eclipse中找到replace.properties文件,修改replace.properties文件中的key为DBROOTPW的值,这个值是mysql默认的密码,我们修改成上面的cloudstack

然后安装ant

sudo apt-get install ant

安装完成后到源码安装目录或者在eclipse中执行

ant deploydb

这样数据库就可以成功部署了。

然后在调试的时候需要选择Debug->Debug Configuration->Source->Add

将所有源码工程加上。

然后打上断点,以Debug模式运行,就可用断点调试了。

可能遇到的问题

1、工程jar包丢失,编译不过去

[WARNING] The POM for org.apache.cloudstack:cloud-plugin-user-authenticator-md5:jar:4.0. is missing, no dependency information available
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/apache/cloudstack/cloud-plugin-user-authenticator-plaintext/4.0.2/cloud-plugin-user-authenticator-plaintext-4.0.2.pom
[WARNING] The POM for org.apache.cloudstack:cloud-plugin-user-authenticator-plaintext:jar:4.0. is missing, no dependency information available
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/apache/cloudstack/cloud-plugin-network-nvp/4.0.2/cloud-plugin-network-nvp-4.0.2.pom
[WARNING] The POM for org.apache.cloudstack:cloud-plugin-network-nvp:jar:4.0. is missing, no dependency information available
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/apache/cloudstack/cloud-plugin-network-ovs/4.0.2/cloud-plugin-network-ovs-4.0.2.pom
[WARNING] The POM for org.apache.cloudstack:cloud-plugin-network-ovs:jar:4.0. is missing, no dependency information available
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/apache/cloudstack/cloud-plugin-network-elb/4.0.2/cloud-plugin-network-elb-4.0.2.pom
[WARNING] The POM for org.apache.cloudstack:cloud-plugin-network-elb:jar:4.0. is missing, no dependency information available
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/apache/cloudstack/cloud-plugin-hypervisor-xen/4.0.2/cloud-plugin-hypervisor-xen-4.0.2.pom
[WARNING] The POM for org.apache.cloudstack:cloud-plugin-hypervisor-xen:jar:4.0. is missing, no dependency information available
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/apache/cloudstack/cloud-plugin-hypervisor-ovm/4.0.2/cloud-plugin-hypervisor-ovm-4.0.2.pom
[WARNING] The POM for org.apache.cloudstack:cloud-plugin-hypervisor-ovm:jar:4.0. is missing, no dependency information available
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/apache/cloudstack/cloud-plugin-hypervisor-kvm/4.0.2/cloud-plugin-hypervisor-kvm-4.0.2.pom
[WARNING] The POM for org.apache.cloudstack:cloud-plugin-hypervisor-kvm:jar:4.0. is missing, no dependency information available
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/apache/cloudstack/cloud-plugin-storage-allocator-random/4.0.2/cloud-plugin-storage-allocator-random-4.0.2.pom
[WARNING] The POM for org.apache.cloudstack:cloud-plugin-storage-allocator-random:jar:4.0. is missing, no dependency information available
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/apache/cloudstack/cloud-plugin-planner-user-dispersing/4.0.2/cloud-plugin-planner-user-dispersing-4.0.2.pom
[WARNING] The POM for org.apache.cloudstack:cloud-plugin-planner-user-dispersing:jar:4.0. is missing, no dependency information available
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/apache/cloudstack/cloud-plugin-planner-user-concentrated-pod/4.0.2/cloud-plugin-planner-user-concentrated-pod-4.0.2.pom
[WARNING] The POM for org.apache.cloudstack:cloud-plugin-planner-user-concentrated-pod:jar:4.0. is missing, no dependency information available
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/apache/cloudstack/cloud-plugin-host-allocator-random/4.0.2/cloud-plugin-host-allocator-random-4.0.2.pom
[WARNING] The POM for org.apache.cloudstack:cloud-plugin-host-allocator-random:jar:4.0. is missing, no dependency information available

找到对应的工程,然后执行mvn clean install,哪个出问题就在哪个工程上执行就可以了。

虚拟化平台cloudstack(6)——使用maven:jetty调试的更多相关文章

  1. 虚拟化平台cloudstack新版本的调试

    虚拟化平台cloudstack(7)——新版本的调试 调试环境 ubuntu 12.04 JDK1.7 apache-maven-3.10 eclipse 4.2 Juno mysql 5 源码下载及 ...

  2. 虚拟化平台cloudstack(7)——新版本的调试

    调试环境 ubuntu 12.04 JDK1.7 apache-maven-3.10 eclipse 4.2 Juno mysql 5 源码下载及调试 上面的几个软件在上一篇中已经介绍了. 在新的版本 ...

  3. 虚拟化平台cloudstack(5)——参考资料

    虚拟化的几种方式 完全虚拟化: 半虚拟化: 硬件辅助虚拟化: 详细的内容可以看: http://pan.baidu.com/share/link?shareid=4134188256&uk=2 ...

  4. 虚拟化平台cloudstack(2)——安装(上)

    vmware workstation安装ubuntu server12.04 这个其实没什么说的了,下软件,安装,一顿下一步,OK. 安装完成后,为ubuntu server 12.04安装桌面. 使 ...

  5. 虚拟化平台cloudstack(8)——从UI开始

    UI ucloudstack采用的是前后端分离的架构,就是说前端可以选择使用web.swing甚至其它的界面,都可以. 我们来看cloudstack的UI信息吧,所有的cloudstack的UI都在{ ...

  6. 虚拟化平台cloudstack(4)——几个异常

    cloudstack主机添加不成功 CloudStack正常启动,添加区域.提供点和群集都正常,但是添加主机时提示添加不成功. 先添加主机: 然后出现提示: 在网上找了一圈,基本上没什么回复,没办法, ...

  7. 虚拟化平台cloudstack(3)——安装(下)

    登录时用户名和密码错误 默认账号密码 admin/password 管理节点安装好后,初始化数据库,完了使用admin和password登陆提示用户名密码错误,查看日志: Fail to genera ...

  8. Maven开发环境的搭建,含jetty调试[简单明了]

    之前的一片老文,搬过来. 1. Maven的开发环境需要哪些部件a) Maven.去http://maven.apache.org/ 下载.将其bin目录加入进系统PATH.测试方法:用命令mvn – ...

  9. 整合maven,jetty,jrebel进行debug调试

    整合maven,jetty,jrebel进行调试 maven配置 这个网上有很多,验证mvn是否配置正确: Jrebel配置 解压至目录,不建议目录名有空格 ,破解包下载 参考: http://zer ...

随机推荐

  1. 题目:利用条件运算符的嵌套来完成此题:学习成绩>=90分的同学用A表示,60-89分之间的用B表示,60分以下的用C表示。

    public class Five_05 { public static void main(String[] args) { Scanner input=new Scanner(System.in) ...

  2. [ MySql学习心得 ] --Two

    五.MySql 中常用子句 1.where子句 我们都知道在查询数据时,未必会查整个表中的数据,当有条件查询时,就会用到where子句.其结构: select * from  [表名]  where ...

  3. How to Use Lucene.NET with Windows Azure SQL Database

    http://social.technet.microsoft.com/wiki/contents/articles/2367.how-to-use-lucene-net-with-windows-a ...

  4. linux下rm -r误删NTFS文件恢复方法

    一时疏忽,手一抖,把整个挂载的F盘删了一半!顿时傻眼!! 被删的F盘是Windows下NTFS分区,在Ubuntu12.04中挂载了F盘,使用rm命令时粗心大意,误删了一半的数据. 血的教训告诉我们, ...

  5. 【转】Python中的赋值、浅拷贝、深拷贝介绍

    这篇文章主要介绍了Python中的赋值.浅拷贝.深拷贝介绍,Python中也分为简单赋值.浅拷贝.深拷贝这几种"拷贝"方式,需要的朋友可以参考下   和很多语言一样,Python中 ...

  6. unity3d多线程坑

    单独起了一个线程来处理网络相关操作,比较常规的做法.本身没啥特别的东西,碰到了一个不大不小的坑折腾了好久,记录下来吧. 简单的说就是子线程中抛出的异常,如果没有catch的话,会导致子线程悄无声息的退 ...

  7. css 文字与小图标对齐

    .icon { display: inline-block; width:20px; height:20px; background: url(delete.png) no-repeat center ...

  8. 无法远程到2008R2的解决方法

    运维的一台Server,昨天还很正常,今天突然远程桌面无法登陆,提示“由于没有远程桌面授权服务器可以提供许可证,远程会话被中断.....”,开始以为是权限问题,试了很多方法,都无法解决,后来上网找解决 ...

  9. 网页Email抓取 java

    import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; impo ...

  10. CCNA第二章TCP/IP简介考试要点学习笔记

    1.描述网络是如何工作的     DoD过程/应用层 -- OSI应用.表示和会话层(定义了结点到结点的应用通信协议以及对用户界面规范的控制): DoD主机到主机层 -- OSI传输层(保证了数据包的 ...