Bug 527077 - Java application terminates without running when pdfbox is in classpath
Summary: Java application terminates without running when pdfbox is in classpath
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 4.8   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-09 13:37 EST by Danilo Silva CLA
Modified: 2023-01-01 04:55 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Danilo Silva CLA 2017-11-09 13:37:58 EST
I have a gradle project with the following dependency org.apache.pdfbox:pdfbox:2.0.8. I have generated an Eclipse project using the `gradle eclipse` task. The application consists of only on class Main.java with the following content:

public class Main {
	public static void main(String[] args) {
		System.out.println("Hello world!");
	}
}

When I try to run Main.java within Eclipse (i.e. "Run as" > "Java application" on the Main.java) the console view displays <terminated> with no output. Note that the expected behavior is to display "Hello world!" in the console. Sometimes it works in the first launch, but displays nothing in the later runs. When I try to debug the application, the following error is displayed:

Cannot connect to VM
Socket operation on nonsocket: configureBlocking

I'm using:
- Eclipse JEE Oxygen 1a
- Windows 7 (64 bits)
- Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
- Gradle 2.12


I have only experienced this problem with pdfbox and fontbox JAR's in the classpath. If I remove them, it works. I'm not sure the issue is with Eclipse, but the fact is that it works when running externally. For example, if I run it in the console using `gradle run` task it works as expected.


There is a sample project in GitHub to facilitate the replication. In a windows machine with git and Java, do the following steps:

1. Run the commands in the command prompt:
> git clone https://github.com/danilofes/bug-report-20171109.git
> cd bug-report-20171109
> gradlew eclipse

2. Import in Eclipse using File > Import > General > Existing projects into workspace

3. Right click src/main/java/Main.java and click "Run as" > "Java application". It usually works the first time, but fails in the later runs.
Comment 1 Sarika Sinha CLA 2017-11-09 21:18:32 EST
To me, the culprit appears to be Bug 525608 which is resolved in 4.7.2 and 4.8 latest version. So If you could try out on a new Eclipse SDK, it will help.
Comment 2 Danilo Silva CLA 2017-11-16 14:35:41 EST
(In reply to Sarika Sinha from comment #1)
> To me, the culprit appears to be Bug 525608 which is resolved in 4.7.2 and
> 4.8 latest version. So If you could try out on a new Eclipse SDK, it will
> help.

Unfortunately, the problem also occurs with the Developer build Eclipse Photon (4.8) M3.
Comment 3 Sarika Sinha CLA 2017-11-16 22:47:19 EST
Fix was not present in 4.8 M3 build, you can wait for M4 build or try the latest I build which has the fix.
Comment 4 Danilo Silva CLA 2017-12-07 10:42:05 EST
(In reply to Sarika Sinha from comment #3)
> Fix was not present in 4.8 M3 build, you can wait for M4 build or try the
> latest I build which has the fix.

I experienced the same problem using version 4.7.2RC4. This version should contain the fix to Bug 525608, right? Does it mean the problem is not related?
Comment 5 Sarika Sinha CLA 2017-12-07 19:35:37 EST
Looks like it's a a different bug then and there can be multiple things which can cause this. Some particular jar in the buildpath, some firewall or vpn or unavailable port.
May be this is one of the reproducible scenarios for Bug 452665.
Comment 6 Sarika Sinha CLA 2018-08-20 05:09:46 EDT
Not having enough information to proceed.
Comment 7 Rodrigo Blanc CLA 2018-11-20 10:59:40 EST
I'm just having exactly the same problem Daniel reported.
Any prevision to fix?

I'm using:
Eclipse Java EE IDE for Web Developers.
Version: 2018-09 (4.9.0)
Build id: 20180917-1800
Comment 8 Eclipse Genie CLA 2020-11-10 06:15:43 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 9 Eclipse Genie CLA 2023-01-01 04:55:12 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.