SmartGWTEE 2.5 eval
The datasources seem to work nicely for our web UI client. Now we are trying to get our other web services to integrate nicely with the SmartGWT server and leverage all the cool stuff in the datasources (ds.xml files).
It seems like RestHandler and AXIS servlets are the way to go but we are having some issues getting them to work.
1) Where is the AxisServlet? I see it mentioned in a document here:
http://www.smartclient.com/smartgwtee/javadoc/com/smartgwt/client/docs/ServletDetails.html but I'm not able to locate the actual servlet anywhere else in the docs. Does it exist?
2) We are trying to get the example for the RestHandler working but are running into errors. We managed to load the servlet successfully and we are able to hit it in the browser, but we get an error. The details are as follows:
URL
http://127.0.0.1:8080/MyWebApp/restapi/?_dataSource=deviceType
This generates the following error:
I'm pretty sure we are hitting the servlet since we get a different error if we try to pass a dataSource param in the URL that doesn't exist. Our DataSource ds.xml is as follows:
Admittedly, I know little about JSON. We are simply trying to see what URL we would need to simply "fetch" a record or all the records from this DataSource (there are only 5 or so in the DB).
We've looked at RestHandler and RestDataSource and the QuickStart. Any other suggestions?
The datasources seem to work nicely for our web UI client. Now we are trying to get our other web services to integrate nicely with the SmartGWT server and leverage all the cool stuff in the datasources (ds.xml files).
It seems like RestHandler and AXIS servlets are the way to go but we are having some issues getting them to work.
1) Where is the AxisServlet? I see it mentioned in a document here:
http://www.smartclient.com/smartgwtee/javadoc/com/smartgwt/client/docs/ServletDetails.html but I'm not able to locate the actual servlet anywhere else in the docs. Does it exist?
2) We are trying to get the example for the RestHandler working but are running into errors. We managed to load the servlet successfully and we are able to hit it in the browser, but we get an error. The details are as follows:
Code:
<servlet> <servlet-name>RESTHandler</servlet-name> <servlet-class>com.isomorphic.servlet.RESTHandler</servlet-class> <init-param> <param-name>defaultDataFormat</param-name> <param-value>json</param-value> </init-param> <init-param> <param-name>wrapJSONResponses</param-name> <param-value>false</param-value> </init-param> <init-param> <param-name>wrapJSONResponses</param-name> <param-value>false</param-value> </init-param> </servlet> <servlet-mapping> <servlet-name>RESTHandler</servlet-name> <url-pattern>/restapi/*</url-pattern> </servlet-mapping>
http://127.0.0.1:8080/MyWebApp/restapi/?_dataSource=deviceType
This generates the following error:
Code:
<BR>com.isomorphic.servlet.RESTHandler top-level exception<BR> <PRE> java.lang.StackOverflowError at sun.nio.cs.SingleByteEncoder.encodeArrayLoop(SingleByteEncoder.java:91) at sun.nio.cs.SingleByteEncoder.encodeLoop(SingleByteEncoder.java:130) at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:544) at sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:252) at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:106) at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:116) at java.io.OutputStreamWriter.write(OutputStreamWriter.java:203) at java.io.Writer.write(Writer.java:140) at org.apache.log4j.helpers.QuietWriter.write(QuietWriter.java:48) at org.apache.log4j.WriterAppender.subAppend(WriterAppender.java:302) at org.apache.log4j.WriterAppender.append(WriterAppender.java:160) at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:251) at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:66) at org.apache.log4j.Category.callAppenders(Category.java:206) at org.apache.log4j.Category.forcedLog(Category.java:391) at org.apache.log4j.Category.debug(Category.java:260) at com.isomorphic.log.Logger.debug(Logger.java:406) at com.isomorphic.datasource.DSRequest.registerFreeResourcesHandler(DSRequest.java:3080) at com.isomorphic.datasource.DataSource.execute(DataSource.java:1142) at com.isomorphic.sql.SQLDataSource.processRequest(SQLDataSource.java:282) at com.isomorphic.sql.SQLDataSource.executeCustom(SQLDataSource.java:240) at com.isomorphic.datasource.DataSource.execute(DataSource.java:1174) at com.isomorphic.sql.SQLDataSource.processRequest(SQLDataSource.java:282) at com.isomorphic.sql.SQLDataSource.executeCustom(SQLDataSource.java:240) at com.isomorphic.datasource.DataSource.execute(DataSource.java:1174) .... the last couple of lines over and over and over again... Stack Overflow...
Code:
<!-- Auto-generated from database table DEVICETYPE --> <DataSource schema="***masked***" dbName="Oracle" tableName="DEVICETYPE_CORE" titleField="DEVICE_TYPE_NAME" infoField="DESCRIPTION" ID="deviceType" serverType="sql" > <fields> <field name="PK" type="sequence" sequenceName="DEVICETYPE_CORE_SEQ" hidden="true" primaryKey="true"></field> <field name="DEVICE_TYPE_NAME" type="text" unique="true" title="Type"></field> <field name="DESCRIPTION" type="text" title="Description"></field> </fields> </DataSource>
We've looked at RestHandler and RestDataSource and the QuickStart. Any other suggestions?
Comment