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

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

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

claudef
Dear Ranga,

Did you try to catch the exception explicitly?  

try:
    testcon = AdminControl.testConnection(eachDataSource)
#Catch javax.management.JMRuntimeException Exceptions
except javax.management.JMRuntimeException, e:    
    errorfound = String.valueOf(e)
    print("javax.management.JMRuntimeException" + errorfound)        


Give it a trial and . let us know of the results.

Regards,
Claude
 


Claude Falbriard
Certified IT Specialist L2 - Middleware
AMS Hortolândia / SP - Brazil
phone:    +55 13 9 9760 0453
cell:         +55 13 9 8117 3316
e-mail:    [hidden email]




From:        "Ranga Raju C.V.S." <[hidden email]>
To:        [hidden email],
Date:        18/09/2014 11:50
Subject:        [Jython-users] WAS 7.0 wsadmin jython 2.1 datasource testConnection not catching exception properly




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