Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 220197 - Agent Controller is unavailable under port 10002
Summary: Agent Controller is unavailable under port 10002
Status: CLOSED DUPLICATE of bug 214788
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: TPTP (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P1 critical (vote)
Target Milestone: ---   Edit
Assignee: Bing Xu CLA
QA Contact:
URL:
Whiteboard: closed471
Keywords:
: 197117 218118 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-02-25 09:51 EST by John A. Murdie CLA
Modified: 2016-05-05 10:51 EDT (History)
3 users (show)

See Also:
xubing: review?


Attachments
Patch to handle when Java runtime fails to launch IAC (907 bytes, patch)
2008-03-03 16:15 EST, Bing Xu CLA
no flags Details | Diff
Top of screenshot of installed plugins (119.30 KB, image/png)
2008-03-06 07:23 EST, John A. Murdie CLA
no flags Details
Bottom of screenshot of installed plugins (127.78 KB, image/png)
2008-03-06 07:24 EST, John A. Murdie CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description John A. Murdie CLA 2008-02-25 09:51:10 EST
Build ID: Version: 3.3.1.1
M20071023-1652

Steps To Reproduce:
1. Download eclipse-SDK-3.3.1.1-linux-gtk.tar.gz
2. tar xvfz it
3. java --version writes 'java version "1.5.0_14"' etc
4. export ECLIPSE_HOME=(here)
5. ./eclipse
6. Follow the instructions to make a Java 'Hello World' project.
7. Choose 'Run -> Profile' - get dialogue box:

    Warning
    One of the selected launch delegates has failed.
    Reason:
    OK       Details

8. Press 'Details' to get the 'More information' below.

More information:
Dialogue box contains (pity that this text can't be copied in one go):

java.lang.NullPointerException
  at org.eclipse.tptp.platform.iac.administrator.internal.startstop.AutoStartStop.hasProcessTerminated(AutoStartStop.java:275)
  at org.eclipse.tptp.platform.iac.administrator.internal.startstop.AutoStartStop.startIAC(AutoStartStop.java:113)
  at org.eclipse.tptp.platform.execution.client.core.internal.NodeImpl.connect(NodeImpl.java:117)
  at org.eclipse.tptp.platform.execution.util.internal.AgentControllerPool$1$EstablishConnection.run(AgentControllerPool.java:164)
  at java.lang.Thread.run(Thread.java:595)
Comment 1 John A. Murdie CLA 2008-02-25 09:52:39 EST
I've also tried Eclipse 3.4M5, which apparently has TPTP 4.5, and exactly the same thing happens.

John A. Murdie
Comment 2 John A. Murdie CLA 2008-02-25 10:17:30 EST
I should have mentioned as step 5.5 of 'Steps to reproduce' : Install updates, then install plugins including TPTP.* 4.4.1-*.

John A. Murdie
Comment 3 Bing Xu CLA 2008-03-03 10:30:05 EST
Hi John,

It's very likely that your problem is caused by the racing condition between Eclipse workbench and IAC (ie IAC doesn't get started quick enough).  

Can you try this:   

1. In your Eclipse workbench, make sure IAC is enabled via Window -> Preferences -> Agent Controller.   

2. In Java perspective, click the Profiling button on the tool bar and select Profile Configuration....

3. In the dialog box, create a new External Java Application

4. Under Host tab, click on 'Test Connection'.  Try it couple of times to see if you get 'Connection Successful' message.

5. If failed, check if 'ACServer' is running on your local machine.
Comment 4 Bing Xu CLA 2008-03-03 16:15:32 EST
Created attachment 91442 [details]
Patch to handle when Java runtime fails to launch IAC

The patch doesn't fix the original problem but it handle the scenario when IAC failed to get launched.  Instead of logging NullPointException it logs more detail info to allow us to diagnose the problem.
Comment 5 Bing Xu CLA 2008-03-03 16:16:37 EST
Jonathan, do you mind reviewing the patch.  Thanks.
Comment 6 Jonathan West CLA 2008-03-03 16:36:57 EST
Patch is good.
Comment 7 John A. Murdie CLA 2008-03-04 05:26:47 EST
> --- Comment #3 from Bing Xu <xubing@ca.ibm.com>  2008-03-03 10:30:05 -0500 ---
> Hi John,
> 
> It's very likely that your problem is caused by the racing condition between
> Eclipse workbench and IAC (ie IAC doesn't get started quick enough).  
> 
> Can you try this:   
> 
> 1. In your Eclipse workbench, make sure IAC is enabled via Window ->
> Preferences -> Agent Controller.   

-> Integrated Agent Controller. Yes, it is enabled.

> 2. In Java perspective, click the Profiling button on the tool bar and select
> Profile Configuration....

Profile As -> Open Profile Dialog.

> 3. In the dialog box, create a new External Java Application

External Java Application -> New Configuration -> Host.

> 4. Under Host tab, click on 'Test Connection'.  Try it couple of times to see
> if you get 'Connection Successful' message.

No result or error message - in fact, no change.

> 5. If failed, check if 'ACServer' is running on your local machine.

No, just the fgrep(1) I use to search for it.

; ps -ef | fgrep -i AcServer
john      2440  4161  0 18:20 pts/3    00:00:00 fgrep -i AcServer
;

I'll apply the patch, try again, and let you know what happens.

John A. Murdie
Comment 8 Bing Xu CLA 2008-03-04 09:56:08 EST
Joanna, can you check in the patch.  Thanks.

John, unless you've downloaded TPTP source code, the patch doesn't work for you. The symptom you described could be caused by the failed attempt to launch the IAC process through Java runtime.  What Linux platform are you running this?  SUSE or RedHat?  32 or 64 bit?  'uname -a' command should tell you.
Comment 9 John A. Murdie CLA 2008-03-04 10:02:16 EST
I'm using a 32-bit Slackware Linux 12.0 on a 64-bit processor.

`uname -a` gives:
Linux pc118 2.6.24.2 #2 SMP PREEMPT Mon Feb 11 10:23:42 GMT 2008 i686 AMD
Athlon(tm) 64 Processor 3500+ AuthenticAMD GNU/Linux

John A. Murdie
Comment 10 jkubasta CLA 2008-03-04 10:10:40 EST
Patch applied to Head.  Bug left open in case additional patch is needed to fix the original problem.
Comment 11 Bing Xu CLA 2008-03-04 10:18:48 EST
John, can you check what does the System.getProperty("os.arch") call return in your Java program.  
Comment 12 John A. Murdie CLA 2008-03-04 10:28:50 EST
$ cat > HelloWorld.java
public class HelloWorld {
        public static void main(String[] args) {
                System.out.println("Hello World! - I am running on an " + System.getProperty("os.arch"));
        }
}
^D
$ javac HelloWorld.java
$ java HelloWorld
Hello World! - I am running on an i386
$

This is using a specially-provided Java J2SDK 1.5.0_14, even though our Slackware Linux system has 1.6.0_02-b05 as the default. (Since I gather that current versions of Eclipse have not been qualified with 1.6.*, am I right?)

John A. Murdie
Comment 13 Bing Xu CLA 2008-03-04 11:13:27 EST
John, can you do these:

1. cd to <eclipse install>/plugins/org.eclipse.tptp.platform.ac.linux_ia32_4.4.1.v200802050100/agent_controller/bin

2. Try to run the RAStart.sh and see if you get any errors. 

3. If you get error saying that config file is missing then do step 4 - 6:

4. In <eclipse install>/plugins/org.eclipse.tptp.platform.ac.linux_ia32_4.4.1.v200802050100/agent_controller, do 'ln -s <eclipse install>/plugins plugins'

5. cd <eclipse install>/plugins/org.eclipse.tptp.platform.ac.linux_ia32_4.4.1.v200802050100/agent_controller/lib, do 'cp <eclipse install>/plugins/org.eclipse.tptp.platform.agentcontroller_4.2.101.v200802120100/config.jar .'.   You may have different version of org.eclipse.tptp.platform.agentcontroller in your eclipse.

6. cd <eclipse install>/plugins/org.eclipse.tptp.platform.ac.linux_ia32_4.4.1.v200802050100/agent_controller/bin, run ./SetConfig.sh.

7. Try RAStart.sh again and us 'ps' command to see if ACServer is running.
Comment 14 John A. Murdie CLA 2008-03-04 13:12:06 EST
Ok, but in my case (Eclipse IDE 3.3.1.1, M20071023-1652) it is (of course?)
plugins/org.eclipse.tptp.platform.ac.linux_ia32_4.4.1.v200709261752/agent_controller/bin

Now I know where to look (ok, so I could have gone digging), I see that all these files are non-executable. So, commanding 'chmod a+x *' in this directory and then doing what you ask, I see:

; ./RAStart.sh
Starting Agent Controller.
ACServer: error while loading shared libraries: ../lib/libtptpUtils.so.4: file too short
ACServer failed to start.
; 

which is odd, as I got no warnings of truncation at install time.

The 3.4M5 install I made similarly omits execute permissions from the executables, but does not have the allegedly truncated library. I see:

; ./RAStart.sh
Starting Agent Controller.
ACServer started successfully.
; 

I shall download again and reinstall, taking care to check the size (and checksum, if available) of the downloaded file.

John A. Murdie
Comment 15 Bing Xu CLA 2008-03-04 14:51:20 EST
John, did you get the NullPointException in Eclipse 3.4M5 too?  If so then it seems odd because the Integrated Agent Controller (IAC)'s RAStart.sh works.  How many JVM do you have installed?  It's recommand to use JVM 1.5 in:

1. PATH
2. Eclipse Window Preference -> Java -> Installed JRE 
3. Eclipse Window Preference -> Agent Controller 

If IAC still fails you, you can try to download and install a stand-alone Agent Controller from www.eclipse.org/tptp.   You just need to download, unzip and run the setconfig.  
Comment 16 John A. Murdie CLA 2008-03-05 08:50:05 EST
>John, did you get the NullPointException in Eclipse 3.4M5 too?  If so then it
>seems odd because the Integrated Agent Controller (IAC)'s RAStart.sh works.

Ah, no. I've just tried 3.4M5 again, with JDK 1.5, taking care to start with an empty workspace each time (perhaps this is the mistake I made when testing 3.4M5 last time?) and I *can* do execution profiling (not tried more than this yet) without the executables in
plugins/org.eclipse.tptp.platform.ac.linux_ia32_4.4.0.v200706020100/agent_controller/bin
being marked executable. (Using JDK 1.6 fails with the message "Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file", but that's fair enough for now.)

It's odd, though; I have downloaded 3.3.1.1 twice, with plenty of free disc space, and each time I get the
ACServer: error while loading shared libraries: ../lib/libtptpUtils.so.4: file
too short
message when trying to profile. Is this a known bug in 3.3.1.1?

>How many JVM do you have installed?

We have 1.6 is in people's default PATH, but we have the last version of each of 1.5 and 1.4 also - not in the default PATH - whose executables directories are prefixed as required to a user's PATH by old software which still requires them

>It's recommand to use JVM 1.5 in:

Checking my install of 3.1.1.1 which was done with JDK 1.5 executables in the path, having JDK 1.5 executables in the path when I start it:

>1. PATH
$ which java
/usr/local/j2sdk-1.5.0_14/bin/java
$

>2. Eclipse Window Preference -> Java -> Installed JRE

/usr/local/j2sdk-1.5.0_14

>3. Eclipse Window Preference -> Agent Controller

/usr/local/j2sdk-1.5.0_14/jre/bin/java

>If IAC still fails you, you can try to download and install a stand-alone Agent
>Controller from www.eclipse.org/tptp.   You just need to download, unzip and
>run the setconfig.

(No need for this.)

John A. Murdie
Comment 17 Bing Xu CLA 2008-03-05 11:21:15 EST
(In reply to comment #16)

> Ah, no. I've just tried 3.4M5 again, with JDK 1.5, taking care to start with an
> empty workspace each time (perhaps this is the mistake I made when testing
> 3.4M5 last time?) and I *can* do execution profiling ....

That's good news.  

> It's odd, though; I have downloaded 3.3.1.1 twice, with plenty of free disc
> space, and each time I get the
> ACServer: error while loading shared libraries: ../lib/libtptpUtils.so.4: file
> too short
> message when trying to profile. Is this a known bug in 3.3.1.1?

So did you download Eclipse 3.3.1.1 and then install TPTP through update manager or you download TPTP separately?   Can you list the files you downloaded and we would try it to see if there is an error with the update manager.

Comment 18 John A. Murdie CLA 2008-03-06 07:22:27 EST
Ok, noticing that Eclipse SDK for Linux 3.3.2 has become available since I raised this bug report, I decided to try that - the first time I have done so.

1. Download eclipse-SDK-3.3.2-linux-gtk.tar.gz

2. md5sum(1) it:

a59b9e8911e59da4cf7a5c5fc6a178e4  eclipse-SDK-3.3.2-linux-gtk.tar.gz

which is the correct value as shown at:
http://download.eclipse.org/eclipse/downloads/drops/R-3.3.2-200802211800/checksum/eclipse-SDK-3.3.2-linux-gtk.tar.gz.md5

3. tar xvfz eclipse-SDK-3.3.2-linux-gtk.tar.gz

As ordinary user, with write access to where I have unpacked the tgz file.

4. Prefix PATH with /usr/local/j2sdk-1.5.0_14/bin; check that the command 'which java' gives /usr/local/j2sdk-1.5.0_14/bin/java.

5. ./eclipse

6. Help -> Software Updates -> Find and Install -> Search for updates. Choose
UK http mirror. No updates found.

7. Help -> Software Updates -> Find and Install -> Search for new features. Choose Europa Discovery Site only. Finish. UK httpd mirror (with automatically select mirrors checked). Choose everything. (It doesn't take that long, and I have plenty of disc space!) Accept the licences. Take all optional additions. Finish.

8. Restart as requested. Build is version 3.3.2, M20080221-1800. JDK is shown as 1.5.0_14 everywhere.

9. Accept creation of new workspace. Create Java HelloWorld program as before.

10. It runs ok. Profile it, choosing Execution time profile. I get the dialogue box:

Warning

One of the selected launch delegates has failed

Ok       Details

Pressing details gives

org.eclipse.core.runtime.CoreException
Agent Controller is unavailable under port 10002.  Make sure that the service is started and the port number is correct under preferences.

java.lang.NullPointerException
  at org.eclipse.tptp.platform.iac.administrator.internal.startstop.AutoStartStop.hasProcessTerminated(AutoStartStop.java:275)
  at org.eclipse.tptp.platform.iac.administrator.internal.startstop.AutoStartStop.startIAC(AutoStartStop.java:113)
  at org.eclipse.tptp.platform.execution.client.core.internal.NodeImpl.connect(NodeImpl.java:117)
  at org.eclipse.tptp.platform.execution.util.internal.AgentControllerPool$1$EstablishConnection.run(AgentControllerPool.java:164)
  at java.lang.Thread.run(Thread.java:595)
"
11. cd-ing to plugins/org.eclipse.tptp.platform.ac.linux_ia32_4.4.1.v200709261752
commanding 'chmod a+x *' and then './RAStart.sh' gives the familiar:

Starting Agent Controller.
ACServer: error while loading shared libraries: ../lib/libtptpUtils.so.4: file too short
ACServer failed to start.

12. Help -> Software Updates -> Manage Configuration lists shows the list of installed components which I will attach as two PNG screenshots, top.png and bot.png (plus one line which wouldn't fit in those shots, the line being "XML Schema Infoset Model (XSD) Extender SDK 2.3.1.v200709252135"). It would be good if this pane had 'Select All' and 'Copy' commands so that I could have copied and pasted the list here without having to resort to screenshots.

As I've said, there is no such problem in 3.4M5, so we're looking forward to Eclipse SK 3.4.

John A. Murdie


Comment 19 John A. Murdie CLA 2008-03-06 07:23:22 EST
Created attachment 91749 [details]
Top of screenshot of installed plugins
Comment 20 John A. Murdie CLA 2008-03-06 07:24:05 EST
Created attachment 91750 [details]
Bottom of screenshot of installed plugins
Comment 21 Bing Xu CLA 2008-03-06 10:18:32 EST
John, I think what you experienced is related to 214788 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=214788).  Can you confirm?  If so I'd like to close this defect.
Comment 22 John A. Murdie CLA 2008-03-06 10:48:15 EST
Yes, it looks very much like that problem - though the actual 'corrupt' file is not the same as one reported in bug 214788. I should have looked in plugins/org.eclipse.tptp.platform.ac.linux_ia32_4.4.1.v200709261752/agent_controller/lib to see what actually was wrong with libtptpUtils.so.4! Now that I do look in that directory, using:

$ file * | fgrep ASCII | wc -l

I see that 48 of the files in that directory are broken in this way.

So, yes, please mark my bug report as (effectively) a duplicate of bug 214788 and close.

Many thanks,

John A. Murdie
Comment 23 Bing Xu CLA 2008-03-06 11:00:14 EST

*** This bug has been marked as a duplicate of bug 214788 ***
Comment 24 Bing Xu CLA 2008-04-15 16:37:44 EDT
*** Bug 197117 has been marked as a duplicate of this bug. ***
Comment 25 Bing Xu CLA 2008-04-15 17:07:48 EDT
*** Bug 218118 has been marked as a duplicate of this bug. ***
Comment 26 Kathy Chan CLA 2010-11-18 18:49:03 EST
As of TPTP 4.6.0, TPTP is in maintenance mode and focusing on improving quality by resolving relevant enhancements/defects and increasing test coverage through test creation, automation, Build Verification Tests (BVTs), and expanded run-time execution. As part of the TPTP Bugzilla housecleaning process (see http://wiki.eclipse.org/Bugzilla_Housecleaning_Processes), this enhancement/defect is verified/closed by the Project Lead since this enhancement/defect has been resolved and unverified for more than 1 year and considered to be fixed. If this enhancement/defect is still unresolved and reproducible in the latest TPTP release (http://www.eclipse.org/tptp/home/downloads/), please re-open.