Worklight 6.2 Consumer Edition : Error in deploying worklight applications and adapters - ant

I have build my project through "build-all" Ant Task and I have deployed the war file using the "install" ant task. After Deployment through this I was getting "No Runtime Environment Found" message on the screen. But After removing following JNDI entries in "server.xml" file the browse button appear on the screen:
<jndiEntry jndiName="MyProject/publicWorkLightProtocol" value='http'/>
<jndiEntry jndiName="MyProject/publicWorkLightPort" value='9080'/>
<jndiEntry jndiName="MyProject/ibm.worklight.admin.environmentid" value='WL_UAT_Config1'/>
Following message is also coming above browse button : FWLSE0023E: application 'myProjecy' not found, please redeploy. [project MyProject]
Then I tried to deployed my adapter and application files and Server is giving following errors on console :
[ERROR ] FWLSE0228E: Failed to deploy the application deployable. Reason: null [project MyProject]
[ERROR ] Preparation to deploy 'myProject' failed
java.lang.NullPointerException
[ERROR ] Result: MyProject: WL_UAT_Server///1.2.3.4: ApplicationDeploymentException:java.lang.NullPointerException
[ERROR ] Preparation to deploy adapter '' failed.
Missing xml file
[ERROR ] Result: MyProject: WL_UAT_Server///1.2.3.4: RuntimeException:Missing xml file
However, If I use this "server.xml" file and deploy the war using "deploy-war" ant task. Everything just works fine. Also, if I deploy everything on server through eclipse everything works fine. Let me know if you guys need any more info over this.

The class loader of the project WAR file is not set to parent last
<application context-root="/MyProject" id="MyProject" location="MyProject.war" name="MyProject" type="war">
<classloader commonLibraryRef="worklight-6.2.0">
<privateLibrary>
<fileset dir="${wlp.user.dir}/shared/resources" includes="org.hsqldb.hsqldb_2.2.5.jar"/>
</privateLibrary>
</classloader>
</application>
It should -- see https://www-01.ibm.com/support/knowledgecenter/SSZH4A_6.2.0/com.ibm.worklight.deploy.doc/admin/t_configuring_liberty_profile_manually.html
Ant tasks do install the hsqldb library, which is not listed in the supported software for Worklight http://www-01.ibm.com/support/docview.wss?uid=swg27024838 .... This file was probably crafted manually related to the Worklight Install part.

Related

Custom Ant Task Not Working On Build Server

I've got a custom Ant task that I'm using successfully from gradle on my local machine:
task fetchRelMod {
doLast {
println 'Fetching the RelMod'
ant.taskdef(name:'relmod',
classpath:'retrievePBSInfo.jar:hsjt400-4-9.jar',
classname:"com.myco.ant.tasks.RetrievePBSRelModString")
ant.relmod(user:project.ext.props.getProperty('fetchrelmod.username'),
password:project.ext.props.getProperty('fetchrelmod.password'),
prodCode:project.ext.props.getProperty('profile.pbs.product.code'),
branch:project.ext.props.getProperty('profile.pbs.branch'),
state:project.ext.props.getProperty('profile.pbs.relmod.selector'))
project.ext.set('iseries_relmod',ant.relmodStub)
project.ext.set('iseries_relmodAndDate', ant.relmod)
}
}
I've got the jar files sitting next to build.gradle for now, out of simplicity... they exist in the same location on the build server. Works great locally. When I run my build from my build server (either through Jenkins or going on the box and running Gradle directly), I get the following:
sudo /var/lib/jenkins/tools/hudson.plugins.gradle.GradleInstallation/gradle214/bin/gradle all -DisQUABuild=true
Building My App
Loading Properties files...
QUA Build. Using build-qua.props
:fetchRelMod
Fetching the RelMod
:fetchRelMod FAILED
FAILURE: Build failed with an exception.
* Where:
Build file '/var/lib/jenkins/workspace/MyApp/build.gradle' line: 141
* What went wrong:
Execution failed for task ':fetchRelMod'.
> taskdef class com.myco.ant.tasks.RetrievePBSRelModString cannot be found
using the classloader AntClassLoader[/var/lib/jenkins/workspace/myApp/hsjt400-4-9.jar]
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 3.104 secs
What concerns me is that there are two jar files in the classpath and it only mentions one in the error. Does anyone have any ideas as to what might be going on?

Buld Errors because of weblogic

I have the following code in my build.properties file
### WebLogic ###
bea.home=${tool.home}/bea
# weblogic 8.1: Change weblogic.home
weblogic.home=${bea.home}/weblogic81
#weblogic.home=${bea.home}/weblogic92
#weblogic.home=${bea.home}/wlserver_10.3
weblogic.version=8.1
ejb.spec.version=3.0
But after running the tools.build file it is showing the following error:
BUILD FAILED
t:\DevEnv\3.1RC25\toolsetup.xml:22:
The following error occurred while executing this line:
t:\DevEnv\3.1RC25\toolsetup.xml:184: Property 'weblogic.8.1.root' is not defined.
I have checked and the weblogic is in the folder T:\bea\weblogic81\server\lib
Is this a problem regarding the wrong versions of weblogic as I have weblogic81 on my machine?

Ant deploy to tomcat 7

I have changed my Tomcat Server from version 6 to 7 and now my ant deploy fails.
At first i had my ant build like the following and got a 403 error
<taskdef resource="org/apache/catalina/ant/catalina.tasks" classpathref="x.classpath" />
<target name="tomcatdeploy" depends="tomcatundeploy,war">
<deploy url="http://localhost/manager/html" username="x" password="x" path="/xx" war="file:x.war"/>
</target>
I found several sources on the internet an changed the manager/html to manager/text and added the roles manager-script and admin-script in the tomcat-user file.
The error I am getting now is
java.net.HttpRetryException: cannot retry due to server authentication, in streaming mode
I found that this may be because of the size of the .war file which i deploy which is about 250M, but i didn't find a solution how to deploy it to tomcat 7 from ant.
I finally found a comprehensive post about this Problem:
http://paulgrenyer.blogspot.co.at/2011/11/catalina-ant-for-tomcat-7.html

Phonegap and Blackberry WebWorks: build\StandardInstall does not exist

