Sep 26, 2011, 5:22 AM
66 Posts

Error 403 when using some Apache Commons libraries in my xPages app ... what kind of java issue it is??

  • Category: Other
  • Platform: All
  • Release: 8.5.2
  • Role: Developer
  • Tags:
  • Replies: 1
 
I'm using java library from  Apache  Commons project in my xPages application. But some methods are raising permission errors like org.apache.commons.lang3.StringUtils.join(...) . In web browser I can see Error 403 ... and in the  log file there is an error as below. Can anyone explain, what is going on? How can I force xPages to work properly?? I'm using Apache Commons in others java projects and never seen such behaviour.
 
 
------------------------- 
 
<extendedDataElements name="CommonBaseEventLogRecord:Exception" type="string">
<values>javax.servlet.ServletException: java.lang.ExceptionInInitializerError&#xD;&#xA;&#x9;at com.ibm.xsp.webapp.FacesServlet.handleError(FacesServlet.java:528)&#xD;&#xA;&#x9;at com.ibm.xsp.webapp.FacesServlet.renderErrorPage(FacesServlet.java:362)&#xD;&#xA;&#x9;at com.ibm.xsp.webapp.FacesServlet.service(FacesServlet.java:181)&#xD;&#xA;&#x9;at com.ibm.xsp.webapp.FacesServletEx.service(FacesServletEx.java:137)&#xD;&#xA;&#x9;at com.ibm.xsp.webapp.DesignerFacesServlet.service(DesignerFacesServlet.java:103)&#xD;&#xA;&#x9;at com.ibm.designer.runtime.domino.adapter.ComponentModule.invokeServlet(ComponentModule.java:576)&#xD;&#xA;&#x9;at com.ibm.domino.xsp.module.nsf.NSFComponentModule.invokeServlet(NSFComponentModule.java:1207)&#xD;&#xA;&#x9;at com.ibm.designer.runtime.domino.adapter.ComponentModule$AdapterInvoker.invokeServlet(ComponentModule.java:847)&#xD;&#xA;&#x9;at com.ibm.designer.runtime.domino.adapter.ComponentModule$ServletInvoker.doService(ComponentModule.java:796)&#xD;&#xA;&#x9;at com.ibm.designer.runtime.domin</values>
<values>o.adapter.ComponentModule.doService(ComponentModule.java:565)&#xD;&#xA;&#x9;at com.ibm.domino.xsp.module.nsf.NSFComponentModule.doService(NSFComponentModule.java:1191)&#xD;&#xA;&#x9;at com.ibm.domino.xsp.module.nsf.NSFService.doServiceInternal(NSFService.java:598)&#xD;&#xA;&#x9;at com.ibm.domino.xsp.module.nsf.NSFService.doService(NSFService.java:421)&#xD;&#xA;&#x9;at com.ibm.designer.runtime.domino.adapter.LCDEnvironment.doService(LCDEnvironment.java:341)&#xD;&#xA;&#x9;at com.ibm.designer.runtime.domino.adapter.LCDEnvironment.service(LCDEnvironment.java:297)&#xD;&#xA;&#x9;at com.ibm.domino.xsp.bridge.http.engine.XspCmdManager.service(XspCmdManager.java:272)&#xD;&#xA;Caused by: java.lang.ExceptionInInitializerError&#xD;&#xA;&#x9;at java.lang.J9VMInternals.initialize(J9VMInternals.java:222)&#xD;&#xA;&#x9;at tcl.wheel.Dialogs.getCategorizedView(Dialogs.java:167)&#xD;&#xA;&#x9;at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)&#xD;&#xA;&#x9;at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAc</values>
<values>cessorImpl.java:60)&#xD;&#xA;&#x9;at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)&#xD;&#xA;&#x9;at java.lang.reflect.Method.invoke(Method.java:611)&#xD;&#xA;&#x9;at com.ibm.jscript.types.JavaAccessObject.call(JavaAccessObject.java:321)&#xD;&#xA;&#x9;at com.ibm.jscript.types.FBSObject.call(FBSObject.java:161)&#xD;&#xA;&#x9;at com.ibm.jscript.ASTTree.ASTCall.interpret(ASTCall.java:175)&#xD;&#xA;&#x9;at com.ibm.jscript.ASTTree.ASTAssign.interpret(ASTAssign.java:91)&#xD;&#xA;&#x9;at com.ibm.jscript.ASTTree.ASTTry.interpret(ASTTry.java:109)&#xD;&#xA;&#x9;at com.ibm.jscript.ASTTree.ASTProgram.interpret(ASTProgram.java:119)&#xD;&#xA;&#x9;at com.ibm.jscript.ASTTree.ASTProgram.interpretEx(ASTProgram.java:139)&#xD;&#xA;&#x9;at com.ibm.jscript.JSExpression._interpretExpression(JSExpression.java:435)&#xD;&#xA;&#x9;at com.ibm.jscript.JSExpression.access$1(JSExpression.java:424)&#xD;&#xA;&#x9;at com.ibm.jscript.JSExpression$2.run(JSExpression.java:414)&#xD;&#xA;&#x9;at java.security.</values>
<values>AccessController.doPrivileged(AccessController.java:284)&#xD;&#xA;&#x9;at com.ibm.jscript.JSExpression.interpretExpression(JSExpression.java:410)&#xD;&#xA;&#x9;at com.ibm.jscript.JSExpression.evaluateValue(JSExpression.java:251)&#xD;&#xA;&#x9;at com.ibm.jscript.JSExpression.evaluateValue(JSExpression.java:234)&#xD;&#xA;&#x9;at com.ibm.xsp.javascript.JavaScriptInterpreter.interpret(JavaScriptInterpreter.java:221)&#xD;&#xA;&#x9;at com.ibm.xsp.binding.javascript.JavaScriptMethodBinding.invoke(JavaScriptMethodBinding.java:111)&#xD;&#xA;&#x9;at com.ibm.xsp.component.UIViewRootEx.initBeforeContents(UIViewRootEx.java:1621)&#xD;&#xA;&#x9;at com.ibm.xsp.page.compiled.AbstractCompiledPage.initComponent(AbstractCompiledPage.java:333)&#xD;&#xA;&#x9;at com.ibm.xsp.page.compiled.AbstractCompiledPage.createTree(AbstractCompiledPage.java:256)&#xD;&#xA;&#x9;at com.ibm.xsp.page.compiled.AbstractCompiledPage.createViewRoot(AbstractCompiledPage.java:167)&#xD;&#xA;&#x9;at com.ibm.xsp.application.ViewHandlerExImpl._createViewRoot(V</values>
<values>iewHandlerExImpl.java:511)&#xD;&#xA;&#x9;at com.ibm.xsp.application.ViewHandlerExImpl.createViewRoot(ViewHandlerExImpl.java:557)&#xD;&#xA;&#x9;at com.ibm.xsp.application.ViewHandlerExImpl.doCreateView(ViewHandlerExImpl.java:141)&#xD;&#xA;&#x9;at com.ibm.xsp.application.ViewHandlerEx.createView(ViewHandlerEx.java:90)&#xD;&#xA;&#x9;at com.ibm.xsp.webapp.FacesServlet.serviceView(FacesServlet.java:223)&#xD;&#xA;&#x9;at com.ibm.xsp.webapp.FacesServletEx.serviceView(FacesServletEx.java:193)&#xD;&#xA;&#x9;at com.ibm.xsp.webapp.FacesServlet.service(FacesServlet.java:158)&#xD;&#xA;&#x9;... 13 more&#xD;&#xA;Caused by: java.security.AccessControlException: Access denied (java.lang.RuntimePermission getClassLoader)&#xD;&#xA;&#x9;at java.security.AccessController.checkPermission(AccessController.java:108)&#xD;&#xA;&#x9;at java.lang.SecurityManager.checkPermission(SecurityManager.java:544)&#xD;&#xA;&#x9;at java.lang.Thread.getContextClassLoader(Thread.java:456)&#xD;&#xA;&#x9;at org.apache.commons.lang3.StringUtils.&lt;clini</values>
<values>t&gt;(StringUtils.java:717)&#xD;&#xA;&#x9;at java.lang.J9VMInternals.initializeImpl(Native Method)&#xD;&#xA;&#x9;at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)&#xD;&#xA;&#x9;... 45 more&#xD;&#xA;</values>
</extendedDataElements> 
Sep 27, 2011, 11:58 AM
54 Posts
Re: Error 403 when using some Apache Commons libraries in my xPages app ... what kind of j...
The reason is "java.security.AccessControlException". Dynamic class loading is a problem in Domino. 
Locate and read the java.policy file and edit it by granting more priviledges for Java Virtual Machine.
I don't know why these dynamic class loadings are prohibited by default...
 
Don't know the exact syntax of what kind of "grant" you should add, but I think our friend Google will help :)