Problems using the XSP Starter Kit - xpages

I followed the instructions to install the XSP Starter kit from openntf. Everything mentioned in the video I was able to do but I am not able to activate it.
When I activate the plugin in my application and try to open it I get an Error 500. Anybody any idea?
The server console tells me:
https://www.dropbox.com/s/w2a0nlmjj5prnxs/Error%20OSGI.jpg?dl=0
The log file contains:
<extendedDataElements name="CommonBaseEventLogRecord:Exception" type="string">
<values>java.lang.RuntimeException: com.ibm.xsp.FacesExceptionEx: javax.faces.FacesException: java.lang.InstantiationException: org.openntf.xsp.starter.renderkit.AbstractHtmlTagRenderer
at com.ibm.designer.runtime.domino.adapter.ComponentModule.initModule(ComponentModule.java:461)
at com.ibm.domino.xsp.module.nsf.NSFComponentModule.initModule(NSFComponentModule.java:498)
at com.ibm.domino.xsp.module.nsf.NSFService.createNSFModule(NSFService.java:752)
at com.ibm.domino.xsp.module.nsf.NSFService.loadModule(NSFService.java:735)
at com.ibm.domino.xsp.module.nsf.NSFService.doServiceInternal(NSFService.java:588)
at com.ibm.domino.xsp.module.nsf.NSFService.doService(NSFService.java:482)
at com.ibm.designer.runtime.domino.adapter.LCDEnvironment.doService(LCDEnvironment.java:350)
at com.ibm.designer.runtime.domino.adapter.LCDEnvironment.service(LCDEnvironment.java:306)
at com.ibm.domino.xsp.bridge.http.engine.XspCmdManager.service(XspCmdManager.j</values>
<values>ava:272)
Caused by: com.ibm.xsp.FacesExceptionEx: javax.faces.FacesException: java.lang.InstantiationException: org.openntf.xsp.starter.renderkit.AbstractHtmlTagRenderer
at com.ibm.xsp.config.CLBootStrap.initContext(CLBootStrap.java:89)
at com.ibm.xsp.config.BootStrap.init(BootStrap.java:82)
at com.ibm.xsp.config.ConfigureCoreListener.contextInitialized(ConfigureCoreListener.java:39)
at com.ibm.designer.runtime.domino.adapter.ComponentModule.initModule(ComponentModule.java:453)
... 8 more
Caused by: javax.faces.FacesException: java.lang.InstantiationException: org.openntf.xsp.starter.renderkit.AbstractHtmlTagRenderer
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:417)
at com.ibm.xsp.config.CLBootStrap.initContext(CLBootStrap.java:81)
... 11 more
Caused by: java.lang.InstantiationException: org.openntf.xsp.starter.renderkit.AbstractHtmlTagRenderer
at java.lang.J9VMInternals.newInstan</values>
<values>ceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1549)
at com.sun.faces.config.ConfigureListener.configure(ConfigureListener.java:926)
at com.sun.faces.config.ConfigureListener.configure(ConfigureListener.java:965)
at com.sun.faces.config.ConfigureListener.configure(ConfigureListener.java:489)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:410)
... 12 more
</values>
</extendedDataElements>

There is a component that was available in the starter kit for org.openntf.xsp.starter.renderkit.AbstractHtmlTagRenderer. It's hitting an error trying to create that component. It's not a component designed to be used in a particular way, it's really there to show what needs to be created for a component - org.openntf.xsp.starter.AbstractHtmlTag is the component, html.xsp-config in META-INF defines the properties available to Domino Designer, html-faces-config adds the component to the server and defines which Java class to use for the component and which one for the renderer (to display the HTML). org.openntf.xsp.starter.renderkit.AbstractHtmlTagRenderer handles printing content to the browser.
I've not used the starter kit as is, but I did use it as a basis for my session at ICON UK http://www.slideshare.net/paulswithers1/from-xpages-hero-to-osgi-guru-taking-the-scary-out-of-building-extension-libraries-icon-uk-2014

Related

java.io.NotSerializableException using Primefaces and Weblogic

