8 Replies Latest reply on Jan 15, 2013 10:18 AM by Ramesh Reddy

    Generated REST service failed

    vmelnikov Newbie

      Teiid 8.2

      Example from  https://docs.jboss.org/author/display/teiid82final/REST+Service+Through+VDB

       

      {code:xml}

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

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

       

          <property name="UseConnectorMetadata" value="true" />

          <property name="{http://teiid.org/rest}auto-generate" value="true"/>

          <property name="{http://teiid.org/rest}security-type" value="HttpBasic"/>

          <property name="{http://teiid.org/rest}security-domain" value="teiid-security"/>

          <property name="{http://teiid.org/rest}security-role" value="example-role"/>

          <property name="{http://teiid.org/rest}passthrough-auth" value="true"/>

       

          <model name="PM1">

              <source name="text-connector" translator-name="loopback" />

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

                      CREATE FOREIGN TABLE G1 (e1 string, e2 integer);

                      CREATE FOREIGN TABLE G2 (e1 string, e2 integer);

              ]]> </metadata>

          </model>

          <model name="View" type ="VIRTUAL">

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

                  SET NAMESPACE 'http://teiid.org/rest' AS REST;

                  CREATE VIRTUAL PROCEDURE g1Table(IN p1 integer) RETURNS TABLE (xml_out xml) OPTIONS (UPDATECOUNT 0, "REST:METHOD" 'GET', "REST:URI" 'g1/{p1}')

                  AS

                  BEGIN

                      SELECT XMLELEMENT(NAME "rows", XMLATTRIBUTES (g1Table.p1 as p1), XMLAGG(XMLELEMENT(NAME "row", XMLFOREST(e1, e2)))) AS xml_out FROM PM1.G1;

                  END

                  ]]> </metadata>

          </model>

       

      </vdb>

      {code}

       

      Open URL: http://localhost:8080/sample_1/view/g1/1

      Error log was generated:

       

      org.jboss.resteasy.spi.UnhandledException: java.lang.NullPointerException

      org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException(SynchronousDispatcher.java:340)

      org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:214)

      org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(SynchronousDispatcher.java:190)

      org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:540)

      org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:502)

      org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119)

      org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208)

      org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55)

      org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50)

      javax.servlet.http.HttpServlet.service(HttpServlet.java:847)

      root cause

      java.lang.NullPointerException
           org.teiid.jboss.rest.TeiidRSProvider.execute(TeiidRSProvider.java:64)
           org.teiid.jboss.rest.View.g1Tableapplication_xml(Unknown Source)
           sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           java.lang.reflect.Method.invoke(Method.java:597)
           org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:155)
           org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:257)
           org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:222)
           org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:211)
           org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:525)
           org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:502)
           org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119)
           org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208)
           org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55)
           org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50)
           javax.servlet.http.HttpServlet.service(HttpServlet.java:847)

       

      Where is problem?

       

      VM

        • 1. Re: Generated REST service failed
          Ramesh Reddy Master

          Did your VDB deploy correctly in ACTIVE state?

          • 2. Re: Generated REST service failed
            vmelnikov Newbie

            Yes. See logs below. Problem is reproduced

             

            10:02:16,762 INFO  [org.jboss.as.configadmin] (ServerService Thread Pool -- 27) JBAS016200: Activating ConfigAdmin Subsystem

            10:02:16,770 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 50) JBAS015537: Activating WebServices Extension

            10:02:16,800 INFO  [org.jboss.as.security] (MSC service thread 1-8) JBAS013100: Current PicketBox version=4.0.7.Final

            10:02:16,880 INFO  [org.jboss.as.connector] (MSC service thread 1-4) JBAS010408: Starting JCA Subsystem (JBoss IronJacamar 1.0.9.Final)

            10:02:16,888 INFO  [org.jboss.as.osgi] (ServerService Thread Pool -- 40) JBAS011940: Activating OSGi Subsystem

            10:02:16,903 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 28) JBAS010404: Deploying non-JDBC-compliant driver class org.teiid.jdbc.TeiidDriver (version 8.2)

            10:02:16,909 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 28) JBAS010404: Deploying non-JDBC-compliant driver class org.teiid.jdbc.TeiidDriver (version 8.2)

            10:02:16,939 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 28) JBAS010404: Deploying non-JDBC-compliant driver class com.relx.jdbc.LinterDriver (version 3.0)

            10:02:17,055 INFO  [org.jboss.as.naming] (MSC service thread 1-2) JBAS011802: Starting Naming Service

            10:02:17,076 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-8) JBAS015400: Bound mail session [java:jboss/mail/Default]

            10:02:17,214 INFO  [org.jboss.ws.common.management.AbstractServerConfig] (MSC service thread 1-8) JBoss Web Services - Stack CXF Server 4.0.2.GA

            10:02:17,693 INFO  [org.teiid.SECURITY] (ServerService Thread Pool -- 46) TEIID50011 Security enabled for transport "jdbc" with security-domain set to teiid-security

            10:02:17,694 INFO  [org.teiid.SECURITY] (ServerService Thread Pool -- 46) TEIID50011 Security enabled for transport "odbc" with security-domain set to teiid-security

            10:02:17,746 INFO  [org.teiid.RUNTIME] (ServerService Thread Pool -- 46) TEIID50006 Teiid translator "access" added.

            10:02:17,798 INFO  [org.teiid.RUNTIME] (ServerService Thread Pool -- 46) TEIID50006 Teiid translator "db2" added.

            10:02:17,844 INFO  [org.teiid.RUNTIME] (ServerService Thread Pool -- 46) TEIID50006 Teiid translator "derby" added.

            10:02:17,870 INFO  [org.teiid.RUNTIME] (ServerService Thread Pool -- 46) TEIID50006 Teiid translator "file" added.

            10:02:17,897 INFO  [org.teiid.RUNTIME] (ServerService Thread Pool -- 46) TEIID50006 Teiid translator "google-spreadsheet" added.

            10:02:17,917 INFO  [org.infinispan.factories.GlobalComponentRegistry] (pool-12-thread-1) ISPN000128: Infinispan version: Infinispan 'Brahma' 5.1.2.FINAL

            10:02:17,936 INFO  [org.teiid.RUNTIME] (ServerService Thread Pool -- 46) TEIID50006 Teiid translator "h2" added.

            10:02:17,966 INFO  [org.teiid.RUNTIME] (ServerService Thread Pool -- 46) TEIID50006 Teiid translator "hive" added.

            10:02:18,007 INFO  [org.teiid.RUNTIME] (ServerService Thread Pool -- 46) TEIID50006 Teiid translator "hsql" added.

            10:02:18,042 INFO  [org.teiid.RUNTIME] (ServerService Thread Pool -- 46) TEIID50006 Teiid translator "infinispan-cache" added.

            10:02:18,078 INFO  [org.teiid.RUNTIME] (ServerService Thread Pool -- 46) TEIID50006 Teiid translator "informix" added.

            10:02:18,113 INFO  [org.teiid.RUNTIME] (ServerService Thread Pool -- 46) TEIID50006 Teiid translator "ingres" added.

            10:02:18,132 INFO  [org.infinispan.jmx.CacheJmxRegistration] (pool-12-thread-1) ISPN000031: MBeans were successfully registered to the platform mbean server.

            10:02:18,412 INFO  [org.teiid.RUNTIME] (ServerService Thread Pool -- 46) TEIID50006 Teiid translator "ingres93" added.

            10:02:18,442 INFO  [org.jboss.as.clustering.infinispan] (pool-12-thread-1) JBAS010281: Started preparedplan cache from teiid container

            10:02:18,463 INFO  [org.teiid.RUNTIME] (ServerService Thread Pool -- 46) TEIID50006 Teiid translator "intersystems-cache" added.

            10:02:18,489 INFO  [org.teiid.RUNTIME] (ServerService Thread Pool -- 46) TEIID50006 Teiid translator "jdbc-ansi" added.

            10:02:18,494 INFO  [org.teiid.RUNTIME] (ServerService Thread Pool -- 46) TEIID50006 Teiid translator "jdbc-simple" added.

            10:02:18,514 INFO  [org.teiid.RUNTIME] (ServerService Thread Pool -- 46) TEIID50006 Teiid translator "jpa2" added.

            10:02:18,534 INFO  [org.teiid.RUNTIME] (ServerService Thread Pool -- 46) TEIID50006 Teiid translator "ldap" added.

            10:02:18,544 INFO  [org.teiid.RUNTIME] (ServerService Thread Pool -- 46) TEIID50006 Teiid translator "loopback" added.

            10:02:18,564 INFO  [org.teiid.RUNTIME] (ServerService Thread Pool -- 46) TEIID50006 Teiid translator "map-cache" added.

            10:02:18,596 INFO  [org.teiid.RUNTIME] (ServerService Thread Pool -- 46) TEIID50006 Teiid translator "metamatrix" added.

            10:02:18,624 INFO  [org.teiid.RUNTIME] (ServerService Thread Pool -- 46) TEIID50006 Teiid translator "modeshape" added.

            10:02:18,662 INFO  [org.teiid.RUNTIME] (ServerService Thread Pool -- 46) TEIID50006 Teiid translator "mysql" added.

            10:02:18,790 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-6) Starting Coyote HTTP/1.1 on http--127.0.0.1-8080

            10:02:18,855 INFO  [org.infinispan.jmx.CacheJmxRegistration] (pool-10-thread-1) ISPN000031: MBeans were successfully registered to the platform mbean server.

            10:02:18,876 INFO  [org.jboss.as.clustering.infinispan] (pool-10-thread-1) JBAS010281: Started resultset cache from teiid container

            10:02:18,860 INFO  [org.teiid.RUNTIME] (ServerService Thread Pool -- 46) TEIID50006 Teiid translator "mysql5" added.

            10:02:18,903 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-8) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]

            10:02:18,881 INFO  [org.infinispan.jmx.CacheJmxRegistration] (pool-11-thread-1) ISPN000031: MBeans were successfully registered to the platform mbean server.

            10:02:18,936 INFO  [org.teiid.RUNTIME] (ServerService Thread Pool -- 46) TEIID50006 Teiid translator "netezza" added.

            10:02:18,956 INFO  [org.jboss.as.clustering.infinispan] (pool-11-thread-1) JBAS010281: Started resultset-repl cache from teiid container

            10:02:18,976 INFO  [org.teiid.RUNTIME] (ServerService Thread Pool -- 46) TEIID50006 Teiid translator "olap" added.

            10:02:19,016 INFO  [org.teiid.RUNTIME] (ServerService Thread Pool -- 46) TEIID50006 Teiid translator "oracle" added.

            10:02:19,046 INFO  [org.teiid.RUNTIME] (ServerService Thread Pool -- 46) TEIID50006 Teiid translator "postgresql" added.

            10:02:19,076 INFO  [org.teiid.RUNTIME] (ServerService Thread Pool -- 46) TEIID50006 Teiid translator "salesforce" added.

            10:02:19,118 INFO  [org.teiid.RUNTIME] (ServerService Thread Pool -- 46) TEIID50006 Teiid translator "sqlserver" added.

            10:02:19,145 INFO  [org.teiid.RUNTIME] (ServerService Thread Pool -- 46) TEIID50006 Teiid translator "sybase" added.

            10:02:19,188 INFO  [org.teiid.RUNTIME] (MSC service thread 1-7) TEIID50001 Teiid Engine 8.2.0.Final Started = Tue Jan 15 10:02:19 MSK 2013

            10:02:19,188 INFO  [org.teiid.RUNTIME] (ServerService Thread Pool -- 46) TEIID50006 Teiid translator "teiid" added.

            10:02:19,208 INFO  [org.teiid.RUNTIME] (MSC service thread 1-7) TEIID50038 Teiid Embedded transport enabled. Bound to: teiid/queryengine

            10:02:19,300 INFO  [org.teiid.RUNTIME] (ServerService Thread Pool -- 46) TEIID50006 Teiid translator "teradata" added.

            10:02:19,330 INFO  [org.teiid.RUNTIME] (ServerService Thread Pool -- 46) TEIID50006 Teiid translator "ws" added.

            10:02:19,459 INFO  [org.teiid.RUNTIME] (MSC service thread 1-5) TEIID50012 Teiid JDBC - Host = 127.0.0.1,  Port = 31000, SSL = OFF, security-domains = [teiid-security]

            10:02:19,486 INFO  [org.teiid.RUNTIME] (MSC service thread 1-1) TEIID50037 Teiid ODBC - Host = 127.0.0.1,  Port = 35432, SSL = OFF, security-domains = [teiid-security]

            10:02:19,491 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015876: Starting deployment of "pt_1.war"

            10:02:19,657 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-4) JBAS015012: Started FileSystemDeploymentService for directory C:\Programs\jboss-as-7.1.1.Final-teiid\standalone\deployments

            10:02:19,502 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015876: Starting deployment of "sample_1.war"

            10:02:19,619 INFO  [org.jboss.as.remoting] (MSC service thread 1-7) JBAS017100: Listening on 127.0.0.1/127.0.0.1:4447

            10:02:19,580 INFO  [org.jboss.as.remoting] (MSC service thread 1-1) JBAS017100: Listening on /127.0.0.1:9999

            10:02:19,968 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-7) JBAS018567: Deployment "deployment.pt_1.war" is using a private module ("org.jboss.resteasy.resteasy-jaxrs:main") which may be changed or removed in future versions without notice.

            10:02:19,968 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-1) JBAS018567: Deployment "deployment.sample_1.war" is using a private module ("org.jboss.resteasy.resteasy-jaxrs:main") which may be changed or removed in future versions without notice.

            10:02:20,404 INFO  [org.jboss.resteasy.spi.ResteasyDeployment] (MSC service thread 1-3) Deploying javax.ws.rs.core.Application: class org.teiid.jboss.rest.TeiidRestApplication

            10:02:20,414 INFO  [org.jboss.resteasy.spi.ResteasyDeployment] (MSC service thread 1-2) Deploying javax.ws.rs.core.Application: class org.teiid.jboss.rest.TeiidRestApplication

            10:02:20,444 INFO  [org.jboss.resteasy.spi.ResteasyDeployment] (MSC service thread 1-2) Adding singleton resource org.teiid.jboss.rest.view from Application javax.ws.rs.core.Application

            10:02:20,464 INFO  [org.jboss.resteasy.spi.ResteasyDeployment] (MSC service thread 1-2) Adding singleton resource org.teiid.jboss.rest.api from Application javax.ws.rs.core.Application

            10:02:20,444 INFO  [org.jboss.resteasy.spi.ResteasyDeployment] (MSC service thread 1-3) Adding singleton resource org.teiid.jboss.rest.View from Application javax.ws.rs.core.Application

            10:02:20,598 INFO  [org.jboss.web] (MSC service thread 1-2) JBAS018210: Registering web context: /pt_1

            10:02:20,598 INFO  [org.jboss.web] (MSC service thread 1-3) JBAS018210: Registering web context: /sample_1

            10:02:20,638 INFO  [org.jboss.as.server] (Controller Boot Thread) JBAS018559: Deployed "sample_1.war"

            10:02:20,648 INFO  [org.jboss.as.server] (Controller Boot Thread) JBAS018559: Deployed "pt_1.war"

            10:02:20,678 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015876: Starting deployment of "sample-vdb.xml"

            10:02:20,688 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-8) JBAS015876: Starting deployment of "teiid-connector-infinispan.rar"

            10:02:20,688 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015876: Starting deployment of "teiid-connector-salesforce.rar"

            10:02:20,678 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-7) JBAS015876: Starting deployment of "teiid-connector-google.rar"

            10:02:20,678 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015876: Starting deployment of "teiid-connector-file.rar"

            10:02:20,871 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-8) JBAS018567: Deployment "deployment.teiid-connector-infinispan.rar" is using a private module ("org.infinispan.client.hotrod:main") which may be changed or removed in future versions without notice.

            10:02:20,688 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015876: Starting deployment of "teiid-connector-ws.rar"

            10:02:20,688 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015876: Starting deployment of "teiid-connector-ldap.rar"

            10:02:20,939 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-8) JBAS018567: Deployment "deployment.teiid-connector-infinispan.rar" is using a private module ("org.infinispan.cachestore.remote:main") which may be changed or removed in future versions without notice.

            10:02:21,050 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-8) JBAS018567: Deployment "deployment.teiid-connector-infinispan.rar" is using a private module ("org.jboss.as.clustering.infinispan:main") which may be changed or removed in future versions without notice.

            10:02:21,028 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-2) JBAS018567: Deployment "deployment.teiid-connector-ws.rar" is using a private module ("org.apache.cxf:main") which may be changed or removed in future versions without notice.

            10:02:21,158 INFO  [org.jboss.as.connector.deployers.RADeployer] (MSC service thread 1-1) IJ020001: Required license terms for file:/C:/Programs/jboss-as-7.1.1.Final-teiid/standalone/tmp/vfs/tempcb290556cf30481/teiid-connector-ldap.rar-cd46e44c1fbcff6f/contents/

            10:02:21,160 INFO  [org.jboss.as.connector.deployers.RADeployer] (MSC service thread 1-4) IJ020001: Required license terms for file:/C:/Programs/jboss-as-7.1.1.Final-teiid/standalone/tmp/vfs/tempcb290556cf30481/teiid-connector-file.rar-50b10b1844aa65f/contents/

            10:02:21,254 INFO  [org.teiid.RUNTIME] (MSC service thread 1-5) TEIID50029 VDB sample.1 model "PM1" metadata is currently being loaded. Start Time: 15.01.13 10:02

            10:02:21,092 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-8) JBAS018567: Deployment "deployment.teiid-connector-infinispan.rar" is using a private module ("org.infinispan.client.hotrod:main") which may be changed or removed in future versions without notice.

            10:02:21,293 INFO  [org.teiid.RUNTIME] (teiid-async-threads - 1) TEIID50030 VDB sample.1 model "PM1" metadata loaded. End Time: 15.01.13 10:02

            10:02:21,280 INFO  [org.teiid.RUNTIME] (MSC service thread 1-5) TEIID50029 VDB sample.1 model "View" metadata is currently being loaded. Start Time: 15.01.13 10:02

            10:02:21,222 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-3) JBAS018567: Deployment "deployment.teiid-connector-salesforce.rar" is using a private module ("org.apache.cxf:main") which may be changed or removed in future versions without notice.

            10:02:21,185 INFO  [org.jboss.as.connector.deployers.RADeployer] (MSC service thread 1-7) IJ020001: Required license terms for file:/C:/Programs/jboss-as-7.1.1.Final-teiid/standalone/tmp/vfs/tempcb290556cf30481/teiid-connector-google.rar-d41eb7d06d156a8c/contents/

            10:02:21,163 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-2) JBAS018567: Deployment "deployment.teiid-connector-ws.rar" is using a private module ("org.apache.cxf:main") which may be changed or removed in future versions without notice.

            10:02:21,392 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-3) JBAS018567: Deployment "deployment.teiid-connector-salesforce.rar" is using a private module ("org.apache.cxf:main") which may be changed or removed in future versions without notice.

            10:02:21,462 INFO  [org.jboss.as.connector.deployers.RADeployer] (MSC service thread 1-3) IJ020001: Required license terms for file:/C:/Programs/jboss-as-7.1.1.Final-teiid/standalone/tmp/vfs/tempcb290556cf30481/teiid-connector-salesforce.rar-5c7c8e8495c30270/contents/

            10:02:21,362 INFO  [org.teiid.RUNTIME] (teiid-async-threads - 2) TEIID50030 VDB sample.1 model "View" metadata loaded. End Time: 15.01.13 10:02

            10:02:21,307 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-8) JBAS018567: Deployment "deployment.teiid-connector-infinispan.rar" is using a private module ("org.infinispan.cachestore.remote:main") which may be changed or removed in future versions without notice.

            10:02:21,534 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-8) JBAS018567: Deployment "deployment.teiid-connector-infinispan.rar" is using a private module ("org.jboss.as.clustering.infinispan:main") which may be changed or removed in future versions without notice.

            10:02:21,442 INFO  [org.jboss.as.connector.deployers.RADeployer] (MSC service thread 1-1) IJ020001: Required license terms for file:/C:/Programs/jboss-as-7.1.1.Final-teiid/standalone/tmp/vfs/tempcb290556cf30481/teiid-connector-ws.rar-f2ef47cc05d4ad6c/contents/

            10:02:21,574 INFO  [org.jboss.as.connector.deployers.RADeployer] (MSC service thread 1-8) IJ020001: Required license terms for file:/C:/Programs/jboss-as-7.1.1.Final-teiid/standalone/tmp/vfs/tempcb290556cf30481/teiid-connector-infinispan.rar-7631db611a812db6/contents/

            10:02:21,554 INFO  [org.teiid.RUNTIME] (teiid-async-threads - 2) TEIID40003 VDB sample.1 is set to ACTIVE

            10:02:21,624 INFO  [org.jboss.as] (MSC service thread 1-8) JBAS015951: Admin console listening on http://127.0.0.1:9990

            10:02:21,654 INFO  [org.jboss.as] (MSC service thread 1-8) JBAS015874: JBoss AS 7.1.1.Final "Brontes" started in 6932ms - Started 433 of 541 services (107 services are passive or on-demand)

            10:02:21,766 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "teiid-connector-ws.rar"

            10:02:21,776 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "teiid-connector-salesforce.rar"

            10:02:21,786 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "teiid-connector-ldap.rar"

            10:02:21,796 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "teiid-connector-infinispan.rar"

            10:02:21,816 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "teiid-connector-google.rar"

            10:02:21,826 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "teiid-connector-file.rar"

            10:02:21,836 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "sample-vdb.xml"

            10:02:30,288 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/sample_1].[RestDataservice]] (http--127.0.0.1-8080-1) Servlet.service() for servlet RestDataservice threw exception: org.jboss.resteasy.spi.UnhandledException: java.lang.NullPointerException

                at org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException(SynchronousDispatcher.java:340) [resteasy-jaxrs-2.3.2.Final.jar:]

                at org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:214) [resteasy-jaxrs-2.3.2.Final.jar:]

                at org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(SynchronousDispatcher.java:190) [resteasy-jaxrs-2.3.2.Final.jar:]

                at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:540) [resteasy-jaxrs-2.3.2.Final.jar:]

                at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:502) [resteasy-jaxrs-2.3.2.Final.jar:]

                at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119) [resteasy-jaxrs-2.3.2.Final.jar:]

                at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) [resteasy-jaxrs-2.3.2.Final.jar:]

                at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) [resteasy-jaxrs-2.3.2.Final.jar:]

                at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) [resteasy-jaxrs-2.3.2.Final.jar:]

                at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.13.Final.jar:]

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]

                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.13.Final.jar:]

                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:]

                at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:489) [jbossweb-7.0.13.Final.jar:]

                at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]

                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:]

                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]

                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]

                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]

                at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:]

                at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:]

                at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]

                at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_30]

            Caused by: java.lang.NullPointerException

                at org.teiid.jboss.rest.TeiidRSProvider.execute(TeiidRSProvider.java:64) [teiid-jboss-integration-8.2.0.Final.jar:8.2.0.Final]

                at org.teiid.jboss.rest.View.g1Tableapplication_xml(Unknown Source) [classes:]

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_30]

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_30]

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_30]

                at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_30]

                at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:155) [resteasy-jaxrs-2.3.2.Final.jar:]

                at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:257) [resteasy-jaxrs-2.3.2.Final.jar:]

                at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:222) [resteasy-jaxrs-2.3.2.Final.jar:]

                at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:211) [resteasy-jaxrs-2.3.2.Final.jar:]

                at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:525) [resteasy-jaxrs-2.3.2.Final.jar:]

                ... 20 more

            • 3. Re: Generated REST service failed
              vmelnikov Newbie

              If we see sources for Teiid 8.2

               

              public abstract class TeiidRSProvider {

               

                  public InputStream execute(String vdbName, int version,    String procedureSignature,

                          LinkedHashMap<String, String> parameters, String charSet, boolean passthroughAuth) throws SQLException {

                      Object result = null;

                     

                      //the generated code sends a empty string rather than null.

                      if (charSet != null && charSet.trim().isEmpty()) {

                          charSet = null;

                      }

                     

                      Connection conn = getConnection(vdbName, version, passthroughAuth);

                      boolean usingReturn = procedureSignature.startsWith("{ ?"); //$NON-NLS-1$

                      try {

                          //TODO: an alternative strategy would be to set the parameters based upon name

                          // which would also allow for less parameters to be passed than the procedure requires

                          // however an enhancement would be needed to support named parameters with callable syntax

                          // alternatively if the end parameters are defaultable, then they can be omitted.

                          CallableStatement statement = conn.prepareCall(procedureSignature);

              Line 64: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

              What connection is required from this point for REST? Possible it's  null .......

               

                          if (!parameters.isEmpty()) {

                              int i = usingReturn?2:1;

                              for (String value : parameters.values()) {

                                  statement.setString(i++, value);

                              }

                          }

              • 4. Re: Generated REST service failed
                Ramesh Reddy Master

                That is connection your REST based WAR making to the VDB you deployed. Hence I asked about it in the previous post. The Rest WAR is just a shell that provides the REST based API on top a deployed VDB.

                 

                The issue I am seeing is, the VDB is deployed but not fully loaded yet before the WAR file is trying to make a connection to the VDB. SInce it is not loaded yet, it returns a null connection.  If you deploy the WAR after the VDB is loaded you will not see the issue.

                 

                You can log on issue for this with Teiid Designer.  Possible solutions are (post the below text in JIRA)

                 

                1) What I am not sure is the need for the REST war to make a connection request right upon deployment. If this can be avoided then connection request can be delayed thus giving the VDB to load properly before the connection request. So, this can be avoided.

                 

                2) If Rest war making a "Local Connection", it can use "waitForLoad" property on its connection URL, which will delay the connection request until the VDB loads, thus returning the valid connection.

                 

                Ramesh..

                1 of 1 people found this helpful
                • 5. Re: Generated REST service failed
                  Ted Jones Master

                  Vadim,

                   

                  It looks like you are using the REST capabilities baked into Teiid as outlined here: https://docs.jboss.org/author/display/teiid82final/REST+Service+Through+VDB, right? We also have the capabability to generate a REST war from Teiid Designer. I would suggest trying that and see if that avoids the NPE.. the steps are in http://docs.jboss.org/teiid/designer/8.0/user-guide/en-US/html/metadata-specific-modeling-chapter.html#war-generation-section (6.4.2.2. Generating a RESTEasy War).

                   

                  Thanks,

                  Ted

                  1 of 1 people found this helpful
                  • 7. Re: Generated REST service failed
                    vmelnikov Newbie

                    Ramesh,

                     

                    Thank for your answer. It' more clear now for me.

                    1) But JBoss AS 7 make deployment in different order.

                    In my previous log it was JBoss restart after succefful copying and deployment sample-vdb.xml to deployment directory.

                    During first deployment WAR for REST was deployed after VDB.

                    2) NPE wasn't appeared during deployment  but after browser HTTP method call.

                     

                    Vadim

                    • 8. Re: Generated REST service failed
                      Ramesh Reddy Master

                      Vadim,

                       

                      Yes, you are correct. I realize that this is on restart this NPE occurring, and during restart Teiid is not honoring the  deployment order on restart. This can be fixed easily. Go ahead and log a JIRA, I will get it fixed for next alpha release.

                       

                      Thanks

                       

                      Ramesh..