eclipse 远程调试jboss as7
Eclipse Guvnor工具参考指南说明书

JBoss Enterprise SOA Platform 5Eclipse Guvnor Tools Reference GuideThis guide is for developers .Edition 5.3.1Last Updated: 2017-10-27JBoss Enterprise SOA Platform 5 Eclipse Guvnor Tools Reference Guide This guide is for developers .Edition 5.3.1David Le SageRed Hat Engineering Content Services******************. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Table of Contents PREFACE CHAPTER 1. PREFACE 1.1. BUSINESS INTEGRATION 1.2. WHAT IS A SERVICE-ORIENTED ARCHITECTURE?1.3. KEY POINTS OF A SERVICE-ORIENTED ARCHITECTURE1.4. WHAT IS THE JBOSS ENTERPRISE SOA PLATFORM?1.5. THE SERVICE-ORIENTED ARCHITECTURE PARADIGM1.6. CORE AND COMPONENTS1.7. COMPONENTS OF THE JBOSS ENTERPRISE SOA PLATFORM1.8. JBOSS ENTERPRISE SOA PLATFORM FEATURES1.9. FEATURES OF THE JBOSS ENTERPRISE SOA PLATFORM'S JBOSSESB COMPONENT1.10. TASK MANAGEMENT1.11. INTEGRATION USE CASE1.12. UTILISING THE JBOSS ENTERPRISE SOA PLATFORM IN A BUSINESS ENVIRONMENT CHAPTER 2. INTRODUCTION 2.1. INTENDED AUDIENCE 2.2. AIM OF THE GUIDE 2.3. REQUIREMENTS AND INSTALLATION 2.4. GUVNOR TOOLS CHAPTER 3. TASKS 3.1. CREATING A NEW GUVNOR CONNECTION3.2. GETTING LOCAL COPIES OF GUVNOR FILES3.3. MANAGING GUVNOR RESOURCES CHAPTER4. REFERENCE 4.1. GUVNOR REPOSITORY EXPLORING PERSPECTIVE 4.2. STARTING THE GUVNOR CONNECTION WIZARD 4.3. CONFIGURING THE GUVNOR CONNECTION WIZARD 4.4. RESOURCE FROM GUVNOR WIZARD 4.5. GUVNOR REPOSITORIES VIEW 4.6. GUVNOR RESOURCE HISTORY VIEW 4.7. CONFIGURING THE GUVNOR RESOURCE HISTORY VIEW 4.8. GUVNOR PREFERENCES 4.9. GUVNOR REPOSITORY CONNECTION PREFERENCES 4.10. LOCAL GUVNOR REPOSITORY RESOURCE DECORATION PREFERENCES APPENDIX A. REVISION HISTORY 233334445556678888910101011131313141415151616161718Table of Contents1Eclipse Guvnor Tools Reference Guide PREFACE2CHAPTER 1. PREFACE3Eclipse Guvnor Tools Reference Guide1. the messages being exchanged2. the agents that act as service requesters and providers3. the shared transport mechanisms that allow the messages to flow back and forth.Report a bug1.4. WHAT IS THE JBOSS ENTERPRISE SOA PLATFORM?The JBoss Enterprise SOA Platform is a framework for developing enterprise application integration (EAI) and service-oriented architecture (SOA) solutions. It is made up of an enterprise service bus (JBoss ESB) and some business process automation infrastructure. It allows you to build, deploy, integrate and orchestrate business services.Report a bug1.5. THE SERVICE-ORIENTED ARCHITECTURE PARADIGMThe service-oriented architecture (SOA) consists of three roles: requester, provider, and broker.Service ProviderA service provider allows access to services, creates a description of a service and publishes it to theservice broker.Service RequesterA service requester is responsible for discovering a service by searching through the servicedescriptions given by the service broker. A requester is also responsible for binding to servicesprovided by the service provider.Service BrokerA service broker hosts a registry of service descriptions. It is responsible for linking a requester to aservice provider.Report a bug1.6. CORE AND COMPONENTSThe JBoss Enterprise SOA Platform provides a comprehensive server for your data integration needs. On a basic level, it is capable of updating business rules and routing messages through an Enterprise Service Bus.The heart of the JBoss Enterprise SOA Platform is the Enterprise Service Bus. JBoss (ESB) creates an environment for sending and receiving messages. It is able to apply “actions” to messages to transform them and route them between services.There are a number of components that make up the JBoss Enterprise SOA Platform. Along with the ESB, there is a registry (jUDDI), transformation engine (Smooks), message queue (HornetQ) and BPEL engine (Riftsaw).4CHAPTER 1. PREFACE5Eclipse Guvnor Tools Reference Guide6CHAPTER 1. PREFACE The company wants an inexpensive solution but one that will adhere to the strict regulations and security requirements of the financial sector. What the company does not want to do is to have to write and maintain “glue code” to connect their legacy databases and systems.The JBoss Enterprise SOA Platform was selected as a middleware layer to integrate these legacy systems with the new customer websites. It provides a bridge between front-end and back-end systems. Business rules implemented with the JBoss Enterprise SOA Platform can be updated quickly and easily. As a result, older systems can now synchronise with newer ones due to the unifying methods of SOA. There are no bottlenecks, even with tens of thousands of transactions per month. Various integration types, such as XML, JMS and FTP, are used to move data between systems. Any one of a number of enterprise-standard messaging systems can be plugged into JBoss Enterprise SOA Platform providing further flexibility.An additional benefit is that the system can now be scaled upwards easily as more servers and databases are added to the existing infrastructure.Report a bug1.12. UTILISING THE JBOSS ENTERPRISE SOA PLATFORM IN A BUSINESS ENVIRONMENTCost reduction can be achieved due to the implementation of services that can quickly communicate with each other with less chance of error messages occurring. Through enhanced productivity and sourcing options, ongoing costs can be reduced.Information and business processes can be shared faster because of the increased connectivity. This is enhanced by web services, which can be used to connect clients easily.Legacy systems can be used in conjunction with the web services to allow different systems to "speak" the same language. This reduces the amount of upgrades and custom code required to make systems synchronise.Report a bugEclipse Guvnor Tools Reference GuideCHAPTER 2. INTRODUCTION Report a bug2.4. GUVNOR TOOLSThe Guvnor repository is a location where certain artifacts (such as rules and SOA policy definitions) are controlled (“governed”) by policies defined by the deployment environment. The purpose of the EGT (Eclipse Guvnor Tools) is to enable access to resources held by the Guvnor repository. Limited capabilities for reading, writing, adding and removing Guvnor repository resources are provided in the EGT.Report a bugEclipse Guvnor Tools Reference GuideCHAPTER 3. TASKS such as the Eclipse Resource Navigator and the Java Package Explorer. The Dummyrule.drl file with the decoration in the Resource Navigator. The Guvnor icon decorator ison the top right of the file image, and the Guvnor revision details are appended to the file name.You can change the location of these in the Local Guvnor Repository ResourceDecoration Preferences.3. You can see that the Dummy rule.drl file is associated with a Guvnor repository resource,and the local copy is based on revision 0, with a 02-10-2008, 4:21:53 date/time stamp.However, the file Sample.drl is not associated with a Guvnor repository file.4. The EGT adds a property page to the standard Eclipse properties dialog. Use it to view thespecific Guvnor repository, the location within the repository, the version (date/time stamp) andthe revision number.Figure 3.2. PropertiesReport a bug3.3. MANAGING GUVNOR RESOURCESThe EGT provides a number of actions (available through the Guvnor context menu on files) for working with files, both those associated with Guvnor repository master copies and those not associated. The actions are:Update ActionAvailable for Guvnor resources that are not synchronized with the Guvnor repository master copies.These resources may not have synchronized due to local changes and/or changes to the master copy. Performing the Update action replaces the local file contents with the current contents from the Guvnor repository master copies.Add ActionAvailable for local files that are not associated with a Guvnor repository master copy. Choosing theEclipse Guvnor Tools Reference GuideCHAPTER 4. REFERENCE CHAPTER 4. REFERENCE4.1. GUVNOR REPOSITORY EXPLORING PERSPECTIVE1. In the Eclipse workbench menu, select Window→Open Perspective→Other to view theperspective list.2. Choose the perspective you wish to use. Eclipse standard views such as Properties andare useful.Resource NavigatorFigure 4.1. Perspective listReport a bug4.2. STARTING THE GUVNOR CONNECTION WIZARD1. To start the Guvnor Connection wizard, open Eclipse and select File→New→Other→Guvnor→Guvnor repository location.2. Alternatively, open the Guvnor Repositories and click the menu button in the drop-downlist.Eclipse Guvnor Tools Reference GuideCHAPTER 4. REFERENCE3. Once the source Guvnor repository is chosen, the wizard prompts for the resources to be copied.4. Finally, choose the target location for the files in the local workspace.5. On completion the wizard copies the selected files from the Guvnor repository to the localworkspace. If a file with the same name already exists in the destination, you will be prompted torename it.Report a bug4.5. GUVNOR REPOSITORIES VIEWThe Guvnor Repositories view contains tree structures representing the contents of Guvnor repositories. You can perform the following actions under the resources in the Guvnor Repositories view:Table 4.1. Guvnor Repositories View ActionsCreate a new Guvnor repository connection Use the wizard to create a new connection byselecting File→New→Other→Guvnor→Guvnor repository location in Eclipse.Delete (Remove a Guvnor repository connection Click Array ) to remove a repository connection.Refresh Guvnor repository e the Refresh context menu item to reload thetree for the selected node."Drill-into" functionality Use icons on the toolbar such as the Home, GoBack and Go Into buttons to navigate deeplynested structures.Returns the tree to the top-level structure.Go Home button ()Selecting a file in the Guvnor repository Doing this causes the Eclipse Properties view todisplay the details of that file.Report a bug4.6. GUVNOR RESOURCE HISTORY VIEWEclipse Guvnor Tools Reference GuideCHAPTER 4. REFERENCE17Eclipse Guvnor Tools Reference GuideAPPENDIX A. REVISION HISTORYRevision 5.3.1-30.4002013-10-31Rüdiger Landmann Rebuild with publican 4.0.0Revision 5.3.1-30Wed Feb 20 2013CS Builder Robot Built from Content Specification: 7132, Revision: 37531418。
CentOS+Jdk+Jboss+dubbo+zookeeper集群配置教程

