5 Replies Latest reply on Oct 2, 2002 4:34 AM by rood

    Deploying EJB - not bound !

    rood

      Hi,

      I use JBoss 3.0.2, jdk 1.3, struts on redhat 7.2.
      I have a pb for all my session and entity beans : not bound...
      I put mysql-service.xml in defautl/deploy and mysql.jar in default/lib.
      Ejb-jar, jboss.xml, jbosscmp-jdbc.xml in my meta-inf project.

      I forgot something ?

        • 1. Re: Deploying EJB - not bound !

          Stacktrace and deployment descriptors? :-)

          Regards,
          Adrian

          • 2. Re: Deploying EJB - not bound !
            rood

            Tanks trying helping me !

            I use JBoss 3.0.2, jdk1.3, Mysql and Struts.
            When I access my jsp page, I have this error :

            2002-09-30 23:43:15,068 WARN [org.jboss.jbossweb] WARNING: Exception for /person/action/viewOwner?id=10
            eu.ohim.common.util.HomeFactoryException: OwnerFacade not bound
            at eu.ohim.common.util.EJBHomeFactory.lookUpHome(EJBHomeFactory.java:146)
            at eu.ohim.common.per.gui.action.OwnerAction.load(OwnerAction.java:208)
            at eu.ohim.common.per.gui.action.OwnerAction.execute(OwnerAction.java:62)
            at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:446)

            ...etc...

            My configuration is this one :
            - mysql-service.xml in server/default/deploy

            <application-policy name = "MySqlDbRealm">

            <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule" flag = "required">
            <module-option name = "principal">per</module-option>
            <module-option name = "userName">root</module-option>
            <module-option name = "password">pass</module-option>
            <module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=MySqlDS</module-option>
            </login-module>

            </application-policy>

            NOTE: the application-policy name attribute must match SecurityDomainJndiName, and the
            module-option name = "managedConnectionFactoryName"
            must match the object name of the ConnectionManager you are configuring here.
            -->
            <!--uncomment out this line if you are using the MySqlDbRealm above
            MySqlDbRealm
            -->
            <depends optional-attribute-name="ManagedConnectionFactoryName">
            <!--embedded mbean-->

            MySqlDS


            <config-property name="ConnectionURL" type="java.lang.String">jdbc:mysql://localhost:3306/devel</config-property>
            <config-property name="DriverClass" type="java.lang.String">com.mysql.jdbc.Driver</config-property>
            <!--set these only if you want only default logins, not through JAAS -->
            <config-property name="UserName" type="java.lang.String">root</config-property>
            <config-property name="Password" type="java.lang.String">pass</config-property>



            <!--Below here are advanced properties -->
            <!--hack-->
            <depends optional-attribute-name="OldRarDeployment">jboss.jca:service=RARDeployment,name=JBoss LocalTransaction JDBC Wrapper


            <depends optional-attribute-name="ManagedConnectionPool">
            <!--embedded mbean-->

            0
            50
            5000
            15
            <!--criteria indicates if Subject (from security domain) or app supplied
            parameters (such as from getConnection(user, pw)) are used to distinguish
            connections in the pool. Choices are
            ByContainerAndApplication (use both),
            ByContainer (use Subject),
            ByApplication (use app supplied params only),
            ByNothing (all connections are equivalent, usually if adapter supports
            reauthentication)-->
            ByContainer


            <depends optional-attribute-name="CachedConnectionManager">jboss.jca:service=CachedConnectionManager
            <depends optional-attribute-name="JaasSecurityManagerService">jboss.service:service=JaasSecurityManager
            java:/TransactionManager
            <!--make the rar deploy! hack till better deployment-->
            jboss.jca:service=RARDeployer



            In my project meta-inf :
            -jbosscmp-jdbc.xml
            <?xml version="1.0" encoding="UTF-8"?>
            <!DOCTYPE jbosscmp-jdbc PUBLIC "-//JBoss//DTD JBOSSCMP-JDBC 3.0//EN"
            "http://www.jboss.org/j2ee/dtd/jbosscmp-jdbc_3_0.dtd">
            <jbosscmp-jdbc>

            java:/MySqlDS
            <datasource-mapping>mySQL</datasource-mapping>
            <create-table>true</create-table>
            <remove-table>false</remove-table>
            <pk-constraint>true</pk-constraint>
            <fk-constraint>true</fk-constraint>


            <enterprise-beans>

            <!-- PKGENERATOR TABLE -->

            <ejb-name>PKGenerator</ejb-name>
            <table-name>PKGENERATOR</table-name>
            <cmp-field>
            <field-name>idName</field-name>
            <column-name>IDNAME</column-name>
            <jdbc-type>CHAR</jdbc-type>
            <sql-type>CHAR(50)</sql-type>
            </cmp-field>
            <cmp-field>
            <field-name>idValue</field-name>
            <column-name>IDVALUE</column-name>
            <jdbc-type>INTEGER</jdbc-type>
            <sql-type>INTEGER</sql-type>
            </cmp-field>


            <!-- OWNER TABLE -->

            <ejb-name>Owner</ejb-name>
            <table-name>OWNER</table-name>
            <cmp-field>
            <field-name>idOwner</field-name>
            <column-name>IDOWNER</column-name>
            <jdbc-type>INTEGER</jdbc-type>
            <sql-type>INTEGER</sql-type>
            </cmp-field>
            .....


            </enterprise-beans>
            <type-mappings>
            <type-mapping>
            mySQL
            .....
            </type-mapping>

            </type-mappings>
            </jbosscmp-jdbc>

            - ejb-jar
            - jboss.xml

            In my meta-inf/jboss.xml :

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

            false
            <container-configurations />
            <resource-managers />
            <enterprise-beans>
            <ejb-name>PKGenerator</ejb-name>
            <ejb-name>Owner</ejb-name>

            <ejb-name>OwnerFacade</ejb-name>

            <!--
            <message-driven>
            <ejb-name>EmailServiceBean</ejb-name>
            <configuration-name>Standard Message Driven Bean</configuration-name>
            <destination-jndi-name>queue/testQueue</destination-jndi-name>
            </message-driven>
            -->

            </enterprise-beans>




            What does I need more to do ?
            I didn't change any files called jaws, etc...


            • 3. Re: Deploying EJB - not bound !

              Ok,

              You posted your mysql config, is that deployed?

              Did you get any errors during the ear deployment?

              You don't show ejb-jar.xml but you are using CMP2.0.
              Do you have the dtd for EJB2.0?
              <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/j2ee/dtds/ejb-jar_2_0.dtd">

              Did you specify CMP2.0?
              <cmp-version>2.x</cmp-version>

              Use http://localhost:8080/jmx-console
              look for jboss:service=JNDIView and use operation
              "list" to see what is in JNDI.

              Regards,
              Adrian

              • 4. Re: Deploying EJB - not bound !
                rood

                Thanks to answer again !
                MySql is deployed, and my projet.jar and projet.war also.

                In my ejb-jar I have :
                <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/j2ee/dtds/ejb-jar_2_0.dtd">..

                I specify : <cmp-version>2.x</cmp-version> (where x is what is written in my ejbjar)....

                :( :(

                Something else is wrong !

                • 5. Re: Deploying EJB - not bound !
                  rood

                  Thanks to answer again !
                  MySql is deployed, and my projet.jar and projet.war also.

                  In my ejb-jar I have :
                  <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/j2ee/dtds/ejb-jar_2_0.dtd">..

                  I specify : <cmp-version>2.x</cmp-version> (where x is what is written in my ejbjar)....

                  :( :(

                  Something else is wrong !