Mario Fehrenbach commented on Jul 11, 2015

Re: Creating an XPages Library

Thanks for your tutorial. But I have a problem running a XPage with the new control.

When I create an new blank NSF with a new XPage. The XPage is running fine on server.

In Designer I go to Application - Properties - XPages - xsp.properties - Page Generation

At XPage Libraries I activate the created Library "com.example.library".

Now the XPage is not running anymore on server.

Stacktrace in Domino\data\IBM_TECHNICAL_SUPPORT says this:

java.lang.RuntimeException: com.ibm.xsp.FacesExceptionEx: java.lang.NoClassDefFoundError: javax.faces.render.Renderer

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:357)

at com.ibm.designer.runtime.domino.adapter.LCDEnvironment.service(LCDEnvironment.java:313)

at com.ibm.domino.xsp.bridge.http.engine.XspCmdManager.service(XspCmdManager.java:272)

Caused by: com.ibm.xsp.FacesExceptionEx: java.lang.NoClassDefFoundError: javax.faces.render.Renderer

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: java.lang.NoClassDefFoundError: javax.faces.render.Renderer

at java.lang.ClassLoader.defineClassImpl(Native Method)

at java.lang.ClassLoader.defineClass(ClassLoader.java:287)

at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:74)

at java.net.URLClassLoader.defineClass(URLClassLoader.java:540)

at java.net.URLClassLoader.defineClass(URLClassLoader.java:451)

at java.net.URLClassLoader.access$300(URLClassLoader.java:79)

at java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:1038)

at java.security.AccessController.doPrivileged(AccessController.java:362)

at java.net.URLClassLoader.findClass(URLClassLoader.java:429)

at sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:281)

at java.lang.ClassLoader.loadClass(ClassLoader.java:677)

at java.lang.ClassLoader.loadClass(ClassLoader.java:643)

at com.ibm.domino.http.bootstrap.osgi.LaunchRCP$OSGILaunchClassLoader.loadClass(LaunchRCP.java:119)

at java.lang.ClassLoader.loadClass(ClassLoader.java:643)

at org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(BundleLoader.java:479)

at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:399)

at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:387)

at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:87)

at java.lang.ClassLoader.loadClass(ClassLoader.java:643)

at com.ibm.domino.xsp.module.nsf.NotesClientClassLoader.loadClass(NotesClientClassLoader.java:184)

at java.lang.ClassLoader.loadClass(ClassLoader.java:669)

at com.ibm.domino.xsp.module.nsf.ModuleClassLoader$DynamicClassLoader.loadClass(ModuleClassLoader.java:399)

at java.lang.ClassLoader.loadClass(ClassLoader.java:643)

at com.ibm.domino.xsp.module.nsf.ModuleClassLoader.loadClass(ModuleClassLoader.java:205)

at java.lang.ClassLoader.loadClass(ClassLoader.java:643)

at com.ibm.domino.xsp.module.nsf.ModuleClassLoader.loadClass(ModuleClassLoader.java:215)

at com.sun.faces.util.Util.loadClass(Util.java:323)

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)

at com.ibm.xsp.config.CLBootStrap.initContext(CLBootStrap.java:81)

... 11 more

Caused by: java.lang.ClassNotFoundException: javax.faces.render.Renderer

at java.net.URLClassLoader.findClass(URLClassLoader.java:434)

at sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:281)

at java.lang.ClassLoader.loadClass(ClassLoader.java:677)

at java.lang.ClassLoader.loadClass(ClassLoader.java:643)

... 43 more

I tried to solve the problem by copying jsf-api.jar and jsf-impl.jar (I found different Versions under Domino\Prog\ and Notes\Prog) to Domino\Prog\jvm\lib\ext and restartet domino server.

The stacktrace changed:

java.lang.RuntimeException: com.ibm.xsp.FacesExceptionEx: javax.faces.FacesException: java.lang.ClassCastException: com.example.renderkit.html_basic.ExampleRenderer incompatible with javax.faces.render.Renderer

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:357)

at com.ibm.designer.runtime.domino.adapter.LCDEnvironment.service(LCDEnvironment.java:313)

at com.ibm.domino.xsp.bridge.http.engine.XspCmdManager.service(XspCmdManager.java:272)

Caused by: com.ibm.xsp.FacesExceptionEx: javax.faces.FacesException: java.lang.ClassCastException: com.example.renderkit.html_basic.ExampleRenderer incompatible with javax.faces.render.Renderer

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.ClassCastException: com.example.renderkit.html_basic.ExampleRenderer incompatible with javax.faces.render.Renderer

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.ClassCastException: com.example.renderkit.html_basic.ExampleRenderer incompatible with javax.faces.render.Renderer

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

That's my ExampleRenderer.java:

package com.example.renderkit.html_basic;

import java.io.IOException;

import javax.faces.component.UIComponent;

import javax.faces.context.FacesContext;

import javax.faces.context.ResponseWriter;

import javax.faces.render.Renderer;

public class ExampleRenderer extends Renderer {

@Override

public void encodeBegin(FacesContext context, UIComponent component) throws IOException {

// Note, the component passed in is the ExampleControl

// ExampleControl control = (ExampleControl) component;

ResponseWriter writer = context.getResponseWriter();

writer.startElement("div", component);

writer.writeAttribute("style", "border:orange solid thin", null);

writer.writeText("This is an ExampleControl using the renderer", null);

writer.startElement("hr", null);

writer.endElement("hr");

}

@Override

public void encodeEnd(FacesContext context, UIComponent component) throws IOException {

ResponseWriter writer = context.getResponseWriter();

writer.endElement("div");

}

}

What did I wrong?

Domino Server: 9.0.1, FP2

Domino Designer: 9.0.1

Robert F Harwood commented on Jan 13, 2012

Re: Creating an XPages Library

checked

Darin Egan commented on Sep 14, 2011

Re: Creating an XPages Library

Mario,

The instructions to do a rename can be found here:

http://www-10.lotus.com/ldd/ddwiki.nsf/dx/Blank_XPages_Library

Mario Semper commented on Sep 8, 2011

Re: Creating an XPages Library

Hi!

I walked through this great tutorial. I only changed the project and package names.

I tried to use the created Xpage Library in a local Application, but after buildung my application, in the java class of my test-xpage, i got the following errors:

ExampleControl cannot be resolved to a type

The import at.uniqa.xsp cannot be resolved

"at.uniqa.xsp" is the top of my package-tree.

Any ideas?

Thanks Mario!