This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal


Jul 4, 2013, 6:45 PM
5 Posts

lotus.domino.cso vs lotus.domino.local

  • Category: Domino Designer
  • Platform: Windows
  • Release: 9.0
  • Role: Developer
  • Tags: BUG
  • Replies: 4

Hi, I have a big problem with my Java process running on Domino 9.0. I'm using NCSO.jar to create a DIIOP Notes session and create a document in a database. My problem is that I'm unable to use some object in remote access. All Notes objets created in my class resolve to lotus.domino.cso package classes, but when I call Session.createStream or Session.createRichTextStyle, it creates lotus.domino.local classes. The result is a ClasCastException when I try to use the local classes in any notes method.

I get :

java.lang.ClassCastException: lotus.domino.local.RichTextStyle incompatible with lotus.domino.cso.RichTextStyle.

 

import lotus.domino.Session;

import lotus.domino.RichTextItem;

import lotus.domino.RichTextStyle;

...

 

RichTextItem rtItem = doc.createRichTextItem(name);
RichTextStyle rtStyle = s.createRichTextStyle();
rtStyle.setPassThruHTML(RichTextStyle.YES);
rtItem.appendStyle(rtStyle);  //<------------------------------------- CRASH LINE
rtItem.appendText((String)value);

 

The method 'appendStyle' needs a lotus.domino.cso object, but the createRichTextStyle creates a lotus.domino.local object. First, I don't understand why the create functions are creating local objects, second, I don't understand why the method 'appendStyle' needs a cso object, and finally, I don't understand why there's no possible cast between the cso and the local types. I have the same problem with the Session.createStream and MimeEntity.setContentFromText(stream, .., ..). In this case, the stream created by the createStream method is from lotus.domino.local, but setContentFromText needs a lotus.domino.cso.Stream.

 

After a lot of tries and retries, I can't find a solution for that.

 

Thanks for your help.

 

Carl

 

Jul 4, 2013, 6:58 PM
5 Posts
Forgot to mention..

I forgot to mention that the line RichTextItem rtItem = doc.createRichTextItem(name) generates a lotus.domino.cso.RichTextItem. So it works correctly.

 

Jul 8, 2013, 1:41 PM
3 Posts
Re: lotus.domino.cso vs lotus.domino.local
You need to import  lotus.domino.* into your application.   There are many internal dependencies, and one cannot pick and choose.  Also, there can be no cast between local and cso objects, as they are completely different animals, and cannot coexist.
Jul 10, 2013, 11:35 AM
5 Posts
Even with lotus.domino.*, it's not working.

As you said, I've added lotus.domino.* in my imports, but it does nothing. I still receive "HTTP JVM: java.lang.ClassCastException: lotus.domino.local.RichTextStyle incompatible with lotus.domino.cso.RichTextStyle".

 

RichTextStyle rtStyle = s.createRichTextStyle();

rtItem.appendStyle(rtStyle);   //Line that fails

 

All my imports are from the package lotus.domino.;

Jul 15, 2013, 6:16 AM
24 Posts
Some questions.

NCSO.jar is more for Java Applications which do not have Notes/Domino installed. So it shouldn't be used in an agent or in the Notes client. Instead use Notes.jar. Can you confirm if this is the case? If not you need to change it, as the Notes.jar would have priority in an agent.

If it is a Java Application, make sure you are also not referencing Notes.jar.  

Secondly, what is the crash stack you get? Just the FATAL stack from the NSD. 

 


This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal