Ls2j Error Null Java Object
Training Support Forums & community Events Rational Tivoli WebSphere Java technology Linux Open source SOA and Web services Web development XML My developerWorks About dW Submit content Feedback developerWorks>Lotus>Forums & community>IBM Lotus Notes/Domino 8.5 Forum (includes Lotus Notes Traveler) IBM Lotus Notes/Domino 8.5 Forum (includes Lotus Notes Traveler) Sign in to participate Subject: Error 314 - LS2J Error: Null Java object error using Java Library Feedback Type: Problem Product Area: Domino Designer on Eclipse (DDE) Technical Area: Application Development Platform: Windows Release: 8.5.2 Reproducible: Always I am using LS2J accessing a Java Library I have created. When I attempt to access the Java class in LotusScript, I continually receive this error: LS2J Error: Null Java object I searched using Google, but nothing really explains the error or has a solution. Error 314 is listed on this link, but no explanation: http://www-10.lotus.com/ldd/ddwiki.nsf/dx/10232008120902PMDDRQG7.htm Here is the LotusScript: Function IsTemplateValid(fileName As String) As Integer On Error Goto ProcessError Dim jSession As JavaSession Dim jClass As JavaClass Dim jObj As JavaObject Dim message As String Dim returnText As String Dim templateVersion As String Dim fieldValue As String Dim checkRow As String Dim checkColumn As String Dim splitValues As Variant 'Get the parameters to send... templateVersion = GetKeywordDocValue("Spreadsheet Process: Template Version")(0) fieldValue = GetKeywordDocValue("Spreadsheet Process: Template Version Cell")(0) splitValues = Split(fieldValue, delimiter) checkRow = splitValues(0) checkColumn = splitValues(1) 'Need to use Java to send URL and get return... Set jSession = New JavaSession() Set jClass = jSession.GetClass("globalSpreadsheet") Set jObj = jClass.CreateObject **** ERROR IS HERE **** returnText = jObj.validateSpreadsheet(fileName, templateVersion, checkRow, checkColumn) If returnText = "Valid" Then IsTemplateValid = True Else IsTemplateValid = False End If Exit Function ProcessError: message = "Error (" & Cstr(Err) & "): " & Error$ & " on line " & Cstr(Erl) & " in BillCode: " & Lsi_info(2) & "." Messagebox message, 16, "Error In Processing..." Exit Function End Function Here is the Jav
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up I can't open a database because the http://www-10.lotus.com/ldd/nd85forum.nsf/0/a09a7f600fe46d788525782500554e49?OpenDocument session is always null up vote 0 down vote favorite I want to create a log for all my webservices. I have the log in java, it works. I want to do the same thing in Lotus Domino using the java's class I do with LS2J class. It works to compil my java class and the ls2j code. When i try to call this java in lotus http://stackoverflow.com/questions/24608540/i-cant-open-a-database-because-the-session-is-always-null it works ! But i have a null value when i call it in java with the getter ! Class GetAllDocuments Private logDTO As LogWSDTO Private objectJavaA As JAVAOBJECT Private a As LogWebService Private db As NotesDatabase Public Sub New() Set logDTO = New LogWSDTO() Set a = New LogWebService() Set objectJavaA = a.getJavaObject End Sub Public Function GetAllDocuments() call logDTO.setNomBaseNotesWS(db.FileName) objectJavaA.setLog(logDTO.getJavaObject()) End Function I have a class in lotus which called my java class : UseLSX "*javacon" Class LogWSDTO sessionJava As JAVASESSION classJava As JAVACLASS objectJava As JAVAOBJECT methodJava As JAVAMETHOD Public Sub New() Set sessionJava = New JAVASESSION Set classJava = sessionJava.GetClass("com.pasquier.DTO.WS/LogWSDTO") Set objectJava = classJava.CreateObject End Sub Public Function getNomBaseNotesWS() Set methodJava = classJava.GetMethod("getNomBaseNotesWS","()Ljava/lang/String;") getNomBaseNotesWS = objectJava.getNomBaseNotesWS() End Function Public Sub setNomBaseNotesWS(nomBaseNotesWS As String) Set methodJava = classJava.GetMethod("setNomBaseNotesWS","(Ljava/lang/String;)V") objectJava.setNomBaseNotesWS(nomBaseNotesWS) End Sub In java : I can't have to have a session, this is always null public void setLog(LogWSDTO log) { System.out.println("entrée java"); System.out.println(log.getNomBaseNotesWS()); <== I Have the data !! this.logDTO = log; if (session == null) { System.out.println("alert !"); session = session.getSession(); <== it doesn't compil i pass it in comment to test System.out.println("alert !"); } System.out.println("Session :" + session ); } the result is
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss http://stackoverflow.com/questions/24432443/how-pass-an-objet-in-parameter-of-another-class-in-ls2j the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow https://turumbay.wordpress.com/2011/05/03/ls2j-bridge-and-notes-session/ Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each ls2j error other. Join them; it only takes a minute: Sign up how pass an objet in parameter of another class in LS2J? up vote 2 down vote favorite I am trying to pass an object of a java class (a bean) to another class with LS2J. The problem is that an error is returned : LS2J Error: Threw java.lang.ClassNotFoundException: ls2j error null com.pasquier.DTO.WS.LogWSDTO I don't know why ? I have a class bean normally with getter and setter. I want to pass an instance of this class in another. My class in Lotus LS2J : Class LogWebService sessionJava As JAVASESSION classJava As JAVACLASS objectJava As JAVAOBJECT methodJava As JAVAMETHOD Public Sub New() Set sessionJava = New JAVASESSION Set classJava = sessionJava.GetClass("com.pasquier.launcher/LogWebService") Set objectJava = classJava.CreateObject End Sub Public Sub setLog(logDTO As LogWSDTO) Set methodJava = classJava.GetMethod("setLog","(Lcom/pasquier/DTO/WS/LogWSDTO;)V") objectJava.setLog(logDTO) End Sub End Class It is the method setLog which crashes I call it in the code : Class LogGetAllDocumentsDAO Private ilog As LogWebService Private logDTO As LogWSDTO Private docDTO As LogGetAllDocumentsDTO Public Sub New(logWSparam As LogWSDTO, docDTOparam As LogGetAllDocumentsDTO) Set Me.logDTO = logWSparam Set Me.docDTO = docDTOparam End Sub Public Sub appelLog() Set ilog = New LogWebService() ' error: LS2J Error: Threw java.lang.ClassNotFoundException: com.pasquier.DTO.WS.LogWSDTO Call ilog.setLog(logDTO) End Sub an idea ? i have a class LogDTO in the same library than LogWebService. Class LogWSDTO sessionJava As JAVASESSION classJava As JAVACLASS objectJava As JAVAOBJECT methodJava As JAVAMETHOD Pu
объекты при работе через LS2J При попытке вызова NotesFactory.createSession() в java коде, вызванном через бридж, бросается исключение NotesException: Cannot create a session from an agent. Поверхностное гугление подтверждает этот вывод: Julie Kadashevich ( Software Engineer, IBM ), в своем посте на форуме IBM прямо отвечает на вопрос о возможности создания domino объектов в LS2J: this is an architectural limitation Г-же Кадашевич можно доверять - она явно не случайный пассажир на форуме ibm. Если честно, доступ к доминошным объекта в ls2j не особо и нужен: предполагается, что манипуляции над domino объектами нужно производить lotusscript, а java bridge подключается для решения вспомогательных задач, которые не могут быть эффективно решены на ls. В качестве примеров использование LS2J можно привести: использование регулярных выражений работа с буфером обмена обработка изображений работа с Zip архивами Неплохая подборка есть на nsftools Появление LS2J значительно упростило жизнь разработчику. Однако, при пользовании нужно помнить про ограничения, упомянутые в хелпе и про то, что мы не можем использовать notes объекты при работе через LS2J Или все-таки можем?😉 Цитата из хелпа дизайнера There are a few limitations with LS2J: You may not delete a Variant containing a JavaClass object. There are some data type limitations (see Data type mappings). LotusScript property names are case insensitive, but Java property names are case sensitive. If two J