This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Jython/Python and the fly likes Error while executing create() method in the python function for creating a Oracle connection pool Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Languages » Jython/Python
Bookmark "Error while executing create() method in the python function for creating a Oracle connection pool" Watch "Error while executing create() method in the python function for creating a Oracle connection pool" New topic
Author

Error while executing create() method in the python function for creating a Oracle connection pool

Keerthi Sagar
Greenhorn

Joined: Apr 21, 2007
Posts: 28
Hi,

I am facing the following error while executing create() method in the python function for creating a Oracle connection pool, given below.

#===============================================
# FUNCTION: data_source_create
#===============================================
def data_source_create(theDataSrcName,theUserId,thePassword):
cd("/");
print 'Creating JDBCSystemResource with name '+ theDataSrcName;
aJDBCSysRsc = create(theDataSrcName,"JDBCSystemResource");
aJDBCResource = aJDBCSysRsc.getJDBCResource();
aJDBCResource.setName(theDataSrcName);

aConnectionPoolParams = aJDBCResource.getJDBCConnectionPoolParams();
aConnectionPoolParams.setConnectionReserveTimeoutSeconds(25);
aConnectionPoolParams.setMaxCapacity(100);
aConnectionPoolParams.setTestTableName("dual");

aDataSrcParams = aJDBCResource.getJDBCDataSourceParams();
aDataSrcParams.addJNDIName(theDataSrcName);
aDataSrcParams.setGlobalTransactionsProtocol("None");

aDriverParams = aJDBCResource.getJDBCDriverParams();
aDriverParams.setUrl(deploy_env_ora_database_jdbc_url);
aDriverParams.setDriverName(ora_jdbc_driver);
aDriverParams.setPassword(thePassword);

aDriverProps = aDriverParams.getProperties();
aProperty = aDriverProps.createProperty("user");
aProperty.setValue(theUserId);
return aJDBCSysRsc;

=============================================================
[wlst] Traceback (innermost last):
[wlst] File "weblogic\weblogic_library.py", line 201, in ?
[wlst] File "<string>", line 1, in ?
[wlst] File "weblogic\weblogic_library.py", line 181, in target_environment_create
[wlst] File "weblogic\weblogic_library.py", line 130, in environment_create
[wlst] File "weblogic\weblogic_library.py", line 141, in environment_create_single_server
[wlst] File "weblogic\weblogic_library.py", line 41, in data_source_create
[wlst] File "<iostream>", line 528, in create
[wlst] at weblogic.management.scripting.EditHandler.create(EditHandler.java:531)
[wlst] at weblogic.management.scripting.WLScriptContext.create(WLScriptContext.java:332)
[wlst] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[wlst] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[wlst] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[wlst] at java.lang.reflect.Method.invoke(Method.java:597)
[wlst]
[wlst] java.lang.ClassCastException: java.lang.ClassCastException: java.lang.reflect.InvocationTargetException cannot be cast to weblogic.management.scripting.ScriptException
[wlst]
[wlst] Exception in thread "main" java.lang.IllegalStateException: Traceback (innermost last):
[wlst] File "weblogic\weblogic_library.py", line 201, in ?
[wlst] File "<string>", line 1, in ?
[wlst] File "weblogic\weblogic_library.py", line 181, in target_environment_create
[wlst] File "weblogic\weblogic_library.py", line 130, in environment_create
[wlst] File "weblogic\weblogic_library.py", line 141, in environment_create_single_server
[wlst] File "weblogic\weblogic_library.py", line 41, in data_source_create
[wlst] File "<iostream>", line 528, in create
[wlst] at weblogic.management.scripting.EditHandler.create(EditHandler.java:531)
[wlst] at weblogic.management.scripting.WLScriptContext.create(WLScriptContext.java:332)
[wlst] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[wlst] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[wlst] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[wlst] at java.lang.reflect.Method.invoke(Method.java:597)
[wlst]
[wlst] java.lang.ClassCastException: java.lang.ClassCastException: java.lang.reflect.InvocationTargetException cannot be cast to weblogic.management.scripting.ScriptException
[wlst]
[wlst] at weblogic.management.scripting.WLSTInterpreterInvoker.printError(WLSTInterpreterInvoker.java:110)
[wlst] at weblogic.management.scripting.WLSTInterpreterInvoker.executePyScript(WLSTInterpreterInvoker.java:103)
[wlst] at weblogic.management.scripting.WLSTInterpreterInvoker.main(WLSTInterpreterInvoker.java:27)
======================================================
Technical information
-------------------------
Operating System: Windows XP 32bit.

Ant version: apache-ant-1.8.4

JDK: jdk1.6.0_21. JAVA_HOME=C:\JavaSDK\jdk1.6.0_21 and JAVA_VENDOR=Sun

Weblogic: 10.3.3. While installing I have not selected to install JDK and JRockit plugins. Instead, I pointed the JDK home to C:\JavaSDK\jdk1.6.0_21.

Oracle: 11g version 11.2.0.1.0. Installed as localhost at 1521 port with service name orcl. Server and TNS Listener are up and running.

Python script was executed using WLST task in an Ant Script.

Please let me know if you need any further information.

Thanks and regards,
Y. Keerthi Sagar.
Keerthi Sagar
Greenhorn

Joined: Apr 21, 2007
Posts: 28
I tried to execute the build multiple times. I believe the domain was messed up. I deleted the domain directory and ran build again. It executed successfully.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error while executing create() method in the python function for creating a Oracle connection pool