10 Replies Latest reply on Jan 8, 2005 12:28 PM by mikezzz

    Advanced Heap Protection (patch kinda...)

      Hi,

      I have added a file (streamstore.zip) to the JBoss Mail Services patch page that contains a first whack at a stream store to support the advanced heap protection mechanism specfied on the Wiki. The file contains only new files (i.e. not actually a patch) and all of the additional libraries required to support the store implementations (mysql connector 3.1.5, sleepy cat db, apache commons db).

      The key interfaces are the Store and the StoreFactory which are stateless interfaces to provide access to the underlying store. InputStream and OutputStream implementations that utilise the store are also provided. There are currently 2 store implementations. One via a jdbc3 style blob, which has been tested with mysql (requires mysql connector 3.1.5 as 3.0 doesn't support in place blob updates). The other uses Sleepycat Berkley DB, which I preferred over a custom file based persistence mechanism.

      JUnits are supplied for both store implementations. The store is not yet integrated with the implementation of the SMTP Mail object. I will look into doing this after M2 is released.

      Comments, questions, etc. are welcome.

      Regards,
      Mike.

      P.S. Didn't submit the file as an actual patch as I can't get 'cvs diff' to handle new files.

        • 1. Re: Problem using JBoss IDE 1.4.0 with AOP Extension

          I am having a similar problem with a JBoss EJB project inside of Eclipse 3.0.1 w/JBoss AOP 1.0.1 plugin, JBossIDE 1.4.0, and J2SE 1.5.0. As soon as I applied interceptors to a single EJB method, my workspace was eaten and the JBossAOP views now produce this message and following exceptions when activated:

          Unable to instantiate view:
          org.jboss.ide.eclipse.jdt.aop.ui.views.AspectManagerView

          Reason:
          Unable to instantiate view:
          org.jboss.ide.eclipse.jdt.aop.ui.views.AspectManagerView

          Error Log:

          java.lang.ClassNotFoundException: org.jboss.ide.eclipse.jdt.aop.ui.views.AspectManagerView
          at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:404)
          at org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader.loadClass(AbstractClassLoader.java:93)
          at java.lang.ClassLoader.loadClass(Unknown Source)
          at org.eclipse.osgi.framework.internal.core.BundleLoader.loadClass(BundleLoader.java:307)
          at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:336)
          at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1313)
          at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:131)
          at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:124)
          at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:113)
          at org.eclipse.ui.internal.WorkbenchPlugin$1.run(WorkbenchPlugin.java:196)
          at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
          at org.eclipse.ui.internal.WorkbenchPlugin.createExtension(WorkbenchPlugin.java:193)
          at org.eclipse.ui.internal.registry.ViewDescriptor.createView(ViewDescriptor.java:76)
          at org.eclipse.ui.internal.ViewFactory$1.run(ViewFactory.java:301)
          at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:616)
          at org.eclipse.core.runtime.Platform.run(Platform.java:747)
          at org.eclipse.ui.internal.ViewFactory.busyRestoreView(ViewFactory.java:273)
          at org.eclipse.ui.internal.ViewFactory$2.run(ViewFactory.java:530)
          at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
          at org.eclipse.ui.internal.ViewFactory.restoreView(ViewFactory.java:528)
          at org.eclipse.ui.internal.Perspective.showView(Perspective.java:1593)
          at org.eclipse.ui.internal.WorkbenchPage.busyShowView(WorkbenchPage.java:773)
          at org.eclipse.ui.internal.WorkbenchPage.access$9(WorkbenchPage.java:753)
          at org.eclipse.ui.internal.WorkbenchPage$13.run(WorkbenchPage.java:3051)
          at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
          at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage.java:3048)
          at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage.java:3028)
          at org.eclipse.ui.internal.ShowViewMenu.showOther(ShowViewMenu.java:204)
          at org.eclipse.ui.internal.ShowViewMenu$2.run(ShowViewMenu.java:68)
          at org.eclipse.jface.action.Action.runWithEvent(Action.java:881)
          at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:915)
          at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:866)
          at org.eclipse.jface.action.ActionContributionItem$7.handleEvent(ActionContributionItem.java:785)
          at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82)
          at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:796)
          at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2772)
          at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2431)
          at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1377)
          at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1348)
          at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:254)
          at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:141)
          at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:96)
          at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:335)
          at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:273)
          at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:129)
          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.eclipse.core.launcher.Main.basicRun(Main.java:185)
          at org.eclipse.core.launcher.Main.run(Main.java:704)
          at org.eclipse.core.launcher.Main.main(Main.java:688)

          org.osgi.framework.BundleException: Exception in org.jboss.ide.eclipse.jdt.aop.ui.AopUiPlugin.start() of bundle org.jboss.ide.eclipse.jdt.aop.ui.
          at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:975)
          at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:937)
          at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:421)
          at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:293)
          at org.eclipse.core.runtime.adaptor.EclipseClassLoader.findLocalClass(EclipseClassLoader.java:110)
          at org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(BundleLoader.java:371)
          at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:402)
          at org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader.loadClass(AbstractClassLoader.java:93)
          at java.lang.ClassLoader.loadClass(Unknown Source)
          at org.eclipse.osgi.framework.internal.core.BundleLoader.loadClass(BundleLoader.java:307)
          at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:336)
          at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1313)
          at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:131)
          at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:124)
          at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:113)
          at org.eclipse.ui.internal.WorkbenchPlugin$1.run(WorkbenchPlugin.java:196)
          at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
          at org.eclipse.ui.internal.WorkbenchPlugin.createExtension(WorkbenchPlugin.java:193)
          at org.eclipse.ui.internal.registry.ViewDescriptor.createView(ViewDescriptor.java:76)
          at org.eclipse.ui.internal.ViewFactory$1.run(ViewFactory.java:301)
          at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:616)
          at org.eclipse.core.runtime.Platform.run(Platform.java:747)
          at org.eclipse.ui.internal.ViewFactory.busyRestoreView(ViewFactory.java:273)
          at org.eclipse.ui.internal.ViewFactory$2.run(ViewFactory.java:530)
          at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
          at org.eclipse.ui.internal.ViewFactory.restoreView(ViewFactory.java:528)
          at org.eclipse.ui.internal.Perspective.showView(Perspective.java:1593)
          at org.eclipse.ui.internal.WorkbenchPage.busyShowView(WorkbenchPage.java:773)
          at org.eclipse.ui.internal.WorkbenchPage.access$9(WorkbenchPage.java:753)
          at org.eclipse.ui.internal.WorkbenchPage$13.run(WorkbenchPage.java:3051)
          at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
          at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage.java:3048)
          at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage.java:3028)
          at org.eclipse.ui.internal.ShowViewMenu.showOther(ShowViewMenu.java:204)
          at org.eclipse.ui.internal.ShowViewMenu$2.run(ShowViewMenu.java:68)
          at org.eclipse.jface.action.Action.runWithEvent(Action.java:881)
          at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:915)
          at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:866)
          at org.eclipse.jface.action.ActionContributionItem$7.handleEvent(ActionContributionItem.java:785)
          at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82)
          at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:796)
          at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2772)
          at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2431)
          at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1377)
          at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1348)
          at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:254)
          at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:141)
          at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:96)
          at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:335)
          at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:273)
          at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:129)
          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.eclipse.core.launcher.Main.basicRun(Main.java:185)
          at org.eclipse.core.launcher.Main.run(Main.java:704)
          at org.eclipse.core.launcher.Main.main(Main.java:688)
          Caused by: java.lang.NoClassDefFoundError: javax/ejb/EJBLocalHome
          at java.lang.ClassLoader.defineClass1(Native Method)
          at java.lang.ClassLoader.defineClass(Unknown Source)
          at java.security.SecureClassLoader.defineClass(Unknown Source)
          at java.net.URLClassLoader.defineClass(Unknown Source)
          at java.net.URLClassLoader.access$100(Unknown Source)
          at java.net.URLClassLoader$1.run(Unknown Source)
          at java.security.AccessController.doPrivileged(Native Method)
          at java.net.URLClassLoader.findClass(Unknown Source)
          at java.lang.ClassLoader.loadClass(Unknown Source)
          at java.lang.ClassLoader.loadClass(Unknown Source)
          at org.jboss.ide.eclipse.jdt.aop.core.util.JaxbReportUtil.loadFile(JaxbReportUtil.java:124)
          at org.jboss.ide.eclipse.jdt.aop.core.util.JaxbReportUtil.access$0(JaxbReportUtil.java:112)
          at org.jboss.ide.eclipse.jdt.aop.core.util.JaxbReportUtil$1.visit(JaxbReportUtil.java:87)
          at org.eclipse.core.internal.resources.Resource$2.visit(Resource.java:108)
          at org.eclipse.core.internal.resources.Resource$1.visitElement(Resource.java:55)
          at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:78)
          at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:82)
          at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:82)
          at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:82)
          at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:82)
          at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:82)
          at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:82)
          at org.eclipse.core.internal.watson.ElementTreeIterator.iterate(ElementTreeIterator.java:123)
          at org.eclipse.core.internal.resources.Resource.accept(Resource.java:65)
          at org.eclipse.core.internal.resources.Resource.accept(Resource.java:106)
          at org.eclipse.core.internal.resources.Resource.accept(Resource.java:85)
          at org.jboss.ide.eclipse.jdt.aop.core.util.JaxbReportUtil.getAopReport(JaxbReportUtil.java:80)
          at org.jboss.ide.eclipse.jdt.aop.core.AopCorePlugin.updateProjectReport(AopCorePlugin.java:435)
          at org.jboss.ide.eclipse.jdt.aop.ui.AopUiPlugin.start(AopUiPlugin.java:73)
          at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:958)
          at java.security.AccessController.doPrivileged(Native Method)
          at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:954)
          ... 57 more
          Root exception:
          java.lang.NoClassDefFoundError: javax/ejb/EJBLocalHome
          at java.lang.ClassLoader.defineClass1(Native Method)
          at java.lang.ClassLoader.defineClass(Unknown Source)
          at java.security.SecureClassLoader.defineClass(Unknown Source)
          at java.net.URLClassLoader.defineClass(Unknown Source)
          at java.net.URLClassLoader.access$100(Unknown Source)
          at java.net.URLClassLoader$1.run(Unknown Source)
          at java.security.AccessController.doPrivileged(Native Method)
          at java.net.URLClassLoader.findClass(Unknown Source)
          at java.lang.ClassLoader.loadClass(Unknown Source)
          at java.lang.ClassLoader.loadClass(Unknown Source)
          at org.jboss.ide.eclipse.jdt.aop.core.util.JaxbReportUtil.loadFile(JaxbReportUtil.java:124)
          at org.jboss.ide.eclipse.jdt.aop.core.util.JaxbReportUtil.access$0(JaxbReportUtil.java:112)
          at org.jboss.ide.eclipse.jdt.aop.core.util.JaxbReportUtil$1.visit(JaxbReportUtil.java:87)
          at org.eclipse.core.internal.resources.Resource$2.visit(Resource.java:108)
          at org.eclipse.core.internal.resources.Resource$1.visitElement(Resource.java:55)
          at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:78)
          at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:82)
          at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:82)
          at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:82)
          at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:82)
          at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:82)
          at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:82)
          at org.eclipse.core.internal.watson.ElementTreeIterator.iterate(ElementTreeIterator.java:123)
          at org.eclipse.core.internal.resources.Resource.accept(Resource.java:65)
          at org.eclipse.core.internal.resources.Resource.accept(Resource.java:106)
          at org.eclipse.core.internal.resources.Resource.accept(Resource.java:85)
          at org.jboss.ide.eclipse.jdt.aop.core.util.JaxbReportUtil.getAopReport(JaxbReportUtil.java:80)
          at org.jboss.ide.eclipse.jdt.aop.core.AopCorePlugin.updateProjectReport(AopCorePlugin.java:435)
          at org.jboss.ide.eclipse.jdt.aop.ui.AopUiPlugin.start(AopUiPlugin.java:73)
          at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:958)
          at java.security.AccessController.doPrivileged(Native Method)
          at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:954)
          at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:937)
          at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:421)
          at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:293)
          at org.eclipse.core.runtime.adaptor.EclipseClassLoader.findLocalClass(EclipseClassLoader.java:110)
          at org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(BundleLoader.java:371)
          at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:402)
          at org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader.loadClass(AbstractClassLoader.java:93)
          at java.lang.ClassLoader.loadClass(Unknown Source)
          at org.eclipse.osgi.framework.internal.core.BundleLoader.loadClass(BundleLoader.java:307)
          at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:336)
          at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1313)
          at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:131)
          at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:124)
          at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:113)
          at org.eclipse.ui.internal.WorkbenchPlugin$1.run(WorkbenchPlugin.java:196)
          at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
          at org.eclipse.ui.internal.WorkbenchPlugin.createExtension(WorkbenchPlugin.java:193)
          at org.eclipse.ui.internal.registry.ViewDescriptor.createView(ViewDescriptor.java:76)
          at org.eclipse.ui.internal.ViewFactory$1.run(ViewFactory.java:301)
          at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:616)
          at org.eclipse.core.runtime.Platform.run(Platform.java:747)
          at org.eclipse.ui.internal.ViewFactory.busyRestoreView(ViewFactory.java:273)
          at org.eclipse.ui.internal.ViewFactory$2.run(ViewFactory.java:530)
          at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
          at org.eclipse.ui.internal.ViewFactory.restoreView(ViewFactory.java:528)
          at org.eclipse.ui.internal.Perspective.showView(Perspective.java:1593)
          at org.eclipse.ui.internal.WorkbenchPage.busyShowView(WorkbenchPage.java:773)
          at org.eclipse.ui.internal.WorkbenchPage.access$9(WorkbenchPage.java:753)
          at org.eclipse.ui.internal.WorkbenchPage$13.run(WorkbenchPage.java:3051)
          at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
          at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage.java:3048)
          at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage.java:3028)
          at org.eclipse.ui.internal.ShowViewMenu.showOther(ShowViewMenu.java:204)
          at org.eclipse.ui.internal.ShowViewMenu$2.run(ShowViewMenu.java:68)
          at org.eclipse.jface.action.Action.runWithEvent(Action.java:881)
          at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:915)
          at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:866)
          at org.eclipse.jface.action.ActionContributionItem$7.handleEvent(ActionContributionItem.java:785)
          at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82)
          at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:796)
          at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2772)
          at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2431)
          at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1377)
          at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1348)
          at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:254)
          at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:141)
          at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:96)
          at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:335)
          at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:273)
          at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:129)
          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.eclipse.core.launcher.Main.basicRun(Main.java:185)
          at org.eclipse.core.launcher.Main.run(Main.java:704)
          at org.eclipse.core.launcher.Main.main(Main.java:688)


          The project build also fails with:

          Errors running builder "AOP Project Builder" on project XXXX.
          An error occurred while traversing resources.

          Error Log:

          java.lang.NullPointerException
          at org.jboss.ide.eclipse.jdt.aop.core.project.AopProjectBuilder$AopBuildVisitor.visit(AopProjectBuilder.java:176)
          at org.eclipse.core.internal.resources.Resource$2.visit(Resource.java:108)
          at org.eclipse.core.internal.resources.Resource$1.visitElement(Resource.java:55)
          at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:78)
          at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:82)
          at org.eclipse.core.internal.watson.ElementTreeIterator.iterate(ElementTreeIterator.java:123)
          at org.eclipse.core.internal.resources.Resource.accept(Resource.java:65)
          at org.eclipse.core.internal.resources.Resource.accept(Resource.java:106)
          at org.eclipse.core.internal.resources.Resource.accept(Resource.java:85)
          at org.jboss.ide.eclipse.jdt.aop.core.project.AopProjectBuilder.cleanBuild(AopProjectBuilder.java:148)
          at org.jboss.ide.eclipse.jdt.aop.core.project.AopProjectBuilder.build(AopProjectBuilder.java:110)
          at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:570)
          at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:616)
          at org.eclipse.core.runtime.Platform.run(Platform.java:747)
          at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:159)
          at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:251)
          at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:204)
          at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:231)
          at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:616)
          at org.eclipse.core.runtime.Platform.run(Platform.java:747)
          at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:234)
          at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:270)
          at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:299)
          at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:155)
          at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:212)
          at org.eclipse.core.internal.jobs.Worker.run(Worker.java:66)


          org.eclipse.core.internal.resources.ResourceException(/XXXX)[566]: java.lang.NullPointerException
          at org.jboss.ide.eclipse.jdt.aop.core.project.AopProjectBuilder$AopBuildVisitor.visit(AopProjectBuilder.java:176)
          at org.eclipse.core.internal.resources.Resource$2.visit(Resource.java:108)
          at org.eclipse.core.internal.resources.Resource$1.visitElement(Resource.java:55)
          at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:78)
          at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:82)
          at org.eclipse.core.internal.watson.ElementTreeIterator.iterate(ElementTreeIterator.java:123)
          at org.eclipse.core.internal.resources.Resource.accept(Resource.java:65)
          at org.eclipse.core.internal.resources.Resource.accept(Resource.java:106)
          at org.eclipse.core.internal.resources.Resource.accept(Resource.java:85)
          at org.jboss.ide.eclipse.jdt.aop.core.project.AopProjectBuilder.cleanBuild(AopProjectBuilder.java:148)
          at org.jboss.ide.eclipse.jdt.aop.core.project.AopProjectBuilder.build(AopProjectBuilder.java:110)
          at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:570)
          at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:616)
          at org.eclipse.core.runtime.Platform.run(Platform.java:747)
          at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:159)
          at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:251)
          at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:204)
          at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:231)
          at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:616)
          at org.eclipse.core.runtime.Platform.run(Platform.java:747)
          at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:234)
          at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:270)
          at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:299)
          at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:155)
          at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:212)
          at org.eclipse.core.internal.jobs.Worker.run(Worker.java:66)

          And about 50 or so more of that one, I think...

          • 2. Re: Advanced Heap Protection (patch kinda...)
            acoliver

            Wow! I didn't expect this yet! Excellent.

            Sleepycat is a better idea.

            That's fine, in the case of new files directory preserving zips are preferred. Its still best if existing files are -u patches.

            Please don't be discouraged that these aren't being committed in real time. I'll branch CVS in the next few days. I'm very excited about your contributions and don't let me slow you down.

            -Andy

            • 3. Re: Advanced Heap Protection (patch kinda...)
              acoliver

              I have applied this patch. explanation is here: http://jira.jboss.com/jira/browse/JBMAIL-21

              I can't wait to see this in action!

              • 4. Re: Advanced Heap Protection (patch kinda...)
                acoliver

                A few suggestions:

                It might be good to take less of a factory approach. Make JDBC and BDB both subclasses of Store and make Store an MBean. The JMX name will be passed to SMTP/POP via JMX attributes/depends. This will also give us a convienent way of doing things like configuring the select statement(s) for the JDBC3 store.

                It is probably preferrable for the Store to assign the GUID rather than the client. This lets us do things like use sequences with databases that support it in the future.

                Its not clear to me whether you're intending to always read the blobs with this BlobInputStream/etc. Part of the intent here is to keep memory footprint low for large messages. Meaning small messages may be kept in the database and fully read "disconnected", but large ones will be streamed directly from the DB to the POP/IMAP client. Reading it disconnected will defeat the purpose when that is our goal. However, buffering will need to be used of course and it should be configurable. It could be I'm missing something (there's some coupling code missing ATM so some things aren't as obvious as they will be and I've only given a cursory glance).

                We're going to need to switch to the new JavaMail to take full advantage of this of course. We need to test to make sure JavaMail doesn't do something lame like read the whole body in when you pass it as a stream (the JavaMail currently distributed with JB3.2.x doesn't have the input/output stream).

                I bet this is going to fly when we get it going.

                -Andy

                • 5. Re: Advanced Heap Protection (patch kinda...)

                   

                  It might be good to take less of a factory approach.


                  No problem, this is mostly a personal style thing.

                  It is probably preferrable for the Store to assign the GUID rather than the client.


                  The GUID is created by the StreamFactory (not the client), but it could be pushed lower down such that is it create by the Store.

                  Its not clear to me whether you're intending to always read the blobs with this BlobInputStream/etc


                  My first implementation used the Blob.getBinaryStream and exposed it to the caller. However MySQL's implementation of the Locator Blob does the following:

                  public InputStream getBinaryStream()
                  {
                   return new ByteArrayInputStream(getBytes(0, length())
                  }


                  I.e. it loads the whole blob into memory first, D'oh! The only way I could find to do true partial reads/writes was using the getBytes()/setBytes() methods. Therefore I have layered the BlobI../O..Stream classes over the top of this API (these are the streams that will be returned to the caller). The Streams maintain all of the state information, mainly the id of the blob and a pointer representing the current position in the blob. The Stream classes will not load all of the data into memory. It will maintain a buffer to speed single byte access. However if a caller requests 10MB in a single read (read(new byte[10*1024*1024]) then it will load 10MB in (same is true for any input stream). There is also an property in the store, which is also called bufferSize, but should be called maxBlockSize. This is the largest amount that it will read from a getBytes() or write to setBytes() call. This should be set to match the max_packet_size option for MySQL. I would also like to use a pool control the number of Store instances created (giving finer grained control over resources used).

                  With regards to performance the maxBlockSize for the Store needs to be reasonably large. I needed it to be at least 1MB to process a 10MB message in around 2 seconds. Set it to around 10K and it will take closer to 2 minutes to read/write (AMD Athlon 1600).

                  I know this solution is not as ideal as you probably orginally intended however it does endevour to meet the requirments. It does do partial reads from the database and avoids loading everything in memory at once. Unfortunately (with the current version of the MySQL connector) getBinaryStream()/setBinaryStream() simply won't work. If I have missed something let me know.

                  As an aside, if we were willing to patch the MySQL Connector. Apparently it supports newIO. We could create a MySQL specific blob that exposed the actual socket channel and use a newIO ByteBuffer to read from the blob. Personally I'm tempted to try it.

                  Hope all of this waffle makes, don't hesitate to ask if you have any further questions.

                  Cheers,
                  Mike.

                  • 6. Re: Advanced Heap Protection (patch kinda...)
                    acoliver

                     


                    My first implementation used the Blob.getBinaryStream and exposed it to the caller. However MySQL's implementation of the Locator Blob does the following:

                    public InputStream getBinaryStream()
                    {
                     return new ByteArrayInputStream(getBytes(0, length())
                    }



                    Yeah, I actually was aware of that. Its something that MySQL needs to fix. I doubt that is a long term thing for MySQL.


                    I would also like to use a pool control the number of Store instances created (giving finer grained control over resources used).


                    I'd rather avoid object pooling. It interferes with garbage collection. If we can make the assumption that the driver will work correctly we can eliminate the need to keep what is in essense a session abstraction and just pass the streams.


                    I know this solution is not as ideal as you probably orginally intended however it does endevour to meet the requirments. It does do partial reads from the database and avoids loading everything in memory at once. Unfortunately (with the current version of the MySQL connector) getBinaryStream()/setBinaryStream() simply won't work. If I have missed something let me know.


                    Are you not however forcing transfer of the bytes from the database even for drivers that don't have this bug?


                    As an aside, if we were willing to patch the MySQL Connector. Apparently it supports newIO. We could create a MySQL specific blob that exposed the actual socket channel and use a newIO ByteBuffer to read from the blob. Personally I'm tempted to try it.


                    That sounds like the ticket ultimately. In the context of JBMail, I'd like to prepare for the moment when the driver works correctly.


                    Hope all of this waffle makes, don't hesitate to ask if you have any further questions.


                    Sure, I expect we'll have several rounds of changes to this due to the complexity/etc. of it all.

                    -Andy

                    • 7. Re: Advanced Heap Protection (patch kinda...)

                       

                      Are you not however forcing transfer of the bytes from the database even for drivers that don't have this bug?


                      I don't think so. Assuming drivers properly implement getBytes(pos, len)/setBytes(pos, data) such that they only transfer the requested/supplied number of bytes from the database then it is OK. I only transfer the amount requested by the caller or size of the buffer held by the stream.

                      I have done some tests and can transfer 128MB in and out of the DB (in 1MB chunks) without blowing a 64MB stack (MySQL did struggle to process it). I have run into an interesting issue with MySQL (which may negate all I have said above) that you can't store a blob larger the max_allowed_packet setting. You don't get an exception you just end up with a NULL in the database. I am going to raise this as an issue with MySQL.

                      Its possible we may need 2 implementations one for DBs (like MySQL) where getBytes/setBytes is required and one for DBs which getBinaryStream is more efficient.

                      Regards,
                      Mike.


                      • 8. Re: Advanced Heap Protection (patch kinda...)
                        acoliver

                        Actually the MySQL problem is worse. It will write a truncated blob. Overall I want to "assume you have a screwdriver" on this.. . meaning assume the DB driver works correctly. Worse case, we can help them make it work correctly.

                        • 9. Re: Advanced Heap Protection (patch kinda...)
                          starksm64

                          A different that I have seen with mysql and blobs is truncation. What I saw is that if the blob sized exceeded the datatype size(for example, BLOB = 64k), the column would be silently truncated to 64k leaving a corrupted data value.

                          • 10. Re: Advanced Heap Protection (patch kinda...)

                            I have raised a defect with the MySQL guys on the problem I found:

                            http://bugs.mysql.com/7745

                            Mike.