Showing posts with label database. Show all posts
Showing posts with label database. Show all posts

Thursday, 4 July 2013

My Tryst with SOA

For a long time I have been trying to learn SOA but to no avail.

I go through several documents but they are more of a bouncer.

So I thought lets do it the regular way starting with Installation.

So this post covers my issues with SOA.

Prerequisite

1> Download Oracle Weblogic Server ( :) I already had it installed)

2> A database (I already have an Oracle XE database installed)

XE database is not supported but then I am sure it will work for a development environment for testing purpose

3> RCU.

All available for download from OTN (Oracle technology Network).

The document is going to cover several issues that I faced on the install.

Starting with creating an RCU on oracle XE database.
While Installing the RCU on Oracle XE Database.

The first problem that I faced is creating a SYSDBA user I tried using SYS but it would just not connect.

I know many of you folks out there are experienced DBA’s and you might laugh out on my knowledge but then I am from the middle ware team.
So, out of several things that I tried was using the apex GUI but could not get around it.

So I was back to the usual SQL Plus using SQL J.




So now I have a user named user1 which is a SYSDBA.

I though I could go ahead with it but turns out I was wrong.

I got two of the below errors.

ERROR rcu: oracle.sysman.assistants.rcu.backend.action.AbstractAction::handleNonIgnorableError: Received Non-Ignorable Error: Error creating PL/SQL Object WRITE_LINE:PROCEDURE

ERROR rcu: oracle.sysman.assistants.rcu.backend.action.AbstractAction::handleNonIgnorableError: Received Non-Ignorable Error: Error creating PL/SQL Object DEBUG_PURGE:PROCEDURE

This was resolved after assistance from the blogpost


And the solution is to
1>     grant execute on sys.dbms_lock to user1 with grant option

2>     set the Environment variable
RCU_JDBC_TRIM_BLOCKS to TRUE

For Windows set it through
a>     right click on My Computer -> Properties -> Click On Advanced
b>    Click on Environment Variables towards the bottom
c>     Then in System Variables add in new
There is an easier way of doing it.
Instead of double clicking the rcu.bat open a command prompt and then run the below
set RCU_JDBC_TRIM_BLOCKS = TRUE

After this cd to the RCU directory and execute rcu.bat

After this installing RCU was pretty much a cake walk just with certain messages like below







And yes, you will have to remove certain components but then that is ok because all we want is SOA.



 So remove Oracle Identity Manager, Oracl Adaptive Access Manager, Spaces and Service, portal

For the custom variables screen this oracle document was very important




Then Click Next, Next Next and then finally you get the success screen











Tuesday, 12 February 2013

IBM DB2 type 2 Driver with weblogic


Had been facing an issue where while creating a datasource with DB2 9.7 and weblogic server 12c we were continuously facing the below error

<Error> <Console> <BEA-240003> <Administration Console encountered the following error:
java.lang.ClassNotFoundException: Cannot load driver: COM.ibm.db2.jdbc.app.DB2Driver

       at weblogic.jdbc.common.internal.DataSourceUtil.testConnection(DataSourc
eUtil.java:293)
       at com.bea.console.utils.jdbc.JDBCUtils.testConnection(JDBCUtils.java:74
6)
       at com.bea.console.actions.jdbc.datasources.createjdbcdatasource.CreateJ
DBCDataSource.testConnectionConfiguration(CreateJDBCDataSource.java:474)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)

The same was working with weblogic 8.1 and we were just trying an upgrade.

So we start the troubelshooting.

Firstly its classnotfound and not a noclassdef a big difference please Google it and you would understand.

So a classnotfound indicates classes not present apparently there are multiple ways of adding the jar file and most of them depend on how do you start the server.

Long story short we tried everything the jars were there we could see them in the logs.

So the next step. we used -verbose:class and to our surprise the class was getting loaded a couple of lines above when the server would throw the error.

See the snippet below

[Loaded COM.ibm.db2.jdbc.app.DB2Driver from file:/opt/IBM/db2/V9.7/java/db2java.zip]
[Loaded COM.ibm.db2.jdbc.app.DB2Driver$1 from file:/opt/IBM/db2/V9.7/java/db2java.zip]
[Loaded COM.ibm.db2.jdbc.app.DB2Driver$2 from file:/opt/IBM/db2/V9.7/java/db2java.zip]
[Loaded COM.ibm.db2.mri.DB2Messages from file:/opt/IBM/db2/V9.7/java/db2java.zip]
[Loaded COM.ibm.db2.mri.DB2ErrorMessages from file:/opt/IBM/db2/V9.7/java/db2java.zip]
<Error>
<Console> <BEA-240003> <Administration Console encountered the following error: java.lang.ClassNotFoundException: Cannot load driver:COM.ibm.db2.jdbc.app.DB2Driver

The above led us to belive there was something more to the issue.

We found this Doc ID 1431921.1 and we followed it however after following it the issue was the same only the classnotfound was on a different class

i.e COM.ibm.db2.jdbc.net.DB2Driver

Finally the Oracle Rep gave us a patch Bug 13870996which resolved the issue.

Turns out after all the handwork our client wants us to use Type 4 Driver hmm n ..what a waste of time but a great learning experience though.