Jump to content
  • Deadlock when previewing a report on MacOS X


    stefan_1
    Assigned User Massimo Rabbi
    CategoryBug report
    PriorityNormal
    ReproducibilityAlways
    ResolutionFixed
    SeverityMinor
    StatusResolved
    Versionv6.0.0

    I have a report with Groovy scriptlets, multiple subreports, several parameters and a MySQL datasource.

     

    When I switch to report preview, before even getting shown the parameters (I only see an empty page where the parameter input fields should be), Jaspersoft Studio hangs indefinitely.

     

    I opened the process in a JConsole and examined the threads. There seems to be a deadlock in the class loading mechanism.

    The conflicting thread stacks follow:

     

    Name: main

    State: BLOCKED on org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@5eef9f84 owned by: Worker-1

    Total blocked: 118 Total waited: 11

     

    Stack trace:

    org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass(ClasspathManager.java:613)

    org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl(ClasspathManager.java:568)

    org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImpl(ClasspathManager.java:492)

    org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:465)

    org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)

    org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:395)

    org.eclipse.osgi.internal.loader.SingleSourcePackage.loadClass(SingleSourcePackage.java:35)

    org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:461)

    org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)

    org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)

    org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)

    java.lang.ClassLoader.loadClass(ClassLoader.java:247)

    com.jaspersoft.studio.editor.preview.view.report.ExportMenu.getExportMenu(ExportMenu.java:57)

    com.jaspersoft.studio.editor.preview.view.report.swt.SWTViewer.contribute2ToolBar(SWTViewer.java:103)

    com.jaspersoft.studio.editor.preview.toolbar.ATopToolBarManager.contributeItems(ATopToolBarManager.java:72)

    com.jaspersoft.studio.editor.preview.PreviewJRPrint$2$1.run(PreviewJRPrint.java:280)

    org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:180)

    org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:150)

    org.eclipse.swt.widgets.Display.syncExec(Display.java:4607)

    com.jaspersoft.studio.editor.preview.PreviewJRPrint$2.switchView(PreviewJRPrint.java:275)

    com.jaspersoft.studio.editor.preview.MultiPageContainer.switchView(MultiPageContainer.java:40)

    com.jaspersoft.studio.editor.preview.PreviewJRPrint$2.switchView(PreviewJRPrint.java:259)

    com.jaspersoft.studio.editor.preview.PreviewContainer.addPreviewModeContributeProperties(PreviewContainer.java:371)

    com.jaspersoft.studio.editor.preview.PreviewContainer.runReport(PreviewContainer.java:350)

    com.jaspersoft.studio.editor.AbstractJRXMLEditor$PreviewEditor.runReport(AbstractJRXMLEditor.java:982)

    com.jaspersoft.studio.editor.preview.PreviewContainer$6.run(PreviewContainer.java:430)

    org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)

    org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)

    - locked org.eclipse.swt.widgets.RunnableLock@2e909348

    org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3946)

    org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3623)

    org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)

    org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)

    org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)

    org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)

    org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)

    org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)

    org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)

    com.jaspersoft.studio.rcp.intro.Application.start(Application.java:94)

    org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)

    org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)

    org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)

    org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)

    org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)

    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

    java.lang.reflect.Method.invoke(Method.java:597)

    org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)

    org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)

    org.eclipse.equinox.launcher.Main.run(Main.java:1438)

     

     

    Name: Worker-1

    State: BLOCKED on org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@13ceebfa owned by: main

    Total blocked: 189 Total waited: 70

     

    Stack trace:

    org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoadedClass(ClasspathManager.java:483)

    org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:462)

    org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)

    org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:395)

    org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:464)

    org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)

    org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)

    org.eclipse.osgi.internal.loader.buddy.RegisteredPolicy.loadClass(RegisteredPolicy.java:79)

    org.eclipse.osgi.internal.loader.buddy.PolicyHandler.doBuddyClassLoading(PolicyHandler.java:135)

    org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:489)

    org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)

    org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)

    org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)

    java.lang.ClassLoader.loadClass(ClassLoader.java:247)

    java.lang.Class.forName0(Native Method)

    java.lang.Class.forName(Class.java:171)

    groovy.lang.MetaClassRegistry$MetaClassCreationHandle.createWithCustomLookup(MetaClassRegistry.java:135)

    groovy.lang.MetaClassRegistry$MetaClassCreationHandle.create(MetaClassRegistry.java:130)

    org.codehaus.groovy.reflection.ClassInfo.getMetaClassUnderLock(ClassInfo.java:175)

    org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:192)

    org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.getMetaClass(MetaClassRegistryImpl.java:302)

    org.codehaus.groovy.runtime.InvokerHelper.getMetaClass(InvokerHelper.java:806)

    groovy.lang.GroovyObjectSupport.(GroovyObjectSupport.java:32)

    groovy.lang.Script.(Script.java:40)

    groovy.lang.Script.(Script.java:37)

    Script1.(Script1.groovy)

    sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

    sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)

    sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)

    java.lang.reflect.Constructor.newInstance(Constructor.java:513)

    java.lang.Class.newInstance0(Class.java:357)

    java.lang.Class.newInstance(Class.java:310)

    org.codehaus.groovy.runtime.InvokerHelper.createScript(InvokerHelper.java:421)

    groovy.lang.GroovyShell.parse(GroovyShell.java:625)

    groovy.lang.GroovyShell.evaluate(GroovyShell.java:516)

    groovy.lang.GroovyShell.evaluate(GroovyShell.java:556)

    groovy.lang.GroovyShell.evaluate(GroovyShell.java:527)

    com.jaspersoft.studio.utils.expr.GroovyInterpretter.eval(GroovyInterpretter.java:75)

    com.jaspersoft.studio.utils.expr.AInterpreter.interpretExpression(AInterpreter.java:83)

    com.jaspersoft.studio.utils.expr.GroovyInterpretter.interpretExpression(GroovyInterpretter.java:70)

    com.jaspersoft.studio.utils.ExpressionInterpreter.interpretExpression(ExpressionInterpreter.java:70)

    com.jaspersoft.studio.editor.preview.view.control.VParameters$2.run(VParameters.java:142)

    org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

     

     

    Please let me know if you need any further information. I can reproduce the deadlock quite reliably with my PC and the report.

     

     



    User Feedback

    Recommended Comments

    Changed Status from New to Feedback Requested

    Changed Assigned User from - to @User_306070


    Hi,is it possible to have the JRXML plus additional files attached here?Just in case if you are able to reproduce the issue with a minimal configuration involving the "SampleDB" data adapter it would be better. In this case you will not have to attach any "personal" details regarding the report you are creating.Regards,Massimo.
    Link to comment
    Share on other sites

    Changed Assigned User from @User_306070 to @anonymous


    Hi Massimo,sorry for the wait. Only just now I have found the time to strip the report down. If I import this project in JasperSoft Studio, open the jrxml and click preview, it hangs on the described deadlock.It definitely has something with class loading, because, if I open a small default report before and click on preview on that report and then preview the attached report, it won't hang (I guess because the relevant classes are already loaded and thus the race condition does not occur in that case).Best,Stefan
    Link to comment
    Share on other sites

    To provide more information, I have also enabled OSGi class loading tracing (via the Eclipse -debug parameter and an .options file containing org.eclipse.osgi/debug/loader=true).

    I have captured the output from the moment I click on preview.

     

    If I interpret this correctly, the two classes being loaded when the deadlock occurs are

     

    BundleLoader[com.jaspersoft.studio_6.0.1.final].loadBundleClass(net.sf.jasperreports.export.SimpleHtmlReportConfiguration)

    BundleLoader[net.sf.jasperreports_6.0.1.final].findLocalClass(net.sf.jasperreports.export.SimpleHtmlReportConfiguration)

     

    and

     

    BundleLoader[com.jaspersoft.studio_6.0.1.final].loadBundleClass(groovy.runtime.metaclass.Script1MetaClass)

    BundleLoader[com.jaspersoft.studio_6.0.1.final].findLocalClass(groovy.runtime.metaclass.Script1MetaClass)

     

    Link to comment
    Share on other sites

    Changed Status from New to Assigned

    Changed Assigned User from @anonymous to @mrabbi


    Hi, I'm currently working on the issue. I was able to solve the problem modifying the target platform and plugin dependencies, basically moving out the groovy jar from the net.sf.jasperreports plug-in and using it as an OSGI bundle.Anyhow since I'm trying to investigate similar steps for other jars, I will let you know when an integration build is ready.Regards,Massimo.
    Link to comment
    Share on other sites

    Changed Resolution from Open to Fixed

    Changed Status from Assigned to Resolved


    Hi Stefan,just to let you know that by the end of the day I will publish a newer integration build of JSS. You will be able to pick-it from here: https://sourceforge.net/projects/jasperstudio/files/beta-release/As mentioned in my previous comment, it appears that moving the groovy-all jar to be used directly as an OSGI bundle for the target platform solved the problem.The problem should be gone, at least now in my development environment it does. I'm no longer able to reproduce the hang on JSS like I was before.Regards,Massimo.
    Link to comment
    Share on other sites



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...