Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 148461 | Differences between
and this patch

Collapse All | Expand All

(-)src-agent/org/eclipse/tptp/trace/arm/internal/agent/Agent.java (-56 / +1 lines)
Lines 12-18 Link Here
12
12
13
package org.eclipse.tptp.trace.arm.internal.agent;
13
package org.eclipse.tptp.trace.arm.internal.agent;
14
14
15
import java.io.File;
16
import java.net.InetAddress;
15
import java.net.InetAddress;
17
import java.net.UnknownHostException;
16
import java.net.UnknownHostException;
18
import java.util.Calendar;
17
import java.util.Calendar;
Lines 54-61 Link Here
54
53
55
	private static final String IP_ADDRESS_OVERRIDE = "org.eclipse.tptp.trace.arm.ip"; 
54
	private static final String IP_ADDRESS_OVERRIDE = "org.eclipse.tptp.trace.arm.ip"; 
56
55
57
	private final static boolean _isNativesAvailable;
58
59
	private static boolean _isRACActive; 
56
	private static boolean _isRACActive; 
60
	
57
	
61
	/*
58
	/*
Lines 84-139 Link Here
84
	
81
	
85
	private Object _monitorActiveSynch = new Object(); 
82
	private Object _monitorActiveSynch = new Object(); 
86
83
87
	/*
88
	 * The following is duplicated from the RemoteComponentSkeleton class. The
89
	 * reason for this is because when you call RemoteComponentSkeleton's
90
	 * intialize method, it will throw an AgentControllerUnavailableException if
91
	 * either the native libraries can't be loaded, or if the RAC hasn't come up
92
	 * yet. In the latter case, we can simply wait for the RAC to come up. But
93
	 * in the former case, there's a problem with the system path, which is a
94
	 * fatal error.
95
	 */
96
	static {
97
		boolean nativesLoadable = false;
98
		String osName = (String) System.getProperties().get("os.name");
99
		String ext = (osName.toUpperCase().startsWith("WIN") ? ".dll" : ".so");
100
		String acLibraryPath = System.getProperty(RemoteComponentSkeleton.AC_LIBRARY_PATH, null);
101
		if (acLibraryPath != null && !acLibraryPath.endsWith(File.separator)) {
102
			acLibraryPath = acLibraryPath.concat(File.separator);
103
		}
104
		
105
		try {
106
			if (acLibraryPath != null) {
107
				// Bug 112749 begins
108
				System.load(acLibraryPath+"hcclco"+ext); //$NON-NLS-1$
109
				System.load(acLibraryPath+"hccls"+ext); //$NON-NLS-1$
110
				System.load(acLibraryPath+"hcbnd"+ext); //$NON-NLS-1$
111
				System.load(acLibraryPath+"hcclsm"+ext); //$NON-NLS-1$
112
				System.load(acLibraryPath+"hccldt"+ext); //$NON-NLS-1$
113
				// Bug 112749 ends
114
				System.load(acLibraryPath+"hcjbnd"+ext); //$NON-NLS-1$
115
				nativesLoadable = true;
116
			}
117
118
			if (!nativesLoadable) {
119
				// Bug 112749 begins
120
				System.loadLibrary("hcclco");
121
				System.loadLibrary("hccls");
122
				System.loadLibrary("hcbnd");
123
				System.loadLibrary("hcclsm");
124
				System.loadLibrary("hccldt");
125
				// Bug 112749 ends
126
				System.loadLibrary("hcjbnd");
127
				nativesLoadable = true;
128
			}
129
		} catch (Throwable e) {
130
			_logger.logReport(ARMLogger.SEV_CRIT, "IWAT0886E", //$NON-NLS-1$
131
					ArmRuntimeMessages.getString("AgentNotReg_ERROR_"), //$NON-NLS-1$
132
					ARMLogger.LOG, e);
133
		}
134
		_isNativesAvailable = nativesLoadable;
135
	}
136
137
	/**
84
	/**
138
	 * Serves as an interface to the RAC and ultimately the workbench.
85
	 * Serves as an interface to the RAC and ultimately the workbench.
139
	 */
86
	 */
Lines 183-191 Link Here
183
			_agent.initialize();
130
			_agent.initialize();
184
			_isRACActive = true;
131
			_isRACActive = true;
