*************************************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
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
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)
ReplyDeletefor 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
DeleteI forgot to add ROOT.war.dodeploy. dude you are a genius. awesome
ReplyDeleteThank you :)
DeleteI have TimeOut problems with Wildfly 10 while are startup ROOT.war of Liferay 6.2 GA6 on Linux (CentOS).
ReplyDeleteTrace:
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?
May be your server Ram was full while starting up liferay ..
Deletedo 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
Good blog , thanks for sharing this informative article. oracle training in chennai
ReplyDelete