java.lang.reflect.InvocationTargetException

Pentaho BI Platform Tracking | Fabien | 6 years ago
  1. 0

    For example, my repository tree is as follows: / (Root) | --- DIR1 | --- TRANSFORMATION1 | --- DIR2 For example, if I try to open TRANSFORMATION1 then I have a NullPointerException... This error doesn't happen when using a database repository. Full exception stack trace: java.lang.reflect.InvocationTargetException at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:381) at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:313) at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:495) at org.pentaho.di.ui.job.dialog.JobLoadProgressDialog.open(JobLoadProgressDialog.java:102) at org.pentaho.di.ui.spoon.Spoon.loadObjectFromRepository(Spoon.java:3315) at org.pentaho.di.ui.spoon.Spoon.access$18(Spoon.java:3290) at org.pentaho.di.ui.spoon.Spoon$19.open(Spoon.java:3236) at org.pentaho.di.ui.repository.repositoryexplorer.controllers.BrowseController.openContent(BrowseController.java:327) at org.pentaho.di.ui.repository.repositoryexplorer.controllers.BrowseController.onDoubleClick(BrowseController.java:614) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.pentaho.ui.xul.impl.AbstractXulDomContainer.invoke(AbstractXulDomContainer.java:317) at org.pentaho.ui.xul.impl.AbstractXulComponent.invoke(AbstractXulComponent.java:131) at org.pentaho.ui.xul.swt.tags.SwtTree.access$2100(SwtTree.java:102) at org.pentaho.ui.xul.swt.tags.SwtTree$12.doubleClick(SwtTree.java:584) at org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredViewer.java:799) at org.eclipse.jface.util.SafeRunnable$3.run(SafeRunnable.java:154) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:193) at org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(StructuredViewer.java:797) at org.eclipse.jface.viewers.StructuredViewer.handleDoubleSelect(StructuredViewer.java:1061) at org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(StructuredViewer.java:1173) at org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEvent(OpenStrategy.java:237) at org.eclipse.jface.util.OpenStrategy.access$0(OpenStrategy.java:234) at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:295) at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source) at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source) at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source) at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source) at org.eclipse.jface.window.Window.runEventLoop(Window.java:820) at org.eclipse.jface.window.Window.open(Window.java:796) at org.pentaho.ui.xul.swt.tags.SwtDialog.show(SwtDialog.java:353) at org.pentaho.ui.xul.swt.tags.SwtDialog.show(SwtDialog.java:279) at org.pentaho.di.ui.repository.repositoryexplorer.RepositoryExplorer.show(RepositoryExplorer.java:133) at org.pentaho.di.ui.spoon.Spoon$20$1.run(Spoon.java:3262) at org.eclipse.swt.widgets.RunnableLock.run(Unknown Source) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Unknown Source) at org.eclipse.swt.widgets.Display.runAsyncMessages(Unknown Source) at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source) at org.pentaho.di.ui.spoon.Spoon.readAndDispatch(Spoon.java:1147) at org.pentaho.di.ui.spoon.Spoon.start(Spoon.java:6627) at org.pentaho.di.ui.spoon.Spoon.main(Spoon.java:544) Caused by: java.lang.NullPointerException at org.pentaho.di.repository.filerep.KettleFileRepository.loadJob(KettleFileRepository.java:1150) at org.pentaho.di.ui.job.dialog.JobLoadProgressDialog$1.run(JobLoadProgressDialog.java:87) at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:369) ... 42 more I propose a patch to fix this problem : ### Eclipse Workspace Patch 1.0 #P Kettle trunk Index: src/org/pentaho/di/repository/filerep/KettleFileRepository.java =================================================================== --- src/org/pentaho/di/repository/filerep/KettleFileRepository.java (revision 14512) +++ src/org/pentaho/di/repository/filerep/KettleFileRepository.java (working copy) @@ -792,7 +792,7 @@ RepositoryDirectoryInterface directory = tree.findDirectory(idDirectory); String folderName = calcDirectoryName(directory); - String relativeFolderName = calcRelativeElementDirectory(directory); + FileObject folder = KettleVFS.getFileObject(folderName); for (FileObject child : folder.getChildren()) { @@ -803,7 +803,7 @@ String transName = name.substring(0, name.length()-4); - ObjectId id = new StringObjectId(calcObjectId(directory, relativeFolderName+transName, EXT_TRANSFORMATION)); + ObjectId id = new StringObjectId(calcObjectId(directory, transName, EXT_TRANSFORMATION)); Date date = new Date(child.getContent().getLastModifiedTime()); list.add( new RepositoryObject(id, transName, directory, "-", date, RepositoryObjectType.TRANSFORMATION, "", false) ); } @@ -826,7 +826,7 @@ RepositoryDirectoryInterface directory = tree.findDirectory(id_directory); String folderName = calcDirectoryName(directory); - String relativeFolderName = calcRelativeElementDirectory(directory); + FileObject folder = KettleVFS.getFileObject(folderName); for (FileObject child : folder.getChildren()) { @@ -837,7 +837,7 @@ String jobName = name.substring(0, name.length()-4); - ObjectId id = new StringObjectId(calcObjectId(directory, relativeFolderName+jobName, EXT_JOB)); + ObjectId id = new StringObjectId(calcObjectId(directory, jobName, EXT_JOB)); Date date = new Date(child.getContent().getLastModifiedTime()); list.add( new RepositoryObject(id, jobName, directory, "-", date, RepositoryObjectType.JOB, "", false) ); } @@ -1147,11 +1147,27 @@ name = name.substring(0, name.length()-fname.getExtension().length()-1); } - String filePath = fileObject.getParent().getName().getPath(); - String dirPath = filePath.substring(repositoryMeta.getBaseDirectory().length()); + String dirPath = fileObject.getParent().getName().getBaseName(); + String absoluteDirPath = fileObject.getParent().getName().getURI(); + if(absoluteDirPath.startsWith("file:///")) + { + absoluteDirPath = absoluteDirPath.substring("file:///".length()); + } + + String pathBase = repositoryMeta.getBaseDirectory(); + + if(!absoluteDirPath.equals(pathBase)) + { + dirPath = absoluteDirPath.substring(pathBase.length() +1); + } + else + { + dirPath = "/"; + } + RepositoryDirectoryInterface directory = loadRepositoryDirectoryTree().findDirectory(dirPath); Date lastModified = new Date(fileObject.getContent().getLastModifiedTime()); - + return new RepositoryObject(objectId, name, directory, "-", lastModified, objectType, "", false); } catch(Exception e) {

    Pentaho BI Platform Tracking | 6 years ago | Fabien
    java.lang.reflect.InvocationTargetException
  2. 0

    For example, my repository tree is as follows: / (Root) | --- DIR1 | --- TRANSFORMATION1 | --- DIR2 For example, if I try to open TRANSFORMATION1 then I have a NullPointerException... This error doesn't happen when using a database repository. Full exception stack trace: java.lang.reflect.InvocationTargetException at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:381) at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:313) at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:495) at org.pentaho.di.ui.job.dialog.JobLoadProgressDialog.open(JobLoadProgressDialog.java:102) at org.pentaho.di.ui.spoon.Spoon.loadObjectFromRepository(Spoon.java:3315) at org.pentaho.di.ui.spoon.Spoon.access$18(Spoon.java:3290) at org.pentaho.di.ui.spoon.Spoon$19.open(Spoon.java:3236) at org.pentaho.di.ui.repository.repositoryexplorer.controllers.BrowseController.openContent(BrowseController.java:327) at org.pentaho.di.ui.repository.repositoryexplorer.controllers.BrowseController.onDoubleClick(BrowseController.java:614) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.pentaho.ui.xul.impl.AbstractXulDomContainer.invoke(AbstractXulDomContainer.java:317) at org.pentaho.ui.xul.impl.AbstractXulComponent.invoke(AbstractXulComponent.java:131) at org.pentaho.ui.xul.swt.tags.SwtTree.access$2100(SwtTree.java:102) at org.pentaho.ui.xul.swt.tags.SwtTree$12.doubleClick(SwtTree.java:584) at org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredViewer.java:799) at org.eclipse.jface.util.SafeRunnable$3.run(SafeRunnable.java:154) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:193) at org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(StructuredViewer.java:797) at org.eclipse.jface.viewers.StructuredViewer.handleDoubleSelect(StructuredViewer.java:1061) at org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(StructuredViewer.java:1173) at org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEvent(OpenStrategy.java:237) at org.eclipse.jface.util.OpenStrategy.access$0(OpenStrategy.java:234) at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:295) at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source) at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source) at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source) at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source) at org.eclipse.jface.window.Window.runEventLoop(Window.java:820) at org.eclipse.jface.window.Window.open(Window.java:796) at org.pentaho.ui.xul.swt.tags.SwtDialog.show(SwtDialog.java:353) at org.pentaho.ui.xul.swt.tags.SwtDialog.show(SwtDialog.java:279) at org.pentaho.di.ui.repository.repositoryexplorer.RepositoryExplorer.show(RepositoryExplorer.java:133) at org.pentaho.di.ui.spoon.Spoon$20$1.run(Spoon.java:3262) at org.eclipse.swt.widgets.RunnableLock.run(Unknown Source) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Unknown Source) at org.eclipse.swt.widgets.Display.runAsyncMessages(Unknown Source) at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source) at org.pentaho.di.ui.spoon.Spoon.readAndDispatch(Spoon.java:1147) at org.pentaho.di.ui.spoon.Spoon.start(Spoon.java:6627) at org.pentaho.di.ui.spoon.Spoon.main(Spoon.java:544) Caused by: java.lang.NullPointerException at org.pentaho.di.repository.filerep.KettleFileRepository.loadJob(KettleFileRepository.java:1150) at org.pentaho.di.ui.job.dialog.JobLoadProgressDialog$1.run(JobLoadProgressDialog.java:87) at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:369) ... 42 more I propose a patch to fix this problem : ### Eclipse Workspace Patch 1.0 #P Kettle trunk Index: src/org/pentaho/di/repository/filerep/KettleFileRepository.java =================================================================== --- src/org/pentaho/di/repository/filerep/KettleFileRepository.java (revision 14512) +++ src/org/pentaho/di/repository/filerep/KettleFileRepository.java (working copy) @@ -792,7 +792,7 @@ RepositoryDirectoryInterface directory = tree.findDirectory(idDirectory); String folderName = calcDirectoryName(directory); - String relativeFolderName = calcRelativeElementDirectory(directory); + FileObject folder = KettleVFS.getFileObject(folderName); for (FileObject child : folder.getChildren()) { @@ -803,7 +803,7 @@ String transName = name.substring(0, name.length()-4); - ObjectId id = new StringObjectId(calcObjectId(directory, relativeFolderName+transName, EXT_TRANSFORMATION)); + ObjectId id = new StringObjectId(calcObjectId(directory, transName, EXT_TRANSFORMATION)); Date date = new Date(child.getContent().getLastModifiedTime()); list.add( new RepositoryObject(id, transName, directory, "-", date, RepositoryObjectType.TRANSFORMATION, "", false) ); } @@ -826,7 +826,7 @@ RepositoryDirectoryInterface directory = tree.findDirectory(id_directory); String folderName = calcDirectoryName(directory); - String relativeFolderName = calcRelativeElementDirectory(directory); + FileObject folder = KettleVFS.getFileObject(folderName); for (FileObject child : folder.getChildren()) { @@ -837,7 +837,7 @@ String jobName = name.substring(0, name.length()-4); - ObjectId id = new StringObjectId(calcObjectId(directory, relativeFolderName+jobName, EXT_JOB)); + ObjectId id = new StringObjectId(calcObjectId(directory, jobName, EXT_JOB)); Date date = new Date(child.getContent().getLastModifiedTime()); list.add( new RepositoryObject(id, jobName, directory, "-", date, RepositoryObjectType.JOB, "", false) ); } @@ -1147,11 +1147,27 @@ name = name.substring(0, name.length()-fname.getExtension().length()-1); } - String filePath = fileObject.getParent().getName().getPath(); - String dirPath = filePath.substring(repositoryMeta.getBaseDirectory().length()); + String dirPath = fileObject.getParent().getName().getBaseName(); + String absoluteDirPath = fileObject.getParent().getName().getURI(); + if(absoluteDirPath.startsWith("file:///")) + { + absoluteDirPath = absoluteDirPath.substring("file:///".length()); + } + + String pathBase = repositoryMeta.getBaseDirectory(); + + if(!absoluteDirPath.equals(pathBase)) + { + dirPath = absoluteDirPath.substring(pathBase.length() +1); + } + else + { + dirPath = "/"; + } + RepositoryDirectoryInterface directory = loadRepositoryDirectoryTree().findDirectory(dirPath); Date lastModified = new Date(fileObject.getContent().getLastModifiedTime()); - + return new RepositoryObject(objectId, name, directory, "-", lastModified, objectType, "", false); } catch(Exception e) {

    Pentaho BI Platform Tracking | 6 years ago | Fabien
    java.lang.reflect.InvocationTargetException
  3. 0

    Android: Saving Map State in Google map

    Stack Overflow | 11 months ago | Junie Negentien
    java.lang.RuntimeException: Unable to resume activity {com.ourThesis.junieNegentien2015/com.ourThesis.junieNegentien2015.MainActivity}: java.lang.NullPointerException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at org.pentaho.di.repository.filerep.KettleFileRepository.loadJob()
    2. org.pentaho.di
      JobLoadProgressDialog$1.run
      1. org.pentaho.di.repository.filerep.KettleFileRepository.loadJob(KettleFileRepository.java:1150)
      2. org.pentaho.di.ui.job.dialog.JobLoadProgressDialog$1.run(JobLoadProgressDialog.java:87)
      2 frames
    3. JFace
      ProgressMonitorDialog.run
      1. org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:369)
      2. org.eclipse.jface.operation.ModalContext.run(ModalContext.java:313)
      3. org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:495)
      3 frames
    4. org.pentaho.di
      BrowseController.onDoubleClick
      1. org.pentaho.di.ui.job.dialog.JobLoadProgressDialog.open(JobLoadProgressDialog.java:102)
      2. org.pentaho.di.ui.spoon.Spoon.loadObjectFromRepository(Spoon.java:3315)
      3. org.pentaho.di.ui.spoon.Spoon.access$18(Spoon.java:3290)
      4. org.pentaho.di.ui.spoon.Spoon$19.open(Spoon.java:3236)
      5. org.pentaho.di.ui.repository.repositoryexplorer.controllers.BrowseController.openContent(BrowseController.java:327)
      6. org.pentaho.di.ui.repository.repositoryexplorer.controllers.BrowseController.onDoubleClick(BrowseController.java:614)
      6 frames
    5. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      4. java.lang.reflect.Method.invoke(Unknown Source)
      4 frames
    6. org.pentaho.ui
      SwtTree$12.doubleClick
      1. org.pentaho.ui.xul.impl.AbstractXulDomContainer.invoke(AbstractXulDomContainer.java:317)
      2. org.pentaho.ui.xul.impl.AbstractXulComponent.invoke(AbstractXulComponent.java:131)
      3. org.pentaho.ui.xul.swt.tags.SwtTree.access$2100(SwtTree.java:102)
      4. org.pentaho.ui.xul.swt.tags.SwtTree$12.doubleClick(SwtTree.java:584)
      4 frames
    7. JFace
      OpenStrategy$1.handleEvent
      1. org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredViewer.java:799)
      2. org.eclipse.jface.util.SafeRunnable$3.run(SafeRunnable.java:154)
      3. org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:193)
      4. org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(StructuredViewer.java:797)
      5. org.eclipse.jface.viewers.StructuredViewer.handleDoubleSelect(StructuredViewer.java:1061)
      6. org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(StructuredViewer.java:1173)
      7. org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEvent(OpenStrategy.java:237)
      8. org.eclipse.jface.util.OpenStrategy.access$0(OpenStrategy.java:234)
      9. org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:295)
      9 frames
    8. RWT
      Display.readAndDispatch
      1. org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
      2. org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
      3. org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
      4. org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
      4 frames
    9. JFace
      Window.open
      1. org.eclipse.jface.window.Window.runEventLoop(Window.java:820)
      2. org.eclipse.jface.window.Window.open(Window.java:796)
      2 frames
    10. org.pentaho.ui
      SwtDialog.show
      1. org.pentaho.ui.xul.swt.tags.SwtDialog.show(SwtDialog.java:353)
      2. org.pentaho.ui.xul.swt.tags.SwtDialog.show(SwtDialog.java:279)
      2 frames
    11. org.pentaho.di
      Spoon$20$1.run
      1. org.pentaho.di.ui.repository.repositoryexplorer.RepositoryExplorer.show(RepositoryExplorer.java:133)
      2. org.pentaho.di.ui.spoon.Spoon$20$1.run(Spoon.java:3262)
      2 frames
    12. RWT
      Display.readAndDispatch
      1. org.eclipse.swt.widgets.RunnableLock.run(Unknown Source)
      2. org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Unknown Source)
      3. org.eclipse.swt.widgets.Display.runAsyncMessages(Unknown Source)
      4. org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
      4 frames
    13. org.pentaho.di
      Spoon.main
      1. org.pentaho.di.ui.spoon.Spoon.readAndDispatch(Spoon.java:1147)
      2. org.pentaho.di.ui.spoon.Spoon.start(Spoon.java:6627)
      3. org.pentaho.di.ui.spoon.Spoon.main(Spoon.java:544)
      3 frames