185
		} catch (AgentControllerUnavailableException e) {
132
		} catch (AgentControllerUnavailableException e) {
186
			if (!_isNativesAvailable) {
133
			throw new NativesUnavailableException(e);
187
				throw new NativesUnavailableException(); 
188
			}
189
		}
134
		}
190
		
135
		
191
		_logger.logDebug(ARMLogger.SEV_DEBUG_MIN, 
136
		_logger.logDebug(ARMLogger.SEV_DEBUG_MIN, 
(-)src-agent/org/eclipse/tptp/trace/arm/internal/agent/NativesUnavailableException.java (+9 lines)
Lines 12-17 Link Here
12
12
13
package org.eclipse.tptp.trace.arm.internal.agent;
13
package org.eclipse.tptp.trace.arm.internal.agent;
14
14
15
import org.eclipse.hyades.internal.execution.remote.AgentControllerUnavailableException;
16
15
/**
17
/**
16
 * Thrown to indicate that the RAC binaries (DLL/so) could not be loaded by the
18
 * Thrown to indicate that the RAC binaries (DLL/so) could not be loaded by the
17
 * JVM. If this exception is encountered, make sure that the PATH/LiBPATH in the
19
 * JVM. If this exception is encountered, make sure that the PATH/LiBPATH in the
Lines 23-28 Link Here
23
 */
25
 */
24
public class NativesUnavailableException extends RuntimeException {
26
public class NativesUnavailableException extends RuntimeException {
25
27
28
	/*
29
	 * Constructor
30
	 */
31
	public NativesUnavailableException(AgentControllerUnavailableException e) {
32
		super(e);
33
	}
34
26
	/**
35
	/**
27
	 * Generated Id.
36
	 * Generated Id.
28
	 */
37
	 */
(-)src-remote/org/eclipse/hyades/internal/execution/remote/RemoteComponentSkeleton.java (-6 / +13 lines)
Lines 110-121 Link Here
110
		boolean nativesLoadable = false;
110
		boolean nativesLoadable = false;
111
		String osName = (String) System.getProperties().get("os.name");
111
		String osName = (String) System.getProperties().get("os.name");
112
		String ext = (osName.toUpperCase().startsWith("WIN") ? ".dll" : ".so");
112
		String ext = (osName.toUpperCase().startsWith("WIN") ? ".dll" : ".so");
113
		String acLibraryPath = System.getProperty(AC_LIBRARY_PATH, null);
113
114
		if (acLibraryPath != null && !acLibraryPath.endsWith(File.separator)) {
115
			acLibraryPath = acLibraryPath.concat(File.separator);
116
		}
117
		
118
		try {
114
		try {
115
			String acLibraryPath = System.getProperty(AC_LIBRARY_PATH, null);
116
			if (acLibraryPath != null && !acLibraryPath.endsWith(File.separator)) {
117
				acLibraryPath = acLibraryPath.concat(File.separator);
118
			}
119
		
119
			if (acLibraryPath != null) {
120
			if (acLibraryPath != null) {
120
				// Bug 112749 begins
121
				// Bug 112749 begins
121
				System.load(acLibraryPath+"hcclco"+ext); //$NON-NLS-1$
122
				System.load(acLibraryPath+"hcclco"+ext); //$NON-NLS-1$
Lines 127-133 Link Here
127
				System.load(acLibraryPath+"hcjbnd"+ext); //$NON-NLS-1$
128
				System.load(acLibraryPath+"hcjbnd"+ext); //$NON-NLS-1$
128
				nativesLoadable = true;
129
				nativesLoadable = true;
129
			}
130
			}
130
131
		} catch (Throwable e) {
132
			e.printStackTrace(System.err);
133
		}
134
		
135
		try {
131
			if (!nativesLoadable) {
136
			if (!nativesLoadable) {
132
				// Bug 112749 begins
137
				// Bug 112749 begins
133
				System.loadLibrary("hcclco");
138
				System.loadLibrary("hcclco");
Lines 140-146 Link Here
140
				nativesLoadable = true;
145
				nativesLoadable = true;
141
			}
146
			}
142
		} catch (Throwable e) {
147
		} catch (Throwable e) {
148
			e.printStackTrace(System.err);
143
		}
149
		}
150
		
144
		nativesAvailable = nativesLoadable;
151
		nativesAvailable = nativesLoadable;
145
	}
152
	}
146
153

Return to bug 148461