Corba,RMI and RMI-IIOP
Can someone help me understand and analyze the marshaling techniques of CORBA, RMI and RMI-IIOP??
RMI/JRMP is easy, just read the RMI Specification:
http://java.sun.com/j2se/1.5.0/docs/guide/rmi/spec/rmi-protocol.html
CORBA is not so easy. Find the GIOP and IIOP specifications at http://www.omg.org
Similar Messages
-
hi,
may i know that what is the difference b/w rmi and iiop "some one told me that it is the marrige form b/w RMI and CORBA"
please explain me or give me a link to explanation.
thanks in advance!http://java.sun.com/j2se/1.3/docs/guide/rmi-iiop/
-
Difference between Java IDL and RMI-IIOP
Hi,
I am new to CORBA / RMI and I am trying to clear my concepts a little bit. Suppose, we want to create a remote object that should be accesible from CORBA clients. Does anyone know what the difference is between creating this object as an RMI object (with RMI-IIOP) and using the java IDL?
In other words, if I am not wrong, it is possible to write the object in java (pretty much like writting an RMI remore object), generate the IDL with rmic and then any CORBA client can access it provided it has the IDL.
Are there any advantages in doing it the other way (explicitely instantiating an ORB in the code, etc) ?
By the way, if we use the first choice (RMI-IIOP), when is the ORB getting called? Is it called by the Tie class, which is generated by rmic -iiop?
Thanks!Visit this link
http://java.sun.com/j2se/1.3/docs/guide/idl/jidlFAQ.html#java%20idl%20vs%20rmi-iiop -
Please i need someone to tell me when to tell me the real life application of RMI and CORBA.
jtahlborn wrote:
wpafbuser1 wrote:
jtahlborn wrote:
Somebody just posted the answer to this question in another forum:
http://catb.org/~esr/faqs/smart-questions.html
I would argue that Google has always had the answer to this question and this is not the place for such a high level interest.Did you check out the link? ;)Haha! Nice. I missed that. We need more of that kind of tough love trickery :) -
CORBA and RMI are "dead"?
Hi,
I'm a Comp. Sci. student taking a course in CORBA and RMI and was wondering how relevant these technologies are out in the real world? I have a friend in industry who tells me that these technologies are "dead". He says XML has taken over as a communications standard.
Also, I am in the design phase of developing a 3D online game and I want to know if CORBA or RMI is fast enough to be used in a realtime application such as this (let's say I want to make 10 remote method calls per second to each of 50 clients). Can someone aim me at some benchmarks or performance figures?
Thanks all.1. Your friend doesn't know as much as he thinks.
His statement is like saying "Conversation is dead because everybody uses English."
I can't speak about CORBA, but
o We have some very robust applictions written using RMI.
o We wonder if SUN is walking away from RMI totards JAX: an XML-based communications scheme.
2. Your problem is kind of under-specified, but
o the way you phrased it sounds like lots of callback from server to clients - an area RMI handles, but only very well on LANs.
o I suspect your performance will be more limited by network characteristics than by RMI. Unerneath, it's just TCPIP. -
Hi,
I have a question on using EJB / or RMI servers with CORBA clients using
RMI-IIOP transport, which in theory should work, but in practice has few
glitches.
Basically, I have implemented a very simple server, StockTreader, which
looks up for a symbol and returns a 'Stock' object. In the first example, I
simplified the 'Stock' object to be a mere java.lang.String, so that lookup
would simply return the 'synbol'.
Then I have implemented the above, as an RMI-IIOP server (case 1) and a
CORBA server (case 2) with respective clients, and the pair of
client-servers work fine as long as they are CORBA-to-CORBA and RMI-to-RMI.
But the problem arises when I tried using the RMI server (via IIOP) with the
CORBA client, when the client tries to narrow the object ref obtained from
the naming service into the CORBA idl defined type (StockTrader) it ends up
with a class cast exception.
This is what I did to achieve the above results:
[1] Define an RMI interface StockTrader.java (extending java.rmi.Remote)
with the method,
public String lookup( String symbol) throws RMIException;
[2] Implement the StorckTrader interface (on a PortableRemoteObject derived
class, to make it IIOP compliant), and then the server to register the stock
trader with COS Naming service as follows:
String homeName =....
StockTraderImpl trader =new StockTraderImpl();
System.out.println("binding obj <" homeName ">...");
java.util.Hashtable ht =new java.util.Hashtable();
ht.put("java.naming.factory.initial", args[2]);
ht.put("java.naming.provider.url", args[3]);
Context ctx =new InitialContext(ht);
ctx.rebind(homeName, trader);
[3] Generate the RMI-IIOP skeletons for the Implementation class,
rmic -iiop stock.StockTraderImpl
[4] generate the IDL for the RMI interface,
rmic -idl stock.StockTraderImpl
[5] Generate IDL stubs for the CORBA client,
idlj -v -fclient -emitAll StockTraderImpl.idl
[6] Write the client to use the IDL-defined stock trader,
String serverName =args[0];
String symList =args[1];
StockClient client =new StockClient();
System.out.println("init orb...");
ORB orb =ORB.init(args, null);
System.out.println("resolve init name service...");
org.omg.CORBA.Object objRef
=orb.resolve_initial_references("NameService");
NamingContext naming =NamingContextHelper.narrow(objRef);
... define a naming component etc...
org.omg.CORBA.Object obj =naming.resolve(...);
System.out.println("narrow objRef: " obj.getClass() ": " +obj);
StockTrader trader =StockTraderHelper.narrow(obj);
[7] Compile all the classes using Java 1.2.2
[8] start tnameserv (naming service), then the server to register the RMI
server obj
[9] Run the CORBA client, passing it the COSNaming service ref name (with
which the server obj is registered)
The CORBA client successfully finds the server obj ref in the naming
service, the operation StockTraderHelper.narrow() fails in the segment
below, with a class cast exception:
org.omg.CORBA.Object obj =naming.resolve(...);
StockTrader trader =StockTraderHelper.narrow(obj);
The <obj> returned by naming service turns out to be of the type;
class com.sun.rmi.iiop.CDRInputStream$1
This is of the same type when stock trader object is registered in a CORBA
server (as opposed to an RMI server), but works correctly with no casting
excpetions..
Any ideas / hints very welcome.
thanks in advance,
-hariOn the contrary... all that is being said is that we needed to provide clearer examples/documentation in the 5.1.0 release. There will be no difference between the product as found in the service pack and the product found in the 5.1.1. That is, the only substantive will be that 5.1.1 will also
include the examples.
"<=one way=>" wrote:
With reference to your and other messages, it appears that one should not
expect that WLS RMI-IIOP will work in a complex real-life system, at least
not now. In other words, support for real-life CORBA clients is not an
option in the current release of WLS.
TIA
"Eduardo Ceballos" <[email protected]> wrote in message
news:[email protected]...
We currently publish an IDL example, even though the IDL programmingmodel in Java is completely non-functional, in anticipation of the support
needs for uses who need to use IDL to talk to the Weblogic server,
generically. This example illustrates the simplest connectivity; it does not
address how
to integrate CORBA and EJB, a broad topic, fraught with peril, imo. I'llnote in passing that, to my knowledge, none of the other vendors attempt
this topic either, a point which is telling if all the less happy to hear.
For the record then, what is missing from our distribution wrt RMI-IIOPare a RMI-IIOP example, an EJB-IIOP example, an EJB-C++. In this you are
correct; better examples are forth coming.
Still, I would not call our RMI-IIOP implementation fragile. I would saythat customers have an understandably hard time accepting that the IDL
programming model is busted; busted in the sense that there are no C++
libraries to support the EJB model, and busted in the sense that there is
simply no
support in Java for an IDL interface to an EJB. Weblogic has nothing to doit being busted, although we are trying to help our customers deal with it
in productive ways.
For the moment, what there is is a RMI (over IIOP) programming model, aninherently Java to Java programming model, and true to that, we accept and
dispatch IIOP request into RMI server objects. The way I look at it is this:
it's just a protocol, like HTTP, or JRMP; it's not IDL and it has
practically nothing to do with CORBA.
ST wrote:
Eduardo,
Can you give us more details about the comment below:
I fear that as soon as the call to narrow succeeds, the remainingapplication will fail to work correctly because it is too difficult ot
use an idl client in java to work.It seems to me that Weblogic's RMI-IIOP is a very fragile
implementation. We
don't need a "HelloWorld" example, we need a concrete serious example(fully
tested and seriously documented) that works so that we can get a betteridea
on how to integrate CORBA and EJB.
Thanks,
Said
"Eduardo Ceballos" <[email protected]> wrote in message
news:[email protected]...
Please post request to the news group...
As I said, you must separate the idl related classes (class files and
java
files) from the rmi classes... in the rmic step, you must set a newtarget
(as you did), emit the java files into that directory (it's not clearyou
did this), then remove all the rmi class files from the class path... ifyou
need to compile more classes at that point, copy the java files to theidl
directly is you must, but you can not share the types in any way.
I fear that as soon as the call to narrow succeeds, the remainingapplication will fail to work correctly because it is too difficult otuse
an idl client in java to work.
Harindra Rajapakshe wrote:
Hi Eduardo,
Thanks for the help. That is the way I compiled my CORBA client, by
separating the IDL-generated stubs from the RMI ones, but still I
get a
CORBA.BAD_PARAM upon narrowing the client proxy to the interfacetype.
Here's what I did;
+ Define the RMI interfaces, in this case a StockTrader interface.
+ Implement RMI interface by extendingjavax.rmi.PortableRemoteObject
making
it IIOP compliant
+ Implemnnt an RMI server, and compile using JDK1.2.2
+ use the RMI implementation to generate CORBA idl, using RMI-IIOPplugin
utility rmic;
rmic -idl -noValueMethods -always -d idl stock.StockTraderImpl
+ generate Java mappings to the IDL generated above, using RMI-IIOPplugin
util,
idlj -v -fclient -emitAll -tf src stocks\StockTrader.idl
This creates source for the package stock and also
org.omg.CORBA.*
package, presumably IIOP type marshalling
+ compile all classes generated above using JDK1.2.2
+ Implement client (CORBA) using the classes generated above, NOTthe
RMI
proxies.
+ start RMI server, with stockTrader server obj
+ start tnameserv
+ start CORBA client
Then the client errors when trying to narrow the obj ref from the
naming
service, into the CORBA IDL defined interface using,
org.omg.CORBA.Object obj =naming.resolve(nn);
StockTrader trader =StockTraderHelper.narrow(obj); // THIS
ERRORS..!!!
throwing a CORBA.BAD_PARAM exception.
any ideas..?
Thanks in advance,
-hari
----- Original Message -----
From: Eduardo Ceballos <[email protected]>
Newsgroups: weblogic.developer.interest.rmi-iiop
To: Hari Rajapakshe <[email protected]>
Sent: Wednesday, July 26, 2000 4:38 AM
Subject: Re: problem using CORBA clients with RMI/EJBservers..!!!???
Please see the post on june 26, re Errors compiling... somewherein
there,
I suspect, you are referring to the rmi class file when you are
obliged
to
completely segregate these from the idl class files.
Hari Rajapakshe wrote:
Hi,
I have a question on using EJB / or RMI servers with CORBA
clients
using
RMI-IIOP transport, which in theory should work, but in practice
has
few
glitches.
Basically, I have implemented a very simple server,
StockTreader,
which
looks up for a symbol and returns a 'Stock' object. In the firstexample, I
simplified the 'Stock' object to be a mere java.lang.String, so
that
lookup
would simply return the 'synbol'.
Then I have implemented the above, as an RMI-IIOP server (case
1)
and a
CORBA server (case 2) with respective clients, and the pair of
client-servers work fine as long as they are CORBA-to-CORBA andRMI-to-RMI.
But the problem arises when I tried using the RMI server (via
IIOP)
with
the
CORBA client, when the client tries to narrow the object ref
obtained
from
the naming service into the CORBA idl defined type (StockTrader)
it
ends
up
with a class cast exception.
This is what I did to achieve the above results:
[1] Define an RMI interface StockTrader.java (extending
java.rmi.Remote)
with the method,
public String lookup( String symbol) throws RMIException;
[2] Implement the StorckTrader interface (on a
PortableRemoteObject
derived
class, to make it IIOP compliant), and then the server to
register
the
stock
trader with COS Naming service as follows:
String homeName =....
StockTraderImpl trader =new StockTraderImpl();
System.out.println("binding obj <" homeName ">...");
java.util.Hashtable ht =new java.util.Hashtable();
ht.put("java.naming.factory.initial", args[2]);
ht.put("java.naming.provider.url", args[3]);
Context ctx =new InitialContext(ht);
ctx.rebind(homeName, trader);
[3] Generate the RMI-IIOP skeletons for the Implementation
class,
rmic -iiop stock.StockTraderImpl
[4] generate the IDL for the RMI interface,
rmic -idl stock.StockTraderImpl
[5] Generate IDL stubs for the CORBA client,
idlj -v -fclient -emitAll StockTraderImpl.idl
[6] Write the client to use the IDL-defined stock trader,
String serverName =args[0];
String symList =args[1];
StockClient client =new StockClient();
System.out.println("init orb...");
ORB orb =ORB.init(args, null);
System.out.println("resolve init name service...");
org.omg.CORBA.Object objRef
=orb.resolve_initial_references("NameService");
NamingContext naming=NamingContextHelper.narrow(objRef);
... define a naming component etc...
org.omg.CORBA.Object obj =naming.resolve(...);
System.out.println("narrow objRef: " obj.getClass() ":"
+obj);
StockTrader trader =StockTraderHelper.narrow(obj);
[7] Compile all the classes using Java 1.2.2
[8] start tnameserv (naming service), then the server to
register
the
RMI
server obj
[9] Run the CORBA client, passing it the COSNaming service ref
name
(with
which the server obj is registered)
The CORBA client successfully finds the server obj ref in the
naming
service, the operation StockTraderHelper.narrow() fails in thesegment
below, with a class cast exception:
org.omg.CORBA.Object obj =naming.resolve(...);
StockTrader trader =StockTraderHelper.narrow(obj);
The <obj> returned by naming service turns out to be of the
type;
class com.sun.rmi.iiop.CDRInputStream$1
This is of the same type when stock trader object is registeredin a
CORBA
server (as opposed to an RMI server), but works correctly with
no
casting
excpetions..
Any ideas / hints very welcome.
thanks in advance,
-hari -
Hi guys,
i feel ejb is internally using rmi.Am i right?what are the differences between rmi and ejb and also what r the similarities?
Thanks
Regards
Vivek.SRMI is just an API that allows Java classes to be invoked remotely. It uses Java Remote Method Protocol. But it also can use IIOP in which case this whole thing is called RMI-IIOP.
RMI doesnt provide any component model like EJB, that has several types of components with well defined behavior and purpose.
Since EJB's can be called remotely they may use JRMP but it's not mandatory.
EJB's have to use IIOP as a connection protocol to ensure interoperability among EJB servers and CORBA ORB's. So EJB' s use RMI as an API, but they have to support IIOP and optionally some other protocols like JRMP. For example, WebLogic supports some interesting protocol called T3.
best regards,
Maris Orbidans
SCJP SCWCD SCBCD -
Standard Java RMI and WLS5.1?
I would surmise that the problem you are seeing is the result of the fact
that we do not except standard Java RMI calls using the functionality in the
JDK. You must use the WebLogic implementation of RMI. It is exactly the
same in terms of APIs, but we have gone through and optimize the underlying
protocol.
Please see the documentation for more details.
We offer both RMI over IIOP and RMI over T3.
Thanks,
Michael
Michael Girdley
Product Manager, WebLogic Server & Express
BEA Systems Inc
Mario Felarca <[email protected]> wrote in message
news:[email protected]..
Hello,
I was trying to get a simple callback demo working using standard java
RMI and the WLS5.1. Unfortunately, although things seemed to compile
and launch smoothly, when the client started up and tried to talk to the
WLS I would get the following error:
weblogic.rmi.server.ExportException: A description for CallbackImpl was
found but it could not be read due to: [Failed to find a stub for [class
CallbackImpl] implements at least one interface [interface Callback]
which extends Remote.]
weblogic.rmi.StubNotFoundException: Failed to find a stub for [class
CallbackImpl] implements at least one interface [interface Callback]
which extends Remote.
I tried determining if this was a classpath problem, but all my efforts
kept producing this result.
On the flip side, if I retool my objects slightly in order to make them
use weblogic.rmi.*, then everything works perfectly.
Is there a tradeoff to using weblogic.rmi over java.rmi?
Also, does anyone have any ideas as to what might be causing my error
when using standard rmi?
Thanks so much in advance,
Mario- -
Jini and Rmi utilisation for a particulary case..
I have to write a application which is going to connect our server to different hospitals infromatque system.
The application would provide a user interface in hospital side wich is going to make them able to send us a inventory file(fromated differently for each hospital with their own informatiqe system).
The application have also to change the the file format befor stored in our data-base(each information have to go to different table)
My supervisor ask me to look Jini and Rmi technologie for this application..
So far i read some information about both technologie..but still i'm wondering my self is Jini or Rmi have a real use in this case.
If your are masterd in those technologie and java networking device woud you help me up ?
Could you tell me if those technologie have to be realy use in this case or there is other solution with java programming.
Thank's
Astiage GhassemianJini is a high level framework that a computer to easily locate a service provider in a network and get the service. So your case does not need such a framework because in your case, just like most of todays application, the service is provided only by your server and you know where it is and what it does. You just need something a one level lower than Jini that actually does the communication - RMI. Jini runs only top of any other lower level protocol including RMI. Detailed description of Jini:
Jini technology is an architecture for the construction of systems from objects and networks. The Jini architecture lets programs use services in a network without knowing anything about the wire protocol that the service uses. One implementation of a service might be XML-based, and another RMI-based, and a third CORBA-based. The client is, in effect, taught by each service how to talk to it. A service is defined by its programming API, declared as a Java programming language interface.
When a service is plugged into a network of Jini technology-enabled services and/or devices, it advertises itself by publishing a Java programming language object that implements the service API. This object's implementation can work in any way the service chooses. The client finds services by looking for an object that supports the API. When it gets the service's published object, it will download any code it needs in order to talk to the service, thereby learning how to talk to the particular service implementation via the API. The programmer who implements the service chooses how to translate an API request into bits on the wire using UPnP, RMI, CORBA, or a private protocol.
In other words, the Jini architecture uses objects that move around the network to make each service, as well as the entire network of services, adaptable to new strategies over time. -
hai everybody,
I wanna know the differences in using RMI and SOAP concepts.
can we use SOAP in place of RMI?
Im new to SOAP.
I want use SOAP concept in my project to work with the database by sending data through SOAP messages using xml to remote server.
there i want call some remote methods to insert data in to database from the SOAP messages.
Is it necessary to use RMI here or we can manage vth SOAP concepts?
can any one suggest in such situation?
Thanks in advance for ur replytjacobs01 wrote:
They are essentially the same. RMI is a little bit more abstract - SOAP defines one way you can do RMI. Others are things like CORBA and DCOM.RMI and SOAP are not the same at all. RMI is java's remote procedure call (RPC) mechanism and is java to java only. SOAP is used for exchanging XML-based messages and is cross-platform. -
What is the difference between RMI and JAX-RPC?
Dear All
First of all my understanding of RMI and JAX-RPC:
RMI is JAVA only version of RPC. It can't talk to any other language.
JAX-RPC is a part of JWSDP and if you implement your client and server with JAX-RPC, client written in any language can talk with JAX-RPC implementation.
What else makes them different and am I right with my understanding?
Finally, I would like to develop clients which will have a java class, say httpserver.java, which will act like a http server, listens to a http port. Now, Two such client will run in two different PC and I want to call a module from one client to another which should be accessible via my httpserver.java. For that which should be my choice RMI or JAX-RPC? Can I achive it with http get-post method, as I am expecting to read some value of variables from one client to the another.
Say class A has variable a, aa, aaa and clas B has variable b, bb, bbb. Now I want to read the value of b, bb, bbb from class A. How do I do that when class B is listening to a http port with my httpserver.java class.
Lastly, say B is listening to a http port and I want to send a file to B from A. How can I do that? Remember, B didn�t ask for that. How can A send a file to B when B is listening to a http port with my httpserver.java.
With regards
Mohammed Jubaer Arif
Mobile: +61-0411215302
Personal Web: http://www.geocities.com/jubairarifctg/
Org. Web.: http://www.geocities.com/halimschamber/simply put, RMI allows you to (semi) transparently treat remote objects as if they were local, and your distributed application can be written (more or less) like a "normal" java app. Sockets just give you a "raw" connection to work with, and you get to build up your application from that.
I hope that helped
Lee -
Difference Between JMS and RMI
Difference Between JMS and RMI in J2EE Technologies
STFW
JMS - http://www.google.co.za/search?hl=en&q=what+is+jms&meta=
RMI - http://www.google.co.za/search?hl=en&q=what+is+rmi&meta= -
Please help: RMI and Swing/AWT issue
Hi guys, I've been having a lot of trouble trying to get a GUI application to work with RMI. I'd appreciate any help. Here's the story:
I wrote a Java application and its GUI using Netbeans. In a nutshell, the application is about performing searches. I am now at the point where I need exterior programs to use my application's search capabilities, thus needing RMI. Such exterior programs are to call methods currently implemented in my application.
I implemented RMI, and got the client --> server communication working. However, the GUI just breaks. It starts outputting exceptions, gets delayed, doesn't update properly, some parts of it stop working.... basically hysterical behavior.
Now take a look at this line within my server class:
Naming.rebind("SearchProgram", mySearchProgram);
If I take it out, RMI obviously does not work... but the application and its GUI work flawlessly. If I put it in, the RMI calls work, but the GUI's above symptoms occur again. Among the symptoms are null pointer exceptions which all look similar, are related to "AWT-EventQueue-0", and keep ocurring. Here's just snippet of the errors outputted:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at javax.swing.plaf.metal.MetalScrollBarUI.getPreferredSize(MetalScrollBarUI.java:102)
at javax.swing.JComponent.getPreferredSize(JComponent.java:1615)
at javax.swing.JScrollBar.getMinimumSize(JScrollBar.java:704)
at javax.swing.ScrollPaneLayout.minimumLayoutSize(ScrollPaneLayout.java:624)
at java.awt.Container.minimumSize(Container.java:1598)
at java.awt.Container.getMinimumSize(Container.java:1583)
at javax.swing.JComponent.getMinimumSize(JComponent.java:1697)
at java.awt.BorderLayout.minimumLayoutSize(BorderLayout.java:634)
at java.awt.Container.minimumSize(Container.java:1598)
at java.awt.Container.getMinimumSize(Container.java:1583)
at javax.swing.JComponent.getMinimumSize(JComponent.java:1697)
at java.awt.BorderLayout.minimumLayoutSize(BorderLayout.java:634)
at java.awt.Container.minimumSize(Container.java:1598)
at java.awt.Container.getMinimumSize(Container.java:1583)
at javax.swing.JComponent.getMinimumSize(JComponent.java:1697)
at javax.swing.BoxLayout.checkRequests(BoxLayout.java:433)
at javax.swing.BoxLayout.layoutContainer(BoxLayout.java:375)
at java.awt.Container.layout(Container.java:1401)
at java.awt.Container.doLayout(Container.java:1390)
at java.awt.Container.validateTree(Container.java:1473)
at java.awt.Container.validateTree(Container.java:1480)
at java.awt.Container.validateTree(Container.java:1480)
at java.awt.Container.validateTree(Container.java:1480)
at java.awt.Container.validateTree(Container.java:1480)
at java.awt.Container.validate(Container.java:1448)
at javax.swing.RepaintManager.validateInvalidComponents(RepaintManager.java:379)
at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:113)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at javax.swing.plaf.basic.BasicMenuItemUI.getPreferredMenuItemSize(BasicMenuItemUI.java:400)
at javax.swing.plaf.basic.BasicMenuItemUI.getPreferredSize(BasicMenuItemUI.java:310)
at javax.swing.JComponent.getPreferredSize(JComponent.java:1615)
at javax.swing.BoxLayout.checkRequests(BoxLayout.java:434)
at javax.swing.BoxLayout.preferredLayoutSize(BoxLayout.java:251)
at javax.swing.plaf.basic.DefaultMenuLayout.preferredLayoutSize(DefaultMenuLayout.java:38)
at java.awt.Container.preferredSize(Container.java:1558)
at java.awt.Container.getPreferredSize(Container.java:1543)
at javax.swing.JComponent.getPreferredSize(JComponent.java:1617)
at javax.swing.JRootPane$RootLayout.layoutContainer(JRootPane.java:910)
at java.awt.Container.layout(Container.java:1401)
at java.awt.Container.doLayout(Container.java:1390)
at java.awt.Container.validateTree(Container.java:1473)
at java.awt.Container.validate(Container.java:1448)
at javax.swing.RepaintManager.validateInvalidComponents(RepaintManager.java:379)
at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:113)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
There are no complaints about anything within my code, it's all GUI related whenever I make a bind() or rebind() call.
Again, any help here would be great... cause this one's just beating me.
Thanks!Maybe you want to change that worker thread to
not do RMI but anything else (dummy data) to see if it really is RMI, I doubt it, I think you are updating some structures that have to do with swing GUI and hence you will hang.
Just check this out. -
Hi there,
I have the following problem.
I opened a ticket in Day Care Support system, about CRX users/group membership that got lost while synchronization with our LDAP server.
Although when the user and the group had been created (and therefore taken from that same LDAP server), the membership was good.... but after some time the membership got lost......
So what i am trying to do now is a Java program that connects to CRX via RMI.
And gets the list of all the users from a group (aka membership).
The idea is to monitor the membership each seconds.
But when trying to get the property "rep:members" of the group, I have the following exception :
javax.jcr.ValueFormatException: Unknown value type 10
at org.apache.jackrabbit.rmi.server.ServerObject.getRepositoryException(ServerObject.java:13 9)
at org.apache.jackrabbit.rmi.server.ServerProperty.getValues(ServerProperty.java:71)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322)"
I searched a little bit and found that "10" is the number for type WeakReference.
That's normal to me because memberships are stored in the group as a list reference to users linked to that group....
Anyways, what's not normal to me is that when the type is "10" the API does not let me get the Value (cf. ServerProperty.getValues() method)
Here is the program:
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import javax.imageio.spi.ServiceRegistry;
import javax.jcr.Node;
import javax.jcr.NodeIterator;
import javax.jcr.Property;
import javax.jcr.PropertyIterator;
import javax.jcr.Repository;
import javax.jcr.RepositoryException;
import javax.jcr.RepositoryFactory;
import javax.jcr.Session;
import javax.jcr.SimpleCredentials;
import javax.jcr.Value;
public class Test {
public static void main(String[] args) {
String uri = "rmi://sma11c02.............:1234/crx";
String username = "admin";
char[] password = {....................};
String workspace = "crx.default";
String nodePath = "/home/groups/a";
Repository repository = null;
Session session = null;
try {
// Connection to repository via RMI
Map<String, String> jcrParameters = new HashMap<String, String>();
jcrParameters.put("org.apache.jackrabbit.repository.uri", uri);
Iterator<RepositoryFactory> iterator = ServiceRegistry.lookupProviders(RepositoryFactory.class);
while (null == repository && iterator.hasNext()) {
repository = iterator.next().getRepository(jcrParameters);
if (repository == null) {
throw new IllegalStateException("Problem with connection to the repository...");
// Creation of a session to the workspace
session = repository.login(new SimpleCredentials(username, password), workspace);
if (session == null) {
throw new IllegalStateException("Problem with creation of session to the workspace...");
// Get the targetted node
Node node = session.getNode(nodePath);
System.out.println("Node : " + node.getName());
System.out.println();
PropertyIterator properties = node.getProperties();
System.out.println("List of properties for this node :");
while (properties.hasNext()) {
Property property = properties.nextProperty();
System.out.print("\t"+property.getName() + " : ");
if (property.isMultiple()) {
Value[] values = property.getValues();
for (int i = 0; i < values.length; i++) {
System.out.print(values[i]);
if (i+1 != values.length) {
System.out.print(", ");
System.out.println();
} else {
Value value = property.getValue();
System.out.println(value);
System.out.println();
NodeIterator kids = node.getNodes();
System.out.println("List of children nodes for this node :");
while (kids.hasNext()) {
Node kid = kids.nextNode();
System.out.println("\tChild node : "+kid.getName());
PropertyIterator kidProperties = kid.getProperties();
System.out.println("List of properties for this child :");
while (kidProperties.hasNext()) {
Property property = kidProperties.nextProperty();
System.out.print("\t"+property.getName() + " : ");
if (property.isMultiple()) {
Value[] values = property.getValues();
for (int i = 0; i < values.length; i++) {
System.out.print(values[i]);
if (i+1 != values.length) {
System.out.print(", ");
System.out.println();
} else {
Value value = property.getValue();
System.out.println(value);
System.out.println();
} catch (RepositoryException e) {
e.printStackTrace();
} finally {
if (session != null) {
session.logout();
Here is the output of the below program:
Node : a
List of properties for this node :
jcr:createdBy : admin
jcr:mixinTypes : mix:lockable
jcr:created : 2011-10-25T16:58:48.140+02:00
jcr:primaryType : rep:AuthorizableFolder
List of children nodes for this node :
Child node : administrators
List of properties for this child :
jcr:createdBy : admin
rep:principalName : administrators
rep:members : javax.jcr.ValueFormatException: Unknown value type 10
at org.apache.jackrabbit.rmi.server.ServerObject.getRepositoryException(ServerObject.java:13 9)
at org.apache.jackrabbit.rmi.server.ServerProperty.getValues(ServerProperty.java:71)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322)
at sun.rmi.transport.Transport$1.run(Transport.java:171)
at java.security.AccessController.doPrivileged(AccessController.java:284)
at sun.rmi.transport.Transport.serviceCall(Transport.java:167)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:547)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:802)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:661)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:897)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:919)
at java.lang.Thread.run(Thread.java:736)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at org.apache.jackrabbit.rmi.server.ServerProperty_Stub.getValues(Unknown Source)
at org.apache.jackrabbit.rmi.client.ClientProperty.getValues(ClientProperty.java:173)
at Test.main(Test.java:96)
Here is the list of jar files i'm using with this program:
2862818581 61388 crx-rmi-2.2.0.jar
732434195 335603 jackrabbit-jcr-commons-2.4.0.jar
1107929681 411330 jackrabbit-jcr-rmi-2.4.0.jar
3096295771 69246 jcr-2.0.jar
1206850944 367444 log4j-1.2.14.jar
685167282 25962 slf4j-api-1.6.4.jar
2025068856 9748 slf4j-log4j12-1.6.4.jar
Finally, we are using CQ 5.4 (CRX 2.2) with the latest hotfix and under Websphere 7.0
Best regards,
Vincent FINETJe suis absent(e) du bureau jusqu'au 17/04/2012
Je suis absent.
Je répondrai à votre sollicitation à mon retour le 17 avril 2012.
Cordialement,
Vincent FINET
Remarque : ceci est une réponse automatique à votre message "[CQ5]
Connection to CRX via RMI and getting WeakReference value..... with an
exception!" envoyé le 13/4/12 0:32:14.
C'est la seule notification que vous recevrez pendant l'absence de cette
personne.
Le papier est un bien precieux, ne le gaspillez pas. N'imprimez ce document que si vous en avez vraiment besoin !
Ce message est confidentiel.
Sous reserve de tout accord conclu par ecrit entre vous et La Banque Postale, son contenu ne represente en aucun cas un engagement de la part de La Banque Postale.
Toute publication, utilisation ou diffusion, meme partielle, doit etre autorisee prealablement.
Si vous n'etes pas destinataire de ce message, merci d'en avertir immediatement l'expediteur. -
Hi,
I have a problem, integrating an application with RMI and a Client side with swing.
I have un RMI object that does something, and in any time I want to inform to the client side rmi... I did something like:
// This is the REmote implementation
public MyRemoteImpl extends Activatable implements MyRemote{
EventListenerList listeners;
// code for activation, etc.......
public void addListener(MyListener l){
// add the listener in the list...
public void fireEvent(String msgEvent){
// in each listener that is MyListener, .doEvent(String msg)
// Methods that calls fireEvent...
// Mylistener interface..
public MyListener implements EventListener{
public void doEvent(String msg);
// The swing client side.
public MyClient extends JPanel implements MyListener{
MyRemote rem=null;
// In the start of ui.. Ido:
rem.addListener(this);
public void doEvent(String msg){
// Puts the message at one component....
}The problem is that when the doEvent of the Swing side is called, it is executing in the rmid... And the UI is not updated...
What I do wrong??
Thanks and Best Regards.I wrote an application that does something similar, it receives some event and modifies a JTree accordingly. You should try using the java.awt.EventQueue.invokeLater(Runnable) method. Something like this:
public void doEvent(String msg) {
// Determine what changes need to be made
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
// Only the GUI component modification calls need to go here
}
Maybe you are looking for
-
Hey all, I have one question, one major problem, i Have a 5th generation video Ipod (late 2006), with a broken headphone jack. its broken because only my music comes out of the left headphone/speaker. i know its not my headphones because i have pluge
-
Hi all, I have been trying to figure out why my audio player ain't displaying the progress of the stream but still can't find a way around it. Could you pros help me out here. Really am out of solutions >_< Thanks in advance
-
What program to use to to down load DVD that will also play on my Ipad 3rd generation
Need to Know what DVD Program to use in order to copy movie dvd so that I can down load to my MacBook as well as my IPad ?
-
Table 'sitv.a' doesn't exist. vendor code 1146
Post Author: pattyg CA Forum: Crystal Reports I need help with a sql statement that I am using in Crystal reports. The table that I am using is sitv and I get an error that it doesn't exist. Here is the statement: SELECT a.UID, a.fid, b.fname , c.ln
-
I preordered Watch Dogs for the Xbox One several months ago, and payed $59.99 when I did so. I went to pick up the game today and was told I was paying off the remaining balance due(being the tax). On their screen they saw the remaining balance due,