Skip to main content

Installing liferay 6.2 on wildfly 10 app server and oracle 11g database & windows machine

*************************************DATABASE CREATION***********************************************************************************************

DOWNLOAD LIFERAY PORTAL SCRIPTS FROM https://www.liferay.com/downloads/liferay-portal/available-releases

Rename the file as liferay.sql
put it let say in under c drive , so it will be located like this  c:\liferay.sql
from cmd dir c:\


SQLPLUS
/ AS SYSDBA
@liferay.sql lportal lportal

it will create the db ..after finishing go to sqlplus again to ggrant the below  to lportal user

SQLPLUS
/ AS SYSDBA
grant create session to lportal;
grant connect to lportal;
grant resource to lportal;


*******************************CONFIGURE WILDFLY TO CONNECT TO ORACLE DB *****************************************************************************************************
 configure wildfly to connect to oracle db
Download the driver: ojdbc[VERSION].jar
Create subfolders [WILDFLY_HOME]/modules/system/layers/base/com/oracle/main/
Copy the downloaded ojdbc[VERSION].jar into the freshly created folder
Create a file module.xml, in the same folder as above, with the contents:

<module xmlns="urn:jboss:module:1.1" name="com.oracle">
  <resources>
    <resource-root path="ojdbc14.jar"/>
  </resources>
  <dependencies>
    <module name="javax.api"/>
    <module name="javax.transaction.api"/>
  </dependencies>
</module>

In the configuration file standalone.xml add the entry:

<driver name="oracle" module="com.oracle">
 <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
</driver>

within the <drivers> tag.
Add a datasource definition within the <datasources> tag (next to ExampleDS):

<datasource jndi-name="java:/liferayDS" pool-name="OracleDS" enabled="true">
 <connection-url>jdbc:oracle:thin:@[HOST_NAME]:1521:[SID]</connection-url>
  <driver>oracle[has to match the driver name]</driver>
  <pool>
   <min-pool-size>1</min-pool-size>
   <max-pool-size>5</max-pool-size>
   <prefill>true</prefill>
  </pool>
  <security>
   <user-name>[USER]</user-name>
   <password>[PWD]</password>
  </security>
</datasource>



******************************CONFIGURE LIFERAY******************************************************************************************************


1- create empty folder liferay6.2 and put wildfly server under it
2-create inv variable  WILDFLY_HOME = C:\liferay6.2\wildfly-10.0.0.Final
3- create these folders C:\liferay6.2\wildfly-10.0.0.Final\modules\com\liferay\portal\main
4- copy the liferay dependancies jars {hsql.jar,portal-service.jar,portlet.jar,ojdbc14.jar} under the created main folder above
5- download liferay.registry.jar https://repository.liferay.com/nexus/content/groups/liferay-ce/com/liferay/com.liferay.registry.api/1.0.2/com.liferay.registry.api-1.0.2.jar and put it also under main folder  (rename it as com.liferay.registry.api.jar )
6- do the same for tracker.collection.jar   https://repository.liferay.com/nexus/content/groups/liferay-ce/com/liferay/com.liferay.osgi.service.tracker.collections/2.0.0/com.liferay.osgi.service.tracker.collections-2.0.0.jar  (rename it as com.liferay.osgi.service.tracker.collections.jar)
7-
Create the file module.xml in the $WILDFLY_HOME/modules/com/liferay/portal/main folder and insert the following contents:

<?xml version="1.0"?>

<module xmlns="urn:jboss:module:1.0" name="com.liferay.portal">
    <resources>
        <resource-root path="com.liferay.registry.api.jar" />
        <resource-root path="ojdbc14.jar" />
        <resource-root path="portal-service.jar" />
        <resource-root path="portlet.jar" />
    </resources>
    <dependencies>
        <module name="javax.api" />
        <module name="javax.mail.api" />
        <module name="javax.servlet.api" />
        <module name="javax.servlet.jsp.api" />
        <module name="javax.transaction.api" />
    </dependencies>
</module>

8- copy osgi folder from any liferay bundle and put it under liferay home folder  in our case it is under c:\liferay6.2

9- go to wildfly standalone.xml  under C:\liferay6.2\wildfly-10.0.0.Final\standalone\configuration
Locate the closing </extensions> tag. Directly beneath that tag, insert the following system properties:

<system-properties>
    <property name="org.apache.catalina.connector.URI_ENCODING" value="UTF-8" />
    <property name="org.apache.catalina.connector.USE_BODY_ENCODING_FOR_QUERY_STRING" value="true" />
</system-properties>
10 - search for  <subsystem xmlns="urn:jboss:domain:deployment-scanner:2.0">  and under it  inside the tag <deployment-scanner  , add this deployment-timeout="340"
11 -Add the following JAAS security domain to the security subsystem <security-domains> defined in element <subsystem xmlns="urn:jboss:domain:security:1.2">.

<security-domain name="PortalRealm">
    <authentication>
        <login-module code="com.liferay.portal.security.jaas.PortalLoginModule" flag="required" />
    </authentication>
</security-domain>
Remove the following tags (if necessary):

<location name="/" handler="welcome-content"/>
<extension module="org.jboss.as.weld"/>
<subsystem xmlns="urn:jboss:domain:weld:2.0"/>
<subsystem xmlns="urn:jboss:domain:weld:3.0"/>
Find the <jsp-config/> tag and insert the development="true" attribute into the tag. Once finished, the tag should look like the following:

<jsp-config development="true" />

12- in standalone.conf.bat change rem set "JAVA_OPTS=-Xms64M -Xmx512M -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m"  to

    set "JAVA_OPTS=%JAVA_OPTS% -Dfile.encoding=UTF-8 -Djava.net.preferIPv4Stack=true -Dsecmgr -Djava.security.policy=$WILDFLY_HOME/bin/server.policy -Dwildfly.home.dir=$WILDFLY_HOME -Duser.timezone=GMT -Xmx1024m -XX:MaxMetaspaceSize=384m -XX:MetaspaceSize=200m"


13-If you’re using Wildfly to manage your data source, add the following configuration to your portal-ext.properties file in your Liferay Home to refer to your data source:

jdbc.default.jndi.name=java:jboss/datasources/liferayDS

14- create folder name it as ROOT.war  under C:\liferay6.2\wildfly-10.0.0.Final\standalone\deployments

15 - extract liferay-portal.war   under C:\liferay6.2\wildfly-10.0.0.Final\standalone\deployments\ROOT.war

16- create empty file under ROOT.war name it as ROOT.war.dodeploy


17- start the standalone server and have fun






