Ported GlassFish support from experimental to stable.
This commit is contained in:
parent
b5100fc3c4
commit
b0d7f89e8a
|
@ -55,7 +55,10 @@
|
|||
<condition property="isAppsTomcat">
|
||||
<equals arg1="tomcatOnly" arg2="${ADEMPIERE_APPS_TYPE}" />
|
||||
</condition>
|
||||
<echo message="Windows=${isWindows} JBoss=${isAppsJBoss} Tomcat=${isAppsTomcat}" />
|
||||
<condition property="isAppsGlassfish">
|
||||
<equals arg1="Glassfish" arg2="${ADEMPIERE_APPS_TYPE}" />
|
||||
</condition>
|
||||
<echo message="Windows=${isWindows} JBoss=${isAppsJBoss} Tomcat=${isAppsTomcat} Glassfish=${isAppsGlassfish}" />
|
||||
|
||||
</target>
|
||||
|
||||
|
@ -359,7 +362,11 @@
|
|||
<!-- bundle everything in one ear file for simpler deployment -->
|
||||
<ear destfile="${basedir}/lib/adempiere.ear" appxml="${basedir}/lib/adempiereAll.xml">
|
||||
<fileset dir="${basedir}/lib"
|
||||
includes="Adempiere.jar,AdempiereSLib.jar,adempiereRoot.jar,adempiereApps.jar,adempiereApps.war,adempiereRoot.war,adempiereWebStore.war,adempiereWebCM.war,posterita.war,webui.war" />
|
||||
includes="Adempiere.jar,AdempiereSLib.jar,adempiereRoot.jar,adempiereApps.jar,adempiereApps.war,adempiereRoot.war,adempiereWebStore.war,adempiereWebCM.war,posterita.war,posterita.jar,webui.war" />
|
||||
</ear>
|
||||
<ear destfile="${basedir}/adempiereGlassfish.ear" appxml="${basedir}/lib/adempiereAll.xml">
|
||||
<fileset dir="${basedir}/lib"
|
||||
includes="Adempiere.jar,AdempiereSLib.jar,adempiereRoot.jar,adempiereApps.jar,adempiereApps.war,adempiereRoot.war,adempiereWebStore.war,adempiereWebCM.war,posterita.war,posterita.jar,webui.war" />
|
||||
</ear>
|
||||
</target>
|
||||
|
||||
|
@ -387,6 +394,24 @@
|
|||
</unjar>
|
||||
</target>
|
||||
|
||||
<!-- ==================================================== -->
|
||||
<!-- Setup Glassfish (Sun Application Server) -->
|
||||
<!-- ==================================================== -->
|
||||
<target name="setupGlassfish" depends="setupLib, setupEAR" if="isAppsGlassfish"
|
||||
description="Setup Glassfish Application Server">
|
||||
<!-- HAVE NO IDEA ON EARTH AS TO WHAT CHANGES MIGHT BE NEEDED HERE.
|
||||
LEFT BLANK FOR NOW
|
||||
CATCH U LATER
|
||||
|
||||
ANOTHER POINT: IS SETUPLIB REQUIRED?
|
||||
-->
|
||||
|
||||
<!-- PLAN AHEAD: MAKE SURE THAT THE EAR FILE GENERATION IS STOPPED THE MOMENT
|
||||
GLASSFISH PROPERTY IS DETECTED. THEN MANUALLY DEPLOY THE APPLICATION
|
||||
-->
|
||||
|
||||
</target>
|
||||
|
||||
<!-- ==================================================== -->
|
||||
<!-- Setup JBoss Server -->
|
||||
<!-- ==================================================== -->
|
||||
|
@ -474,7 +499,7 @@
|
|||
<!-- ==================================================== -->
|
||||
<!-- Deploy J2EE Server -->
|
||||
<!-- ==================================================== -->
|
||||
<target name="setupDeploy" depends="setupJBoss, setupTomcat"
|
||||
<target name="setupDeploy" depends="setupJBoss, setupTomcat, setupGlassfish"
|
||||
description="Deploy Adempiere Application Server">
|
||||
<echo message="AppsDeployment= ${ADEMPIERE_APPS_DEPLOY}" />
|
||||
</target>
|
||||
|
|
|
@ -0,0 +1,173 @@
|
|||
/**********************************************************************
|
||||
* This file is part of Adempiere ERP Bazaar *
|
||||
* http://www.adempiere.org *
|
||||
* *
|
||||
* Copyright (C) Praneet Tiwari. *
|
||||
* Copyright (C) Contributors *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU General Public License *
|
||||
* as published by the Free Software Foundation; either version 2 *
|
||||
* of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the Free Software *
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, *
|
||||
* MA 02110-1301, USA. *
|
||||
* *
|
||||
* Contributors: *
|
||||
* - Trifon Trifonov (trifonnt@users.sourceforge.net) *
|
||||
* *
|
||||
* Sponsors: *
|
||||
* - D3 Soft (http://www.d3-soft.com) *
|
||||
***********************************************************************/
|
||||
|
||||
package org.compiere.install;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.*;
|
||||
|
||||
/**
|
||||
* GlassFish v2UR1 Apps Server Configuration
|
||||
*
|
||||
* @author Praneet Tiwari
|
||||
* @author Trifon Trifonov
|
||||
* @version $Id: $
|
||||
*/
|
||||
|
||||
public class ConfigGlassfish extends Config {
|
||||
|
||||
/**
|
||||
* ConfigGlassfish
|
||||
* @param data configuration
|
||||
*/
|
||||
public ConfigGlassfish (ConfigurationData data)
|
||||
{
|
||||
super (data);
|
||||
} // ConfigGlassfish
|
||||
|
||||
/**
|
||||
* Initialize
|
||||
*/
|
||||
public void init()
|
||||
{
|
||||
p_data.setAppsServerDeployDir(getDeployDir());
|
||||
p_data.setAppsServerDeployDir(false);
|
||||
//
|
||||
p_data.setAppsServerJNPPort("1099");
|
||||
p_data.setAppsServerJNPPort(true);
|
||||
p_data.setAppsServerWebPort("8080");
|
||||
p_data.setAppsServerWebPort(true);
|
||||
p_data.setAppsServerSSLPort("443");
|
||||
p_data.setAppsServerSSLPort(true);
|
||||
} // init
|
||||
|
||||
/**
|
||||
* Get Deployment Dir
|
||||
* @return deployment dir
|
||||
*/
|
||||
private String getDeployDir()
|
||||
{
|
||||
// TODO - check deployment directory
|
||||
return p_data.getAdempiereHome();
|
||||
/*Commented for now
|
||||
+ File.separator + "glassfish"
|
||||
+ File.separator + "domains"
|
||||
+ File.separator + "domain1" ;
|
||||
* */
|
||||
} // getDeployDir
|
||||
|
||||
/**
|
||||
* Test
|
||||
* @return error message or null if OK
|
||||
*/
|
||||
public String test()
|
||||
{
|
||||
// AppsServer
|
||||
String server = p_data.getAppsServer();
|
||||
boolean pass = server != null && server.length() > 0
|
||||
&& server.toLowerCase().indexOf("localhost") == -1
|
||||
&& !server.equals("127.0.0.1");
|
||||
InetAddress appsServer = null;
|
||||
String error = "Not correct: AppsServer = " + server;
|
||||
try
|
||||
{
|
||||
if (pass)
|
||||
appsServer = InetAddress.getByName(server);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
error += " - " + e.getMessage();
|
||||
pass = false;
|
||||
}
|
||||
if (getPanel() != null)
|
||||
signalOK(getPanel().okAppsServer, "ErrorAppsServer",
|
||||
pass, true, error);
|
||||
if (!pass)
|
||||
return error;
|
||||
log.info("OK: AppsServer = " + appsServer);
|
||||
setProperty(ConfigurationData.ADEMPIERE_APPS_SERVER, appsServer.getHostName());
|
||||
setProperty(ConfigurationData.ADEMPIERE_APPS_TYPE, p_data.getAppsServerType());
|
||||
|
||||
// Deployment Dir
|
||||
p_data.setAppsServerDeployDir(getDeployDir());
|
||||
File deploy = new File (p_data.getAppsServerDeployDir());
|
||||
pass = deploy.exists();
|
||||
error = "Not found: " + deploy;
|
||||
if (getPanel() != null)
|
||||
signalOK(getPanel().okDeployDir, "ErrorDeployDir",
|
||||
pass, true, error);
|
||||
if (!pass)
|
||||
return error;
|
||||
setProperty(ConfigurationData.ADEMPIERE_APPS_DEPLOY, p_data.getAppsServerDeployDir());
|
||||
log.info("OK: Deploy Directory = " + deploy);
|
||||
|
||||
// JNP Port
|
||||
int JNPPort = p_data.getAppsServerJNPPort();
|
||||
pass = !p_data.testPort (appsServer, JNPPort, false)
|
||||
&& p_data.testServerPort(JNPPort);
|
||||
error = "Not correct: JNP Port = " + JNPPort;
|
||||
if (getPanel() != null)
|
||||
signalOK(getPanel().okJNPPort, "ErrorJNPPort",
|
||||
pass, true, error);
|
||||
if (!pass)
|
||||
return error;
|
||||
log.info("OK: JNPPort = " + JNPPort);
|
||||
setProperty(ConfigurationData.ADEMPIERE_JNP_PORT, String.valueOf(JNPPort));
|
||||
|
||||
// Web Port
|
||||
int WebPort = p_data.getAppsServerWebPort();
|
||||
pass = !p_data.testPort ("http", appsServer.getHostName(), WebPort, "/")
|
||||
&& p_data.testServerPort(WebPort);
|
||||
error = "Not correct: Web Port = " + WebPort;
|
||||
if (getPanel() != null)
|
||||
signalOK(getPanel().okWebPort, "ErrorWebPort",
|
||||
pass, true, error);
|
||||
if (!pass)
|
||||
return error;
|
||||
log.info("OK: Web Port = " + WebPort);
|
||||
setProperty(ConfigurationData.ADEMPIERE_WEB_PORT, String.valueOf(WebPort));
|
||||
|
||||
// SSL Port
|
||||
int sslPort = p_data.getAppsServerSSLPort();
|
||||
pass = !p_data.testPort ("https", appsServer.getHostName(), sslPort, "/")
|
||||
&& p_data.testServerPort(sslPort);
|
||||
error = "Not correct: SSL Port = " + sslPort;
|
||||
if (getPanel() != null)
|
||||
signalOK(getPanel().okSSLPort, "ErrorWebPort",
|
||||
pass, true, error);
|
||||
if (!pass)
|
||||
return error;
|
||||
log.info("OK: SSL Port = " + sslPort);
|
||||
setProperty(ConfigurationData.ADEMPIERE_SSL_PORT, String.valueOf(sslPort));
|
||||
//
|
||||
return null;
|
||||
} // test
|
||||
|
||||
} // ConfigGlassfish
|
||||
|
|
@ -1026,18 +1026,28 @@ public class ConfigurationData
|
|||
protected static String APPSTYPE_JBOSS = "jboss";
|
||||
/** Tomcat only */
|
||||
protected static String APPSTYPE_TOMCAT = "tomcatOnly";
|
||||
/** GlassFish */
|
||||
protected static String APPSTYPE_GLASSFISH = "GlassFish";
|
||||
/** IBM WS */
|
||||
private static String APPSTYPE_IBM = "<ibmWS>";
|
||||
/** Oracle */
|
||||
private static String APPSTYPE_ORACLE = "<oracleAS>";
|
||||
/** Application Server Type */
|
||||
static String[] APPSTYPE = new String[]
|
||||
{APPSTYPE_JBOSS, APPSTYPE_TOMCAT,
|
||||
APPSTYPE_IBM, APPSTYPE_ORACLE};
|
||||
{ APPSTYPE_JBOSS
|
||||
, APPSTYPE_GLASSFISH
|
||||
, APPSTYPE_TOMCAT
|
||||
, APPSTYPE_IBM
|
||||
, APPSTYPE_ORACLE
|
||||
};
|
||||
/** Database Configs */
|
||||
private Config[] m_appsConfig = new Config[]
|
||||
{new ConfigJBoss(this), new ConfigTomcat(this),
|
||||
null, null};
|
||||
{ new ConfigJBoss(this)
|
||||
, new ConfigGlassfish( this )
|
||||
, new ConfigTomcat(this)
|
||||
, null
|
||||
, null
|
||||
};
|
||||
|
||||
/**
|
||||
* Init Apps Server
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
@version $Id: application.xml,v 1.3 2006/06/12 00:59:05 jjanke Exp $
|
||||
-->
|
||||
<application version="1.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application_1_4.xsd">
|
||||
<display-name>adempiere</display-name>
|
||||
<description>Adempiere Applications</description>
|
||||
<display-name>adempiere</display-name>
|
||||
<module>
|
||||
<java>AdempiereSLib.jar</java>
|
||||
</module>
|
||||
|
|
Loading…
Reference in New Issue