TKlerx / android-sqlite-browser-for-eclipse

Automatically exported from code.google.com/p/android-sqlite-browser-for-eclipse
13 stars 4 forks source link

Failed to create the part's controls #4

Closed henriquedesousa closed 9 years ago

henriquedesousa commented 9 years ago

Hello, I'm using Android Device Monitor separately in Android Studio 1.3. I've put the AndroidSQLiteBrowser_1.0.1.jar in the plugins folder adt-bundle-mac-x86_64-20140702/sdk/tools/lib/monitor-x86_64/plugins and whenever I try to open SQLite Manager, the following error occurs. I'm using Oracle JDK8 in MacOSX 10.10.4. Can you help? Thanks in advance,

    java.lang.NullPointerException
        at com.questoid.sqlitebrowser.view.SqliteBrowserView.createPartControl(SqliteBrowserView.java:94)
        at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.createPartControl(CompatibilityPart.java:138)
        at org.eclipse.ui.internal.e4.compatibility.CompatibilityView.createPartControl(CompatibilityView.java:155)
        at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:313)
        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:497)
        at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
        at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:861)
        at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:841)
        at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:113)
        at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:321)
        at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:242)
        at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:161)
        at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:102)
        at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:71)
        at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:53)
        at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.createWidget(ContributedPartRenderer.java:141)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:894)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:629)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$6.run(PartRenderingEngine.java:520)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:505)
        at org.eclipse.e4.ui.workbench.renderers.swt.ElementReferenceRenderer.createWidget(ElementReferenceRenderer.java:74)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:894)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:629)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:731)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:702)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:696)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:681)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$1.handleEvent(PartRenderingEngine.java:130)
        at org.eclipse.e4.ui.services.internal.events.UIEventHandler$1.run(UIEventHandler.java:41)
        at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:180)
        at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:150)
        at org.eclipse.swt.widgets.Display.syncExec(Display.java:4607)
        at org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:187)
        at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:38)
        at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:197)
        at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:197)
        at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
        at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
        at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
        at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:135)
        at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:78)
        at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:39)
        at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:80)
        at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:58)
        at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374)
        at org.eclipse.e4.ui.model.application.ui.impl.UIElementImpl.setToBeRendered(UIElementImpl.java:290)
        at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.showElementInWindow(ModelServiceImpl.java:420)
        at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.bringToTop(ModelServiceImpl.java:389)
        at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.delegateBringToTop(PartServiceImpl.java:606)
        at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:579)
        at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:549)
        at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:538)
        at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.showPart(PartServiceImpl.java:1022)
        at org.eclipse.ui.internal.WorkbenchPage.showPart(WorkbenchPage.java:1171)
        at org.eclipse.ui.internal.WorkbenchPage.busyShowView(WorkbenchPage.java:1155)
        at org.eclipse.ui.internal.WorkbenchPage$9.run(WorkbenchPage.java:3749)
        at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
        at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage.java:3746)
        at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage.java:3721)
        at com.questoid.sqlitebrowser.SqliteBrowserPluginStartup$3$1.run(SqliteBrowserPluginStartup.java:150)
        at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:180)
        at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:150)
        at org.eclipse.swt.widgets.Display.syncExec(Display.java:4607)
        at com.questoid.sqlitebrowser.SqliteBrowserPluginStartup$3.run(SqliteBrowserPluginStartup.java:141)
        at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
        at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
        at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
        at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:452)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
        at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4136)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1458)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1481)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1466)
        at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1271)
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3982)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3621)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1053)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:942)
        at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
        at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:588)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:543)
        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
        at com.android.ide.eclipse.monitor.MonitorApplication.start(MonitorApplication.java:86)
        at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
        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:497)
        at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
TKlerx commented 9 years ago

Uhh... It seems like the table is not succesfully pulled from your device. I do not know the reason, yet.

Do you get any errors in the Ddm console like Failed to open database file ?

I will try to look into this, but my time is very rare at the moment, so it may take some time.

henriquedesousa commented 9 years ago

No, I don't get any errors in the Console -> DDMS.