目录1.软件准备 (2)2.安装步骤 (2)2.1.安装虚拟机 (2)2.2.在CentOS上安装JDK (2)2.3.安装Jboss (4)2.4.Zookeeper单机版的安装与测试 (6)2.5.Zookeeper 集群安装(单点与分布式成功安装) (9)2.6.dubbo管理控制台及集成zookeeper集群部署 (11)CentOS+Jdk+Jboss+Dubbo配置教程1.软件准备虚拟机:VMware-workstation-full-10.0.0-1295980.exe CentOS:CentOS-5.10-i386-bin-DVD-1of2.iso、CentOS-5.10-i386-bin-DVD-2of2.isoJdk7:jdk-7u45-linux-i586.rpmJboss7.1.1:jboss-as-7.1.1.Final.zipZookeeper:zookeeper-3.4.5.tar.gzSSH工具:SSHSecureShellClient-3.2.9.exe2.安装步骤2.1.安装虚拟机一、在电脑上安装VMware-workstation-full-10.0.0-1295980.exe二、在Vmware上安装CentOS 操作系统2.2.在CentOS上安装JDK一、查看Linux自带的JDK是否已安装(卸载centOS已安装的1.4)安装好的CentOS会自带OpenJdk,用命令java -version ,会有下面的信息:# java –version(注:下面开始#开始是shell命令,并且用颜色区分)java version "1.6.0"OpenJDK Runtime Environment (build 1.6.0-b09)OpenJDK 64-Bit Server VM (build 1.6.0-b09, mixed mode)最好还是先卸载掉openjdk,在安装sun公司的jdk,先查看rpm -qa | grep java# rpm -qa | grep javajava-1.4.2-gcj-compat-1.4.2.0-40jpp.115java-1.6.0-openjdk-1.6.0.0-1.7.b09.el5卸载:#rpm -e --nodeps java-1.4.2-gcj-compat-1.4.2.0-40jpp.115#rpm -e --nodeps java-1.6.0-openjdk-1.6.0.0-1.7.b09.el5二、安装JDK在usr下新建java文件夹,用ssh工具将安装包jdk-7u45-linux-i586.rpm放在/usr/java目录下,然后安装JDK,注:也可以直接在centos直接点击安装jdk;# cd /usr/java# sudo rpm -ivh jdk-7u45-linux-i586.rpm三、配置环境变量# vi /etc/profile按i 进入vi插入模式,光标移动到最后,在最后加入以下几行:export JA V A_HOME=/usr/java/jdk1.6.0_10exportCLASSPATH=.:$JA V A_HOME/jre/lib/rt.jar:$JAV A_HOME/lib/dt.jar:$JA V A_HOME/l ib/tools.jarexport PATH=$PATH:$JA V A_HOME/bin按ESC:wq(退出vi 并保存)# reboot (重启机器配置生效)2.3.安装Jboss一、把jboss解压文件放到usr文件夹下面,目录文件结构/usr/jboss-as-7.1.1.Final/bin二、执行添加管理员用户#cd /usr/local/jboss/bin#sh add-user.shWhat type of user do you wish to add?a) Management User (mgmt-users.properties)b) Application User (application-users.properties): aEnter the details of the new user to add.Realm (ManagementRealm) : (回车)Username : (输入用户名)Password : (输入密码)Re-enter Password :(重新输入密码)About to add user 'adminjboss' for realm 'ManagementRealm'Is this correct yes/no? yesAdded user 'adminjboss' to file '/usr/local/jboss/standalone/configuration/mgmt-users.properties'Added user 'adminjboss' to file '/usr/local/jboss/domain/configuration/mgmt-users.properties'三、配置环境变量# vi /etc/profileexport JBOSS_HOME=/usr/jboss-as-7.1.1.Finalexport PATH=$PATH:$JBOSS_HOME/bin:wq四、修改standalone.xml文件编辑standalone.xml文件,将jboss.bind.address.management、jboss.bind.address 127.0.0.1替换为本机IP或者0.0.0.0vi /jboss/standalone/configuration/standalone.xml<interfaces><interface name="management"><inet-address value="${jboss.bind.address.management: 127.0.0.1}"/> </interface><interface name="public"><inet-address value="${jboss.bind.address: 127.0.0.1}"/></interface><interface name="unsecure"><inet-address value="${jboss.bind.address.unsecure: 127.0.0.1}"/> </interface><interface name="ipv4"><any-ipv4-address/></interface></interfaces>保存并退出,按ESC后输入:wq五、编辑防火墙vi /etc/sysconfig/iptables注意要在最后一句的前面添加如下语句:-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT-A INPUT -m state --state NEW -m tcp -p tcp --dport 8009 -j ACCEPT六、启动jboss启动jboss有两种方式:(1)如果关闭当前窗口则jboss服务也被关闭。
Myeclipse7.0+JBoss5.0测试EJB3.0环境搭建过程详解

