Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[equinox-dev] Query on external class in Equionox framework

Hi all,

One external class cannot run in Eclipse's OSGi framework well. It can
run independently as normal java, so I'm wondering whether there exist
some limitation in using external classes in an OSGi bundle.

The problem is presented in detail as below:

I'm intended to pack an existing external java class into a bundle of
standard OSGi. The class in experiment is from a project named Globus
GridFTP. The class is namely FTPClient, in a binary JAR file provided
by Globus organization. And I added reference of this JAR file, and
imported the package.

However, when execute the program, the execution get blocked on the
construction function of one external class.
//CODE:
try{
		System.out.println("Caught host="+host+" port="+port+" new object");
		FTPClient thisClient = new FTPClient(host,port); //Blocked on this line
		System.out.println("FTPClient created"); //This line never reached
after a long time
		}
		catch (Exception ex)
		{
			System.out.println("Caught exception in service."); //This line
never reached after a long time.
		}

FTPClient is an external class imported from a Globus JAR file. The
above code snip is from a function in a bundle's service
implementation. When calling this service from another bundle,
execution seems get dead-looped on the construction function, and
neither its following statement or the catch clause was hit. It is
definitly not because there's a time-out in the constructor, becasue
(1) I wait it for a very long time (approx. 1hour and it's still
there). (2) When running these statements in a normal Java program(not
under OSGi framework or as a bundle), the constructor could execute
smoothly and immediately returned.

Thus, I'm wondering that is there currently some limitation in using
external classes under OSGi framework and as a bundle. Consider this
class (FTPClient) is dealing with network, I'm wondering whether
there're some specific requirements for external classes running
inside a bundle, particularly consider the network operations.

I'll at the same time deliver my query to the Globus side. However, as
they're not dealing with  OSGi development, and their classes in JARs
could running correctly outside OSGi bundle, I think my primary
problem should be the lack of knowledge of Equinox implementation of
OSGi, not of that FTPClient class.

My Eclipse version: 3.2.0
org.eclipse.osgi package version: 3.3.2.R33x_v20080105
Globus JAR version: cog-jglobus.jar : ver 1.4

Thanks very much.


Warm Regards,
Ji Li,
May,22,2008


Back to the top