1 2 3 Previous Next 34 Replies Latest reply on Dec 4, 2006 1:59 AM by Deepak anand

    Learning JBoss and XDoclet

    arun Newbie

      I am writing guide titled Start using JBoss with XDoclet, which can be downloaded from
      http://www.mycgiserver.com/~asahni/
      Please send me any comments for its improvement

        • 1. Re: Learning JBoss and XDoclet
          arun Newbie

          Some of people experienced problem in accessing early URL they can try from alternative URL of my home page.
          http://home.attbi.com/~arun.sahni/

          • 2. Re: Learning JBoss and XDoclet
            Baris Newbie

            Having a CMR section would be nice. I have been playing with it for a while but it could have been better with a tutorial.

            Baris

            • 3. Re: Learning JBoss and XDoclet
              Elmar Henne Newbie

              Hi asahni,

              I have started a collection of helpful beginner links in the thread "How to get started?" http://www.jboss.org/modules/bb/index.html?module=bb&op=viewtopic&t=forums/ Don't want you add your link to this thread?

              Elmar

              • 4. Re: Learning JBoss and XDoclet
                Elmar Henne Newbie

                Hi asahni,

                I have started a collection of helpful beginner links in the thread "How to get started?" http://www.jboss.org/modules/bb/index.html?module=bb&op=viewtopic&t=forums/ Don't want you add your link to this thread?

                Elmar

                • 5. Re: Learning JBoss and XDoclet
                  arun Newbie

                  I have made some changes in guide based on user feedback. Now it covers the following
                  -Basic setup of JBoss application server
                  -Setup of XDoclet
                  -First web application.
                  -First session bean.
                  -First CMP bean.
                  -First use of JMS as resource
                  -First MDB
                  -First Mail

                  You can download it from my home page
                  http://home.attbi.com/~arun.sahni/index.html
                  Good luck for JBoss learning.

                  • 6. Re: Learning JBoss and XDoclet
                    arun Newbie

                    I have made some changes in guide based on user feedback. Now it covers the following
                    -Basic setup of JBoss application server
                    -Setup of XDoclet
                    -First web application.
                    -First session bean.
                    -First CMP bean.
                    -First use of JMS as resource
                    -First MDB
                    -First Mail

                    You can download it from my home page
                    http://home.attbi.com/~arun.sahni/index.html
                    Good luck for JBoss learning.

                    • 7. Re: Learning JBoss and XDoclet
                      Jason Moody Newbie

                      I'm having problems with the example for a stateless EJB. I changed the build.xml file (which would not complete) fileset line to:





                      This allows a war file to be created an copied to jboss. But when I run the jsp page (FirstSession) I get the following error. How can I fix this?

                      2003-02-21 12:26:16,041 WARN [org.jboss.jbossweb] WARNING: Exception for /firstweb/jsp/FirstSession.jsp
                      org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.

                      /tmp/Jetty_0_0_0_0_8080__firstweb/jsp/FirstSession$jsp.java:5: Package test.ejb not found in import.
                      import test.ejb.*;
                      ^
                      1 error, 1 warning

                      at org.apache.jasper.compiler.Compiler.compile(Compiler.java:289)
                      at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:548)
                      at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:176)
                      at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:188)
                      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
                      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
                      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
                      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:366)
                      at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:293)
                      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:581)
                      at org.mortbay.http.HttpContext.handle(HttpContext.java:1687)
                      at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:544)
                      at org.mortbay.http.HttpContext.handle(HttpContext.java:1637)
                      at org.mortbay.http.HttpServer.service(HttpServer.java:875)
                      at org.jboss.jetty.Jetty.service(Jetty.java:543)
                      at org.mortbay.http.HttpConnection.service(HttpConnection.java:806)
                      at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:956)
                      at org.mortbay.http.HttpConnection.handle(HttpConnection.java:823)
                      at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:203)
                      at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:290)
                      at org.mortbay.util.ThreadPool$JobRunner.run(ThreadPool.java:743)
                      at java.lang.Thread.run(Thread.java:536)

                      • 8. Re: Learning JBoss and XDoclet
                        arun Newbie

                        Thanks for bringing error. Please change the import in FirstSession.jsp from test.ejb.* to com.helplab. The page dirctive be :
                        <%@ page language="java" import="javax.naming.InitialContext,java.util.*,com.helplab.*"%>

                        I checked the corrected code.

                        • 10. Re: Learning JBoss and XDoclet
                          Bing Newbie

                          Arun,

                          Thank you for posting this helpful guide.
                          I failed on running your first session bean sample through JBoss after successfully compiled and deployed. I got the following Linkage error:

                          org.apache.jasper.JasperException: Unexpected Error
                          java.lang.LinkageError: loader constraints violated when linking javax/transaction/UserTransaction class
                          at org.jboss.ejb.StatelessSessionEnterpriseContext.(StatelessSessionEnterpriseContext.java:45)
                          at org.jboss.ejb.plugins.StatelessSessionInstancePool.create(StatelessSessionInstancePool.java:61)
                          at org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.java:209)
                          at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:63)
                          at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:107)
                          at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:178)
                          at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:60)
                          at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130)
                          at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:204)
                          at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:313)
                          at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invoke(BaseLocalContainerInvoker.java:301)
                          at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:81)
                          at $Proxy42.helloworld(Unknown Source)
                          at org.apache.jsp.FirstSession_jsp._jspService(FirstSession_jsp.java:58)
                          at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:136)
                          at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
                          at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:204)
                          at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
                          at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
                          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:260)
                          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.valves.CertificatesValve.invoke(CertificatesValve.java:246)
                          at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
                          at org.jboss.web.catalina.session.ClusteredSessionValve.invoke(ClusteredSessionValve.java:78)
                          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.StandardContext.invoke(StandardContext.java:2396)
                          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:170)
                          at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
                          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
                          at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
                          at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:469)
                          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.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1040)
                          at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1151)
                          at java.lang.Thread.run(Thread.java:536)

                          at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:248)
                          at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
                          at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
                          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:260)
                          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.valves.CertificatesValve.invoke(CertificatesValve.java:246)
                          at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
                          at org.jboss.web.catalina.session.ClusteredSessionValve.invoke(ClusteredSessionValve.java:78)
                          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.StandardContext.invoke(StandardContext.java:2396)
                          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:170)
                          at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
                          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
                          at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
                          at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:469)
                          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.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1040)
                          at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1151)
                          at java.lang.Thread.run(Thread.java:536)


                          Do you have any idea how this happened and how to pass it?

                          Thank you.

                          bxz0052

                          • 11. Re: Learning JBoss and XDoclet
                            arun Newbie

                            I am not sure what is the problem in your setup. I do not have problem in running examples with JBoss+Tomcat. Are you able to run any JSP page in your setup? Are you abel to deploy any other session bean in your setup?

                            • 12. Re: Learning JBoss and XDoclet
                              arun Newbie

                              It is not happening on my setup with JBoss and Tomcat bundle. I am not sure about cause of problem. Are you able to run any other WAR application with JSP? What is the error on console when you deploy session bean?

                              • 13. Re: Learning JBoss and XDoclet
                                mzaremba Newbie

                                Hi,

                                I cannot build your "first" example. Below is stack error that I am getting. Do you know the reason.

                                Michal

                                [ejbdoclet] org.xml.sax.SAXParseException: The content of element type "enterprise-beans" is incomplete, it must match "(session|entity|message-driven)+".
                                [ejbdoclet] at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
                                [ejbdoclet] at xdoclet.util.XmlValidator.doValidate(XmlValidator.java:220)
                                [ejbdoclet] at xdoclet.util.XmlValidator.validate(XmlValidator.java:189)
                                [ejbdoclet] at xdoclet.XmlSubTask.engineFinished(XmlSubTask.java:240)
                                [ejbdoclet] at xdoclet.TemplateSubTask.startEngine(TemplateSubTask.java:561)
                                [ejbdoclet] at xdoclet.TemplateSubTask.startProcessForAll(TemplateSubTask.java:614)
                                [ejbdoclet] at xdoclet.TemplateSubTask.startProcess(TemplateSubTask.java:595)
                                [ejbdoclet] at xdoclet.XmlSubTask.startProcess(XmlSubTask.java:196)
                                [ejbdoclet] at xdoclet.modules.ejb.dd.EjbDotXmlSubTask.execute(EjbDotXmlSubTask.java:194)
                                [ejbdoclet] at xdoclet.XDocletMain.start(XDocletMain.java:46)
                                [ejbdoclet] at xdoclet.DocletTask.start(DocletTask.java:457)
                                [ejbdoclet] at xjavadoc.ant.XJavadocTask.execute(XJavadocTask.java:69)
                                [ejbdoclet] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:193)
                                [ejbdoclet] at org.apache.tools.ant.Task.perform(Task.java:341)
                                [ejbdoclet] at org.apache.tools.ant.Target.execute(Target.java:309)
                                [ejbdoclet] at org.apache.tools.ant.Target.performTasks(Target.java:336)
                                [ejbdoclet] at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
                                [ejbdoclet] at org.apache.tools.ant.Project.executeTargets(Project.java:1255)
                                [ejbdoclet] at org.apache.tools.ant.Main.runBuild(Main.java:609)
                                [ejbdoclet] at org.apache.tools.ant.Main.start(Main.java:196)
                                [ejbdoclet] at org.apache.tools.ant.Main.main(Main.java:235)
                                [ejbdoclet] 0 [main] ERROR XDocletMain.start - Running XDoclet failed.
                                [ejbdoclet] 0 [main] ERROR XDocletMain.start - <<Couldn't validate document C:\java\xdoclet\jboss\first\build\output\classes\META-INF\ejb-jar.xml>>
                                [ejbdoclet] file:c:/java/xdoclet/jboss/first/build.xml:57: XDoclet failed.
                                [ejbdoclet] at xdoclet.DocletTask.start(DocletTask.java:460)
                                [ejbdoclet] at xjavadoc.ant.XJavadocTask.execute(XJavadocTask.java:69)
                                [ejbdoclet] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:193)
                                [ejbdoclet] at org.apache.tools.ant.Task.perform(Task.java:341)
                                [ejbdoclet] at org.apache.tools.ant.Target.execute(Target.java:309)
                                [ejbdoclet] at org.apache.tools.ant.Target.performTasks(Target.java:336)
                                [ejbdoclet] at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
                                [ejbdoclet] at org.apache.tools.ant.Project.executeTargets(Project.java:1255)
                                [ejbdoclet] at org.apache.tools.ant.Main.runBuild(Main.java:609)
                                [ejbdoclet] at org.apache.tools.ant.Main.start(Main.java:196)
                                [ejbdoclet] at org.apache.tools.ant.Main.main(Main.java:235)
                                [ejbdoclet] Caused by: xdoclet.XDocletException: Couldn't validate document C:\java\xdoclet\jboss\first\build\output\classes\META-INF\ejb-jar.xml
                                [ejbdoclet] at xdoclet.util.XmlValidator.doValidate(XmlValidator.java:224)
                                [ejbdoclet] at xdoclet.util.XmlValidator.validate(XmlValidator.java:189)
                                [ejbdoclet] at xdoclet.XmlSubTask.engineFinished(XmlSubTask.java:240)
                                [ejbdoclet] at xdoclet.TemplateSubTask.startEngine(TemplateSubTask.java:561)
                                [ejbdoclet] at xdoclet.TemplateSubTask.startProcessForAll(TemplateSubTask.java:614)
                                [ejbdoclet] at xdoclet.TemplateSubTask.startProcess(TemplateSubTask.java:595)
                                [ejbdoclet] at xdoclet.XmlSubTask.startProcess(XmlSubTask.java:196)
                                [ejbdoclet] at xdoclet.modules.ejb.dd.EjbDotXmlSubTask.execute(EjbDotXmlSubTask.java:194)
                                [ejbdoclet] at xdoclet.XDocletMain.start(XDocletMain.java:46)
                                [ejbdoclet] at xdoclet.DocletTask.start(DocletTask.java:457)
                                [ejbdoclet] ... 10 more
                                [ejbdoclet] --- Nested Exception ---
                                [ejbdoclet] xdoclet.XDocletException: Couldn't validate document C:\java\xdoclet\jboss\first\build\output\classes\META-INF\ejb-jar.xml
                                [ejbdoclet] at xdoclet.util.XmlValidator.doValidate(XmlValidator.java:224)
                                [ejbdoclet] at xdoclet.util.XmlValidator.validate(XmlValidator.java:189)
                                [ejbdoclet] at xdoclet.XmlSubTask.engineFinished(XmlSubTask.java:240)
                                [ejbdoclet] at xdoclet.TemplateSubTask.startEngine(TemplateSubTask.java:561)
                                [ejbdoclet] at xdoclet.TemplateSubTask.startProcessForAll(TemplateSubTask.java:614)
                                [ejbdoclet] at xdoclet.TemplateSubTask.startProcess(TemplateSubTask.java:595)
                                [ejbdoclet] at xdoclet.XmlSubTask.startProcess(XmlSubTask.java:196)
                                [ejbdoclet] at xdoclet.modules.ejb.dd.EjbDotXmlSubTask.execute(EjbDotXmlSubTask.java:194)
                                [ejbdoclet] at xdoclet.XDocletMain.start(XDocletMain.java:46)
                                [ejbdoclet] at xdoclet.DocletTask.start(DocletTask.java:457)
                                [ejbdoclet] at xjavadoc.ant.XJavadocTask.execute(XJavadocTask.java:69)
                                [ejbdoclet] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:193)
                                [ejbdoclet] at org.apache.tools.ant.Task.perform(Task.java:341)
                                [ejbdoclet] at org.apache.tools.ant.Target.execute(Target.java:309)
                                [ejbdoclet] at org.apache.tools.ant.Target.performTasks(Target.java:336)
                                [ejbdoclet] at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
                                [ejbdoclet] at org.apache.tools.ant.Project.executeTargets(Project.java:1255)
                                [ejbdoclet] at org.apache.tools.ant.Main.runBuild(Main.java:609)
                                [ejbdoclet] at org.apache.tools.ant.Main.start(Main.java:196)
                                [ejbdoclet] at org.apache.tools.ant.Main.main(Main.java:235)

                                BUILD FAILED
                                file:c:/java/xdoclet/jboss/first/build.xml:57: Unexpected error

                                Total time: 12 seconds

                                • 14. Re: Learning JBoss and XDoclet
                                  arun Newbie

                                  Michael
                                  Thanks for feedback. I have made changes in pdf and checked correct code with it. This time I have included tested build files for direct deployment in server.
                                  Happy JBossing.

                                  1 2 3 Previous Next