I'm using Primefaces 6.1 running on a clustered WebLogic Server (Mojarra 2.2.8) Version: 12.2.1.3.0 and during the session replication i'm getting the following exception:
<Jan 30, 2018 4:08:08,727 PM CET> <Error> <Cluster> <BEA-003144> <All session objects should be serializable to replicate. Check the objects in the session. Failed to replicate a non-serializable object in context /app.
java.rmi.MarshalException: failed to marshal create(Lweblogic.rmi.spi.HostID;ILweblogic.cluster.replication.ROID;Ljava.io.Serializable;); nested exception is:
java.io.NotSerializableException: org.primefaces.model.SortMeta
at weblogic.rjvm.BasicOutboundRequest.marshalArgs(BasicOutboundRequest.java:100)
at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:297)
at weblogic.cluster.replication.RemoteReplicationServicesInternalImpl_12213_WLStub.create(Unknown Source)
at sun.reflect.GeneratedMethodAccessor1191.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Truncated. see log file for complete stacktrace
Caused By: java.io.NotSerializableException: org.primefaces.model.SortMeta
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
at java.util.ArrayList.writeObject(ArrayList.java:766)
at sun.reflect.GeneratedMethodAccessor31.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Truncated. see log file for complete stacktrace
JSF component binding is never used in the application. Looking at the Primefaces source I can see that the model SortMeta (does not implements Serializable) is only used in the DataTable component.
The view state saving method has to be server side.
How to solve or avoid this exception?
EDIT:
Problem was caused by the "new" datatable attribute multiViewState.
https://forum.primefaces.org/viewtopic.php?f=3&t=54138&p=164132
Class SortMeta is now Serializable:
https://github.com/primefaces/primefaces/issues/3272

Getting a custom class to be recognized as an fxml tag

I have a custom textfield, PersistentPromptTextField that extends TextField and would like to be able to add it my .fxml file. When I do and I run it, I get a list of errors such as this:
Caused by: java.lang.InstantiationException: gui.PersistentPromptTextField
at java.lang.Class.newInstance(Unknown Source)
at sun.reflect.misc.ReflectUtil.newInstance(Unknown Source)
... 75 more
Caused by: java.lang.NoSuchMethodException: gui.PersistentPromptTextField.<init>()
at java.lang.Class.getConstructor0(Unknown Source)
... 77 more
In my .fxml file I have included <?import gui.PersistentPromptTextField?> as well, but obviously I am missing something.
The error raised due to the FXMLLoader is (by default) tried to instantiate the given class using its a no-arg constructor. If you didn't define, try it.
Instantiating using a constructor having some arguments, you need to use #NamedArgs annotation. See this comprehensive answer for more details.

Errors in integrating ESAPI suite with MyEclipse j2ee project

Hi, I am trying to integrate of checkmarx plug in with my project in
myEclipse. I copied the jars (i.e. antisamy-1.4.3.jar &
esapi-2.1.0.jar ) my current jars directory and included in the
project libraries of myeclipse. And copied the property files into
my source directory of project i.e. ESAPI.properties &
validation.properties (prop files) where all my project property
files exists. Below is the screen shot Now I am trying to test if my
integration of ESapi successful. For that I have a create a test
java class(which is provided in the document i.e.
esapi4java-core-2.0-install-guide.pdf ) in my source folder, no
compilation errors found. But when I am running it is giving error ,
so what am I making mistake could you please help me.
Exception log :
SecurityConfiguration for ESAPI.printProperties not found in
ESAPI.properties. Using default: false Exception in thread "main"
org.owasp.esapi.errors.ConfigurationException:
java.lang.reflect.InvocationTargetException AccessController class
(org.owasp.esapi.reference.DefaultAccessController) CTOR threw
exception. at
org.owasp.esapi.util.ObjFactory.make(ObjFactory.java:129) at
org.owasp.esapi.ESAPI.accessController(ESAPI.java:85) at
com.steelwedge.util.checkmarx.EsapiTest.main(EsapiTest.java:14)
Caused by: java.lang.reflect.InvocationTargetException at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597) at
org.owasp.esapi.util.ObjFactory.make(ObjFactory.java:86) ... 2 more
Caused by: java.lang.NoClassDefFoundError:
org/apache/commons/configuration/ConfigurationException at
org.owasp.esapi.reference.DefaultAccessController.(DefaultAccessController.java:32)
at
org.owasp.esapi.reference.DefaultAccessController.getInstance(DefaultAccessController.java:22)
... 7 more Caused by: java.lang.ClassNotFoundException:
org.apache.commons.configuration.ConfigurationException at
java.net.URLClassLoader$1.run(URLClassLoader.java:202) at
java.security.AccessController.doPrivileged(Native Method) at
java.net.URLClassLoader.findClass(URLClassLoader.java:190) at
java.lang.ClassLoader.loadClass(ClassLoader.java:307) at
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at
java.lang.ClassLoader.loadClass(ClassLoader.java:248) ... 9 more
Thank you. ~Shyam
I'm not familiar with ESAPI but note that the error includes "Caused by: java.lang.ClassNotFoundException: org.apache.commons.configuration.ConfigurationException"
The class, org.apache.commons.configuration.ConfigurationException, is in the commons-configuration.jar, so you will need that jar in your classpath also (and maybe others).
Note that for web applications, you may also need to add jars to the Deployment Assembly (right click the project, select Properties and then go to the MyEclipse/Deployment Assembly page - you can add jars from the classpath or individuals jars) as this controls what gets deployed to the server.

