0

Dynamic grid loading doesn't work in docker environment

asked 2018-10-18 15:21:15 +0800

bonjour gravatar image bonjour
1

Hi,

In a project I'm working on we're using zkoss 6.0.1, the application is running on weblogic 12c (12.2.1.3). We lately dockerized our development environemt just to make it more stable. Unfortunately on of the applications stopped working. When I load the webapp I get following error:

<Oct 18, 2018 6:52:47,111 AM GMT> <Error> <org.zkoss> <BEA-000000> <>>org.zkoss.zk.ui.UiException: Sourced file: inline evaluation of: ``                                       new com.companuy.mui.actions.LoadArticlesAction().run(self); . . . '' unknown error: In
valid index : at Line: 20 : in file: inline evaluation of: ``                                           new com.companuy.mui.actions.LoadArticlesAction().run(self); . . . '' : new com .companuy .mui .actions .LoadArticlesAction ( ) .run ( self )

>>Sourced file: inline evaluation of: ``                                        new com.companuy.mui.actions.LoadArticlesAction().run(self); . . . '' unknown error: Invalid index : at Line: 20 : in file: inline evaluation of: ``
new com.companuy.mui.actions.LoadArticlesAction().run(self); . . . '' : new com .company .mui .actions .LoadArticlesAction ( ) .run ( self )
>>
>>      at bsh.Interpreter.eval(Unknown Source)
>>      at bsh.Interpreter.eval(Unknown Source)
>>      at org.zkoss.zk.scripting.bsh.BSHInterpreter.exec(BSHInterpreter.java:131)
>>      at org.zkoss.zk.scripting.util.GenericInterpreter.interpret(GenericInterpreter.java:328)
>>      at org.zkoss.zk.ui.impl.PageImpl.interpret(PageImpl.java:853)
>>      at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2695)
>>      at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2648)
>>      at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:136)
>>      at org.zkoss.zk.ui.impl.UiEngineImpl.processEvent(UiEngineImpl.java:1702)
>>      at org.zkoss.zk.ui.impl.UiEngineImpl.process(UiEngineImpl.java:1487)
>>      at org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage0(UiEngineImpl.java:463)
>>      at org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage(UiEngineImpl.java:316)
>>      at org.zkoss.zk.ui.http.DHtmlLayoutServlet.process(DHtmlLayoutServlet.java:215)
>>      at org.zkoss.zk.ui.http.DHtmlLayoutServlet.doGet(DHtmlLayoutServlet.java:135)
>>      at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
>>      at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
>>      at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:286)
>>      at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:260)
>>      at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:137)
>>      at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:350)
>>      at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:25)
>>      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
>>      at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:394)
>>      at org.springframework.security.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
>>      at org.springframework.security.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
>>      at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:406)
>>      at org.springframework.security.ui.SessionFixationProtectionFilter.doFilterHttp(SessionFixationProtectionFilter.java:67)
>>      at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
>>      at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:406)
>>      at org.springframework.security.ui.ExceptionTranslationFilter.doFilterHttp(ExceptionTranslationFilter.java:101)
>>      at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
>>      at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:406)
>>      at org.springframework.security.wrapper.SecurityContextHolderAwareRequestFilter.doFilterHttp(SecurityContextHolderAwareRequestFilter.java:91)
>>      at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
>>      at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:406)
>>      at org.springframework.security.ui.AbstractProcessingFilter.doFilterHttp(AbstractProcessingFilter.java:278)
>>      at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
>>      at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:406)
>>      at org.springframework.security.ui.logout.LogoutFilter.doFilterHttp(LogoutFilter.java:89)
>>      at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
>>      at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:406)
>>      at org.springframework.security.ui.logout.LogoutFilter.doFilterHttp(LogoutFilter.java:89)
>>      at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
>>      at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:406)
>>      at org.springframework.security.context.HttpSessionContextIntegrationFilter.doFilterHttp(HttpSessionContextIntegrationFilter.java:235)
>>      at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
>>      at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:406)
>>      at org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:185)
>>      at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:183)
>>      at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:138)
>>      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
>>      at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:32)
>>      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
>>      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3701)
>>      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3667)
>>      at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:326)
>>      at weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197)
>>      at weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)
>>      at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71)
>>      at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2443)
>>      at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2291)
>>      at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2269)
>>      at weblogic.servlet.internal.ServletRequestImpl.runInternal(ServletRequestImpl.java:1703)
>>      at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1663)
>>      at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:272)
>>      at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:352)
>>      at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:337)
>>      at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:57)
>>      at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
>>      at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:644)
>>      at weblogic.work.ExecuteThread.execute(ExecuteThread.java:415)
>>      at weblogic.work.ExecuteThread.run(ExecuteThread.java:355)

