8 Replies Latest reply on Nov 19, 2005 8:59 AM by boost box

    loosing my mind, need help before i loose it completely

    boost box Newbie

      i am running jboss 4.0.3 under win xp. I use netbeans to create and deploy the application. My problem is that i can't get the application to use neither my postgresql server (localhost) or a oracle database server (remote host). It keeps on using the embedded database server, hypersonic sql.

      I have been trying to work this out for days, maybe weeks, but i just can't get a break. I have been modifying the xml files but it just keeps on using the hypersonic sql. If it's anyone who wish to TRY to help me i will be very greatfull.

      Where is the problem?

        • 2. Re: loosing my mind, need help before i loose it completely
          boost box Newbie

          i see it's jms, does it apply to ordinary cmp and session beans?

          • 3. Re: loosing my mind, need help before i loose it completely
            Novice

            For CMP:
            * deploy a new datasource (with a name like "cmpDS")
            * use the cmpDS in your persistence.xml (if you use EJB3)
            or change it globally in standardjbosscmp-jdbc.xml

            • 4. Re: loosing my mind, need help before i loose it completely
              boost box Newbie

              ok, thanks, you will have to forgive me but i have to ask, what about login.config.xml file? Do i need to change that as well? And how?

              • 5. Re: loosing my mind, need help before i loose it completely
                boost box Newbie

                well, i have tried what you said, but i'm not using ejb3 so i guess it's abit different.

                Here is what i did:

                1. copied the jdbc drivers of postgresql to server/all/lib and to server/default/lib.
                2. copied the postgres-ds.xml file from docs/examples in to server/default/deploy.
                3. modified that file so it now reads

                <datasources>
                 <local-tx-datasource>
                 <jndi-name>PostgresDS</jndi-name>
                 <use-java-context>true</use-java-context>
                 <connection-url>jdbc:postgresql://localhost:5432/boostbox</connection-url>
                 <driver-class>org.postgresql.Driver</driver-class>
                 <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
                 <user-name>myUsername</user-name>
                 <password>mypassword</password>
                 <min-pool-size>1</min-pool-size>
                 <max-pool-size>10</max-pool-size>
                 <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
                 <metadata>
                 <type-mapping>PostgreSQL 8.0</type-mapping>
                 </metadata>
                 </local-tx-datasource>
                
                </datasources>
                


                4. changed server/default/conf/standardjboss-jdbc.xml so it reads:

                <defaults>
                 <datasource>java:/PostgresDS</datasource>
                 <datasource-mapping>PostgreSQL 8.0</datasource-mapping>
                
                 <create-table>true</create-table>
                 <remove-table>false</remove-table>
                 <read-only>false</read-only>
                 <read-time-out>300000</read-time-out>
                 <row-locking>false</row-locking>
                 <pk-constraint>true</pk-constraint>
                 <fk-constraint>false</fk-constraint>
                 <preferred-relation-mapping>foreign-key</preferred-relation-mapping>
                 <read-ahead>
                 <strategy>on-load</strategy>
                 <page-size>1000</page-size>
                 <eager-load-group>*</eager-load-group>
                 </read-ahead>
                 <list-cache-max>1000</list-cache-max>
                 <clean-read-ahead-on-load>false</clean-read-ahead-on-load>
                
                 <unknown-pk>
                 <key-generator-factory>UUIDKeyGeneratorFactory</key-generator-factory>
                 <unknown-pk-class>java.lang.String</unknown-pk-class>
                 <jdbc-type>VARCHAR</jdbc-type>
                 <sql-type>VARCHAR(32)</sql-type>
                 </unknown-pk>
                
                 <entity-command name="default"/>
                 <ql-compiler>org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLCompiler</ql-compiler>
                 <throw-runtime-exceptions>false</throw-runtime-exceptions>
                 </defaults>
                


                5. also changed the server/default/conf/standardjaws.xml

                <jaws>
                 <datasource>java:/PostgresDS</datasource>
                 <type-mapping>PostgreSQL 8.0</type-mapping>
                 <debug>false</debug>
                


                It still doesn't work, so i'm wondering if anyone can give me some pointers as to where it all goes to H***

                Thanks..

                • 7. Re: loosing my mind, need help before i loose it completely
                  boost box Newbie

                  Ok. I am frustrated, but i will try to narrow down my question.
                  I am using netbeans to deploy and develop the application. I have constructed a very simple cmp and session bean (ejb 2.0).

                  PROGRESS: i fired up ethereal and sniffed up some traffic going from my computer to the remote oracle database server. it seems as my application is connecting to some random port and not the oracle port 1521 defined in my server/default/deploy/oracle-ds.xml file. The server replies with no valid data etc.

                  At the same time the application uses the hypersonic database... And i get a lot of errors at deployment. here are the first ones...

                  --- MBeans waiting for other MBeans ---
                  ObjectName: jboss.ejb:service=EJBTimerService,persistencePolicy=database
                   State: CONFIGURED
                   I Depend On:
                   jboss.jca:service=DataSourceBinding,name=DefaultDS
                  
                  ObjectName: jboss.mq:service=InvocationLayer,type=HTTP
                   State: CONFIGURED
                   I Depend On:
                   jboss.mq:service=Invoker
                   jboss.web:service=WebServer
                  
                  ObjectName: jboss:service=KeyGeneratorFactory,type=HiLo
                   State: CONFIGURED
                   I Depend On:
                   jboss:service=TransactionManager
                   jboss.jca:service=DataSourceBinding,name=DefaultDS
                  


                  • 8. Re: loosing my mind, need help before i loose it completely
                    boost box Newbie

                    hmm... this might give some useful information. it's from the deployment of the apllication:

                    --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
                    ObjectName: jboss.jca:service=DataSourceBinding,name=DefaultDS
                     State: NOTYETINSTALLED
                     Depends On Me:
                     jboss.ejb:service=EJBTimerService,persistencePolicy=database
                     jboss:service=KeyGeneratorFactory,type=HiLo
                     jboss.mq:service=StateManager
                     jboss.mq:service=PersistenceManager
                    


                    I guess it's something wrong with the confiuration of the datasource, but i really don't know where i should begin..