WAS 7.0 wsadmin jython 2.1 datasource testConnection not catching exception properly

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

WAS 7.0 wsadmin jython 2.1 datasource testConnection not catching exception properly

Ranga Raju

In WebSphere App Server 7.0.0.33 wsadmin (jython 2.1), for some reason it is not catching certain exceptions properly. Below command is used to test a WAS datasource connection.


try:

                        testcon = AdminControl.testConnection(eachDataSource)

                except:

                        typ,val,tb = sys.exc_info()[1]

                        print

                        print "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"

                        print "Exception Type:"

                        print typ

                        print "Exception Value:"

                        print val

                        print "Traceback:"

                        print tb

                        print "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"

                        print

                        FAILED_DS.append(dsname)

                        continue


I get the following exceptions when this command is run:

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

Working on DataSource: quoting_integration_datasource

com.ibm.rmi.ras.Utility.newWriter: could not write to orbtrc.15092014.1558.28.txt : java.io.FileNotFoundException: /was6/was_ds/v70/ksh/orbtrc.15092014.1558.28.txt (Permission denied)

WASX7017E: Exception received while running file "/was_ds/v70/jython/testDataSources.py"; exception information: javax.management.JMRuntimeException:

        >> SERVER (id=144d42ac, host=venice1) TRACE START:

        >>    javax.management.JMRuntimeException: ADMN0034E: The service is unable to obtain a valid administrative client to connect process "venice1quoting1" from process "nodeagent", because of exception: com.ibm.websphere.management.exception.ConnectorException: com.ibm.ws.management.connector.ipc.RetryCandidateException: java.lang.ClassNotFoundException: oracle.net.ns.NetException

        >>       at com.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:1366)

        >>       at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)

        >>       at com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:1224)

        >>       at com.ibm.ws.management.connector.AdminServiceDelegator.invoke(AdminServiceDelegator.java:181)

        >>       at com.ibm.ws.management.connector.ipc.CallRouter.route(CallRouter.java:242)

       >>       at com.ibm.ws.management.connector.ipc.IPCConnectorInboundLink.doWork(IPCConnectorInboundLink.java:353)

        >>       at com.ibm.ws.management.connector.ipc.IPCConnectorInboundLink$IPCConnectorReadCallback.complete(IPCConnectorInboundLink.java:595)

        >>       at com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCompletedCallback.complete(SSLReadServiceContext.java:1818)

        >>       at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)

        >>       at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)

        >>       at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)

        >>       at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)

        >>       at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)

        >>       at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)

        >>       at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)

        >>       at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1660)

        >> SERVER (id=144d42ac, host=venice1) TRACE END.

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


As you can see above, the try-except block failed to catch the exception. Please let me know hwo to re-phrase my try-except block commands so I can catch the above exception properly ?

Thank you in advance ...

Regards,

Ranga Raju...


------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________
Jython-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jython-users
Reply | Threaded
Open this post in threaded view
|

Re: WAS 7.0 wsadmin jython 2.1 datasource testConnection not catching exception properly

Jeff Emanuel
try:
  yourcodehere()
except java.lang.Exception, javaEx:
  handleJava(javaEx)
except Except, pyEx:
  handlePy(pyEx)


On 9/18/2014 8:51 AM, Ranga Raju C.V.S. wrote:

In WebSphere App Server 7.0.0.33 wsadmin (jython 2.1), for some reason it is not catching certain exceptions properly. Below command is used to test a WAS datasource connection.


try:

                        testcon = AdminControl.testConnection(eachDataSource)

                except:

                        typ,val,tb = sys.exc_info()[1]

                        print

                        print "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"

                        print "Exception Type:"

                        print typ

                        print "Exception Value:"

                        print val

                        print "Traceback:"

                        print tb

                        print "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"

                        print

                        FAILED_DS.append(dsname)

                        continue


I get the following exceptions when this command is run:

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

Working on DataSource: quoting_integration_datasource

com.ibm.rmi.ras.Utility.newWriter: could not write to orbtrc.15092014.1558.28.txt : java.io.FileNotFoundException: /was6/was_ds/v70/ksh/orbtrc.15092014.1558.28.txt (Permission denied)

WASX7017E: Exception received while running file "/was_ds/v70/jython/testDataSources.py"; exception information: javax.management.JMRuntimeException:

        >> SERVER (id=144d42ac, host=venice1) TRACE START:

        >>    javax.management.JMRuntimeException: ADMN0034E: The service is unable to obtain a valid administrative client to connect process "venice1quoting1" from process "nodeagent", because of exception: com.ibm.websphere.management.exception.ConnectorException: com.ibm.ws.management.connector.ipc.RetryCandidateException: java.lang.ClassNotFoundException: oracle.net.ns.NetException

        >>       at com.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:1366)

        >>       at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)

        >>       at com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:1224)

        >>       at com.ibm.ws.management.connector.AdminServiceDelegator.invoke(AdminServiceDelegator.java:181)

        >>       at com.ibm.ws.management.connector.ipc.CallRouter.route(CallRouter.java:242)

       >>       at com.ibm.ws.management.connector.ipc.IPCConnectorInboundLink.doWork(IPCConnectorInboundLink.java:353)

        >>       at com.ibm.ws.management.connector.ipc.IPCConnectorInboundLink$IPCConnectorReadCallback.complete(IPCConnectorInboundLink.java:595)

        >>       at com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCompletedCallback.complete(SSLReadServiceContext.java:1818)

        >>       at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)

        >>       at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)

        >>       at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)

        >>       at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)

        >>       at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)

        >>       at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)

        >>       at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)

        >>       at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1660)

        >> SERVER (id=144d42ac, host=venice1) TRACE END.

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


As you can see above, the try-except block failed to catch the exception. Please let me know hwo to re-phrase my try-except block commands so I can catch the above exception properly ?

Thank you in advance ...

Regards,

Ranga Raju...



------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk


_______________________________________________
Jython-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jython-users


------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________
Jython-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jython-users
Reply | Threaded
Open this post in threaded view
|

Re: WAS 7.0 wsadmin jython 2.1 datasource testConnection not catching exception properly

Jeff Emanuel
sorry, "Except" below should obviously be "Exception"

On 9/18/2014 9:16 AM, Jeff Emanuel wrote:
try:
  yourcodehere()
except java.lang.Exception, javaEx:
  handleJava(javaEx)
except Except, pyEx:
  handlePy(pyEx)


On 9/18/2014 8:51 AM, Ranga Raju C.V.S. wrote:

In WebSphere App Server 7.0.0.33 wsadmin (jython 2.1), for some reason it is not catching certain exceptions properly. Below command is used to test a WAS datasource connection.


try:

                        testcon = AdminControl.testConnection(eachDataSource)

                except:

                        typ,val,tb = sys.exc_info()[1]

                        print

                        print "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"

                        print "Exception Type:"

                        print typ

                        print "Exception Value:"

                        print val

                        print "Traceback:"

                        print tb

                        print "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"

                        print

                        FAILED_DS.append(dsname)

                        continue


I get the following exceptions when this command is run:

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

Working on DataSource: quoting_integration_datasource

com.ibm.rmi.ras.Utility.newWriter: could not write to orbtrc.15092014.1558.28.txt : java.io.FileNotFoundException: /was6/was_ds/v70/ksh/orbtrc.15092014.1558.28.txt (Permission denied)

WASX7017E: Exception received while running file "/was_ds/v70/jython/testDataSources.py"; exception information: javax.management.JMRuntimeException:

        >> SERVER (id=144d42ac, host=venice1) TRACE START:

        >>    javax.management.JMRuntimeException: ADMN0034E: The service is unable to obtain a valid administrative client to connect process "venice1quoting1" from process "nodeagent", because of exception: com.ibm.websphere.management.exception.ConnectorException: com.ibm.ws.management.connector.ipc.RetryCandidateException: java.lang.ClassNotFoundException: oracle.net.ns.NetException

        >>       at com.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:1366)

        >>       at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)

        >>       at com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:1224)

        >>       at com.ibm.ws.management.connector.AdminServiceDelegator.invoke(AdminServiceDelegator.java:181)

        >>       at com.ibm.ws.management.connector.ipc.CallRouter.route(CallRouter.java:242)

       >>       at com.ibm.ws.management.connector.ipc.IPCConnectorInboundLink.doWork(IPCConnectorInboundLink.java:353)

        >>       at com.ibm.ws.management.connector.ipc.IPCConnectorInboundLink$IPCConnectorReadCallback.complete(IPCConnectorInboundLink.java:595)

        >>       at com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCompletedCallback.complete(SSLReadServiceContext.java:1818)

        >>       at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)

        >>       at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)

        >>       at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)

        >>       at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)

        >>       at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)

        >>       at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)

        >>       at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)

        >>       at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1660)

        >> SERVER (id=144d42ac, host=venice1) TRACE END.

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


As you can see above, the try-except block failed to catch the exception. Please let me know hwo to re-phrase my try-except block commands so I can catch the above exception properly ?

Thank you in advance ...

Regards,

Ranga Raju...



------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk


_______________________________________________
Jython-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jython-users



------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk


_______________________________________________
Jython-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jython-users


------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________
Jython-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jython-users