My environment is Windows XP.
JDK and Apache ant are installed.
Phonegap version is 1.7.0
BlackBerry Webworks SDK for smartphone: version 2.3.1
I'm following the instruction of http://docs.phonegap.com/en/1.7.0/guide_getting-started_blackberry_index.md.html#Getting%20Started%20with%20Blackberry to try phonegap on blackberry.
The sample Blackberry WebWorks sample application I use is this https://github.com/phonegap/phonegap/tree/master/lib/blackberry/sample
First I execute 'ant blackberry build'. Although it said "BUILD SUCCESSFUL", however, neither StandardInstall nor .cod was created. And the output contained error message like this:
[exec] E:\Temp\widgetGen.15924526831337325595265.tmp\extension\blackberry\common\util\URLDecoder.java:183: unclosed string literal
[exec] decodingMap.put( "%AC", "? );
[exec] ^
[exec] 100 errors
[exec] Error!: Error: java compiler failed: C:\Program Files\Java\jdk1.6.0_32\bin\javac.exe #E:\TEMP\rapc_02802fef.dir\options
[exec] [ERROR] RAPC exception occurred
The full build log is here http://www.cis.nctu.edu.tw/~gis90571/a.txt
Then I execute 'ant blackberry load-simulator', it shows:
...
BUILD FAILED
D:\WebWorks_projects\helloworld\build.xml:33: The following error occurred while
executing this line:
D:\WebWorks_projects\helloworld\blackberry.xml:123: D:\WebWorks_projects\hellowo
rld\build\StandardInstall does not exist.
the content of blackberry.xml is:
123: <copy todir="${simulator.dir}">
124: <fileset dir="${build.dir}/StandardInstall" includes="*.cod, *.cso, *.csl, *.alx" />
125: </copy>
(I put the sample app provided by phonegap in D:\WebWorks_projects and changed its name to "helloworld".)
I'm new to ant and blackberry.
Could someone please offer some help or hint? Thanks.
Answer:
It seems that the source file URLDecoder.java in \ext\common\blackberry\common\util is broken due to some encoding issue. Fix it and the problem solved.
An useful article here: http://whatdrewknows.blogspot.com/2012/04/cordova-blackberry-development-part-2.html
Your application is not successfully getting built.
If your application gets build and generate 3 folders
OTAInstall
StandardInstall
widget
As well as one application.zip file is also created.
If you get all these files then your application was successfully compiled and built.

ftp task hangs with ant

I'm trying to pull out the file through ftp within ant, it get hung with after printing "getting files", so I enabled debug in ant and my output is
[root#LODIVM11SE001 net]# ant -d -f ftp_t.xml
Apache Ant version 1.6.5 compiled on June 2 2005
Buildfile: ftp_t.xml
Adding reference: ant.PropertyHelper
Detected Java version: 1.5 in: /root/jdk1.6.0_10/jre
Detected OS: Linux
Adding reference: ant.ComponentHelper
Setting ro project property: ant.version -> Apache Ant version 1.6.5 compiled on June 2 2005
Setting ro project property: ant.file -> /Test_Framework/tasks/net/ftp_t.xml
Adding reference: ant.projectHelper
Adding reference: ant.parsing.context
Adding reference: ant.targets
parsing buildfile /Test_Framework/tasks/net/ftp_t.xml with URI = file:///Test_Framework/tasks/net/ftp_t.xml
Setting ro project property: ant.project.name -> FTP simple interface - ftp.xml
Adding reference: FTP simple interface - ftp.xml
Setting ro project property: ant.file.FTP simple interface - ftp.xml -> /Test_Framework/tasks/net/ftp_t.xml
Project base dir set to: /Test_Framework/tasks/net
+Target:
+Target: ftpget
Setting project property: ftpServerName -> xxxxx
Setting project property: ftpUser -> xxxxx
Setting project property: ftpPassword -> xxxx
Setting project property: ftpRemoteDir -> /test
Setting project property: ftpRemoteFile -> ReadMe.txt
Setting project property: ftpLocalDir -> /local/test
Attempting to create object of type org.apache.tools.ant.helper.DefaultExecutor
Adding reference: ant.executor
Build sequence for target(s) `ftpget' is [ftpget]
Complete build sequence is [ftpget, ]
ftpget:
[echo] FTP getting 'ReadMe.txt' from '/test' to '/local/test'
[ftp] Opening FTP connection to xxxxx
[ftp] connected
[ftp] logging in to FTP server
[ftp] login succeeded
[ftp] changing the remote directory
[ftp] getting files
Could not load a dependent class (com/sun/media/jai/codec/FileSeekableStream) for type image
Could not load a dependent class (com/jcraft/jsch/UserInfo) for type sshexec
Could not load a dependent class (com/jcraft/jsch/UserInfo) for type scp
Could not load a dependent class (jdepend/xmlui/JDepend) for type jdepend
Could not load a dependent class (junit/framework/Test) for type junit
fileset: Setup scanner in dir /local/test with patternSet{ includes: [ReadMe.txt] excludes: [] }
My code
<target name="ftpget" description="Get file over FTP">
<fail message="Build Abrted! Failed to find property:ftpRemoteFile" unless="ftpRemoteFile"/>
<fail message="Build Abrted! Failed to find property:ftpLocalDir" unless="ftpLocalDir"/>
<echo message="FTP getting '${ftpRemoteFile}' from '${ftpRemoteDir}' to '${ftpLocalDir}'"/>
<ftp action="get"
server="${ftpServerName}"
userid="${ftpUser}"
password="${ftpPassword}"
verbose="true"
remotedir="${ftpRemoteDir}"
skipFailedTransfers="true">
<fileset dir="${ftpLocalDir}">
<include name="${ftpRemoteFile}"/>
</fileset>
</ftp>
Note: Normal ftp is working fine. I'm using Linux 64bit, ant 1.6.5 and java 1.6.10
Looks like everything works fine until you actually try and retrieve the data. FTP uses two channels; one for control and one for data. This works out fine until a firewall denies the data connection. Passive mode attempts to work around this. Does your FTP library work have a 'passive mode', or 'PASV' option?
Ant FTP task has require dependencies, Libraries that must be on classpath for it to function properly. See link below,
http://ant.apache.org/manual/install.html#commons-net
To use the FTP task, you need jakarta-oro 2.0.8 or later, and commons-net

Resources