This week The apache Ignite book becomes one of the top books of leanpub

This week The apache Ignite book becomes one of the top books of leanpub.


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 already have mvn installed on your system).
Our aim is to add one weblogic.xml descriptor file to archiva-webapp/src/main/webapp/WEB-INF, add one maven ear module on archiva-web module to get ear artifact and edit archiva-base.xml file to change the column length.
First of all we will add following weblogic.xml in the \src\apache-archiva-1.3.3-src\archiva-modules\archiva-web\archiva-webapp\src\main\webapp\WEB-INF directory.
<?xml version = '1.0' encoding = 'windows-1252'?>
<weblogic-web-app xmlns:xsi=""
Which will active resource location by jndi
Next we have to make some change on archive-base.xml located on \src\apache-archiva-1.3.3-src\archiva-modules\archiva-base\archiva-model\src\main\mdo . By default Archiva released with Jpox orm which data base object mapping is not supported for Oracle data types. Change the mapping for column named "message" for table  REPOSITORY_PROBLEMS as follows:
 <field stash.maxSize="4000">
    The origin of the health problem.
Change the length of the field named "message" for table LICENSES as follows:
 <field stash.maxSize="4000">
    Addendum information pertaining to this license.
Edit the length of the field named "description"for tables PROJECT as follows:
 <field stash.maxSize="4000">
    The description of this project.

You could also set the data type to Clob in order to String. The above fixes is enough to get rid of the following errors on weblogic:
java.sql.SQLSyntaxErrorException: ORA-00910: specified length too long for its datatype
You can compile and build the artifact to deploy it to WebLogic, it will set the context root to archiva-web-1.3.3. In order to change the context root of the Archiva web application we can create a maven ear module on archiva-web directory as follows:

add the module in the archive-web pom.xml as follows:
archiva-ear module will have the following structure:
pom.xml will have the following content:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="" xmlns:xsi="" xsi:schemaLocation="">
    <name>Archiva Ear :: Application</name>
Add the following weblogic-application.xml into the archiva-web\archiva-ear\src\main\resources\META-INF directory
<?xml version = '1.0' encoding = 'windows-1252'?>
<weblogic-application xmlns:xsi=""
                      xsi:schemaLocation="" xmlns="">
Now the code is complete and you can build and deploy to Weblogic server.
Happy coding & happy new year.

No comments :