| Summary: | Could not start Agent Controller. Empty serviceconfig.xml. | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Eugene Chan <ewchan> | ||||||||||||
| Component: | TPTP | Assignee: | Igor Alelekov <igor.alelekov> | ||||||||||||
| Status: | CLOSED FIXED | QA Contact: | |||||||||||||
| Severity: | blocker | ||||||||||||||
| Priority: | P1 | CC: | asaf.yaffe, ewchan, guru.nagarajan, igor.alelekov, jcayne, jkubasta, kiryl.kazakevich, nmehrega, samwai | ||||||||||||
| Version: | unspecified | ||||||||||||||
| Target Milestone: | --- | ||||||||||||||
| Hardware: | PC | ||||||||||||||
| OS: | Windows XP | ||||||||||||||
| Whiteboard: | |||||||||||||||
| Bug Depends on: | |||||||||||||||
| Bug Blocks: | 203472 | ||||||||||||||
| Attachments: |
|
||||||||||||||
This is failing all the profile on server use cases. This issue is a IAC/New Execution framework issue Is this a duplicate of 202078 This is different from bug 202078. I start RAC before I do any profile for attach use cases, and all attach use case failed because of this. I was using IBM JVM 1.5. I cannot reproduce using the 0910 driver. Here is what I have done: 1. Start ACServer in a command prompt 2. Run "java -agentlib:JPIBootLoader=JPIAgent:server=controlled;CGProf:execdetails=true StartStop" in another command prompt with all required environment set 3. Start Eclipse workbench and attach to the running TI agent 4. Attached successfully and profiling data is collected The "Could not start Agent Controller." message should not come from the TI agent process. This message only exist in the ACServer code, not the agent code. Please retry the 0910 driver and let me know if the same problem occurs. It works if environment variables are pointing to RAC instead instead of eclipse plugins. it works if I use: set TPTP_AC_HOME=D:\ibm\AgentController set JAVA_PROFILER_HOME=D:\ibm\AgentController\plugins\org.eclipse.tptp.javaprofi ler set PATH=%TPTP_AC_HOME%\bin;%JAVA_PROFILER_HOME%;%PATH% set CLASSPATH=%JAVA_PROFILER_HOME%;%CLASSPATH% and fails if I use: set TPTP_AC_HOME=D:\ibm\4410-0910\eclipse\plugins\org.eclipse.tptp.platform.ac.w in_ia32_4.4.0.v200706020100\agent_controller set JAVA_PROFILER_HOME=D:\ibm\4410-0906\eclipse\plugins\org.eclipse.tptp.platfor m.jvmti.runtime_4.4.100.v200709060100\agent_files\win_ia32 set PATH=%TPTP_AC_HOME%\bin;%JAVA_PROFILER_HOME%;%PATH% set CLASSPATH=%JAVA_PROFILER_HOME%;%CLASSPATH% The failing use case works if I start IAC(by launching workbench first) and instead of RAC for the attach. this problem is blocking the profile on server use case. There is a requirement to have AC started up before any attach scenarios, and profile on server is an attach scenario. Hence having user start up RAC and profile server does not work right now. This problem does not exist in 4402, could be changes made in the IAC code. Interestingly, the problem does not exist with Thread Analysis. Sizing estimates. Igor, can you please help with this fix? This could be a inconsistence between IAC and RAC packaging, in which there maybe file that is auto generated in IAC startup. Eugene, - Sorry, what is your use case? You are starting AC from eclipse\plugins\ac.. directory and AC can't find serviceconfig.xml, right? However, you are successfuly launching both AC - standalone and IAC. I'm not sure that AC should be launched in the above use case. AC plugin in eclipse directory can't configure itself since it knows nothing about other required plugins - hyades, jvmti.runtime... However, if IAC was previously launched and serviceconfig.xml was created, after that, failed use case in Comment #6 works without problems. Hi Igor, The use case I run is: With a fresh workspace... 1. start RAC in command prompt. ie that standalone AC outside eclipse. 2. in command prompt, setup environment variables for JVMTI standalone profile and point varialbles to IAC libraries, ie. set TPTP_AC_HOME=D:\ibm\4410-0910\eclipse\plugins\org.eclipse.tptp.platform.ac.w in_ia32_4.4.0.v200706020100\agent_controller set JAVA_PROFILER_HOME=D:\ibm\4410-0906\eclipse\plugins\org.eclipse.tptp.platfor m.jvmti.runtime_4.4.100.v200709060100\agent_files\win_ia32 set PATH=%TPTP_AC_HOME%\bin;%JAVA_PROFILER_HOME%;%PATH% set CLASSPATH=%JAVA_PROFILER_HOME%;%CLASSPATH% 3. in the same command prompt, try JVMTI standalone profile: java -agentlib:JPIBootLoader=JPIAgent:server=controlled;CGProf:execdetai ls=true PerformanceExample I got error message in step 3. If I in step 2, point to path and libraries in RAC, things works okay. It seems like there is a different in the libraries packaged in IAC and RAC and they don't give consistent result when used. Thanks, Eugene :) I'll check it tomorrow. Hi Eugene, I got your use case in Comment #15 worked with the following preliminary step: 0. Start Eclipse and initialize IAC by clicking "test connection" button in the Profile Dialog. Shutdown Eclipse (in order to shutdown IAC). This step creates serviceconfig.xml configuration file. You see, to find out AC, an agent needs to get some info from this config file. Curently, IAC is intended to be configured from Eclipse workbench only. That is why step 0. is required. Thanks, Igor Thanks Igor, I got it working from your suggestion. However in the profile on server scenario, server is started in attach mode where environment variables are point to the IAC path, and there is no IAC running until the first attach to the server happens with a fresh workspace. The IAC initializes as attach dialog is shown and a query for the available agents for attach starts. Is there a way to trigger the initialization of the IAC, if it's not yet running, for the profile on server scenarios? (In reply to comment #15) > Hi Igor, > > The use case I run is: > > With a fresh workspace... > 1. start RAC in command prompt. ie that standalone AC outside eclipse. > > 2. in command prompt, setup environment variables for JVMTI standalone profile > and point varialbles to IAC libraries, ie. > set > TPTP_AC_HOME=D:\ibm\4410-0910\eclipse\plugins\org.eclipse.tptp.platform.ac.w > in_ia32_4.4.0.v200706020100\agent_controller > set > JAVA_PROFILER_HOME=D:\ibm\4410-0906\eclipse\plugins\org.eclipse.tptp.platfor > m.jvmti.runtime_4.4.100.v200709060100\agent_files\win_ia32 > set PATH=%TPTP_AC_HOME%\bin;%JAVA_PROFILER_HOME%;%PATH% > set CLASSPATH=%JAVA_PROFILER_HOME%;%CLASSPATH% > > 3. in the same command prompt, try JVMTI standalone profile: > java -agentlib:JPIBootLoader=JPIAgent:server=controlled;CGProf:execdetai > ls=true PerformanceExample > > I got error message in step 3. > If I in step 2, point to path and libraries in RAC, things works okay. It seems > like there is a different in the libraries packaged in IAC and RAC and they > don't give consistent result when used. > Eugene, if I understand this correctly, it seems like you're mixing and matching IAC and AC. You're starting AC, but asking it to use IAC libraries! This isn't legal. The paths in AC's serverconfig.xml will be different than what you set your environment variables to. This will obviously confuse both AC and IAC. I remember having a long discussion about the usage of IAC in the attach scenario with Asaf. IMHO, IAC shouldn't even be used in the attach scenario. IAC is meant for novice users for hiding all the complexities of the Agent Controller's life cycle. This is possible to do in the launch scenario. We know exactly when to configure IAC, start, and stop it. But it's not possible in the attach scenario, since the user is launching an agent in a different process. To use IAC in the attach scenario, the user would have to start IAC by clicking on the 'Test Connection' button or take another action that would launch IAC. In essence they're manually starting it. This defeats the whole purpose of IAC, since it's meant to hide these details from the user. Advanced users who want to attach to an agent should use AC so they can have full control of AC's life cycle. >Is there a way to trigger the initialization of the IAC, if it's not yet >running, for the profile on server scenarios? Are you looking to start it programmatically? If so, see the AutoStartStop class in the IAC plugin Navid, I agree with you that mixing IAC and RAC should not be promoted. However, in the profile on server use case, servers are started with the environment variables setup and point to the IAC libraries programmatically. As user is responsible to start an AC beforehand for the attach scenario and there is no guarantee on where the RAC will be installed on the host, the profile on server code has to use the IAC path in its setup. The server process starting in attach mode could be running before an IAC is initialized and started. It seems like in this use case, I have to initialize IAC to create the serviceconfig.xml file, even if RAC is used. I looked at the AutoStartStop class, can I call org.eclipse.tptp.platform.iac.administrator.internal.common.AdminUtil.generateConfigFile() directly to just generate the file needed? Thanks. I'm going to try add
if (AdminUtil.isConfigEmpty()) {
AdminUtil.generateConfigFile();
}
in the profile on server code before a server process is started in profile mode.
Eugene, AC could start agents/applications/servers on its startup. Isn't it appropriate for your scenario? Yes, you can call AdminUtil.generateConfigFile(), but you're asking for trouble whenever you mix up IAC and AC :) There is no choice here as I have no idea which AC user is going to profile with and I only have the path information of IAC. I can get the server started now, but failed when try to attach to the process after it finished its start up process. Igor, does this ring your bell? the console output I got is: ... INFO: Server startup in 21925 ms [Error: Attach failed] Navid, where is the IAC's serviceconfig.xml file be saved? I removed the one under eclipse\plugins\org.eclipse.tptp.platform.ac.win_ia32_4.4.0.v200706020100\agent_controller\config but there is no complain about missing file. (In reply to comment #22) > Eugene, > AC could start agents/applications/servers on its startup. > Isn't it appropriate for your scenario? > Igor, could you please give more information here? Thanks. Any application can be configured to be started by AC (agents folder in $AC_HOME). It is simple to allow agents/applications to be started automatically after AC starts - see enh. https://bugs.eclipse.org/bugs/show_bug.cgi?id=184277 (In reply to comment #25) > I can get the server started now, but failed when try to attach to the process > after it finished its start up process. Igor, does this ring your bell? > the console output I got is: > ... > INFO: Server startup in 21925 ms > [Error: Attach failed] Are you starting server with JVMTI agent before AC start-up? Thanks Igor, Server processes are started manually by user in the UI, and your suggestion does not apply to the use case. (In reply to comment #29) > > Are you starting server with JVMTI agent before AC start-up? > No, the server is started with JVMTI agent after RAC is start-up. Igor, I got more information after several trials. Even if I start IAC by profiling a simple helloworld and follow by a profile on server process, it failed. here is what I got. Sep 13, 2007 12:40:42 PM org.apache.catalina.storeconfig.StoreLoader load INFO: Find registry server-registry.xml at classpath resource [Error: Attach failed] Unhandled exception Type=Segmentation error vmState=0x009274a8 J9Generic_Signal_Number=00000004 ExceptionCode=c0000005 ExceptionAddress=43057F53 ContextFlags=0001003f Handler1=7EFB0630 Handler2=7F057A80 InaccessibleAddress=00000000 EDI=4306D208 ESI=4306D1F8 EAX=00000000 EBX=448673B0 ECX=00000000 EDX=00000000 EIP=43057F53 ESP=0006FB74 EBP=0006FCCC Module=D:\ibm\4410-0910\eclipse\plugins\org.eclipse.tptp.platform.jvmti.runtime_4.4.100.v200709060100\agent_files\win_ia32\CGProf.dll Module_base_address=43050000 Offset_in_DLL=00007f53 Target=2_30_20070131_11312_lHdSMR (Windows XP 5.1 build 2600 Service Pack 2) CPU=x86 (2 logical CPUs) (0x7fe5b000 RAM) JVMDUMP006I Processing Dump Event "gpf", detail "" - Please Wait. JVMDUMP007I JVM Requesting System Dump using 'D:\ibm\4410-0910\eclipse\core.20070913.124044.3200.dmp' Unhandled exception Type=Segmentation error vmState=0x00000000 J9Generic_Signal_Number=00000004 ExceptionCode=c0000005 ExceptionAddress=43057F53 ContextFlags=0001003f Handler1=7EFB0630 Handler2=7F057A80 InaccessibleAddress=00000000 EDI=4306D208 ESI=4306D1F8 EAX=00000000 EBX=45885B50 ECX=00000000 EDX=00000000 EIP=43057F53 ESP=4960FD98 EBP=4960FEF0 Module=D:\ibm\4410-0910\eclipse\plugins\org.eclipse.tptp.platform.jvmti.runtime_4.4.100.v200709060100\agent_files\win_ia32\CGProf.dll Module_base_address=43050000 Offset_in_DLL=00007f53 Target=2_30_20070131_11312_lHdSMR (Windows XP 5.1 build 2600 Service Pack 2) CPU=x86 (2 logical CPUs) (0x7fe5b000 RAM) JVMDUMP006I Processing Dump Event "gpf", detail "" - Please Wait. Hi Eugene, It seems the exception was throwen in CGProf.dll module. Please open a new bugzilla to track this. BTW, the problem with config file is resolved, can we close this bug? (In reply to comment #26) > Navid, where is the IAC's serviceconfig.xml file be saved? I removed the one > under > eclipse\plugins\org.eclipse.tptp.platform.ac.win_ia32_4.4.0.v200706020100\agent_controller\config > but there is no complain about missing file. > It should be in that location. Try stopping IAC (by exiting workbench) and starting it again (by profiling). It should complain then. (In reply to comment #33) > Hi Eugene, > It seems the exception was throwen in CGProf.dll module. > Please open a new bugzilla to track this. > BTW, the problem with config file is resolved, can we close this bug? > Igor, I will have to attach the patch of the fix in comment #21, test it on different platforms and get PMC approval before closing this bug. I will also open a separate defect to track the problem in comment #32. Created attachment 78454 [details]
patch
Created attachment 78455 [details]
patched jar
I have verified on WinXP and RHEL that the patch solve the problem and it's not complaining about the following anymore. Could not start Agent Controller. Empty serviceconfig.xml file Make sure you have created a valid serviceconfig.xml file by running the SetConfig script. However, it still failed in the attach, and show the following error: ... INFO: Server startup in 21925 ms [Error: Attach failed] I don't consistently get what is mentioned in comment #32. I have open bug 203472 to follow up on this, and mark this bug blocked by it. To smooth the experience for user, when neither RAC or IAC is running, profile on server code should start IAC before server process is started to support the 'Running AC beforehand' requirement for profile on server use case. Created attachment 78553 [details]
updated patch
Created attachment 78554 [details]
updated patched jar
Created attachment 78555 [details]
updated patched jar
I was able to reproduce the problem: INFO: Server startup in 21925 ms [Error: Attach failed] on my Windows XP machine running the TPTP-4.4.1-200709101254 candidate driver with the latest version of the updated_patched.jar attached to the defect. Before running the test in the workbench, I ran the command line steps and also received the errors: Could not start Agent Controller. Empty serviceconfig.xml file Make sure you have created a valid serviceconfig.xml file by running the SetConfig script. After running the test in the workbench, I did not see the error on the command line and the serviceconfig.xml file was not empty. Hi Eugene, do you have an update for this? (In reply to comment #44) > Hi Eugene, do you have an update for this? > Hi Igor, the patch in comment #40 solve the problem of library references in the profile on server use case (please review and check it in). However, the complete use case is still blocked by bug 203472. Hi Eugene, The problem in this bugzilla seems to be fixed. I'm going to resolve it. Resolving as fixed CLOSE BUG |
-driver tptp441 0906 build - start Java process in command prompt using JVMTI throws error complaining Agent Controller. - problem does not exist with JVMPI agent. >java -agentlib:JPIBootLoader=JPIAgent:server=controlled;CGProf:execdetai ls=true PerformanceExample Could not start Agent Controller. Empty serviceconfig.xml file Make sure you have created a valid serviceconfig.xml file by running the SetConf ig script.