Skip to main content

Posts

Ibatis3 with oracle proxy authentication

Most of all oracle security features could be done by oracle proxy authentication. Oracle proxy authentication provides fine grained access control for temporary users of the account, without compromising the original password even enabling database auditing and logging. In this current post i will first setup database for proxy authentication and later will connect to it by connection pool. 1) Database setup: sqlplus /nolog conn sys/manager@orcl as sysdba create a proxy user create user proxy_user identified by pw_proxy default tablespace users temporary tablespace temp; create a target user create user target_user identified by pw_target default tablespace users temporary tablespace temp quota unlimited on users; now we will alter target user to connect through proxy user alter user target_user grant connect through proxy_user; Also grant create session and the create table system privilege grant create session, create table to targ...

Writing weblogic logs to database table

By default, oracle weblogic server logging service uses an implementation, based on the Java Logging APIs by using the LogMBean.isLog4jLoggingEnabled attribute. With a few effort you can use log4j with weblogic logging service. In the Administration Console, you can specify Log4j or keep the default Java Logging implementation. In this blog i will describe how to configure log4j with weblogic logging service and writes all the logs messages to database table. Most of all cases it's sufficient to writes log on files, however it's better to get all the logs on table to query on it. In our case we have 3 different web logic servers in our project and our consumer need to get all the logs in one central place to diagnose if something goes wrong. First of all we will create a simple table on our oracle database schema and next configure all other parts. Here we go: 1) CREATE TABLE LOGS (USER_ID VARCHAR2(20), DOMAIN varchar2(50), DATED DATE NOT NULL, LOGGER VARCHAR2(500) NOT...

Configure apache CXF project to deploy on Weblogic server 10.3.2.0

Last week we have migrated our one of web service project on apache CXF. Apache CXF provides simplified security package to authentication and authorization for web services. As usual we decided to use Weblogic as our favorite application server to deploy and run migrated service. This blog post is consist of a few tips to configure properly Apache CXF project to deploy on Weblogic server. Most of all tips i have got from the following link JAX-WS, CXF and SAAJ on Oracle Weblogic 10.3 , but it was not sufficient to deploy successfully, a few additional task needed to deploy Apcahe CXF on Weblogic. This current post is all about this tips. First of all we must configure and prepare Apache CXF project to deploy. 1) Add the following fragment of xml configuration to you weblogic.xml <container-descriptor> <prefer-web-inf-classes>true</prefer-web-inf-classes> </container-descriptor> which will force weblogic to use library from WEB-INF/lib. By default Apache CX...

JODReports is alive

Yesterday we got a requirement from our consumer to convert MS office document to Html as like a google feature "View as html" on portal. As always it was very urgent and with high priority task on Jira. At first i have tried to solve it on regular way but found that there is no straight forword way on java to manage the task. A few commercial product has available on the web to solve the task. One of them are Davisor , 1 cpu license is about 2400 euro. Another one is Aspose . Download their trail version and first of all i discover that Aspose has not support convert Pdf to Html. Davisor convert MS office document not very well, nested table couldn't convert to html at all. After a few googling i have found some information to use Open Office Org (ooo) to convert MS office documents to any format including PDF, html e.t.c. Also found a few fragment of code and API documents of OOO and JODConvertor open source to convert MS office documents. With great surprise i found ...

Playing with Ibatis *.*Provider to create dynamic query

Last week, in one of our project, which we decided to upgrade sql queries on ibatis needed dynamic sql query execution. As we decided to use annotations as much as possible on sql mapper - it's seems not a straight to build dynamic query. At first tried to do something as follows: DONOT TRY THIS - IT'S WRONG WAY TO BUILD DYNAMIC QUERY @Update("update ${schemaName}.fdc_uf uf" + " set uf.reestr_date = #{reestDate}," + " uf.reestr_number = #{reestNum}" + " where uf.reestr_number IS NULL AND uf.reestr_date IS NULL and uf.id in " + " <foreach item="item" index="index" collection="list" open="(" separator="," close=")">"+ " #{item}"+ " </foreach>") After some tries, read the user guide attentively, found there are another a few way to build dynamic query, one of them to use Select/Insert/UpdateProvider. These alternative SQL annotations allo...

Call pl/sql package by Ibatis 3

Last few weeks i have been working with a project ,where we decided to use Ibatis for generating complex report. Ibatis is a very small smart ORM tools to execute complex query but, in version 3, developers made a vast change and it's difficult to migrate from version 2 to version 3. In this post i am going to describe how to call pl/sql package function from within Ibatis3. First of all we will create two small tables and a pl/sql package for demonstration: -- Create table create table ADDRESSES ( ADR_ID INTEGER not null, ADR_CITY VARCHAR2(15), ADR_COUNTRY VARCHAR2(15) not null ); alter table ADDRESSES add primary key (ADR_ID); create table PERSONS ( PRS_ID INTEGER not null, PRS_FATHER_ID INTEGER, PRS_MOTHER_ID INTEGER, PRS_ADR_ID INTEGER, PRS_FIRST_NAME VARCHAR2(15), PRS_SURNAME VARCHAR2(15) ); / alter table PERSONS add constraint PRS_ADR_FK foreign key (PRS_ADR_ID) references ADDRESSES (ADR_ID); alter table PERSONS add constraint PRS_PRS_FATHER_FK fo...

Resolve "(MARSHAL) Exception" when deploying osb project on web logic through JMX client

Last week we decided to managing deployment of osb project on web logic cluster throw programmatic way. Throw simple JMX client, it's very easy to deploy and change the runtime configuration of the osb project. However the way to development of the simple client for deploying we got some confrontation, and the current post are all about these. First of all Weblogic(10g R3) JMX implemention classes are no longer exists on weblogic.jar file. Thus, creating new proxy instance for DomainRuntimeServiceMBean might be through java native JMX clasess. However you could use wlfullclient.jar to build all the proxy client, on version 10gR3 oracle transfer all the web logic JMX implemention classes on wlfullclient.jar. Whenever you compile the project successfully and run the client, we found another runtime error related with "(MARSHAL) Exception". The runtime error are as follows: 01.06.2009 13:21:44 com.sun.corba.se.impl.encoding.CDRInputStream_1_0 read_value WARNING: "IOP...