IBM / zopeneditor-about

IBM Z Open Editor: File issues here!
https://ibm.github.io/zopeneditor-about
Apache License 2.0
50 stars 20 forks source link

Output panel opens up and shows error when opening COBOL file #14

Closed dankox closed 4 years ago

dankox commented 4 years ago

vscode Version: 1.39.2 (user setup) Commit: 6ab598523be7a800d7f3eb4d92d7ab9a66069390 Date: 2019-10-15T15:35:18.241Z Electron: 4.2.10 Chrome: 69.0.3497.128 Node.js: 10.11.0 V8: 6.9.427.31-electron.0 OS: Windows_NT x64 10.0.18362

An error occurs, when opening a sample cobol program in vscode. Highlight works ok, but OUTPUT panel get focus and shows this error. My main problem is that the output panel shows up even if I don't want it, as I have there terminal. I guess that might be vscode issue (although I saw that they resolved it before).
But the issue with ClassDefFoundError is from cobol language server. So I'm attaching the error and also the sample of program where it happens.

steps to reproduce

  1. open a cobol file
  2. change language mode (ctrl+k m)
  3. choose cobol
  4. error...

error

[Error - 11:41:16 AM] Request textDocument/documentLink failed.
  Message: Internal error.
  Code: -32603 
java.util.concurrent.CompletionException: java.lang.NoClassDefFoundError: com/ibm/systemz/cobol/editor/core/parser/CobolParseController
    at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:273)
    at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:280)
    at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:604)
    at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577)
    at java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:443)
    at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
    at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
    at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
    at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Caused by: java.lang.NoClassDefFoundError: com/ibm/systemz/cobol/editor/core/parser/CobolParseController
    at com.ibm.lsp.cobol.core.handlers.DocumentLinkHandler.getDocumentLinks(DocumentLinkHandler.java:36)
    at com.ibm.lsp.cobol.core.CobolLanguageServer.lambda$5(CobolLanguageServer.java:209)
    at com.ibm.lsp.cobol.core.CobolLanguageServer$1.apply(CobolLanguageServer.java:302)
    at com.ibm.lsp.cobol.core.CobolLanguageServer$1.apply(CobolLanguageServer.java:1)
    at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602)
    ... 6 more
Caused by: java.lang.ClassNotFoundException: An error occurred while automatically activating bundle com.ibm.systemz.cobol.editor.core (22).
    at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:123)
    at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:505)
    at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:328)
    at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:392)
    at org.eclipse.osgi.internal.loader.sources.SingleSourcePackage.loadClass(SingleSourcePackage.java:36)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:466)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:419)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:411)
    at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 11 more
Caused by: org.osgi.framework.BundleException: Error starting module.
    at org.eclipse.osgi.container.Module.doStart(Module.java:590)
    at org.eclipse.osgi.container.Module.start(Module.java:449)
    at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:468)
    at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:114)
    ... 20 more
Caused by: java.lang.NoClassDefFoundError: org/eclipse/ui/plugin/AbstractUIPlugin
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
    at org.eclipse.osgi.internal.loader.ModuleClassLoader.defineClass(ModuleClassLoader.java:276)
    at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.defineClass(ClasspathManager.java:632)
    at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findClassImpl(ClasspathManager.java:555)
    at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClassImpl(ClasspathManager.java:514)
    at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:501)
    at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:328)
    at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:392)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:470)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:419)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:411)
    at org.eclipse.osgi.internal.framework.BundleContextImpl.loadBundleActivator(BundleContextImpl.java:762)
    at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:716)
    at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:1002)
    at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:354)
    at org.eclipse.osgi.container.Module.doStart(Module.java:581)
    ... 23 more
Caused by: java.lang.ClassNotFoundException: An error occurred while automatically activating bundle org.eclipse.ui.workbench (133).
    at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:123)
    at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:505)
    at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:328)
    at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:392)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:470)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:419)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:411)
    at org.eclipse.osgi.internal.framework.BundleContextImpl.loadBundleActivator(BundleContextImpl.java:762)
    at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:716)
    at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:1002)
    at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:354)
    at org.eclipse.osgi.container.Module.doStart(Module.java:581)
    at org.eclipse.osgi.container.Module.start(Module.java:449)
    at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:468)
    at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:114)
    at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:505)
    at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:328)
    at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:392)
    at org.eclipse.osgi.internal.loader.sources.SingleSourcePackage.loadClass(SingleSourcePackage.java:36)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:466)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:419)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:411)
    at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at com.ibm.lsp.cobol.core.handlers.DocumentSyncHandler.didOpen(DocumentSyncHandler.java:80)
    at com.ibm.lsp.cobol.core.CobolLanguageServer.didOpen(CobolLanguageServer.java:275)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:65)
    at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.notify(GenericEndpoint.java:152)
    at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleNotification(RemoteEndpoint.java:220)
    at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:187)
    at com.ibm.lsp.cobol.core.abilities.WatchLSPParent.lambda$0(WatchLSPParent.java:96)
    at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:192)
    at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94)
    at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:99)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: org.osgi.framework.BundleException: Error starting module.
    at org.eclipse.osgi.container.Module.doStart(Module.java:590)
    at org.eclipse.osgi.container.Module.start(Module.java:449)
    at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:468)
    at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:114)
    ... 42 more
