5 Replies Latest reply on Aug 26, 2004 10:40 AM by fearlessspiff

    cannot switch from hypersonic to oracle

    itteerde

      i configured a oracle DataSource that works (tested it with a servlet) and tried to map an EntityBean to my database but during the deployment it continues to create the hypersonic table. any help appreciated

      jboss: 3.2.5
      jdk/jre: 1.4.2_5
      xdoclet: 1.2/jboss-ide for eclipse 3.0

      /*
      * Project name : ofas
      * File name : Server.java
      *
      * Created on Aug 17, 2004
      * Author : itteerde
      *
      * History:
      *
      * Last Editor Date Comment
      * ----------------------------------------------------------------------------
      * itteerde Aug 17, 2004 created
      */
      package com.bbraun.ofas.persistence.permission.ejb;

      import java.rmi.RemoteException;

      import javax.ejb.EJBException;
      import javax.ejb.EntityBean;
      import javax.ejb.EntityContext;
      import javax.ejb.RemoveException;

      /**
      * @ejb.bean name="Permission"
      * display-name="Name for Permission"
      * description="Description for Permission"
      * jndi-name="ejb/Permission"
      * type="CMP"
      * cmp-version="2.x"
      * view-type="local"
      *
      * @ejb.bean primkey-field = "guid"
      *
      * @todo should extend AbstractEntityBean
      *
      * @jboss.persistence
      * datasource = "ofas"
      * table-name = "ofas.ofas_permissions"
      *
      *
      */
      public abstract class PermissionBean implements EntityBean {

      /**
      *
      */
      public PermissionBean() {
      super();
      // TODO Auto-generated constructor stub
      }

      /* (non-Javadoc)
      * @see javax.ejb.EntityBean#setEntityContext(javax.ejb.EntityContext)
      */
      public void setEntityContext(EntityContext ctx)
      throws EJBException,
      RemoteException {
      // TODO Auto-generated method stub

      }

      /* (non-Javadoc)
      * @see javax.ejb.EntityBean#unsetEntityContext()
      */
      public void unsetEntityContext() throws EJBException, RemoteException {
      // TODO Auto-generated method stub

      }

      /* (non-Javadoc)
      * @see javax.ejb.EntityBean#ejbRemove()
      */
      public void ejbRemove()
      throws RemoveException,
      EJBException,
      RemoteException {
      // TODO Auto-generated method stub

      }

      /* (non-Javadoc)
      * @see javax.ejb.EntityBean#ejbActivate()
      */
      public void ejbActivate() throws EJBException, RemoteException {
      // TODO Auto-generated method stub

      }

      /* (non-Javadoc)
      * @see javax.ejb.EntityBean#ejbPassivate()
      */
      public void ejbPassivate() throws EJBException, RemoteException {
      // TODO Auto-generated method stub

      }

      /* (non-Javadoc)
      * @see javax.ejb.EntityBean#ejbLoad()
      */
      public void ejbLoad() throws EJBException, RemoteException {
      // TODO Auto-generated method stub

      }

      /* (non-Javadoc)
      * @see javax.ejb.EntityBean#ejbStore()
      */
      public void ejbStore() throws EJBException, RemoteException {
      // TODO Auto-generated method stub

      }

      /**
      * Getter for CMP Field guid
      *
      * @ejb.pk-field
      * @ejb.persistent-field
      * @ejb.interface-method view-type="local"
      *
      * @jboss.column-name name = "ID"
      * @jboss.jdbc-type type = "VARCHAR"
      */
      public abstract String getGuid();

      /**
      * Setter for CMP Field guid
      *
      * @ejb.interface-method view-type="local"
      */
      public abstract void setGuid(String value);

      /**
      * Getter for CMP Field name
      *
      *
      * @ejb.persistent-field
      * @ejb.interface-method view-type="local"
      *
      * @jboss.column-name name = "NAME"
      * @jboss.jdbc-type type = "VARCHAR"
      */
      public abstract String getName();

      /**
      * Setter for CMP Field name
      *
      * @ejb.interface-method view-type="local"
      */
      public abstract void setName(String value);

      }

        • 1. Re: cannot switch from hypersonic to oracle
          darranl

          Have you put the jbosscmp-jdbc.xml in the jar file? I have not tried specifying the datasource using XDoclet tags, I normaly specify it in the build script, have you checked the contents of jbosscmp-jdbc.xml?

          • 2. Re: cannot switch from hypersonic to oracle
            itteerde

             

            "darranl" wrote:
            Have you put the jbosscmp-jdbc.xml in the jar file? I have not tried specifying the datasource using XDoclet tags, I normaly specify it in the build script, have you checked the contents of jbosscmp-jdbc.xml?


            no i have not

            thank you very much, i ll fix some datasource mappings now...

            • 3. Re: cannot switch from hypersonic to oracle
              fearlessspiff

              could you fix it? I have exactly the same problem. But my jbosscmp-jdbc.xml is ok. All mapped nicely. What i could see is, that the jbosscmp-jdbc.xml is ignored by JBoss! Don't know why, but i can change what i like, the file isn't read by JBoss... I use the same software versions as you, maybe this is a problem?

              • 4. Re: cannot switch from hypersonic to oracle
                itteerde

                 

                "FearlessSpiff" wrote:
                could you fix it? I have exactly the same problem. But my jbosscmp-jdbc.xml is ok. All mapped nicely. What i could see is, that the jbosscmp-jdbc.xml is ignored by JBoss! Don't know why, but i can change what i like, the file isn't read by JBoss... I use the same software versions as you, maybe this is a problem?


                yes i could:

                the following source works for XDoclet generating the correct settings (i have other problems but at least i have my database)

                /*
                * Project name : ofas
                * File name : Server.java
                *
                * Created on Aug 16, 2004
                * Author : itteerde
                *
                * History:
                *
                * Last Editor Date Comment
                * ----------------------------------------------------------------------------
                * itteerde Aug 16, 2004 created
                */
                package com.bbraun.ofas.persistence.figuretable.ejb;

                import java.rmi.RemoteException;

                import javax.ejb.EJBException;
                import javax.ejb.EntityBean;
                import javax.ejb.EntityContext;
                import javax.ejb.RemoveException;

                /**
                * @ejb.bean name="FigureTable"
                * display-name="Name for FigureTable"
                * description="Description for FigureTable"
                * jndi-name="ejb/FigureTable"
                * type="CMP"
                * cmp-version="2.x"
                * view-type="local"
                *
                * @ejb.bean primkey-field = "guid"
                *
                * @todo should extend AbstractEntityBean
                *
                * @jboss.persistence
                * datasource = "java:ofas"
                * datasource-mapping = "Oracle9i"
                * table-name = "OFAS.OFAS_FIGURETABLES"
                * create-table = "false"
                */
                public abstract class FigureTableBean implements EntityBean {

                /**
                *
                */
                public FigureTableBean() {
                super();
                // TODO Auto-generated constructor stub
                }

                /* (non-Javadoc)
                * @see javax.ejb.EntityBean#setEntityContext(javax.ejb.EntityContext)
                */
                public void setEntityContext(EntityContext ctx)
                throws EJBException,
                RemoteException {
                // TODO Auto-generated method stub

                }

                /* (non-Javadoc)
                * @see javax.ejb.EntityBean#unsetEntityContext()
                */
                public void unsetEntityContext() throws EJBException, RemoteException {
                // TODO Auto-generated method stub

                }

                /* (non-Javadoc)
                * @see javax.ejb.EntityBean#ejbRemove()
                */
                public void ejbRemove()
                throws RemoveException,
                EJBException,
                RemoteException {
                // TODO Auto-generated method stub

                }

                /* (non-Javadoc)
                * @see javax.ejb.EntityBean#ejbActivate()
                */
                public void ejbActivate() throws EJBException, RemoteException {
                // TODO Auto-generated method stub

                }

                /* (non-Javadoc)
                * @see javax.ejb.EntityBean#ejbPassivate()
                */
                public void ejbPassivate() throws EJBException, RemoteException {
                // TODO Auto-generated method stub

                }

                /* (non-Javadoc)
                * @see javax.ejb.EntityBean#ejbLoad()
                */
                public void ejbLoad() throws EJBException, RemoteException {
                // TODO Auto-generated method stub

                }

                /* (non-Javadoc)
                * @see javax.ejb.EntityBean#ejbStore()
                */
                public void ejbStore() throws EJBException, RemoteException {
                // TODO Auto-generated method stub

                }

                /**
                * Getter for CMP Field guid
                *
                * @ejb.pk-field
                * @ejb.persistent-field
                * @ejb.interface-method view-type="local"
                *
                * @jboss.column-name name = "ID"
                * @jboss.jdbc-type type = "VARCHAR"
                * @jboss.sql-type type = "CHAR(32)"
                */
                public abstract String getGuid();

                /**
                * Setter for CMP Field guid
                *
                * @ejb.interface-method view-type="local"
                */
                public abstract void setGuid(String value);

                /**
                * Returns the figure table's name. This is usually the operating figure's name.
                *
                * @return figure table's name
                *
                * @ejb.interface-method
                * view-type = "both"
                *
                * @jboss.column-name name = "NAME"
                * @jboss.jdbc-type type = "VARCHAR"
                * @jboss.sql-type type = "VARCHAR2(255)"
                */
                public abstract String getName();

                /**
                * Sets the figure table's name. You usually should use the operating figure's name.
                *
                * @param name figure table's name
                *
                * @ejb.interface-method
                * view-type = "both"
                *
                */
                public abstract void setName(String name);

                /**
                * Returns the unique id of the system this figure table belongs to
                *
                * @return unique id of the system this figure table belongs to
                *
                * @ejb.interface-method
                * view-type = "both"
                *
                * @jboss.column-name name = "SYSTEM"
                * @jboss.jdbc-type type = "VARCHAR"
                * @jboss.sql-type type = "CHAR(32)"
                */
                public abstract String getSystem();

                /**
                * Sets the unique id of the system this figure table belongs to
                *
                * @param name unique id of the system this figure table belongs to
                *
                * @ejb.interface-method
                * view-type = "both"
                */
                public abstract void setSystem(String system);

                /**
                * Returns the connector used to collect the data for this figure table
                *
                * @return connector used to collect the data for this figure table
                *
                * @ejb.interface-method
                * view-type = "both"
                *
                * @jboss.column-name name = "CONNECTOR"
                * @jboss.jdbc-type type = "VARCHAR"
                * @jboss.sql-type type = "CHAR(32)"
                */
                public abstract String getConnector();

                /**
                * Sets the connector used to collect the data for this figure table
                *
                * @param name connector used to collect the data for this figure table
                *
                * @ejb.interface-method
                * view-type = "both"
                */
                public abstract void setConnector(String connector);


                }

                • 5. Re: cannot switch from hypersonic to oracle
                  fearlessspiff

                  Thanks, it is working now! :-) But this wasn't your problem.
                  My problem was ant. My ejb-jar task in ant version 1.5.3 didn't put the jbosscmp-jdbc.xml in the jar file, so i made it by hand. This didn't work.
                  Now with 1.6.2 and cmp-version="2.0" in ejb-jar, the jar seems to be better(?!?) and the xml file is read by JBoss.