Skip to main content

Posts

Showing posts from 2010

Deploy apache archiva 1.3.3 on Oracle Weblogic server

Deploy Apache Archiva web application archive (war) is not straight forward on WebLogic, although on apache site it declared that, it should be deploy on any J2ee server. This week we decided to upgrade our Archiva version from 1.3 to 1.3.3 and locate some interesting facts which should be fix to deploy on WebLogic server. In this following blog post you can get some useful information to deploy version 1.3 on WebLogic server. In this current post i am going to explain the maven way to fix all the problems among with Jpox ORM (we have oracle DB 10.3.1 as external database) and mailSession of Archiva to deploy on WebLogic. Most of all configuration you will get from the Apache Archiva site. At first we have to download the source code of the Apache Archiva. You could found it here .Unzip the archive file and run mvn clean install -Dmaven.test.skip=true, it will download a few more plugin and dependency libraries to compile and install the artifact on you local machine (Assume that you

JRebel version 3.5 released

I6 November released JRebel version 3.5. JRebel is an award winning productivity tool for Java EE development. JRebel maps your project workspace directly to your running application. When a developer makes a change to any class or resource in their IDE the change is immediately reflected in the application, skipping the build and redeploy phases. See the leaflet here It takes only a few simple steps to configure and works out. 1) Download the installer from the following location http://www.zeroturnaround.com/jrebel/current 2) Run the setup file 3) Add JRebel plugin in the projects root maven pom.xml as follows: <plugin> <groupId>org.zeroturnaround</groupId> <artifactId>jrebel-maven-plugin</artifactId> <executions> <execution> <id>generate-rebel-xml</id> <phase>process-resources</phase> <goals> <goal>generate</goal> </goals> </execution>

Manipulation Oracle Bpm directory with FDI api

The BPM Directory is an information repository. It stores configuration information about a BPM Environment. This repository is a fundamental component of the BPM Environment; a BPM Environment cannot exist without a BPM Directory. All the users information and organizational unit information maintains on BPM directory. Oracle BPM also provides API named FDI to CRUD operations on these information. For more additional information see here . In this current post, i will provide sample java code which will help to quick start with FDI. Fdi Api is not public api to use, for these reason only a few reference found on the web. Oracle BPM Standard Components Reference provides most of the information to working with FDI. For example purpose, i will use Bpm Standalone Enterprise server directory.xml. To run standalone client we have to need following libraries on class path: fuegopapi-client.jar b1oracle.jar b1base.jar b1util.jar b1resource.jar Here is my maven pom.xml file <proj

Resolve NullPointerException at weblogic.wsee.jaxws.spi.ClientIdentityRegistry.internalAddClientRuntimeMBean

One of our project running on Solaris Sparc system on production, last week we have deployed newer version of our project which have to integrate with 3rd party webservices. On development platform all the test goes fine on Weblogic 10.3.3, but on production we got the following Nullpointer exception: 05-10-2010 18:48:01.066 ERROR r.f.t.a.service.AuctionAOPLogger - Exception: java.lang.NullPointerException: null at weblogic.wsee.jaxws.spi.ClientIdentityRegistry.internalAddClientRuntimeMBean(ClientIdentityRegistry.java:470) ~[weblogic.jar:10.3.3.0] at weblogic.wsee.jaxws.spi.ClientIdentityRegistry.addClientRuntimeMBean(ClientIdentityRegistry.java:424) ~[weblogic.jar:10.3.3.0] at weblogic.wsee.jaxws.tubeline.standard.WseeClientTube.register(WseeClientTube.java:54) ~[weblogic.jar:10.3.3.0] at weblogic.wsee.jaxws.tubeline.standard.WseeClientTube. (WseeClientTube.java:35) ~[weblogic.jar:10.3.3.0] at weblogic.wsee.jaxws.tubeline.standard.StandardTubelineDeploymentListener$1.createClie

Oracle service bus logging with custom JDBCAppander

Last few weeks we are upgrading logging system of our MDM system, we have design a central place for all logging data. With central log system we can afford to manage our system very effectively and debug any fatal error. With OSB it's not straight forword to pulling logging data from console to somewhere, because a few subsystem uses different appender to write and filter log. See the following link to know more about oracle logging service . In my previous post i demonstrate how to use log4j JDBC appender in log4j.properties to redirect log to database table. For the current post we also uses same DDL to create tables 1) CREATE TABLE LOGS (USER_ID VARCHAR2(20), DOMAIN varchar2(50), DATED DATE NOT NULL, LOGGER VARCHAR2(500) NOT NULL, LEVEL VARCHAR2(50) NOT NULL, MESSAGE VARCHAR2(4000) NOT NULL ); 2) Create a simple maven project with a few dependency to create custom JDBCAppender <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="htt

A quick fix to set Locale on OOO (Open office org)

One of our web application uses OOO(open office org 3.2) to convert msOffice file to HTML file. There are a open source project named JodConverter which helps you to do most of the low level works such as connecting to server and much more. For quick start you can see my previous post. Few days ago we got a bug about Russian encoding after converting big Ms Word file to Html, as a usual our developers done their all the best to get rid of it, put directives on html and much more, but all in vain. Then i tried to change the OOO settings which recommended on ooo forums. 1) Change HTML compatibility - character set UTF-8 which should fix the problem but it havn't 2) Then change the Language settings -> set Locale for Russian and the bug fixes. see the screen shot Preferences During my annual vacation, colleague could not manage to change the preferences to the production server. He as usual connect to server by ssl client on cli mode and thus could't change to the prefe

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