Saxon stops working after installing batik-rasterizer - ant

Could someone please help me with the following problem?
Yesterday I was trying to add a process to my ANT script (Windows XP, ANT version 1.8.2, mostly XSLT 2.0, Saxon 9 simply added to my ant/lib) whereby it converts a directory of SVGs to PDFs using Batik's rasterizertask. Initially I had a lot of trouble getting ANT to recognize the rasterizertask but after reinstalling Batik from source and with the help of the following link I was able to get it to work.
https://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/200605.mbox/%3C445B43B9.4010403#harcotechnology.com%3E
Though these instructions did not state to do so, I found I needed to recompile/rebuild the rasterizertask.jar.
As a side note, I had also already added the path to the batik-rasterizer.jar and rasterizertask classes to my CLASSPATH as recommended on the official Batik site.
And voila, I had the rasterizer task working. Alas, all my XSLT 2.0 tasks that followed the rasterizertask in my ANT script stopped working. From what I could tell, something I had done caused the default XSLT processor to be changed to Xalan-j. And Xalan does not support much of my XSLT.
For example, this is the error I get from Xalan (I know why I am getting this error, which is why I use Saxon):
[xslt] Processing D:\workDirs\PLMXML2HeirarchalXML\source\plmxml.xml to D:\workDirs\PLMXML2HeirarchalXML\target\step1.xml
[xslt] Loading stylesheet D:\workDirs\PLMXML2HeirarchalXML\stylesheets\step1.xsl
[xslt] D:\workDirs\PLMXML2HeirarchalXML\stylesheets\step1.xsl:10:16: Warning! Created using: Apache Software Foundation, http://xml.apache.org/xalan-j
[xslt] D:\workDirs\PLMXML2HeirarchalXML\stylesheets\step1.xsl:10:16: Warning! Created using: Apache Software Foundation, http://xml.apache.org/xalan-j
[xslt] Processing D:\workDirs\PLMXML2HeirarchalXML\target\step1.xml to D:\workDirs\PLMXML2HeirarchalXML\target\step2.xml
[xslt] Loading stylesheet D:\workDirs\PLMXML2HeirarchalXML\stylesheets\step2.xsl
[xslt] D:\workDirs\PLMXML2HeirarchalXML\stylesheets\step2.xsl:134:53: Fatal Error! java.lang.ClassCastException: org.apache.xpath.objects.XRTreeFrag cannot be cast to org.apache.xpath.objects.XNodeSet Cause: java.lang.ClassCastException: org.apache.xpath.objects.XRTreeFrag cannot be cast to org.apache.xpath.objects.XNodeSet
[xslt] Failed to process D:\workDirs\PLMXML2HeirarchalXML\target\step1.xml
BUILD FAILED
D:\workDirs\PLMXML2HeirarchalXML\build.xml:5: Fatal error during transformation
And all methods I have found and tried to force ANT to use Saxon (ie. adding Saxon to CLASSPATH, xslt/factory) seem to result in Saxon being called rather than Xalan but now I get the following error:
java.lang.NullPointerException
at org.apache.xerces.parsers.AbstractSAXParser.setContentHandler(Unknown Source)
at net.sf.saxon.Configuration.reuseStyleParser(Configuration.java:2346)
at net.sf.saxon.PreparedStylesheet.loadStylesheetModule(PreparedStylesheet.java:261)
at net.sf.saxon.PreparedStylesheet.prepare(PreparedStylesheet.java:185)
at net.sf.saxon.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:132)
at org.apache.tools.ant.taskdefs.optional.TraXLiaison.readTemplates(TraXLiaison.java:300)
at org.apache.tools.ant.taskdefs.optional.TraXLiaison.createTransformer(TraXLiaison.java:317)
at org.apache.tools.ant.taskdefs.optional.TraXLiaison.transform(TraXLiaison.java:178)
at org.apache.tools.ant.taskdefs.XSLTProcess.process(XSLTProcess.java:853)
at org.apache.tools.ant.taskdefs.XSLTProcess.execute(XSLTProcess.java:389)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:392)
at org.apache.tools.ant.Target.performTasks(Target.java:413)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.Main.runBuild(Main.java:811)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
So if I let Xalan do the processing, the rasterizer task still works, but my previously working XSLT does not, and if I use Saxon nothing works. I tried installing ANT 1.8.4, but I get the same results.
I have exhausted all of the resources I have found, including similar posts on this site, but all solutions seem to point to things I have already tried.
Hopefully this is enough information for someone to give me some advice or assistance.
Thanks,
Keith

There's a long history here of different problems in different Ant releases. (As a result, I for one have a lot of legacy Ant code using to call Saxon via the command line interface.) But I believe that with recent Ant releases, the trax factory mechanism works properly. Are you using
<xslt...>
<factory name="net.sf.saxon.TransformerFactoryImpl"/>
</xslt>
?
Trying to control which XSLT processor is used via the classpath is intrinsically failure-prone. That applies to any application, not just to Ant. And I think there are still bugs in the way Ant manipulates the classpath - or at any rate, to be more polite, behaviours that are not apparent from the documentation.

Related

HTML Publisher plugin failed to extract (only when Serenity tests fail)

I am using Serenity BDD for my automation test framework and now I wish to publish the the results onto Jenkins using the HTML Publisher plugin.
When all my tests pass, no problem, I can publish the report with no issues, but if 1 single test fails, I get an error during the publishing stage from the HTML Publisher plugin. The error I receive is due to "truncated TAR archive". Not really sure what this means. Looking deeper at the error, I can see:
Caused by: java.io.IOException: Entry 'pagesource11965942031956863624.html' closed at '0' before the '106438' bytes specified in the header were written, but I also don't know what this means.
Here is the full error (with some directory partly hidden):
java.io.IOException: Failed to extract /home/jenkins/agent/workspace/*<someJenkinsDirs>*/target/site/serenity/**/*
at hudson.FilePath.readFromTar(FilePath.java:2982)
at hudson.FilePath.copyRecursiveTo(FilePath.java:2742)
at hudson.FilePath.copyRecursiveTo(FilePath.java:2706)
at hudson.FilePath.copyRecursiveTo(FilePath.java:2694)
at hudson.FilePath.copyRecursiveTo(FilePath.java:2677)
at htmlpublisher.HtmlPublisher.publishReports(HtmlPublisher.java:242)
at htmlpublisher.workflow.PublishHTMLStepExecution.run(PublishHTMLStepExecution.java:62)
at htmlpublisher.workflow.PublishHTMLStepExecution.run(PublishHTMLStepExecution.java:44)
at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
Suppressed: java.util.concurrent.ExecutionException: java.io.IOException: Entry 'pagesource11965942031956863624.html' closed at '0' before the '106438' bytes specified in the header were written
at hudson.remoting.Channel$2.adapt(Channel.java:1036)
at hudson.remoting.Channel$2.adapt(Channel.java:1030)
at hudson.remoting.FutureAdapter.get(FutureAdapter.java:66)
at hudson.FilePath.copyRecursiveTo(FilePath.java:2745)
... 12 more
Caused by: java.io.IOException: Entry 'pagesource11965942031956863624.html' closed at '0' before the '106438' bytes specified in the header were written
at org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.closeArchiveEntry(TarArchiveOutputStream.java:429)
at hudson.util.io.TarArchiver.visit(TarArchiver.java:117)
at hudson.util.DirScanner.scanSingle(DirScanner.java:51)
at hudson.util.DirScanner$Glob.scan(DirScanner.java:146)
at hudson.FilePath.writeToTar(FilePath.java:2943)
at hudson.FilePath$CopyRecursiveRemoteToLocal.invoke(FilePath.java:2908)
at hudson.FilePath$CopyRecursiveRemoteToLocal.invoke(FilePath.java:2893)
at hudson.FilePath$FileCallableWrapper.call(FilePath.java:3492)
at hudson.remoting.UserRequest.perform(UserRequest.java:211)
at hudson.remoting.UserRequest.perform(UserRequest.java:54)
at hudson.remoting.Request$2.run(Request.java:376)
at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:121)
at java.base/java.lang.Thread.run(Unknown Source)
Suppressed: java.io.IOException: This archive contains unclosed entries.
at org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.finish(TarArchiveOutputStream.java:291)
at org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.close(TarArchiveOutputStream.java:309)
at hudson.util.io.TarArchiver.close(TarArchiver.java:124)
at hudson.FilePath.writeToTar(FilePath.java:2942)
... 12 more
Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from 61.0.33.251/61.0.33.251:52128
at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1784)
at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356)
at hudson.remoting.Channel$2.adapt(Channel.java:1034)
at hudson.remoting.Channel$2.adapt(Channel.java:1030)
at hudson.remoting.FutureAdapter.get(FutureAdapter.java:66)
at hudson.FilePath.copyRecursiveTo(FilePath.java:2745)
at hudson.FilePath.copyRecursiveTo(FilePath.java:2706)
at hudson.FilePath.copyRecursiveTo(FilePath.java:2694)
at hudson.FilePath.copyRecursiveTo(FilePath.java:2677)
at htmlpublisher.HtmlPublisher.publishReports(HtmlPublisher.java:242)
at htmlpublisher.workflow.PublishHTMLStepExecution.run(PublishHTMLStepExecution.java:62)
at htmlpublisher.workflow.PublishHTMLStepExecution.run(PublishHTMLStepExecution.java:44)
at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.io.IOException: Truncated TAR archive
at org.apache.commons.compress.archivers.tar.TarArchiveInputStream.read(TarArchiveInputStream.java:743)
at java.base/java.io.InputStream.read(InputStream.java:205)
at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1309)
at org.apache.commons.io.IOUtils.copy(IOUtils.java:978)
at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1282)
at org.apache.commons.io.IOUtils.copy(IOUtils.java:953)
at hudson.util.IOUtils.copy(IOUtils.java:52)
at hudson.FilePath.readFromTar(FilePath.java:2972)
... 13 more
I've also tried using archiveArtefacts but I get the exact same error (guessing they both function in similar ways).
How do I fix this error?
EDIT:
I've done some more digging into this issue and I've found that the pagesource<random20numbers>.html is generated when either a test fails or a test has an error (not sure if there are other situations in which this file in generated). The file itself seems to be the HTML and CSS code for the webpage that Serenity can "see" in the test failure/error (ie, the page being viewed by the Selenium webdriver when the test fails).
I've tried deleting the file in my Jenkins pipeline with a simple rm pagesource<numbers> command, but ran into permission issues (will speak to people on team to resolve this) and I've also tried to use the includes parameter for the HTML publisher plugin. The Glob expression I have tried is **/!(pagesource)* but this then causes me to get the error:
ERROR: Directory '<someJenkinsDirs>/target/site/serenity' exists but failed copying to '<someJenkinsDirs>/builds/29/htmlreports/Serenity_20Report'.
I've managed to find 1 solution to this problem, it's not quite what I wanted, but it'll until I find or am shown another way.
Serenity takes screenshots during the test and this functionality can be customised in the serenity.properties file. The options available are:
FOR_EACH_ACTION
BEFORE_AND_AFTER_EACH_STEP
AFTER_EACH_STEP
FOR_FAILURES
DISABLED
I simply disabled the screenshot functionality and the pagesource<numbers>.html is no longer generated. More about managing Serenity screenshots here
I believe the pagesource.html file is generated so that a tester can debug why the test is failing or erroring out. Disabling screenshots means that the following page isn't available in the Serenity report, meaning that there is no need to generate the pagesource.html file (the HTML source button links to the pagesource.html file).
If anyone finds a better solution to this problem that doesn't involve disabling screenshots, please post it, as I'd prefer to have screenshots enabled so that it is easier for our BA's to see the user journey.
For others, that might be Googling and find a similar stack trace. We had that cryptic stack trace, because Windows Defender removed file while copying. The fix was, that we had to disable "Real-time protection".

