I need a little help in updating the context root for my war in my Websphere 8.5 appserver. I have a war file called DefaultApplication.war and during manual deployment through websphere console, iam able to set the context-root. Now i ahve requirment of automating the current flow and i choosed to write ant script to install the war file. Below is the code
<target name="installEAR" depends="uninstallEAR">
<fail unless="wasHome.dir">The property "wasHome.dir" must be specified.
</fail>
<fail unless="appName">The property "appName" must be specified.</fail>
<fail unless="deployEar">The property "deployEar" must be specified.</fail>
<echo message="Deployable EAR File found at: ${deployEar}" />
<wsInstallApp ear="${deployEar}"
options="-appname ${appName} -cell ${was.cell} -node ${was.node} -usedefaultbindings"
wasHome="${wasHome.dir}"
conntype="${connType}"
port="${port}"
host="${hostName}"
user="${userId}"
password="${password}"
failonerror="true" />
</target>
As mentioned in above code, iam setting -usedefaultbindings to use and i have ibm-web-ext.xml file in WEB-INF folder of war file.
Context of ibm-web-ext.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-ext
xmlns="http://websphere.ibm.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://websphere.ibm.com/xml/ns/javaee
http://websphere.ibm.com/xml/ns/javaee/ibm-web-ext_1_1.xsd"
version="1.1">
<context-root uri="test"/>
</web-ext>
After deployment my apllication is getting started but unable to access it through /test context path. please help me on this.
Thanks in advance.
You must specify Servlet 3.0 or 3.1 in your web.xml, or ibm-web-ext.xml will not be interpreted. For 2.4, a similar file called ibm-web-ext.xmi is interpreted instead.
Related
We trigger jetty through ant target as below
<target name="jettysh" depends="init">
<exec executable="${JETTY_HOME}/bin/jetty.sh" failonerror="true">
<env key="JAVA_OPTIONS"
value="-server -d64 ${x} ${y} ${z} ${l} -Dsettings.path=${p.path} -Dlog4j.configuration=file:///${dpath}/conf/sample.xml -Djetty.secure.port=${JETTY_SECURE_PORT} -Dapp.dir=${app.dir}"/>
</exec>
</target>
In this we pass -Dlog4j.configuration path in the older log4j 1.X version as we are migrating to newer version we are passing the new configuration -Dlog4j2.configurationFile but the logs are not getting generated .
And also we are not seeing any log files getting generated that means that log configuration itself is not picked
Help is very much appreciated as it is a time bound one.
Jetty Hightide 7.x does not have support for log4j2 at the server level.
Using that ancient EOL version of Jetty, you only have support for log4j2 within your webapps.
That means you have to put the log4j2 jars and it's configuration files in your WAR file.
I got an error during the deploying my web-application.
The title of error is Could not open Source file: Could not find a part of the path
'Could not open Source file: Could not find a part of the path
'E:\ARCHIVES\Projects\Main\Jahan.Handicraft\Jahan.Handicraft.Web.Mvc.UmbracoCms.App\obj\Release\AspnetCompileMerge\TempBuildDir\App_Plugins\UmbracoForms\Data\Web.config;\App_Plugins\UmbracoForms\Data\Web.config'.'.
I've used Umbraco 7.4.3 und ASP.NET MVC in my project.
I'd like deploy it on localhost.
How can I solve this problem?
This is a failed attempt at transforming connection strings in sublevel configurations files.
To disable this transformation, edit the publish profile under Properties\PublishProfiles and set the value of the AutoParameterizationWebConfigConnectionStrings element to false. Add the element if missing.
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!--
...
Other settings
...
-->
<AutoParameterizationWebConfigConnectionStrings>false</AutoParameterizationWebConfigConnectionStrings>
</PropertyGroup>
</Project>
I got it from this blog (which is not mine): http://blog.aabech.no/archive/web-deploy-says-could-not-open-source-file-some-webconfig-when-you-publish-an-umbraco-site/
Post installation
You should note that the Umbraco nuget package adds a build step to always include the Umbraco folders when you deploy using Web One-Click Publish with Visual Studio.
You can see these folders in packages/UmbracoCms x.y.z/build/UmbracoCms.targets
Should you need to exclude any of these folders or content, you can add a target to your .pubxml files in the properties/Publish folder. For instance if you need to exclude json data a plugin generates during production.
<Target Name="StopUmbracoFromPublishingAppPlugins" AfterTargets="AddUmbracoFilesToOutput">
<ItemGroup>
<FilesForPackagingFromProject Remove=".\App_Plugins\UmbracoForms\Data\**\*.*"/>
</ItemGroup>
</Target>
Reference: https://our.umbraco.org/documentation/Getting-Started/Setup/Install/install-umbraco-with-nuget#post-installation
Problem:
We have a Websphere EAR project. Under it are two web modules. These two web modules make use of the same shared session context. This in enabled by setting in it the ibm-application-ext.xml file of the ear project.
I know how to create an ant build script to create an .ear file. The thing is, I do not know how to include ibm-application-ext.xml in the ant script to have it included in the .ear file . How do I do that?
If the application.xml file is included through the ff. syntax below, how to I include ibm-application-ext.xml.
<ear destfile="somearfile.ear" appxml="conf/application.xml">
If it's stored in conf/application.xml, then something like this:
<ear destfile="somearfile.ear" appxml="conf/application.xml">
<zipfileset dir="conf" includes="ibm-application-ext.xml" prefix="META-INF"/>
</ear>
...or just:
<jar destfile="somearfile.ear">
<zipfileset dir="conf" includes="*.xml" prefix="META-INF"/>
</jar>
Just trying to run ANT script with in IBM RAD\RSA 8 to deploy to websphere .
It works fine when run from command prompt using WS_ANT.bat but inside RAD fails with following error
Unable to determine WAS Home directory. Please use the wasHome task attribute or set the was.root System property.
Following is basic ANT script copied from SO and Modified again runs fine from WS_ANT but not from RAD
<?xml version="1.0"?>
<projectname="project"default="wasListApps"basedir=".">
<description>
Script for listing installed apps.
Example run from:
/opt/IBM/SDP70/runtimes/base_v61/profiles/AppSrv01/bin
</description>
<propertyname="was_home"location="C:\Program Files\ibm\SDP80\runtimes\base_v7"/>
<pathid="was.runtime">
<filesetdir="${was_home}/lib">
<includename="**/*.jar"/>
</fileset>
<filesetdir="${was_home}/plugins">
<includename="**/*.jar"/>
</fileset>
</path>
<propertyname="was_cp"value="${toString:was.runtime}">
</property>
<propertyname="was_server"value="server1"/>
<propertyenvironment="env">
</property>
<targetname="wsStopServer">
<taskdefname="wsStopServer"classname="com.ibm.websphere.ant.tasks.StopServer"classpath="${was_cp}">
</taskdef>
<wsStopServerserver="${was_server}"failonerror="false"/>
</target>
<targetname="wsStartServer" depends="wsStopServer">
<taskdefname="wsStartServer"classname="com.ibm.websphere.ant.tasks.StartServer"classpath="${was_cp}">
</taskdef>
<wsStartServerserver="${was_server}"failonerror="true"/>
</target>
<targetname="wasListApps"depends="wsStartServer">
<taskdefname="wsListApp"classname="com.ibm.websphere.ant.tasks.ListApplications"classpath="${was_cp}">
</taskdef>
<wsListAppwasHome="${was_home}"/>
</target>
</project>
If you look at the ws_ant.bat file you will find it calls the setupCmdLine.bat first thing to, you guessed it, setup the command line. That file tries to determine the WAS_HOME environment variable by setting it to the parent directory.
SET CUR_DIR=%cd%
cd /d "%~dp0.."
SET WAS_HOME=%cd%
cd /d "%CUR_DIR%"
This is fine when you run from the command line. You are usually in the ~/SDP/runtimes/base_v7/bin (or other server version) directory. The parent is where you want to be.
I would look into setting the working directory when you run the ws_ant.bat script. That is probably the most likely cause.
I have been having trouble deploying liferay portlets and themes from the command line with ant deploy;
sample execution:
pwd: C:\liferay-plugins-sdk\themes
create.bat deep-blue "Deep Blue"
cd deep-blue-theme
ant deploy
-> Buildfile: C:\liferay-plugins-sdk\themes\deep-blue-theme\build.xml
-> compile:
-> BUILD FAILED
-> C:\liferay-plugins-stk\themes\build-common-theme.xml:172: C:\liferay-plugins-sdk\themes\deep-blue-theme\liferay-portal-6.0.6 omcat-6.0.29webappsROOT\html\themes_unstyled does not exist.
the problem appears to be with the bold section and how the path is obviously incorrect; where is this directory being set?
edit:
the problem was my app.server.dir in build.{username}.properties
The error is a result of the ant build not being able to find a Liferay installation (which contains items needed by the SDK).
By default, the build properties in the SDK are set up on the assumption that your setup looks like this:
- Your Development Directory
- bundles
- data
- deploy
- license
- tomcat-6.0.29
- liferay-plugins-sdk
Where bundles contains a Liferay bundle distribution, including the bundled Tomcat server.
You can see this setup in the build.properties file at the root level of your SDK.
#
# Specify the paths to an unzipped Tomcat bundle.
#
app.server.type=tomcat
app.server.dir=${project.dir}/../bundles/tomcat-6.0.29
app.server.deploy.dir=${app.server.dir}/webapps
app.server.lib.global.dir=${app.server.dir}/lib/ext
app.server.portal.dir=${app.server.dir}/webapps/ROOT
The recommended way to change this is not to edit this section of build.properties, but to create overriding entries in a new file, called build.username.properties. (where username is your user name on your computer account).
As you say in the comment to kirkz's answer, you have already set your build.connor.properties: You obviously have used backslash in there. Here \t is short for the tab character. This explains what you see: ...liferay-portal-6.0.6 omcat... (there's a tab between 6.0.6 and omcat)
Do only use forward-slash in properties files (when you refer to file names, no matter if you're on windows or on any other platforms)
I think to solve this issue just for now. To check weather you are getting unsuccessful build or not you can try this solution:
I have just used the static liferay path in this solution.
<elseif>
<equals arg1="${theme.parent}" arg2="classic" />
<then>
<copy todir="docroot" overwrite="true">
<fileset
dir="C:/Liferay/liferay-portal-6.2-ce-ga2/tomcat-7.0.42/webapps/ROOT/html/themes/classic"
excludes="_diffs/**,templates/**"
/>
</copy>
<copy todir="docroot/templates" overwrite="true">
<fileset
dir="C:/Liferay/liferay-portal-6.2-ce-ga2/tomcat-7.0.42/webapps/ROOT/html/themes/classic/templates"
includes="*.${theme.type}"
/>
</copy>
</then>
</elseif>
After setting up this code in your build-common-theme.xml file you will NOT get omcat-6.0.29webappsROOT\html\themes_unstyled error at least.