Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Eclipse plugin and RemoteJAI
Eclipse plugin and RemoteJAI [message #438250] Fri, 18 June 2004 00:23 Go to next message
Eclipse UserFriend
Originally posted by: tzhou.proteomesystems.com

G'day:

I am trying to write a plugin to play with the JAI/RMI.
So it is related to RemoteJAI. I've got in trouble when I create
RemoteJAI at the client site. Following is my code listing:

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< <<<<<<
private void init() {
if (System.getSecurityManager() == null) {
System.setSecurityManager(new RMISecurityManager());
}

// FIXME Should be read in from configuration
String hostString = "188.88.8.18:1099";
RemoteJAI jaiServer = new RemoteJAI("jairmi", hostString);

// Set up negotiation preferences so as to turn off compression
ParameterListDescriptorImpl pld
= new ParameterListDescriptorImpl(null, null, null, null, null);

negotiableCapability cap
= new NegotiableCapability("tileCodec", "noExistingCodec", null, pld,
true);
NegotiableCapabilitySet preferences
= new NegotiableCapabilitySet(true);
preferences.add(cap);
jaiServer.setNegotiationPreferences(preferences);
}
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>

When comes to :
RemoteJAI jaiServer = new RemoteJAI("jairmi", hostString);

It can pass around that line.

I have played all those lines in eclipse java application. I works
perfectly.

Any people can give me some clues why when in plugin, it does not work
again?

Thanks in advance.

Ted
Re: Eclipse plugin and RemoteJAI [message #438251 is a reply to message #438250] Fri, 18 June 2004 00:37 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: tzhou.proteomesystems.com

T Z wrote:
> G'day:
>
> I am trying to write a plugin to play with the JAI/RMI.
> So it is related to RemoteJAI. I've got in trouble when I create
> RemoteJAI at the client site. Following is my code listing:
>
> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< <<<<<<
> private void init() {
> if (System.getSecurityManager() == null) {
> System.setSecurityManager(new RMISecurityManager());
> }
>
> // FIXME Should be read in from configuration
> String hostString = "188.88.8.18:1099";
> RemoteJAI jaiServer = new RemoteJAI("jairmi", hostString);
>
> // Set up negotiation preferences so as to turn off compression
> ParameterListDescriptorImpl pld
> = new ParameterListDescriptorImpl(null, null, null, null, null);
>
> negotiableCapability cap
> = new NegotiableCapability("tileCodec", "noExistingCodec", null,
> pld, true);
> NegotiableCapabilitySet preferences
> = new NegotiableCapabilitySet(true);
> preferences.add(cap);
> jaiServer.setNegotiationPreferences(preferences);
> }
> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>
>
> When comes to :
> RemoteJAI jaiServer = new RemoteJAI("jairmi", hostString);
>
> It can pass around that line.
Sorry. It is typo.

I means It can NOT get around that line.

>
> I have played all those lines in eclipse java application. I works
> perfectly.
>
> Any people can give me some clues why when in plugin, it does not work
> again?
>
> Thanks in advance.
>
> Ted
>
Eclipse plugin, RMI, RemoteJAI [message #438252 is a reply to message #438251] Fri, 18 June 2004 03:55 Go to previous messageGo to next message
Ted is currently offline TedFriend
Messages: 22
Registered: July 2009
Junior Member
T Z wrote:
> T Z wrote:
>
>> G'day:
>>
>> I am trying to write a plugin to play with the JAI/RMI.
>> So it is related to RemoteJAI. I've got in trouble when I create
>> RemoteJAI at the client site. Following is my code listing:
>>
>> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< <<<<<<
>> private void init() {
>> if (System.getSecurityManager() == null) {
>> System.setSecurityManager(new RMISecurityManager());
>> }
>>

I believe the problem is from the above. If java eclipse application,
then you may set the security manager at the main function. But for
eclipse plugin, I have no idea where and how to set the security manager?

Anyone has some clues?


>> // FIXME Should be read in from configuration
>> String hostString = "188.88.8.18:1099";
>> RemoteJAI jaiServer = new RemoteJAI("jairmi", hostString);
>>
>> // Set up negotiation preferences so as to turn off compression
>> ParameterListDescriptorImpl pld
>> = new ParameterListDescriptorImpl(null, null, null, null, null);
>>
>> negotiableCapability cap
>> = new NegotiableCapability("tileCodec", "noExistingCodec", null,
>> pld, true);
>> NegotiableCapabilitySet preferences
>> = new NegotiableCapabilitySet(true);
>> preferences.add(cap);
>> jaiServer.setNegotiationPreferences(preferences);
>> }
>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>
>>
>> When comes to :
>> RemoteJAI jaiServer = new RemoteJAI("jairmi", hostString);
>>
>> It can pass around that line.
>
> Sorry. It is typo.
>
> I means It can NOT get around that line.
>
>>
>> I have played all those lines in eclipse java application. I works
>> perfectly.
>>
>> Any people can give me some clues why when in plugin, it does not work
>> again?
>>
>> Thanks in advance.
>>
>> Ted
>>
>
Eclipse plugin, RMI, RemoteJAI, Security Manager [message #438253 is a reply to message #438252] Fri, 18 June 2004 04:26 Go to previous messageGo to next message
Ted is currently offline TedFriend
Messages: 22
Registered: July 2009
Junior Member
Ted wrote:
> T Z wrote:
>
>> T Z wrote:
>>
>>> G'day:
>>>
>>> I am trying to write a plugin to play with the JAI/RMI.
>>> So it is related to RemoteJAI. I've got in trouble when I create
>>> RemoteJAI at the client site. Following is my code listing:
>>>
>>> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< <<<<<<
>>> private void init() {
>>> if (System.getSecurityManager() == null) {
>>> System.setSecurityManager(new RMISecurityManager());
>>> }
>>>
>
> I believe the problem is from the above. If java eclipse application,
> then you may set the security manager at the main function. But for
> eclipse plugin, I have no idea where and how to set the security manager?
>
> Anyone has some clues?
>

In the Eclipse plugin, possibly you can not set up the security manager.
Otherwise then that should be a security hole.

That is only my guess and thinking.

>
>>> // FIXME Should be read in from configuration
>>> String hostString = "188.88.8.18:1099";
>>> RemoteJAI jaiServer = new RemoteJAI("jairmi", hostString);
>>>
>>> // Set up negotiation preferences so as to turn off compression
>>> ParameterListDescriptorImpl pld
>>> = new ParameterListDescriptorImpl(null, null, null, null, null);
>>>
>>> negotiableCapability cap
>>> = new NegotiableCapability("tileCodec", "noExistingCodec", null,
>>> pld, true);
>>> NegotiableCapabilitySet preferences
>>> = new NegotiableCapabilitySet(true);
>>> preferences.add(cap);
>>> jaiServer.setNegotiationPreferences(preferences);
>>> }
>>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>
>>>
>>> When comes to :
>>> RemoteJAI jaiServer = new RemoteJAI("jairmi", hostString);
>>>
>>> It can pass around that line.
>>
>>
>> Sorry. It is typo.
>>
>> I means It can NOT get around that line.
>>
>>>
>>> I have played all those lines in eclipse java application. I works
>>> perfectly.
>>>
>>> Any people can give me some clues why when in plugin, it does not
>>> work again?
>>>
>>> Thanks in advance.
>>>
>>> Ted
>>>
>>
>
Re: Eclipse plugin, RMI, RemoteJAI, Security Manager [message #438254 is a reply to message #438253] Fri, 18 June 2004 05:18 Go to previous messageGo to next message
Ted is currently offline TedFriend
Messages: 22
Registered: July 2009
Junior Member
Ted wrote:



> Ted wrote:
>
>> T Z wrote:
>>
>>> T Z wrote:
>>>
>>>> G'day:
>>>>
>>>> I am trying to write a plugin to play with the JAI/RMI.
>>>> So it is related to RemoteJAI. I've got in trouble when I create
>>>> RemoteJAI at the client site. Following is my code listing:
>>>>
>>>> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< <<<<<<
>>>> private void init() {
>>>> if (System.getSecurityManager() == null) {
>>>> System.setSecurityManager(new RMISecurityManager());
>>>> }
>>>>
>>
>> I believe the problem is from the above. If java eclipse application,
>> then you may set the security manager at the main function. But for
>> eclipse plugin, I have no idea where and how to set the security manager?
>>
>> Anyone has some clues?
>>
>
> In the Eclipse plugin, possibly you can not set up the security manager.
> Otherwise then that should be a security hole.
>
> That is only my guess and thinking.
>

Hi, Ted:

You looks like correct.

Actually you can set up the security manager from the VM parameter as
following:

-Djava.security.manager -Djava.security.policy=/tmp/policy

inside file /tmp/policy, you set up the permissions, through
"-Djava.security.manager", the security manager will be set up for you,
then not necessary to set up in the plugin code.

Ted

>>
>>>> // FIXME Should be read in from configuration
>>>> String hostString = "188.88.8.18:1099";
>>>> RemoteJAI jaiServer = new RemoteJAI("jairmi", hostString);
>>>>
>>>> // Set up negotiation preferences so as to turn off compression
>>>> ParameterListDescriptorImpl pld
>>>> = new ParameterListDescriptorImpl(null, null, null, null, null);
>>>>
>>>> negotiableCapability cap
>>>> = new NegotiableCapability("tileCodec", "noExistingCodec", null,
>>>> pld, true);
>>>> NegotiableCapabilitySet preferences
>>>> = new NegotiableCapabilitySet(true);
>>>> preferences.add(cap);
>>>> jaiServer.setNegotiationPreferences(preferences);
>>>> }
>>>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>
>>>>
>>>> When comes to :
>>>> RemoteJAI jaiServer = new RemoteJAI("jairmi", hostString);
>>>>
>>>> It can pass around that line.
>>>
>>>
>>>
>>> Sorry. It is typo.
>>>
>>> I means It can NOT get around that line.
>>>
>>>>
>>>> I have played all those lines in eclipse java application. I works
>>>> perfectly.
>>>>
>>>> Any people can give me some clues why when in plugin, it does not
>>>> work again?
>>>>
>>>> Thanks in advance.
>>>>
>>>> Ted
>>>>
>>>
>>
>
Re: Eclipse plugin, RMI, RemoteJAI [message #438255 is a reply to message #438252] Fri, 18 June 2004 05:35 Go to previous messageGo to next message
Ted is currently offline TedFriend
Messages: 22
Registered: July 2009
Junior Member
Ted wrote:
> T Z wrote:
>
>> T Z wrote:
>>
>>> G'day:
>>>
>>> I am trying to write a plugin to play with the JAI/RMI.
>>> So it is related to RemoteJAI. I've got in trouble when I create
>>> RemoteJAI at the client site. Following is my code listing:
>>>
>>> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< <<<<<<
>>> private void init() {
>>> if (System.getSecurityManager() == null) {
>>> System.setSecurityManager(new RMISecurityManager());
>>> }
>>>
>
> I believe the problem is from the above. If java eclipse application,
> then you may set the security manager at the main function. But for
> eclipse plugin, I have no idea where and how to set the security manager?
>
> Anyone has some clues?
>
>
>>> // FIXME Should be read in from configuration
>>> String hostString = "188.88.8.18:1099";
>>> RemoteJAI jaiServer = new RemoteJAI("jairmi", hostString);
>>>
>>> // Set up negotiation preferences so as to turn off compression
>>> ParameterListDescriptorImpl pld
>>> = new ParameterListDescriptorImpl(null, null, null, null, null);
>>>
>>> negotiableCapability cap
>>> = new NegotiableCapability("tileCodec", "noExistingCodec", null,
>>> pld, true);
>>> NegotiableCapabilitySet preferences
>>> = new NegotiableCapabilitySet(true);
>>> preferences.add(cap);
>>> jaiServer.setNegotiationPreferences(preferences);
>>> }
>>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>
>>>
>>> When comes to :
>>> RemoteJAI jaiServer = new RemoteJAI("jairmi", hostString);
>>>
>>> It can pass around that line.
>>
>>
>> Sorry. It is typo.
>>
>> I means It can NOT get around that line.

The error message is :

Unhandled exception caught in event loop.
Reason:
javax/media/jai/remote/RemoteJAI

Why can not this RemoteJAI be initialized inside this function?

>>
>>>
>>> I have played all those lines in eclipse java application. I works
>>> perfectly.
>>>
>>> Any people can give me some clues why when in plugin, it does not
>>> work again?
>>>
>>> Thanks in advance.
>>>
>>> Ted
>>>
>>
>
Re: Eclipse plugin and RemoteJAI [message #438257 is a reply to message #438250] Fri, 18 June 2004 07:02 Go to previous messageGo to next message
Ted is currently offline TedFriend
Messages: 22
Registered: July 2009
Junior Member
T Z wrote:
> G'day:
>
> I am trying to write a plugin to play with the JAI/RMI.
> So it is related to RemoteJAI. I've got in trouble when I create
> RemoteJAI at the client site. Following is my code listing:
>
> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< <<<<<<
> private void init() {
> if (System.getSecurityManager() == null) {
> System.setSecurityManager(new RMISecurityManager());
> }
>
> // FIXME Should be read in from configuration
> String hostString = "188.88.8.18:1099";
> RemoteJAI jaiServer = new RemoteJAI("jairmi", hostString);
>

The error message is:
=============================================
Unhandled exception caught in event loop.
Reason:
javax/media/jai/remote/RemoteJAI
=============================================

Quite strange, I step into that line,
The real reason is the class
"javax.media.jai.remote.RemoteJAI" failed to be loaded.

Those classes of JAI are in the "JAVAHOME/jre/lib/ext/". So that is the
reason the java eclipse application works.

So possibly the class loading mechanism of eclipse plugin application is
different from the eclipse java application.

Any one give me more clues?






> // Set up negotiation preferences so as to turn off compression
> ParameterListDescriptorImpl pld
> = new ParameterListDescriptorImpl(null, null, null, null, null);
>
> negotiableCapability cap
> = new NegotiableCapability("tileCodec", "noExistingCodec", null,
> pld, true);
> NegotiableCapabilitySet preferences
> = new NegotiableCapabilitySet(true);
> preferences.add(cap);
> jaiServer.setNegotiationPreferences(preferences);
> }
> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>
>
> When comes to :
> RemoteJAI jaiServer = new RemoteJAI("jairmi", hostString);
>
> It can pass around that line.
>
> I have played all those lines in eclipse java application. I works
> perfectly.
>
> Any people can give me some clues why when in plugin, it does not work
> again?
>
> Thanks in advance.
>
> Ted
>
Re: Eclipse plugin, RMI, RemoteJAI [message #438258 is a reply to message #438255] Fri, 18 June 2004 07:03 Go to previous messageGo to next message
Ted is currently offline TedFriend
Messages: 22
Registered: July 2009
Junior Member
Ted wrote:
> Ted wrote:
>
>> T Z wrote:
>>
>>> T Z wrote:
>>>
>>>> G'day:
>>>>
>>>> I am trying to write a plugin to play with the JAI/RMI.
>>>> So it is related to RemoteJAI. I've got in trouble when I create
>>>> RemoteJAI at the client site. Following is my code listing:
>>>>
>>>> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< <<<<<<
>>>> private void init() {
>>>> if (System.getSecurityManager() == null) {
>>>> System.setSecurityManager(new RMISecurityManager());
>>>> }
>>>>
>>
>> I believe the problem is from the above. If java eclipse application,
>> then you may set the security manager at the main function. But for
>> eclipse plugin, I have no idea where and how to set the security manager?
>>
>> Anyone has some clues?
>>
>>
>>>> // FIXME Should be read in from configuration
>>>> String hostString = "188.88.8.18:1099";
>>>> RemoteJAI jaiServer = new RemoteJAI("jairmi", hostString);
>>>>

The error message is:
=============================================
Unhandled exception caught in event loop.
Reason:
javax/media/jai/remote/RemoteJAI
=============================================

Quite strange, I step into that line,
The real reason is the class
"javax.media.jai.remote.RemoteJAI" failed to be loaded.

Those classes of JAI are in the "JAVAHOME/jre/lib/ext/". So that is the
reason the java eclipse application works.

So possibly the class loading mechanism of eclipse plugin application is
different from the eclipse java application.

Any one give me more clues?

>>>> // Set up negotiation preferences so as to turn off compression
>>>> ParameterListDescriptorImpl pld
>>>> = new ParameterListDescriptorImpl(null, null, null, null, null);
>>>>
>>>> negotiableCapability cap
>>>> = new NegotiableCapability("tileCodec", "noExistingCodec", null,
>>>> pld, true);
>>>> NegotiableCapabilitySet preferences
>>>> = new NegotiableCapabilitySet(true);
>>>> preferences.add(cap);
>>>> jaiServer.setNegotiationPreferences(preferences);
>>>> }
>>>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>
>>>>
>>>> When comes to :
>>>> RemoteJAI jaiServer = new RemoteJAI("jairmi", hostString);
>>>>
>>>> It can pass around that line.
>>>
>>>
>>>
>>> Sorry. It is typo.
>>>
>>> I means It can NOT get around that line.
>
>
> The error message is :
>
> Unhandled exception caught in event loop.
> Reason:
> javax/media/jai/remote/RemoteJAI
>
> Why can not this RemoteJAI be initialized inside this function?
>
>>>
>>>>
>>>> I have played all those lines in eclipse java application. I works
>>>> perfectly.
>>>>
>>>> Any people can give me some clues why when in plugin, it does not
>>>> work again?
>>>>
>>>> Thanks in advance.
>>>>
>>>> Ted
>>>>
>>>
>>
>
Re: Eclipse plugin and RemoteJAI [message #438312 is a reply to message #438257] Mon, 21 June 2004 18:39 Go to previous messageGo to next message
David Bidermanas is currently offline David BidermanasFriend
Messages: 4
Registered: July 2009
Junior Member
Hi,

The class loading system in Eclipse is quite unusual for those who are used
to regular java applications. Once the initial eclipse loader has loaded the
plugin mechanism, only libraries located in a registered plug-in may be
loaded within Eclipse.

That means :

- All libraries must be packaged into a plugin and referenced as a plugin
dependancy from your application
- All remote objects accessed by your Eclipse application must have their
class data (or stub) already locally accessible from within an accessible
Eclipse plugin.

Note : The RMI classloader works with the java classloader, not the one
provided by Eclipse. The consequence is that classes loaded by the RMI
classloader, or any other remote classloader not loaded by eclipse, are not
instances of the same class as the class loaded by Eclipse. One workaround
is to re-serialize the object and deserialize it from a class loaded from
within Eclipse.

Now for classes registered in java.ext.lib, I am not sure because I have not
tested it myself, but I believe that the Eclipse classloader does not
consider them when loading classes, as it does not recognize the extension
directory.

One could say that Eclipse is not fully "java compliant" on this matter, but
its overall plugin mechanism allows so much memory savings that those little
remote application glitches are not too painful to handle.

"Ted" <ted@x.y.z.com> a
How can I push a Button from code? [message #438313 is a reply to message #438312] Mon, 21 June 2004 20:47 Go to previous messageGo to next message
adrian is currently offline adrianFriend
Messages: 26
Registered: July 2009
Junior Member
How do I send a Button (SWT.PUSH) a push event? I'm implementing my own
mnemonic traversal, and I'm trying to push the button whose mnemonic
char in getText() matches the traverse event's character.
Re: How can I push a Button from code? [message #438419 is a reply to message #438313] Wed, 23 June 2004 22:53 Go to previous messageGo to next message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
You can't. You can enter a bugzilla feature request but it'll be low
priority.

"adrian" <stori@ca.ibm.com> wrote in message
news:cb7hhd$42k$1@eclipse.org...
> How do I send a Button (SWT.PUSH) a push event? I'm implementing my own
> mnemonic traversal, and I'm trying to push the button whose mnemonic
> char in getText() matches the traverse event's character.
Re: How can I push a Button from code? [message #438475 is a reply to message #438419] Fri, 25 June 2004 09:16 Go to previous message
Eclipse UserFriend
Originally posted by: wohlgemuth.mpimp-golm.mpg.de

the easiest way to do, is write a jface push button control... or wait some
time, for example after I write a comboBoxViewer, RC1 ships with one...


"Steve Northover" <steve_northover@ca.ibm.com> wrote in message
news:cbd1lg$36r$1@eclipse.org...
> You can't. You can enter a bugzilla feature request but it'll be low
> priority.
>
> "adrian" <stori@ca.ibm.com> wrote in message
> news:cb7hhd$42k$1@eclipse.org...
> > How do I send a Button (SWT.PUSH) a push event? I'm implementing my own
> > mnemonic traversal, and I'm trying to push the button whose mnemonic
> > char in getText() matches the traverse event's character.
>
>
Previous Topic:ContextMenu on tabbedView
Next Topic:Table columns with images makes first row partially hidden...
Goto Forum:
  


Current Time: Sat Apr 27 02:09:19 GMT 2024

Powered by FUDForum. Page generated in 0.03509 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top