Servlet exception stream closed jsp

I am getting a servlet Exception "Stream closed" !!. I am not able to identify which jsp page is the problematic one or which line has the issue. It's showing the pagedefinition page as well as included pages.
As it is not easy to show all the pages attaching as a zip file : InGoogleDocs
The structure is like
pageDef.jsp Contains : allThings.jsp design.jsp myFile.jsp
The exception I got is as follows:
javax.servlet.jsp.JspException: ServletException in
'/layout/global/allThings.jsp': ServletException in
'/layout/body/design.jsp': ServletException in
'/layout/sub/design.jsp': ServletException in
'/module/air/myFile.jsp': Stream closed
at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:920)
at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:460)
at org.apache.jsp.pagedef.air.pageDef_jsp._jspx_meth_tiles_insert_0(pageDef_jsp.java:1693)
at org.apache.jsp.pagedef.air.pageDef_jsp._jspService(pageDef_jsp.java:146)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:386)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at sun.reflect.GeneratedMethodAccessor70.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:270)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:269)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:302)
at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:163)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:283)
at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:56)
Important Note:
I am not getting this exception all the time.
when I go to the page (sometimes i will get the exception). If not getting , if I click back button in the jsp and coming back to the page will make the exception.
This problem is solved.
The problem was in a JSTL custom tag library's for-loop !!
How I solved(debugging JSP):
I made different copies of problematic file and included each of them in definition JSP.
Each of those problematic JSP files are edited in different areas as follows. If we do so, the error will be in only one/some JSP and so it is easy to find out the exception.
Say:
problematic-ORIGINAL.jsp
<jsp:for...></jsp>
<c:...>..</c>
...
problematic-1.jsp
<c:...>..</c>
problematic-2.jsp
<jsp:for...></jsp>
problematic-3.jsp
...
And then include 1,2 and 3 in definition JSP. Thus I could find the prob was in 2nd one. Enjoy coding ..

can not find org.apache.myfaces.el.ValueBindingImpl class in myfaces-impl 2.1.6

I am working on a jsf migration project. In the process of migration to jsf 2.0, I have replaced myfaces-api-1.1.5 and myfaces-impl1.1.5 with myfaces-impl(2.1.6). I got the following Exception.
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_22]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_22]
at java.lang.Thread.run(Thread.java:662) [:1.6.0_22]
Caused by: java.lang.NoClassDefFoundError: org/apache/myfaces/el/ValueBindingImpl
at java.lang.Class.getDeclaredConstructors0(Native Method) [:1.6.0_22]
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389) [:1.6.0_22]
at java.lang.Class.getConstructor0(Class.java:2699) [:1.6.0_22]
at java.lang.Class.getConstructor(Class.java:1657) [:1.6.0_22]
at org.jboss.as.web.deployment.jsf.JsfManagedBeanProcessor.deploy(JsfManagedBeanProcessor.java:105)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115)
... 5 more
Caused by: java.lang.ClassNotFoundException: org.apache.myfaces.el.ValueBindingImpl from [Module "deployment.ASSET.war:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:191)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:361)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:333)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:310)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:103)
... 11 more
When I try to find out ValueBindingImpl in the jar files, I am not able to find org.apache.myfaces.el.ValueBindingImpl in the myfaces-impl(2.1.6).. Is there any alternative?
It seems that your code is using MyFaces 1.1 specific implementation classes instead of the JSF 1.1 API classes. For example,
ValueBinding binding = new ValueBindingImpl(...);
instead of
ValueBinding binding = application.createValueBinding(...);
You'd need to fix the code to remove MyFaces 1.1 specific implementation classes.
Note that ValueBinding is deprecated since JSF 1.2, if you can, replace by ValueExpression.

Resources