Questions Tagged With jsfhttps://answers.axonivy.com/tags/jsf/?type=rss&user=trungdvquestions tagged <span class="tag">jsf</span>enThu, 29 Dec 2016 12:03:45 -0500Access Ivy project classloader on jarhttps://answers.axonivy.com/questions/2337/access-ivy-project-classloader-on-jar<p>Hi all</p> <p>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,...)</p> <p>Sometime when i start ivy engine (via Windows services), i got exception:</p> <pre><code>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.&lt;init&gt;(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.&lt;init&gt;(FaceletViewDeclarationLanguage.java:309) at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguageStrategy.&lt;init&gt;(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) </code></pre> <p>In my jar file, i need to access to ivy project class loader, so i have this line:</p> <pre><code> ClassLoader cl = Ivy.request().getProject().getProjectClassLoader(); </code></pre> <p>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)</p> <p>I guess my jar is started before ivy initialize its environment. So how can i solve it ?</p> <p>P/S: when i try to start some more times, my engine can start but this exception is quite annoying imo</p> <p>Thanks</p>trungdvThu, 29 Dec 2016 12:03:45 -0500https://answers.axonivy.com/questions/2337/access-ivy-project-classloader-on-jarjsfOutOfScopeException: Cannot access scopedhttps://answers.axonivy.com/questions/2091/outofscopeexception-cannot-access-scoped<p>Hi all I'm using ivy 6.3.0 with JSF + Primefaces, when i test my website with multiple users at the same time, i got this:</p> <pre><code>12:36:49.661 ERROR [ch.ivyteam.ivy.dialog.execution.jsf.error] [http-nio-8443-exec-393] [requestId=2235134] Error during rendering of html dialog com.google.inject.ProvisionException: Unable to provision, see the following errors: 1) Error in custom provider, com.google.inject.OutOfScopeException: Cannot access scoped [ch.ivyteam.ivy.dialog.execution.DialogRuntimeManager]. Either we are not currently inside an HTTP Servlet request, or you may have forgotten to apply com.google.inject.servlet.GuiceFilter as a servlet filter for this request. </code></pre> <p>We also get this problem when i embed my page to another by using <em>iframe</em> </p> <p>We don't use any api from <em>com.google.inject</em>, it could come from ivy library i guess.</p> <p>Does anyone have any idea why this exception occurred? Thanks all </p>trungdvTue, 11 Oct 2016 04:12:15 -0400https://answers.axonivy.com/questions/2091/outofscopeexception-cannot-access-scopedhtmluserdialogjsfprimefacesHow to change default port in ivy designer/server?https://answers.axonivy.com/questions/928/how-to-change-default-port-in-ivy-designer-server<p>Hi all I'm using ivy designer 5 with htmlUserDialog. When i start an apllication, it can be access by browser with default port is 8081 (for ex: <code>http://localhost:8081/ivy/info/index.jsp</code>). Now i want to change it to another port because 8081 is being used by another application. How can i change it. Please help me for designer and server Thanks in advance</p>trungdvTue, 19 Aug 2014 10:59:44 -0400https://answers.axonivy.com/questions/928/how-to-change-default-port-in-ivy-designer-serverjsfivy