This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reading and Parsing XML Files with Enterprise JavaBeans Problem

 
Stanley Chang Shen
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3150
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic