Title: RE: [jBoss-User] Problems with entity bean CMP descriptors

I also included jaws.xml, jboss.xml and changes to jboss.conf, jboss.properties and jboss.jcml.  We didn't get ours to deploy until everything was clean.  I'm in no way a jBoss guru; this is what we got to work last Friday.  This was for Interbase; we were also able to deploy to an Oracle 7 database with changes to the deployment files.  

John Moore


-- ejb-jar.xml
<?xml version="1.0" encoding="Cp1252"?>

<ejb-jar>
        <description>test application</description>
        <display-name>User</display-name>
        <enterprise-beans>
                <entity>
                        <ejb-name>User</ejb-name>
                        <home>UserHome</home>
                        <remote>User</remote>
                        <ejb-class>UserBean</ejb-class>
                        <reentrant>False</reentrant>
                        <cmp-field><field-name>userId</field-name></cmp-field>
                        <cmp-field><field-name>lastName</field-name></cmp-field>
                        <cmp-field><field-name>firstName</field-name></cmp-field>
                        <primkey-field>userId</primkey-field>
                        <prim-key-class>java.lang.Integer</prim-key-class>
                        <persistence-type>Container</persistence-type>
                        <resource-ref>
                                <res-ref-name>StaffEasy</res-ref-name>
                                        <res-type>java.sql.DataSource</res-type>
                                        <res-auth>Container</res-auth>
                                </resource-ref>

                </entity>
        </enterprise-beans>
</ejb-jar>

-- jaws.xml
<?xml version="1.0" encoding="UTF-8"?>
<jaws>
    <datasource>StaffEasy</datasource>
    <type-mapping>InterBase</type-mapping>

    <default-entity>
       <create-table>true</create-table>
       <remove-table>false</remove-table>
       <tuned-updates>false</tuned-updates>
       <read-only>false</read-only>
       <time-out>300</time-out>
    </default-entity>

    <type-mappings>
        <type-mapping>
            <name>InterBase</name>
            <mapping>
                <java-type>java.lang.Boolean</java-type>
                <jdbc-type>BIT</jdbc-type>
                <sql-type>SMALLINT</sql-type>
            </mapping>
            <mapping>
                <java-type>java.lang.Byte</java-type>
                <jdbc-type>TINYINT</jdbc-type>
                <sql-type>SMALLINT</sql-type>
            </mapping>
            <mapping>
                <java-type>java.lang.Short</java-type>
                <jdbc-type>SMALLINT</jdbc-type>
                <sql-type>SMALLINT</sql-type>
            </mapping>
            <mapping>
                <java-type>java.lang.Integer</java-type>
                <jdbc-type>INTEGER</jdbc-type>
                <sql-type>INTEGER</sql-type>
            </mapping>
            <mapping>
                <java-type>java.lang.Long</java-type>
                <jdbc-type>BIGINT</jdbc-type>
                <sql-type>NUMERIC(18,0)</sql-type>
            </mapping>
            <mapping>
                <java-type>java.lang.Float</java-type>
                <jdbc-type>REAL</jdbc-type>
                <sql-type>FLOAT</sql-type>
            </mapping>
            <mapping>
                <java-type>java.lang.Double</java-type>
                <jdbc-type>DOUBLE</jdbc-type>
                <sql-type>DOUBLE PRECISION</sql-type>
            </mapping>
            <mapping>
                <java-type>java.lang.Character</java-type>
                <jdbc-type>CHAR</jdbc-type>
                <sql-type>CHAR</sql-type>
            </mapping>
            <mapping>
                <java-type>java.lang.String</java-type>
                <jdbc-type>VARCHAR</jdbc-type>
                <sql-type>VARCHAR(255)</sql-type>
            </mapping>
            <mapping>
                <java-type>java.sql.Date</java-type>
                <jdbc-type>DATE</jdbc-type>
                <sql-type>DATE</sql-type>
            </mapping>
            <mapping>
                <java-type>java.sql.Time</java-type>
                <jdbc-type>TIME</jdbc-type>
                <sql-type>TIME</sql-type>
            </mapping>
            <mapping>
                <java-type>java.sql.Timestamp</java-type>
                <jdbc-type>TIMESTAMP</jdbc-type>
                <sql-type>TIMESTAMP</sql-type>
            </mapping>
            <mapping>
                <java-type>java.lang.Object</java-type>
                <jdbc-type>JAVA_OBJECT</jdbc-type>
                <sql-type>VARCHAR(2000)</sql-type>
            </mapping>
        </type-mapping>
    </type-mappings>
       
    <enterprise-beans>
        <entity>
                <ejb-name>User</ejb-name>
                <create-table>false</create-table>
                <remove-table>false</remove-table>
                <table-name>USERS_TBL</table-name>
                <cmp-field>
                        <field-name>userId</field-name>
                        <column-name>USER_ID</column-name>
                        <sql-type>INTEGER</sql-type>
                </cmp-field>
                <cmp-field>
                        <field-name>lastName</field-name>
                        <column-name>USER_LNAME_VC</column-name>
            <sql-type>VARCHAR</sql-type>
                </cmp-field>
                <cmp-field>
                        <field-name>firstName</field-name>
                        <column-name>USER_FNAME_VC</column-name>
            <sql-type>VARCHAR</sql-type>
                </cmp-field>
        </entity>
    </enterprise-beans>