/guoquanyou Myeclipse7.0+JBoss5.0测试EJB3.0环境搭建过程详解1.首先去官方网站将对应的工具下载,在这里用到的工具与版本如下:jdk1.6.0_11(/)jboss-5.0.0.GA-jdk6(/)Myeclipse7.02.将对应的工具安装并进行环境搭建。
安装jdk,并配置环境变量JAVA_HOME,path,classpath,这个比较简单,这里不再详解。
安装(或解压)jboss,并配置环境变量JBOSS_HOME, path,与jdk配置基本相同。
3.安装Myeclipse,并配置Jboss,由于此处Jboss采用5.x版,故Jdk需要采用6.0版。
设置对应的JDK版本4.创建EJBTest项目,测试环境Add External JARs->将Jboss中client目录下的所以包都加载进来5、新建接口HelloWorld(1)可以通过eclipse进行发布,并将发布包拷贝到D:\jboss-5.0.0.GA-jdk6\jboss-5.0.0.GA\server\default\deploy目录下。
导出过程如下:右键项目->export->Java->jar(2)可以通过ant进行发布,这个方便后面开发过程,不需要每次都要发布并拷贝到deploy目录,只要设置好,相关信息,可以直接发布到目录deploy下。
在项目根目录下,新建build.xml文件,该文件呈现蚂蚁形状。
通过ant对项目进行发布,可以去deploy目录查看。
8.启动JBOSS服务器如果提示找不到main方法。
需要如下配置。
添加自己安装的JDK,替换myeclipse自带的jdk,即可解决该问题。
Eclipse插件开发之基础篇(3)插件的测试与调试

