11 Replies Latest reply on Nov 14, 2018 7:57 AM by sachin bante

    Problem while Connecting to MongoDB from WildFly - JBoss EAP

    sachin bante Newbie

      Hello Team,

       

      From last few days a try to connect mongodb nosql with wildfly - JBoss EAP.

      Download some setup for same -

      a.Quick starts for http://teiid.jboss.org/

      Download quick start set up from https://github.com/teiid/teiid-quickstarts.

      b.Download the teiid runtime.

      Link: http://teiid.jboss.org/downloads/

      c.Download the wild fly server from link: http://wildfly.org/downloads/

      d.Download the JBoss EAP Server Link: http://wildfly.org/downloads/

       

      And setup maven,JDK_Home and JBoss_home to local but while running  and build mongo as data source for wildfly teiid over JBoss EAP-7.

       

      But while running following command i got some errors please have a look.

       

       

      bin>standalone.bat -c standalone-teiid.xml

       

        WARNING: JBOSS_HOME may be pointing to a different installation - unpredictable results may occur

      .

       

            JBOSS_HOME: "C:\Users\EAP-7.1.0"

       

      Calling "F:\E-DRIVE BACKUP\Tools\veristride\teiid-10.3.5-wildfly-server\teiid-10.3.5\bin\standalone.

      1. conf.bat"

      Setting JAVA property to "C:\Program Files\Java\jdk1.8.0_151\bin\java"

      ===============================================================================

       

        JBoss Bootstrap Environment

       

        JBOSS_HOME: "C:\Users\EAP-7.1.0"

       

        JAVA: "C:\Program Files\Java\jdk1.8.0_151\bin\java"

       

        JAVA_OPTS: "-Dprogram.name=standalone.bat -Xms64M -Xmx512M -XX:MetaspaceSize=96M -XX:MaxMetaspaceS

      ize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman"

       

      ===============================================================================

       

      13:10:11,371 INFO  [org.jboss.modules] (main) JBoss Modules version 1.6.0.Final-redhat-1

      13:10:11,754 INFO  [org.jboss.msc] (main) JBoss MSC version 1.2.7.SP1-redhat-1

      13:10:11,894 INFO  [org.jboss.as] (MSC service thread 1-7) WFLYSRV0049: JBoss EAP 7.1.0.GA (WildFly

      Core 3.0.10.Final-redhat-1) starting

      13:10:16,151 INFO  [org.jboss.as.controller] (Controller Boot Thread) OPVDX002: Failed to pretty pri

      nt validation error: null

      13:10:16,153 ERROR [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0055: Caught exception duri

      ng boot: org.jboss.as.controller.persistence.ConfigurationPersistenceException: WFLYCTL0085: Failed

      to parse configuration

              at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersis

      1. ter.java:143)

              at org.jboss.as.server.ServerService.boot(ServerService.java:387)

              at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:37

      0)

              at java.lang.Thread.run(Thread.java:748)

      Caused by: javax.xml.stream.XMLStreamException: WFLYCTL0083: Failed to load module org.jboss.teiid

              at org.jboss.as.controller.parsing.ExtensionXml.parseExtensions(ExtensionXml.java:154)

              at org.jboss.as.server.parsing.StandaloneXml$DefaultExtensionHandler.parseExtensions(Standal

      • oneXml.java:131)

              at org.jboss.as.server.parsing.StandaloneXml_5.readServerElement(StandaloneXml_5.java:219)

              at org.jboss.as.server.parsing.StandaloneXml_5.readElement(StandaloneXml_5.java:142)

              at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:107)

              at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:49)

              at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:122)

              at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:76)

              at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersis

      1. ter.java:126)

              ... 3 more

      Caused by: java.util.concurrent.ExecutionException: javax.xml.stream.XMLStreamException: WFLYCTL0083

      : Failed to load module

              at java.util.concurrent.FutureTask.report(FutureTask.java:122)

              at java.util.concurrent.FutureTask.get(FutureTask.java:192)

              at org.jboss.as.controller.parsing.ExtensionXml.parseExtensions(ExtensionXml.java:146)

              ... 11 more

      Caused by: javax.xml.stream.XMLStreamException: WFLYCTL0083: Failed to load module

              at org.jboss.as.controller.parsing.ExtensionXml.loadModule(ExtensionXml.java:195)

              at org.jboss.as.controller.parsing.ExtensionXml.access$000(ExtensionXml.java:68)

              at org.jboss.as.controller.parsing.ExtensionXml$1.call(ExtensionXml.java:126)

              at org.jboss.as.controller.parsing.ExtensionXml$1.call(ExtensionXml.java:123)

              at java.util.concurrent.FutureTask.run(FutureTask.java:266)

              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

              at java.lang.Thread.run(Thread.java:748)

              at org.jboss.threads.JBossThread.run(JBossThread.java:320)

      Caused by: org.jboss.modules.ModuleNotFoundException: org.jboss.teiid

              at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:285)

              at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:271)

              at org.jboss.as.controller.parsing.ExtensionXml.loadModule(ExtensionXml.java:177)

              ... 8 more

       

       

      please let me know the suitable solution over it or any alternative to connect mongo db with teiid wildfly.

       

      Tia.....!!!!!!!!!!!!!!

        • 1. Re: Problem while Connecting to MongoDB from WildFly - JBoss EAP
          Ramesh Reddy Master

          To Install the Teiid

           

          1) Download this this https://oss.sonatype.org/service/local/repositories/releases/content/org/teiid/teiid/11.2.0/teiid-11.2.0-wildfly-server.…  and unzip into any directory.

          2) use bin/add-user.sh, and create two users, one Management User and another Application User

          3) start as bin/standalone.sh -c standalone-teiid.xml

           

          To add work with MongoDB, follow this article teiid: SQL on MongoDB using Teiid - Part 1

           

          If you are using Designer you can also follow Connect to a MongoDB Source

          • 2. Re: Problem while Connecting to MongoDB from WildFly - JBoss EAP
            sachin bante Newbie

            Hello Ramesh,

             

             

            Thank you so much for your gentle reply it helped me a lot, i have query can you share me the proper way to connect the squirrel SQL client with mongodb jdbc driver i found difficulty to get mongojdbc driver actually i have try with simba or unity but they dont work with it kindly suggest the best way to connect mongojdbc driver with squirrel client.

             

             

             

            THANKS.

            Sachin.

            • 3. Re: Problem while Connecting to MongoDB from WildFly - JBoss EAP
              Ramesh Reddy Master

              In SQuirrL you use Teiid JDBC driver, NOT MongoDB driver. You can get that driver here Teiid Wildfly Downloads | Teiid then you connect to Teiid and issue SQL queries against any sources (for ex: mongo) you configured in your VDB

              • 4. Re: Problem while Connecting to MongoDB from WildFly - JBoss EAP
                sachin bante Newbie

                Hello Ramesh,

                 

                Thanks for all your guidance,

                 

                1. Configured VDB

                 

                2.I have create a driver for mongodb, as you suggest the teiid wildfly driver i have download and connect with SQuirrel.

                Connect successfully : Driver class org.teiid.jdbc.TeiidDriver successfully registered for driver definition: JBOSS DATA VIR

                3.While creating alias it has some issue please check.

                error :

                Mongoviz: JDBC Driver class not found

                class java.lang.ClassNotFoundException:

                org.jboss.modules.ModuleLoadException

                Am doing some thing wrong please help me out.

                 

                 

                TIA....

                • 5. Re: Problem while Connecting to MongoDB from WildFly - JBoss EAP
                  Steven Hawkins Master

                  The problem is with the URL.  The driver is attempting to make an in vm connection, which requires jboss modules.  That should have a better error message.

                   

                  The remote url format is jdbc:teiid:vdb@mm://host:port

                  • 7. Re: Problem while Connecting to MongoDB from WildFly - JBoss EAP
                    sachin bante Newbie

                    Hello Steven,

                     

                     

                    I have update URL as  -  jdbc:teiid:mongodb@mm://192.168.1.105:31000;

                     

                    but again it shown error -

                     

                    Unexpected Error occurred attempting to open an SQL connection.

                    class java.net.ConnectException: Connection timed out: connect

                    • 8. Re: Problem while Connecting to MongoDB from WildFly - JBoss EAP
                      sachin bante Newbie

                      Hello Steven/Ramesh,

                       

                       

                      please ignore the previous reply the URL would be jdbc:teiid:mongodb@mm://localhost:31000;

                       

                      and it thoroughgoing this error-

                       

                      Unexpected Error occurred attempting to open an SQL connection.

                      class org.teiid.client.security.TeiidSecurityException: TEIID40046 Remote org.teiid.dqp.service.SessionServiceException: TEIID40046 VDB "mongodb" version "null" does not exist.

                      • 9. Re: Problem while Connecting to MongoDB from WildFly - JBoss EAP
                        Steven Hawkins Master

                        That exception clarifies that you are now hitting the Teiid server.  Make sure from the server log that there weren't any issues with the start of your vdb.

                        • 10. Re: Problem while Connecting to MongoDB from WildFly - JBoss EAP
                          sachin bante Newbie

                          hello steven,

                           

                          Sorry to intrrupt you again but I am new for teiid and wiildfly so difficult to find the error.

                          according to ramesh post i have create vdb for mongodb and put entry in standalone-teiid.xml file and also try to put manually over deployment folder as well as deploy from web console but while running command ./standalone.sh -c standalone-teiid.xml

                          log foll with error :

                           

                          12:35:55,611 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 65)  WFLYUT0021: R

                          egistered web context: '/odata4' for server 'default-server'

                          12:35:55,615 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread)  WFLYCTL0

                          013: Operation ("add") failed - address: ([

                              ("subsystem" => "resource-adapters"),

                              ("resource-adapter" => "file")

                          ]) - failure description: "WFLYJCA0080: RAR 'file' not yet deployed."

                          12:35:55,616 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread)  WFLYCTL0

                          013: Operation ("add") failed - address: ([

                              ("subsystem" => "resource-adapters"),

                              ("resource-adapter" => "ftp")

                          ]) - failure description: "WFLYJCA0080: RAR 'ftp' not yet deployed."

                          12:35:55,617 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread)  WFLYCTL0

                          013: Operation ("add") failed - address: ([

                              ("subsystem" => "resource-adapters"),

                              ("resource-adapter" => "google")

                          ]) - failure description: "WFLYJCA0080: RAR 'google' not yet deployed."

                          12:35:55,617 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread)  WFLYCTL0

                          013: Operation ("add") failed - address: ([

                              ("subsystem" => "resource-adapters"),

                              ("resource-adapter" => "ldap")

                          ]) - failure description: "WFLYJCA0080: RAR 'ldap' not yet deployed."

                          12:35:55,618 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread)  WFLYCTL0

                          013: Operation ("add") failed - address: ([

                              ("subsystem" => "resource-adapters"),

                              ("resource-adapter" => "salesforce")

                          ]) - failure description: "WFLYJCA0080: RAR 'salesforce' not yet deployed."

                          12:35:55,618 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread)  WFLYCTL0

                          013: Operation ("add") failed - address: ([

                              ("subsystem" => "resource-adapters"),

                              ("resource-adapter" => "salesforce-34")

                          ]) - failure description: "WFLYJCA0080: RAR 'salesforce-34' not yet deployed."

                          12:35:55,619 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread)  WFLYCTL0

                          013: Operation ("add") failed - address: ([

                              ("subsystem" => "resource-adapters"),

                              ("resource-adapter" => "salesforce-41")

                          ]) - failure description: "WFLYJCA0080: RAR 'salesforce-41' not yet deployed."

                          12:35:55,620 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread)  WFLYCTL0

                          013: Operation ("add") failed - address: ([

                              ("subsystem" => "resource-adapters"),

                              ("resource-adapter" => "webservice")

                          ]) - failure description: "WFLYJCA0080: RAR 'webservice' not yet deployed."

                          12:35:55,620 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread)  WFLYCTL0

                          013: Operation ("add") failed - address: ([

                              ("subsystem" => "resource-adapters"),

                              ("resource-adapter" => "mongodb")

                          ]) - failure description: "WFLYJCA0080: RAR 'mongodb' not yet deployed."

                          12:35:55,621 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread)  WFLYCTL0

                          013: Operation ("add") failed - address: ([

                              ("subsystem" => "resource-adapters"),

                              ("resource-adapter" => "couchbase")

                          ]) - failure description: "WFLYJCA0080: RAR 'couchbase' not yet deployed."

                          12:35:55,622 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread)  WFLYCTL0

                          013: Operation ("add") failed - address: ([

                              ("subsystem" => "resource-adapters"),

                              ("resource-adapter" => "cassandra")

                          ]) - failure description: "WFLYJCA0080: RAR 'cassandra' not yet deployed."

                          12:35:55,623 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread)  WFLYCTL0

                          013: Operation ("add") failed - address: ([

                              ("subsystem" => "resource-adapters"),

                              ("resource-adapter" => "simpledb")

                          ]) - failure description: "WFLYJCA0080: RAR 'simpledb' not yet deployed."

                          12:35:55,624 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread)  WFLYCTL0

                          013: Operation ("add") failed - address: ([

                              ("subsystem" => "resource-adapters"),

                              ("resource-adapter" => "accumulo")

                          ]) - failure description: "WFLYJCA0080: RAR 'accumulo' not yet deployed."

                          12:35:55,624 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread)  WFLYCTL0

                          013: Operation ("add") failed - address: ([

                              ("subsystem" => "resource-adapters"),

                              ("resource-adapter" => "solr")

                          ]) - failure description: "WFLYJCA0080: RAR 'solr' not yet deployed."

                          12:35:55,625 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread)  WFLYCTL0

                          013: Operation ("add") failed - address: ([

                              ("subsystem" => "resource-adapters"),

                              ("resource-adapter" => "infinispan")

                          ]) - failure description: "WFLYJCA0080: RAR 'infinispan' not yet deployed."

                          12:35:55,626 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread)  WFLYCTL0

                          013: Operation ("add") failed - address: ([

                              ("subsystem" => "resource-adapters"),

                              ("resource-adapter" => "mongodbQS")

                          ]) - failure description: "WFLYJCA0080: RAR 'mongodbQS' not yet deployed."

                          12:35:55,679 INFO  [org.jboss.as.server] (Controller Boot Thread)  WFLYSRV0010: Deployed "mongodb1"

                          (runtime-name : "mongodb-vdb.xml")

                           

                          Dont know what to do please help me out i can post my vdb as well if you need.

                           

                          entry in standalone-teiid.xml...

                          <resource-adapter id="mongodb">

                                              <module slot="main" id="org.jboss.teiid.resource-adapter.mongodb"/>

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

                                              <connection-definitions>

                                                  <connection-definition class-name="org.teiid.resource.adapter.mongodb.MongoDBManagedConnectionFactory" jndi-name="java:/mongoDS" enabled="true" use-java-context="true" pool-name="teiid-mongodb-ds">

                                                      <config-property name="Database">

                                                          Employee

                                                      </config-property>

                                                      <config-property name="RemoteServerList">

                                                          localhost:27017

                                                      </config-property>

                                                  </connection-definition>

                                              </connection-definitions>

                          </resource-adapter>

                           

                          vdb file...

                           

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

                          <vdb name="mongoVDB" version="1">

                              <model name="Employee">

                                  <source name="local" translator-name="translator-mongodb" connection-jndi-name="java:/mongoDS"/>

                                      <metadata type="DDL"><![CDATA[

                                          CREATE FOREIGN TABLE Employee (

                                              employee_id integer,

                                              FirstName varchar(25),

                                              LastName varchar(25)

                                          ) OPTIONS(UPDATABLE 'TRUE');

                                      ]]> </metadata>

                              </model>

                           

                           

                              <translator name="translator-mongodb" type="mongodb">

                              </translator>

                          </vdb>

                           

                          Please help me out,

                          Thanks in Advance!!!!!

                          • 11. Re: Problem while Connecting to MongoDB from WildFly - JBoss EAP
                            sachin bante Newbie

                            Hi Ramesh/Steven,

                             

                            The above error get solved now thanks for your support,

                            but now only mongodQS is not deployed please check latest log...

                             

                            18:21:57,019 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread)  WFLYCTL0013: Operation ("add") failed - address: ([

                                ("subsystem" => "resource-adapters"),

                                ("resource-adapter" => "mongodbQS")

                            ]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.ra.deployment.\"org.jboss.teiid.resource-adapter.mongodb:main_mongodbQS\"" => "WFLYJCA0046: Failed to start RA deployment [mongodbQ

                            S]

                                Caused by: org.jboss.jca.deployers.common.DeployException: IJ020056: Deployment failed: file:/E:/apps/jboss/teiid-11.2.0-wildfly-server/teiid-11.2.0/modules/system/layers/dv/org/jboss/teiid/resource-adapter/mongodb/main/    Caused by: javax.resource.spi.InvalidPropertyException: No host and port information supplied for the mongodb connection"}}

                             

                            Can you please check and help.

                             

                            Thanks............