I am building a Mobile application with Flex 4.11.0 and AIR 4.0. My IDE is Flash Builder 4.7. I wrote a lot of unit tests, some of them using AIR features such as File system access.
I am trying to integrate the project into a CI job on jenkins. I have an ANT script doing the following:
Compiling
Packaging for Android
Packaging for iOS
Generating ASDOC
What I want now is to write an ANT-Task to launch my unit tests and generate a report in XML or HTML which can be parsed by Jenkins afterwards.
I have tried the following:
- Followed the tutorial on http://tutorials.digitalprimates.net/flexunit/Unit-16.html and got the example to work. However, this is a Flash project and not an AIR-Project!
- Read the documentation on https://cwiki.apache.org/confluence/display/FLEX/FlexUnit+Ant+Task, downloaded and built the FlexUnit code from git#github.com:flexunit/flexunit.git to get the FlexUnit4AIRCIListener.swc
- Read a LOT of information on the internet from all over the place, not finding an answer (I did find some hints, but a lot of the information is outdated or references dead links)
What I have so far is the following:
<taskdef resource="flexUnitTasks.tasks" classpath="${basedir}\libs\flexUnitTasks-4.1.0.jar" />
<target name="test" >
<echo>Testing...</echo>
<echo>==========</echo>
<!-- 1. Compile FlexUnit-Application -->
<mxmlc file="${PROJECT.src}\FlexUnit.mxml" output="FlexUnit.swf" >
<load-config filename="D:\tools\sdk\flex\4.11.0_AIR4.0\frameworks\air-config.xml" append="true" />
<source-path path-element="${PROJECT.src}" />
<source-path path-element="${basedir}\test" />
<library-path dir="${PROJECT.libs}" append="true">
<include name="**/*.swc" />
<include name="**/*.ane" />
</library-path>
<library-path dir="D:\tools\sdk\flex\4.11.0_AIR4.0\frameworks\libs\air" append="true">
<include name="airglobal.swc" />
</library-path>
<compiler.verbose-stacktraces>true</compiler.verbose-stacktraces>
<compiler.headless-server>true</compiler.headless-server>
</mxmlc>
<!-- 2. Run the compiled SWF -->
<flexunit swf="FlexUnit.swf"
player="air"
timeout="180000"
toDir="${OUTPUT.root}\flexUnit"
haltonfailure="false"
verbose="true"
localTrusted="true"
/>
<!-- 3. Generate readable JUnit-style reports -->
<junitreport todir="${OUTPUT.root}\flexUnit">
<fileset dir="${OUTPUT.root}\flexUnit">
<include name="TEST-*.xml" />
</fileset>
<report format="frames" todir="${OUTPUT.root}\flexUnit\html" />
</junitreport>
</target>
Here are the relevant parts of my FlexUnit.mxml-Application:
protected function onCreationComplete(event:FlexEvent):void
{
core = new FlexUnitCore();
core.addListener(new AirCIListener());
core.run(currentRunTestSuite());
}
public function currentRunTestSuite():Array
{
var testsToRun:Array = new Array();
testsToRun.push(test.suites.CLXSatelliteTestSuite);
return testsToRun;
}
Step 1. from the ANT-Task works (at least I get the FlexUnit.swf). However, Launching the SWF in the <flexunit>-Task fails:
VerifyError: Error #1014: Class flash.filesystem::File could not be found.
Console output:
[flexunit] Generating default values ...
[flexunit] Using default working dir [D:\workspaces\flex\projects\clx-satellite]
[flexunit] Using the following settings for the test run:
[flexunit] FLEX_HOME: [D:\tools\sdk\flex\4.11.0_AIR4.0]
[flexunit] haltonfailure: [false]
[flexunit] headless: [false]
[flexunit] display: [99]
[flexunit] localTrusted: [true]
[flexunit] player: [flash]
[flexunit] port: [1024]
[flexunit] swf: [D:\workspaces\flex\projects\clx-satellite\FlexUnit.swf]
[flexunit] timeout: [180000ms]
[flexunit] toDir: [D:\workspaces\flex\projects\clx-satellite\deploy\flexUnit]
[flexunit] Setting up server process ...
[flexunit] Starting server ...
[flexunit] Opening server socket on port [1024].
[flexunit] Waiting for client connection ...
[flexunit] OS: [Windows]
[flexunit] Launching player:
[flexunit] Executing 'rundll32' with arguments:
[flexunit] 'url.dll,FileProtocolHandler'
[flexunit] 'D:\workspaces\flex\projects\clx-satellite\FlexUnit.swf'
[flexunit] The ' characters around the executable and arguments are
[flexunit] not part of the command.
[flexunit] Client connected.
[flexunit] Setting inbound buffer size to [262144] bytes.
[flexunit] Receiving data ...
[flexunit] Sending acknowledgement to player to start sending test data ...
[flexunit]
[flexunit] Stopping server ...
[flexunit] End of test data reached, sending acknowledgement to player ...
BUILD FAILED
D:\workspaces\flex\projects\clx-satellite\build.xml:148:
java.util.concurrent.ExecutionException: could not close client/server socket
When I include a single test which does not use the File-Class, the tests work and I get a similar error (ReferenceError: Error #1065: Variable flash.desktop::NativeApplication is not defined.) but at least the tests run through and I get XML-output. Seems to me like FlexUnit is not really compatible with AIR, although I use player=airin the task.
Does anybody of you have a working example of running Unit Tests with FlexUnit for an AIR Application (possibly a mobile application) through ANT?
Never mind, I figured it out myself and blogged about it in my personal blog:
http://www.tiefenauer.info/ci-for-flex-mobile-applications-part-3-performing-unit-tests/
I described a whole CI process there, just in case anyone has the same problem.
There is Apache FlexUnit feature request for this here: Apache FlexUnit: FLEX-35090
Or you can utilize this feature by compiling your own FlexUnit task by using this fork of FlexUnit 4.1: additionalCompilerOptions branch
The formatting supported with the custom FlexUnit Ant Task is as follows:
<flexunit
workingDir="${bin.loc}"
toDir="${report.loc}"
haltonfailure="false"
verbose="true"
localTrusted="true" >
<!-- only supported with custom FlexUnit Ant tasks -->
<additionalCompilerOption option="-define+=MY_CONST::foo,'BAR'" />
</flexunit>
Related
I have an application with the name cat_tiger.war that gets deployed as localhost:8080/cat_tiger but I want to change the context path to localhost:8080/cat/lion/ instead. I've added the META-INF/context.xml file as
<?xml version="1.0" encoding="UTF-8"?>
<Context copyXML="true" docBase="cat_tiger" path="/cat/lion"/>
and the server.xml file to be
<Host name="localhost" appBase="webapps"
copyXML="true" deployXML="true"
unpackWARs="true" autoDeploy="true">
but it still deploys as localhost:8080/cat_tiger/
Any ideas as to what else needs to be changed?
EDIT:
[1] Tomcat 8.5.3
[2]
04-Sep-2018 13:50:41.830 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDescriptor Deployment of configuration descriptor [/opt/tomcat/conf/Catalina/localhost/cat_tiger.xml] has finished in [2,750] ms
...
...
04-Sep-2018 13:50:39.070 WARNING [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDescriptor A docBase [/opt/tomcat/webapps/cat_tiger] inside the host appBase has been specified, and will be ignored
[3] I'm deploying through Netbeans but will have to be deployed in a Docker container eventually.
I don't understand why you are having problems, but I've created the web project using NetBeans 8.2 (File > New Project... > Java Web > Web Application), and successfully changed the context, so perhaps if I give details of my project you can identify where there's a crucial difference.
1 cat_tiger\web\META-INF\context.xml
My file looks identical to yours:
<?xml version="1.0" encoding="UTF-8"?>
<Context copyXML="true" docBase="cat_tiger" path="/cat/lion"/>
[2] Run output
Select the project node, right click and select Run from the popup menu to run on Tomcat 8.5:
ant -f D:\\NB82\\cat_tiger -Dnb.internal.action.name=run -Ddirectory.deployment.supported=true -DforceRedeploy=false -Dnb.wait.for.caches=true -Dbrowser.context=D:\\NB82\\cat_tiger -Duser.properties.file=C:\\Users\\johndoe\\AppData\\Roaming\\NetBeans\\8.2\\build.properties run
init:
deps-module-jar:
deps-ear-jar:
deps-jar:
library-inclusion-in-archive:
library-inclusion-in-manifest:
compile:
compile-jsps:
In-place deployment at D:\NB82\cat_tiger\build\web
Deployment is in progress...
deploy?config=file%3A%2FC%3A%2FUsers%2Fjohndoe%2FAppData%2FLocal%2FTemp%2Fcontext7953615149857268018.xml&path=/cat/lion
OK - Deployed application at context path [/cat/lion]
Start is in progress...
start?path=/cat/lion
OK - Started application at context path [/cat/lion]
run-deploy:
Browsing: http://localhost:8080/cat/lion
run-display-browser:
run:
BUILD SUCCESSFUL (total time: 0 seconds)
Actually, you probably don't need to run the application to see the problem; just select Deploy instead of Run from the popup menu. This is the output I get from Deploy:
ant -f D:\\NB82\\cat_tiger -Dnb.internal.action.name=redeploy -Ddirectory.deployment.supported=true -DforceRedeploy=true -Dnb.wait.for.caches=true -Dbrowser.context=D:\\NB82\\cat_tiger -Duser.properties.file=C:\\Users\\johndoe\\AppData\\Roaming\\NetBeans\\8.2\\build.properties run-deploy
init:
deps-module-jar:
deps-ear-jar:
deps-jar:
library-inclusion-in-archive:
library-inclusion-in-manifest:
compile:
compile-jsps:
Undeploying ...
undeploy?path=/cat_tiger
OK - Undeployed application at context path [/cat_tiger]
In-place deployment at D:\NB82\cat_tiger\build\web
Deployment is in progress...
deploy?config=file%3A%2FC%3A%2FUsers%2Fjohndoe%2FAppData%2FLocal%2FTemp%2Fcontext5063723197082921373.xml&path=/cat/lion
OK - Deployed application at context path [/cat/lion]
Start is in progress...
start?path=/cat/lion
OK - Started application at context path [/cat/lion]
run-deploy:
BUILD SUCCESSFUL (total time: 0 seconds)
[3] Tomcat log
Here are the deployment details in the Tomcat log, where you can see that my deployment shows the context correctly, whereas yours does not:
05-Sep-2018 23:09:09.321 INFO [http-nio-8080-exec-6] org.apache.catalina.startup.HostConfig.deployDescriptor Deploying configuration descriptor [C:\apache-tomcat-8.5.20\conf\Catalina\localhost\cat#lion.xml]
05-Sep-2018 23:09:09.334 INFO [http-nio-8080-exec-6] org.apache.catalina.startup.HostConfig.deployDescriptor Deployment of configuration descriptor [C:\apache-tomcat-8.5.20\conf\Catalina\localhost\cat#lion.xml] has finished in [13] ms
05-Sep-2018 23:09:09.338 INFO [http-nio-8080-exec-5] org.apache.catalina.util.LifecycleBase.start The start() method was called on component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/cat/lion]] after start() had already been called. The second call will be ignored.
[4] C:\apache-tomcat-8.5.20\conf\Catalina\localhost\cat#lion.xml
This is the file Tomcat created when deploying the application:
<?xml version="1.0" encoding="UTF-8"?>
<Context copyXML="true" docBase="D:\NB82\cat_tiger\build\web" path="/cat/lion"/>
Note that docBase contains an absolute path.
[5] server.xml
Here's the entire content. I'm using Tomcat 8.5. Note that the <host> element is slightly different to yours, but when I added copyXML="true" deployXML="true" to the <host> element (so it looked like yours) everything continued to work fine:
<?xml version="1.0" encoding="UTF-8"?>
<Server port="8005" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.startup.VersionLoggerListener"/>
<Listener SSLEngine="on" className="org.apache.catalina.core.AprLifecycleListener"/>
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener"/>
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener"/>
<GlobalNamingResources>
<Resource auth="Container" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" name="UserDatabase" pathname="conf/tomcat-users.xml" type="org.apache.catalina.UserDatabase"/>
</GlobalNamingResources>
<Service name="Catalina">
<Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443" relaxedQueryChars="[]|{}^+\`"<>"/>
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443"/>
<Engine defaultHost="localhost" name="Catalina">
<Realm className="org.apache.catalina.realm.LockOutRealm">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>
</Realm>
<Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true">
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" pattern="%h %l %u %t "%r" %s %b" prefix="localhost_access_log" suffix=".txt"/>
<Context docBase="C:\apache-tomcat-8.5.20\wtpwebapps\PlusServlet" path="/PlusServlet" reloadable="true" source="org.eclipse.jst.jee.server:PlusServlet"/>
</Host>
</Engine>
</Service>
</Server>
Updated 9/6/2018:
Ignore the answer given above! Even though it happened to work for my configuration, the approach is explicitly disallowed in the Tomcat documentation.
Specifically, path should not be specified within the <Context> of a context.xml file placed within the application's META-INF directory. From the path description in the Common Attributes section of the Tomcat 8.5 documentation for the Context Container:
This attribute must only be used when statically defining a Context in
server.xml. In all other circumstances, the path will be inferred from
the filenames used for either the .xml context file or the docBase.
Even when statically defining a Context in server.xml, this attribute
must not be set unless either the docBase is not located under the
Host's appBase or both deployOnStartup and autoDeploy are false. If
this rule is not followed, double deployment is likely to result.
I'm deploying a worklight 6.2 application for iphone (ios 7) environment. I managed to enable Application Authenticity for iphone.
When Application Authenticity feature is enabled, the direct update feature fails. On the iphone, after I tap on "OK" button when receiving new updates, the application download the update for awhile then show: direct update failed (Direct Update Failure).
I all so see this error log in the xcode console:
***014-12-16 19:32:16.487 OnlineBanking[14685:132821] Splash screen image is Default
2014-12-16 19:32:16.487 OnlineBanking[14685:132821] iPhone 5 is detected. Splash image name is: Default-568h
2014-12-16 19:32:18.991 OnlineBanking[14685:133123] [ERROR] [WL_DIRECT_UPDATE] -[WLDirectUpdateDownloader logInvalidUpdateFileData] in WLDirectUpdateDownloader.m:428 :: Invalid update data format: /*-secure-
{"WL-Authentication-Failure":{"wl_authenticityRealm":{"reason":"Invalid gadget request format: \/OnlineBanking\/iphone\/0.1skin=default. Unknown handler path: 0.1"}}}*/QSwcIAAAAAAIAAAAAAAAAUEsDBBQACAgIAIKckEUAAAAAAAAAAAAAAAAgAAAAZGVmYXVsdC9i
b3dlci9hbmd1bGFyL2FuZ3VsYXIuanPMvetaG0fWMPqfq2iI30jCojEkky8jjD3ExgkzPr2GTGZe
zJhGaom2RbfS3TJmbL5n38O+w30le52qalV1S2CPs7+tPMFSnQ+rqtZ5rWyuR39N3ieHwzKb1dGw
yOs0r6NxWVxEZ8VlWm4m+WQ+Tey/8dsqyvJoXExHaQnlLy6KPFrfXNlcX1+J1qO/TLNhmldptMfF
/3oYvd+Kv4t/wMzusBdt39u6twF/vo9+LorJNO1HB/kwjs7rejbYNJ28reKinGCVp9zcIHp2cLSC
/XTH83xYZ0XevczyUXHZj0bFcH4Bg+5H83yUjrM8HfWij505DKKqy2xYd3ZW7PBGaUUzhQbgNyYd
nWdVVJy9TYd1NCuL9xkUiZJoXmfTrL6CiZaYPJoPs3wSQXPn0X5ZQuJFWlXJBMpeZvV5hq2ZOcfR
AaxkkkdnKfwznaajKKlwxabFZTWQbt8nZZR+SC5m0/RZlkOT0W50QV+6HUnv9HawZH1eFpd+2W6n
yNNOP+rQ4D/eu47wn61rSBoXRT86S0qqy/NLo+SseA9jKdOkxsnlsINVneTDNCrG0ituag1FpZ8o
T2CCs2SYxtgCNlSm1Xxa4yqktACX2XQanSfQcOJKjyRzWIyocWkuhvHG0dKWynQ2hQZoNrikNJr3
yXRO7dC0knyEs7TZvI5S4gwXHicrewkrkhc19kVAACOTGebzizMAXaiSlBOCHIBo2jBa7eRdGsv. Restart the application and try again
2014-12-16 19:32:19.020 OnlineBanking[14685:133123] [ERROR] [WL_DIRECT_UPDATE] -[WLDirectUpdateDownloader installUpdate] in WLDirectUpdateDownloader.m:253 :: Invalid format of file /Users/personifyvietnam/Library/Developer/CoreSimulator/Devices/1FBDD906-33B4-431E-A340-68B8BFF8F8FA/data/Containers/Data/Application/5FC1C249-9064-495C-B047-E77713D34F29/Library/tempUpdateFile. Reason is: file length prefix is not found. Reinstall the application and try again.
2014-12-16 19:32:19.030 OnlineBanking[14685:133088] [ERROR] [WL_DIRECT_UPDATE] -[WLDirectUpdatePlugin updateDidFinishWithCommand:status:] in WLDirectUpdatePlugin.m:123 :: Update did finish with error FAILURE_UNKNOWN
2014-12-16 19:32:19.062 OnlineBanking[14685:132821] THREAD WARNING: ['Notification'] took '21.096191' ms. Plugin should use a background thread.
2014-12-16 19:32:19.109 OnlineBanking[14685:132821] [DEBUG] [WL_SPLASH] -[WLSplashView hide] in WLSplashView.m:73 ::***
I config security test in authenticationConfig.xml and deploy file .war file to Worklight Server:
<customSecurityTest name="customTests">
<test realm="wl_antiXSRFRealm" step="1"/>
<test realm="wl_authenticityRealm" step="1"/>
<test realm="wl_remoteDisableRealm" step="1"/>
<test realm="wl_directUpdateRealm" mode="perSession" step="1"/>
<test realm="wl_anonymousUserRealm" isInternalUserID="true" step="1"/>
<test realm="wl_deviceNoProvisioningRealm" isInternalDeviceID="true" step="2"/>
</customSecurityTest>
Then in application-descriptor.xml:
<iphone bundleId="xxxapp.domain.com" version="0.1" applicationId="appId" securityTest="customTests">
<worklightSettings include="false"/>
<security>
<encryptWebResources enabled="false"/>
<testWebResourcesChecksum enabled="false" ignoreFileExtensions="png, jpg, jpeg, gif, mp4, mp3"/>
</security>
</iphone>
What is your Worklight full build number?
I think you should get the latest iFix for Worklight 6.2.0.01 from IBM Fix Central because this same issue "Direct Update not working when authenticity is enabled" was fixed in APAR PI26123.
We have our shared Ivy repository on an nginx web server reachable within our intranet.
I configured a url resolver to read from the shared repository and an ssh resolver to write to it, mostly following Jason Grimes' excellent blog post on managing dependencies in non-Java projects.
Now I just successfully published a module to the repository via the ssh resolver.
In my SFTP client I can see the directory structure and files sitting in the directory served by the web server:
com.organization/modulename/ivy-modulename-2.0.1.xml.md5
com.organization/modulename/ivy-modulename-2.0.1.xml.sha1
com.organization/modulename/ivy-modulename-2.0.1.xml
com.organization/modulename/modulename-2.0.1.zip.md5
com.organization/modulename/modulename-2.0.1.zip.sha1
com.organization/modulename/modulename-2.0.1.zip
However, when I execute ivy:listmodule it doesn't seem to find it. Frankly, it doesn't output anything apart from the ivysettings initialization output.
This is the Ant target I am executing:
<!-- ================================
target: check-already-in-repo
Check if the current version of a module already exists in the (shared) repository.
================================ -->
<target name="check-already-in-repo">
<ivy:listmodules resolver="shared" organisation="${ivy.organisation}" module="${ivy.module}" revision="${version}" property="already-in-repo" value="true"/>
<ac:if>
<isset property="already-in-repo"/>
<then>
<echo>${ivy.module} ${version} already exists in the repository.</echo>
<echo>Skipping publishing of ${ivy.module}.</echo>
</then>
</ac:if>
</target>
And this is the only output:
$ ant check-already-in-repo -Dversion=2.0.1 -Divy.organisation=com.organization -Divy.module=modulename
Buildfile: [...]/build.xml
check-already-in-repo:
[ivy:listmodules] :: Apache Ivy 2.4.0-rc1 - 20140315220245 :: http://ant.apache.org/ivy/ ::
[ivy:listmodules] :: loading settings :: file = [...]/build/ivysettings.xml
BUILD SUCCESSFUL
Total time: 0 seconds
I checked the value of ivy.shared.default.root and the corresponding ivy and artifact patterns and they're all matching (I kept them simple).
I tried it with the glob matcher and called ivy:listmodules with organization=*, module=* and revision=*, so it should in every case return something. Which it doesn't.
What do I miss?
Here's the rest of the relevant config:
<ivysettings>
<!-- This file is referenced from multiple projects - DO NOT EDIT! -->
<!-- shared -->
<property name="ivy.shared.default.root" value="http://10.79.1.30/ivy"/>
<property name="ivy.shared.default.ivy.pattern" value="[organisation]/[module]/ivy-[module]-[revision].[ext]"/>
<property name="ivy.shared.default.artifact.pattern" value="[organisation]/[module]/[artifact]-[revision].[ext]"/>
<!-- local -->
<property name="ivy.local.default.root" value="${ivy.default.ivy.user.dir}/local"/>
<property name="ivy.local.default.ivy.pattern" value="${ivy.shared.default.ivy.pattern}"/>
<property name="ivy.local.default.artifact.pattern" value="${ivy.shared.default.artifact.pattern}"/>
<settings defaultResolver="default"/>
<resolvers>
<filesystem name="local">
<ivy pattern="${ivy.local.default.root}/${ivy.local.default.ivy.pattern}" />
<artifact pattern="${ivy.local.default.root}/${ivy.local.default.artifact.pattern}" />
</filesystem>
<!-- read access -->
<url name="shared">
<ivy pattern="${ivy.shared.default.root}/${ivy.shared.default.ivy.pattern}" />
<artifact pattern="${ivy.shared.default.root}/${ivy.shared.default.artifact.pattern}" />
</url>
<!-- write access -->
<ssh name="ssh" host="10.79.1.30" port="22" user="ivy" userPassword="${ivy.ssh.password}" publishPermissions="0664">
<ivy pattern="${ivy.shared.default.ivy.pattern}" />
<artifact pattern="${ivy.shared.default.artifact.pattern}" />
</ssh>
<chain name="default" returnFirst="true">
<resolver ref="local"/>
<resolver ref="shared"/>
</chain>
</resolvers>
</ivysettings>
After executing the Ant target with the -d (debug) option something caught my eye:
$ ant check-already-in-repo -Dversion=2.0.1 -Divy.organisation=com.organization -Divy.module=modulename -d
[...]
[ivy:listmodules] using shared to list all in http://10.79.1.30/ivy/
[ivy:listmodules] HTTP response status: 403 url=http://10.79.1.30/ivy/
[ivy:listmodules] CLIENT ERROR: Forbidden url=http://10.79.1.30/ivy/
[ivy:listmodules] HTTP response status: 403 url=http://10.79.1.30/ivy/
[ivy:listmodules] CLIENT ERROR: Forbidden url=http://10.79.1.30/ivy/
[ivy:listmodules] problem while listing resources in http://10.79.1.30/ivy/ with shared (java.io.IOException: The HTTP response code for http://10.79.1.30/ivy/ did not indicate a success. See log for more detail.)
[ivy:listmodules] java.io.IOException: The HTTP response code for http://10.79.1.30/ivy/ did not indicate a success. See log for more detail.
[...]
It seems for listmodules to work, the web server needs to have directory listings enabled. And indeed, after adding
location /ivy {
autoindex on;
}
to the nginx config and restarting the web server it finally worked as expected!
$ ant check-already-in-repo -Dversion=2.0.1 -Divy.organisation=com.organization -Divy.module=modulename
Buildfile: [...]/build.xml
check-already-in-repo:
[ivy:listmodules] :: Apache Ivy 2.4.0-rc1 - 20140315220245 :: http://ant.apache.org/ivy/ ::
[ivy:listmodules] :: loading settings :: file = [...]/build/ivysettings.xml
[echo] modulename 2.0.1 already exists in the repository.
[echo] Skipping publishing of modulename.
BUILD SUCCESSFUL
Total time: 0 seconds
Hooray! :-)
I am trying to setup openbravo on eclipse environment with the above URL.
Development stack setup is done successfully. (ANT, Java, Postgresql)
At the openbravo source directory when i apply the command
ant install.source
Build failure due to errors -
/home/pos/sourcecode_openbravo/Openbravo-3.0MP21/build.xml:480: The following error occurred while executing this line:
480 <ant dir="${base.src}" target="compile.complete.development" inheritAll="true" inheritRefs="true" />
/home/pos/sourcecode_openbravo/Openbravo-3.0MP21/src/build.xml:874: The following error occurred while executing this line:
874 <jvmarg line="${env.CATALINA_OPTS}" />
/home/pos/sourcecode_openbravo/Openbravo-3.0MP21/src/build.xml:880: Directory
880 <jvmarg value="-Djava.io.tmpdir=${env.CATALINA_BASE}/temp" />
/var/lib/tomcat6/webapps/openbravo/WEB-INF/lib creation was not successful for an unknown reason
Any help would be appreciated. Thanks.
Sounds like a permission problem.
See the related section 'Permission issues' in openbravo wiki
EDIT
for the remaining issues, i believe the properties base.src, CATALINA_OPTS and CATALINA_BASE are not set properly. Check this via :
<echo>
$${base.src} => ${base.src}
$${env.CATALINA_OPTS} => ${env.CATALINA_OPTS}
$${env.CATALINA_BASE} => ${env.CATALINA_BASE}
</echo>
or simply output all available properties use :
<echoproperties/>
also consider, before using ${env.whatever} you need to use :
<property environment="env"/>
before !
/var/lib/tomcat6/webapps/openbravo/WEB-INF/lib creation was not successful for an unknown reason
Give the permission to webapps folder
sudo chmod -R 777 /var/lib/tomcat6/webapps/
/var/lib/tomcat6/webapps/openbravo/WEB-INF/lib creation was not
successful for an unknown reason
it seem permission problem. It is important to always us the correct user account to start / stop tomcat!
Conceptually there are two user accounts involved in working with Openbravo:
command-line user used to work with files & compile Openbravo
user account used by Apache Tomcat service
There are several overlapping areas in which one of the accounts needs to access and modify files from the other account in both directions.
To avoid any problems Openbravo strongly recommends to run Apache Tomcat services with the same user account which is used on command line. As that way the above topic will be perfectly solved easily.
source: http://wiki.openbravo.com/wiki/Installation/Custom/Apache_Tomcat
This is restart target code which is defined in build.xml
target name="restart"
propertycopy name="remote.host" from="deploy.${target.env}.host.${remote.id}"
propertycopy name="remote.port" from="deploy.${target.env}.port.${remote.id}"
sshexec trust="true"
host="${remote.host}"
port="${remote.port}"
username="${scm.user}"
keyfile="${scm.user.key}"
command="sudo /usr/local/bin/bounce_jboss"
target
server information is defined in build.properties.
The above code is working fine, but the restarting process is very late bcas its stopping-starting server one and later its stopping-starting another server,
Is there a way where i can restart both servers parallely with a time frame of 45 seconds.
Have you investigated the Ant Parallel task? You should be able to parallelise the rebooting fairly simply using this.
e.g.
<parallel>
<!-- first server reboot -->
<ssh ...>
<!-- second server reboot -->
<ssh ...>
</parallel>
The parallel task will work for you. Another example:
<target name="restart" ... >
<parallel>
<!-- first server reboot call -->
<!-- second server reboot call -->
</parallel>
</target>
From command line:
>ant restart
Don't execute "ant restart" twice. Only call it once and your servers should only restart once.