<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16890" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial size=2><SPAN class=226505013-01092009>Good afternoon 
list</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=226505013-01092009></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=226505013-01092009>I've implemented 
<FONT face="Courier New">CmsCustomSourceSelectWidget</FONT>, which is an 
example custom widget from the book "OpenCms 7 Development" by Dan Liliedahl. 
I'm sure many of you have also done this. </SPAN></FONT><FONT face=Arial 
size=2><SPAN class=226505013-01092009>The widget is running fine, but today I 
discovered an error in my log which I haven't noticed before (but I guess it has 
been there all along). The error happens during initialization of 
OpenCms, when the widgets are added. </SPAN></FONT><FONT face=Arial size=2><SPAN 
class=226505013-01092009>As the log shows, the widget is added anyway after the 
exception, so there's no real problem other than the annoying presence of 
this exception.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=226505013-01092009></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=226505013-01092009>Details: The 
NullPointerException is caused when trying to instanciate an object of 
class <FONT face="Courier New">null</FONT>. I only use the custom widget in one 
XSD, where I set <FONT face="Courier New">ContentFieldListDS</FONT> as the 
DataSource class. This is done in the widget's configuration 
string. Apparently OpenCms has not read the configuration string 
at the time the exception is thrown, since the class name string is <FONT 
face="Courier New">null</FONT> when it should be "<FONT 
face="Courier New">ContentFieldListDS</FONT>".</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=226505013-01092009></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=226505013-01092009>Has anyone else 
experienced this?</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=226505013-01092009></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=226505013-01092009>Cheers,</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=226505013-01092009>Paul</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=226505013-01092009></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=226505013-01092009>Attachment; snippet 
from my log:</SPAN></FONT><FONT><SPAN class=226505013-01092009></DIV>
<DIV><SPAN lang=EN>
<P><FONT face="Courier New" size=2>01 sep 2009 16:10:47,486  INFO 
[s.xml.CmsXmlContentTypeManager: 241] . XML content config   : added 
widget "org.opencms.widgets.CmsTextareaWidgetPlaintext"<BR>01 sep 2009 
16:10:47,486  INFO [s.xml.CmsXmlContentTypeManager: 241] . XML content 
config   : added widget "org.opencms.widgets.CmsUserWidget"<BR>01 sep 
2009 16:10:47,486  INFO [s.xml.CmsXmlContentTypeManager: 241] . XML content 
config   : added widget "org.opencms.widgets.CmsVfsFileWidget"<BR>01 
sep 2009 16:10:47,486 ERROR [ts.CmsCustomSourceSelectWidget: 104] Error 
instantiating DataSource object of class "null" - 
"null"<BR>java.lang.NullPointerException<BR> at 
java.lang.Class.forName0(Native Method)<BR> at 
java.lang.Class.forName(Unknown Source)<BR> at 
no.npolar.common.widgets.CmsCustomSourceSelectWidget.setConfiguration(CmsCustomSourceSelectWidget.java:99)<BR> at 
org.opencms.widgets.A_CmsWidget.<init>(A_CmsWidget.java:66)<BR> at 
org.opencms.widgets.A_CmsSelectWidget.<init>(A_CmsSelectWidget.java:66)<BR> at 
org.opencms.widgets.CmsSelectWidget.<init>(CmsSelectWidget.java:67)<BR> at 
no.npolar.common.widgets.CmsCustomSourceSelectWidget.<init>(CmsCustomSourceSelectWidget.java:71)<BR> at 
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
Method)<BR> at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown 
Source)<BR> at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown 
Source)<BR> at java.lang.reflect.Constructor.newInstance(Unknown 
Source)<BR> at java.lang.Class.newInstance0(Unknown Source)<BR> at 
java.lang.Class.newInstance(Unknown Source)<BR> at 
org.opencms.xml.CmsXmlContentTypeManager.addWidget(CmsXmlContentTypeManager.java:227)<BR> at 
sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source)<BR> at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)<BR> at 
java.lang.reflect.Method.invoke(Unknown Source)<BR> at 
org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:216)<BR> at 
org.apache.commons.digester.CallMethodRule.end(CallMethodRule.java:626)<BR> at 
org.apache.commons.digester.Rule.end(Rule.java:253)<BR> at 
org.apache.commons.digester.Digester.endElement(Digester.java:1222)<BR> at 
org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown 
Source)<BR> at 
org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown 
Source)<BR> at 
org.apache.xerces.impl.dtd.XMLDTDValidator.emptyElement(Unknown 
Source)<BR> at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown 
Source)<BR> at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown 
Source)<BR> at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown 
Source)<BR> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown 
Source)<BR> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown 
Source)<BR> at org.apache.xerces.parsers.XMLParser.parse(Unknown 
Source)<BR> at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown 
Source)<BR> at 
org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown 
Source)<BR> at 
org.apache.commons.digester.Digester.parse(Digester.java:1765)<BR> at 
org.opencms.configuration.CmsConfigurationManager.loadXmlConfiguration(CmsConfigurationManager.java:507)<BR> at 
org.opencms.configuration.CmsConfigurationManager.loadXmlConfiguration(CmsConfigurationManager.java:348)<BR> at 
org.opencms.main.OpenCmsCore.initConfiguration(OpenCmsCore.java:962)<BR> at 
org.opencms.main.OpenCmsCore.initContext(OpenCmsCore.java:1306)<BR> at 
org.opencms.main.OpenCmsCore.upgradeRunlevel(OpenCmsCore.java:1731)<BR> at 
org.opencms.main.OpenCmsListener.contextInitialized(OpenCmsListener.java:87)<BR> at 
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3764)<BR> at 
org.apache.catalina.core.StandardContext.start(StandardContext.java:4216)<BR> at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)<BR> at 
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)<BR> at 
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)<BR> at 
org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:831)<BR> at 
org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:720)<BR> at 
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)<BR> at 
org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)<BR> at 
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)<BR> at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)<BR> at 
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)<BR> at 
org.apache.catalina.core.StandardHost.start(StandardHost.java:736)<BR> at 
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)<BR> at 
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)<BR> at 
org.apache.catalina.core.StandardService.start(StandardService.java:448)<BR> at 
org.apache.catalina.core.StandardServer.start(StandardServer.java:700)<BR> at 
org.apache.catalina.startup.Catalina.start(Catalina.java:552)<BR> at 
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<BR> at 
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)<BR> at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)<BR> at 
java.lang.reflect.Method.invoke(Unknown Source)<BR> at 
org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)<BR> at 
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)<BR>01 sep 2009 
16:10:47,502  INFO [s.xml.CmsXmlContentTypeManager: 241] . XML content 
config   : added widget 
"no.npolar.common.widgets.CmsCustomSourceSelectWidget"<BR>01 sep 2009 
16:10:47,502  INFO [s.xml.CmsXmlContentTypeManager: 208] . XML content 
config   : added schema type "OpenCmsBoolean" using default widget 
"org.opencms.widgets.CmsCheckboxWidget"<BR>01 sep 2009 16:10:47,502  INFO 
[s.xml.CmsXmlContentTypeManager: 208] . XML content config   : added 
schema type "OpenCmsColor" using default widget 
"org.opencms.widgets.CmsColorpickerWidget"</FONT></P></SPAN></SPAN></FONT></DIV></BODY></HTML>