Hi all
I'm using a htmlUserDialog wich JSF and i have a jsf custom tag, i build and put it on webapp folder of server. this is a custom tag that i will use on my xhtml. this tag somehow is a jsf event listener, it listen system event of jsf (ex: PostAddToView, PreRenderView,...)
Sometime when i start ivy engine (via Windows services), i got exception:
ch.ivyteam.ivy.environment.EnvironmentNotAvailableException: Access to ivy environment outside a process request thread is not possible.
Current thread: Thread[http-nio-8082-exec-1,5,main]
at ch.ivyteam.ivy.environment.Ivy.getIvy(Ivy.java:574)
at ch.ivyteam.ivy.environment.Ivy.getEnvironmentData(Ivy.java:553)
at ch.ivyteam.ivy.environment.Ivy.getEnvironmentData(Ivy.java:548)
at ch.ivyteam.ivy.environment.Ivy.request(Ivy.java:242)
at ch.axonivy.fintech.guiframework.component.GuiEventListenerFactoryServiceProvider.getProjectClassLoader(GuiEventListenerFactoryServiceProvider.java:67)
at ch.axonivy.fintech.guiframework.component.GuiEventListenerFactoryServiceProvider.getFactory(GuiEventListenerFactoryServiceProvider.java:32)
at ch.axonivy.fintech.guiframework.component.GuiEventListenerComponent.<init>(GuiEventListenerComponent.java:46)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at org.apache.myfaces.application.ApplicationImpl.createComponent(ApplicationImpl.java:1469)
at javax.faces.application.ApplicationWrapper.createComponent(ApplicationWrapper.java:129)
at org.apache.myfaces.extensions.validator.core.factory.ExtValApplicationWrapper.createComponent(ExtValApplicationWrapper.java:84)
at javax.faces.application.ApplicationWrapper.createComponent(ApplicationWrapper.java:129)
at org.apache.myfaces.view.facelets.compiler.FaceletsCompilerSupport.loadLibraries(FaceletsCompilerSupport.java:141)
at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.loadLibraries(FaceletViewDeclarationLanguage.java:2526)
at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.createCompiler(FaceletViewDeclarationLanguage.java:2172)
at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.initialize(FaceletViewDeclarationLanguage.java:2464)
at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.<init>(FaceletViewDeclarationLanguage.java:309)
at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguageStrategy.<init>(FaceletViewDeclarationLanguageStrategy.java:52)
at org.apache.myfaces.view.ViewDeclarationLanguageFactoryImpl.initialize(ViewDeclarationLanguageFactoryImpl.java:104)
at org.apache.myfaces.view.ViewDeclarationLanguageFactoryImpl.getViewDeclarationLanguage(ViewDeclarationLanguageFactoryImpl.java:73)
at org.apache.myfaces.application.ViewHandlerImpl.getViewDeclarationLanguage(ViewHandlerImpl.java:183)
at javax.faces.application.ViewHandlerWrapper.getViewDeclarationLanguage(ViewHandlerWrapper.java:133)
at org.apache.myfaces.shared.application.DefaultViewHandlerSupport.checkResourceExists(DefaultViewHandlerSupport.java:569)
at org.apache.myfaces.shared.application.DefaultViewHandlerSupport.handleSuffixMapping(DefaultViewHandlerSupport.java:507)
In my jar file, i need to access to ivy project class loader, so i have this line:
ClassLoader cl = Ivy.request().getProject().getProjectClassLoader();
I have a interface in this jar so i need to get class loader to find which class (from ivy project) is implementing my interface (vis ServiceLoader)
I guess my jar is started before ivy initialize its environment.
So how can i solve it ?
P/S: when i try to start some more times, my engine can start but this exception is quite annoying imo
Thanks
asked
29.12.2016 at 12:03
trungdv
(suspended)
accept rate:
52%