Thanks for the reply. At the risk of sounding obtuse, where exactly is the
correct place to define this property? I tried to look for it in the Tomcat
docs but couldn't find anywhere that talks about this. I tried setting it as
a -D at tomcat startup, which doesn't seem like the correct place to set
this, and it didn't work anyway. Do I put this in the web.xml of the web
application as a context parameter? 

Stephen

-----Original Message-----
From: Stephen Faustino [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 22, 2005 9:38 AM
To: tomcat-user@jakarta.apache.org
Subject: XInclude in faces-config file


I'm attempting to modularize one of the xml files by using XInclude under
Tomcat 5.5.9. The application starts, but at the point in time when the
beans should get instantiated I get a NullPointerException in the
ManagedBeanFactory. In the example below, I'm trying to include file2.xml in
file1.xml, but it appears that the include directive is being ignored. Note
that if I insert the contents of file2.xml directly into file1.xml,
everything works as expected. Can anyone offer any insight in what I'm doing
wrong?

file1.xml
----------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer
Faces Config 1.0//EN" 
"http://java.sun.com/dtd/web-facesconfig_1_0.dtd";>

<faces-config xmlns:xi="http://www.w3.org/2001/XInclude"; >
  <managed-bean>
     <managed-bean-name>bean1</managed-bean-name>
      ...
  </managed-bean>
  ...
  <xi:include href="file2.xml"/>
</faces-config>


file2.xml
-----------
  <managed-bean>
     <managed-bean-name>bean2</managed-bean-name>
      ...
  </managed-bean>
  

stderr.log
------------
Sep 22, 2005 9:10:47 AM com.sun.faces.application.ApplicationAssociate
createAndMaybeStoreManagedBeans
SEVERE: Managedbean master could not be created Can't instantiate class:
'org.nowhere.myapp.beans.Master'.. class org.nowhere.myapp.beans.Master :
java.lang.NullPointerException
javax.faces.FacesException: Can't instantiate class:
org.nowhere.myapp.beans.Master'.. class org.nowhere.myapp.beans.Master :
java.lang.NullPointerException
        at
com.sun.faces.config.ManagedBeanFactory.newInstance(ManagedBeanFactory.java:
209)
        at
com.sun.faces.application.ApplicationAssociate.createAndMaybeStoreManagedBea
ns(ApplicationAssociate.java:256)
        at
com.sun.faces.el.VariableResolverImpl.resolveVariable(VariableResolverImpl.j
ava:78)
        at com.sun.faces.el.impl.NamedValue.evaluate(NamedValue.java:125)
        at
com.sun.faces.el.impl.ComplexValue.evaluate(ComplexValue.java:146)
        at
com.sun.faces.el.impl.ExpressionEvaluatorImpl.evaluate(ExpressionEvaluatorIm
pl.java:243)
        at
com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:173)
        at
com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:154)
           <snip>...
Caused by: java.lang.ClassNotFoundException: class
org.nowhere.myapp.beans.Master : java.lang.NullPointerException
        at java.beans.Beans.instantiate(Beans.java:208)
        at java.beans.Beans.instantiate(Beans.java:48)
        at
com.sun.faces.config.ManagedBeanFactory.newInstance(ManagedBeanFactory.java:
203)
        ... 60 more
Caused by: java.lang.NullPointerException
        at com.slc.webetm.beans.Master.<init>(Unknown Source)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
        at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAcces
sorImpl.java:39)
        at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstruc
torAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
        at java.lang.Class.newInstance0(Class.java:350)
        at java.lang.Class.newInstance(Class.java:303)
        at java.beans.Beans.instantiate(Beans.java:204)
        ... 62 more

Stephen L. Faustino
Senior Software Engineer

SecureLogix Corporation
13750 San Pedro, Suite 230
San Antonio, TX 78232
Direct/Vmail (210) 402-9669 x949
http://www.securelogix.com

SECURELOGIX CORPORATION EMAIL NOTICE - This transmission may be strictly
confidential. If you are not the intended recipient of this message, you may
not disclose, print, copy, or disseminate this information. If you have
received this in error, please reply and notify the sender (only) and delete
the message. Unauthorized interception of this e-mail is a violation of
federal criminal law. This communication does not reflect an intention by
the sender or the sender's principal to conduct a transaction or make any
agreement by electronic means. Nothing contained in this message or in any
attachment shall satisfy the requirements for a writing, and nothing
contained herein shall constitute a contract or electronic signature under
the Electronic Signatures in Global and National Commerce Act, any version
of the Uniform Electronic Transactions Act, or any other statute governing
electronic transactions.

Reply via email to