Caused by: java.lang.NoClassDefFoundError: org/eclipse/swt/SWTError
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)
    at java.lang.Class.getConstructor0(Class.java:3075)
    at java.lang.Class.newInstance(Class.java:412)
    at org.eclipse.osgi.internal.framework.BundleContextImpl.loadBundleActivator(BundleContextImpl.java:763)
    at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:716)
    at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:1002)
    at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:354)
    at org.eclipse.osgi.container.Module.doStart(Module.java:581)
    ... 45 more
Caused by: java.lang.ClassNotFoundException: org.eclipse.swt.SWTError cannot be found by org.eclipse.ui.workbench_3.111.0.v20180524-1156
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:508)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:419)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:411)
    at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 54 more

program

000100 IDENTIFICATION DIVISION.                                                 
       PROGRAM-ID. FINAPP06.                                                    
000300 ENVIRONMENT DIVISION.                                                    
       INPUT-OUTPUT SECTION.                                                    
000500 FILE-CONTROL.                                                            
           SELECT REPORT-FILE ASSIGN U-T-SYSOUT.                                
           SELECT INPUT-FILE ASSIGN U-T-INPUT.                                  
000700 DATA DIVISION.                                                           
000800 FILE SECTION.                                                            
       FD REPORT-FILE                                                           
           LABEL RECORDS ARE OMITTED                                            
           RECORDING MODE IS F                                                  
           RECORD CONTAINS 133 CHARACTERS                                       
           DATA RECORD IS OUTPUT-RECORD.                                        
         01 OUTPUT-RECORD.                                                      
           02 CARRIAGE-CONTROL PIC X.                                           
           02 OUTPUT-LINE      PIC X(132).                                      
       FD INPUT-FILE                                                            
           LABEL RECORDS ARE STANDARD                                           
           RECORD CONTAINS 80 CHARACTERS                                        
           DATA RECORD IS INPUT-FILE-RECORD.                                    
         01 INPUT-FILE-RECORD.                                                  
           02 INPUT-FIELD1           PIC 9(8).                                  
           02 INPUT-FIELD2           PIC X(10).                                 
           02 INPUT-FIELD3           PIC X(20).                                 
           02 INPUT-FIELD4           PIC 9(6).                                  
           02 INPUT-FIELD5           PIC 9(6).                                  
           02 INPUT-FIELD6           PIC X(6).                                  
           02 FILLER                 PIC X(24).                                 
      ***THIS IS A CHANGE***********************************************        
       WORKING-STORAGE SECTION.                                                 
       COPY FINHDR1.                                                            
       01  PROGRAM-WORK-FIELDS.                                                 
           02  INPUT-SWITCH      PIC X(3).                                      
               88  END-OF-FILE   VALUE 'EOF'.                                   
           02  LINES-WRITTEN     PIC 9(3).                                      
               88  NEW-PAGE      VALUE 30.                                      
           02  PAGE-COUNT        PIC 9(3).                                      
       COPY FINPAG1.                                                            
       01  DATA-LINE.                                                           
           02  FILLER                PIC X(5).                                  
           02  OUTPUT-FIELD1         PIC ZZ,ZZZ,ZZ9.                            
           02  FILLER                PIC X(5).                                  
           02  OUTPUT-FIELD2         PIC X(10).                                 
           02  FILLER                PIC X(5).                                  
           02  OUTPUT-FIELD3         PIC X(20).                                 
           02  FILLER                PIC X(5).                                  
           02  OUTPUT-FIELD4         PIC ZZZ,ZZ9.                               
           02  FILLER                PIC X(5).                                  
           02  OUTPUT-FIELD5         PIC ZZZ,ZZ9.                               
           02  FILLER                PIC X(5).                                  
           02  OUTPUT-FIELD6         PIC ZZZ,ZZ9.                               
           02  FILLER                PIC X(5).                                  
           02  OUTPUT-TOTAL          PIC ZZZ,ZZZ,ZZZ,ZZZ,ZZ9.                   
           02  FILLER                PIC X(19).                                 
      ******************************************************************        