More information: I have tried to open a database.db file from the /sdcard/ with SQLite Browser and the same issue occurs (I'm using a Genymotion emulator).

But I'm able to pull database files directly from /data/data using adb adb pull /data/data/cm.aptoide.pt.dev/databases/database.db and also from sdcard adb pull /sdcard/database.db

Is there a way for me to debug this? Can I just clone this and import into Eclipse? I can try to help you out. Thanks in advance.

henriquedesousa commented 9 years ago

I ran Eclipse Juno from console and I got this new Stacktrace:

  org.tmatesoft.sqljet.core.SqlJetException: CORRUPT: error code is CORRUPT
    at org.tmatesoft.sqljet.core.internal.schema.SqlJetSchema.readShema(SqlJetSchema.java:342)
    at org.tmatesoft.sqljet.core.internal.schema.SqlJetSchema.init(SqlJetSchema.java:168)
    at org.tmatesoft.sqljet.core.internal.schema.SqlJetSchema.<init>(SqlJetSchema.java:154)
    at org.tmatesoft.sqljet.core.table.SqlJetDb$2.runWithLock(SqlJetDb.java:249)
    at org.tmatesoft.sqljet.core.table.SqlJetDb.runWithLock(SqlJetDb.java:307)
    at org.tmatesoft.sqljet.core.table.SqlJetDb.readSchema(SqlJetDb.java:244)
    at org.tmatesoft.sqljet.core.table.SqlJetDb.refreshSchema(SqlJetDb.java:715)
    at org.tmatesoft.sqljet.core.table.SqlJetDb.getSchemaInternal(SqlJetDb.java:338)
    at org.tmatesoft.sqljet.core.table.SqlJetDb.getSchema(SqlJetDb.java:333)
    at com.questoid.sqlitebrowser.view.SqliteBrowserView.getSqlJetSchema(SqliteBrowserView.java:217)
    at com.questoid.sqlitebrowser.view.SqliteBrowserView.createPartControl(SqliteBrowserView.java:88)
    at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.createPartControl(CompatibilityPart.java:138)
    at org.eclipse.ui.internal.e4.compatibility.CompatibilityView.createPartControl(CompatibilityView.java:155)
    at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:313)
    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:497)
    at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
    at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:861)
    at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:841)
    at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:113)
    at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:321)
    at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:242)
    at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:161)
    at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:102)
    at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:71)
    at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:53)
    at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.createWidget(ContributedPartRenderer.java:141)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:894)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:629)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$6.run(PartRenderingEngine.java:520)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:505)
    at org.eclipse.e4.ui.workbench.renderers.swt.ElementReferenceRenderer.createWidget(ElementReferenceRenderer.java:74)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:894)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:629)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:731)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:702)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:696)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:681)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$1.handleEvent(PartRenderingEngine.java:130)
    at org.eclipse.e4.ui.services.internal.events.UIEventHandler$1.run(UIEventHandler.java:41)
    at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:180)
    at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:150)
    at org.eclipse.swt.widgets.Display.syncExec(Display.java:4607)
    at org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:187)
    at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:38)
    at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:197)
    at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:197)
    at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
    at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
    at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:135)
    at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:78)
    at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:39)
    at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:80)
    at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:58)
    at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374)
    at org.eclipse.e4.ui.model.application.ui.impl.UIElementImpl.setToBeRendered(UIElementImpl.java:290)
    at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.showElementInWindow(ModelServiceImpl.java:420)
    at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.bringToTop(ModelServiceImpl.java:389)
    at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.delegateBringToTop(PartServiceImpl.java:606)
    at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:579)
    at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:549)
    at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:538)
    at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.showPart(PartServiceImpl.java:1022)
    at org.eclipse.ui.internal.WorkbenchPage.showPart(WorkbenchPage.java:1171)
    at org.eclipse.ui.internal.WorkbenchPage.busyShowView(WorkbenchPage.java:1155)
    at org.eclipse.ui.internal.WorkbenchPage$9.run(WorkbenchPage.java:3749)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage.java:3746)
    at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage.java:3721)
    at com.questoid.sqlitebrowser.SqliteBrowserPluginStartup$3$1.run(SqliteBrowserPluginStartup.java:150)
    at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:180)
    at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:150)
    at org.eclipse.swt.widgets.Display.syncExec(Display.java:4607)
    at com.questoid.sqlitebrowser.SqliteBrowserPluginStartup$3.run(SqliteBrowserPluginStartup.java:141)
    at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
    at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
    at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
    at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:452)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4136)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1458)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1481)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1466)
    at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1271)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3982)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3621)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1053)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:942)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:588)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:543)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
    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:497)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1438)

I imported your source code to Eclipse, replaced SqlJet from 1.0.7 to 1.1.10 but when I exported the .jar and pasted in the plugins folder, it cannot be find in the Window -> View. I never developed an Eclipse plugin, so I dunno how to export the jar. Any pointers would be fine, thanks again!

henriquedesousa commented 9 years ago

Ok so I'm learning as I go, and using the provided SqlJet-1.0.7 we got the above error:

org.tmatesoft.sqljet.core.SqlJetException: CORRUPT: error code is CORRUPT at org.tmatesoft.sqljet.core.internal.schema.SqlJetSchema.readShema(SqlJetSchema.java:342)

The retrieval of the file from the device is working good, the private File dbFile; resolves to /Users/hsousa/sqlitedbfile.db.

Using the new SqlJet-1.1.10, the error is different:

    try {            
     final IWorkbenchPage activePage = fileExplorerView.getViewSite().getPage();
     Display.getDefault().syncExec( new Runnable() {
          public void run(){
             try {                                           
               SqliteBrowserView sqliteBrowserView = (SqliteBrowserView)activePage.findView(SqliteBrowserView.ID);
               if(sqliteBrowserView != null){
                 activePage.hideView(sqliteBrowserView);
               }                                             
               SqliteBrowserView.mExplorer = mExplorer;
               SqliteBrowserView.fileEntry = singleEntry;
               activePage.showView(SqliteBrowserView.ID); // Open the view with new db file
        } catch (Exception e) {                          
          e.printStackTrace();
        }
          }
        });
    }
    catch (Exception e) {            
       e.printStackTrace();
    }