Eclipse插件开发之基础篇(3)插件的测试与调试1. 使⽤JUnit对插件进⾏测试 Eclipse中已经嵌⼊了JUnit,我们可以使⽤JUnit为插件进⾏单体测试。
⼀般的JUnit是不可以对插件部分(对Eclipse的API依赖的部分)进⾏测试的,但是在PDE环境中使利⽤JUnit对插件进⾏单元测试成为可能。
要想进⾏测试⾸先要添加插件的依赖关系,在插件设定页⾯的[依赖关系(Dependencies)]页⾯点击[增加(Add)]按钮,添加[org.junit(3.8.2)]作为必须插件(图3-1)。
图3-1 增加org.junit插件的依赖关系 接下来,⽣成测试⽤例(TestCase)。
测试⽤例和⼀般的JUnit⽤例相同,继承junit.framework.TestCase。
代码1中的测试⽤例说明了,在⼯作台页⾯中打开⼀个视图,并且确认打开的视图处于激活状态。
代码1 插件测试⽤例的⽰例public class SampleViewTest extends TestCase {public SampleViewTest(String name) throws Exception {//取得当前活动的页⾯IWorkbench workbench = PlatformUI.getWorkbench();IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();IWorkbenchPage page = window.getActivePage();//打开视图page.showView("cn.sf.amateras.sample.views.SampleView");//确认打开的视图处于激活状态IWorkbenchPart activePart = page.getActivePart();assertTrue(activePart instanceof IViewPart);assertEquals("cn.sf.amateras.sample.views.SampleView",activePart.getSite().getId());}} 当前这个测试⽤例可以通过在测试类上点右键[执⾏(Run As)]->[JUnit插件测试(JUnit Plug-in Test)]执⾏。
JBOSS的下载安装、环境变量配置以及部署

JBOSS的下载安装、环境变量配置以及部署JBoss是纯Java的EJB(企业JavaBean)服务器。
第一步:下载安装1.进入官网/downloads,选择“(158mb Install)”这个是JBoss EAP6.2.0.GA,是最新版的,而且是Windows安装包。
如果想下载ZIP压缩包,就选择“Seemore……”,再选择ZIP压缩包。
2.下载完成后,安装就可以,安装路径一般是:C:\program files\EAP-6.2.0\jboss-eap-6.2;ZIP压缩包解压到一个路径纯英文的文件夹下,如:E:\JBOSS\jboss-eap-6.2.0第二步:环境变量配置JBoss的使用必须有JDK,只有JRE是不行的,所以你的电脑必须首先配置Java环境变量3.下载JDK(/technetwork/java/javase/downloads/index.html),现在最新版本为8.05,安装或者解压后到一个纯英文目录或者文件夹下:如:C:\ProgramFiles\Java\jdk1.8.0_05\。
我以windows 7 来说明,4.首先右键点击桌面上的计算机,选择属性-->高级系统设置-->环境变量,在系统变量中新建一个变量名:JAVA_HOME,变量值(路径):就是你解压的路径,路径一直到看得见bin目录为止:将上面路径复制环境变量路径里,确定。
5.找到path变量,然后在打开在最前面输入%JAVA_HOME%\bin; 注意最后的分号不能少,他能把该路径和别的路径区分开。
6.现在JDK配置好了,接下来可以配置JBOSS了;还是在环境变量新建一个:JBOSS_HOME 路径为你解压JBOSS的路径:一直到看的到bin目录为止,路径粘贴复制到新建的环境变量路径里,确定。
7.新建一个环境变量:Classpath 路径为:%JAVA_HOME%\lib; 注意最后的分号不能少。
Eclipse Debug模式快捷键

在Eclipse中使用调试程序最基本的操作是:1.首先在一个java文件中设断点,然后debug as-->open debug Dialog,然后在对话框中选类后--> Run当程序走到断点处就会转到debug视图下。
2.F5键与F6键均为单步调试,F5是step into,也就是进入本行代码中执行,F6是step over,也就是执行本行代码,跳到下一行,3.F7是跳出函数4.F8是执行到最后。
快捷键的详细介绍:1.Step Into (also F5) 跳入2.Step Over (also F6) 跳过3.Step Return (also F7) 执行完当前method,然后return跳出此method4.step Filter 逐步过滤一直执行直到遇到未经过滤的位置或断点(设置Filter:window-preferences-java-Debug-step Filtering)5.resume 重新开始执行debug,一直运行直到遇到breakpoint6.hit count 设置执行次数适合程序中的for循环(设置 breakpoint view-右键hit count)7.inspect 检查运算。
执行一个表达式显示执行值8.watch 实时地监视变量的变化9.我们常说的断点(breakpoints)是指line breakpoints,除了line breakpoints,还有其他的断点类型:field(watchpoint)breakpoint,method breakpoint,exception breakpoint.10.field breakpoint 也叫watchpoint(监视点) 当成员变量被读取或修改时暂挂11.添加method breakpoint 进入/离开此方法时暂挂(Run-method breakpoint)12.添加Exception breakpoint 捕抓到Execption时暂挂(待续...)断点属性:1.hit count 执行多少次数后暂挂用于循环2.enable condition 遇到符合你输入条件(为ture\改变时)就暂挂3.suspend thread 多线程时暂挂此线程4.suspend VM 暂挂虚拟机13.variables 视图里的变量可以改变变量值,在variables 视图选择变量点击右键--change value.一次来进行快速调试。
Pentaho技术白皮书中文版(一)用 Eclipse 构建和调试 Pentaho
这篇文档的目的是教会开发人员如何开始进行Pentaho 的开发。
这篇文档解释了如何在Eclipse 中设置一个开发环境,包括如何连接到Pentaho Subversion repository,检出Pentaho 项目,使用一个'1stand-alone'1 Java 应用和Eclipse JBoss IDE 来构建调试它们。
这篇文档也解释了Pentaho repository 结构和对于开发Pentaho 来说,许多很重要的build targets。
目标读者是软件开发人员。
我们假设读者已经很熟悉Eclipse 平台和Java 开发。
如果目的是将平台配置为一个J2EE 应用,我们假设读者了解J2EE 和应用服务器。
我们此处就是使用JBoss 应用服务器进行演示。
虽然不是很重要,但如果读者有使用Apache Ant 的经验也会很有用处。
如果你仔细阅读了这个指南中的说明,但仍没有解决你的问题,请到论坛寻找答案:/.01. 设置你的环境以下是开始研究Pentaho,你需要使用的工具列表。
推荐你现在就下载所有必需的包,这样你就可不间断的进行试用。
1. 一个Java SDK:Pentaho BI Platform 在Java SDK 1.4 上构建和测试。
注意你需要完整的SDK,而不仅仅是runtime (JRE)。
2. Ant:基于Java 的构建工具。
3. Eclipse:平台IDE。
4. Subclipse:一个Eclipse 插件,其在Eclipse IDE 上添加了Subversion 集成。
5. JBoss IDE for Eclipse。
为开始设置:1. 下载和安装你的Java SDK。
2. 下载和安装Ant。
3. 下载和安装Eclipse。
4. 下载和安装Subclipse。
5. 下载和安装JBoss IDE for Eclipse。
以后章节是关于Pentaho 团队使用的这些工具的版本说明,以及使环境适合于Pentaho 平台codeline 开发的技巧。
学习使用Eclipse进行高级的Java开发和调试技巧
学习使用Eclipse进行高级的Java开发和调试技巧第一章:Eclipse简介Eclipse是一个著名的集成开发环境(IDE),用于开发各种编程语言,特别是Java。
它的功能强大,易于使用,可以大大提高开发人员的效率。
本章将介绍Eclipse的基本特点和常用功能。
1.1 Eclipse的特点Eclipse是一个开源软件,支持多种操作系统,具有可扩展性强的插件体系结构,可以根据需要安装各种插件来扩展其功能。
它具有代码补全、代码导航、错误提示、代码重构等功能,使得编写代码更加便捷高效。
1.2 Eclipse的安装和配置要使用Eclipse进行高级的Java开发和调试技巧,首先需要下载并安装Eclipse。
安装后,可以根据需要进行一些基本的配置,如设置工作区、选择编译器版本等。
第二章:Java项目的创建与管理2.1 创建Java项目在Eclipse中创建Java项目非常简单。
选择File -> New -> Java Project,然后按照提示进行操作即可。
同时,可以设置项目名称、路径、源文件夹等。
2.2 导入和导出Java项目可以将已经存在的Java项目导入到Eclipse中,选择File -> Import -> Existing Projects into Workspace,然后选择要导入的项目即可。
同样,可以将项目导出为可执行的JAR文件或WAR文件,以便于分发和部署。
2.3 项目的管理Eclipse提供了多种管理项目的功能。
可以通过Package Explorer或Project Explorer视图来查看和管理项目的文件和文件夹结构,可以创建和删除源文件、包和类,可以设置类路径和库引用等。
第三章:编辑和调试Java代码3.1 编写Java代码在Eclipse中,可以通过打开一个Java源文件来编辑代码。
Eclipse提供了代码补全、语法高亮、代码折叠等功能,大大提高了编辑的效率和质量。
eclipse调试java程序的九个技巧
eclipse调试java程序的九个技巧九个技巧:1. 逻辑结构2. 条件debug3. 异常断点4. 单步过滤5. 跳到帧6. Inspect7. expressions8. display9. 远程debug 最早开始⽤eclipse的debug的时候,只会F5 F6 F7 F8,甚⾄F7都不是很搞的明⽩是怎么⽤的,那时候资浅,碰不到需要复杂debug的代码,慢慢⼯作深⼊了,场景碰多了,就需要各种debug技巧来提升定位bug效率,以前找⼈帮忙排查问题,看他开各种窗⼝debug各种溜甚是羡慕嫉妒恨,慢慢久病成医⾃⼰也⽤溜了eclipse的⼀些主要的debug技巧。
稍作整理分享出来。
F5678这四个基本技能就略过不说了,但是最基本的技能能解决90%问题,所以虽然略过不说,但是必须⽤的很溜,相信园友达⼈们这四个肯定⽐我⽤的溜的多。
1. 逻辑结构逻辑结构主要⽤来展⽰map之类的collection数据结构存储的值的,它只展⽰存储值的逻辑部分,⽽屏蔽了数据结构详细的内部结构,更⽅便我们查看map之类collection结构⾥存储的值,推荐使⽤。
这个按钮就是展⽰逻辑结构的按钮,下⾯两个图,上图是不展⽰逻辑结构,下图是展⽰逻辑结构,很明显,下图的结构可读性更强,可以专注于debug的变量。
2. 条件debug条件debug⽤在需要满⾜某种条件才会触发断点的场景,⽐如只有id是12345这条记录会有问题,那就当id等于12345时才触发断点,其他都放过。
右击断点选择断点属性,就能看到这样⼀个配置框,右边的⽂本区块可以填写条件代码,⽐如id==12345,由于每次都要做这个判断,如果循环数很⼤的话,还是有点点慢的,你可以去上个厕所接个⽔啊什么的,还是很⽅便的。
3. 异常断点异常断点只要⽤在debug某种异常的时候,可以配置当这个异常出现后才触发断点,不需要debug去寻找异常。
点击这个红圈就能弹出异常断点的窗⼝,会列出你系统⾥的所有异常类,然后选择需要断点的异常就OK。
eclipse远程debug tomcat
要求:
1>本机代码保持与tomcat一致
步骤
1、Linux中配置tomcat在catalina.sh中添加如下
CATALINA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"
注意:上诉代码必须写成一行,不能换行。
2、Window中修改catalina,bat文件,添加:
Set “CATALINA_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend =n"
注意:上诉代码必须写成一行,不能换行。
3、启动tomcat
4、Eclipse使用配置好的debug启动具体配置如下
启动之后debug 透视图内容如图,此时Console 没有输出是正常的
然后打开tomcat 应用
点击按钮eclipse 就会拦截到动作
可以查看变量值,但是报错的时候Console 依然没有输出
而且还有个很恶心的就是你的eclipse 开启了链接那么其他人在使用的时候也会被eclipse拦截..。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
eclipse 远程调试jboss7
在 %jbosss_home%/ bin目录下,
找到standalone.conf文件:
加上如下参数:
JAVA_OPTS="$JAVA_OPTS -Xdebug
-Xrunjdwp:transport=dt_socket,address=8888,server=y,suspend=n"
最终的截图如下:
在eclipse中创建web项目test2,
index.jsp:
<%@page contentType="text/html; charset=utf-8"%>
<%@ page import="com.sunyard.*"%>
<%
Remote.sayChinese();
Remote.sayChinese2();
%>
Hello World!
package com.sunyard;
public class Remote {
public static void sayChinese(){
System.out.println("chinese");
}
public static void sayChinese2(){
System.out.println("chinese3");
}
public static void sayChinese3(){
System.out.println("chinese3");
}
}
在Remote类的sayChinese方法中添加断点:
然后将项目打包成war包, 部署到
/%jboss_home%/standalone/deployments目录下。
在eclipse下, 点击
Run---Debug Configurations…
进入debug的配置页面:
选择要debug的项目, 如上图。
Host填写服务器ip
Port中填写的端口要和standalone.conf中配置的端口一致, 且不要被其他程序占用。然后
点击“Debug”按钮:
如果远程的服务没有启动, 会出现以下错误:
启动项目:进入/%jboss_home%/bin目录, 在linux下的话, 执行./standalone.sh启动项目,
这是在eclipse中点击“Debug”按钮就可以连接到远程。