简体   繁体   中英

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:

entityManager.persist(member);

However, in Eclipse when I pressed F5 to step into, I received

Source not found
Edit source lookup path

Where is the source of the class TransactionScopedEntityManager located? In my ~/.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. Extract to a location. Open the 'server view'. Select your server runtime and hit f3 (or rightclick and click 'open'). 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.
The real file path is 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. Press 'Ctrl+h' to open search panel, then select the tab 'File Search'. 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.

Manually edit the source path lookup, to point to directly "wildfly-10.1.0.Final-src\\jpa\\subsystem\\src\\main\\java\\", it may help.

I got the source code for JBoss 7.2 EAP from here (JBoss login required):

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

Scroll down the list to 7.2.0 (other versions are also available). Download the source zip file, extract to a local folder then follow the instructions from mojoo-de's answer .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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