Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Keerthi Sagar
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic