1 2 Previous Next 20 Replies Latest reply on Jun 14, 2013 12:56 PM by shawkins Go to original post
      • 15. Re: Custom Translator for cleansing
        pinkstondevin

        Ok, i tried using an incorrect translator, it gave me a deployment error.  So i switched it back, and added a sysout in the resultsetexecution but didn't get anything in return.  I also trired in a default constructor with nothing as well.  So it appears that it is not getting into my class?

         

        I attached my module, jar, vdb, and also the single class I am using.

         

        Thank you very much Steven.

        • 16. Re: Custom Translator for cleansing
          shawkins

          Ok, there turns out to be a simple explanation here.  The base delegation logic implements createExecution as a delegating method - that effectively bypasses the override you are adding.  We need to remove that method from the base class.  You can work around this in several ways

          - by just moving your override from createResultSetExceution to createExecution (although more handling would be needed for other execution types)

          - by adding a createExecution method to your cleaner class that is a copy of the intended method from ExecutionFactory - https://github.com/teiid/teiid/blob/master/api/src/main/java/org/teiid/translator/ExecutionFactory.java this will call your overriden createResultSetExecution method as expected

          - create an extended JDBCExecutionFactory that overrides createResultSetExecution

           

          In any case I'll get this corrected moving forward.  Otherwise the setup you have seemed to work.  I could see the sys outs from when the instance is created etc.  Some minor style considerations would be to use a module name that is not under the teiid naming structure (org.jboss.teiid.translator...) and to use a class name with the first letter in upper case.

           

          Steve

          • 17. Re: Custom Translator for cleansing
            pinkstondevin

            Thank you very much Steven!

            • 18. Re: Custom Translator for cleansing
              shawkins

              https://issues.jboss.org/browse/TEIID-2551 will cover this for 8.4.1 and 8.5.

              • 19. Re: Custom Translator for cleansing
                pinkstondevin

                Steven,

                 

                I got the delegating translator working and returning results as long as I do not modify the list.  It seems that if I do any modification to the list, I receive a Null Pointer Exception.  If I don't modify the list/row at all and just return it, the client just prints the results like it normally would.

                 

                I attached the class in this post, everything is working fine, but if I add any logic to the next() i seem to encounter errors.

                 

                Executing using the TeiidDriver

                org.teiid.jdbc.TeiidSQLException: org.teiid.core.TeiidException

                    at org.teiid.jdbc.TeiidSQLException.create(TeiidSQLException.java:135)

                    at org.teiid.jdbc.TeiidSQLException.create(TeiidSQLException.java:71)

                    at org.teiid.jdbc.StatementImpl.postReceiveResults(StatementImpl.java:660)

                    at org.teiid.jdbc.StatementImpl.access$100(StatementImpl.java:63)

                    at org.teiid.jdbc.StatementImpl$2.onCompletion(StatementImpl.java:516)

                    at org.teiid.client.util.ResultsFuture.done(ResultsFuture.java:130)

                    at org.teiid.client.util.ResultsFuture.access$200(ResultsFuture.java:37)

                    at org.teiid.client.util.ResultsFuture$1.receiveResults(ResultsFuture.java:75)

                    at org.teiid.net.socket.SocketServerInstanceImpl.receivedMessage(SocketServerInstanceImpl.java:222)

                    at org.teiid.net.socket.SocketServerInstanceImpl.read(SocketServerInstanceImpl.java:257)

                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

                    at java.lang.reflect.Method.invoke(Method.java:616)

                    at org.teiid.net.socket.SocketServerConnectionFactory$ShutdownHandler.invoke(SocketServerConnectionFactory.java:102)

                    at sun.proxy.$Proxy1.read(Unknown Source)

                    at org.teiid.net.socket.SocketServerInstanceImpl$RemoteInvocationHandler$1.get(SocketServerInstanceImpl.java:356)

                    at org.teiid.jdbc.StatementImpl.executeSql(StatementImpl.java:525)

                    at org.teiid.jdbc.StatementImpl.executeSql(StatementImpl.java:393)

                    at org.teiid.jdbc.StatementImpl.executeQuery(StatementImpl.java:327)

                    at JDBCClient.execute(JDBCClient.java:106)

                    at JDBCClient.main(JDBCClient.java:66)

                Caused by: org.teiid.core.TeiidException

                    at org.teiid.client.ResultsMessage.setException(ResultsMessage.java:202)

                    at org.teiid.dqp.internal.process.RequestWorkItem.sendError(RequestWorkItem.java:955)

                    at org.teiid.dqp.internal.process.RequestWorkItem.close(RequestWorkItem.java:543)

                    at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:346)

                    at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:51)

                    at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:248)

                    at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:268)

                    at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119)

                    at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:214)

                    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)

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

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

                Caused by: java.lang.NullPointerException

                    at org.teiid.translator.cleaner.cleaner$1.next(cleaner.java:93)

                    at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.handleBatch(ConnectorWorkItem.java:313)

                    at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.more(ConnectorWorkItem.java:139)

                    at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:449)

                    at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:159)

                    at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:156)

                    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)

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

                    at org.teiid.dqp.internal.process.FutureWork.run(FutureWork.java:58)

                    ... 6 more

                 

                Thank you.

                • 20. Re: Custom Translator for cleansing
                  shawkins

                  I should have mentioned before that you'll always have an npe with the current code as result sets are null terminated.

                   

                  Steve

                  1 2 Previous Next