We have SqlJetException in the attribution line 148 SqliteBrowserView.mExplorer = mExplorer; It amazes me, because the imports of the two variables are the same, but I've confirmed using Eclipe's Debug and it crashes right there.

I'm using an Android with 5.1.1 so maybe the SQLite Schema is different and unknown to SqlJet-1.0.7, but the weird error with the attribution in SqlJet-1.1.10 is really stopping me from continuing to help.

Hope this saves you some time, thanks again.

TKlerx commented 9 years ago

Thanks for your effort. I did some research and Android 5 ships with SQLite v. 3.8 As far as I can see, SqlJet only supports SQLite v. 3.6

So the task would be to change to another SQLite java library that supports SQLite v. 3.8 (e.g. sqlite4java). This migration would result in a lot of changes, I cannot make at the moment. I am sorry, but I don't see any quick solution so far :(

TKlerx commented 9 years ago

Btw this is a duplicate of #1 and #2 I did the import (from google code) just some months ago and forgot about this project. So changing to another SQLite library seems to be the solution.

henriquedesousa commented 9 years ago

Ok, that leaves us to Gingerbread only:

SQLite 3.8.4.3:

21-5.0-Lollipop

SQLite 3.7.11:

20-4.4W.2-Android Wear
19-4.4-KitKat
18-4.3-Jelly Bean
17-4.2-Jelly Bean
16-4.1-Jelly Bean

SQLite 3.7.4:

15-4.0.3-Ice Cream Sandwich
14-4.0-Ice Cream Sandwich
13-3.2-Honeycomb
12-3.1-Honeycomb
11-3.0-Honeycomb

SQLite 3.6.22:

10-2.3.3-Gingerbread
9-2.3.1-Gingerbread
8-2.2-Froyo

Again, thank you for your time, I'll keep doing sql queries from the shell, it's the only faster solution :) Best wishes and kind regards, hsousa

TKlerx commented 9 years ago

Ok, that is somehow frustrating. Maybe I will find the time to migrate to another SQLite library. So SqlJet was a bad choice :(

henriquedesousa commented 9 years ago

Well it was, but you didn't have a way to know that back at the time, right? Your effort is very honoring, and if you find the time to migrate you could set up a Donation button, I'm sure a lot of people will use and find your work very useful.

TKlerx commented 9 years ago

I uploaded a new version which misses some features but should work in general. I hacked a bit of code and it seems to work. Somehow I had to do this instead of other, more important things -.- Please let me know whether it works. New jar can be found in the release tab.

henriquedesousa commented 9 years ago

WOW it's opening now, very nice work, thanks! However one cannot browse the data due to the following error:

java.sql.SQLException: column 0 out of bounds [1,12] at org.sqlite.core.CoreResultSet.checkCol(CoreResultSet.java:84) at org.sqlite.core.CoreResultSet.markCol(CoreResultSet.java:97) at org.sqlite.jdbc3.JDBC3ResultSet.getString(JDBC3ResultSet.java:430) at com.questoid.sqlitebrowser.view.SqliteBrowserView.loadTableData(SqliteBrowserView.java:227) at com.questoid.sqlitebrowser.view.SqliteBrowserView.access$1(SqliteBrowserView.java:206) at com.questoid.sqlitebrowser.view.SqliteBrowserView$1.widgetSelected(SqliteBrowserView.java:138) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4136) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1458) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1481) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1466) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1271) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3982) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3621) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1053) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:942) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:588) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:543) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at com.android.ide.eclipse.monitor.MonitorApplication.start(MonitorApplication.java:86) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180) 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:497) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584) at org.eclipse.equinox.launcher.Main.run(Main.java:1438)

Seems that the boundaries are slighty off, because this happened on a 12 column table. Other tables are ocurring the same error, only changing the values:

java.sql.SQLException: column 0 out of bounds [1,2] java.sql.SQLException: column 0 out of bounds [1,1]

However this error only happens when I try to browse tables that DO have data. On empty tables this error is not triggered.

I have check the source, and it happens inside a for loop. Maybe jdbc wants the indexes to start at 1 ?

for (int i = 0; i < rsMeta.getColumnCount(); i++) {
    row[i] = rs.getString(i);
}

Thanks a lot again for you time, it really is valuable :) :+1:

henriquedesousa commented 9 years ago

In order to save you some time, I've forked, fixed the issue, and requested a pull. I've tested and it's now working fine. Thank you again !

TKlerx commented 9 years ago

You are right, of course, jdbc wants to start at 1, sorry. I only had an empty database available for testing. Thanks for testing and the Pull request.

henriquedesousa commented 9 years ago

Thank you. You should setup a donation button :+1: :)

TKlerx commented 9 years ago

I had a look at the donate buttons from paypal, etc. Most of them charge 30 cent per transaction, plus some relative fee (between 2% and 10%). As donations are usually small, and they charge a relatively big fixed amount, I will not setup a donation button.

Apart from that, I like the spirit of Open source that people are building stuff for other people and just giving it away for free. I am grateful for all the stuff being developed for Linux (and sometimes also windows) without paying any money. If people can reuse the stuff I did, than I am happy to help,