1 2 Previous Next 15 Replies Latest reply on Dec 31, 2011 12:25 AM by tcunning

    JbossESB + Eclipse + Oracle 10g

    darovenomcx

      Hello. I have a few questions for you. Is there any tutorial how to configure Eclipse with Oracle Database for using JbossESB? And secound question is how can I import {ESB home}/samples/quickstarts/ into my Eclipse ? Especially helpful will be importing helloworld_sql_action.

      Thanks for any information.

        • 1. Re: JbossESB + Eclipse + Oracle 10g
          tcunning

          Is there any tutorial how to configure Eclipse with Oracle Database for using JbossESB?

           

          I'm not sure what you're asking for here - is Eclipse with Oracle Database an Oracle Eclipse distribution?       

          And secound question is how can I import {ESB home}/samples/quickstarts/ into my Eclipse ?

           

          There's a few options here :

           

          - JBoss Developer Studio (http://devstudio.jboss.com/download/) has a number of the Quickstarts preconfigured as examples, and has a number of other cool tools like jboss-esb.xml editor, create a jbossesb project, etc. that are helpful in developing with JBoss ESB

           

          - Just use your current eclipse, File->New->Java Project, give the location of the samples/quickstarts directory as your Location, choose quickstarts as a name, and then Finish.    You'll probably have to add some JARs here and there to the project classpath, but by and large this should work.

          • 2. Re: JbossESB + Eclipse + Oracle 10g
            darovenomcx

            Tom Cunningham wrote:

             

            Is there any tutorial how to configure Eclipse with Oracle Database for using JbossESB?

             

            I'm not sure what you're asking for here - is Eclipse with Oracle Database an Oracle Eclipse distribution?       

             

            I will need to create an ESB project that looks like helloworld_sql_action but i want to use Oracle 10g database. And my question is. What should i configure? (Only the .xml file in ESB project or something more in eclipse, maybe in database or in other place?)

            • 3. Re: JbossESB + Eclipse + Oracle 10g
              tcunning

              I will need to create an ESB project that looks like helloworld_sql_action but i want to use Oracle 10g database. And my question is. What should i configure? (Only the .xml file in ESB project or something more in eclipse, maybe in database or in other place?)

               

              Everything you need to configure there should be in the jboss-esb.xml.

               

              The build.xml has some database details you might need to configure to run the quickstart as well, but those aren't things you'll need to deploy your own project using the SQL provider.

              • 4. Re: JbossESB + Eclipse + Oracle 10g
                darovenomcx

                OK. I have imported helloworld_sql_action. And i changed the jboss-esb.xml. When i deploy my project I haven't got any errors.  I only have informaton that my listener queue is added:

                11:29:27,457 INFO  [QueueService] Queue[/queue/quickstart_sql_action_Request_esb] started, fullSize=200000, pageSize=2000, downCacheSize=2000

                I create in my database gateway_table. And then i try to insert values like that :

                SQL> insert into gateway_table values (3,'data 2222','P','timestamp');

                And when I do this nothing really hapens. And in my opinion MyAction.java should be invoked. I've got a question what I'm doing wrong? I'am using Oracle 10g Express Edition(maybe i should use full version?) I have posted my jboss-esb.xml, deployment.xml and jbm-queue-service.xml.

                 

                My jboss-esb.xml looks like this :

                 

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

                <jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd"

                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                    xsi:schemaLocation="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd http://anonsvn.jboss.org/repos/labs/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd"

                    parameterReloadSecs="5">

                 

                    <providers>

                          <sql-provider name="SQLprovider"

                                         url="jdbc:oracle:oci8://localhost:1521"

                                         driver="oracle.jdbc.OracleDriver"

                                         username="system"

                                         password="******">

                               <sql-bus busid="helloSQLChannel" >

                                    <sql-message-filter

                                         tablename="GATEWAY_TABLE"

                                         status-column="STATUS_COL"

                order-by="DATA_COLUMN"

                where-condition="DATA_COLUMN like 'data%'"

                message-column="message"

                                         message-id-column="UNIQUE_ID"

                                         insert-timestamp-column="TIMESTAMP_COL"

                                    />

                               </sql-bus>

                          </sql-provider>

                 

                          <jms-provider name="JBossMQ"

                                    connection-factory="ConnectionFactory">

                <jms-bus busid="quickstartEsbChannel">

                <jms-message-filter

                dest-type="QUEUE"

                dest-name="queue/quickstart_sql_action_Request_esb"

                selector="source='fromHelloworldSQLAction'"

                />

                </jms-bus>

                 

                </jms-provider>

                 

                      </providers>

                 

                      <services>

                        <service

                category="myCategory"

                name="mySqlListener"

                             description="Hello World SQL Action (esb jdbc listener)">

                            <listeners>

                                 <sql-listener name="SqlGateway"

                                      busidref="helloSQLChannel"

                                      is-gateway="true"/>

                                <jms-listener name="helloWorldJmsAction"

                                              busidref="quickstartEsbChannel"

                                />

                            </listeners>

                            <actions mep="OneWay">

                <action name="action1"

                                        class="org.jboss.soa.esb.samples.quickstart.helloworldsqlaction.MyAction"

                                        process="displayMessage"

                                        />

                <action name="action2" class="org.jboss.soa.esb.actions.SystemPrintln" />

                            </actions>

                 

                        </service>

                      </services>

                 

                </jbossesb>

                 

                 

                deployment.xml

                 

                <?xml version="1.0"?>

                <jbossesb-deployment>

                 

                  <jmsQueue>quickstart_sql_action_Request_esb</jmsQueue>

                </jbossesb-deployment>

                 

                jbm-queue-service.xml

                 

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

                <server>

                  <mbean code="org.jboss.jms.server.destination.QueueService"

                    name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_sql_action_Request_esb"

                    xmbean-dd="xmdesc/Queue-xmbean.xml">

                     <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>

                     <depends>jboss.messaging:service=PostOffice</depends>

                  </mbean>

                 

                 

                </server>

                 

                • 5. Re: JbossESB + Eclipse + Oracle 10g
                  tcunning

                  Is there any error in the server.log?

                   

                  Did you add the Oracle JDBC driver into the classpath somewhere?     Usually this goes into $AS/server/default/lib - assuming you are using the default config.

                  • 6. Re: JbossESB + Eclipse + Oracle 10g
                    darovenomcx

                    Tom Cunningham wrote:

                     

                    Is there any error in the server.log?

                    In my server log i only have a message like that :

                    14:16:43,125 INFO  [QueueService] Queue[/queue/quickstart_sql_action_Request_esb] started, fullSize=200000, pageSize=2000, downCacheSize=2000

                     

                     

                    Tom Cunningham wrote:

                    Did you add the Oracle JDBC driver into the classpath somewhere?     Usually this goes into $AS/server/default/lib - assuming you are using the default config.

                    I copied ojdbc14.jar from my database to the $AS/server/default/lib and yes i'm using default configuration.

                     

                     

                    I also tried to modyfy my sql-provider. So now it looks like that:

                    I still haven't got any errors in server log. Simply nothing is happening. I checked my tsnames.ora file. And that conf should be correct. But i have a question about : driver="oracle.jdbc.OracleDriver". Is this correct? And maybe problem is sql-message_filter ?

                    <providers>

                              <sql-provider name="SQLprovider"

                                                            url="jdbc:oracle:thin:@//dvx:1521/xe"

                                                            driver="oracle.jdbc.OracleDriver"

                                                            username="system"

                                                            password="admin">

                                        <sql-bus busid="helloSQLChannel" >

                                                  <sql-message-filter

                                                            tablename="GATEWAY_TABLE"

                                                            status-column="STATUS_COL"

                                                            order-by="DATA_COLUMN"

                                                            where-condition="DATA_COLUMN like 'data%'"

                                                                      message-column="message"

                                                            message-id-column="UNIQUE_ID"

                                                            insert-timestamp-column="TIMESTAMP_COL"

                                                  />

                                        </sql-bus>

                              </sql-provider>

                    • 7. Re: JbossESB + Eclipse + Oracle 10g
                      tcunning

                      Maybe - from sqlplus can you try the query to see what you get?

                      select * from GATEWAY_TABLE where DATA_COLUMN like 'data%';

                      • 8. Re: JbossESB + Eclipse + Oracle 10g
                        darovenomcx

                        Tom Cunningham wrote:

                         

                        Maybe - from sqlplus can you try the query to see what you get?

                        select * from GATEWAY_TABLE where DATA_COLUMN like 'data%';

                        I have the same output as I try to select * from GATEWAY_TABLE because i only insert rows that match. Any ideas ??

                        SQL> select * from gateway_table where data_column like 'data%';

                         

                        UNIQUE_ID

                        ----------

                        DATA_COLUMN

                        -----------------------------------------------------------------------

                         

                        STATUS_COL

                        -----------------------------------------------------------------------

                         

                        TIMESTAMP_COL

                        -----------------------------------------------------------------------

                         

                                 1

                        data 123

                        P

                        Timestamp_col

                         

                         

                        SQL>

                        • 9. Re: JbossESB + Eclipse + Oracle 10g
                          tcunning

                          Try changing your log4j settings so that you can observe DEBUG from org.jboss.soa.esb.     I have a feeling you've got an error here somewhere (case sensitivity?) that you aren't seeing your server.log.      Change the setting, restart the server and see what you see then.

                          • 10. Re: JbossESB + Eclipse + Oracle 10g
                            darovenomcx

                            Tom Cunningham wrote:

                             

                            Try changing your log4j settings so that you can observe DEBUG from org.jboss.soa.esb.     I have a feeling you've got an error here somewhere (case sensitivity?) that you aren't seeing your server.log.      Change the setting, restart the server and see what you see then.

                            OK. I tried to do that. But probably i'm not doing it wright, because i don't know how I should change log4j settings?

                            I tried to change my C:\ESB\jboss-5.1.0.GA\server\default\conf\jboss-log4j.xml file. But I dont know should I add another appender? If yes how to do that correctly. And also I try to modyfy this section to DEBUG: 

                            <!-- Limit JBoss categories

                               <category name="org.jboss">

                                  <priority value="DEBUG"/>

                               </category>

                               -->

                            But when i do this nothing really changes. If you could tell my how to change my settings correctly I would be gratefull.

                             

                             

                             

                            And I have secound question. That could be helpfull. When I wastrying to find out what could be possibly wrong. I noticed that in one example on the forum sql-privider has datasource property. And I was wandering it can be the cause of the problem. Because Oracle isn't my default database and the default database is HSQLDB. Maybe i should do something like that : http://community.jboss.org/wiki/JBossESBSwitchDatabase 

                            And i don't know can it be the cause of my problems or not ?

                              <sql-provider datasource="java:/OracleDS" name="GatewaySQLprovider" url="jdbc:oracle:thin:xxx">

                            • 11. Re: JbossESB + Eclipse + Oracle 10g
                              tcunning

                              Edit server/default/conf/jboss-log4j.xml, and after the "<category name="org.jboss" definition, add the following:

                               

                                 <category name="org.jboss.soa.esb.listeners">

                                    <priority value="TRACE"/>

                                 </category>

                               

                              Then restart your server and watch server/default/log/server.log for errors.

                              1 of 1 people found this helpful
                              • 12. Re: JbossESB + Eclipse + Oracle 10g
                                darovenomcx

                                Ok now it works. Problem was in definition of sql-provider. There is no need to write sid or service.  And i must commit after instert in sqlplus. For me it works with :

                                url="jdbc:oracle:thin:@//dvx:1521"

                                But i have two questions.

                                1. It only works when status_col == 'P'

                                For example :

                                insert into gateway_table values(1,'data 1234','P','something');

                                But i don't see anything like that in my jboss.xml file. Is that column necessary. And if isn't what property is responsible for that?

                                 

                                2. Is it normal that i must first run my server from command line. And after that i must run it in my eclipse? Otherwise my log file isn't created. And nothing is really happening. I ask because if i try to use quickstarts from eclipse i only must run server in eclipse and everything works just fine.

                                • 13. Re: JbossESB + Eclipse + Oracle 10g
                                  tcunning

                                  But i have two questions.

                                  1. It only works when status_col == 'P'

                                  For example :

                                  insert into gateway_table values(1,'data 1234','P','something');

                                  But i don't see anything like that in my jboss.xml file. Is that column necessary. And if isn't what property is responsible for that?

                                   

                                  The status column is the indicator of the status of that row - whether it has been processed, pending, or an error occurs.     See

                                  http://docs.jboss.org/jbossesb/docs/4.7/javadoc/esb/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListener.html for details.

                                   

                                  2. Is it normal that i must first run my server from command line. And after that i must run it in my eclipse? Otherwise my log file isn't created. And nothing is really happening. I ask because if i try to use quickstarts from eclipse i only must run server in eclipse and everything works just fine.

                                   

                                  I'm not really sure what you are describing here - are you waiting for the quickstart ESB archive to deploy?    Is it deploying in the right location for both?    When you run the server through eclipse, it may be putting the server.log somewhere else or using a different log4j configuration.      Check your Eclipse settings.    

                                   

                                  In any case, you should be able to run the server through Eclipse or through the command line.

                                  • 14. Re: JbossESB + Eclipse + Oracle 10g
                                    darovenomcx

                                    Tom Cunningham wrote:

                                     

                                     

                                     

                                    The status column is the indicator of the status of that row - whether it has been processed, pending, or an error occurs.     See

                                    http://docs.jboss.org/jbossesb/docs/4.7/javadoc/esb/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListener.html for details.

                                     

                                    OK. But is there any way that Jboss ESB can listen on SQL table without that status column? I ask because if i have a SQL database that i can't modyfy. And of course i don't have in my tables column responsible for status. Then I simply can use Jboss ESB for listening on that table? Am I wright? Or I dont understand something?

                                    1 2 Previous Next