Error while migrating data from Neo4j to OrientDb

I'm getting the following error while importing the data from Neo4j.
OrientDb server is not running as per the documentation.
[cloud_user#xxxxxxx bin]$ ./orientdb-neo4j-importer.sh -neo4jlibdir ~/neo4j-community-3.4.7/lib/ -neo4jdbdir ~/backup_files/graph.db/
Neo4j to OrientDB Importer v.3.0.10 - Veloce (build eac0654847df662ca03b45a6a5efa5eadd229ca5, branch 3.0.x) - Copyrights (c) 2017 OrientDB LTD
WARNING: 'o' option not found. Defaulting to 'false'.
WARNING: 'i' option not found. Defaulting to 'false'.
WARNING: 'odbdir' option not found. Defaulting to '/opt/orientdb/databases/neo4j_import'.
Please make sure that there are no running servers on:
'/home/cloud_user/backup_files/graph.db' (Neo4j)
and:
'/opt/orientdb/databases/neo4j_import' (OrientDB)
Initializing Neo4j...Done
Initializing OrientDB...Exception in thread "main" java.lang.NoClassDefFoundError: com/tinkerpop/blueprints/impls/orient/OrientGraphFactory
at com.orientechnologies.orient.neo4jimporter.ONeo4jImporterInitializer.invoke(ONeo4jImporterInitializer.java:94)
at com.orientechnologies.orient.neo4jimporter.ONeo4jImporter.execute(ONeo4jImporter.java:108)
at com.orientechnologies.orient.neo4jimporter.ONeo4jImporterMain.main(ONeo4jImporterMain.java:25)
Caused by: java.lang.ClassNotFoundException: com.tinkerpop.blueprints.impls.orient.OrientGraphFactory
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 3 more
[cloud_user#xxxxxxx bin]$
I struggled for more than 2 hours trying to import data from Neo4j to Orientdb. The documentation is quite sloppy.
You can solve this issue by downloading the jar- orientdb-graphdb-*.jar into lib folder. However, you still might face the other issues of missing classes.
Downloading jars below helped to resolve such issues:
blueprints-core-*.jar
gremlin-groovy-3.3.4.jar
Let me know if you still face class missing issues.
Hope that saves someone's time.
OrientDB does not contain all of the necessary libraries it needs to perform this task by default. Often, you can define submodules to be imported in a pom file, but if you aren't using a Java application, then you need to import these libraries yourself into the lib/ folder of your OrientDB home directory.
To get the importer to work download the following JAR files and move them into the lib/ folder:
- orientdb-graphdb
- Tinkerpop Blueprints Core
- Gremlin Groovy

MobileFirst Server - Application Center Configure Ant Task (configure-appcenter-liberty-mysql.xml) Error

I'm trying to install & configure the application center for MobileFirst Server using the ant task to install. Prior to the install task I was able to use the database task to create necessary tables in the app center database.
I get the error mentioned in the logs below when running
ant -f configure-appcenter-liberty-mysql.xml install
Ref
https://www.ibm.com/support/knowledgecenter/SSHS8R_7.1.0/com.ibm.worklight.installconfig.doc/appcenter/t_ac_deploy_cons_serv_ant_tasks.html?lang=en
Ant Script Output
root#ubuntu:/opt/IBM/MobileFirst_Platform_Server/ApplicationCenter/configuration-samples# sudo ant -v -f configure-appcenter-liberty-mysql-edited.xml install
Apache Ant(TM) version 1.9.3 compiled on April 8 2014
Buildfile: /opt/IBM/MobileFirst_Platform_Server/ApplicationCenter/configuration-samples/configure-appcenter-liberty-mysql-edited.xml
Detected Java version: 1.7 in: /usr/lib/jvm/java-7-openjdk-amd64/jre
Detected OS: Linux
parsing buildfile /opt/IBM/MobileFirst_Platform_Server/ApplicationCenter/configuration-samples/configure-appcenter-liberty-mysql-edited.xml with URI = file:/opt/IBM/MobileFirst_Platform_Server/ApplicationCenter/configuration-samples/configure-appcenter-liberty-mysql-edited.xml
Project base dir set to: /opt/IBM/MobileFirst_Platform_Server/ApplicationCenter/configuration-samples
parsing buildfile jar:file:/usr/share/ant/lib/ant.jar!/org/apache/tools/ant/antlib.xml with URI = jar:file:/usr/share/ant/lib/ant.jar!/org/apache/tools/ant/antlib.xml from a zip file
Build sequence for target(s) `install' is [install]
Complete build sequence is [install, help, minimal-update, databases, uninstall, ]
install:
[installApplicationCenter] Logging output of task <installApplicationCenter> to file /root/.mobilefirst_platform_server/configuration-logs/installApplicationCenter_2016_04_20_22_42_09.log
[installApplicationCenter] Copying /opt/IBM/MobileFirst_Platform_Server/tools/mysql-connector-java-5.1.38/mysql-connector-java-5.1.38-bin.jar to /opt/IBM/WebSphere/Liberty/usr/shared/resources/mysql/mysql-connector-java-5.1.38-bin.jar
[installApplicationCenter] Copying /opt/IBM/MobileFirst_Platform_Server/tools/mysql-connector-java-5.1.38/mysql-connector-java-5.1.38-bin.jar to /opt/IBM/WebSphere/Liberty/usr/shared/resources/mysql/mysql-connector-java-5.1.38-bin.jar
[installApplicationCenter] Copying /opt/IBM/WebSphere/Liberty/usr/servers/simpleServer/server.xml to /opt/IBM/WebSphere/Liberty/usr/servers/simpleServer/server.xml.bak2
[installApplicationCenter] Modifying /opt/IBM/WebSphere/Liberty/usr/servers/simpleServer/server.xml
[installApplicationCenter] Deleting /opt/IBM/WebSphere/Liberty/usr/servers/simpleServer/server.xml.bak2
BUILD FAILED
/opt/IBM/MobileFirst_Platform_Server/ApplicationCenter/configuration-samples/configure-appcenter-liberty-mysql-edited.xml:74: An error occured while reading file /opt/IBM/WebSphere/Liberty/usr/servers/simpleServer/server.xml. Error: null.
at com.ibm.worklight.config.ant.appserver.AppCenterAppServerTask.wasLibertyAugmentConfigFiles(AppCenterAppServerTask.java:654)
at com.ibm.worklight.config.ant.appserver.AppServerTask.configureAppServer(AppServerTask.java:4423)
at com.ibm.worklight.config.ant.appserver.AppServerTask.installItems(AppServerTask.java:4165)
at com.ibm.worklight.config.ant.appserver.AppCenterAppServerTask.installItems(AppCenterAppServerTask.java:1143)
at com.ibm.worklight.config.ant.appserver.AppServerTask.processItems(AppServerTask.java:4114)
at com.ibm.worklight.config.ant.appserver.AppCenterAppServerTask.buildAndProcessItems(AppCenterAppServerTask.java:1088)
at com.ibm.worklight.config.ant.appserver.AppServerTask.setupBuildAndProcessItems(AppServerTask.java:3064)
at com.ibm.worklight.config.ant.appserver.AppServerTask.doExecute(AppServerTask.java:307)
at com.ibm.worklight.config.ant.appserver.InstallApplicationCenterTask.execute(InstallApplicationCenterTask.java:28)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.Target.performTasks(Target.java:456)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
at org.apache.tools.ant.Main.runBuild(Main.java:851)
at org.apache.tools.ant.Main.startAnt(Main.java:235)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: java.lang.NullPointerException
at com.ibm.worklight.config.helper.appserver.WASLibertyAugmentServerXML.addAppCenterApplicationAndDataSourceElements(WASLibertyAugmentServerXML.java:1921)
at com.ibm.worklight.config.helper.appserver.WASLibertyAugmentServerXML.mainInstallApplicationCenter(WASLibertyAugmentServerXML.java:143)
at com.ibm.worklight.config.ant.appserver.AppCenterAppServerTask.wasLibertyAugmentConfigFiles(AppCenterAppServerTask.java:642)
... 25 more
Total time: 7 seconds
Just based on the name of the Ant file you're using, and the pathnames displayed in in the message output you included, it looks like you started from the wrong sample Ant file - in other words, it appears that you are using Liberty Profile as your application server, but you started from the sample Ant file for use with WebSphere Application Server.
Assuming that is in fact the case, you should start with the sample configuration file "configure-appcenter-liberty-mysql.xml" instead.
Also, just as a hint - it appears that even with the file you are using, you modified the sample Ant file provided with MobileFirst Platform Foundation 7.1 "in place" and wrote it back to it's original filename and used it? As mentioned in the documentation link you have in your question, it's actually recommended to make a copy of this file and work with the copy, rather than modifying the one we provide - that way, you'll always have the unmodified samples we provide, in case you want to refer to them, or use them as templates for a different server and/or different configuration.
I think you use Liberty Profile 8.5.5.9. There were some changes concerning the password decoding mechanism in this version that is no more compatible with MobileFirst.
Either you ask the IBM support for the APAR http://www-01.ibm.com/support/docview.wss?crawler=1&uid=swg1PI61386, either you use Liberty 8.5.5.8.

The rule 'OCLint:ivar assignment outside accessors or init' does not exist

I am trying to integrate SonarQube to generate report on my iOS project,
I am using Objective-C Sonar plugin
When i run ./run-sonar.sh
OCLint generates a compile_commands.json file in my root directory.
and after that getting following error
11:24:39.782 INFO - Processing OCLint report /Users/.......app/./sonar-reports/oclint.xml
11:24:39.899 ERROR - Reporting 1073 violations.
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 16.240s
Final Memory: 6M/86M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
org.sonar.runner.impl.RunnerException: Unable to execute Sonar
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
at java.security.AccessController.doPrivileged(Native Method)
at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
at org.sonar.runner.api.Runner.execute(Runner.java:100)
at org.sonar.runner.Main.executeTask(Main.java:70)
at org.sonar.runner.Main.execute(Main.java:59)
at org.sonar.runner.Main.main(Main.java:53)
Caused by: The rule 'OCLint:ivar assignment outside accessors or init' does not exist.
Can any one help me on this issue?
Thanks
AMR
Thnaks
I had a similar error. My sonar server had two objective-c code analyser plugin. The Sonar Plugin for Objective C (free) and SonarSource Objective-C plugin (commercial)
When I removed (uninstalled) one of the plugin from sonar server the error stopped to occur
I had a similar error too with the last version of this plugin which is a fork of the one you used.
I downgrade my OCLint version from 0.11 to 0.10.1 and everything work perfectly.
It seems that the OCLint rules defined in the plugin was different of the OCLint version installed on my server.
I am not sure what version of the objective-c-sonar plugin that you were using.
I solved similar issue before.
Goto ${SONAR_INSTALLATION_FOLDER}/extensions/plugins/, copy the sonar-objective-c-plugin-${version}.jar to somewhere else.
unzip the jar file, and edit below file
org/sonar/plugins/objectivec/profile-oclint.xml
Add the rule you are missing following the layout of the xml file,
may be look similar below
<rule>
<repositoryKey>OCLint</repositoryKey>
<key>ivar assignment outside accessors or init</key>
</rule>
And edit another file org/sonar/plugins/objectivec/rules-oclint.xml
<rule>
<key>ivar assignment outside accessors or init</key>
<name>ivar assignment outside accessors or init</name>
<priority>MAJOR</priority>
<description>ivar assignment outside accessors or init</description>
</rule>
And then using zip to package the files unpacked as the new jar file.
Override the original plugin jar file in ${SONAR_INSTALLATION_FOLDER}/extensions/plugins/, restart the sonar, issue could be gone.
Repeat the step for all similar issues you encountered.

com/ibm/etools/ejbdeploy/EjbDeploy error websphere 7

I got the build working by adding user.install.root and set up the profile value in taskdef,
<taskdef name="wasejbjar" classname="com.ibm.websphere.ant.tasks.WsEjbDeploy" classpath="D:\IBM\WebSphere\AppServer\plugins\com.ibm.ws.runtime.jar;D:\IBM\WebSphere\AppServer\profiles\AppSrv01\;" >
</taskdef>
<wasejbjar inputJar="${build.root.dir}/ejbtemp/${undeployed.ejb.name}-TMP.jar" wasHome="D:\IBM\WebSphere\AppServer\profiles\AppSrv01\" workingDirectory="${build.root.dir}/ejbtemp" outputJar="${build.lib.dir}/${undeployed.ejb.name}.jar" classpathref="all.ejb.path" noValidate="false" noWarnings="false" noInform="true" trace="false" quiet="false"/>
But even now I get the following error as:
[wsejbdeploy] java.lang.NoClassDefFoundError: com/ibm/etools/ejbdeploy/EJBDeploy [wsejbdeploy] Caused by: java.lang.ClassNotFoundException: com.ibm.etools.ejbdeploy.EJBDeploy
Can anybody tell me why this is happening?
Referencing arbitrary JARs from WAS_HOME/plugins is not supported. I believe the supported use of the Ant task is to use the WAS_HOME/bin/ws_ant script. (Unfortunately, it's a quite old version of Ant.)
I found the issue and resolved it. I marked the jar file as _old, which resolved the issue.
The path is as follows, D:\IBM\WebSphere\AppServer\java\lib\ibmorbtools_old.jar.
This is because in one of the forum, i read that the ibmorbtools.jar in Java conflict with websphere.
Thanks for all.

Resources