[opencms-dev] Challange! External Program access to OpenCMS I nstance...

Marcus Redeker mredeker at web.de
Sat Nov 15 21:56:01 CET 2003


Ralf,

I doubt that the OpenCms object is the only one which is not
serialzable. So once you implement the Serializable interface on the
OpenCms object you will get the same error with any reference which is
hold by the OpenCms object which is also not serializable. You will have
to go through each object which is not serializable and implement the
interface.

Once you are done with that the question is how big is the data that has
to be serialized? Thinking of the OpenCms object and all ist references
this might be a lot of data and calling a method trough RMI can be
really slow.

Good luck,

--Marcus



> -----Original Message-----
> From: opencms-dev-admin at opencms.org 
> [mailto:opencms-dev-admin at opencms.org] On Behalf Of Ralf Bierig
> Sent: Saturday, November 15, 2003 9:44 PM
> To: opencms-dev at opencms.org
> Subject: RE: [opencms-dev] Challange! External Program access 
> to OpenCMS I nstance...
> 
> 
> Hello,
> 
> I followed your tip and programmed a RMI Server, which is 
> initiateed by the OpenCmsHTTPServlet class when the opencms 
> servlet it called. The server is up and running.
> 
> However when I access the server and want to get the OpenCms 
> object I get the following message:
> 
> System RemoteExceptionjava.rmi.UnmarshalException: error unmarshalling
> return; nested exception is: 
> 	java.io.WriteAbortedException: writing aborted;
> java.io.NotSerializableException: com.opencms.core.OpenCms
> 
> The OpenCms object does indeed not implement the Serializable 
> interface. My question now is, when I modify the OpenCms 
> class file and add that it implements Serializable will it 
> work then and will it work properly?
> 
> Is the problem another one and how can I fix it. I am soooo 
> close and there should be a way...
> 
> 
> Cheers,
> Ralf
> 
> > You will need RMI to call the wrapper class if you start another 
> > application with "java myApplication" because then you start a new 
> > JVM, different than the JVM which is started by your web 
> application 
> > and in which your wrapper class was initialized.
> > w
> > 
> > -----Original Message-----
> > From: ambiesense at gmx.de [mailto:ambiesense at gmx.de]
> > Sent: mercredi 12 novembre 2003 14:32
> > To: opencms-dev at opencms.org
> > Subject: RE: [opencms-dev] Challange! External Program access to 
> > OpenCMS I nstance...
> > 
> > 
> > Hello Wouter,
> > 
> > can another Java program (started indepentendly with "java 
> > myApplication") call the static Wrapper embedded as part of the 
> > OpenCMS server? If this is possible, then I am fine.
> > 
> > I think this is more a Java question then a OpenCMS question. I 
> > appologise if I might have confused you.
> > 
> > Ralf
> > 
> > > I don't understand exactly what you are trying to say. 
> Why don't you 
> > > consider the Wrapper class as being part of the OpenCms server ?  
> > > It's the client which afterwards calls the wrapper class 
> in order to 
> > > get acces to the
> > > singleton OpenCms.
> > > 
> > > Concerning the other question , as long you keep the singleton 
> > > "single" there no problem that different threads or clients 
> > > (possibly through
> > > rmi)
> > > make use of the singleton. They all use a reference to 
> the same object.
> > > 
> > > wouter
> > > 
> > > -----Original Message-----
> > > From: Ralf Bierig [mailto:ambiesense at gmx.de]
> > > Sent: mercredi 12 novembre 2003 11:22
> > > To: opencms-dev at opencms.org
> > > Subject: Re: [opencms-dev] Challange! External Program access to
> > > OpenCMS
> > > Instance...
> > > 
> > > 
> > > Hi Matt and Wouter,
> > > 
> > > the method is more direct. However using this appraoch 
> would change 
> > > the workflow. My initial idea was that OpenCMS with data and 
> > > everything is like a
> > > service and I have a client, who can access this without
> > > HTTP/SOAP/Webservice
> > > but API(local)/RMI or Sockets.
> > > 
> > > Wouter's method is good but change the workflow in the 
> way that the
> > > OpenCMS
> > > server is acutally calling my application (the wrapper). 
> This would 
> > > turn
> > > OpenCMS into a pseudo client and the application which 
> was supposed to 
> > > be a
> > > client into a pseudo server. The application would be invoked by 
> > > starting
> > > OpenCMS.
> > > I would like it however the other way round. Would this 
> be possible to 
> > > start
> > > a RMI server/Socket Server with this extra line and let 
> the appliation
> > > client connect to that, get the OpenCms Object and work with the 
> > > singleton
> > > OpenCms
> > > instance. 
> > > 
> > > If more then one client applications would connect like 
> that, would
> > > this way
> > > of accessing still ensure that each client sees the same 
> (files, users,
> > > etc)?
> > > 
> > > Another question based on the fact that I would accept 
> the fact that
> > > OpenCMS
> > > starts the application. Could  this line:
> > > 
> > > // added by myself
> > > opencms.addons.CmsWrapper.setOpenCms(m_opencms);
> > > // end added by myself
> > > 
> > > be extended to start a number of appliations (Wrappers) 
> > > simultaniously
> > > (i.e.
> > > as Threads). Would this still ensure that each 
> application would see 
> > > the
> > > same OpenCMS instance with the same changes made by 
> others (i.e. users,
> > > files,
> > > tasks...)?
> > > 
> > > Cheers,
> > > Ralf
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > > Ralf Bierig wrote:
> > > > > Hello Matt,
> > > > > 
> > > > > thank you again for you competent answer.
> > > > > 
> > > > > Do you agree that this solution should not have side 
> effects, if
> > > the
> > > > only
> > > > > user would be this Java programm and there would NO OTHER user
> > > logged in
> > > > via
> > > > > HTTP/Tomcat?
> > > > 
> > > > I think that should be okay. wouter's method is probably better,
> > > though
> > > > -- esp. if you were planning on using RMI anyway.
> > > > 
> > > > Matt
> > > > 
> > > > _______________________________________________
> > > > This mail is send to you from the opencms-dev mailing list To 
> > > > change your list options, or to unsubscribe from the 
> list, please
> > > visit
> > > > http://mail.opencms.org/mailman/listinfo/opencms-dev
> > > > 
> > > 
> > > --
> > > NEU FÜR ALLE - GMX MediaCenter - für Fotos, Musik, Dateien...
> > > Fotoalbum, File Sharing, MMS, Multimedia-Gruß, GMX FotoService
> > > 
> > > Jetzt kostenlos anmelden unter http://www.gmx.net
> > > 
> > > +++ GMX - die erste Adresse für Mail, Message, More! +++
> > > 
> > > _______________________________________________
> > > This mail is send to you from the opencms-dev mailing 
> list To change 
> > > your list options, or to unsubscribe from the list, please visit
> > > http://mail.opencms.org/mailman/listinfo/opencms-dev
> > > _______________________________________________
> > > This mail is send to you from the opencms-dev mailing list
> > > To change your list options, or to unsubscribe from the 
> list, please
> > visit
> > > http://mail.opencms.org/mailman/listinfo/opencms-dev
> > > 
> > 
> > --
> > NEU FÜR ALLE - GMX MediaCenter - für Fotos, Musik, Dateien...
> > Fotoalbum, File Sharing, MMS, Multimedia-Gruß, GMX FotoService
> > 
> > Jetzt kostenlos anmelden unter http://www.gmx.net
> > 
> > +++ GMX - die erste Adresse für Mail, Message, More! +++
> > 
> > _______________________________________________
> > This mail is send to you from the opencms-dev mailing list
> > To change your list options, or to unsubscribe from the 
> list, please 
> > visit http://mail.opencms.org/mailman/listinfo/opencms-dev
> > _______________________________________________
> > This mail is send to you from the opencms-dev mailing list
> > To change your list options, or to unsubscribe from the 
> list, please 
> > visit http://mail.opencms.org/mailman/listinfo/opencms-dev
> > 
> 
> -- 
> NEU FÜR ALLE - GMX MediaCenter - für Fotos, Musik, Dateien... 
> Fotoalbum, File Sharing, MMS, Multimedia-Gruß, GMX FotoService
> 
> Jetzt kostenlos anmelden unter http://www.gmx.net
> 
> +++ GMX - die erste Adresse für Mail, Message, More! +++
> 
> 
> 
> -- 
> NEU FÜR ALLE - GMX MediaCenter - für Fotos, Musik, Dateien... 
> Fotoalbum, File Sharing, MMS, Multimedia-Gruß, GMX FotoService
> 
> Jetzt kostenlos anmelden unter http://www.gmx.net
> 
> +++ GMX - die erste Adresse für Mail, Message, More! +++
> 
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, 
> please visit http://mail.opencms.org/mailman/listinfo/opencms-dev
> 





More information about the opencms-dev mailing list