]
Ramesh Reddy resolved TEIID-2350.
---------------------------------
Resolution: Done
The real issue was when security is used it was not building valid URL, thus connection
was null. Corrected the code.
I really wanted to make this deployment WAR to happen each time server starts, such that
deployment is transient and deployment order can be controlled. However there is bug in
the AS7 code now, undeploy of WAR during shutdown is not cleaning up the content directory
correctly. So, I had leave this in persistent mode. When AS7 fixes this in future
releases, we will move this to non-persistent.
NPE during call generated REST service from browser
---------------------------------------------------
Key: TEIID-2350
URL:
https://issues.jboss.org/browse/TEIID-2350
Project: Teiid
Issue Type: Bug
Components: Server
Affects Versions: 8.2
Environment: Windows 7, JBoss AS 7.1.1 Final
Reporter: Vadim Melnikov
Assignee: Ramesh Reddy
Fix For: 8.3
See also discussion at
https://community.jboss.org/thread/219690
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)
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: