2 Replies Latest reply: May 6, 2013 8:09 AM by 1007286 RSS

    Problem with EJB3 sample in JEE6 tutorial

    1007286
      Folks'es,

      I'm working my way through the [JEE6 tutorials|http://docs.oracle.com/javaee/6/tutorial/doc/bnbod.html] and arrived at the EJB part and the cart example.

      However, I can't get it to work, neither from NetBeans 7.3 nor from command line using ant. When I start the client app it just sits there for ever, doing nothing, saying nothing, not even an error.

      Glassfish 3.1.2.2 (build 5) shows the following warning during start up:
      WARNUNG: ACDEPL112: The following extensions or libraries are referenced from the manifest of C:\glassfish3\glassfish\docs\javaee-tutorial\examples\ejb\cart\dist\gfdeploy\cart\cart-app-client.jar but were not found where indicated: cart-ejb.jar ; ignoring and continuing
      Could that be related to the client not doing anything?
      What's the reason for this msg?
      What am I doing wrong, I followed the tut to the point?

      Thanks,
      Thomas
        • 1. Re: Problem with EJB3 sample in JEE6 tutorial
          gimbal2
          1004283 wrote:
          What am I doing wrong, I followed the tut to the point?
          Welcome to the internet, tutorials tend to be broken and incomplete (and stay that way because nobody feels responsible for fixing them) and absolutely do not serve as the primary source of knowledge and understanding, they are only a quick reference at best.

          A book is a better source of information, I highly recommend you to obtain "Enterprise Javabeans 3.1"; it is the best book on EJB tech that I know. For any assistance you'll have to post the code you've been using so far (use \
           tags) and explain what you did to try and deploy it. The problem may be in the deployment part since the error you get basically translates to "I can't find cart-ejb.jar".                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
          • 2. Re: Problem with EJB3 sample in JEE6 tutorial
            1007286
            Thanx, gimbal2, for your suggestion. Sometimes its just not an option to learn by the book, even though you certainly are right about it...

            In general, the project comes with all the necessary ant files set up (so I would have thought) to deploy thins correctly. It consists of 3 build.xml files which I have not modified.
            [project root]/build.xml:
            <project name="cart" default="default" basedir="." xmlns:ear="http://www.netbeans.org/ns/j2ee-earproject/1">
                <description>Builds, tests, and runs the project .</description>
            
                <property name="is.ear.module" value="true"/>
            
                <path id="ear-components">
                    <filelist dir="./cart-ejb" files="build.xml"/>
                    <filelist dir="./cart-app-client" files="build.xml"/>
                </path>
            
                <import file="../../bp-project/main.xml"/>
            
                <target name="-pre-init" if="debug">
                    <echo message="---------------------------------------------------"/>
                    <echo message="Classpath info"/>
                    <echo message="---------------------------------------------------"/>
                    <property name="cp" refid="classpath"/>
                    <echo message="Classpath is ${cp}"/>
                    <echo message="---------------------------------------------------"/>
                    <echo message="Project properties"/>
                    <echo message="---------------------------------------------------"/>
                    <echoproperties/>
                </target>
            
                <target name="all" unless="netbeans.home" depends="clean,default">
                    <antcall target="run"/>
                </target>
            
                <target name="run-nb" if="netbeans.home" depends="init">
                    <antcall target="run-ac"/>
                </target>
            
                <target name="run-ant" unless="netbeans.home" depends="init">
                    <antcall target="client-jar"/>
                    <antcall target="bpp-run-app-client"/>
                </target>
            
                <target name="run" depends="init,run-deploy">
                    <antcall target="run-ant"/>
                    <antcall target="run-nb"/>
                </target>
            
            </project>
            cart-app-client/build.xml
            <project name="cart-app-client" default="default" basedir=".">
                <description>Builds, tests, and runs the project cart-app-client.</description>
            
                <path id="common.jars">
                    <filelist dir="../cart-ejb" files="build.xml"/>
                </path>
            
                <macrodef name="iterate">
                    <attribute name="target"/>
                    <sequential>
                        <subant target="@{target}" failonerror="false">
                            <buildpath refid="common.jars"/>
                        </subant>
                    </sequential>
                </macrodef>
            
                <property name="is.app-client.module" value="true"/>
            
                <import file="../../../bp-project/main.xml"/>
            
                <target name="-pre-init" if="debug">
                    <echo message="---------------------------------------------------"/>
                    <echo message="Classpath info"/>
                    <echo message="---------------------------------------------------"/>
                    <property name="cp" refid="classpath"/>
                    <echo message="Classpath is ${cp}"/>
                    <echo message="---------------------------------------------------"/>
                    <echo message="Project properties"/>
                    <echo message="---------------------------------------------------"/>
                    <echoproperties/>
                </target>
            
                <target name="-pre-compile" unless="netbeans.home" depends="build-common"/>
            
                <target name="build-common" unless="netbeans.home" depends="init">
                    <iterate target="default"/>
                </target>
            
            </project>
            cart-ejb/build.xml
            <project name="cart-ejb" default="default" basedir="." xmlns:ejbjarproject="http://www.netbeans.org/ns/j2ee-ejbjarproject/2">
                <description>Builds, tests, and runs the project .</description>
                <property name="is.ejb-jar.module" value="true"/>
            
                <import file="../../../bp-project/main.xml"/>
            
                <target name="-pre-init" if="debug">
                    <echo message="---------------------------------------------------"/>
                    <echo message="Classpath info"/>
                    <echo message="---------------------------------------------------"/>
                    <property name="cp" refid="classpath"/>
                    <echo message="Classpath is ${cp}"/>
                    <echo message="---------------------------------------------------"/>
                    <echo message="Project properties"/>
                    <echo message="---------------------------------------------------"/>
                    <echoproperties/>
                </target>
            </project>
            The server says that both jar-files are deployed correctly (if understand the output correctly)...