Zul file looks as follows:

<zk>
    <div align="right">
        <checkbox id="allCheckbox" label="${labels.all}" forward="onCheck=onSelectAll" visible="true"/>
    </div>
    <grid id="operationGrid" rowRenderer="com.company.mui.ui.renderer.OptionRowRenderer"  sclass="simpleTable" hflex="1">
        <attribute name="onCreate">
            new com.company.mui.actions.LoadCudTypesction().run(self);
        </attribute>
    </grid>


    <grid id="typesGrid" rowRenderer="com.company.mui.ui.renderer.AlertTypeOptionRowRenderer"  sclass="simpleTable" hflex="1"  visible="false">
        <attribute name="onCreate">
            new com.company.mui.actions.LoadRecordTypeAction().run(self);
        </attribute>
    </grid>

    <grid id="articleGrid" rowRenderer="com.company.mui.ui.renderer.OptionRowRenderer"  sclass="simpleTable" hflex="1"  visible="false">
        <attribute name="onCreate">
            new com.company.mui.actions.LoadArticlesAction().run(self);
        </attribute>
    </grid>
</zk>

And the class responsible for loading the data:

public class LoadArticlesAction extends CommonLoadAction {

    public Object run(Object data) {
        return loadListItem(data, "article_types",false);
    }

}

The same error appear for other parts trying to load the data in zul file.

The strange thing is that it works in Weblogic 12c installed on my local windows machine.

Any ideas?

I couldn't create new tag.

delete flag offensive retag edit

Comments

I've found out one more thing in the log files

<Oct 18, 2018 9:01:19,052 AM GMT> <Error> <org.zkoss> <BEA-000000> <>>org.zkoss.zk.ui.UiException: Sourced file: inline evaluation of: ``                                       new com.steria.mui.actions.LoadArticlesAction().run(self); . . . '' unkn
bonjour ( 2018-10-18 17:03:47 +0800 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-10-23 11:34:40 +0800

cor3000 gravatar image cor3000
4263 1 7
ZK Team

I don't fully see what's causing the error message, since it's interpreted beanshell code. Which we don't recommend for production environments.

It looks like you are trying to initialize the grid items by a specific class to do the loading. If you want to keep this separation you can just apply a Composer implementation to the grid.

1) you can implement a separate composer to do what you'd do in the inline code.

<grid id="articleGrid" rowRenderer="com.company.mui.ui.renderer.OptionRowRenderer"
      sclass="simpleTable" hflex="1"  visible="false"
      apply="com.company.mui.actions.LoadArticlesComposer">
</grid>

public class LoadArticlesComposer implements Composer<Component> {
   public void doAfterCompose(Component comp) {
       new LoadArticlesAction().run(comp);
   }
}

2) or just extend the action by adding the Composer interface

<grid id="articleGrid" rowRenderer="com.company.mui.ui.renderer.OptionRowRenderer"
      sclass="simpleTable" hflex="1"  visible="false"
      apply="com.steria.mui.actions.LoadArticlesAction">
</grid>


public class LoadArticlesAction extends CommonLoadAction 
                                implements Composer<Component> {
    public Object run(Object data) {
        return loadListItem(data, "article_types",false);
    }

   public void doAfterCompose(Component comp) {
       this.run(comp);
   }
}

I both variants the results will be more efficient since they avoid interpreted bean shell code, and maybe the avoid the error in the first place or provide at least better stack trace information about what's going wrong.

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2018-10-18 15:21:15 +0800

Seen: 2 times

Last updated: Oct 23

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More