aspose file tools*
The moose likes XML and Related Technologies and the fly likes Reading and Parsing XML Files with Enterprise JavaBeans Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Reading and Parsing XML Files with Enterprise JavaBeans Problem" Watch "Reading and Parsing XML Files with Enterprise JavaBeans Problem" New topic
Author

Reading and Parsing XML Files with Enterprise JavaBeans Problem

Stanley Chang Shen
Greenhorn

Joined: Oct 27, 2004
Posts: 3
hello everyone,

I am a beginner in Java and also XML.

I had used SAX Parsing technique to parse XML in J2SE. The problem comes when i try to implement it in EJB which is J2EE technology.

I had try out the example in this link and still trying to make it work.

http://www.stardeveloper.com/articles/display.html?article=2001120601&page=1

For your information application server i use it JBoss and Tomcat as its require in the example on the link above.

The problem i get here is taken from the error generated by Tomcat and is stated below:

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 7 in the jsp file: /xmlReaderEJB.jsp

Generated servlet error:
[javac] Compiling 1 source file

C:\Tomcat 4.1\work\Standalone\localhost\jboss\xmlReaderEJB_jsp.java:58: cannot access javax.ejb.EJBHome
file javax\ejb\EJBHome.class not found
XMLReader bean = home.create();
^



An error occurred at line: 7 in the jsp file: /xmlReaderEJB.jsp

Generated servlet error:
C:\Tomcat 4.1\work\Standalone\localhost\jboss\xmlReaderEJB_jsp.java:60: cannot access javax.ejb.EJBObject
file javax\ejb\EJBObject.class not found
bean.readXML("C:\\Projects\\TomcatJBoss\\xml\\Contacts.xml");
^



An error occurred at line: 7 in the jsp file: /xmlReaderEJB.jsp

Generated servlet error:
C:\Tomcat 4.1\work\Standalone\localhost\jboss\xmlReaderEJB_jsp.java:61: cannot resolve symbol
symbol : method remove ()
location: interface com.stardeveloper.ejb.session.XMLReader
bean.remove();
^
3 errors

at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:130)
at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:293)
at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:353)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:370)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:473)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:190)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2422)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:163)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:199)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:700)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:584)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:534)
-------------------------------------------------------------------------

Anyone had any idea how to solve the error above?...thank you very much...
[ October 27, 2004: Message edited by: Stanley Chang Shen ]
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
You have check whether your jsp is able to import and locate class com.stardeveloper.ejb.session.XMLReaderHome, Your jsp is not able to locate or access the ejb clasess.
The error is not related to XML parsing, so i am moving this thread to EJB forum.
Folks their may help you more.


Spritle Software Blogs
 
 
subject: Reading and Parsing XML Files with Enterprise JavaBeans Problem