1 2 3 Previous Next 43 Replies Latest reply on Mar 29, 2013 4:16 PM by divadatabase

    Twitter VDB

    divadatabase

      Hello,

       

      In the README of the Web Services as a Data Source Example (of the Quick Start guide), the following things are listed:

       

      connect

      /subsystem=resource-adapters/resource-adapter=twitterDS:add(archive=teiid-connector-ws.rar, transaction-support=NoTransaction)

      /subsystem=resource-adapters/resource-adapter=twitterDS/connection-definitions=twitterDS:add(jndi-name=java:/twitterDS, class-name=org.teiid.resource.adapter.ws.WSManagedConnectionFactory, enabled=true, use-java-context=true)

      /subsystem=resource-adapters/resource-adapter=twitterDS/connection-definitions=twitterDS/config-properties=EndPoint:add(value=http://search.twitter.com/search.json)

      /subsystem=resource-adapters/resource-adapter=twitterDS:activate

       

      I've already added the first three lines to the standalone-teiid.xml file.

       

      How do I add the last line in the file?

       

      I'm asking because I recieve this error when I run the batch file:

       

      12:30:14,173 WARN  [org.teiid.RUNTIME] (teiid-async-threads - 2)  TEIID50036 VDB

      twitter.1 model "twitter" metadata failed to load. Reason:TEIID31097 Connection

      Factory (no data source found) provided is null; Can not proceed with metadata

      load.

       

      I'm using the same twitter-vdb.xml and twitter-ds.xml files from the guide.

       

      I'd appreciate any feedback.

       

      Thanks!

        • 1. Re: Twitter VDB
          van.halbert

          If you are setting up the resource adapter using JBoss CLI, which it appears you are, then that last line needs to be executed in order to enable the resource adapter.  That line isn't present in the quickstart pom.xml, because there's a current issue  (or was at the time of the quickstart creation) with the JBossAS maven plugin in that it won't activate the adapter.  That's why its indicated in the readme that the server requires a restart if you use maven to setup the resource adapter.

           

          Van

          • 2. Re: Twitter VDB
            divadatabase

            Hi Van,

             

            Yes, I'm using my local instance of the Teiid server (standalone-teiid.xml) to deploy and activate my VDBs. Then I will be using JDBC to query against them (I'm not using Maven).

             

            So how do I add the line? Do I just write "twitterDS:activate" somewhere in that section?

             

            <subsystem xmlns="urn:jboss:domain:resource-adapters:1.0">

                <resource-adapters>

                    <resource-adapter>

                        <archive>teiid-connector-ws.rar</archive>

                        <transaction-support>NoTransaction</transaction-support>

                        <connection-definitions>

                            <connection-definition class-name="org.teiid.resource.adapter.ws.WSManagedConnectionFactory" jndi-name="java:/twitterDS" enabled="true" use-java-context="true" pool-name="twitter-ds">

                                  <config-property name="EndPoint">http://search.twitter.com/search.json</config-property>

                            </connection-definition>

                        </connection-definitions>

                    </resource-adapter>

                twitterDS:activate

                </resource-adapters>

            </subsystem>

             

            Thanks again!

            • 3. Re: Twitter VDB
              van.halbert

              That line is only of use if you are using JBoss CLI to add the resource adapter, so that the server will immediately activate the adapter.  Otherwise, it shouldn't be manually added to the configuration (standalone-teiid-xml) file.  If you were to start your server, the resource adapter should be available for the vdb to find.

               

              Van

              • 4. Re: Twitter VDB
                divadatabase

                Hi Van,

                 

                That is exactly what I thought. Im also using another VDB which has only one data source, a CSV file, and it deploys and activates just fine (most of the time).

                 

                I'm not sure why I am receiving this error. Can you please take a look at my code:

                 

                <subsystem xmlns="urn:jboss:domain:resource-adapters:1.0">

                            <resource-adapters>

                                <resource-adapter>

                                    <archive>

                                        teiid-connector-file.rar

                                    </archive>

                                    <transaction-support>NoTransaction</transaction-support>

                                    <connection-definitions>

                                        <connection-definition class-name="org.teiid.resource.adapter.file.FileManagedConnectionFactory" jndi-name="java:/allstar-file" enabled="true" use-java-context="true" pool-name="allstar-file">

                                            <config-property name="ParentDirectory">

                                                ../standalone/deployments/baseball/data

                                            </config-property>

                                            <config-property name="AllowParentPaths">

                                                true

                                            </config-property>

                                        </connection-definition>

                                    </connection-definitions>

                                </resource-adapter>

                                <resource-adapter>

                                    <archive>

                                        teiid-connector-ws.rar

                                    </archive>

                                    <transaction-support>NoTransaction</transaction-support>

                                    <connection-definitions>

                                        <connection-definition class-name="org.teiid.resource.adapter.ws.WSManagedConnectionFactory" jndi-name="java:/twitterDS" enabled="true" use-java-context="true" pool-name="teiid-twitter-ds">

                                            <config-property name="EndPoint">

                                                http://search.twitter.com/search.json

                                            </config-property>

                                        </connection-definition>

                                    </connection-definitions>

                                </resource-adapter>

                            </resource-adapters>

                        </subsystem>

                 

                What could it be?

                • 5. Re: Twitter VDB
                  van.halbert

                  I ran the quickstart using maven to see what was added and compare to yours, and here's what it added:

                   

                                  <resource-adapter id="twitterDS">

                                      <archive>

                                          teiid-connector-ws.rar

                                      </archive>

                                      <transaction-support>NoTransaction</transaction-support>

                                      <connection-definitions>

                                          <connection-definition class-name="org.teiid.resource.adapter.ws.WSManagedConnectionFactory" jndi-name="java:/twitterDS" enabled="true" use-java-context="true" pool-name="websericeDS">

                                              <config-property name="EndPoint">

                                                  http://search.twitter.com/search.json

                                              </config-property>

                                          </connection-definition>

                                      </connection-definitions>

                                  </resource-adapter>

                   


                  After restarting server, I was able to execute the example in the quickstart. 

                   

                  The 2 differences I see are the "id" for the resource-adapter and the name of the pool-name is "websericeDS" (which shouldn't cause the issue).    Try adding the "id" to if it fixes it.

                   

                  Van

                  • 6. Re: Twitter VDB
                    divadatabase

                    Hi Van,

                     

                    I've made the changes accordingly. However, I am still getting that exact same error.

                     

                    I am baffled.

                     

                    Do you have anymore suggestions?

                     

                    If not, I understand, you've been extremely helpful!

                     

                    Thanks,

                    Danah

                    • 7. Re: Twitter VDB
                      van.halbert

                      Danah,

                       

                      I hate to ask this, could you try the maven option?   If so, first delete the twitter resource adapter from the standalone-teiid.xml and delete the deployed twitter-vdb.xml from the deployments directory.

                       

                      -  set JBOSS_HOME to the jboss-as server installed directory.

                      -  perform the steps in the README.md to run maven

                       

                      This will at least confirm that it will work. 

                       

                      Van

                      • 8. Re: Twitter VDB
                        divadatabase

                        Hi Van,

                         

                        I think that's a good idea. I will try this now and post an update shortly.

                         

                        Again, thank you so much.

                         

                        Danah

                        • 9. Re: Twitter VDB
                          van.halbert

                          Danah,

                           

                          Thanks for your patience to work thru this, its very much appreciated.

                           

                          Van

                          • 10. Re: Twitter VDB
                            divadatabase

                            Hello again,

                             

                            So I finally got it to work once I changed a few of the names in the twitter-vdb.xml (almost all of the name tags were "twitter" and I believe that was confusing the server). The Twitter VDB is now ACTIVE.

                             

                            Now I'm attempting to query the View by JDBC, is that possible?

                             

                            I tried to query it from the command line with:

                             

                            run.bat localhost 31000 twitter "select * from tweet where query= 'jboss'"

                             

                            but it kept telling me to start the JBoss AS Server when it has already been started.

                             

                            Thanks in advance.

                            • 11. Re: Twitter VDB
                              van.halbert

                              Where are you running run.bat from?   It's not from the quickstart, so can you post what that script looks like?

                               

                              Thanks.

                               

                              Van

                              • 12. Re: Twitter VDB
                                divadatabase

                                Hi Van,

                                 

                                Im running run.bat from JBOSS_HOME/bin.

                                 

                                Unsurprisingly, here is the script from run.bat.

                                 

                                @ECHO OFF

                                REM Placeholder for people used to run.bat from older version redirecting them to read the readme

                                echo.

                                echo =======================================================================================

                                echo.

                                echo To start JBoss Application Server please see %CD%\..\README.txt

                                echo.

                                echo ========================================================================================

                                echo.

                                 

                                In the README it says to use JBOSS_HOME/bin/standalone.bat to start the server, which I did.

                                 

                                Thus, I used the following command line to query the twitter view: standalone.bat localhost 31000 twitter "select * from tweet where query= 'jboss'"

                                 

                                I recieved the following error:

                                 

                                Invalid option 'localhost' Usage: .standalone.sh [args...] where args include: ...

                                • 13. Re: Twitter VDB
                                  van.halbert

                                  Hey Danah,

                                   

                                  The JBOSS_HOME/bin scripts are not used for querying teiid.

                                   

                                  Use the simpleclient quickstart and run:  mvn install -Dvdb=twitter -Dsql="select * from tweet where query= 'jboss'"

                                   

                                   

                                  Van

                                  • 14. Re: Twitter VDB
                                    van.halbert

                                    Or you can use your favorite SQL tool (i.e., SQuirreL) to connect to Teiid and run the sql.

                                    1 2 3 Previous Next