1 2 3 Previous Next 34 Replies Latest reply on Dec 4, 2006 1:59 AM by anand_deepak2003 Go to original post
      • 15. Re: Learning JBoss and XDoclet
        billfanaus

        In order to get the FirstSession bean working, I found the following are needed:

        1. Get to it at http://localhost:8080/firstweb/jsp/FirstSession.jsp. The document did not point it to the correct path.

        2. I create an application.xml under firstweb\src, it simply contains the the following:

        <?xml version="1.0" encoding="UTF-8"?>


        <display-name>First JBoss </display-name>


        first.jar




        3. Need to add a block of code to create the first.ear in the first\build.xml, and deploy it instead of deploying frist.jar.

        I use the following:
        <!-- ================ -->
        <!-- Create the ear archives -->
        <!-- ================ -->










        4. Modify the block of code <target name="deploy" ... , so it looks like the following:

        <target name="deploy" description="This will deploy files in jboss" depends="jar,ear,jar-client">

        <!-- fileset file="&#36;&#123;project.dir&#125;/dist/&#36;&#123;project.name&#125;.jar" / -->
        <fileset file="&#36;&#123;project.dir&#125;/dist/&#36;&#123;project.name&#125;.ear" />




        Then, run ant to build it...

        It works for me in this way. Hope it helps ;-)

        • 16. Re: Learning JBoss and XDoclet
          asahni

          I am not sure why there is need for ear when you are not packaging war file into it or having more then one version of jar deploy into it. Since Jboss default implementation for class loading is UCL (See manual page 46-48) . If you have not change default class loading attribute then it should work. I just tried again on my setup and it is working ok without making ear file of first session bean. I am using Tomcat not jetty as web container hope you are doing same.

          • 17. Re: Learning JBoss and XDoclet
            sysuser1

            Hi asahni,

            got probs with your "firstCmp" application:

            2003-05-14 11:13:36,508 INFO [org.jboss.deployment.MainDeployer] Starting deployment of package: file:/C:/Applications/jboss/server/default/deploy/firstCmp.jar
            2003-05-14 11:13:36,669 INFO [org.jboss.ejb.EJBDeployer] looking for nested deployments in : file:/C:/Applications/jboss/server/default/deploy/firstCmp.jar
            2003-05-14 11:13:37,159 WARN [org.jboss.ejb.EJBDeployer.verifier] EJB spec violation:
            Bean : Test
            Method : public abstract Collection ejbSelectByName(String)
            Section: 10.6.7
            Warning: Select methods of an entity bean class must define javax.ejb.FinderException in their throws clause.


            Any hints?

            Paul

            • 18. Re: Learning JBoss and XDoclet
              asahni

              what is the Jboss version are you using?
              Is it same as I used in my guide?

              • 19. Re: Learning JBoss and XDoclet
                findulas

                I use 3.2.1 wit Tomcat 4.1.24 and have the same problem.

                • 20. Re: Learning JBoss and XDoclet
                  sysuser1

                  Hi,

                  I'm using JBoss 3.2.0

                  bye

                  • 21. Re: Learning JBoss and XDoclet
                    asahni

                    I used 3.04 with tomcat 4.1.12. I try on jboss 3.2 soon.

                    • 22. Re: Learning JBoss and XDoclet
                      jiuyang

                      In the RegisterBean.java, declare the exception and use ejb.select tag for the ejbSelectByName method. On top of your file, just specify one line for the jboss.query tag.

                      Below is the sample code. I am attaching the source that I modified here.

                      /* jboss.query
                      * signature="java.util.Collection ejbSelectByName(java.lang.String name)"

                      /**
                      * @ejb.select
                      * query="SELECT DISTINCT OBJECT(o) FROM Test o WHERE o.name = ?1"
                      * result-type-mapping="Remote"
                      */
                      public abstract java.util.Collection ejbSelectByName(java.lang.String name) throws FinderException;

                      • 23. Re: Learning JBoss and XDoclet
                        asahni

                        Thanks for feedback. I updated for JBoss 3.2.1-tomcat-4.1.24 bundle and added java client for Session,MDB and CMP. Please download correct version as per your requirement.

                        • 24. Re: Learning JBoss and XDoclet
                          danielwikman


                          Hi all!

                          Thanx for the first usable getting started documentation!
                          I have done some posts to this forum and it is not much
                          help, Except for you guys of course!

                          I have some comments as well. I am running Jboss 3.2.1
                          and Jetty. I have been able to pass parts of your guide.
                          If you would like I can keep you posted, then you can
                          update the guide with Jetty stuff.

                          I have run into these problems (so far):

                          1) When configuring 3.2.1, it seems like the server does
                          not automatically put all jars in
                          jboss/server/all/deploy
                          to the server classpath. So I had to copy the
                          mysql-connector jar into the jboss/lib to get it
                          working.

                          2) The same goes for the first.jar. The FirstSession.jsp
                          cannot find these classes, they are not in the
                          classpath for jetty. I read the Jboss.org documentation
                          (The not working examples) and it said that if a
                          war wanted to access the J2EE beans in a ear/jar the
                          client classes should be packed into WEB-INF/lib,
                          so I added the first/dist/firstClient.jar to the
                          firstweb jar under WEB-INF/lib, then it worked.

                          - Are there better ways to do this, like changing the
                          Jboss classpath???

                          BR

                          Daniel

                          • 25. Re: Learning JBoss and XDoclet
                            jiuyang

                            Hi,

                            a) For the mysql-jdbc driver, did you follow asahni's guide and put the jar file in /server/default/lib? It works for me... remember to tweak the mysql-ds.xml after that.

                            b) no problem to me with first.jar. i am attaching my copy of firstsession.jsp for u to compare if u want

                            >
                            > Hi all!
                            >
                            > Thanx for the first usable getting started
                            > documentation!
                            > I have done some posts to this forum and it is not
                            > much
                            > help, Except for you guys of course!
                            >
                            > I have some comments as well. I am running Jboss
                            > 3.2.1
                            > and Jetty. I have been able to pass parts of your
                            > guide.
                            > If you would like I can keep you posted, then you
                            > can
                            > update the guide with Jetty stuff.
                            >
                            > I have run into these problems (so far):
                            >
                            > 1) When configuring 3.2.1, it seems like the server
                            > does
                            > not automatically put all jars in
                            > jboss/server/all/deploy
                            > to the server classpath. So I had to copy the
                            > mysql-connector jar into the jboss/lib to get it
                            > working.
                            >
                            > 2) The same goes for the first.jar. The
                            > FirstSession.jsp
                            > cannot find these classes, they are not in the
                            > classpath for jetty. I read the Jboss.org
                            > rg documentation
                            > (The not working examples) and it said that if a
                            > war wanted to access the J2EE beans in a ear/jar
                            > ar the
                            > client classes should be packed into WEB-INF/lib,
                            > b,
                            > so I added the first/dist/firstClient.jar to the
                            > firstweb jar under WEB-INF/lib, then it worked.
                            >
                            > - Are there better ways to do this, like changing
                            > the
                            > Jboss classpath???
                            >
                            > BR
                            >
                            > Daniel

                            • 26. Re: Learning JBoss and XDoclet
                              danielwikman

                              Thanx for the ideas, after posting I started thinking ?)

                              a) Oops, sorry... I jumped the gun there. I saw later
                              today that when I ran /etc/init.d/jboss restart
                              it failed so that is probably why this did not work.
                              I have to rewrite the script that Jboss supplied,
                              it seems like it needs a "sleep" between the
                              shutdown commands and the start command.

                              b) This happends for the Jetty engine. The webpage
                              I can see when refering to the FirstSession.jsp
                              is jsp servlet compilation errors from "Jetty" saying
                              that it cannot find the classes TestSession,
                              TestSessionLocal etc. I cannot give you the answer
                              if the solution for a) solves this. I do not know
                              whether Jboss came into some strange state when
                              started in 2 instances. I cannot verify this until
                              after the weekend since the FAN to my "hack"
                              computer broke yesterday :(. I'll continue to report
                              problems as soon as it is up and running.

                              BR

                              /Daniel

                              • 27. Re: Learning JBoss and XDoclet
                                jiuyang

                                It will be great if you could add some advanced examples, e.g. CMR, in yr tutorial:)


                                > Thanks for feedback. I updated for JBoss
                                > 3.2.1-tomcat-4.1.24 bundle and added java client for
                                > Session,MDB and CMP. Please download correct version
                                > as per your requirement.

                                • 28. Re: Learning JBoss and XDoclet
                                  suneth

                                  Hi Guys
                                  I'm trying out asahni's tutorial which is pretty good and easy to understand. However i cant seem to find the parser.jar and jaxp.jar files needed to complile the samples.

                                  Does anyone know where i can find these files?

                                  thx.
                                  -suneth

                                  • 29. Re: Learning JBoss and XDoclet
                                    columod

                                    hi,
                                    great document.
                                    what would also be really useful to add is setting up hibernate with xdoclet and jboss.
                                    i've recently done this and it took a while as there are pieces of documentation all over the place.
                                    i include relevant parts of my ant build.xml if you'd like to use it :


                                    <!-- =================================================================== -->
                                    <!-- Invoke XDoclet's hibernate -->
                                    <!-- =================================================================== -->


                                    +---------------------------------------------------+
                                    | |
                                    | RUNNING HIBERNATEDOCLET |
                                    | |
                                    +---------------------------------------------------+













                                    <!-- =================================================================== -->
                                    <!-- Compiles all the hibernate classes -->
                                    <!-- =================================================================== -->



                                    +---------------------------------------------------+
                                    | |
                                    | COMPILING HIBERNATE SOURCES |
                                    | |
                                    +---------------------------------------------------+








                                    <!-- =================================================================== -->
                                    <!-- Export database schema to a file -->
                                    <!-- =================================================================== -->



                                    +---------------------------------------------------+
                                    | |
                                    | EXPORTING DATABASE SCHEMA |
                                    | |
                                    +---------------------------------------------------+






















                                    <!-- =================================================================== -->
                                    <!-- Compose the hibernate sar file -->
                                    <!-- =================================================================== -->



                                    +---------------------------------------------------+
                                    | |
                                    | BUILDING HIBERNATE SAR AND JAR FILES |
                                    | |
                                    +---------------------------------------------------+




















                                    ====================================

                                    the .sar needs to be deployed and bobs your uncle you can use hibernate ;-)
                                    cheers,
                                    colum.