简体   繁体   English

如何在Eclipse调试中找到Wildfly的源代码

[英]How to find the source code of Wildfly in Eclipse debug

I am using Wildfly 10 and Eclipse develop an application, and need to debug into a class TransactionScopedEntityManager through this "persist" method:我正在使用 Wildfly 10 和 Eclipse 开发一个应用程序,需要通过这个“persist”方法调试到一个类 TransactionScopedEntityManager 中:

entityManager.persist(member);

However, in Eclipse when I pressed F5 to step into, I received但是,在 Eclipse 中,当我按 F5 进入时,我收到了

Source not found
Edit source lookup path

Where is the source of the class TransactionScopedEntityManager located? TransactionScopedEntityManager 类的来源在哪里? In my ~/.m2/repository/org/jboss/:在我的 ~/.m2/repository/org/jboss/ 中:

aesh/                 integration-platform/ jboss-parent/         jdf/                  marshalling/          remotingjmx/          shrinkwrap/           staxmapper/           weld/                                                        
arquillian/           jboss-dmr/            jboss-vfs/            logging/              remoting/             sasl/                 spec/                 threads/              xnio/

It has all those directories.它有所有这些目录。 Where to find the source code of the class?在哪里可以找到类的源代码?

http://wildfly.org/downloads/下载“Application Server Source Code”zip,将其展开到某处并配置 Eclipse 的 Source Lookup 以查看该文件夹。

Download the source code, matching your runtime, from the wildfly project page.从 Wildfly 项目页面下载与您的运行时匹配的源代码。 Extract to a location.提取到一个位置。 Open the 'server view'.打开“服务器视图”。 Select your server runtime and hit f3 (or rightclick and click 'open').选择您的服务器运行时并按 f3(或右键单击并单击“打开”)。 Click 'open launch configuration'.单击“打开启动配置”。 Go to tab 'Source'.转到选项卡“来源”。 Click 'Add'.点击“添加”。 Select 'File System Directory' and hit 'Ok'.选择“文件系统目录”并点击“确定”。 Choose the location that you extracted the source to and check 'Search subfolders'.选择您将源提取到的位置并选中“搜索子文件夹”。 Confirm with 'OK'-用“确定”确认-

The package path is org.jboss.as.jpa.container.包路径是 org.jboss.as.jpa.container。
The real file path is wildfly-master\\jpa\\subsystem\\src\\main\\java\\org\\jboss\\as\\jpa\\container.真正的文件路径是wildfly-master\\jpa\\subsystem\\src\\main\\java\\org\\jboss\\as\\jpa\\container。
If you need to find source code in Eclipse, you could use 'File Search' function in Eclipse.如果您需要在 Eclipse 中查找源代码,您可以使用 Eclipse 中的“文件搜索”功能。 Press 'Ctrl+h' to open search panel, then select the tab 'File Search'.按“Ctrl+h”打开搜索面板,然后选择“文件搜索”选项卡。 Now you could input keywords in Containing Text, and find them.现在您可以在包含文本中输入关键字并找到它们。

I unzip WildFly 10 source code, did a search in File explorer for "TransactionScopedEntityManager.java", i found it is under wildfly-10.1.0.Final-src\\jpa\\subsystem\\src\\main\\java\\org\\jboss\\as\\jpa\\container.我解压 WildFly 10 源代码,在文件资源管理器中搜索“TransactionScopedEntityManager.java”,我发现它在 wildfly-10.1.0.Final-src\\jpa\\subsystem\\src\\main\\java\\org\\jboss\\as \\jpa\\容器。

Manually edit the source path lookup, to point to directly "wildfly-10.1.0.Final-src\\jpa\\subsystem\\src\\main\\java\\", it may help.手动编辑源路径查找,直接指向“wildfly-10.1.0.Final-src\\jpa\\subsystem\\src\\main\\java\\”,可能会有帮助。

I got the source code for JBoss 7.2 EAP from here (JBoss login required):我从这里得到了 JBoss 7.2 EAP 的源代码(需要 JBoss 登录):

https://developers.redhat.com/products/eap/download https://developers.redhat.com/products/eap/download

Scroll down the list to 7.2.0 (other versions are also available).向下滚动列表到 7.2.0(其他版本也可用)。 Download the source zip file, extract to a local folder then follow the instructions from mojoo-de's answer .下载源 zip 文件,解压到本地文件夹,然后按照mojoo-de's answer 中的说明进行操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM