Hi,
I wrote some code to marshal a bean using a mapping file generated using the
MappingTool. This works fine when I am calling the methods that do the
marshalling from a simple java applications main() method.
When I copy these methods into a backing bean, upload my application to
Tomcat and try to run the code from there an exception is thrown and I get
the stack trace at the end of this message. The
com.anabus.gamma.faces.DisplayManagerBean is not one of the beans being
marshaled but it contains methods that are supposed to marshal other
objects. Why is the exception being thrown?
If I comment out the body of the method doing the marshalling I do not get
the exception (method body below exception stack trace)
Any help or insight would be greatly appreciated.
Thanks in advance.
Tom.
===========
Stack Trace
===========
ERROR ClassUtils - Class :
com.anabus.gamma.faces.DisplayManagerBean not found.
java.lang.NoClassDefFoundError: org/exolab/castor/xml/ValidationException
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2328)
at java.lang.Class.getConstructor0(Class.java:2640)
at java.lang.Class.newInstance0(Class.java:321)
at java.lang.Class.newInstance(Class.java:303)
at
org.apache.myfaces.util.ClassUtils.newInstance(ClassUtils.java:274)
at
org.apache.myfaces.util.ClassUtils.newInstance(ClassUtils.java:265)
at
org.apache.myfaces.config.ManagedBeanBuilder.buildManagedBean(ManagedBeanBui
lder.java:49)
at
org.apache.myfaces.el.VariableResolverImpl.resolveVariable(VariableResolverI
mpl.java:311)
at
oracle.adfinternal.view.faces.el.AdfFacesVariableResolver.resolveVariable(Ad
fFacesVariableResolver.java:40)
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)
at
org.apache.myfaces.custom.tree2.UITreeData.getValue(UITreeData.java:257)
at
org.apache.myfaces.custom.tree2.UITreeData.getDataModel(UITreeData.java:395)
at
org.apache.myfaces.custom.tree2.UITreeData.saveState(UITreeData.java:91)
at
org.apache.myfaces.custom.tree2.HtmlTree.saveState(HtmlTree.java:60)
at
javax.faces.component.UIComponentBase.processSaveState(UIComponentBase.java:
462)
at
javax.faces.component.UIComponentBase.processSaveState(UIComponentBase.java:
456)
at
javax.faces.component.UIComponentBase.processSaveState(UIComponentBase.java:
456)
at
javax.faces.component.UIComponentBase.processSaveState(UIComponentBase.java:
456)
at
javax.faces.component.UIComponentBase.processSaveState(UIComponentBase.java:
456)
at
javax.faces.component.UIComponentBase.processSaveState(UIComponentBase.java:
456)
at
javax.faces.component.UIComponentBase.processSaveState(UIComponentBase.java:
456)
at
javax.faces.component.UIComponentBase.processSaveState(UIComponentBase.java:
456)
at
javax.faces.component.UIComponentBase.processSaveState(UIComponentBase.java:
456)
at
javax.faces.component.UIComponentBase.processSaveState(UIComponentBase.java:
456)
at
javax.faces.component.UIComponentBase.processSaveState(UIComponentBase.java:
456)
at
javax.faces.component.UIComponentBase.processSaveState(UIComponentBase.java:
456)
at
oracle.adfinternal.view.faces.application.StateManagerImpl.saveSerializedVie
w(StateManagerImpl.java:187)
at
com.sun.faces.taglib.jsf_core.ViewTag.doAfterBody(ViewTag.java:169)
at
org.apache.jsp.pages.results_jsp._jspx_meth_f_view_0(org.apache.jsp.pages.re
sults_jsp:114)
at
org.apache.jsp.pages.results_jsp._jspService(org.apache.jsp.pages.results_js
p:68)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
32)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:173)
at
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter
.java:362)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:202)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:173)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
java:672)
at
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDis
patcher.java:463)
at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatch
er.java:398)
at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher
.java:301)
at
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:
322)
at
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:13
0)
at
oracle.adfinternal.view.faces.application.ViewHandlerImpl.renderView(ViewHan
dlerImpl.java:157)
at
oracle.adfinternal.view.faces.application.ViewHandlerImpl.renderView(ViewHan
dlerImpl.java:157)
at
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java
:87)
at
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
at
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:107)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:173)
at
org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsF
ilter.java:122)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:202)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:173)
at
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter
.java:362)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:202)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:178)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126
)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105
)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processC
onnection(Http11BaseProtocol.java:667)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.jav
a:527)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWo
rkerThread.java:80)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:684)
at java.lang.Thread.run(Thread.java:595)
===========
Method Body
===========
private void marshalData() {
Mapping mapping;
File outputXMLFile;
Writer writer;
Marshaller marshaller;
Output[] output;
try {
// Load OneWay mapping file
mapping = new Mapping();
mapping.loadMapping("XML\\mapping\\OneWayMapping.xml");
// Get data for first OneWay output
output = (Output[])resultsMap.get("Output 1");
// Marshal the array of OneWayOutput objects
outputXMLFile = new File("XML\\Output1.xml");
writer = new FileWriter(outputXMLFile);
marshaller = new Marshaller(writer);
marshaller.setMapping(mapping);
marshaller.marshal(output);
// Get data for second OneWay output
output = (Output[])resultsMap.get("Output 2");
// Marshal the array of OneWayOutput objects
outputXMLFile = new File("XML\\Output2.xml");
writer = new FileWriter(outputXMLFile);
marshaller = new Marshaller(writer);
marshaller.setMapping(mapping);
marshaller.marshal(output);
// Load TwoWay mapping file
mapping = new Mapping();
mapping.loadMapping("XML\\mapping\\TwoWayMapping.xml");
// Get data for first TwoWay output
output = (Output[])resultsMap.get("Output 3");
// Marshal the array of TwoWayOutput objects
outputXMLFile = new File("XML\\Output3.xml");
writer = new FileWriter(outputXMLFile);
marshaller = new Marshaller(writer);
marshaller.setMapping(mapping);
marshaller.marshal(output);
}
catch (IOException e) {
e.printStackTrace(System.err);
}
catch (MarshalException e) {
e.printStackTrace(System.err);
}
catch (MappingException e) {
e.printStackTrace(System.err);
}
catch (ValidationException e) {
e.printStackTrace(System.err);
}
catch (Exception e) {
e.printStackTrace(System.err);
}
}
AnaBus Analytic Business Services, Inc.
With better information, we help you make better decisions.
Thomas A. Hurley
(215) 576-8447 ext.104
(215) 576-8452 fax
[EMAIL PROTECTED]
-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:
[EMAIL PROTECTED]
-------------------------------------------------