Hi Stephen & Robby, Thank you for your help. You were right I forgot to include the castor jar in the WEB-INF/lib directory of my war file. I still have not got things to work fully yet but I do not believe my problems are castor related.
BTW thank you to all of the group for such an amazing piece of software. The whole XML/Java binding thing was very abstract to me up to now. Thanks. Tom. > -----Original Message----- > From: Pelssers, Robby, VF-NL [mailto:[EMAIL PROTECTED] > Sent: Wednesday, March 01, 2006 10:24 AM > To: [email protected] > Subject: RE: [castor-user] Getting NoClassDefFoundError for class > containing methods that marshal other objects > > I should have pointed you to this url: > > http://tomcat.apache.org/tomcat-5.5-doc/appdev/deployment.html > > Sorry, my mistake :-) > > Robby > > -----Original Message----- > From: Pelssers, Robby, VF-NL [mailto:[EMAIL PROTECTED] > Sent: woensdag 1 maart 2006 16:22 > To: [email protected] > Subject: RE: [castor-user] Getting NoClassDefFoundError for class > containing methods that marshal other objects > > > Try following : > > When you install an application into Tomcat (or any other > 2.2/2.3-compatible server), the classes in the WEB-INF/classes/ > directory, as well as all classes in JAR files found in the WEB-INF/lib/ > directory, are made visible to other classes within your particular web > application. > > Have a look at > D:\tools\apache-tomcat-5.5.15\webapps\tomcat-docs\appdev\deployment.html > for howto deploy webapp in tomcat > > > Cheers, > Robby Pelssers > > -----Original Message----- > From: Stephen Bash [mailto:[EMAIL PROTECTED] > Sent: woensdag 1 maart 2006 14:55 > To: [email protected] > Subject: Re: [castor-user] Getting NoClassDefFoundError for class > containing methods that marshal other objects > > > Tom- > > It looks like Tomcat can't find the Castor JAR. (the > NoClassDefFoundError states Java is looking for the ValidationException > class, but can't find it). That being said, I personally have never > used Castor inside Tomcat, so I'm probably not much help. > > Stephen > > > On 2/28/06, Thomas A Hurley <[EMAIL PROTECTED]> wrote: > > 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(ManagedB > > eanBui > > lder.java:49) > > at > > > org.apache.myfaces.el.VariableResolverImpl.resolveVariable(VariableResol > verI > > mpl.java:311) > > at > > > oracle.adfinternal.view.faces.el.AdfFacesVariableResolver.resolveVariabl > e(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(ExpressionEvaluat > orIm > > 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.j > ava: > > 462) > > at > > > javax.faces.component.UIComponentBase.processSaveState(UIComponentBase.j > ava: > > 456) > > at > > > javax.faces.component.UIComponentBase.processSaveState(UIComponentBase.j > ava: > > 456) > > at > > > javax.faces.component.UIComponentBase.processSaveState(UIComponentBase.j > ava: > > 456) > > at > > > javax.faces.component.UIComponentBase.processSaveState(UIComponentBase.j > ava: > > 456) > > at > > > javax.faces.component.UIComponentBase.processSaveState(UIComponentBase.j > ava: > > 456) > > at > > > javax.faces.component.UIComponentBase.processSaveState(UIComponentBase.j > ava: > > 456) > > at > > > javax.faces.component.UIComponentBase.processSaveState(UIComponentBase.j > ava: > > 456) > > at > > > javax.faces.component.UIComponentBase.processSaveState(UIComponentBase.j > ava: > > 456) > > at > > > javax.faces.component.UIComponentBase.processSaveState(UIComponentBase.j > ava: > > 456) > > at > > > javax.faces.component.UIComponentBase.processSaveState(UIComponentBase.j > ava: > > 456) > > at > > > javax.faces.component.UIComponentBase.processSaveState(UIComponentBase.j > ava: > > 456) > > at > > > oracle.adfinternal.view.faces.application.StateManagerImpl.saveSerialize > dVie > > 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.page > s.re > > sults_jsp:114) > > at > > > org.apache.jsp.pages.results_jsp._jspService(org.apache.jsp.pages.result > s_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.ja > va: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(Applica > tion > > FilterChain.java:252) > > at > > > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt > erCh > > ain.java:173) > > at > > > org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFi > lter > > .java:362) > > at > > > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica > tion > > FilterChain.java:202) > > at > > > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt > erCh > > ain.java:173) > > at > > > org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatc > her. > > java:672) > > at > > > org.apache.catalina.core.ApplicationDispatcher.processRequest(Applicatio > nDis > > patcher.java:463) > > at > > > org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDisp > atch > > er.java:398) > > at > > > org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispat > cher > > .java:301) > > at > > > com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.j > ava: > > 322) > > at > > > com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.jav > a:13 > > 0) > > at > > > oracle.adfinternal.view.faces.application.ViewHandlerImpl.renderView(Vie > wHan > > dlerImpl.java:157) > > at > > > oracle.adfinternal.view.faces.application.ViewHandlerImpl.renderView(Vie > wHan > > 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(Applica > tion > > FilterChain.java:252) > > at > > > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt > erCh > > ain.java:173) > > at > > > org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(Extensi > onsF > > ilter.java:122) > > at > > > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica > tion > > FilterChain.java:202) > > at > > > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt > erCh > > ain.java:173) > > at > > > org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFi > lter > > .java:362) > > at > > > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica > tion > > FilterChain.java:202) > > at > > > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt > erCh > > ain.java:173) > > at > > > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv > e.ja > > va:213) > > at > > > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv > e.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:1 > 48) > > at > > > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:86 > 9) > > at > > > org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.proc > essC > > onnection(Http11BaseProtocol.java:667) > > at > > > org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint > .jav > > a:527) > > at > > > org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollow > erWo > > 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 helpyou makebetterdecisions. 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] > > ------------------------------------------------- > > > > > > ------------------------------------------------- > If you wish to unsubscribe from this list, please > send an empty message to the following address: > > [EMAIL PROTECTED] > ------------------------------------------------- > > > ------------------------------------------------- > If you wish to unsubscribe from this list, please > send an empty message to the following address: > > [EMAIL PROTECTED] > ------------------------------------------------- ------------------------------------------------- If you wish to unsubscribe from this list, please send an empty message to the following address: [EMAIL PROTECTED] -------------------------------------------------