Comments

  1. I have followed your instruction but when i go to this address http://localhost:8080/ after starting the server it shows 404 - Not Found however the console shows WildFly Full 10.0.0.Final (WildFly Core 2.0.10.Final) started in 1921ms - Started 266 of 553 services (371 services are lazy, passive or on-demand)

    ReplyDelete
    Replies
    1. for 404 error >>the first time startup will take a while (depending on your machine processor and ram) as Liferay is generating a lot of files and during this time the Wildfly app server console will not tell you any details... if your machine is not powerful enough then in step 10 you may increase deployment-timeout and wait for it

      Delete
  2. I forgot to add ROOT.war.dodeploy. dude you are a genius. awesome

    ReplyDelete
  3. I have TimeOut problems with Wildfly 10 while are startup ROOT.war of Liferay 6.2 GA6 on Linux (CentOS).


    Trace:

    17:05:24,126 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0348: Timeout after [300] seconds waiting for service container stability. Operation will roll back. Step that first updated the service container was 'add' at address '[
    ("core-service" => "management"),
    ("management-interface" => "http-interface")
    ]'
    17:05:51,915 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0190: Step handler org.jboss.as.server.DeployerChainAddHandler$FinalRuntimeStepHandler@2a022f50 for operation {"operation" => "add-deployer-chains","address" => []} at address [] failed handling operation rollback -- java.util.concurrent.TimeoutException: java.util.concurrent.TimeoutException
    at org.jboss.as.controller.OperationContextImpl.waitForRemovals(OperationContextImpl.java:511)
    at org.jboss.as.controller.AbstractOperationContext$Step.handleResult(AbstractOperationContext.java:1369)
    at org.jboss.as.controller.AbstractOperationContext$Step.finalizeInternal(AbstractOperationContext.java:1328)
    at org.jboss.as.controller.AbstractOperationContext$Step.finalizeStep(AbstractOperationContext.java:1301)
    at org.jboss.as.controller.AbstractOperationContext$Step.access$300(AbstractOperationContext.java:1185)
    at org.jboss.as.controller.AbstractOperationContext.executeResultHandlerPhase(AbstractOperationContext.java:767)
    at org.jboss.as.controller.AbstractOperationContext.processStages(AbstractOperationContext.java:644)
    at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:370)
    at org.jboss.as.controller.OperationContextImpl.executeOperation(OperationContextImpl.java:1344)
    at org.jboss.as.controller.ModelControllerImpl.boot(ModelControllerImpl.java:485)
    at org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.java:387)
    at org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.java:349)
    at org.jboss.as.server.ServerService.boot(ServerService.java:392)
    at org.jboss.as.server.ServerService.boot(ServerService.java:365)
    at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:299)
    at java.lang.Thread.run(Thread.java:745)


    With this JAVA_OPTS

    JAVA_OPTS=" -Dfile.encoding=UTF-8 -Djava.net.preferIPv4Stack=true "
    JAVA_OPTS="$JAVA_OPTS -Dsecmgr -Djava.security.policy=$JBOSS_HOME/bin/server.policy "
    JAVA_OPTS="$JAVA_OPTS -Dwildfly.home.dir=$JBOSS_HOME -Duser.timezone=GMT "
    JAVA_OPTS="$JAVA_OPTS -Xmx2048m -Xms2048m -XX:MaxMetaspaceSize=384m -XX:MetaspaceSize=200m "

    Adding "-Djboss.as.management.blocking.timeout=800" is not enought time and stop in every cases.

    I miss something for to do?

    ReplyDelete
    Replies
    1. May be your server Ram was full while starting up liferay ..
      do the same process again and trace your ram usage in your system task manager
      you may need a bigger RAM or you may need to stop some running heavy software while starting lifer

      Delete
  4. Good blog , thanks for sharing this informative article. oracle training in chennai

    ReplyDelete

Post a Comment

Popular posts from this blog

itext 2.7.1 writing Arabic and English content in a PDF file

   public void createPdf(String filename) throws IOException, DocumentException {               Document document = new Document();           PdfWriter.getInstance(document, new FileOutputStream(filename));             document.open();             document.add(Chunk.NEWLINE);        FontFactory.register("c:/windows/fonts/tradbdo.ttf", "my_arabic");               Font myArabicFont = FontFactory.getFont("my_arabic" ,BaseFont.IDENTITY_H, BaseFont.EMBEDDED);         PdfPTable table = new PdfPTable(1);         table.getDefaultCell().setNoWrap(false);        // table.setRunDirection(PdfWriter.RUN_DIRECTION_RTL);         PdfPCell text = new PdfPCell(new Phrase("محمود السنباطيthis is أبتثجحخدرزسشصضطظعغفقكلمنهوى", myArabicFont));         text.setRunDirection(PdfWriter.RUN_DIRECTION_RTL);          text.setNoWrap(false);          table.addCell(text);     //Add the table to the document         document.add(table);                  

Fast Download with progress indication facility using Java NIO

package test; import java.io.FileOutputStream; import java.io.IOException; import java.net.HttpURLConnection; import java.net.URL; import java.nio.ByteBuffer; import java.nio.channels.Channels; import java.nio.channels.ReadableByteChannel; import java.util.Date; public class DownloadProgressExample {     public static void main( String[] args ) {         new Downloader( "c:/header12.jpg", "http://www.daralshifa.com/images/mainheader/header12.jpg" );     }     private interface RBCWrapperDelegate {          // The RBCWrapperDelegate receives rbcProgressCallback() messages         // from the read loop.  It is passed the progress as a percentage         // if known, or -1.0 to indicate indeterminate progress.         //         // This callback hangs the read loop so a smart implementation will         // spend the least amount of time possible here before returning.         //         // One possible implementation is to push the progress message         // atomic