</jaws>

-- jboss.xml
<?xml version="1.0" encoding="Cp1252"?>

<jboss>
        <enterprise-beans>
                <entity>
                        <ejb-name>User</ejb-name>
                        <jndi-name>test/User</jndi-name>
                        <configuration-name>Standard CMP EntityBean</configuration-name>
                </entity>         
        </enterprise-beans>
</jboss>

-- jboss.properties (changes)
jdbc.drivers=org.hsql.jdbcDriver,org.enhydra.instantdb.jdbc.idbDriver,interbase.interclient.Driver

-- jboss.conf (changes)
<MLET CODE="org.jboss.jdbc.XADataSourceLoader" ARCHIVE="jboss.jar" CODEBASE="../../lib/ext/">
    <ARG TYPE="java.lang.String" VALUE="StaffEasy">
    <ARG TYPE="java.lang.String" VALUE="org.jboss.minerva.xa.XADataSourceImpl">
</MLET>

-- jboss.jcml ( I only added url, password and JDBCUser attributes, the rest was added at runtime (I assume) )
     <mbean name="DefaultDomain:service=XADataSource,name=StaffEasy">
       <attribute name="TimestampUsed">false</attribute>
       <attribute name="Password">masterkey</attribute>
       <attribute name="MaxSize">0</attribute>
       <attribute name="InvalidateOnError">false</attribute>
       <attribute name="IdleTimeout">1800000</attribute>
       <attribute name="GCInterval">120000</attribute>
       <attribute name="Blocking">true</attribute>
       <attribute name="LoggingEnabled">false</attribute>
       <attribute name="IdleTimeoutEnabled">false</attribute>
       <attribute name="GCEnabled">false</attribute>
       <attribute name="URL">jdbc:interbase://bear/usr/local/interbase/data/staffeasy.gdb</attribute>
       <attribute name="Properties"></attribute>
       <attribute name="MinSize">0</attribute>
       <attribute name="MaxIdleTimeoutPercent">1.0</attribute>
       <attribute name="JDBCUser">sysdba</attribute>
       <attribute name="GCMinIdleTime">1200000</attribute>
     </mbean>


-----Original Message-----
From: Luigi Kohler [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 19, 2001 7:30 AM
To: [EMAIL PROTECTED]
Subject: [jBoss-User] Problems with entity bean CMP descriptors


Hello,
we need help to deploy an entity bean contained managed persistence
The problem is the XML descriptor.
May anyone send me a copy of a valid ejb-jar CMP ?
I get the following error when I deploy my bean.


[Auto deploy] Starting
[Auto deploy] Auto deploy of file:/F:/jboss/jBoss-2.0_FINAL/deploy/lmtlinkcompany.jar
[J2EE Deployer] Deploy J2EE application: file:/F:/jboss/jBoss-2.0_FINAL/deploy/lmtlinkcompany.jar
[J2EE Deployer] Could not delete temporary file: /F:/jboss/jBoss-2.0_FINAL/bin/../tmp/deploy/copy1001.zip
[J2EE Deployer] Destroying application lmtlinkcompany.jar
[J2EE Deployer] deployment.cfg file deleted.
[J2EE Deployer] File tree file:/F:/jboss/jBoss-2.0_FINAL/tmp/deploy/lmtlinkcompany.jar deleted.
[Auto deploy] Deployment failed:file:/F:/jboss/jBoss-2.0_FINAL/deploy/lmtlinkcompany.jar
[Auto deploy] org.jboss.deployment.J2eeDeploymentException: No valid deployment descriptor was found within this URL: file:/F:/jboss/jBoss-2.0_FINAL/deploy/lmtlinkcompany.jar

[Auto deploy] Make sure it points to a valid j2ee package (ejb.jar/web.war/app.ear)!



Thank you very much
Best Regards
Luigi Kohler

Reply via email to