022000 PROCEDURE DIVISION.                                                      
           OPEN INPUT  INPUT-FILE                                               
                OUTPUT REPORT-FILE.                                             
           PERFORM GET-INPUT.                                                   
           PERFORM WRITE-AND-READ                                               
              UNTIL END-OF-FILE.                                                
           CLOSE INPUT-FILE                                                     
                 REPORT-FILE.                                                   
           GOBACK.                                                              
      ******************************************************************        
       GET-INPUT.                                                               
           READ INPUT-FILE AT END                                               
               MOVE 'EOF' TO INPUT-SWITCH.                                      
      ******************************************************************        
       WRITE-AND-READ.                                                          
           PERFORM WRITE-REPORT-LINE.                                           
           PERFORM GET-INPUT.                                                   
      ******************************************************************        
       WRITE-REPORT-LINE.                                                       
           IF NEW-PAGE                                                          
              PERFORM WRITE-HEADER                                              
              MOVE 2 TO LINE-SPACING.                                           
              MOVE LINE-SPACING TO CARRIAGE-CONTROL.                            
           MOVE INPUT-FIELD1 TO OUTPUT-FIELD1.                                  
           MOVE INPUT-FIELD2 TO OUTPUT-FIELD2.                                  
           MOVE INPUT-FIELD3 TO OUTPUT-FIELD3.                                  
           MOVE INPUT-FIELD4 TO OUTPUT-FIELD4.                                  
           MOVE INPUT-FIELD5 TO OUTPUT-FIELD5.                                  
           MOVE INPUT-FIELD6 TO OUTPUT-FIELD6.                                  
           COMPUTE OUTPUT-TOTAL =                                               
               INPUT-FIELD4 + INPUT-FIELD5 + INPUT-FIELD1.                      
           MOVE DATA-LINE TO OUTPUT-LINE.                                       
           WRITE OUTPUT-RECORD.                                                 
           ADD 1 TO LINES-WRITTEN.                                              
           MOVE 1 TO LINE-SPACING.                                              
           MOVE LINE-SPACING TO CARRIAGE-CONTROL.                               
      ******************************************************************        
       WRITE-HEADER.                                                            
           MOVE PAGE-SPACING TO CARRIAGE-CONTROL.                               
           ADD 1 TO PAGE-COUNT                                                  
           MOVE '     FINANCIAL REPORT         '   TO REPORT-TITLE.             
           MOVE PAGE-COUNT TO PAGE-NUMBER.                                      
           MOVE HEADER-RECORD TO OUTPUT-LINE.                                   
           WRITE OUTPUT-RECORD.                                                 
phaumer commented 4 years ago

@dankox what version of Java are you using? We require a full SDK of Java 8 or higher.

dankox commented 4 years ago

I have JDK 8 (not sure if that qualifies as full SDK):

java version "1.8.0_221" Java(TM) SE Runtime Environment (build 1.8.0_221-b11) Java HotSpot(TM) Client VM (build 25.221-b11, mixed mode, sharing)

I have in the same vscode ReadHat Java Language Support extension for running and debugging Java projects.

Also, I wouldn't even mind that error, but it focuses OUTPUT panel instead of my Terminal panel which I have opened. It sounds more like issue for vscode, but it doesn't happen with other extensions even if they have some errors. They write it into output panel but they don't bring it up.

phaumer commented 4 years ago

The call stack indicates that it is a Java Runtime issue. You need to install the 64bit Java SDK. It might also work with the Server JRE from Oracle. Another (preferred) alternative is to download the IBM Java linked in our online help. We will do more testing with the different JRE variants and update our documentation.

image

dankox commented 4 years ago

Just a comment, if somebody else finds this issue and wants to know more.

You can actually setup Java path in settings, it is zopeneditor.JAVA_HOME field in settings.json. This is useful if you have multiple Java version and don't want to swap them in path just because of this extension.

Or if you just want to disable the focus of the OUTPUT panel no matter what (as I wanted) and you are fine with just the highlighting functionality and no LSP, you can update the extension.js file in ~/.vscode/extensions/ibm.zopeneditor-0.3.11/dist directory where you replace revealOutputChannelOn:n.revealOutputChannelOn||p.Error with revealOutputChannelOn:4.

What this does, is it turns revealing output channel on error to never reveal it. Errors will be still logged, it just doesn't get the focus so you can work in Terminal or elsewhere.

zvookiejoo commented 4 years ago

The call stack indicates that it is a Java Runtime issue. You need to install the 64bit Java SDK. It might also work with the Server JRE from Oracle. Another (preferred) alternative is to download the IBM Java linked in our online help. We will do more testing with the different JRE variants and update our documentation.

image

I'm not possible to install 64-bit version of Java 8 JDK, only 32-bit.

jdk1.8.0_251 is not solving this issue.

What should I do?